Skip to contents

MARSS() outputs marssMLE objects. predict(object), where object is marssMLE object, will return the predictions of \(\mathbf{y}_t\) or the smoothed value of \(\mathbf{x}_t\) for h steps past the end of the model data. predict(object) returns a marssPredict object which can be passed to print.marssPredict() for automatic printing.

Usage

# S3 method for marssPredict
print(x, ...)

Arguments

x

A marssPredict object.

...

Other arguments for print. Not used.

Value

A print out of the predictions as a data frame.

Author

Eli Holmes, NOAA, Seattle, USA.

Examples

dat <- t(harborSealWA)
dat <- dat[2:4,] #remove the year row
fit <- MARSS(dat, model=list(R="diagonal and equal"))
#> Success! abstol and log-log tests passed at 44 iterations.
#> Alert: conv.test.slope.tol is 0.5.
#> Test with smaller values (<0.1) to ensure convergence.
#> 
#> MARSS fit is
#> Estimation method: kem 
#> Convergence test: conv.test.slope.tol = 0.5, abstol = 0.001
#> Estimation converged in 44 iterations. 
#> Log-likelihood: 17.84491 
#> AIC: -15.68982   AICc: -10.45173   
#>  
#>                     Estimate
#> R.diag               0.00582
#> U.X.SJF              0.06833
#> U.X.SJI              0.07084
#> U.X.EBays            0.04221
#> Q.(X.SJF,X.SJF)      0.04150
#> Q.(X.SJI,X.SJI)      0.01271
#> Q.(X.EBays,X.EBays)  0.00807
#> x0.X.SJF             5.97602
#> x0.X.SJI             6.70656
#> x0.X.EBays           6.63306
#> Initial states (x0) defined at t=0
#> 
#> Standard errors have not been calculated. 
#> Use MARSSparamCIs to compute CIs and bias estimates.
#> 

# 2 steps ahead forecast
predict(fit, type="ytT", n.ahead=2)
#>    .rownames  t estimate
#> 23       SJF 23 7.547435
#> 24       SJF 24 7.615761
#> 47       SJI 23 8.335404
#> 48       SJI 24 8.406240
#> 71     EBays 23 7.603746
#> 72     EBays 24 7.645959

# smoothed x estimates with intervals
predict(fit, type="xtT")
#>    .rownames  t       .x estimate
#> 1      X.SJF  1 6.044264 6.044345
#> 2      X.SJF  2 6.192149 6.112590
#> 3      X.SJF  3 6.340035 6.260476
#> 4      X.SJF  4 6.487920 6.408361
#> 5      X.SJF  5 6.635806 6.556246
#> 6      X.SJF  6 6.783691 6.704132
#> 7      X.SJF  7 6.934182 6.852017
#> 8      X.SJF  8 7.097030 7.002508
#> 9      X.SJF  9 6.805200 7.165357
#> 10     X.SJF 10 6.948989 6.873526
#> 11     X.SJF 11 7.273468 7.017315
#> 12     X.SJF 12 7.229726 7.341794
#> 13     X.SJF 13 7.072488 7.298052
#> 14     X.SJF 14 7.142899 7.140814
#> 15     X.SJF 15 7.367541 7.211225
#> 16     X.SJF 16 7.609002 7.435867
#> 17     X.SJF 17 7.379654 7.677329
#> 18     X.SJF 18 7.680866 7.447980
#> 19     X.SJF 19 7.615123 7.749192
#> 20     X.SJF 20 7.693577 7.683449
#> 21     X.SJF 21 7.486276 7.761903
#> 22     X.SJF 22 7.479109 7.554602
#> 23     X.SJI  1 6.777215 6.777395
#> 24     X.SJI  2 6.912514 6.848051
#> 25     X.SJI  3 7.047813 6.983350
#> 26     X.SJI  4 7.183112 7.118648
#> 27     X.SJI  5 7.318411 7.253947
#> 28     X.SJI  6 7.453709 7.389246
#> 29     X.SJI  7 7.637902 7.524545
#> 30     X.SJI  8 7.590312 7.708738
#> 31     X.SJI  9 7.679125 7.661148
#> 32     X.SJI 10 7.737608 7.749960
#> 33     X.SJI 11 7.907332 7.808443
#> 34     X.SJI 12 7.975191 7.978168
#> 35     X.SJI 13 8.061066 8.046027
#> 36     X.SJI 14 8.154990 8.131902
#> 37     X.SJI 15 8.230627 8.225826
#> 38     X.SJI 16 8.373657 8.301463
#> 39     X.SJI 17 8.421790 8.444493
#> 40     X.SJI 18 8.477634 8.492626
#> 41     X.SJI 19 8.512724 8.548470
#> 42     X.SJI 20 8.398618 8.583560
#> 43     X.SJI 21 8.366571 8.469454
#> 44     X.SJI 22 8.264568 8.437407
#> 45   X.EBays  1 6.674960 6.675270
#> 46   X.EBays  2 6.783692 6.717173
#> 47   X.EBays  3 6.892424 6.825905
#> 48   X.EBays  4 7.001156 6.934636
#> 49   X.EBays  5 7.109887 7.043368
#> 50   X.EBays  6 7.218619 7.152100
#> 51   X.EBays  7 7.345337 7.260831
#> 52   X.EBays  8 7.321332 7.387549
#> 53   X.EBays  9 7.388396 7.363545
#> 54   X.EBays 10 7.458986 7.430609
#> 55   X.EBays 11 7.517168 7.501198
#> 56   X.EBays 12 7.528953 7.559380
#> 57   X.EBays 13 7.557326 7.571165
#> 58   X.EBays 14 7.585700 7.599539
#> 59   X.EBays 15 7.635923 7.627913
#> 60   X.EBays 16 7.665752 7.678135
#> 61   X.EBays 17 7.669217 7.707964
#> 62   X.EBays 18 7.671004 7.711430
#> 63   X.EBays 19 7.723585 7.713217
#> 64   X.EBays 20 7.625414 7.765797
#> 65   X.EBays 21 7.555667 7.667626
#> 66   X.EBays 22 7.561534 7.597879