Type: | Package |
Title: | Copula-Based Estimation and Statistical Process Control for Serially Correlated Time Series |
Version: | 2.9 |
Date: | 2021-11-29 |
Author: | Takeshi Emura, Xinwei Huang, Ting-Hsuan Long, Li-Hsien Sun |
Maintainer: | Takeshi Emura <takeshiemura@gmail.com> |
Description: | Estimation and statistical process control are performed under copula-based time-series models. Available are statistical methods in Long and Emura (2014 JCSA), Emura et al. (2017 Commun Stat-Simul) <doi:10.1080/03610918.2015.1073303>, Huang and Emura (2021 Commun Stat-Simul) <doi:10.1080/03610918.2019.1602647>, Lin et al. (2021 Comm Stat-Simul) <doi:10.1080/03610918.2019.1652318>, Sun et al. (2020 JSS Series in Statistics)<doi:10.1007/978-981-15-4998-4>, and Huang and Emura (2021, in revision). |
License: | GPL-2 |
NeedsCompilation: | no |
Packaged: | 2021-11-29 05:03:42 UTC; biouser |
Repository: | CRAN |
Date/Publication: | 2021-11-29 05:40:13 UTC |
Copula-Based Estimation and Statistical Process Control for Serially Correlated Time Series
Description
Copulas are applied to model a Markov dependence for serially correlated time series. The Clayton and Joe copulas are available to specify the dependence structure. The normal and binomial distributions are available for the marginal model. Maximum likelihood estimation is implmented for estimating parameters, and a Shewhart control chart is drawn for performing statistical process control.
Details
Package: | Copula.Markov |
Type: | Package |
Version: | 2.9 |
Date: | 2021-11-29 |
License: GPL-2 |
Author(s)
Emura T, Huang XW, Chen WR, Long TH, Sun LH. Maintainer: Takeshi Emura <takeshiemura@gmail.com>
References
Chen W (2018) Copula-based Markov chain model with binomial data, NCU Library
Huang XW, Emura T (2021-), Computational methods for a copula-based Markov chain model with a binomial time series, in review
Emura T, Long TH, Sun LH (2017), R routines for performing estimation and statistical process control under copula-based time series models, Communications in Statistics - Simulation and Computation, 46(4):3067-87
Long TH and Emura T (2014), A control chart using copula-based Markov chain models, Journal of the Chinese Statistical Association, 52(4):466-96
Lin WC, Emura T, Sun LH (2021), Estimation under copula-based Markov normal mixture models for serially correlated data, Communications in Statistics - Simulation and Computation, 50(12):4483-515
Huang XW, Emura T (2021), Model diagnostic procedures for copula-based Markov chain models for statistical process control, Communications in Statistics - Simulation and Computation, doi: 50(8):2345-67
Generating Time Series Data Under a Copula-Based Markov Chain Model with the Clayton Copula
Description
Time-series data are generated under a copula-based Markov chain model with the Clayton copula. See Long et al. (2014) and Emura et al. (2017) for the details.
Usage
Clayton.Markov.DATA(n, mu, sigma, alpha)
Arguments
n |
sample size |
mu |
mean |
sigma |
standard deviation |
alpha |
association parameter |
Details
-1<alpha<0 for negative association; alpha>0 for positive association
Value
Time series data of size n.
Author(s)
Takeshi Emura
References
Emura T, Long TH, Sun LH (2017), R routines for performing estimation and statistical process control under copula-based time series models, Communications in Statistics - Simulation and Computation, 46 (4): 3067-87
Long TH and Emura T (2014), A control chart using copula-based Markov chain models, Journal of the Chinese Statistical Association 52 (No.4): 466-96
Examples
set.seed(1)
Y=Clayton.Markov.DATA(n=1000,mu=0,sigma=1,alpha=8)
Clayton.Markov.MLE(Y,plot=TRUE)
Generating Time Series Data Under a Copula-Based Markov Chain Model with the Clayton Copula and Binomial Margin.
Description
Time-series data are generated under a copula-based Markov chain model with the Clayton copula and binomial margin.
Usage
Clayton.Markov.DATA.binom(n, size, prob, alpha)
Arguments
n |
number of observations |
size |
number of binomial trials |
prob |
binomial probability; 0<p<1 |
alpha |
association parameter |
Details
-1<alpha<0 for negative association; alpha>0 for positive association
Value
Time series data of size n (this is different from the number of binomial trials = "size").
Author(s)
Huang XW, Chen W, Emura T
References
Chen W (2018) Copula-based Markov chain model with binomial data, NCU Library
Huang XW, Emura T (2021-), Computational methods for a copula-based Markov chain model with a binomial time series, in review
Examples
size=50
prob=0.5
alpha=2
set.seed(1)
Y=Clayton.Markov.DATA.binom(n=500,size,prob,alpha)
### sample mean and SD ###
mean(Y)
sd(Y)
### true mean and SD ###
size*prob
sqrt(size*prob*(1-prob))
A goodness-of-fit test for the marginal normal distribution.
Description
Perform a parametric bootstrap test based on the Cramer-von Mises and Kolmogorov-Smirnov statistics as proposed by Huang and Emura (2019).
Usage
Clayton.Markov.GOF(Y, k = 3, D = 1, B = 200,GOF.plot=FALSE, method = "Newton")
Arguments
Y |
vector of datasets |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
D |
diameter for U(-D, D) used in randomized Newton-Raphson |
B |
the number of Bootstrap replications |
GOF.plot |
if TRUE, show the model diagnostic plots for B bootstrap replications |
method |
Newton-Raphson method or nlm can be chosen |
Value
CM |
The Cramer-von Mises statistic and its P-value |
KS |
The Kolmogorov-Smirnov statistic and its P-value |
CM.boot |
Bootstrap values of the Cramer-von Mises statistics |
KS.boot |
Bootstrap values of the Kolmogorov-Smirnov statistics |
Author(s)
Takeshi Emura
References
Emura T, Long TH, Sun LH (2017), R routines for performing estimation and statistical process control under copula-based time series models, Communications in Statistics - Simulation and Computation, 46 (4): 3067-87
Long TH and Emura T (2014), A control chart using copula-based Markov chain models, Journal of the Chinese Statistical Association 52 (No.4): 466-96
Huang XW, Emura T (2021), Model diagnostic procedures for copula-based Markov chain models for statistical process control, Communications in Statistics - Simulation and Computation, doi: 50(8):2345-67
Examples
set.seed(1)
Y=Clayton.Markov.DATA(n=1000,mu=0,sigma=1,alpha=2)
Clayton.Markov.GOF(Y,B=5,GOF.plot=TRUE)
A goodness-of-fit test for the marginal binomial distribution.
Description
Perform a parametric bootstrap test based on the Cramer-von Mises and Kolmogorov-Smirnov statistics as proposed by Huang and Emura (2019) and Huang et al. (2019-).
Usage
Clayton.Markov.GOF.binom(Y, k = 3, size, B = 200,GOF.plot=FALSE, method = "Newton")
Arguments
Y |
vector of datasets |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
size |
number of binomial trials |
B |
the number of Bootstrap replications |
GOF.plot |
if TRUE, show the model diagnostic plots for B bootstrap replications |
method |
Newton-Raphson method or nlm can be chosen |
Value
CM |
The Cramer-von Mises statistic and its P-value |
KS |
The Kolmogorov-Smirnov statistic and its P-value |
CM.boot |
Bootstrap values of the Cramer-von Mises statistics |
KS.boot |
Bootstrap values of the Kolmogorov-Smirnov statistics |
Author(s)
Huang XW, Emura T
References
Huang XW, Emura T (2021), Model diagnostic procedures for copula-based Markov chain models for statistical process control, Communications in Statistics - Simulation and Computation, doi: 50(8):2345-67
Huang XW, Emura T (2021-), Computational methods for a copula-based Markov chain model with a binomial time series, in review
Examples
size=50
prob=0.5
alpha=2
set.seed(1)
Y=Clayton.Markov.DATA.binom(n=500,size,prob,alpha)
Clayton.Markov.GOF.binom(Y,size=size,B=5,k=3,GOF.plot=TRUE) ## B=5 to save time
Maximum Likelihood Estimation and Statistical Process Control Under the Clayton Copula
Description
The maximum likelihood estimates are produced and the Shewhart control chart is drawn with k-sigma control limits (e.g., 3-sigma). The dependence model follows the Clayton copula and the marginal (stationary) distribution follows the normal distribution.
Usage
Clayton.Markov.MLE(Y, k = 3, D = 1, plot = TRUE,GOF=FALSE,method = "nlm")
Arguments
Y |
vector of datasets |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
D |
diameter for U(-D, D) used in randomized Newton-Raphson |
plot |
show the control chart if TRUE |
GOF |
show the model diagnostic plot if TRUE |
method |
apply "nlm" or "Newton" method |
Value
mu |
estimate, SE, and 95 percent CI |
sigma |
estimate, SE, and 95 percent CI |
alpha |
estimate, SE, and 95 percent CI |
Control_Limit |
Center = mu, LCL = mu - k*sigma, UCL = mu + k*sigma |
out_of_control |
IDs for out-of-control points |
Gradient |
gradients (must be zero) |
Hessian |
Hessian matrix |
Eigenvalue_Hessian |
Eigenvalues for the Hessian matrix |
KS.test |
KS statistics |
CM.test |
CM statistics |
log.likelihood |
Log-likelihood value for the estimation |
Author(s)
Long TH, Huang XW and Emura T
References
Emura T, Long TH, Sun LH (2017), R routines for performing estimation and statistical process control under copula-based time series models, Communications in Statistics - Simulation and Computation, 46 (4): 3067-87
Long TH and Emura T (2014), A control chart using copula-based Markov chain models, Journal of the Chinese Statistical Association 52 (No.4): 466-96
Examples
set.seed(1)
Y=Clayton.Markov.DATA(n=1000,mu=0,sigma=1,alpha=2)
Clayton.Markov.MLE(Y,plot=TRUE)
Maximum Likelihood Estimation and Statistical Process Control Under the Clayton Copula
Description
The maximum likelihood estimates are produced and the Shewhart control chart is drawn with k-sigma control limits (e.g., 3-sigma). The dependence model follows the Clayton copula and the marginal (stationary) distribution follows the normal distribution.
Usage
Clayton.Markov.MLE.binom(Y, size, k = 3, method="nlm", plot = TRUE, GOF=FALSE)
Arguments
Y |
vector of observations |
size |
numbe of binomial trials |
method |
nlm or Newton |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
plot |
show the control chart if TRUE |
GOF |
show the model diagnostic plot if TRUE |
Value
p |
estimate, SE, and 95 percent CI |
alpha |
estimate, SE, and 95 percent CI |
Control_Limit |
Center = n*p, LCL = mu - k*sigma, UCL = mu + k*sigma |
out_of_control |
IDs for out-of-control points |
Gradient |
gradients (must be zero) |
Hessian |
Hessian matrix |
Eigenvalue_Hessian |
Eigenvalues for the Hessian matrix |
KS.test |
KS statistics |
CM.test |
CM statistics |
log_likelihood |
Log-likelihood value for the estimation |
Author(s)
Huang XW, Emura T
References
Chen W (2018) Copula-based Markov chain model with binomial data, NCU Library
Huang XW, Emura T (2021-), Computational methods for a copula-based Markov chain model with a binomial time series, in review
Examples
size=50
prob=0.5
alpha=2
set.seed(1)
Y=Clayton.Markov.DATA.binom(n=500,size,prob,alpha)
Clayton.Markov.MLE.binom(Y,size=size,k=3,plot=TRUE)
Generating Time Series Data Under a Copula-Based 2nd-order Markov Chain Model with the Clayton Copula
Description
Time-series data are generated under a copula-based 2nd order Markov chain model with the Clayton copula.
Usage
Clayton.Markov2.DATA(n, mu, sigma, alpha)
Arguments
n |
sample size |
mu |
mean |
sigma |
standard deviation |
alpha |
association parameter |
Details
-1<alpha<0 for negative association; alpha>0 for positive association
Value
Time series data of size n
Author(s)
Xinwei Huang and Takeshi Emura
References
Huang XW, Emura T (2021), Model diagnostic procedures for copula-based Markov chain models for statistical process control, Communications in Statistics - Simulation and Computation, doi: 50(8):2345-67
Examples
Clayton.Markov2.DATA(n = 100, mu = 0, sigma = 1, alpha = 2)
Maximum Likelihood Estimation and Statistical Process Control Under the Clayton Copula with a 2nd order Markov chain.
Description
The maximum likelihood estimates are produced and the Shewhart control chart is drawn with k-sigma control limits (e.g., 3-sigma). The dependence model follows the Clayton copula and the marginal (stationary) distribution follows the normal distribution. The model diagnostic plot is also given (by the option "GOF=TRUE"). See Huang and Emura (2019) for the methodological details.
Usage
Clayton.Markov2.MLE(Y, k = 3, D = 1, plot = TRUE, GOF=FALSE)
Arguments
Y |
vector of datasets |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
D |
diameter for U(-D, D) used in randomized Newton-Raphson |
plot |
show the control chart if TRUE |
GOF |
show the model diagnostic plot if TRUE |
Value
mu |
estimate, SE, and 95 percent CI |
sigma |
estimate, SE, and 95 percent CI |
alpha |
estimate, SE, and 95 percent CI |
Control_Limit |
Center = mu, LCL = mu - k*sigma, UCL = mu + k*sigma |
out_of_control |
IDs for out-of-control points |
Gradient |
gradients (must be zero) |
Hessian |
Hessian matrix |
Eigenvalue_Hessian |
Eigenvalues for the Hessian matrix |
KS.test |
KS statistics |
CM.test |
CM statistics |
log.likelihood |
Log-likelihood value for the estimation |
Author(s)
Xinwei Huang and Takeshi Emura
References
Huang XW, Emura T (2021), Model diagnostic procedures for copula-based Markov chain models for statistical process control, Communications in Statistics - Simulation and Computation, doi: 50(8):2345-67
Examples
Y = c(0.265, 0.256, 0.261, 0.261, 0.260, 0.257, 0.258, 0.263, 0.254, 0.254,
0.258, 0.256, 0.256, 0.265, 0.270, 0.267, 0.270, 0.267, 0.266, 0.271,
0.270, 0.264, 0.261, 0.264, 0.266, 0.264, 0.269, 0.268, 0.264, 0.262,
0.257, 0.255, 0.255, 0.253, 0.251, 0.254, 0.255)
Clayton.Markov2.MLE(Y, k = 1, D = 1, plot = TRUE)
Y=Clayton.Markov2.DATA(n=1000,mu=0,sigma=1,alpha=8)
Clayton.Markov2.MLE(Y, plot=TRUE)
Maximum Likelihood Estimation using Newton-Raphson Method Under the Clayton Copula and the Mix-Normal distribution
Description
The maximum likelihood estimates are produced. The dependence model follows the Clayton copula and the marginal distribution follows the Mix-Normal distribution.
Usage
Clayton.MixNormal.Markov.MLE(y)
Arguments
y |
vector of datasets |
Value
alpha |
estimate, SE, and 95 percent CI |
mu1 |
estimate, SE, and 95 percent CI |
mu2 |
estimate, SE, and 95 percent CI |
sigma1 |
estimate, SE, and 95 percent CI |
sigma2 |
estimate, SE, and 95 percent CI |
p |
estimate, SE, and 95 percent CI |
Gradient |
gradients (must be zero) |
Hessian |
Hessian matrix |
Eigenvalue_Hessian |
Eigenvalues for the Hessian matrix |
log.likelihood |
Log-likelihood value for the estimation |
Author(s)
Sun LH, Huang XW
References
Lin WC, Emura T, Sun LH (2021), Estimation under copula-based Markov normal mixture models for serially correlated data, Communications in Statistics - Simulation and Computation, 50(12):4483-515
Examples
data(DowJones)
Y=as.vector(DowJones$log_return)
Clayton.MixNormal.Markov.MLE(y=Y)
Dow Jones Industrial Average
Description
The log return of weekly stock price of Dow Jones Industrial Average from 2008/1/1 to 2012/1/1.
Usage
data("DowJones")
Format
A data frame with 754 observations on the following 1 variables.
log_return
a numeric vector
References
Lin WC, Emura T, Sun LH (2021), Estimation under copula-based Markov normal mixture models for serially correlated data, Communications in Statistics - Simulation and Computation, 50(12):4483-515
Examples
data(DowJones)
DowJones
Generating Time Series Data Under a Copula-Based Markov Chain Model with the Joe Copula
Description
Time-series data are generated under a copula-based Markov chain model with the Joe copula.
Usage
Joe.Markov.DATA(n, mu, sigma, alpha)
Arguments
n |
sample size |
mu |
mean |
sigma |
standard deviation |
alpha |
association parameter |
Details
alpha>=1 for positive association
Value
Time series data of size n
Author(s)
Takeshi Emura
References
Emura T, Long TH, Sun LH (2017), R routines for performing estimation and statistical process control under copula-based time series models, Communications in Statistics - Simulation and Computation, 46 (4): 3067-87
Long TS and Emura T (2014), A control chart using copula-based Markov chain models, Journal of the Chinese Statistical Association 52 (No.4): 466-96
Examples
n=1000
alpha=2.856 ### Kendall's tau =0.5 ###
mu=2
sigma=1
Y=Joe.Markov.DATA(n,mu,sigma,alpha)
mean(Y)
sd(Y)
cor(Y[-1],Y[-n],method="kendall")
Joe.Markov.MLE(Y,k=2)
Generating Time Series Data Under a Copula-Based Markov Chain Model with the Joe Copula and Binomial Margin.
Description
Time-series data are generated under a copula-based Markov chain model with the Joe copula and binomial margin.
Usage
Joe.Markov.DATA.binom(n, size, prob, alpha)
Arguments
n |
number of observations |
size |
number of binomial trials |
prob |
binomial probability; 0<p<1 |
alpha |
association parameter |
Details
alpha>=1 for positive association
Value
time series data
Author(s)
Huang X, Emura T
References
Chen W (2018) Copula-based Markov chain model with binomial data, NCU Library
Huang XW, Emura T (2021-), Computational methods for a copula-based Markov chain model with a binomial time series, in review
Examples
size=50
prob=0.5
alpha=2
set.seed(1)
Y=Joe.Markov.DATA.binom(n=500,size,prob,alpha)
### sample mean and SD ###
mean(Y)
sd(Y)
### true mean and SD ###
size*prob
sqrt(size*prob*(1-prob))
A goodness-of-fit test for the marginal binomial distribution.
Description
Perform a parametric bootstrap test based on the Cramer-von Mises and Kolmogorov-Smirnov statistics as proposed by Huang and Emura (2019) and Huang et al. (2019-).
Usage
Joe.Markov.GOF.binom(Y, k = 3, size, B = 200,GOF.plot=FALSE)
Arguments
Y |
vector of datasets |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
size |
number of binomial trials |
B |
the number of Bootstrap replications |
GOF.plot |
if TRUE, show the model diagnostic plots for B bootstrap replications |
Value
CM |
The Cramer-von Mises statistic and its P-value |
KS |
The Kolmogorov-Smirnov statistic and its P-value |
CM.boot |
Bootstrap values of the Cramer-von Mises statistics |
KS.boot |
Bootstrap values of the Kolmogorov-Smirnov statistics |
Author(s)
Huang XW, Emura T
References
Huang XW, Emura T (2021), Model diagnostic procedures for copula-based Markov chain models for statistical process control, Communications in Statistics - Simulation and Computation, doi: 50(8):2345-67
Huang XW, Emura T (2021-), Computational methods for a copula-based Markov chain model with a binomial time series, in review
Examples
size=50
prob=0.5
alpha=2
set.seed(1)
Y=Joe.Markov.DATA.binom(n=500,size,prob,alpha)
Joe.Markov.GOF.binom(Y,size=size,B=5,k=3,GOF.plot=TRUE) ## B=5 to save time
Maximum Likelihood Estimation and Statistical Process Control Under the Joe Copula
Description
The maximum likelihood estimates are produced and the Shewhart control chart is drawn with k-sigma control limits (e.g., 3-sigma). The dependence model follows the Joe copula and the marginal (stationary) distribution follows the normal distribution.
Usage
Joe.Markov.MLE(Y, k = 3, D = 1, plot = TRUE,GOF=FALSE,method = "nlm")
Arguments
Y |
vector of datasets |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
D |
diameter for U(-D, D) used in randomized Newton-Raphson |
plot |
show the control chart if TRUE |
GOF |
show the model diagnostic plot if TRUE |
method |
apply "nlm" or "Newton" method |
Value
mu |
estimate, SE, and 95 percent CI |
sigma |
estimate, SE, and 95 percent CI |
alpha |
estimate, SE, and 95 percent CI |
Control_Limit |
Center = mu, LCL = mu - k*sigma, UCL = mu + k*sigma |
out_of_control |
IDs for out-of-control points |
Gradient |
gradients (must be zero) |
Hessian |
Hessian matrix |
Eigenvalue_Hessian |
Eigenvalues for the Hessian matrix |
KS.test |
KS statistics |
CM.test |
CM statistics |
log.likelihood |
Log-likelihood value for the estimation |
Author(s)
Long TH, Huang XW and Takeshi Emura
References
Emura T, Long TH, Sun LH (2017), R routines for performing estimation and statistical process control under copula-based time series models, Communications in Statistics - Simulation and Computation, 46 (4): 3067-87
Long TH and Emura T (2014), A control chart using copula-based Markov chain models, Journal of the Chinese Statistical Association 52 (No.4): 466-96
Examples
n=1000
alpha=2.856 ### Kendall's tau =0.5 ###
mu=2
sigma=1
Y=Joe.Markov.DATA(n,mu,sigma,alpha)
mean(Y)
sd(Y)
cor(Y[-1],Y[-n],method="kendall")
Joe.Markov.MLE(Y,k=2)
Maximum Likelihood Estimation and Statistical Process Control Under the Joe Copula
Description
The maximum likelihood estimates are produced and the Shewhart control chart is drawn with k-sigma control limits (e.g., 3-sigma). The dependence model follows the Joe copula and the marginal (stationary) distribution follows the binomial distribution.
Usage
Joe.Markov.MLE.binom(Y, size, k = 3, plot = TRUE, GOF=FALSE)
Arguments
Y |
vector of observations |
size |
number of binomial trials |
k |
constant determining the length between LCL and UCL (k=3 corresponds to 3-sigma limit) |
plot |
show the control chart if TRUE |
GOF |
show the model diagnostic plot if TRUE |
Value
p |
estimate, SE, and 95 percent CI |
alpha |
estimate, SE, and 95 percent CI |
Control_Limit |
Center = n*p, LCL = mu - k*sigma, UCL = mu + k*sigma |
out_of_control |
IDs for out-of-control points |
Gradient |
gradients (must be zero) |
Hessian |
Hessian matrix |
Eigenvalue_Hessian |
Eigenvalues for the Hessian matrix |
KS.test |
KS statistics |
CM.test |
CM statistics |
log_likelihood |
Log-likelihood value for the estimation |
Author(s)
Huang XW, Emura T
References
Chen W (2018) Copula-based Markov chain model with binomial data, NCU Library
Huang XW, Emura T (2021+), Computational methods for a copula-based Markov chain model with a binomial time series, under review
Examples
size=50
prob=0.5
alpha=2
set.seed(1)
Y=Joe.Markov.DATA.binom(n=500,size,prob,alpha)
Joe.Markov.MLE.binom(Y,size=size,k=3,plot=TRUE)