Learn R Programming

mgm

The package includes functions to estimate, visualize and resample time-varying k-order Mixed Graphical Models (MGMs) and mixed Vector Autoregressive (mVAR) models.

Here is a paper describing the package: https://arxiv.org/abs/1510.06871

And here are a couple of blog posts about some functions: https://jmbh.github.io/

The developmental version can be installed from within R using the devtools-package:

library(devtools) install_github("jmbh/mgm")

Copy Link

Version

Install

install.packages('mgm')

Monthly Downloads

2,964

Version

1.2-15

License

GPL (>= 2)

Maintainer

Jonas Haslbeck

Last Published

March 16th, 2025

Functions in mgm (1.2-15)

bwSelect

Select optimal bandwidth for time-varying MGMs and mVAR Models
mgm

Estimating Mixed Graphical Models
condition

Computes mgm object conditional on a set of variables
FactorGraph

Draws a factor graph of a (time-varying) MGM
mvarsampler

Sampling from a mixed VAR model
mgm-package

Estimating Time-Varying k-order Mixed Graphical Models
mgmsampler

Sample from k-order Mixed Graphical Model
mvar

Estimating mixed Vector Autoregressive Model (mVAR)
plotRes

Plot summary of resampled sampling distributions
showInteraction

Retrieving details of interactions
datasets

Example Datasets in the mgm Package
mgm-internal

Internal mgm functions
tvmvarsampler

Sampling from a time-varying mixed VAR model
tvmgm

Estimating time-varying Mixed Graphical Models
print.mgm

Print method for mgm objects
tvmgmsampler

Sample from time-varying k-order Mixed Graphical Model
resample

Resampling scheme for mgm objects
tvmvar

Estimating time-varying Mixed Vector Autoregressive Model (mVAR)
print.int

Print method for int objects
predict.mgm

Compute predictions from mgm model objects