simuOneCol: Function to generate data of one column

Description Usage Arguments Examples

View source: R/simu1col.R

Description

Function to generate data of one column

Usage

1
simuOneCol(n_time, n_grp, rho, omega, rndVar = F, mean = 0, sd = 0)

Arguments

n_time

Length of the time series

n_grp

Number of groups

rho

Parameter of serial correlation

omega

Parameter of synchronization

rndVar

Set random numbers for the each group mean. Default is FALSE

mean

mean value (hyper parameter) in the distribution of the group mean. Default is 0

sd

sd value (hyper parameter) in the distribution of the group mean. Default is 0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n_time <- 100
n_grp <- 5

y <- simuOneCol(n_time, n_area, rho = 0.5, omega = 0.5,
 rndVar = T, mean = 0, sd = 1)
x0 <- rep(1, n_time * n_grp) # Intercept
x1 <- simuOneCol(n_time, n_grp, rho = 0.5, omega = 1)
x2 <- simuOneCol(n_time, n_grp, rho = 0.5, omega = 0)
area <- makeGrp(n_time, n_grp)

dat <- data.frame(y, x0, x1, x2, area)

ShojiTaniguchi/timsync documentation built on Oct. 10, 2020, 3:33 p.m.