Learn R Programming

qcr (version 1.4)

fdqcs.rank: Function to plot rank functional data (DFD) - chart

Description

This function is used to compute statistics required by the RFD chart.

Usage

fdqcs.rank(x, ...)

# S3 method for fdqcd fdqcs.rank( x, y = x, func.depth = depth.FM, alpha = 0.01, plot = TRUE, trim = 0.1, draw.control = NULL, ... )

Arguments

x

an R object (used to select the method). See details.

...

arguments passed to or from methods.

y

The set of new curves to evaluate the depth. fdqcd class object. The set of reference curves respect to which the depth is computed. fdqcd class object.

func.depth

Type of depth measure, by default depth.mode.

alpha

Quantile to determine the cutoff from the Bootstrap procedure

plot

a logical value indicating that it should be plotted.

trim

The porcentage of the trimming.

draw.control

ist that it specifies the col, lty and lwd for objects: fdataobj, statistic, IN and OUT.

References

Flores, M.; Naya, S.; Fern<U+00E1>ndez-Casal,R.; Zaragoza, S.; Ra<U+00F1>a, P.; Tarr<U+00ED>o-Saavedra, J. Constructing a Control Chart Using Functional Data. Mathematics 2020, 8, 58.

Examples

Run this code
# NOT RUN {
library(qcr)
m <- 30
tt<-seq(0,1,len=m)
mu<-30 * tt * (1 - tt)^(3/2)
n0 <- 100
set.seed(12345)
mdata<-matrix(NA,ncol=m,nrow=n0)
sigma <- exp(-3*as.matrix(dist(tt))/0.9)
for (i in 1:n0) mdata[i,]<- mu+0.5*mvrnorm(mu = mu,Sigma = sigma )
fdchart <- fdqcd(mdata)
summary(fdchart)
plot(fdchart,type="l",col="gray")
out <- fddep$out
## Outliers - State in Control
alpha <- 0.005
trim <- 0.1
while (length(out)>0) {
 mdata <- fddep$fdata$data[-out,]
 fddep <- fdqcs.depth(mdata,ns = alpha, trim=trim, plot=FALSE)
 out <- fddep$out
}
plot(fddep,title.fdata = "FD-State in Control",title.depth = "Depth")
# Ha
mu_a<- 30 * tt^(3/2) * (1 - tt)
n_a <- 50
set.seed(12345)
mdata_a<-matrix(NA,ncol=m,nrow=n_a)
for (i in 1:n_a) mdata_a[i,]<- mu_a+0.5*mvrnorm(mu = mu_a,Sigma = sigma )
fdchart_a <- fdqcd(mdata_a,"Curves Monitoring")
plot(fdchart_a)
plot(fdchart,fdchart_a,main="Phase II")
pashe2.chart <- fdqcs.rank(fdchart,fdchart_a)
plot(pashe2.chart,title.fdata = "FDA",title.rank = "Rank")
summary(pashe2.chart)
# }

Run the code above in your browser using DataLab