Skip to Content

SimulGeneExpressionAR1 {G1DBN}

First order multivariate Auto-Regressive time series generation
Package: 
G1DBN
Version: 
3.1.1

Description

This function generates multivariate time series according to the following first order Auto-Regressive process, X(t)= A X(t-1) + B + \varepsilon(t), where \varepsilon(t) follows a zero-centered multivariate gaussian distribution whose variance matrix S is diagonal.

Usage

SimulGeneExpressionAR1(A,B,X0,SigmaEps,n)

Arguments

         

A
a matrix (p     imes p)
B
a column vector (p     imes 1)
X0
a column vector (p     imes 1) containing the values of the process at time 0
SigmaEps
a column vector (p     imes 1) containing the values of the diagonal of covariance matrix S
n
the desired length of the time serie.

Values

A matrix, with n rows (=length) and p columns (=dimension), containing the generated time series,

See Also

SimulNetworkAdjMatrix

Examples

library(G1DBN)
## number of genes
p <- 20
## the network - adjacency Matrix
MyNet <- SimulNetworkAdjMatrix(p,0.05,c(-1,0,0,1))
 
## initializing the B vector
B <- runif(p,0,0.5)
## initializing the variance of the noise
sigmaEps <- runif(p,0.1,0.8)
## initializing the process Xt
X0 <- B + rnorm(p,0,sigmaEps*10)
## number of time points
n <- 30
 
## the AR(1) time series process
Xn <- SimulGeneExpressionAR1(MyNet$A,B,X0,sigmaEps,n)
 
plot(1:n, Xn[,1],type="l", xlab="Time t", ylab="X(t)",
main="Simulated AR(1) time series", ylim=c(min(Xn),max(Xn)))
 
for (i in 2:p){
  lines(1:n,Xn[,i],col=i)
}

Documentation reproduced from package G1DBN, version 3.1.1. License: GPL (>= 2)