simon: simulating dataset (Online settings)

Description Usage Arguments Value See Also Examples

View source: R/simon.R

Description

Function to simulate datasets based on the VAR(1) model (without intercept). The dataset include in control batches and new batches for online monitoring

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simon(
  n = 100,
  I = 200,
  size = 2,
  Inew = 5,
  n1 = 50,
  B1 = matrix(c(-0.3, 0.4, 0.4, 0.5), ncol = size, byrow = TRUE),
  varcov = diag(2),
  B1new = matrix(c(-0.3, 0.4, 0.4, 0.5), ncol = size, byrow = TRUE)
)

Arguments

n

number of time-instants

I

number of in control batch samples

size

number of variables

Inew

number of new batch samples for monitoring

n1

number of time-instants for the new batches under the in control process

B1

matrix (size x size) containing the VAR(1) coefficients of in control batches

varcov

covariance matrix (size x size) of errors

B1new

matrix (size x size) containing the VAR(1) coefficients of new batches

Value

data A dataframe of reference dataset of I in control batches. For each batch, variables are arranged in lines and columns are time-instants. The different batches are combined in a single dataset of dimension [(I * size) X n]

newdata A dataframe including a dataset of Inew new batches for monitoring (each with same number of variables and time-instants of data). The different batches are combined in a single dataset of dimension [(Inew * size) X n]

See Also

onlinem, simoff, offlinem

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example 1: Two variables (A default in control simulating dataset)

    mydata=simon()


# Example 2: Three variables and Inew=5 out of control batches

    B1=matrix(c(-0.3,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
    B1new=matrix(c(0.1,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
    mydata1=simon(n=100,I=200,size=3,Inew=5,n1=50,B1,varcov=diag(3),B1new)


# Example 3: Three variables and one Inew=1 out of control batch

    B1=matrix(c(-0.3,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
    B1new=matrix(c(0.1,0,0.4,0,0.7,0,0,-0.1,0.5),3,byrow=TRUE)
    mydata2=simon(n=100,I=1,size=3,Inew=1,n1=25,B1,varcov=diag(3),B1new)
    plot.ts(t(mydata2$data),main="One in control batch sample")
    plot.ts(t(mydata2$newdata),main="One new batch sample")

dvqcc documentation built on July 2, 2020, 2:10 a.m.