Clarification on the use of include or terms in fitted_samples() #340
-
I'm unsure as to what the difference is between using include or terms in fitted_samples, as they result in different .fitted values etc (Option 1 vs Option 2 below). An example model :
Generating new data and using fitted samples:
Option 1:
Option 2 - I would have thought option 1 and option 2 would have resulted in similar .fitted values, but they are quite different.
I can also replicate the results of option 2,if I put Could somebody please clarify the difference in using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't know why you think
which is why "there isn't explicit documentation as to what
If all you want is posterior draws from a specific smooth, then you would be better off with As you have already deduced that option 2 with either |
Beta Was this translation helpful? Give feedback.
I don't know why you think
include
is a valid argument topredict.gam()
, because it isn't. There are two arguments that control which arguments are included in the predictions:terms
, andexclude
which is why "there isn't explicit documentation as to what
include
does in the arguments offitted_samples
", although?fitted_samples
does direct you to?predict.gam
(for the...
argument), which would have alerted you to the fact that you had made a mistake.terms
is how you select which terms need to be included in the predictions, whileexclude
is the complement ofterms
and indicates which model terms should not be included in the predictions.If all you want is posterior draws from a spec…