Tips and Tricks
- Use
plot(fit)
(or autoplot(fit)
) to see a series of plots and diagnostics for your model.
- Try
MARSSinfo()
if you get errors you don’t understand or fitting is taking a long time to converge.
- When fitting a model with
MARSS()
, pass in silent=2
to see what MARSS()
is doing. This puts it in verbose mode.
- Use
fit=FALSE
to set up a model without fitting. Let’s say you do fit <- MARSS(..., fit=FALSE)
. Now you can do summary(fit$model)
to see what MARSS()
thinks you are trying to fit. You can also try toLatex(fit$model)
to make a LaTeX file and pdf version of your model (saved in the working directory). This loads the Hmisc package (and all its dependencies) and requires that you are able to process LaTeX files (e.g. you have the tinytex package).
- Let’s say you specified your model with some text shortcuts, like
Q="unconstrained"
, but you want the list matrix form for a next step. a <- summary(fit$model)
returns that list (invisibly). Because the model argument of MARSS()
will understand a list of list matrices, you can pass in model=a
to specify the model.
MARSSkfas(fit, return.kfas.model=TRUE)
will return your model in KFAS form (class SSModel), thus you can use all the functions available in the KFAS package on your model.