Version 3.11.3
This is a copy of the CRAN 3.11.3. release. This is an update based on version 3.11.2 and 3.11.2-beta (GitHub releases). It is mainly focused on providing graceful exiting for models that report errors due to ill-conditioned variance matrices and for models with fixed parameters. The testing and output (plot
, residuals
, tsSmooth
, fitted
) was made less reliant on MARSSkfss()
, which involves an inversion of Vtt1
and which can become ill-conditioned and report an error. The update also fixes a bug in the log-likelihood calculation due to not specifying the tol=0
in SSModel()
call. This bug would come up only for variance matrices with extremely high condition numbers fit with method=BFGS
. Data and covariates can now be a ts object and the time information will be used for plotting.
ENHANCEMENTS
- Stop all
MARSSkfss()
calls whentrace=-1
.MARSSkfss()
is used for error checks (because it has verbose information to indicate model problems) but because it uses matrix inversions, it will stop models from being fit just because they cannot be run throughMARSSkfss()
even if they run fine withMARSSkfas()
, which doesn't use these matrix inversions. - Allow data, covariates and newdata to be a ts object. model.tsp attribute added to model and marss elements of marssMLE object and this information used for plotting and for
t
column in fitted, residuals and tsSmooth output. - Add
xtt
andVtt
toMARSSkfas()
to avoidMARSSkfss()
calls when unnecessary. - Added graceful exiting for various functions for marssMLE objects without a par element. This occurs when
MARSS()
was run withfit=FALSE
. - Added graceful exiting for
MARSSparamCIs()
when model is fixed and thus no parameters estimated. - Add alert when there are negative values on the diagonal of
VtT
which sometimes happens forMARSSkfas()
. Give user helpful suggestions for switching the Kalman filter/smoother function. - Addition of a KFAS chapter which is mainly a testing chapter. All variants of model and state residuals computed by the KFAS package are compared to the residuals produced by MARSS. Similarly the StructTS chapter is mainly a testing chapter which compares output for StructTS objects to the equivalent output for marssMLE objects. The tests in these chapters are repeated in the tests directory (which is on GitHub).
BUGS
- In
KFS()
, a tolerance correction affected the log-likelihood value when R was below square root of machine tolerance or condition number was very high (if R non-diagonal). This created a large (incorrect) jump in the log-likelihood. This would be reported with a warning that the log-likelihood dropped if using the EM algorithm. Solution was to set the tolerance to 0 in the KFAS model inMARSSkfas()
. Note this did not happen for all cases of small R and a warning would have been generated alerting the user to a problem. MARSSkfas()
did not recognize if H was time-varying.- If model in
MARSS()
call was a marssMLE or marssMODEL object, the tinitx and diffuse elements were not being passed in, only the parameter matrices. - No ACF should be plotted for state smoothation residuals (smoothation residuals are not temporally uncorrelated). Fix applied to
plot.marssMLE()
andautoplot.marssMLE()
. marssMLE$fun.kf
was not always being passed toMARSShatyt()
so it didn't necessarily use the function requested by the user.coef.marssMLE()
did not change what to, say,par.se
iftype
passed in socoef(fit, what="par.lowCI", type="Z")
returnedcoef(fit, type="Z")
.print.marssMLE()
andcoef.marssMLE()
would fail ungracefully if all the parameters were fixed orMARSS()
was run withfit=FALSE
.
DOCUMENTATION
- Minor fixes to the derivations table in EMDerivation.Rnw and added some information on the initial conditions for the Kalman filter in the expectations section. Typo in eqn 29-31. u^T should have been u. Added information on EM algorithm when parameter set is updated by parts.
- Added notation definitions to the Kalman smoother algorithm section for
xtt
andxtt1
etc. - Added information on how to get CIs on rotated loadings to DFA chapter.
- Cleaned up MARSSkf.Rd sections on initial conditions and cleaned up equation formatting so looks better in pdf format.
- Added section on normalization calculations to Residuals.Rnw.
- Cleaned up notation for conditional expectations in the man files.
- Fixed bug in the Covariates chapter which was not showing the B estimates for
kem.plank.4
.
OTHER
- If
tinitx=1
, thenVtt1T[,,1]
does not exist. ReplacedVtt1T[,,1]
with NA instead of 0 in this case. NoteVtt1T[,,1]
would never be used in this case asV10T
is used instead however a value of 0 is not correct. The value is does not exist so NA is the correct value.