Learn R Programming

ActiveLearning4SPM (version 0.1.0)

simulate_stream: Simulate Process Monitoring Data for Stream-Based Active Learning

Description

Generate a sequence of latent states and corresponding multivariate Gaussian observations for process monitoring. The process has three possible states:

  1. state 1: in-control (IC),

  2. state 2: out-of-control (OC),

  3. state 3: out-of-control (OC).

Usage

simulate_stream(
  d = 10,
  TT = 500,
  T0 = 100,
  T_min_IC = 60,
  T_max_IC = 85,
  T_OC = 5,
  mean = NULL,
  covariance = NULL
)

Value

A list with elements:

x

Integer vector of latent states of length T0 + TT.

y

Matrix of simulated multivariate observations with T0 + TT rows and d columns.

Arguments

d

Integer. Number of variables (dimension of the multivariate observations). Default is 10.

TT

Integer. Length of the sequence after the initial IC portion. Default is 500.

T0

Integer. Length of the initial IC sequence known to belong to state 1. Default is 100.

T_min_IC, T_max_IC

Integers. Minimum and maximum length of consecutive IC observations before switching to an OC state.

T_OC

Integer. Fixed length of each OC state sequence.

mean

List of three numeric vectors of length d, representing the mean vectors of states 1 (IC), 2 (OC), and 3 (OC). If NULL (default), simple default values are used.

covariance

List of three d x d covariance matrices, one for each state. If NULL (default), pre-defined (equal) covariance matrices are used.

Details

The first T0 observations are fixed in state 1 (IC). Then, in the following TT observations, only state 2 appears in the first half, and only state 3 appears in the second half. Within each half, runs of state 1 (IC) of random length between T_min_IC and T_max_IC alternate with fixed-length runs of the corresponding OC state of length T_OC.

Examples

Run this code
library(ActiveLearning4SPM)
sim <- simulate_stream()
table(sim$x)

Run the code above in your browser using DataLab