cramer_vonmises | R Documentation |
Calculate the Cramér-von-Mises criterion with a p-value (via parametric bootstrapping) to assess the goodness of fit of a parametric copula compared to the empirical copula of the data.
cramer_vonmises( copula, theta, x, n_bootstrap = 1000, parameters = NULL, optim.method = "L-BFGS-B", optim.control = list(maxit = 100) )
copula |
R object of class ' |
theta |
numeric vector of angles (measurements of a circular variable) or "circular" component of pseudo-observations. |
x |
numeric vector of step lengths (measurements of a linear variable) or "linear" component of pseudo-observations. |
n_bootstrap |
integer number of bootstrap replicates. If
|
parameters |
vector of character strings
holding the names of the parameters to be optimized when using the bootstrap
procedure.
These can be any parameters in |
optim.method |
character string, optimizer used in
|
optim.control |
list of additional controls passed to
|
The Cramér-von Misses criterion is calculated as the sum of the squared
differences between the empirical copula and the parametric copula, copula
,
evaluated at the pseudo-observations obtained from theta
and x
.
If the bootstrap procedure is used, a random sample is drawn from copula
and converted to pseudo-observations. A new (set of) copula parameter(s) is then
fit to those pseudo-observations using maximum likelihood (function
cylcop::fit_cylcop_ml()
).
A list of length 2 containing the Cramér-von Mises criterion and the p-value.
Genest2008cylcop
set.seed(1234) sample <- rcylcop(100,cyl_cubsec(0.1, 0.1)) opt_cop <- fit_cylcop_ml(copula = cyl_quadsec(), theta = sample[,1], x = sample[,2], parameters = "a", start = 0 )$copula cramer_vonmises(opt_cop, theta = sample[,1], x = sample[,2], n_bootstrap=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.