indsim: Simulation time series data for individual

Description Usage Format Examples

Description

A dataset containing values of 10 interested variables over 50 periods.

Usage

1

Format

An object of class matrix (inherits from array) with 50 rows and 10 columns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Generated by the following R codes
set.seed(1000)
n = 50
p = 10
precision = diag(rep(2, p))        # generate precision matrix
for (i in 1 : (p - 1)){
  if (i <= 2 * p / 3) temp = 1
  if (i > 2 * p / 3) temp = 0.4
  precision[i, i + 1] = temp
  precision[i + 1, i] = temp
}
Sigma = solve(precision)           # generate covariance matrix
rho = 0.5
X = matrix(0, n, p)                # observed time series data
Epsilon = MASS::mvrnorm(n, rep(0, p), Sigma)
X[1, ] = Epsilon[1, ]
for (i in 2 : n){
  X[i, ] = rho * X[i - 1, ] + sqrt(1 - rho^2) * Epsilon[i, ]
}
indsim = X

BrainCon documentation built on Sept. 30, 2021, 5:10 p.m.

Related to indsim in BrainCon...