Package: mvgam 1.1.5003

mvgam: Multivariate (Dynamic) Generalized Additive Models

Fit Bayesian Dynamic Generalized Additive Models to multivariate observations. Users can build nonlinear State-Space models that can incorporate semiparametric effects in observation and process components, using a wide range of observation families. Estimation is performed using Markov Chain Monte Carlo with Hamiltonian Monte Carlo in the software 'Stan'. References: Clark & Wells (2023) <doi:10.1111/2041-210X.13974>.

Authors:Nicholas J Clark [aut, cre], Sarah Heaps [ctb], Scott Pease [ctb], Matthijs Hollanders [ctb]

mvgam_1.1.5003.tar.gz
mvgam_1.1.5003.zip(r-4.5)mvgam_1.1.5003.zip(r-4.4)mvgam_1.1.5003.zip(r-4.3)
mvgam_1.1.5003.tgz(r-4.5-x86_64)mvgam_1.1.5003.tgz(r-4.5-arm64)mvgam_1.1.5003.tgz(r-4.4-x86_64)mvgam_1.1.5003.tgz(r-4.4-arm64)mvgam_1.1.5003.tgz(r-4.3-x86_64)mvgam_1.1.5003.tgz(r-4.3-arm64)
mvgam_1.1.5003.tar.gz(r-4.5-noble)mvgam_1.1.5003.tar.gz(r-4.4-noble)
mvgam_1.1.5003.tgz(r-4.4-emscripten)mvgam_1.1.5003.tgz(r-4.3-emscripten)
mvgam.pdf |mvgam.html
mvgam/json (API)
NEWS

# Install 'mvgam' in R:
install.packages('mvgam', repos = c('https://nicholasjclark.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/nicholasjclark/mvgam/issues

Pkgdown site:https://nicholasjclark.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

bayesian-statisticsdynamic-factor-modelsecological-modellingforecastinggaussian-processgeneralised-additive-modelsgeneralized-additive-modelsjoint-species-distribution-modellingmultilevel-modelsmultivariate-timeseriesstantime-series-analysistimeseriesvector-autoregressionvectorautoregressioncpp

9.85 score 140 stars 117 scripts 742 downloads 94 exports 81 dependencies

Last updated 2 hours agofrom:8a3d615b33. Checks:1 OK, 11 NOTE. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 11 2025
R-4.5-win-x86_64NOTEMar 11 2025
R-4.5-mac-x86_64NOTEMar 11 2025
R-4.5-mac-aarch64NOTEMar 11 2025
R-4.5-linux-x86_64NOTEMar 11 2025
R-4.4-win-x86_64NOTEMar 11 2025
R-4.4-mac-x86_64NOTEMar 11 2025
R-4.4-mac-aarch64NOTEMar 11 2025
R-4.4-linux-x86_64NOTEMar 11 2025
R-4.3-win-x86_64NOTEMar 11 2025
R-4.3-mac-x86_64NOTEMar 11 2025
R-4.3-mac-aarch64NOTEMar 11 2025

Exports:%>%add_residualsARas_drawsas_draws_arrayas_draws_dfas_draws_listas_draws_matrixas_draws_rvarsaugmentavg_predictionsbernoullibeta_binomialbetarCARcodecompare_mvgamscomparisonsconditional_effectsdatagriddrawDotmvgamdynamicensembleeval_mvgameval_smoothDothilbertDotsmootheval_smoothDotmodDotsmootheval_smoothDotmoiDotsmoothfevdforecastget_dataget_mvgam_priorsget_predictgpGPhindcasthow_to_citehypothesesirfjsdgamlfo_cvlognormallooloo_comparelv_correlationsmcmc_plotmvgamnbneff_rationmixnuts_paramsplot_comparisonsplot_mvgam_factorsplot_mvgam_fcplot_mvgam_ptermsplot_mvgam_randomeffectsplot_mvgam_residsplot_mvgam_seriesplot_mvgam_smoothplot_mvgam_trendplot_mvgam_uncertaintyplot_predictionsplot_slopesposterior_epredposterior_linpredposterior_predictpp_checkppcpredictionspriorprior_prior_stringPWresidual_corrhatroll_eval_mvgamRWsscoreseries_to_mvgamset_priorsim_mvgamslopesstabilitystancodestandatastudentstudent_tt2tetitweedieVARvariablesZMVN

Dependencies:abindbackportsbayesplotBHbridgesamplingbrmsBrobdingnagcallrcheckmateclicodacodetoolscolorspacedata.tabledescdigestdistributionaldplyrfansifarverfuturefuture.applygenericsggplot2ggridgesglobalsgluegridExtragtableinlineinsightisobandlabelinglatticelifecyclelistenvloomagrittrmarginaleffectsMASSMatrixmatrixStatsmgcvmunsellmvnfastmvtnormnleqslvnlmenumDerivparallellypatchworkpillarpkgbuildpkgconfigplyrposteriorprocessxpspurrrQuickJSRR6RColorBrewerRcppRcppArmadilloRcppEigenRcppParallelreshape2rlangrstanrstantoolsscalesStanHeadersstringistringrtensorAtibbletidyselectutf8vctrsviridisLitewithr

Forecasting and forecast evaluation in mvgam

Rendered fromforecast_evaluation.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-03-10
Started: 2023-10-23

Formatting data for use in mvgam

Rendered fromdata_in_mvgam.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-03-10
Started: 2023-09-20

N-mixtures in mvgam

Rendered fromnmixtures.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-02-27
Started: 2024-01-29

Overview of the mvgam package

Rendered frommvgam_overview.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-03-10
Started: 2023-08-29

Shared latent states in mvgam

Rendered fromshared_states.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-03-10
Started: 2023-09-29

State-Space models in mvgam

Rendered fromtrend_formulas.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-03-10
Started: 2023-09-01

Time-varying effects in mvgam

Rendered fromtime_varying_effects.Rmdusingknitr::rmarkdownon Mar 11 2025.

Last update: 2025-02-27
Started: 2023-10-14

Readme and manuals

Help Manual

Help pageTopics
Calculate randomized quantile residuals for 'mvgam' objectsadd_residuals add_residuals.mvgam
NEON Amblyomma and Ixodes tick abundance survey dataall_neon_tick_data
Augment an 'mvgam' object's dataaugment.mvgam
Stan code and data objects for 'mvgam' modelscode stancode.mvgam stancode.mvgam_prefit standata.mvgam_prefit
Display conditional effects of predictors for 'mvgam' modelsconditional_effects.mvgam plot.mvgam_conditional_effects print.mvgam_conditional_effects
Defining dynamic coefficients in 'mvgam' formulaedynamic
Combine forecasts from 'mvgam' models into evenly weighted ensemblesensemble ensemble.mvgam_forecast
Evaluate forecasts from fitted 'mvgam' objectscompare_mvgams evaluate_mvgams eval_mvgam roll_eval_mvgam
Calculate latent VAR forecast error variance decompositionsfevd fevd.mvgam
Expected values of the posterior predictive distribution for 'mvgam' objectsfitted.mvgam
Extract or compute hindcasts and forecasts for a fitted 'mvgam' objectforecast forecast.mvgam
Extract formulae from 'mvgam' objectsformula.mvgam formula.mvgam_prefit
Extract information on default prior distributions for an 'mvgam' modelget_mvgam_priors
Specify dynamic Gaussian process trends in 'mvgam' modelsGP
Enhance post-processing of 'mvgam' models using 'gratia' functionalitydraw.mvgam drawDotmvgam eval_smooth.hilbert.smooth eval_smooth.mod.smooth eval_smooth.moi.smooth eval_smoothDothilbertDotsmooth eval_smoothDotmodDotsmooth eval_smoothDotmoiDotsmooth gratia_mvgam_enhancements
Extract hindcasts for a fitted 'mvgam' objecthindcast hindcast.mvgam
Generate a methods description for 'mvgam' modelshow_to_cite how_to_cite.mvgam
Index 'mvgam' objectsand coefficient Index index-mvgam names their variables variables.mvgam `mgcv`
Calculate latent VAR impulse response functionsirf irf.mvgam
Fit Joint Species Distribution Models in 'mvgam'jsdgam
Approximate leave-future-out cross-validation of fitted 'mvgam' objectslfo_cv lfo_cv.mvgam
Compute pointwise Log-Likelihoods from fitted 'mvgam' objectslogLik.mvgam
LOO information criteria for 'mvgam' modelsloo.mvgam loo_compare.mvgam
Calculate trend correlations based on latent factor loadings for 'mvgam' modelslv_correlations
MCMC plots of 'mvgam' parameters, as implemented in 'bayesplot'mcmc_plot.mvgam
Extract model.frame from a fitted 'mvgam' objectmodel.frame.mvgam model.frame.mvgam_prefit
Monotonic splines in 'mvgam' modelsmonotonic Predict.matrix.mod.smooth Predict.matrix.moi.smooth smooth.construct.mod.smooth.spec smooth.construct.moi.smooth.spec
Fit a Bayesian dynamic GAM to a univariate or multivariate set of time seriesmvgam
Extract diagnostic quantities of 'mvgam' modelslog_posterior.mvgam mvgam_diagnostics neff_ratio neff_ratio.mvgam nuts_params nuts_params.mvgam rhat rhat.mvgam
Extract posterior draws from fitted 'mvgam' objectsas.array.mvgam as.data.frame.mvgam as.matrix.mvgam as_draws.mvgam as_draws_array.mvgam as_draws_df.mvgam as_draws_list.mvgam as_draws_matrix.mvgam as_draws_rvars.mvgam mvgam_draws
Supported 'mvgam' familiesbernoulli betar beta_binomial lognormal mvgam_families nb nmix student student_t tweedie
'mvgam_fevd' object descriptionmvgam_fevd-class
'mvgam_forecast' object descriptionmvgam_forecast-class
Details of formula specifications in 'mvgam' modelsmvgam_formulae
'mvgam_irf' object descriptionmvgam_irf-class
Helper functions for 'marginaleffects' calculations in 'mvgam' modelsfind_predictors.mvgam find_predictors.mvgam_prefit get_coef.mvgam get_data.mvgam get_data.mvgam_prefit get_predict.mvgam get_vcov.mvgam mvgam_marginaleffects set_coef.mvgam
Supported latent trend models in 'mvgam'mvgam_trends
Fitted 'mvgam' object descriptionmvgam-class
Create a matrix of output plots from a 'mvgam' objectpairs.mvgam
Latent factor summaries for a fitted 'mvgam' objectplot_mvgam_factors
Plot posterior forecast predictions from 'mvgam' modelsplot.mvgam_forecast plot_mvgam_fc plot_mvgam_forecasts
Plot parametric term partial effects for 'mvgam' modelsplot_mvgam_pterms
Plot random effect terms from 'mvgam' modelsplot_mvgam_randomeffects
Residual diagnostics for a fitted 'mvgam' objectplot_mvgam_resids
Plot observed time series used for 'mvgam' modellingplot_mvgam_series
Plot smooth terms from 'mvgam' modelsplot_mvgam_smooth
Plot latent trend predictions from 'mvgam' modelsplot_mvgam_trend
Plot forecast uncertainty contributions from 'mvgam' modelsplot_mvgam_uncertainty
Default plots for 'mvgam' modelsplot.mvgam
Plot forecast error variance decompositions from an 'mvgam_fevd' objectplot.mvgam_fevd
Plot impulse responses from an 'mvgam_irf' objectplot.mvgam_irf
Plot Pareto-k and ELPD values from a 'mvgam_lfo' objectplot.mvgam_lfo
Plot residual correlations based on latent factors from a fitted jsdgamplot.mvgam_residcor
Portal Project rodent capture survey dataportal_data
Draws from the expected value of the posterior predictive distribution for 'mvgam' objectsposterior_epred.mvgam
Posterior draws of the linear predictor for 'mvgam' objectsposterior_linpred.mvgam
Draws from the posterior predictive distribution for 'mvgam' objectsposterior_predict.mvgam
Posterior Predictive Checks for 'mvgam' modelspp_check pp_check.mvgam
Plot conditional posterior predictive checks from 'mvgam' modelsppc ppc.mvgam
Predict from a fitted 'mvgam' modelpredict.mvgam
Summary for a fitted 'mvgam' objectprint.mvgam
Specify piecewise linear or logistic trends in 'mvgam' modelsPW
Extract residual correlations based on latent factors from a fitted jsdgamresidual_cor residual_cor.jsdgam
Posterior draws of residuals from 'mvgam' modelsresiduals.mvgam
Specify autoregressive dynamic processes in 'mvgam'AR CAR RW VAR
Compute probabilistic forecast scores for 'mvgam' modelsscore score.mvgam_forecast
Convert timeseries object to format necessary for 'mvgam' modelsseries_to_mvgam
Simulate a set of time series for modelling in 'mvgam'sim_mvgam
Calculate measures of latent VAR community stabilitystability stability.mvgam
Summary for a fitted 'mvgam' modelscoef.mvgam summary.mvgam summary.mvgam_prefit
Posterior summary of forecast error variance decompositionssummary.mvgam_fevd
Posterior summary of impulse responsessummary.mvgam_irf
Update an existing 'mvgam' model objectupdate.jsdgam update.mvgam
Specify correlated residual processes in 'mvgam'ZMVN