Closed LakeRainSound closed 3 years ago
As the error states, you have NA values in your model matrices. Your model contains 3 variances parameters set to NA, but in your fitSSM call you are only supplying two initial values.
There is actually another related problem here: As said in the documentation of fitSSM
: "Note that the default updatefn function cannot be used with trigonometric seasonal components as its covariance structure is of form σI, i.e. not all NA's correspond to unique value." So you should write your own updatefn
for fitSSM
. Easiest thing is to do it like this:
updatefn <- function(pars, model) {
SSModel(dat_t ~ SSMtrend(degree=1, Q=matrix(exp(pars[1])))
+ SSMseasonal(12, sea.type="trigonometric", Q=matrix(exp(pars[2]))),
H=matrix(exp(pars[3])))
}
Thank you! I've solved it!
I wrote the following source code and ran it, but an error occurred.
error (There's some Japanese in there.)
What is the cause of this error? How can I solve this problem?