Skip to content

Commit 3053fe6

Browse files
authored
Merge pull request #185 from atsa-es/v3-11-7
V3 11 7 (close) to final changes
2 parents 5b9e4cb + c8ce16b commit 3053fe6

File tree

241 files changed

+5387
-3184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+5387
-3184
lines changed

.Rbuildignore

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,31 @@
44
.Rhistory
55
.RData
66
.gitignore
7-
.github
8-
logo.jpg
9-
logot.png
7+
^\.github$
8+
9+
License.md
10+
tests
11+
1012
hexlogo.png
1113
mars.png
1214
favicon.ico
1315
_config.yml
1416
_layouts
15-
License.md
16-
vignettes/cbe.bst
17-
vignettes/footmisc.sty
18-
vignettes/hanging.sty
19-
vignettes/svmono.cls
20-
vignettes/versiontest.R
21-
vignettes/debugger_template.Rnw
22-
vignettes/debug_manual.R
23-
tests
2417
^_pkgdown\.yml$
2518
^docs$
2619
^pkgdown$
27-
^\.github$
20+
Rplots.*
21+
2822
^inst/oldtex$
2923
^inst/userguide$
3024
^inst/derivations$
3125
^inst/testing-releases$
32-
inst/doc/mathdefs.tex
26+
^inst/Makedoc
27+
^inst/Makerelease
28+
^inst/DEVELOPER_NOTES.*
29+
^inst/Makefile
30+
3331
^revdep$
3432
^cran-comments.md$
35-
^inst/doc/UserGuide-static\.pdf$
33+
^doc$
34+
^Meta$

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ tests/testthat/dontruntests/*.*
1010
inst/.DS_Store
1111

1212
docs
13+
/doc/
14+
/Meta/

NEWS.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@ output: html_document
44

55
# MARSS 3.11.7 (GitHub)
66

7-
This release is focused on moving the MARSS User Guide into a separate repository. This will facilitate updating MARSS and converting the User Guide to an eBook.
7+
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.
88

9-
* Deleted the `inst/doc` folder
109
* Added pkgdown. Note this required special files for MathJax in the `pkgdown` folder.
1110
* Removed packages in `Suggests:` that were associated with the User Guide and tests and not used in examples.
12-
* Converted `Quick_Start.Rnw` and `Residuals.Rnw` to Rmd so it works better with pkgdown.
11+
* Converted `Quick_Start.Rnw` to Rmd so it works better with pkgdown and renders to html for CRAN.
1312
* Updated DESCRIPTION and README to refer to marssTMB.
1413
* Added marssTMB to Suggests with `Additional_repositories: https://atsa-es.r-universe.dev`
1514

16-
1715
## BUGS
1816

1917
* In `predict_marssMLE()`, the newdata model.tsp was not being set.
18+
* In `plot.marssMLE()`, the CIs for the state residuals did not plot correctly because there is always a NA at the end.
19+
* In `autoplot.marssMLE(), two plots would always be plotted if one plot type was specified.
20+
21+
## DOCUMENTATION
22+
23+
* Added `vignettes/Learning_MARSS.Rmd`
24+
* Fixed various equation formatting typos (unbolded x's and x's that should have been X's in expectations).
25+
* Added `MARSS.dfa()` to the manual built by CRAN by removing keyword internal.
26+
* Added `inst/DEVELOPER_NOTES.md`
27+
* Minor change to make the v and w in `EMDerivation.Rnw` in slant font as they are random variables.
28+
2029

2130
# MARSS 3.11.6 (GitHub)
2231

@@ -26,7 +35,7 @@ This release is focused on adding new method `method="TMB"` which uses the packa
2635
* Added the generic function `MARSSfit()` and methods for "kem" and "BFGS".
2736
* Added the defaults to `R/onLoad.R` and made it easier to specify new methods and constraints on methods
2837
* Made changes to `checkMARSSinputs.R`, `is_marssMLE.R` and `is.validvarcov()` so they are not so specific to `method="BFGS"` but work for any methods with similar constraints.
29-
* Export MARSSvectorizeparam(). Need when writing methods for MARSSfit() generic.
38+
* Export `MARSSvectorizeparam()`. Need when writing methods for `MARSSfit()` generic.
3039
* Added {generics} as a dependency and removed {forecast} and {broom} from Suggests. Cleaned up examples and text throughout to remove references to these packages.
3140

3241
## BUGS
@@ -110,7 +119,7 @@ This is an update based on version 3.11.2 (GitHub release). It is mainly focused
110119
* Added notation definitions to the Kalman smoother algorithm section for `xtt` and `xtt1` etc.
111120
* Added information on how to get CIs on rotated loadings to DFA chapter.
112121
* Cleaned up MARSSkf.Rd sections on initial conditions and cleaned up equation formatting so looks better in pdf format.
113-
* Added section on normalization calculations to Residuals.Rnw.
122+
* Added section on normalization calculations to `Residuals.Rnw`.
114123
* Cleaned up notation for conditional expectations in the man files.
115124
* Fixed bug in the Covariates chapter which was not showing the B estimates for `kem.plank.4`.
116125

R/autoplot_marssMLE.R

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ autoplot.marssMLE <-
172172
}
173173
plts[[i]] <- p1
174174
if (length(plot.type) == 1) {
175-
invisible(plts)
175+
return(plts[[1]])
176176
}
177177
}
178178

@@ -246,7 +246,7 @@ autoplot.marssMLE <-
246246
}
247247
plts[[i]] <- p1
248248
if (length(plot.type) == 1) {
249-
invisible(plts)
249+
return(plts[[1]])
250250
}
251251
}
252252

@@ -292,7 +292,7 @@ autoplot.marssMLE <-
292292
}
293293
plts[[i]] <- p1
294294
if (length(plot.type) == 1) {
295-
invisible(plts)
295+
return(plts[[1]])
296296
}
297297
}
298298

@@ -355,7 +355,7 @@ autoplot.marssMLE <-
355355
}
356356
plts[[i]] <- p1
357357
if (length(plot.type) == 1) {
358-
invisible(plts)
358+
return(plts[[1]])
359359
}
360360
}
361361

@@ -393,6 +393,7 @@ autoplot.marssMLE <-
393393
if (conf.int) {
394394
if (grepl("std", i)) {
395395
df$sigma <- 1
396+
df$sigma[is.na(df$value)] <- 0
396397
} else {
397398
df$sigma <- df$.sigma
398399
df$sigma[is.na(df$value)] <- 0 # will never be the case for x so not really needed here
@@ -416,7 +417,7 @@ autoplot.marssMLE <-
416417
}
417418
plts[[i]] <- p1
418419
if (length(plot.type) == 1) {
419-
invisible(plts)
420+
return(plts[[1]])
420421
}
421422
}
422423

@@ -489,9 +490,7 @@ autoplot.marssMLE <-
489490
p1 <- p1 + ggplot2::labs(caption = paste0(strwrap(note), collapse = "\n")) + ggplot2::theme(plot.caption = ggplot2::element_text(size = 7.5, hjust = 0))
490491
}
491492
plts[[i]] <- p1
492-
if (length(plot.type) == 1) {
493-
invisible(plts)
494-
}
493+
if (length(plot.type) == 1) return(plts[[1]])
495494
}
496495

497496
# ACF plots
@@ -574,9 +573,7 @@ autoplot.marssMLE <-
574573
p1 <- p1 + ggplot2::labs(caption = paste0(strwrap(note), collapse = "\n")) + ggplot2::theme(plot.caption = ggplot2::element_text(size = 7.5, hjust = 0))
575574
}
576575
plts[[i]] <- p1
577-
if (length(plot.type) == 1) {
578-
invisible(plts)
579-
}
576+
if (length(plot.type) == 1) return(plts[[1]])
580577
}
581578

582579
for (i in names(plts)) {
@@ -595,6 +592,5 @@ autoplot.marssMLE <-
595592
if (!silent) cat("Finished plots.\n")
596593
}
597594
}
598-
599-
invisible(plts)
595+
if(silent) invisible(plts)
600596
}

R/plot_marssMLE.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ plot.marssMLE <-
228228
# need to adjust sigma for making a polygon
229229
if (grepl("std", i)) {
230230
df$.sigma <- 1
231+
df$.sigma[is.na(df$value)] <- 0
231232
} else {
232233
df$.sigma[is.na(df$value)] <- 0
233234
}
@@ -251,7 +252,9 @@ plot.marssMLE <-
251252
cex = plotpar$point.size
252253
)
253254
if (conf.int) {
254-
polygon(c(t, rev(t)), c(ymin, rev(ymax)), col = plotpar$ci.col, border = plotpar$ci.border, lwd = plotpar$ci.lwd, lty = plotpar$ci.lty)
255+
df2 <- data.frame(x=c(t, rev(t)), y=c(ymin, rev(ymax)))
256+
df2 <- na.omit(df2)
257+
polygon(df2$x, df2$y, col = plotpar$ci.col, border = plotpar$ci.border, lwd = plotpar$ci.lwd, lty = plotpar$ci.lty)
255258
points(t, .resids, col = plotpar$point.col, pch = plotpar$point.pch, cex = plotpar$point.size)
256259
}
257260
title(plt)

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
MARSS stands for Multivariate Auto-Regressive(1) State-Space. The MARSS R package estimates the parameters of linear MARSS models with Gaussian errors. This class of model is extremely important in the study of linear stochastic dynamical systems, and these models are important in many different fields, including economics, engineering, genetics, physics and ecology. The model class has different names in different fields, for example in some fields they are termed dynamic linear models (DLMs) or vector autoregressive (VAR) state-space models. The MARSS package allows you to easily fit time-varying constrained and unconstrained MARSS models with or without covariates via maximum-likelihood using an EM algorithm or BFGS. Fast fitting with TMB is available with the companion package [marssTMB](https://atsa-es.github.io/marssTMB/).
44

5-
[![cran version](http://www.r-pkg.org/badges/version/MARSS)](https://cran.r-project.org/package=MARSS)
5+
[![cran version](https://www.r-pkg.org/badges/version/MARSS)](https://cran.r-project.org/package=MARSS)
66
[![github](https://img.shields.io/github/v/release/atsa-es/MARSS?color=brightgreen&label=GitHub)](https://github.com/atsa-es/MARSS/releases/latest)
7-
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/MARSS?)](https://github.com/r-hub/cranlogs.app)
7+
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/MARSS?)](https://github.com/r-hub/cranlogs.app)
88
[![](https://cranlogs.r-pkg.org/badges/MARSS?color=FFD700)](https://www.r-pkg.org/pkg/MARSS)
99
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0%201.0-lightgrey.svg)](https://creativecommons.org/publicdomain/zero/1.0/)
1010

@@ -69,6 +69,9 @@ Type `citation("MARSS")` at the command line to get the most up to data citation
6969

7070
To see our publications using MARSS models, see the [Applied Time Series Analysis website](https://atsa-es.github.io/).
7171

72+
### Developers
73+
74+
See `inst/DEVELOPER_NOTES.md` for instructions on creating a release from the repository.
7275

7376
### NOAA Disclaimer
7477

Rplots.pdf

493 KB
Binary file not shown.
Lines changed: 201 additions & 1695 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)