arrays - `KFAS`: how to fit time-varying variance in `regSSM` function -
please, consider following example kfas package:
install.packages('kfas') require(kfas) # drivers model <- structssm(y = log(seatbelts[,"drivers"]), trend = "level", seasonal = "time", x = cbind(log(seatbelts[,"kms"]), log(seatbelts[,"petrolprice"]), seatbelts[,c("law")])) fit <- fitssm(inits = rep(-1,3), model = model) out <- kfs(fit$model, smoothing = "state") str(out) you can see out$model$h single value, model not time-varying in variance of disturbance terms.
see arguments of regssm typing:
?regssm regssm says can make h argument time-varying:
...
h p * p covariance matrix (or p * p * n array in of time-varying case) of disturbance terms epsilon[ t ] of observation equation. default gives p * p 0 matrix.
...
could show me how may fit time-varying covariance state-space model using regssm , fitssm functions?
the best me if use same example above.
Comments
Post a Comment