Learn R Programming

SparseTSCGM (version 1.0)

sim.data: Simulation from first order autoregressive time series chain graphical models

Description

This function provides repeated multivariate time series simulated data from random chain graph represented by precision and autoregressive coefficients matrices.

Usage

sim.data(time=time,n_obs=n_obs, n_var=n_var,prob0=prob0)

Arguments

time
Number of time points.
n_obs
Number of repeated observations at each time point.
n_var
Number of variables.
prob0
The probability that a pair of nodes has an edge.

Value

  • A list containing:
  • data1Simulated data in longitudinal data format.
  • true_omegaPrecision matrix.
  • true_gammaAutoregressive coefficients matrix.

References

Fentaw Abegaz and Ernst wit (2012) Sparse time series chain graphical models for reconstructing genetic networks. Biostatistics, doi:10.1093/biostatistics/kxt005. Li H., Zhao T., Wang L. Yuan X. and Lui H. (2013), flare: Family of Lasso Regression (R package), http://flare.r-forge.r-project.org

Examples

Run this code
#Simulated data from random graph
set.seed(1)
simu <- sim.data(time=10,n_obs=5, n_var=20,prob0=0.15)
Sdata <- simu$data1
prec.mat <- simu$true_omega
autoreg.mat <- simu$true_gamma

Run the code above in your browser using DataLab