pois_PCC {bayespm}R Documentation

PCC for Poisson data with rate parameter unknown

Description

pois_PCC is used to derive the Predictive Control Chart (PCC) for Poisson data, when the rate parameter is unknown.

Usage

pois_PCC( data = NULL, s = NULL, historical_data = NULL,
          historical_s = NULL, c0 = 1/2, d0 = 0, alpha_0 = NULL,
          ARL_0 = 370.4, FAP = NULL, FIR = FALSE, fFIR = .99, aFIR = 1/8,
          summary_list = TRUE, PCC_PLOT = TRUE, PriorPosterior_PLOT = FALSE,
          historical_data_PLOT = FALSE, pdf_report = FALSE, path_pdf_report = tempdir(),
          xlab = "Observation Order", ylab = "Quality characteristic Values",
          main = "PCC Poisson with rate unknown" )

Arguments

data

vector; a univariate dataset for PCC implementation. Data needs to be in a vector form.

s

vector; refers to the period of time or grouping of counts, if data are rate dataset. It needs to be in a vector form.

historical_data

vector; an optional univariate dataset of historical data. Historical data needs to be in a vector form.

historical_s

vector; refers to the period of time or grouping of counts, if historical_data are rate dataset. It needs to be in a vector form.

c0

scalar (positive); scalar (positive); hyperparameter of the prior G(c0, d0). It needs to be a number. The default is 1/2 and it refers to the initial reference prior G(1/2, 0).

d0

scalar (positive); scalar (positive); hyperparameter of the prior G(c0, d0). It needs to be a number. The default is 0 and it refers to the initial reference prior G(1/2, 0).

alpha_0

scalar (non negative); It is a power prior parameter controlling the influence of the historical data on the posterior distribution. The default is 1/n_0, where n_0 is the size of the historical data.

ARL_0

scalar (positive); In Control (IC) Average Run Length (ARL). It is average number of IC data points that we will plot in the PCC before a false alarm occurs. The default value is 370.4

FAP

scalar (between 0 and 1); False Alarm Probability (FAP). It is the probability of raising at least one false alarm out of a pre-determined number of N hypothesis tests and it can be used instead of ARL_0. It is based on the Sidak's correction.

FIR

logical; If TRUE, then the Fast Initial Response (FIR) PCC is applied, which is an adjustment (narrows the PCC limits) for the initial fisrt tests.

fFIR

a number between 0 and 1; It is used if FIR=TRUE. The default value is 0.99 and represents the proportion of the adjusted PCC region over the initial one for the first test.

aFIR

non-negative number; It is used if FIR=TRUE. The default value is 0.125 and it is a smoothing parameter for the FIR adjustment.

summary_list

logical; If it is TRUE, then a data frame is provided, containing the data sequence, the PCC limits along with the possible occurence of an alarm. It is TRUE by default.

PCC_PLOT

logical; if TRUE, the PCC plot is displayed. It is TRUE by default.

PriorPosterior_PLOT

logical; if TRUE, the Prior and Posterior distribution(s) of the parameter(s) are displayed. It is TRUE by default.

historical_data_PLOT

logical; if TRUE, the historical data are plotted precending the PCC plot. It is FALSE by default.

pdf_report

logical; if TRUE then the summary list, PCC plot and Prior/Posterior distribution(s) of the parameter(s) are reported in a pdf file.

path_pdf_report

specified path to save pdf report if pdf_report=TRUE. The default path is the temporary direction tempdir().

xlab, ylab, main

The titles of the x-axis, y-axis and the overall title for the PCC plot. The default values are "Observation Order", "Quality characteristic Values" and "PCC Poisson" respectively

Details

pois_PCC provides the Predictive Control Chart (PCC) process for Poisson data, when the rate parameter is unknown. The PCC process is based on the sequential testing of the future observable against the Highest Predictive Density (HPrD), which is obtained by the posterior predictive distribution. The PCC testing starts as early as the second observation.

The initial prior for the unknown rate is a Gamma: G(c, d), where d is the rate parameter. Furthermore, the direct use of available historical data is possible via the power prior, if they are available. In this case, the default value for the power prior parameter alpha_0 is the reciprocal of the length of the historical data, which conveys the weight of a single observation to the prior information. The default prior is the non-informative reference prior G(1/2, 0), without the use of historical data.

A FIR option is available by narrowing the first few control limits. The metrics that can be used to control the false alarms tolerance are either ARL_0 or FAP.

Value

Runs the PCC process, while if FIR=T, then the FIR-PCC is implemented. If plot=T, then a data frame is provided with the data, the upper and the lower limits of the Highest Predictive Density or Mass (HPrD/M) region, and an indication in case of alarms. If PCC_PLOT=T, then the PCC process is visualized, while if historical_data_PLOT=T, the historical data are added to the plot. If PriorPosterior_PLOT = T, a plot with the prior and the posterior is provided. Finally, if pdf_report=T, all the output is reported and saved into a pdf file.

Examples

# 30 Poisson observations introducing an outlier at the 15th observation
set.seed(1111)
out <- rpois(n = 30, lambda = 4)
out[15] <- out[15] + 6
pois_PCC(out)

# Real data application
attach(ECE)
pois_PCC(data = defect_counts, s = inspected_units)

[Package bayespm version 0.2.0 Index]