scoutsteps {SCOUTer}R Documentation

scoutsteps

Description

Shift of an array following a step-wise pattern.

Usage

scoutsteps(
  X,
  pcaref,
  T2.target = NA,
  SPE.target = NA,
  nsteps = 1,
  gspe = 1,
  gt2 = 1
)

Arguments

X

Matrix with observations that will be shifted as rows.

pcaref

List with the elements of a PCA model:

  • m: mean.

  • s: standard deviation.

  • prepro: preprocessing: "none", "cent" or "autosc".

  • P: loading matrix.

  • lambda: vector with variances of each PC.

T2.target

A number indicating the target value for the Hotelling's T^2_A after the shift. Set to NA by default.

SPE.target

A number indicating the target value for the Squared Prediction Error after the shift. Set to NA by default.

nsteps

A number indicating the number of steps between the reference and target values of the SPE and the T^2. Set to 1 by default.

gspe

A number indicating the term that will tune the spacing between steps for the SPE. Set to 1 by default (linear spacing).

gt2

A number indicating the term that will tune the spacing between steps for the SPE. Set to 1 by default (linear spacing).

Value

list with elements:

Examples

X <- as.matrix(X)
pcamodel.ref <- pcamb_classic(X, 3, 0.1, "autosc") # PCA-MB with all observations
# Shift a set of observations increasing the T^2  and the SPE in 4 linear steps:
outsteps <- scoutsteps(X, pcamodel.ref, T2.target = matrix(40, nrow(X), 1), 
SPE.target = matrix(50, nrow(X), 1), nsteps = 4)
# Shift a set of observations increasing the SPE in 4 non-linear steps:
outsteps <- scoutsteps(X, pcamodel.ref, SPE.target = matrix(50, nrow(X), 1), nsteps = 4, 
gspe = 0.3)

[Package SCOUTer version 1.0.0 Index]