SimulGeneExpressionAR1: First order multivariate Auto-Regressive time series...

Description Usage Arguments Value Author(s) See Also Examples

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

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

Arguments

A

a matrix (p \times p)

B

a column vector (p \times 1)

X0

a column vector (p \times 1) containing the values of the process at time 0

SigmaEps

a column vector (p \times 1) containing the values of the diagonal of covariance matrix S

n

the desired length of the time serie.

Value

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

Author(s)

Lebre Sophie (http://icube-bfo.unistra.fr/en/index.php/Sophie_Lebre),

Chiquet Julien (http://stat.genopole.cnrs.fr/~jchiquet).

See Also

SimulNetworkAdjMatrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)
}

G1DBN documentation built on May 2, 2019, 3:41 p.m.