Releases: atsa-es/MARSS
MARSS 3.11.9 (CRAN 2024-02-19)
MARSS 3.11.7 (GitHub); MARSS 3.11.8 (CRAN)
Note: See also notes from 3.11.6.
This release is focused on moving the MARSS User Guide and derivation files into a inst/userguide
and inst/derivations
along with Makefiles to build. This will facilitate updating MARSS and converting the User Guide to an eBook.
- Added pkgdown. Note this required special files for MathJax in the
pkgdown
folder. - Removed packages in
Suggests:
that were associated with the User Guide and tests and not used in examples. - Converted
Quick_Start.Rnw
to Rmd so it works better with pkgdown and renders to html for CRAN. - Updated DESCRIPTION and README to refer to marssTMB.
- Added marssTMB to Suggests with
Additional_repositories: https://atsa-es.r-universe.dev
BUGS
- In
predict_marssMLE()
, the newdata model.tsp was not being set. - In
plot.marssMLE()
, the CIs for the state residuals did not plot correctly because there is always a NA at the end. - In `autoplot.marssMLE(), two plots would always be plotted if one plot type was specified.
DOCUMENTATION
- Added
vignettes/Learning_MARSS.Rmd
- Fixed various equation formatting typos (unbolded x's and x's that should have been X's in expectations).
- Added
MARSS.dfa()
to the manual built by CRAN by removing keyword internal. - Added
inst/DEVELOPER_NOTES.md
- Minor change to make the v and w in
EMDerivation.Rnw
in slant font as they are random variables.
MARSS 3.11.6 (GitHub)
This release is focused on adding new method method="TMB"
which uses the package {marssTMB}.
- Added methods "TMB", "BFGS_TMB" and "nlminb_TMB" and changed
MARSS()
to recognize these. - Added the generic function
MARSSfit()
and methods for "kem" and "BFGS". - Added the defaults to
R/onLoad.R
and made it easier to specify new methods and constraints on methods - Made changes to
checkMARSSinputs.R
,is_marssMLE.R
andis.validvarcov()
so they are not so specific tomethod="BFGS"
but work for any methods with similar constraints. - Export MARSSvectorizeparam(). Need when writing methods for MARSSfit() generic.
- Added {generics} as a dependency and removed {forecast} and {broom} from Suggests. Cleaned up examples and text throughout to remove references to these packages.
BUGS
- The iterations count for
optim()
was using number of function calls not number of gradient calls.
OTHER
- Allow
toLatex()
to output the raw tex so that it can directly go into RMarkdown or Quarto. - Use
match.arg()
for form and method. - Fix typo in DLM chapter re y_1^{t-1}
Version 3.11.4
This is a CRAN release also. This release is focused on improving the plotting functions for marssMLE, marssResiduals and marssPredict objects. The website links also needed to be updated to the new GitHub organization home for MARSS (and the other ATSA material): atsa-es.
ENHANCEMENTS
- Added a variety of new plots to
autoplot.marssMLE
andplot.marssMLE
: all types of residuals with all possible standardizations versus time, plus ACF and QQPlots for the same, and all possible fitted y and x plots. Cleaned-up the plots in various ways (e.g. missing CIs). Added notes (that can be turned off) to the bottom of theautoplot
plots to explain what the plot is and guide the user to the more standard plots. - Revamped residuals plots made by
autoplot.marssMLE()
andplot.marssMLE()
to allow a full range of residuals plots but to only show a subset for a specific set of residuals diagnostics plots by default. - Created
autoplot.marssResiduals()
andplot.marssResiduals()
formarssResiduals
objects. Simplifies standard residuals plots. This needs to be separate fromplot.marssMLE()
(i.e. cannot be called fromplot.marssMLE
) since it is designed to plot whatever happens to be in themarssResiduals
object passed toplot.marssResiduals()
.plot.marssMLE()
runsresiduals()
to create a specific set of residuals diagnostics plots. - Improved
autoplot.marssPredict()
with better titles and notes below the plots. Removedpi.int
as an argument forautoplot.marssPredict()
andplot.marssPredict()
as this was extraneous. The PI/CI info is pulled in from themarssPredict
object. - Added utility function
match.arg.exact()
which does exact argument matching. The base Rmatch.arg()
usespmatch()
and does partial matching. This is a problem for many functions where"xtt1"
is different than"xtt"
. This function implements exact matching. - Added row and column names to the output from
coef.marssMLE()
whentype="matrix"
. - Added more text to help file for
MARSSresiduals()
to explain variance and correlation for standardized residuals. - Added
var.ytt1
andvar.Eytt1
to the output fromMARSShatyt()
whenonly.kem=FALSE
. This is for convenience for the plot functions. - Added
str_to_sentence
utility function for the notes inautoplot.marssMLE()
plots. - Added
interval.type
to the marssPredict objects otherwise the type of interval in the object (prediction or confidence) cannot be known. - Removed the loess lines from the residuals plots.
BUGS
plot.predictMARSS()
was not showing the forecasts and the state predictions whenh=0
was garbling the CIs and PIs when a shortnewdata
was passed in (short = shorter than original data).autoplot.marssPredict()
was not using the time info from ts object, so x-axis was showing 1, 2, 3 etc instead of the years, for example.MARSS.dfa()
used ifform="dfa"
allowed Z to be passed in. This form is a helper function that forms a default DFA model with a user specified number of trends (m). If the user needs a custom Z, they should not useform="dfa"
but use the defaultMARSS()
(form="marxss"
).MARSS.dfa()
was changed to not allow Z to be passed into the model argument.coef.marssMLE()
was not properly showing a time-varying A or U whentype="matrix"
,form="marss"
and D or C estimated.plot.marssMLE()
was not resettingpar()
when done thus affecting users plot environment.residuals.marssMLE()
value column for states was wrong when there were more than one state becausec($.x[2:TT], NA)
was used. Changed to not offsetting either.x
or.fitted
columns and instead added clarification to the documentation forresiduals.marssMLE()
. Thevalue
column was used for examples in help file forresiduals.marssMLE()
and for the coefficient of determination reported byglance.marssMLE()
.MARSS()
was not setting convergence to an error code when Kalman filter function throws and error before model is fit.
DOCUMENTATION
- Fixed some references to
MARSSsettings()
. This was replaced withpkg_globals
in the package environment via.onLoad()
. - More clean-up of the equations. Just being more consistent about using
\eqn{}
when R, Q etc refer to the matrices in the MARSS equation versus code. residuals_marssMLE.Rd
had a few typos. Main one was thatname
column was called.type
column.- Fixed a typo in
Residuals.Rnw
. LaTeX definition forVtt1
was not working. Also fixed a couple misspellings inEMDerivation.Rnw
. - Did a thorough re-read of the User Guide and did a lot of clean-up.
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.
Version 3.11.2-beta
This is a further improvement on release 3.11.2 earlier in September. This is an update to make the testing and output (plots, residuals, tsSmooth, fitted) less reliant on MARSSkfss()
, which involves an inversion of Vtt1
which can become ill-conditioned thus preventing inversion. 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 certain variance matrices with very 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.
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.- No ACF should be plotted for state smoothation residuals. Fix 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()
would not allow you to change type to, say,par.se
.
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 information on how to get CIs on rotated loadings to DFA chapter.
- Cleaned up MARSSkf.Rd sections on initial conditions.
- Added section on normalization calculations to Residuals.Rnw.
Version 3.11.2
This is a minor update to stop all MARSSkfss()
calls when trace=-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 through MARSSkfss()
even if they run fine with MARSSkfas()
, which doesn't use these matrix inversions.
To install:
install.packages("devtools")
library(devtools)
install_github("nwfsc-timeseries/[email protected]")
Version 3.11.1
Version 3.11.1 is focused on addition of the predict
, forecast
, fitted
and residuals
functions along with plotting functions for the output. Documentation for these functions along with background literature and the derivation of the residuals algorithms have been updated. Residuals in state-space models are complex as there are two processes (observation and state), three types of conditioning (data to t-1, t or T), and four types of standardization used in the literature (none, marginal, Cholesky on the full variance matrix, and Cholesky on only model or state residual variance). The MARSS package computes all the variants of residuals. Many of the predict
changes are listed below for 3.10.13 release on GitHub. New chapters illustrating structural equation models using MARSS versus StructTS
and the KFAS package were added. The KFAS chapter compares the KFAS residuals functions to the MARSS residuals functions. The two packages use different algorithms and different semantics to compute the same residuals.
ENHANCEMENTS
ldiag()
convenience function added to make list diagonal matrices. This replaces having to do code likea <- matrix(list(0),2,2); diag(a) <- list(2,"a")
. Now you can callldiag(list(2,"a"))
.- Added
accurancy.marssMLE()
andaccuracy.marssPredict()
which returns accuracy metrics sensu the forecast package. - Added
is.unitcircle()
utility function and added tol so that it does not fail if abs(eigenvalue) is above 1 by machine tolerance. - Added ACF plots for model and state innovation residuals to
plot.marssMLE()
andautoplot.marssMLE()
. - Revamped
residuals.marssMLE()
. Got rid ofaugment.marssMLE()
and renamed itresiduals.marssMLE()
. The oldresiduals.marssMLE()
becameMARSSresiduals()
. There was too much duplication betweenresiduals.marssMLE()
andaugment.marssMLE()
and betweenaugment.marssMLE()
andfitted.marssMLE()
. Also I want to minimize dependency on other packages andaugment
is a class in the broom package. This required changes to theglance.marssMLE()
,plot.marssMLE()
andautoplot.marssMLE()
code. - Revamped
tidy.marssMLE
.tsSmooth.marssMLE
now returns the estimates from the Kalman filter or smoother whichtidy.marssMLE
had returned.tidy.marssMLE
only returns a data frame for the parameter estimates. - V0T was computed with an inverse of Vtt1[,,1]. This led to unstable numerics when V00 was like matrix(big, m, m). Changed to use
solve(t(Vtt1[,,1]), B%*%V00)
which should be faster and seems to have lower numerical error. predict.marssMLE
updated to return ytt1, ytt, ytt1.- Added state innovations and contemporaneous residuals to
MARSSresiduals.tt1
andMARSSresiduals.tt
but not returned byresiduals.marssMLE()
(unlessclean=FALSE
). Only returned byMARSSresiduals()
. - Added Block Cholesky standardized residuals.
BUGS
- This bug affected
residuals()
in cases where R=0. In v 3.10.12, I introduced a bug intoMARSSkfss()
for cases where R has 0s on diagonal. History: To limit propagation of numerical errors when R=0, the row/col of Vtt for the fully determined x need to be set to 0. In v 3.10.11 and earlier, my algorithm for finding these x was not robust and zero-d out Vtt row/cols when it should not have if Z was under-determined. This bug (in < 3.10.12) only affected underdetermined models (such as models with a stochastic trend and AR-1 errors). To fix I added a utility functionfully.spec.x()
. This returns the x that are fully determined by the data. There was a bug in these corrections which madeMARSSkfss()$xtT
wrong whenever there were 0s on diagonal of R. This would show up inresiduals()
since that was usingMARSSkfss()
(in order to get some output thatMARSSkfas()
doesn't provide.) The problem wasfully.spec.x()
. It did not recognize when Z.R0 (the Z for the R=0) was all 0 for an x and thus was not (could not be) fully specified by the data. Fix was simple check that colSums of Z.R0 was not all 0. - When computing the Cholesky standardized residuals, the lower triangle of the Cholesky decomposition should be used so that the residuals are standardized to a variance of 1.
base::chol()
returns the upper triangle. Thus the lines inMARSSresiduals.tT()
andMARSSresiduals.tt1()
that applied the standardization needt(chol())
. trace=1
would fail becauseMARSSapplynames()
did not recognize thatkf$xtt
andkf$Innov
were a message instead of a matrix. I had changed theMARSSkfas()
behavior to not return these due to some questions about the values returned by the KFAS function.is.validvarcov()
used eigenvalues >= 0 as passing positive-definite test. Should be strictly positive so > 0.MARSSkfas()
had bug on the line whereV0T
was computed whentinitx=0
. It was using*
instead of%*%
for the lastJ0
multiplication. It would affect models with a non-zeroV0
under certainB
matrices, such as structural models fit byStructTS()
.- The following bug was in
MARSSresiduals.tT()
andMARSSresiduals.tt1()
but was in the oldresiduals.marssMLE()
also. If MLE object had thekf
element,kf
was not assigned in code since there was nokf <- MLEobj$kf
line for that case. Normally MLE objects do not have thekf
element, but it could be added or is added for some settings ofcontrol$trace
. This causedresiduals()
to fail iftrace=2
.
DOCUMENTATION and MAN FILES
- Added covariates and example to
MARSS_dfa.Rd
- Added chapter on Structural time series models which compares
StructTS()
toMARSS()
output. - Removed all mention of
augment()
from documentation and manuals. Replaced withresiduals()
. predict.marssMLE.Rd
(help page) had bug in the examples. removeQ=Q
from the model list in the first example.- Cleaned-up the man pages for
predict()
andpredict.marssMLE()
. - In the chapter on structural breaks and outliers, Koopman et al (1998) use the marginal residuals in their example rather than the Cholesky standardized residuals. Changed to use marginal residuals to follow their example.
- In Covariates.Rnw I show the acf of residuals. This should use innovations instead of smoothations. Only the former are temporally independent.
- Added derivation for joint variance-covariance matrices for innovations model and state residuals.
OTHER
- Changed
fitted.marssMLE
to have column with .x which is conceptually the same as the y column for observations. It is the left-side of the x equation (with error term) while fitted is the right-side without the error term. - Changed the x0 estimation behavior for
predict.marssMLE()
when no data passed in. - Added x0 argument to
predict.marssMLE()
so that user can specify x0 if needed. - Removed the tibble class from the data frames returned by
residuals.marssMLE()
. The data frames are still in tibble form. Removed all reference to tibbles in the documentation. - When
trace = -1
some tests were still being done. I added a test fortrace = -1
to a few more test lines inMARSS.R
andMARSS_marxss.R
. - Changed the default behavior of
residuals.marssMLE()
to return innovations instead of smoothations. - Columns of model estimated values in
fitted.marssMLE
,residuals.marssMLE
, andtsSmooth.marssMLE
have a leading ".".
Version 3.10.13
Version 3.10.13 mainly has to do with the predict()
and forecast()
functions along with plotting and printing methods.
This version is still fairly beta, and I am fixing minor bugs and posting to the master branch:
- predict.marssMLE.Rd (help page) has a bug in the examples. remove
Q=Q
from the model list in the first example. - futzing with the man pages for predict() and predict.marssMLE
- changed the x0 estimation behavior for predict.marssMLE() when no data passed in.
- probably will change the arguments for plot.marssMLE()
3.10.13 ENHANCEMENTS
predict.marssMLE()
Shows the prediction or confidence intervals for data or states. Forecasts can be done by passing inh
.newdata
can be passed in also and fitted model will be used to fit these data and show the intervals. Output is a tibble. Returns a list of classmarssPredict
.forecast.marssMLE()
This does the foreward forecasting past the end of the data. Intended to be called bypredict.marssMLE
. I did not write amarssMLE
method for theforecast
generic in the forecast package since that would require that the forecast package be required for the MARSS package.plot.marssPredict()
plot method for the new marssPredict object. This is designed to look like theplot.forecast()
function in the forecast package.print.marssPredict()
print method for marssPredict objects.MARSSkfss()
andMARSSkfas()
Add rownames to the x elements of the list.MARSSkf()
Addednewdata
to allow user to pass in a new dataset to fit with the fitted model.
Version 3.10.12
Version 3.10.12 update mainly has to do with the tidy()
, fitted()
and augment()
enhancements which clarify ytT, xtT and residual intervals for MARSS models. This was a major update though probably users won't notice much as it only affects residuals output. A few minor bugs were fixed which caused errors to be thrown in some rare time-varying cases. One bug that affected bootstrap confidence intervals was fixed. The documentation got a major clean-up. The Residuals report has been heavily edited to improve precision and clarity (with added verbosity). The help files and automated manual from the help files were cleaned-up and some of the internal functions moved out of the manual.
BUGS
MARSSsimulate()
missing values were placed in the wrong positions in simulated data. This would affect all simulated data with missing values and thus any function that usedMARSSboot()
, for example bootstrap confidence intervals for a data set with missing values. Default is to use Hessian so the user would not normally have encountered this bug and it had little effect on the CIs.fitted.marssMLE()
Fixed bug in fitted.marssMLE for states when one.step.ahead=TRUE. It was using xtt1[,t-1] instead of xtt[,t-1]. The former meant it only used data up to t-2.degen.test()
in MARSSkem() was not catching when R or Q was time-varying (and thus degeneracy should not be allowed). Changed to test the 3D of model.dims == 1 or not.residuals.marssMLE(..., Harvey=TRUE)
would fail if Q, B, or G was time-varying because parmat() called with t+1. Changed to only call parmat() when t<TT. Q, B, and G do not appear in the recursion when t=TT so parmat() with t=t+1 is never needed.MARSS_dfa()
used form="dfa" in MARSS.call list. Just info. Never used.- Default A matrix ("scaling") was throwing an error for manually set up DLM models. Problem was call to check that Z was a design matrix in MARSS_marxss.R. It was not catching that Z was time-varying before running
is.design()
. toLatex.marssMODEL()
Fixed some old bugs in toLatex_marssMODEL.R. Added S3 class declaration in NAMESPACE for toLatex. fixed equation attribute in MARSS_marxss. G{t} was used instead of G_{t}. Only affected toLatex_marssMODEL(). Had extra line in build.mat.tex() that removed last line of matrices. This function was not exported so users would never have run into these bugs.MARSSkfss()
To limit propogation of numerical errors when R=0, the row/col of Vtt for the fully determined x (determined from data) need to be set to 0. My algorithm for finding these x was not robust and zero-d out Vtt row/cols when it should not have if Z was under-determined. MARSSkfss() is not used for fitting and only affected underdetermined models (such as models with a stochastic trend and AR-1 errors). To fix I added a functionfully.det.x()
to the utility functions. This returns the x that are fully determined by the data. Note, MARSkfss() is the classic Kalman filter/smoother. The MARSS algorithm does not use this normally. Normally MARSSkfas(), build off the Koopman et al algorithm which avoids unneeded matrix inverses, is used. MARSSkfas() uses the Kalman filter/smoother in the KFAS package.
ENHANCEMENTS
MARSShatyt()
Added ytt, ytt1, Ott, Ott1 to MARSShatyt() so that tidy.marssMLE() can more easily return the one-step-ahead preditions for Y(t). Also added var.ytT and var.EytT so you can easily get the estimates, CI and prediction intervals for missing data. Added only.kem to MARSShatyt() so that only values conditioned on 1:T as needed by MARSS kem are returned. This makes the Ey part of a MARSS object smaller and speeds up MARSShatyt() a little.tidy.marssMLE()
Changed type for tidy() to xtT, ytT and fitted.ytT. tidy() exclusively gives estimates of things (parameters, X, Y, fitted Y) conditioned on all the data.fitted.marssMLE()
Added interval=c("none", "confidence", "prediction") to fitted() and returns a list with se's (or sd's if prediction) and intervals. Also added conditioning argument to fitted.marssMLE which gives fitted values with different conditioning. Changed default output to tibble.augment.marssMLE()
Changed standard errors output for augment() to .se.fit for std error of fitted y and .sigma to std error of residuals. This matches what augment.lm outputs.plot.marssMLE()
andautoplot.marssMLE()
. Added plot.par to plot.marssMLE and autoplot.marssMLE so that the plots can be customized. Added plot of ytT to both functions. Changed the residuals plots to use the CIs for the residuals not the loess CIs.MARSSinfo()
Added "AZR0" to MARSSinfo() to give info if user gets error that A cannot be estimated with R=0. Added more informative message to MARSSkemcheck() for that case.- Made all if statements checking class of object robust to the class returning more than one class (so vector of length > 1). Due to change in R 4.0.0 where matrix has class c("matrix","array")
- Updated all code to tidyverse style
- Changed
residuals.marssMLE()
. This is now a helper function which callsMARSSresiduals.tT()
orMARSSresiduals.tt1()
. The former is smoothation residuals and the latter is innovations (one-step-ahead) residuals.
DOCUMENTATION and MAN FILES
- Added derivation of variance of Y conditioned on y and X to EMDerivation.Rnw. Needed for CI on the missing values estimate.
- Major update to Residuals report. No changes to equations but much editting to improve precision and clarity (with much more verbosity). Reposted to Arxiv. Added innovations residuals.
- tidy, augment and fitted man files got major update.
- internal functions given \keyword{internal} so they don't appear in the documentation, but will appear if you use
?
or help.search. - Rd files extensively cleaned to improve linking and move more of the internal functions out of view of the normal user. Equations cleaned up (though not completely).