Running examples in 'MARSS-Ex.R' failed
The error most likely occurred in:

> ### Name: fitted.marssMLE
> ### Title: Return fitted values for X(t) and Y(t) in a MARSS model
> ### Aliases: fitted.marssMLE
> ### Keywords: coremethods
> 
> ### ** Examples
> 
> dat <- t(harborSeal)
> dat <- dat[c(2, 11, 12), ]
> fit <- MARSS(dat, model = list(Z = factor(c("WA", "OR", "OR"))))
Success! abstol and log-log tests passed at 37 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 37 iterations. 
Log-likelihood: 13.72233 
AIC: -11.44465   AICc: -8.918339   
 
                Estimate
A.OR.SouthCoast  0.49280
R.diag           0.02509
U.WA             0.06171
U.OR             0.03686
Q.(WA,WA)        0.01082
Q.(OR,OR)        0.00439
x0.WA            7.41712
x0.OR            6.56460
Initial states (x0) defined at t=0

Standard errors have not been calculated. 
Use MARSSparamCIs to compute CIs and bias estimates.

> fitted(fit)
          .rownames  t        y  .fitted
1  CoastalEstuaries  1 7.434848 7.478834
2  CoastalEstuaries  2 7.462789 7.527291
3  CoastalEstuaries  3 7.641084 7.561730
4  CoastalEstuaries  4 7.851661 7.659996
5  CoastalEstuaries  5       NA 7.812064
6  CoastalEstuaries  6 7.959975 7.873775
7  CoastalEstuaries  7 8.391176 7.984753
8  CoastalEstuaries  8 8.555837 8.249960
9  CoastalEstuaries  9 8.392990 8.459223
10 CoastalEstuaries 10 8.343554 8.489312
11 CoastalEstuaries 11 8.700847 8.481630
12 CoastalEstuaries 12 8.477828 8.647625
13 CoastalEstuaries 13 8.935904 8.628580
14 CoastalEstuaries 14 8.824089 8.836448
15 CoastalEstuaries 15 8.775704 8.892282
16 CoastalEstuaries 16       NA 8.898552
17 CoastalEstuaries 17 9.068892 8.960263
18 CoastalEstuaries 18 8.956866 9.084143
19 CoastalEstuaries 19 9.007122 9.082103
20 CoastalEstuaries 20 8.663196 9.107640
21 CoastalEstuaries 21 8.778326 8.957151
22 CoastalEstuaries 22 8.880586 8.933726
23 CoastalEstuaries 23 8.941545 8.970158
24 CoastalEstuaries 24       NA 9.018261
25 CoastalEstuaries 25 8.870242 9.079972
26 CoastalEstuaries 26       NA 9.021653
27 CoastalEstuaries 27       NA 9.083364
28 CoastalEstuaries 28       NA 9.145076
29 CoastalEstuaries 29       NA 9.206787
30 CoastalEstuaries 30       NA 9.268498
31    OR.NorthCoast  1       NA 6.601457
32    OR.NorthCoast  2       NA 6.638318
33    OR.NorthCoast  3 6.423247 6.675179
34    OR.NorthCoast  4       NA 6.625364
35    OR.NorthCoast  5       NA 6.781325
36    OR.NorthCoast  6       NA 6.818186
37    OR.NorthCoast  7       NA 6.855047
38    OR.NorthCoast  8 6.638568 6.891908
39    OR.NorthCoast  9 6.906755 6.906977
40    OR.NorthCoast 10 6.916715 7.041783
41    OR.NorthCoast 11 7.016610 7.041162
42    OR.NorthCoast 12 6.898715 7.156028
43    OR.NorthCoast 13 7.288244 7.159225
44    OR.NorthCoast 14 7.355002 7.265265
45    OR.NorthCoast 15 7.553287 7.370729
46    OR.NorthCoast 16 7.539027 7.489409
47    OR.NorthCoast 17 7.424165 7.538483
48    OR.NorthCoast 18 7.824446 7.538386
49    OR.NorthCoast 19 7.753624 7.633471
50    OR.NorthCoast 20 7.689371 7.660755
51    OR.NorthCoast 21 7.553287 7.630795
52    OR.NorthCoast 22 7.677400 7.569566
53    OR.NorthCoast 23       NA 7.575025
54    OR.NorthCoast 24 7.829233 7.579818
55    OR.NorthCoast 25 7.484369 7.645344
56    OR.NorthCoast 26 7.404888 7.585838
57    OR.NorthCoast 27 7.409742 7.560004
58    OR.NorthCoast 28 7.675546 7.540157
59    OR.NorthCoast 29 7.798113 7.608532
60    OR.NorthCoast 30       NA 7.670312
61    OR.SouthCoast  1       NA 7.094258
62    OR.SouthCoast  2       NA 7.131119
63    OR.SouthCoast  3       NA 7.167980
64    OR.SouthCoast  4 7.466799 7.118166
65    OR.SouthCoast  5       NA 7.274126
66    OR.SouthCoast  6       NA 7.310987
67    OR.SouthCoast  7       NA 7.347848
68    OR.SouthCoast  8 7.573531 7.384709
69    OR.SouthCoast  9 7.786967 7.399778
70    OR.SouthCoast 10       NA 7.534584
71    OR.SouthCoast 11 7.878913 7.533963
72    OR.SouthCoast 12 7.758333 7.648829
73    OR.SouthCoast 13 7.833204 7.652026
74    OR.SouthCoast 14 7.977968 7.758067
75    OR.SouthCoast 15 8.051022 7.863530
76    OR.SouthCoast 16 7.987864 7.982210
77    OR.SouthCoast 17 7.978311 8.031284
78    OR.SouthCoast 18 8.008698 8.031188
79    OR.SouthCoast 19 7.962764 8.126272
80    OR.SouthCoast 20 7.822445 8.153556
81    OR.SouthCoast 21 7.757051 8.123597
82    OR.SouthCoast 22 7.812378 8.062367
83    OR.SouthCoast 23 7.954723 8.067827
84    OR.SouthCoast 24 7.943073 8.072620
85    OR.SouthCoast 25 7.873598 8.138145
86    OR.SouthCoast 26 7.977968 8.078639
87    OR.SouthCoast 27 7.946971 8.052805
88    OR.SouthCoast 28 8.040125 8.032958
89    OR.SouthCoast 29 8.024535 8.101333
90    OR.SouthCoast 30       NA 8.163113
> 
> # Example of fitting a stochastic level model to the Nile River flow data
> # red line is smooothed level estimate
> # grey line is one-step-ahead prediction using xtt1
> nile <- as.vector(datasets::Nile)
> mod.list <- list(
+   Z = matrix(1), A = matrix(0), R = matrix("r"),
+   B = matrix(1), U = matrix(0), Q = matrix("q"),
+   x0 = matrix("pi")
+ )
> fit <- MARSS(nile, model = mod.list, silent = TRUE)
> 
> # Plotting
> # There are plot methods for marssMLE objects
> library(ggplot2)
> autoplot(fit)
Error: Stopped in residuals.marssMLE: MARSSresiduals() failed. 
Execution halted