mvgam
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 5e2a8923..98d98d3c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -9,7 +9,7 @@ articles: shared_states: shared_states.html time_varying_effects: time_varying_effects.html trend_formulas: trend_formulas.html -last_built: 2024-01-29T05:37Z +last_built: 2024-03-12T03:54Z urls: reference: https://nicholasjclark.github.io/mvgam/reference article: https://nicholasjclark.github.io/mvgam/articles diff --git a/docs/reference/figures/README-unnamed-chunk-13-1.png b/docs/reference/figures/README-unnamed-chunk-13-1.png index 97f08209..63559a6a 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-13-1.png and b/docs/reference/figures/README-unnamed-chunk-13-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-14-1.png b/docs/reference/figures/README-unnamed-chunk-14-1.png index 8e34a550..1dca9500 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-14-1.png and b/docs/reference/figures/README-unnamed-chunk-14-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-15-1.png b/docs/reference/figures/README-unnamed-chunk-15-1.png index f801d30b..8b1142de 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-15-1.png and b/docs/reference/figures/README-unnamed-chunk-15-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-16-1.png b/docs/reference/figures/README-unnamed-chunk-16-1.png index 94d4bf12..ba4439e4 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-16-1.png and b/docs/reference/figures/README-unnamed-chunk-16-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-17-1.png b/docs/reference/figures/README-unnamed-chunk-17-1.png index 85e0db39..d722ba66 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-17-1.png and b/docs/reference/figures/README-unnamed-chunk-17-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-18-1.png b/docs/reference/figures/README-unnamed-chunk-18-1.png index fbb3a6b1..c72e0706 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-18-1.png and b/docs/reference/figures/README-unnamed-chunk-18-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-19-1.png b/docs/reference/figures/README-unnamed-chunk-19-1.png index 7f2f84c9..87c0bc2e 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-19-1.png and b/docs/reference/figures/README-unnamed-chunk-19-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-20-1.png b/docs/reference/figures/README-unnamed-chunk-20-1.png index 84f2b09d..d39944b0 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-20-1.png and b/docs/reference/figures/README-unnamed-chunk-20-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-21-1.png b/docs/reference/figures/README-unnamed-chunk-21-1.png index 246e3eef..eb759d89 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-21-1.png and b/docs/reference/figures/README-unnamed-chunk-21-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-22-1.png b/docs/reference/figures/README-unnamed-chunk-22-1.png index e1b4751a..a748b548 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-22-1.png and b/docs/reference/figures/README-unnamed-chunk-22-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-23-1.png b/docs/reference/figures/README-unnamed-chunk-23-1.png index 00f1d110..45ab957c 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-23-1.png and b/docs/reference/figures/README-unnamed-chunk-23-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-24-1.png b/docs/reference/figures/README-unnamed-chunk-24-1.png index 24d051b6..40e68091 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-24-1.png and b/docs/reference/figures/README-unnamed-chunk-24-1.png differ diff --git a/docs/reference/figures/mvgam_logo.png b/docs/reference/figures/mvgam_logo.png new file mode 100644 index 00000000..ce0ace9b Binary files /dev/null and b/docs/reference/figures/mvgam_logo.png differ diff --git a/docs/reference/get_mvgam_priors.html b/docs/reference/get_mvgam_priors.html index 273505f3..a514ddc0 100644 --- a/docs/reference/get_mvgam_priors.html +++ b/docs/reference/get_mvgam_priors.html @@ -402,13 +402,13 @@Examples#> 6 trend sd sigma ~ student_t(3, 0, 2.5);
#> 7 inverse of NB dispsersion phi_inv ~ student_t(3, 0, 0.1);
#> example_change new_lowerbound new_upperbound
-#> 1 lambda ~ exponential(0.03); NA NA
-#> 2 mu_raw ~ normal(0.56, 0.85); NA NA
-#> 3 sigma_raw ~ exponential(0.28); NA NA
-#> 4 ar1 ~ normal(0.03, 0.94); NA NA
-#> 5 ar2 ~ normal(0.08, 0.56); NA NA
-#> 6 sigma ~ exponential(0.97); NA NA
-#> 7 phi_inv ~ normal(0.75, 0.12); NA NA
+#> 1 lambda ~ exponential(0.18); NA NA
+#> 2 mu_raw ~ normal(0.23, 0.71); NA NA
+#> 3 sigma_raw ~ exponential(0.79); NA NA
+#> 4 ar1 ~ normal(-0.57, 0.81); NA NA
+#> 5 ar2 ~ normal(0.19, 0.65); NA NA
+#> 6 sigma ~ exponential(0.12); NA NA
+#> 7 phi_inv ~ normal(-0.61, 0.11); NA NA
# Make a few changes; first, change the population mean for the series-level
# random intercepts
diff --git a/docs/reference/monotonic.html b/docs/reference/monotonic.html
index c243b75d..368ad6d9 100644
--- a/docs/reference/monotonic.html
+++ b/docs/reference/monotonic.html
@@ -64,16 +64,16 @@
Usage
# S3 method for moi.smooth.spec
-smooth.construct(object, data, knots)
+smooth.construct(object, data, knots)
# S3 method for mod.smooth.spec
-smooth.construct(object, data, knots)
+smooth.construct(object, data, knots)
# S3 method for moi.smooth
-Predict.matrix(object, data)
+Predict.matrix(object, data)
# S3 method for mod.smooth
-Predict.matrix(object, data)
+Predict.matrix(object, data)
Usage
# S3 method for moi.smooth.spec
-smooth.construct(object, data, knots)
+smooth.construct(object, data, knots)
# S3 method for mod.smooth.spec
-smooth.construct(object, data, knots)
+smooth.construct(object, data, knots)
# S3 method for moi.smooth
-Predict.matrix(object, data)
+Predict.matrix(object, data)
# S3 method for mod.smooth
-Predict.matrix(object, data)
Examples
# A standard TRPS smooth doesn't capture monotonicity
mod_data <- data.frame(y = y, x = x)
-mod <- gam(y ~ s(x, k = 16),
+mod <- gam(y ~ s(x, k = 16),
data = mod_data,
family = gaussian())
@@ -166,7 +166,7 @@ Examples
# Using the 'moi' basis in mvgam rectifies this
mod_data$time <- 1:NROW(mod_data)
-mod2 <- mvgam(y ~ s(x, bs = 'moi', k = 18),
+mod2 <- mvgam(y ~ s(x, bs = 'moi', k = 18),
data = mod_data,
family = gaussian())
@@ -199,7 +199,7 @@ Examplesmod_data$time <- 1:NROW(mod_data)
# Fit a model with different smooths per factor level
-mod <- mvgam(y ~ s(x, bs = 'moi', by = fac, k = 8),
+mod <- mvgam(y ~ s(x, bs = 'moi', by = fac, k = 8),
data = mod_data,
family = gaussian())
diff --git a/docs/reference/mvgam.html b/docs/reference/mvgam.html
index a2c50701..cdc9d72f 100644
--- a/docs/reference/mvgam.html
+++ b/docs/reference/mvgam.html
@@ -91,6 +91,7 @@ Usage
prior_simulation = FALSE,
return_model_data = FALSE,
family = "poisson",
+ share_obs_params = FALSE,
use_lv = FALSE,
n_lv,
trend_map,
@@ -122,7 +123,7 @@ Usage
Arguments
- formula
A character
string specifying the GAM observation model formula. These are exactly like the formula
-for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
+for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
dynamic()
terms, can be added to the right hand side
to specify that the linear predictor depends on smooth functions of predictors
(or linear functionals of these). In nmix()
family models, the formula
is used to
@@ -201,22 +202,31 @@
Argumentsnb() for count data
poisson()
for count data
gaussian()
for real-valued data
-betar()
for proportional data on (0,1)
-lognormal()
for non-negative real-valued data
+betar()
for proportional data on (0,1)
+lognormal()
for non-negative real-valued data
student_t()
for real-valued data
Gamma()
for non-negative real-valued data
nmix()
for count data with imperfect detection modeled via a
State-Space N-Mixture model. The latent states are Poisson, capturing the 'true' latent
abundance, while the observation process is Binomial to account for imperfect detection.
See mvgam_families
for an example of how to use this family
-Note that only nb()
and poisson()
are available if using JAGS
as the backend.
+
Note that only nb()
and poisson()
are available if using JAGS
as the backend.
Default is poisson()
.
See mvgam_families
for more details
+- share_obs_params
+logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
+
+
- use_lv
logical
. If TRUE
, use dynamic factors to estimate series'
latent trends in a reduced dimension format. Only available for
@@ -453,8 +463,9 @@
Details
to ensure predictions can be made for all levels of the supplied factor variable
Observation level parameters: When more than one series is included in data
and an
observation family that contains more than one parameter is used, additional observation family parameters
-(i.e. phi
for nb()
or sigma
for gaussian()
) are
-estimated independently for each series.
+(i.e. phi
for nb()
or sigma
for gaussian()
) are
+by default estimated independently for each series. But if you wish for the series to share
+the same observation parameters, set share_obs_params = TRUE
Factor regularisation: When using a dynamic factor model for the trends with JAGS
factor precisions are given
regularized penalty priors to theoretically allow some factors to be dropped from the model by squeezing increasing
factors' variances to zero. This is done to help protect against selecting too many latent factors than are needed to
@@ -507,7 +518,7 @@ Examples# Formulate a model using Stan where series share a cyclic smooth for
# seasonality and each series has an independent random walk temporal process;
# Set run_model = FALSE to inspect the returned objects
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = 'poisson',
@@ -538,7 +549,7 @@ Examples refresh = 100)
# Now fit the model using mvgam with the Stan backend
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = poisson(),
@@ -574,7 +585,7 @@ Examplesplot(mod1, type = 'smooths', realisations = TRUE)
# Plot conditional response predictions using marginaleffects
-plot(conditional_effects(mod1), ask = FALSE)
+plot(conditional_effects(mod1), ask = FALSE)
plot_predictions(mod1, condition = 'season', points = 0.5)
# Extract observation model beta coefficient draws as a data.frame
@@ -597,7 +608,7 @@ Examples trend = c(1,1,2))
# Fit the model using AR1 trends
-mod <- mvgam(y ~ s(season, bs = 'cc'),
+mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_map = trend_map,
trend_model = 'AR1',
data = mod_data,
@@ -662,9 +673,9 @@ Examples# Fit a model that includes the offset in the linear predictor as well as
# hierarchical seasonal smooths
mod <- mvgam(formula = y ~ offset(offset) +
- s(series, bs = 're') +
- s(season, bs = 'cc') +
- s(season, by = series, m = 1, k = 5),
+ s(series, bs = 're') +
+ s(season, bs = 'cc') +
+ s(season, by = series, m = 1, k = 5),
data = dat$data_train,
trend_model = 'None',
use_stan = TRUE)
@@ -765,7 +776,7 @@ Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
+- share_obs_params
+logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
+
+
- priors
An optional data.frame
with prior
definitions (in JAGS or Stan syntax). if using Stan, this can also be an object of
diff --git a/index.Rmd b/index.Rmd
index e7112bb5..1e409a8d 100644
--- a/index.Rmd
+++ b/index.Rmd
@@ -5,6 +5,8 @@ always_allow_html: true
+
[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/index.md b/index.md
index 6441ce50..2fbd2c11 100644
--- a/index.md
+++ b/index.md
@@ -1,6 +1,8 @@
+
[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/man/figures/README-unnamed-chunk-13-1.png b/man/figures/README-unnamed-chunk-13-1.png
index 97f08209..63559a6a 100644
Binary files a/man/figures/README-unnamed-chunk-13-1.png and b/man/figures/README-unnamed-chunk-13-1.png differ
diff --git a/man/figures/README-unnamed-chunk-14-1.png b/man/figures/README-unnamed-chunk-14-1.png
index 8e34a550..1dca9500 100644
Binary files a/man/figures/README-unnamed-chunk-14-1.png and b/man/figures/README-unnamed-chunk-14-1.png differ
diff --git a/man/figures/README-unnamed-chunk-15-1.png b/man/figures/README-unnamed-chunk-15-1.png
index f801d30b..8b1142de 100644
Binary files a/man/figures/README-unnamed-chunk-15-1.png and b/man/figures/README-unnamed-chunk-15-1.png differ
diff --git a/man/figures/README-unnamed-chunk-16-1.png b/man/figures/README-unnamed-chunk-16-1.png
index 94d4bf12..ba4439e4 100644
Binary files a/man/figures/README-unnamed-chunk-16-1.png and b/man/figures/README-unnamed-chunk-16-1.png differ
diff --git a/man/figures/README-unnamed-chunk-17-1.png b/man/figures/README-unnamed-chunk-17-1.png
index 85e0db39..d722ba66 100644
Binary files a/man/figures/README-unnamed-chunk-17-1.png and b/man/figures/README-unnamed-chunk-17-1.png differ
diff --git a/man/figures/README-unnamed-chunk-18-1.png b/man/figures/README-unnamed-chunk-18-1.png
index fbb3a6b1..c72e0706 100644
Binary files a/man/figures/README-unnamed-chunk-18-1.png and b/man/figures/README-unnamed-chunk-18-1.png differ
diff --git a/man/figures/README-unnamed-chunk-19-1.png b/man/figures/README-unnamed-chunk-19-1.png
index 7f2f84c9..87c0bc2e 100644
Binary files a/man/figures/README-unnamed-chunk-19-1.png and b/man/figures/README-unnamed-chunk-19-1.png differ
diff --git a/man/figures/README-unnamed-chunk-20-1.png b/man/figures/README-unnamed-chunk-20-1.png
index 84f2b09d..d39944b0 100644
Binary files a/man/figures/README-unnamed-chunk-20-1.png and b/man/figures/README-unnamed-chunk-20-1.png differ
diff --git a/man/figures/README-unnamed-chunk-21-1.png b/man/figures/README-unnamed-chunk-21-1.png
index 246e3eef..eb759d89 100644
Binary files a/man/figures/README-unnamed-chunk-21-1.png and b/man/figures/README-unnamed-chunk-21-1.png differ
diff --git a/man/figures/README-unnamed-chunk-22-1.png b/man/figures/README-unnamed-chunk-22-1.png
index e1b4751a..a748b548 100644
Binary files a/man/figures/README-unnamed-chunk-22-1.png and b/man/figures/README-unnamed-chunk-22-1.png differ
diff --git a/man/figures/README-unnamed-chunk-23-1.png b/man/figures/README-unnamed-chunk-23-1.png
index 00f1d110..45ab957c 100644
Binary files a/man/figures/README-unnamed-chunk-23-1.png and b/man/figures/README-unnamed-chunk-23-1.png differ
diff --git a/man/figures/README-unnamed-chunk-24-1.png b/man/figures/README-unnamed-chunk-24-1.png
index 24d051b6..40e68091 100644
Binary files a/man/figures/README-unnamed-chunk-24-1.png and b/man/figures/README-unnamed-chunk-24-1.png differ
diff --git a/man/figures/mvgam_logo.png b/man/figures/mvgam_logo.png
new file mode 100644
index 00000000..ce0ace9b
Binary files /dev/null and b/man/figures/mvgam_logo.png differ
Examplesmod_data$time <- 1:NROW(mod_data)
# Fit a model with different smooths per factor level
-mod <- mvgam(y ~ s(x, bs = 'moi', by = fac, k = 8),
+mod <- mvgam(y ~ s(x, bs = 'moi', by = fac, k = 8),
data = mod_data,
family = gaussian())
diff --git a/docs/reference/mvgam.html b/docs/reference/mvgam.html
index a2c50701..cdc9d72f 100644
--- a/docs/reference/mvgam.html
+++ b/docs/reference/mvgam.html
@@ -91,6 +91,7 @@ Usage
prior_simulation = FALSE,
return_model_data = FALSE,
family = "poisson",
+ share_obs_params = FALSE,
use_lv = FALSE,
n_lv,
trend_map,
@@ -122,7 +123,7 @@ Usage
Arguments
- formula
A character
string specifying the GAM observation model formula. These are exactly like the formula
-for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
+for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
dynamic()
terms, can be added to the right hand side
to specify that the linear predictor depends on smooth functions of predictors
(or linear functionals of these). In nmix()
family models, the formula
is used to
@@ -201,22 +202,31 @@
Argumentsnb() for count data
poisson()
for count data
gaussian()
for real-valued data
-betar()
for proportional data on (0,1)
-lognormal()
for non-negative real-valued data
+betar()
for proportional data on (0,1)
+lognormal()
for non-negative real-valued data
student_t()
for real-valued data
Gamma()
for non-negative real-valued data
nmix()
for count data with imperfect detection modeled via a
State-Space N-Mixture model. The latent states are Poisson, capturing the 'true' latent
abundance, while the observation process is Binomial to account for imperfect detection.
See mvgam_families
for an example of how to use this family
-Note that only nb()
and poisson()
are available if using JAGS
as the backend.
+
Note that only nb()
and poisson()
are available if using JAGS
as the backend.
Default is poisson()
.
See mvgam_families
for more details
+- share_obs_params
+logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
+
+
- use_lv
logical
. If TRUE
, use dynamic factors to estimate series'
latent trends in a reduced dimension format. Only available for
@@ -453,8 +463,9 @@
Details
to ensure predictions can be made for all levels of the supplied factor variable
Observation level parameters: When more than one series is included in data
and an
observation family that contains more than one parameter is used, additional observation family parameters
-(i.e. phi
for nb()
or sigma
for gaussian()
) are
-estimated independently for each series.
+(i.e. phi
for nb()
or sigma
for gaussian()
) are
+by default estimated independently for each series. But if you wish for the series to share
+the same observation parameters, set share_obs_params = TRUE
Factor regularisation: When using a dynamic factor model for the trends with JAGS
factor precisions are given
regularized penalty priors to theoretically allow some factors to be dropped from the model by squeezing increasing
factors' variances to zero. This is done to help protect against selecting too many latent factors than are needed to
@@ -507,7 +518,7 @@ Examples# Formulate a model using Stan where series share a cyclic smooth for
# seasonality and each series has an independent random walk temporal process;
# Set run_model = FALSE to inspect the returned objects
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = 'poisson',
@@ -538,7 +549,7 @@ Examples refresh = 100)
# Now fit the model using mvgam with the Stan backend
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = poisson(),
@@ -574,7 +585,7 @@ Examplesplot(mod1, type = 'smooths', realisations = TRUE)
# Plot conditional response predictions using marginaleffects
-plot(conditional_effects(mod1), ask = FALSE)
+plot(conditional_effects(mod1), ask = FALSE)
plot_predictions(mod1, condition = 'season', points = 0.5)
# Extract observation model beta coefficient draws as a data.frame
@@ -597,7 +608,7 @@ Examples trend = c(1,1,2))
# Fit the model using AR1 trends
-mod <- mvgam(y ~ s(season, bs = 'cc'),
+mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_map = trend_map,
trend_model = 'AR1',
data = mod_data,
@@ -662,9 +673,9 @@ Examples# Fit a model that includes the offset in the linear predictor as well as
# hierarchical seasonal smooths
mod <- mvgam(formula = y ~ offset(offset) +
- s(series, bs = 're') +
- s(season, bs = 'cc') +
- s(season, by = series, m = 1, k = 5),
+ s(series, bs = 're') +
+ s(season, bs = 'cc') +
+ s(season, by = series, m = 1, k = 5),
data = dat$data_train,
trend_model = 'None',
use_stan = TRUE)
@@ -765,7 +776,7 @@ Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
+- share_obs_params
+logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
+
+
- priors
An optional data.frame
with prior
definitions (in JAGS or Stan syntax). if using Stan, this can also be an object of
diff --git a/index.Rmd b/index.Rmd
index e7112bb5..1e409a8d 100644
--- a/index.Rmd
+++ b/index.Rmd
@@ -5,6 +5,8 @@ always_allow_html: true
+
[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/index.md b/index.md
index 6441ce50..2fbd2c11 100644
--- a/index.md
+++ b/index.md
@@ -1,6 +1,8 @@
+
[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/man/figures/README-unnamed-chunk-13-1.png b/man/figures/README-unnamed-chunk-13-1.png
index 97f08209..63559a6a 100644
Binary files a/man/figures/README-unnamed-chunk-13-1.png and b/man/figures/README-unnamed-chunk-13-1.png differ
diff --git a/man/figures/README-unnamed-chunk-14-1.png b/man/figures/README-unnamed-chunk-14-1.png
index 8e34a550..1dca9500 100644
Binary files a/man/figures/README-unnamed-chunk-14-1.png and b/man/figures/README-unnamed-chunk-14-1.png differ
diff --git a/man/figures/README-unnamed-chunk-15-1.png b/man/figures/README-unnamed-chunk-15-1.png
index f801d30b..8b1142de 100644
Binary files a/man/figures/README-unnamed-chunk-15-1.png and b/man/figures/README-unnamed-chunk-15-1.png differ
diff --git a/man/figures/README-unnamed-chunk-16-1.png b/man/figures/README-unnamed-chunk-16-1.png
index 94d4bf12..ba4439e4 100644
Binary files a/man/figures/README-unnamed-chunk-16-1.png and b/man/figures/README-unnamed-chunk-16-1.png differ
diff --git a/man/figures/README-unnamed-chunk-17-1.png b/man/figures/README-unnamed-chunk-17-1.png
index 85e0db39..d722ba66 100644
Binary files a/man/figures/README-unnamed-chunk-17-1.png and b/man/figures/README-unnamed-chunk-17-1.png differ
diff --git a/man/figures/README-unnamed-chunk-18-1.png b/man/figures/README-unnamed-chunk-18-1.png
index fbb3a6b1..c72e0706 100644
Binary files a/man/figures/README-unnamed-chunk-18-1.png and b/man/figures/README-unnamed-chunk-18-1.png differ
diff --git a/man/figures/README-unnamed-chunk-19-1.png b/man/figures/README-unnamed-chunk-19-1.png
index 7f2f84c9..87c0bc2e 100644
Binary files a/man/figures/README-unnamed-chunk-19-1.png and b/man/figures/README-unnamed-chunk-19-1.png differ
diff --git a/man/figures/README-unnamed-chunk-20-1.png b/man/figures/README-unnamed-chunk-20-1.png
index 84f2b09d..d39944b0 100644
Binary files a/man/figures/README-unnamed-chunk-20-1.png and b/man/figures/README-unnamed-chunk-20-1.png differ
diff --git a/man/figures/README-unnamed-chunk-21-1.png b/man/figures/README-unnamed-chunk-21-1.png
index 246e3eef..eb759d89 100644
Binary files a/man/figures/README-unnamed-chunk-21-1.png and b/man/figures/README-unnamed-chunk-21-1.png differ
diff --git a/man/figures/README-unnamed-chunk-22-1.png b/man/figures/README-unnamed-chunk-22-1.png
index e1b4751a..a748b548 100644
Binary files a/man/figures/README-unnamed-chunk-22-1.png and b/man/figures/README-unnamed-chunk-22-1.png differ
diff --git a/man/figures/README-unnamed-chunk-23-1.png b/man/figures/README-unnamed-chunk-23-1.png
index 00f1d110..45ab957c 100644
Binary files a/man/figures/README-unnamed-chunk-23-1.png and b/man/figures/README-unnamed-chunk-23-1.png differ
diff --git a/man/figures/README-unnamed-chunk-24-1.png b/man/figures/README-unnamed-chunk-24-1.png
index 24d051b6..40e68091 100644
Binary files a/man/figures/README-unnamed-chunk-24-1.png and b/man/figures/README-unnamed-chunk-24-1.png differ
diff --git a/man/figures/mvgam_logo.png b/man/figures/mvgam_logo.png
new file mode 100644
index 00000000..ce0ace9b
Binary files /dev/null and b/man/figures/mvgam_logo.png differ
Usage
Arguments
- formula
A character
string specifying the GAM observation model formula. These are exactly like the formula
-for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
+for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
dynamic()
terms, can be added to the right hand side
to specify that the linear predictor depends on smooth functions of predictors
(or linear functionals of these). In nmix()
family models, the formula
is used to
@@ -201,22 +202,31 @@
Argumentsnb() for count data
poisson()
for count data
gaussian()
for real-valued data
-betar()
for proportional data on (0,1)
-lognormal()
for non-negative real-valued data
+betar()
for proportional data on (0,1)
+lognormal()
for non-negative real-valued data
student_t()
for real-valued data
Gamma()
for non-negative real-valued data
nmix()
for count data with imperfect detection modeled via a
State-Space N-Mixture model. The latent states are Poisson, capturing the 'true' latent
abundance, while the observation process is Binomial to account for imperfect detection.
See mvgam_families
for an example of how to use this family
-Note that only nb()
and poisson()
are available if using JAGS
as the backend.
+
Note that only nb()
and poisson()
are available if using JAGS
as the backend.
Default is poisson()
.
See mvgam_families
for more details
+- share_obs_params
+logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
+
+
- use_lv
logical
. If TRUE
, use dynamic factors to estimate series'
latent trends in a reduced dimension format. Only available for
@@ -453,8 +463,9 @@
Details
to ensure predictions can be made for all levels of the supplied factor variable
Observation level parameters: When more than one series is included in data
and an
observation family that contains more than one parameter is used, additional observation family parameters
-(i.e. phi
for nb()
or sigma
for gaussian()
) are
-estimated independently for each series.
+(i.e. phi
for nb()
or sigma
for gaussian()
) are
+by default estimated independently for each series. But if you wish for the series to share
+the same observation parameters, set share_obs_params = TRUE
Factor regularisation: When using a dynamic factor model for the trends with JAGS
factor precisions are given
regularized penalty priors to theoretically allow some factors to be dropped from the model by squeezing increasing
factors' variances to zero. This is done to help protect against selecting too many latent factors than are needed to
@@ -507,7 +518,7 @@ Examples# Formulate a model using Stan where series share a cyclic smooth for
# seasonality and each series has an independent random walk temporal process;
# Set run_model = FALSE to inspect the returned objects
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = 'poisson',
@@ -538,7 +549,7 @@ Examples refresh = 100)
# Now fit the model using mvgam with the Stan backend
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = poisson(),
@@ -574,7 +585,7 @@ Examplesplot(mod1, type = 'smooths', realisations = TRUE)
# Plot conditional response predictions using marginaleffects
-plot(conditional_effects(mod1), ask = FALSE)
+plot(conditional_effects(mod1), ask = FALSE)
plot_predictions(mod1, condition = 'season', points = 0.5)
# Extract observation model beta coefficient draws as a data.frame
@@ -597,7 +608,7 @@ Examples trend = c(1,1,2))
# Fit the model using AR1 trends
-mod <- mvgam(y ~ s(season, bs = 'cc'),
+mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_map = trend_map,
trend_model = 'AR1',
data = mod_data,
@@ -662,9 +673,9 @@ Examples# Fit a model that includes the offset in the linear predictor as well as
# hierarchical seasonal smooths
mod <- mvgam(formula = y ~ offset(offset) +
- s(series, bs = 're') +
- s(season, bs = 'cc') +
- s(season, by = series, m = 1, k = 5),
+ s(series, bs = 're') +
+ s(season, bs = 'cc') +
+ s(season, by = series, m = 1, k = 5),
data = dat$data_train,
trend_model = 'None',
use_stan = TRUE)
@@ -765,7 +776,7 @@ Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
+- share_obs_params
+logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
+
+
- priors
An optional data.frame
with prior
definitions (in JAGS or Stan syntax). if using Stan, this can also be an object of
diff --git a/index.Rmd b/index.Rmd
index e7112bb5..1e409a8d 100644
--- a/index.Rmd
+++ b/index.Rmd
@@ -5,6 +5,8 @@ always_allow_html: true
+
[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/index.md b/index.md
index 6441ce50..2fbd2c11 100644
--- a/index.md
+++ b/index.md
@@ -1,6 +1,8 @@
+
[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/man/figures/README-unnamed-chunk-13-1.png b/man/figures/README-unnamed-chunk-13-1.png
index 97f08209..63559a6a 100644
Binary files a/man/figures/README-unnamed-chunk-13-1.png and b/man/figures/README-unnamed-chunk-13-1.png differ
diff --git a/man/figures/README-unnamed-chunk-14-1.png b/man/figures/README-unnamed-chunk-14-1.png
index 8e34a550..1dca9500 100644
Binary files a/man/figures/README-unnamed-chunk-14-1.png and b/man/figures/README-unnamed-chunk-14-1.png differ
diff --git a/man/figures/README-unnamed-chunk-15-1.png b/man/figures/README-unnamed-chunk-15-1.png
index f801d30b..8b1142de 100644
Binary files a/man/figures/README-unnamed-chunk-15-1.png and b/man/figures/README-unnamed-chunk-15-1.png differ
diff --git a/man/figures/README-unnamed-chunk-16-1.png b/man/figures/README-unnamed-chunk-16-1.png
index 94d4bf12..ba4439e4 100644
Binary files a/man/figures/README-unnamed-chunk-16-1.png and b/man/figures/README-unnamed-chunk-16-1.png differ
diff --git a/man/figures/README-unnamed-chunk-17-1.png b/man/figures/README-unnamed-chunk-17-1.png
index 85e0db39..d722ba66 100644
Binary files a/man/figures/README-unnamed-chunk-17-1.png and b/man/figures/README-unnamed-chunk-17-1.png differ
diff --git a/man/figures/README-unnamed-chunk-18-1.png b/man/figures/README-unnamed-chunk-18-1.png
index fbb3a6b1..c72e0706 100644
Binary files a/man/figures/README-unnamed-chunk-18-1.png and b/man/figures/README-unnamed-chunk-18-1.png differ
diff --git a/man/figures/README-unnamed-chunk-19-1.png b/man/figures/README-unnamed-chunk-19-1.png
index 7f2f84c9..87c0bc2e 100644
Binary files a/man/figures/README-unnamed-chunk-19-1.png and b/man/figures/README-unnamed-chunk-19-1.png differ
diff --git a/man/figures/README-unnamed-chunk-20-1.png b/man/figures/README-unnamed-chunk-20-1.png
index 84f2b09d..d39944b0 100644
Binary files a/man/figures/README-unnamed-chunk-20-1.png and b/man/figures/README-unnamed-chunk-20-1.png differ
diff --git a/man/figures/README-unnamed-chunk-21-1.png b/man/figures/README-unnamed-chunk-21-1.png
index 246e3eef..eb759d89 100644
Binary files a/man/figures/README-unnamed-chunk-21-1.png and b/man/figures/README-unnamed-chunk-21-1.png differ
diff --git a/man/figures/README-unnamed-chunk-22-1.png b/man/figures/README-unnamed-chunk-22-1.png
index e1b4751a..a748b548 100644
Binary files a/man/figures/README-unnamed-chunk-22-1.png and b/man/figures/README-unnamed-chunk-22-1.png differ
diff --git a/man/figures/README-unnamed-chunk-23-1.png b/man/figures/README-unnamed-chunk-23-1.png
index 00f1d110..45ab957c 100644
Binary files a/man/figures/README-unnamed-chunk-23-1.png and b/man/figures/README-unnamed-chunk-23-1.png differ
diff --git a/man/figures/README-unnamed-chunk-24-1.png b/man/figures/README-unnamed-chunk-24-1.png
index 24d051b6..40e68091 100644
Binary files a/man/figures/README-unnamed-chunk-24-1.png and b/man/figures/README-unnamed-chunk-24-1.png differ
diff --git a/man/figures/mvgam_logo.png b/man/figures/mvgam_logo.png
new file mode 100644
index 00000000..ce0ace9b
Binary files /dev/null and b/man/figures/mvgam_logo.png differ
A character
string specifying the GAM observation model formula. These are exactly like the formula
-for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
+for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
dynamic()
terms, can be added to the right hand side
to specify that the linear predictor depends on smooth functions of predictors
(or linear functionals of these). In nmix()
family models, the formula
is used to
@@ -201,22 +202,31 @@
Argumentsnb() for count data
poisson()
for count data
gaussian()
for real-valued data
betar()
for proportional data on (0,1)
lognormal()
for non-negative real-valued data
betar()
for proportional data on (0,1)
lognormal()
for non-negative real-valued data
student_t()
for real-valued data
Gamma()
for non-negative real-valued data
nmix()
for count data with imperfect detection modeled via a
State-Space N-Mixture model. The latent states are Poisson, capturing the 'true' latent
abundance, while the observation process is Binomial to account for imperfect detection.
See mvgam_families
for an example of how to use this family
Note that only nb()
and poisson()
are available if using JAGS
as the backend.
+
Note that only nb()
and poisson()
are available if using JAGS
as the backend.
Default is poisson()
.
See mvgam_families
for more details
logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
logical
. If TRUE
, use dynamic factors to estimate series'
latent trends in a reduced dimension format. Only available for
@@ -453,8 +463,9 @@
Details
to ensure predictions can be made for all levels of the supplied factor variable
Observation level parameters: When more than one series is included in data
and an
observation family that contains more than one parameter is used, additional observation family parameters
-(i.e. phi
for nb()
or sigma
for gaussian()
) are
-estimated independently for each series.
+(i.e. phi
for nb()
or sigma
for gaussian()
) are
+by default estimated independently for each series. But if you wish for the series to share
+the same observation parameters, set share_obs_params = TRUE
Factor regularisation: When using a dynamic factor model for the trends with JAGS
factor precisions are given
regularized penalty priors to theoretically allow some factors to be dropped from the model by squeezing increasing
factors' variances to zero. This is done to help protect against selecting too many latent factors than are needed to
@@ -507,7 +518,7 @@ Examples# Formulate a model using Stan where series share a cyclic smooth for
# seasonality and each series has an independent random walk temporal process;
# Set run_model = FALSE to inspect the returned objects
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = 'poisson',
@@ -538,7 +549,7 @@ Examples refresh = 100)
# Now fit the model using mvgam with the Stan backend
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = poisson(),
@@ -574,7 +585,7 @@ Examplesplot(mod1, type = 'smooths', realisations = TRUE)
# Plot conditional response predictions using marginaleffects
-plot(conditional_effects(mod1), ask = FALSE)
+plot(conditional_effects(mod1), ask = FALSE)
plot_predictions(mod1, condition = 'season', points = 0.5)
# Extract observation model beta coefficient draws as a data.frame
@@ -597,7 +608,7 @@ Examples trend = c(1,1,2))
# Fit the model using AR1 trends
-mod <- mvgam(y ~ s(season, bs = 'cc'),
+mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_map = trend_map,
trend_model = 'AR1',
data = mod_data,
@@ -662,9 +673,9 @@ Examples# Fit a model that includes the offset in the linear predictor as well as
# hierarchical seasonal smooths
mod <- mvgam(formula = y ~ offset(offset) +
- s(series, bs = 're') +
- s(season, bs = 'cc') +
- s(season, by = series, m = 1, k = 5),
+ s(series, bs = 're') +
+ s(season, bs = 'cc') +
+ s(season, by = series, m = 1, k = 5),
data = dat$data_train,
trend_model = 'None',
use_stan = TRUE)
@@ -765,7 +776,7 @@ Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
Examples refresh = 100)
# Now fit the model using mvgam with the Stan backend
-mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
+mod1 <- mvgam(formula = y ~ s(season, bs = 'cc'),
data = dat$data_train,
trend_model = 'RW',
family = poisson(),
@@ -574,7 +585,7 @@ Examplesplot(mod1, type = 'smooths', realisations = TRUE)
# Plot conditional response predictions using marginaleffects
-plot(conditional_effects(mod1), ask = FALSE)
+plot(conditional_effects(mod1), ask = FALSE)
plot_predictions(mod1, condition = 'season', points = 0.5)
# Extract observation model beta coefficient draws as a data.frame
@@ -597,7 +608,7 @@ Examples trend = c(1,1,2))
# Fit the model using AR1 trends
-mod <- mvgam(y ~ s(season, bs = 'cc'),
+mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_map = trend_map,
trend_model = 'AR1',
data = mod_data,
@@ -662,9 +673,9 @@ Examples# Fit a model that includes the offset in the linear predictor as well as
# hierarchical seasonal smooths
mod <- mvgam(formula = y ~ offset(offset) +
- s(series, bs = 're') +
- s(season, bs = 'cc') +
- s(season, by = series, m = 1, k = 5),
+ s(series, bs = 're') +
+ s(season, bs = 'cc') +
+ s(season, by = series, m = 1, k = 5),
data = dat$data_train,
trend_model = 'None',
use_stan = TRUE)
@@ -765,7 +776,7 @@ Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
Examples trend = c(1,1,2))
# Fit the model using AR1 trends
-mod <- mvgam(y ~ s(season, bs = 'cc'),
+mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_map = trend_map,
trend_model = 'AR1',
data = mod_data,
@@ -662,9 +673,9 @@ Examples# Fit a model that includes the offset in the linear predictor as well as
# hierarchical seasonal smooths
mod <- mvgam(formula = y ~ offset(offset) +
- s(series, bs = 're') +
- s(season, bs = 'cc') +
- s(season, by = series, m = 1, k = 5),
+ s(series, bs = 're') +
+ s(season, bs = 'cc') +
+ s(season, by = series, m = 1, k = 5),
data = dat$data_train,
trend_model = 'None',
use_stan = TRUE)
@@ -765,7 +776,7 @@ Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
Examples
# View the changepoints with ggplot2 utilities
library(ggplot2)
-mcmc_plot(mod, variable = 'delta_trend',
+mcmc_plot(mod, variable = 'delta_trend',
regex = TRUE) +
scale_y_discrete(labels = mod$trend_model$changepoints) +
labs(y = 'Potential changepoint',
diff --git a/docs/reference/update.mvgam.html b/docs/reference/update.mvgam.html
index c3b8b5a0..823f41e0 100644
--- a/docs/reference/update.mvgam.html
+++ b/docs/reference/update.mvgam.html
@@ -72,6 +72,7 @@ Usage
use_lv,
n_lv,
family,
+ share_obs_params,
priors,
lfo = FALSE,
...
@@ -175,6 +176,15 @@ Argumentsmvgam_families for more details
Argumentsmvgam_families for more details
logical
. If TRUE
and the family
+has additional family-specific observation parameters (e.g. variance components in
+student_t()
or gaussian()
, or dispersion parameters in nb()
or betar()
),
+these parameters will be shared across all series. This is handy if you have multiple
+time series that you believe share some properties, such as being from the same
+species over different spatial units. Default is FALSE
.
An optional data.frame
with prior
definitions (in JAGS or Stan syntax). if using Stan, this can also be an object of
diff --git a/index.Rmd b/index.Rmd
index e7112bb5..1e409a8d 100644
--- a/index.Rmd
+++ b/index.Rmd
@@ -5,6 +5,8 @@ always_allow_html: true
+[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/index.md b/index.md
index 6441ce50..2fbd2c11 100644
--- a/index.md
+++ b/index.md
@@ -1,6 +1,8 @@
+[
](https://mc-stan.org/)
+
## mvgam
**M**ulti**V**ariate (Dynamic) **G**eneralized **A**ddivite **M**odels
diff --git a/man/figures/README-unnamed-chunk-13-1.png b/man/figures/README-unnamed-chunk-13-1.png
index 97f08209..63559a6a 100644
Binary files a/man/figures/README-unnamed-chunk-13-1.png and b/man/figures/README-unnamed-chunk-13-1.png differ
diff --git a/man/figures/README-unnamed-chunk-14-1.png b/man/figures/README-unnamed-chunk-14-1.png
index 8e34a550..1dca9500 100644
Binary files a/man/figures/README-unnamed-chunk-14-1.png and b/man/figures/README-unnamed-chunk-14-1.png differ
diff --git a/man/figures/README-unnamed-chunk-15-1.png b/man/figures/README-unnamed-chunk-15-1.png
index f801d30b..8b1142de 100644
Binary files a/man/figures/README-unnamed-chunk-15-1.png and b/man/figures/README-unnamed-chunk-15-1.png differ
diff --git a/man/figures/README-unnamed-chunk-16-1.png b/man/figures/README-unnamed-chunk-16-1.png
index 94d4bf12..ba4439e4 100644
Binary files a/man/figures/README-unnamed-chunk-16-1.png and b/man/figures/README-unnamed-chunk-16-1.png differ
diff --git a/man/figures/README-unnamed-chunk-17-1.png b/man/figures/README-unnamed-chunk-17-1.png
index 85e0db39..d722ba66 100644
Binary files a/man/figures/README-unnamed-chunk-17-1.png and b/man/figures/README-unnamed-chunk-17-1.png differ
diff --git a/man/figures/README-unnamed-chunk-18-1.png b/man/figures/README-unnamed-chunk-18-1.png
index fbb3a6b1..c72e0706 100644
Binary files a/man/figures/README-unnamed-chunk-18-1.png and b/man/figures/README-unnamed-chunk-18-1.png differ
diff --git a/man/figures/README-unnamed-chunk-19-1.png b/man/figures/README-unnamed-chunk-19-1.png
index 7f2f84c9..87c0bc2e 100644
Binary files a/man/figures/README-unnamed-chunk-19-1.png and b/man/figures/README-unnamed-chunk-19-1.png differ
diff --git a/man/figures/README-unnamed-chunk-20-1.png b/man/figures/README-unnamed-chunk-20-1.png
index 84f2b09d..d39944b0 100644
Binary files a/man/figures/README-unnamed-chunk-20-1.png and b/man/figures/README-unnamed-chunk-20-1.png differ
diff --git a/man/figures/README-unnamed-chunk-21-1.png b/man/figures/README-unnamed-chunk-21-1.png
index 246e3eef..eb759d89 100644
Binary files a/man/figures/README-unnamed-chunk-21-1.png and b/man/figures/README-unnamed-chunk-21-1.png differ
diff --git a/man/figures/README-unnamed-chunk-22-1.png b/man/figures/README-unnamed-chunk-22-1.png
index e1b4751a..a748b548 100644
Binary files a/man/figures/README-unnamed-chunk-22-1.png and b/man/figures/README-unnamed-chunk-22-1.png differ
diff --git a/man/figures/README-unnamed-chunk-23-1.png b/man/figures/README-unnamed-chunk-23-1.png
index 00f1d110..45ab957c 100644
Binary files a/man/figures/README-unnamed-chunk-23-1.png and b/man/figures/README-unnamed-chunk-23-1.png differ
diff --git a/man/figures/README-unnamed-chunk-24-1.png b/man/figures/README-unnamed-chunk-24-1.png
index 24d051b6..40e68091 100644
Binary files a/man/figures/README-unnamed-chunk-24-1.png and b/man/figures/README-unnamed-chunk-24-1.png differ
diff --git a/man/figures/mvgam_logo.png b/man/figures/mvgam_logo.png
new file mode 100644
index 00000000..ce0ace9b
Binary files /dev/null and b/man/figures/mvgam_logo.png differ