Learn R Programming

Sequential Normal Scores

The methods discussed in this package are new nonparametric methods based on sequential normal scores (SNS), designed for sequences of observations, usually time series data, which may occur singly or in batches, and may be univariate or multivariate. These methods are designed to detect changes in the process, which may occur as changes in location (mean or median), changes in scale (standard deviation, or variance), or other changes of interest in the distribution of the observations, over the time observed. They usually apply to large data sets, so computations need to be simple enough to be done in a reasonable time on a computer, and easily updated as each new observation (or batch of observations) becomes available.

Installation

You can install the released version of SNS from CRAN with:

install.packages("SNSchart")

or install from the package hosted in github.

install_github("LuisBenavides/SNSchart")

Note: To use install_github it is needed the library devtools. ## Univariate Analysis

Using SNS function

The reference sample Y and the monitoring sample X.

Y = c(10,20,30,40,50,60,70,80,90,100)
X = c(30, 35, 45)

Example of conditionsl SNS with a reference sample Y

Y = c(10,20,30,40,50,60,70,80,90,100)
X = c(30, 35, 45)
theta = 40
Ftheta = 0.5
sample.id = c("a", "b", "c")
SNS(X = X, X.id = sample.id, Y = Y, theta = theta, Ftheta = Ftheta)

Output

#> $coefficients
#> $coefficients$n
#> [1] 1
#> 
#> $coefficients$chart
#> [1] "Shewhart"
#> 
#> $coefficients$chart.par
#> [1] 3
#> 
#> 
#> $R
#> [1] 3.5 5.0 1.0
#> 
#> $Z
#> [1] -0.52440051 -0.31863936  0.08964235
#> 
#> $X.id
#> [1] "a" "b" "c"
#> 
#> $UCL
#> [1] 3 3 3
#> 
#> $LCL
#> [1] -3 -3 -3
#> 
#> $scoring
#> [1] "Z"
#> 
#> attr(,"class")
#> [1] "SNS"

Example of unconditionsl SNS with a reference sample Y

Y = c(10,20,30,40,50,60,70,80,90,100)
X = c(30, 35, 45)
theta = NULL
Ftheta = NULL
sample.id = c("a", "b", "c")
SNS(X = X, X.id = sample.id, Y = Y, theta = theta, Ftheta = Ftheta)

Output

#> $coefficients
#> $coefficients$n
#> [1] 1
#> 
#> $coefficients$chart
#> [1] "Shewhart"
#> 
#> $coefficients$chart.par
#> [1] 3
#> 
#> 
#> $R
#> [1] 3.5 5.0 7.0
#> 
#> $Z
#> [1] -0.6045853 -0.3186394  0.0000000
#> 
#> $X.id
#> [1] "a" "b" "c"
#> 
#> $UCL
#> [1] 3 3 3
#> 
#> $LCL
#> [1] -3 -3 -3
#> 
#> $scoring
#> [1] "Z"
#> 
#> attr(,"class")
#> [1] "SNS"

Example of conditional SNS without a reference sample Y

Y = NULL
X = c(30, 35, 45)
theta = 40
Ftheta = 0.5
sample.id = c("a", "b", "c")
SNS(X = X, X.id = sample.id, Y = Y, theta = theta, Ftheta = Ftheta)

Output

#> $coefficients
#> $coefficients$n
#> [1] 1
#> 
#> $coefficients$chart
#> [1] "Shewhart"
#> 
#> $coefficients$chart.par
#> [1] 3
#> 
#> 
#> $R
#> [1] 1.5 2.0 1.0
#> 
#> $Z
#> [1] -0.6744898 -0.3186394  0.6744898
#> 
#> $X.id
#> [1] "a" "b" "c"
#> 
#> $UCL
#> [1] 3 3 3
#> 
#> $LCL
#> [1] -3 -3 -3
#> 
#> $scoring
#> [1] "Z"
#> 
#> attr(,"class")
#> [1] "SNS"

Example of unconditional SNS without a reference sample Y

Y = NULL
X = c(30, 35, 45)
theta = NULL
Ftheta = NULL
sample.id = c("a", "b", "c")
SNS(X = X, X.id = sample.id, Y = Y, theta = theta, Ftheta = Ftheta)

Output

#> $coefficients
#> $coefficients$n
#> [1] 1
#> 
#> $coefficients$chart
#> [1] "Shewhart"
#> 
#> $coefficients$chart.par
#> [1] 3
#> 
#> 
#> $R
#> [1] 1 2 3
#> 
#> $Z
#> [1] 0.0000000 0.6744898 0.9674216
#> 
#> $X.id
#> [1] "a" "b" "c"
#> 
#> $UCL
#> [1] 3 3 3
#> 
#> $LCL
#> [1] -3 -3 -3
#> 
#> $scoring
#> [1] "Z"
#> 
#> attr(,"class")
#> [1] "SNS"

Copy Link

Version

Install

install.packages('SNSchart')

Monthly Downloads

169

Version

1.4.0

License

MIT + file LICENSE

Maintainer

Luis Benavides

Last Published

April 7th, 2021

Functions in SNSchart (1.4.0)

example74a

Data from Example 7.4(a) Qiu (2014).
calibrateControlLimit

Calibration of the control limit for the selected chart
MSNS

Multivariate Sequential Normal Scores
NS

Normal Scores
MNS

Multivariate Normal Scores
dataAlignment

Alignment of the data
example91

Data from Example 9.1 on page 369 Qiu (2014).
example65

Data from Example 6.5 on page 246 Qiu (2014).
example71

Data from Example 7.1 Qiu (2014).
example49

Data from Example 4.9 Qiu (2014).
SNS

Sequential Normal Scores
example82

Data from Example 8.2 Qiu (2014).
getARL

Average Run Length (ARL)
example81

Data from Example 8.1 on page 319 Qiu (2014).
example93

Data from Example 9.3 Qiu (2014).
mgetRL

Multivariate Run Length
mgetDist

Multivariate Random Observations Generetor
example74b

Data from Example 7.4(b) Qiu (2014).
srank

Sequential Rank
getDist

Random Observations Generator
example74c

Data from Example 7.4(c) Qiu (2014).
example84

Data from Example 8.4 Qiu (2014).
getQuantile

Obtain Quantile from Distribution Function
getRL

Run Length
example85

Data from Example 8.5 Qiu (2014).
example83

Data from Example 8.3 on page 326 Qiu (2014).
mcalibrateControlLimit

Calibration of the control limit for the selected chart
example87

Data from Example 8.7 on page 339 Qiu (2014).
mgetARL

Multivariate Average Run Length (ARL)