View source: R/plot_mvgam_factors.R
| plot_mvgam_factors | R Documentation |
This function takes a fitted mvgam object and returns plots and
summary statistics for the latent dynamic factors
plot_mvgam_factors(object, plot = TRUE)
object |
|
plot |
|
If the model in object was estimated using dynamic factors,
it is possible that not all factors contributed to the estimated trends.
This is due to the regularisation penalty that acts independently on each
factor's Gaussian precision, which will squeeze un-needed factors to a
white noise process (effectively dropping that factor from the model). In
this function, each factor is tested against a null hypothesis of white
noise by calculating the sum of the factor's 2nd derivatives. A factor
that has a larger contribution will have a larger sum due to the weaker
penalty on the factor's precision. If plot == TRUE, the factors
are also plotted.
A data.frame of factor contributions
Nicholas J Clark
## Not run:
simdat <- sim_mvgam()
mod <- mvgam(
y ~ s(season, bs = 'cc', k = 6),
trend_model = AR(),
use_lv = TRUE,
n_lv = 2,
data = simdat$data_train,
chains = 2,
silent = 2
)
plot_mvgam_factors(mod)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.