Title: | Time Series Copula Models |
---|---|
Description: | Functions for the analysis of time series using copula models. The package is based on methodology described in the following references. McNeil, A.J. (2021) <doi:10.3390/risks9010014>, Bladt, M., & McNeil, A.J. (2021) <doi:10.1016/j.ecosta.2021.07.004>, Bladt, M., & McNeil, A.J. (2022) <doi:10.1515/demo-2022-0105>. |
Authors: | Alexander McNeil [aut, cre], Martin Bladt [aut] |
Maintainer: | Alexander McNeil <[email protected]> |
License: | GPL-3 |
Version: | 0.4.6 |
Built: | 2025-02-20 13:25:57 UTC |
Source: | https://github.com/ajmcneil/tscopula |
Compute partial autocorrelations from autocorrelations
acf2pacf(rho)
acf2pacf(rho)
rho |
vector of autocorrelation values (excluding 1). |
A vector of partial autocorrelation values with same length as rho
.
rho <- ARMAacf(ar = -0.9, ma = 0.8, lag.max = 50)[-1] alpha <- acf2pacf(rho)
rho <- ARMAacf(ar = -0.9, ma = 0.8, lag.max = 50)[-1] alpha <- acf2pacf(rho)
Akaike Corrected Information Criterion
AICc(object, ...)
AICc(object, ...)
object |
a fitted model object for which there exists a logLik method to extract the corresponding log-likelihood. |
... |
optionally more fitted model objects. |
If just one object is provided, a numeric value with the corresponding AICC value.
If multiple objects are provided, a data.frame with rows corresponding to the objects and columns representing the number of parameters in the model (df) and the AICC.
Transform an armacopula into a dvinecopula or dvinecopula2 object
arma2dvine(object)
arma2dvine(object)
object |
an object of class armacopula. |
An object of class dvinecopula (for AR copulas) or class dvinecopula2 (for MA or ARMA copulas).
arma2dvine(armacopula(list(ar = 0.5, ma = 0.4)))
arma2dvine(armacopula(list(ar = 0.5, ma = 0.4)))
Constructor function for ARMA copula process
armacopula(pars = list(ar = 0, ma = 0))
armacopula(pars = list(ar = 0, ma = 0))
pars |
list consisting of vector of AR parameters named 'ar' and vector of MA parameters named 'ma'. |
An object of class armacopula.
armacopula(list(ar = 0.5, ma = 0.4))
armacopula(list(ar = 0.5, ma = 0.4))
Class of objects for ARMA copula processes.
## S4 method for signature 'armacopula' coef(object) ## S4 method for signature 'armacopula' show(object) ## S4 method for signature 'armacopula' sim(object, n = 1000) ## S4 method for signature 'armacopula' kendall(object, lagmax = 20) ## S4 method for signature 'armacopula' predict(object, data, x, type = "df")
## S4 method for signature 'armacopula' coef(object) ## S4 method for signature 'armacopula' show(object) ## S4 method for signature 'armacopula' sim(object, n = 1000) ## S4 method for signature 'armacopula' kendall(object, lagmax = 20) ## S4 method for signature 'armacopula' predict(object, data, x, type = "df")
object |
an object of the class. |
n |
length of realization. |
lagmax |
maximum value of lag. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
coef(armacopula)
: Coef method for ARMA copula class
show(armacopula)
: Show method for ARMA copula process
sim(armacopula)
: Simulation method for armacopula class
kendall(armacopula)
: Calculate Kendall's tau values for armacopula model
predict(armacopula)
: Prediction method for armacopula class
name
name of ARMA copula process.
modelspec
vector containing number of AR and MA parameters.
pars
list consisting of vector of AR parameters named 'ar' and vector of MA parameters named 'ma'.
sim(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)), n = 1000) mod <- armacopula(list(ar = 0.95, ma = -0.85)) kendall(mod)
sim(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)), n = 1000) mod <- armacopula(list(ar = 0.95, ma = -0.85)) kendall(mod)
Transform a fitted armacopula into a fitted dvinecopula or dvinecopula2 object
armafit2dvine(object)
armafit2dvine(object)
object |
an object of class tscopulafit in which the copula is of class armacopula. |
An object of class tscopulafit in which the copula is a dvinecopula (for fitted AR copulas) or class dvinecopula2 (for fitted MA or ARMA copulas).
Turn vector of ARMA parameters into list
armavec2list(theta, order)
armavec2list(theta, order)
theta |
vector of ARMA model parameters |
order |
order of model |
a list containing ARMA parameters in components ar and ma
This function begins with a model based exclusively on Gaussian pair copulas and systematically replaces a finite number of copulas with non-Gaussian alternatives that lower a specified information criterion.
auto_dvine( model, nreplace = 5, tautol = 1e-04, maxlag = Inf, ICtol = 0.5, nstrike = 3, criterion = "AIC", choices = c("gumbel", "clayton", "frank", "joe"), verbose = TRUE )
auto_dvine( model, nreplace = 5, tautol = 1e-04, maxlag = Inf, ICtol = 0.5, nstrike = 3, criterion = "AIC", choices = c("gumbel", "clayton", "frank", "joe"), verbose = TRUE )
model |
an object of class tscopulafit such that |
nreplace |
fixed number of copulas to replace |
tautol |
tolerance for setting the effective maximum lag in list of copulas |
maxlag |
fixed value for maximum lag |
ICtol |
tolerance for deciding on a premature stop to copula replacement |
nstrike |
number of negligible improvements before premature stop |
criterion |
information criterion to be used (AIB, BIC or AICc) |
choices |
vector of copula names to be used for replacements |
verbose |
logical parameter specifying whether a verbose output is desired |
The number of copulas to replace is specified by nreplace
but the algorithm may stop
prematurely if the information criterion is barely lowered over nstrike
consecutive steps.
This is a slow function to execute. Increasing tautol
or setting a value for
maxlag
will speed it up at the cost of some accuracy in the final model. The default
choices of copula are all one-parameter but the t copula can be added if desired.
For copulas without radial symmetry different rotations are tried to accommodate negative
and positive dependencies.
An object of class tscopulafit such that model@tscopula
is of class
sdvinecopula.
Time series of Bitcoin closing prices from 31 December 2015 to 31 December 2019 (1044 values). This permits the calculation of 4 calendar years of returns.
data(bitcoin)
data(bitcoin)
An object of class "xts"
.
data(bitcoin) plot(bitcoin) X <- (diff(log(bitcoin))[-1]) * 100 plot(X)
data(bitcoin) plot(bitcoin) X <- (diff(log(bitcoin))[-1]) * 100 plot(X)
Convert tscopula object to tscm object
## S4 method for signature 'tscopula,tscm' coerce(from, to = "tsc", strict = TRUE)
## S4 method for signature 'tscopula,tscm' coerce(from, to = "tsc", strict = TRUE)
from |
a tscopula object. |
to |
a tscm object. |
strict |
logical variable stating whether strict coercion should be enforced. |
A tscm object.
Convert tscopulafit object to be tscmfit object
## S4 method for signature 'tscopulafit,tscmfit' coerce(from, to = "tscmfit", strict = TRUE)
## S4 method for signature 'tscopulafit,tscmfit' coerce(from, to = "tscmfit", strict = TRUE)
from |
a tscopulafit object. |
to |
a tscmfit object. |
strict |
logical variable stating whether strict coercion should be enforced. |
A tscmfit object.
Time series of US quarterly CPI (consumer price index) data Q4 1959 to Q4 2020 (245 values) for studying inflation. These data were sourced from the OECD webpage and represent the total ‘perspective’ on inflation, including food and energy. They have been based to have a value of 100 in 2015.
data(cpi)
data(cpi)
An object of class "xts"
.
data(cpi) plot(cpi) X <- (diff(log(cpi))[-1]) * 100 plot(X)
data(cpi) plot(cpi) X <- (diff(log(cpi))[-1]) * 100 plot(X)
Compute the density function of the marginal model.
dmarg(x, y, log = FALSE)
dmarg(x, y, log = FALSE)
x |
an object of class margin. |
y |
vector of values for which density should be computed. |
log |
logical variable specifying whether log density should be returned. |
A vector of values for the density.
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) dmarg(margmod, c(-2, 0, 2), log = TRUE)
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) dmarg(margmod, c(-2, 0, 2), log = TRUE)
Double Weibull distribution
ddoubleweibull(x, mu = 0.05, shape = 1, scale = 1, log = FALSE) pdoubleweibull(q, mu = 0.05, shape = 1, scale = 1) qdoubleweibull(p, mu = 0.05, shape = 1, scale = 1) rdoubleweibull(n, mu = 0.05, shape = 1, scale = 1)
ddoubleweibull(x, mu = 0.05, shape = 1, scale = 1, log = FALSE) pdoubleweibull(q, mu = 0.05, shape = 1, scale = 1) qdoubleweibull(p, mu = 0.05, shape = 1, scale = 1) rdoubleweibull(n, mu = 0.05, shape = 1, scale = 1)
x |
vector of values. |
mu |
location parameter. |
shape |
shape parameter. |
scale |
scale parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
This function sets up a stationary d-vine process of finite order where the elements of
the (finite-length) copula sequence may be any copulas that can be implemented using
bicop_dist
in the rvinecopulib
package.
dvinecopula(family = "indep", pars = list(NULL), rotation = 0)
dvinecopula(family = "indep", pars = list(NULL), rotation = 0)
family |
a vector of family names |
pars |
a list containing the parameters of the copula at each lag |
rotation |
a vector of rotations |
Copulas may also be rotated through 90, 180 and 270 degrees. If the
same family
or same rotation
is to be used at every lag, these arguments may be scalars.
The pars
argument must be a list with the same length as the copula sequence.
If a t copula is included, the correlation parameter precedes the degrees of freedom in the parameter vector. This copula should be referred to as "t" rather than "Student".
An object of class dvinecopula.
dvinecopula(family = c("joe", "gauss", "t"), pars = list(3, .5, c(0.4, 4)), rotation = c(180, 0, 0))
dvinecopula(family = c("joe", "gauss", "t"), pars = list(3, .5, c(0.4, 4)), rotation = c(180, 0, 0))
Class of objects for d-vine copula processes.
## S4 method for signature 'dvinecopula' coef(object) ## S4 method for signature 'dvinecopula' show(object) ## S4 method for signature 'dvinecopula' sim(object, n = 1000, innov = NA, start = NA) ## S4 method for signature 'dvinecopula' predict(object, data, x, type = "df") ## S4 method for signature 'dvinecopula' kendall(object, lagmax = 20)
## S4 method for signature 'dvinecopula' coef(object) ## S4 method for signature 'dvinecopula' show(object) ## S4 method for signature 'dvinecopula' sim(object, n = 1000, innov = NA, start = NA) ## S4 method for signature 'dvinecopula' predict(object, data, x, type = "df") ## S4 method for signature 'dvinecopula' kendall(object, lagmax = 20)
object |
an object of the class. |
n |
length of realization. |
innov |
vector of innovations of length n. |
start |
vector of start values with length equal to order of process. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
lagmax |
maximum value of lag. |
coef(dvinecopula)
: Coef method for dvinecopula class
show(dvinecopula)
: Show method for dvinecopula class
sim(dvinecopula)
: Simulation method for dvinecopula class
predict(dvinecopula)
: Prediction method for dvinecopula class
kendall(dvinecopula)
: Calculate Kendall's tau values for pair copulas in d-vine copula
name
name of the d-vine copula process.
modelspec
list containing the family, number of parameters and rotations
pars
list comprising of the parameters.
mixmod <- dvinecopula(family = c("gumbel", "gauss"), pars = list(1.5, -0.6)) kendall(mixmod)
mixmod <- dvinecopula(family = c("gumbel", "gauss"), pars = list(1.5, -0.6)) kendall(mixmod)
This function sets up a stationary d-vine process of finite or infinite order based on a single
copula family from a subset of those that can be implemented using
bicop_dist
in the rvinecopulib
package.
dvinecopula2( family = "gauss", rotation = 0, kpacf = "kpacf_arma", pars = list(ar = 0.1, ma = 0.1), tautol = 1e-04, maxlag = Inf, negtau = "none" )
dvinecopula2( family = "gauss", rotation = 0, kpacf = "kpacf_arma", pars = list(ar = 0.1, ma = 0.1), tautol = 1e-04, maxlag = Inf, negtau = "none" )
family |
family name |
rotation |
a scalar specifying the rotation (default is 0) |
kpacf |
a character string giving the name of the Kendall pacf |
pars |
a list containing the parameters of the model |
tautol |
scalar value at which kpacf is truncated |
maxlag |
a scalar which can be used to force a given value for maximum lag |
negtau |
a character string specifying the treatment of negative Kendall's tau values |
The copula family may be any one-parameter family or the t copula family. The basic copula from
which the sequence is built may be rotated through 180 degrees using the rotation
argument; the default
is no rotation (0 degrees).
The copulas are parameterized using the Kendall partial autocorrelation function (kpacf) specified
by the kpacf
argument. The default choice is the kpacf of a standard ARMA process which is
implemented in the function kpacf_arma
. The parameters
of the kpacf should be set as a list using the pars
argument; the required parameters should usually
be clear from the documentation of the chosen kpacf function and must be correctly named.
If the kpacf takes a negative value at any lag and the standard copula is unable to model a
negative dependency (e.g. Clayton, Gumbel, Joe and their 180 degree rotations) then one of four
different treatments may be specified using the negtau
parameter: "gauss" substitutes a
Gaussian copula at that lag; "frank" substitutes a Frank copula; "right" and "left" rotate the copula
through 90 degrees in a clockwise or anto-clockwise direction respectively.
In practice, the sequence of copulas will be truncated at the last copula for which the kpacf exceeds tautol
.
The maxlag
parameter is typically used to force the truncation to take place at a lower lag (to increase speed).
This can also be achieved by increasing the value of tautol
.
If the t copula is chosen by setting family
equal to "t", the list of
parameters needs to be augmented with a component named "df" which is
the degrees of freedom. In this case it makes sense to set maxlag
to be a finite number to avoid models
with tail dependencies at arbitrary lags which are not ergodic. The class dvinecopula3
is more suitable for working with t copulas with different degrees of freedom at different lags.
An object of class dvinecopula2.
dvinecopula2(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30)
dvinecopula2(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30)
Class of objects for d-vine copula processes. See dvinecopula2 for more details.
## S4 method for signature 'dvinecopula2' coef(object) ## S4 method for signature 'dvinecopula2' show(object) ## S4 method for signature 'dvinecopula2' sim(object, n = 1000) ## S4 method for signature 'dvinecopula2' predict(object, data, x, type = "df") ## S4 method for signature 'dvinecopula2' kendall(object, lagmax = 20)
## S4 method for signature 'dvinecopula2' coef(object) ## S4 method for signature 'dvinecopula2' show(object) ## S4 method for signature 'dvinecopula2' sim(object, n = 1000) ## S4 method for signature 'dvinecopula2' predict(object, data, x, type = "df") ## S4 method for signature 'dvinecopula2' kendall(object, lagmax = 20)
object |
an object of the class. |
n |
length of realization. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
lagmax |
maximum value of lag. |
coef(dvinecopula2)
: Coef Method for dvinecopula2 class
show(dvinecopula2)
: Show method for dvinecopula2 class
sim(dvinecopula2)
: Simulation method for dvinecopula2 class
predict(dvinecopula2)
: Prediction method for dvinecopula2 class
kendall(dvinecopula2)
: Calculate Kendall's tau values for pair copulas in type 2 d-vine copula
name
name of the d-vine copula process.
modelspec
list containing the family, rotation, and name of KPACF
pars
list comprising of the parameters.
copmod <- dvinecopula2(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30) kendall(copmod)
copmod <- dvinecopula2(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30) kendall(copmod)
This function sets up a stationary d-vine process of finite or infinite order based on a
sequence of Gaussian copulas with a finite number of non-Gaussian substitutions at specified lags.
The substituted families can be Gumbel, Clayton, Joe, Frank, t and BB1 copulas as implemented by the
bicop_dist
in the rvinecopulib
package. The Gauss copula can be
named in the list of substitutions but does not need to be.
dvinecopula3( location = 1, family = "gumbel", posrot = 0, negrot = 90, kpacf = "kpacf_arma", pars = list(ar = 0.1, ma = 0.1), auxpar = NA, tautol = 1e-04, maxlag = Inf )
dvinecopula3( location = 1, family = "gumbel", posrot = 0, negrot = 90, kpacf = "kpacf_arma", pars = list(ar = 0.1, ma = 0.1), auxpar = NA, tautol = 1e-04, maxlag = Inf )
location |
vector of locations of copula substitutions |
family |
vector of family names for copula substitutions |
posrot |
vector of rotations for substituted families under positive dependence (default is 0) |
negrot |
vector of rotations for substituted families under negative dependence (default is 90) |
kpacf |
a character string giving the name of the Kendall pacf |
pars |
a list containing the parameters of the model |
auxpar |
vector of additional parameters for two-parameter copulas |
tautol |
scalar value at which kpacf is truncated |
maxlag |
a scalar which can be used to force a given value for maximum lag |
For the substituted copulas (other than t and Frank) the user must specify the rotation that should be used for positive dependencies (0 or 180) and the rotation that should be used for negative dependencies (90 or 270).
The copulas are parameterized using the Kendall partial autocorrelation function (kpacf) specified
by the kpacf
argument. The default choice is the kpacf of a standard ARMA process which is
implemented in the function kpacf_arma
. The parameters
of the kpacf should be set as a list using the pars
argument; the required parameters should usually
be clear from the documentation of the chosen kpacf function and must be correctly named.
In practice, the sequence of copulas will be truncated at the last copula for which the kpacf exceeds tautol
.
The maxlag
parameter is typically used to force the truncation to take place at a lower lag (to increase speed).
This can also be achieved by increasing the value of tautol
.
If one or more of the substituted copulas are t or BB1 copulas the argument auxpar
should be used to
specify the additional parameters. These are the degree-of-freedom parameter for t and the delta parameter for BB1;
the former must be greater or equal 2 and the latter greater or equal 1.
An object of class dvinecopula3.
dvinecopula3(location = c(1,4), family = c("Gumbel", "clayton"), posrot = c(0, 180), negrot = c(90, 270), kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = 0.85), maxlag = 20)
dvinecopula3(location = c(1,4), family = c("Gumbel", "clayton"), posrot = c(0, 180), negrot = c(90, 270), kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = 0.85), maxlag = 20)
Class of objects for d-vine copula processes. See dvinecopula3 for more details.
## S4 method for signature 'dvinecopula3' coef(object) ## S4 method for signature 'dvinecopula3' kendall(object, lagmax = 20) ## S4 method for signature 'dvinecopula3' show(object) ## S4 method for signature 'dvinecopula3' sim(object, n = 1000) ## S4 method for signature 'dvinecopula3' predict(object, data, x, type = "df")
## S4 method for signature 'dvinecopula3' coef(object) ## S4 method for signature 'dvinecopula3' kendall(object, lagmax = 20) ## S4 method for signature 'dvinecopula3' show(object) ## S4 method for signature 'dvinecopula3' sim(object, n = 1000) ## S4 method for signature 'dvinecopula3' predict(object, data, x, type = "df")
object |
an object of the class. |
lagmax |
maximum value of lag to be considered. |
n |
length of realization. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
coef(dvinecopula3)
: Coef Method for dvinecopula3 class
kendall(dvinecopula3)
: Calculate Kendall's tau values for pair copulas in type 3 d-vine copula
show(dvinecopula3)
: Show method for dvinecopula3 class
sim(dvinecopula3)
: Simulation method for dvinecopula3 class
predict(dvinecopula3)
: Prediction method for dvinecopula2 class
name
name of the d-vine copula process.
modelspec
list containing the family, rotation, and name of KPACF
pars
list comprising of the parameters.
This function sets up a stationary d-vine process of finite or infinite order based on a single
inverse-v-transformed copula family from a subset of those that can be implemented using
bicop_dist
in the rvinecopulib
package.
dvinecopulavt( family = "joe", rotation = 0, kpacf = "kpacf_arma", pars = list(ar = 0.1, ma = 0), vt1 = Vlinear(0.5), vt2 = Vlinear(0.5), tautol = 1e-04, maxlag = Inf, V2override = FALSE )
dvinecopulavt( family = "joe", rotation = 0, kpacf = "kpacf_arma", pars = list(ar = 0.1, ma = 0), vt1 = Vlinear(0.5), vt2 = Vlinear(0.5), tautol = 1e-04, maxlag = Inf, V2override = FALSE )
family |
family name |
rotation |
a scalar specifying the rotation (default is 0) |
kpacf |
a character string giving the name of the Kendall pacf |
pars |
a list containing the parameters of the model |
vt1 |
first v-transform |
vt2 |
second v-transform |
tautol |
scalar value at which kpacf is truncated |
maxlag |
a scalar which can be used to force a given value for maximum lag |
V2override |
logical variable stating whether 2-parameter v-transform should be permitted |
The permitted choices of base copula family are currently Joe, Gumbel, Frank, ast or Clayton survival. If
Clayton is chosen, the rotation
argument must be set to 180, while if Joe, Gumbel or ast are chosen, the
rotation
argument must be zero (which is the default); any other options will return an error
The copulas are parameterized using the Kendall partial autocorrelation function (kpacf)
of the base copula sequence specified
by the kpacf
argument. The default choice is the kpacf of a standard ARMA process which is
implemented in the function kpacf_arma
. The parameters
of the kpacf should be set as a list using the pars
argument; the required parameters should usually
be clear from the documentation of the chosen kpacf function and must be correctly named.
The arguments vt1
and vt2
are used to enter two parametric v-transforms which may be created, for example,
by Vlinear
or V2p
. However, the latter is very slow and the
variable V2override
has to be set to TRUE
if you want to include 2-parameter
v-transforms. While fitting is possible, residual analysis and simulation are almost always
prohibitively slow.
For data showing stochastic volatility, we expect positive serial dependencies in the base copula sequence. For this reason, we do not consider models where the kpacf takes negative values.
In practice, the sequence of base copulas will be truncated at the last copula for which the kpacf exceeds tautol
.
The maxlag
parameter is typically used to force the truncation to take place at a lower lag (to increase speed).
This can also be achieved by increasing the value of tautol
.
An object of class dvinecopulavt.
dvinecopulavt(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30)
dvinecopulavt(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30)
Class of objects for d-vine copula processes. See dvinecopulavt for more details.
## S4 method for signature 'dvinecopulavt' coef(object) ## S4 method for signature 'dvinecopulavt' show(object) ## S4 method for signature 'dvinecopulavt' kendall(object, lagmax = 20) ## S4 method for signature 'dvinecopulavt' sim(object, n = 1000, forcetrunc = TRUE) ## S4 method for signature 'dvinecopulavt' predict(object, data, x, type = "df")
## S4 method for signature 'dvinecopulavt' coef(object) ## S4 method for signature 'dvinecopulavt' show(object) ## S4 method for signature 'dvinecopulavt' kendall(object, lagmax = 20) ## S4 method for signature 'dvinecopulavt' sim(object, n = 1000, forcetrunc = TRUE) ## S4 method for signature 'dvinecopulavt' predict(object, data, x, type = "df")
object |
an object of the class. |
lagmax |
maximum value of lag. |
n |
length of realization. |
forcetrunc |
logical parameter: TRUE truncates the copula sequence at lag 10 to accelerate simulation if copula sequence is longer; FALSE turns this feature off. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
coef(dvinecopulavt)
: Coef Method for dvinecopulavt class
show(dvinecopulavt)
: Show method for dvinecopulavt class
kendall(dvinecopulavt)
: Calculate Kendall's tau values for core pair copulas
in d-vine copula model with v-transforms
sim(dvinecopulavt)
: Simulation method for dvinecopulavt class
predict(dvinecopulavt)
: Prediction method for dvinecopulavt class
name
name of the d-vine copula process.
modelspec
list containing the family, rotation, and name of KPACF
pars
list comprising of the parameters.
copmod <- dvinecopulavt(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30) kendall(copmod)
copmod <- dvinecopulavt(family = "joe", kpacf = "kpacf_arma", pars = list(ar = 0.95, ma = -0.85), maxlag = 30) kendall(copmod)
Construct empirical margin
edf()
edf()
An object of class margin signifying an empirical distribution function.
Methods are available for objects of class tscopulaU, vtscopula, tscopulafit, margin and tscm.
fit(x, y, ...)
fit(x, y, ...)
x |
an object of the model class. |
y |
a vector or time series of data. |
... |
further arguments to be passed on. |
An object of the fitted model class.
Fit method for margin class
## S4 method for signature 'margin' fit(x, y, tsoptions = list(), control = list())
## S4 method for signature 'margin' fit(x, y, tsoptions = list(), control = list())
x |
an object of class margin. |
y |
a vector or time series of data. |
tsoptions |
list of optional arguments: hessian is logical variable specifying whether Hessian matrix should be returned; start is vector od named starting values |
control |
list of control parameters to be passed to the
|
An object of class marginfit.
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) data <- sim(margmod, n = 500) fit(margmod, data)
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) data <- sim(margmod, n = 500) fit(margmod, data)
Fit method for tscm class
## S4 method for signature 'tscm' fit(x, y, tsoptions = list(), control = list(), method = "IFM")
## S4 method for signature 'tscm' fit(x, y, tsoptions = list(), control = list(), method = "IFM")
x |
an object of class tscm. |
y |
a vector or time series of data. |
tsoptions |
a list of parameters passed to fitting. |
control |
list of control parameters to be passed to the
|
method |
character string specifying method. |
An object of class tscmfit.
mod <- tscm(dvinecopula(family = "gauss", pars = 0.5), margin("doubleweibull")) y <- sim(mod) fit(mod, y)
mod <- tscm(dvinecopula(family = "gauss", pars = 0.5), margin("doubleweibull")) y <- sim(mod) fit(mod, y)
Fit method for tscopulafit class
## S4 method for signature 'tscopulafit' fit(x, y, tsoptions = list(), control = list(warn.1d.NelderMead = FALSE))
## S4 method for signature 'tscopulafit' fit(x, y, tsoptions = list(), control = list(warn.1d.NelderMead = FALSE))
x |
an object of class tscopulafit. |
y |
vector or time series of data to which the copula process is to be fitted. |
tsoptions |
list of options |
control |
list of control parameters to be passed to the
|
An object of class tscopulafit.
ar1 <- armacopula(list(ar = 0.7)) data <- sim(ar1, 1000) ar1fit <- fit(fit(ar1, data), sim(ar1, 1000))
ar1 <- armacopula(list(ar = 0.7)) data <- sim(ar1, 1000) ar1fit <- fit(fit(ar1, data), sim(ar1, 1000))
Fit method for tscopulaU class
## S4 method for signature 'tscopulaU' fit(x, y, tsoptions = list(), control = list())
## S4 method for signature 'tscopulaU' fit(x, y, tsoptions = list(), control = list())
x |
an object of class tscopulaU. |
y |
vector or time series of data to which the copula process is to be fitted. |
tsoptions |
list of options |
control |
list of control parameters to be passed to the
|
An object of class tscopulafit.
data <- sim(armacopula(list(ar = 0.5, ma = 0.4)), n = 1000) fit(armacopula(list(ar = 0.5, ma = 0.4)), data)
data <- sim(armacopula(list(ar = 0.5, ma = 0.4)), n = 1000) fit(armacopula(list(ar = 0.5, ma = 0.4)), data)
Fit object of class vtscopula to data using maximum likelihood.
## S4 method for signature 'vtscopula' fit( x, y, tsoptions = list(), control = list(maxit = 2000, warn.1d.NelderMead = FALSE) )
## S4 method for signature 'vtscopula' fit( x, y, tsoptions = list(), control = list(maxit = 2000, warn.1d.NelderMead = FALSE) )
x |
an object of class vtscopula. |
y |
a vector or time series of data. |
tsoptions |
list of optional arguments: hessian is logical variable specifying whether Hessian matrix should be returned; method is choice of optimization method. |
control |
list of control parameters to be passed to the
|
An object of class tscopulafit.
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) vtcop <- vtscopula(copobject, Vtransform = V2p()) y <- sim(vtcop) fit(vtcop, y)
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) vtcop <- vtscopula(copobject, Vtransform = V2p()) y <- sim(vtcop) fit(vtcop, y)
Gaussian distribution
dgauss(x, mu = 0, sigma = 1, log = FALSE) pgauss(q, mu = 0, sigma = 1) qgauss(p, mu = 0, sigma = 1) rgauss(n, mu = 0, sigma = 1)
dgauss(x, mu = 0, sigma = 1, log = FALSE) pgauss(q, mu = 0, sigma = 1) qgauss(p, mu = 0, sigma = 1) rgauss(n, mu = 0, sigma = 1)
x |
vector of values. |
mu |
location parameter. |
sigma |
scale parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Centred Gaussian distribution
dgauss0(x, sigma = 1, log = FALSE) pgauss0(q, sigma = 1) qgauss0(p, sigma = 1) rgauss0(n, sigma = 1)
dgauss0(x, sigma = 1, log = FALSE) pgauss0(q, sigma = 1) qgauss0(p, sigma = 1) rgauss0(n, sigma = 1)
x |
vector of values. |
sigma |
scale parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Generalized hyperbolic distribution
pgh(q, lambda = 0, shape = 1, gamma = 0, mu = 0, sigma = 1) qgh(p, lambda, shape = 1, gamma = 0, mu = 0, sigma = 1) dgh(x, lambda, shape = 1, gamma = 0, mu = 0, sigma = 1, log = FALSE) rgh(n, lambda, shape = 1, gamma = 0, mu = 0, sigma = 0)
pgh(q, lambda = 0, shape = 1, gamma = 0, mu = 0, sigma = 1) qgh(p, lambda, shape = 1, gamma = 0, mu = 0, sigma = 1) dgh(x, lambda, shape = 1, gamma = 0, mu = 0, sigma = 1, log = FALSE) rgh(n, lambda, shape = 1, gamma = 0, mu = 0, sigma = 0)
q |
vector of quantiles. |
lambda |
overarching shape parameter. |
shape |
shape parameter. |
gamma |
skewness parameter. |
mu |
location parameter. |
sigma |
scale parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
Generalized lagging function
glag(x, lagmax = 20, glagplot = FALSE)
glag(x, lagmax = 20, glagplot = FALSE)
x |
an object of class tscopulafit. |
lagmax |
maximum value for lag. |
glagplot |
logical value indicating generalized lag plot. |
If glagplot
is TRUE
a list of generalized lagged datasets
of maximum length 9 is returned to facilitate a generalized lagplot.
If glagplot
is FALSE
a vector of length lagmax
containing
the Kendall rank correlations for the generalized lagged datasets is returned.
Hyperbolic distribution
phyp(q, shape = 1, gamma = 0, mu = 0, sigma = 1) qhyp(p, shape = 1, gamma = 0, mu = 0, sigma = 1) dhyp(x, shape = 1, gamma = 0, mu = 0, sigma = 1, log = FALSE) rhyp(n, shape = 1, gamma = 0, mu = 0, sigma = 0)
phyp(q, shape = 1, gamma = 0, mu = 0, sigma = 1) qhyp(p, shape = 1, gamma = 0, mu = 0, sigma = 1) dhyp(x, shape = 1, gamma = 0, mu = 0, sigma = 1, log = FALSE) rhyp(n, shape = 1, gamma = 0, mu = 0, sigma = 0)
q |
vector of quantiles. |
shape |
shape parameter. |
gamma |
skewness parameter. |
mu |
location parameter. |
sigma |
scale parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
Johnson's SU distribution
pjsu(q, delta = 2, mu = 0, sigma = 1, gamma = 0) qjsu(p, delta, mu, sigma, gamma) djsu(x, delta, mu, sigma, gamma, log = FALSE) rjsu(n, delta, mu, sigma, gamma)
pjsu(q, delta = 2, mu = 0, sigma = 1, gamma = 0) qjsu(p, delta, mu, sigma, gamma) djsu(x, delta, mu, sigma, gamma, log = FALSE) rjsu(n, delta, mu, sigma, gamma)
q |
vector of quantiles. |
delta |
shape parameter. |
mu |
location parameter. |
sigma |
scale parameter. |
gamma |
skewness parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Methods are available for objects of class armacopula, dvinecopula, dvinecopula2 and vtscopula.
kendall(object, ...)
kendall(object, ...)
object |
an object of the model class. |
... |
further arguments to be passed to Kendall calculation. |
A vector of Kendall correlations.
Kalman filter for ARMA copula model
kfilter(x, y)
kfilter(x, y)
x |
an object of class armacopula. |
y |
a vector of data. |
A matrix or multivariate time series with columns consisting of conditional mean, standard deviation and residuals.
data <- sim(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)), n = 1000) kfilter(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)), data)
data <- sim(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)), n = 1000) kfilter(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)), data)
KPACF of ARFIMA process
kpacf_arfima(k, theta)
kpacf_arfima(k, theta)
k |
number of lags. |
theta |
list with components ar, ma and d specifying the ARFIMA parameters |
A vector of Kendall partial autocorrelations of length k
.
KPACF of ARMA process
kpacf_arma(k, theta)
kpacf_arma(k, theta)
k |
number of lags. |
theta |
list with components ar and ma specifying the ARMA parameters. |
A vector of Kendall partial autocorrelations of length k
.
KPACF of fractional Brownian noise
kpacf_fbn(k, theta)
kpacf_fbn(k, theta)
k |
number of lags |
theta |
parameter of process |
A vector of Kendall partial autocorrelations of length k
.
KPACF of monthly seasonal ARMA process
kpacf_sarma12(k, theta)
kpacf_sarma12(k, theta)
k |
number of lags. |
theta |
list with components ar, ma, sar and sma specifying the ARMA and seasonal ARMA parameters. |
A vector of Kendall partial autocorrelations of length k
.
KPACF of quarterly seasonal ARMA process
kpacf_sarma4(k, theta)
kpacf_sarma4(k, theta)
k |
number of lags. |
theta |
list with components ar, ma, sar and sma specifying the ARMA and seasonal ARMA parameters. |
A vector of Kendall partial autocorrelations of length k
.
Laplace distribution
dlaplace(x, mu = 0, scale = 1, log = FALSE) plaplace(q, mu = 0, scale = 1) qlaplace(p, mu = 0, scale = 1) rlaplace(n, mu = 0, scale = 1)
dlaplace(x, mu = 0, scale = 1, log = FALSE) plaplace(q, mu = 0, scale = 1) qlaplace(p, mu = 0, scale = 1) rlaplace(n, mu = 0, scale = 1)
x |
vector of values. |
mu |
location parameter. |
scale |
scale parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Centred Laplace distribution
dlaplace0(x, scale = 1, log = FALSE) plaplace0(q, scale = 1) qlaplace0(p, scale = 1) rlaplace0(n, scale = 1)
dlaplace0(x, scale = 1, log = FALSE) plaplace0(q, scale = 1) qlaplace0(p, scale = 1) rlaplace0(n, scale = 1)
x |
vector of values. |
scale |
scale parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Constructor function for margin
margin(name, pars = NULL)
margin(name, pars = NULL)
name |
character string giving name of distribution |
pars |
parameters of the distribution |
An object of class margin.
margin("sst")
margin("sst")
Class of objects for marginal models for stationary time series. The object is given a name and there must exist functions pname, qname, dname and rname. As well as the parameters of the distribution, dname must have the logical argument log specifying whether log density should be computed.
## S4 method for signature 'margin' coef(object) ## S4 method for signature 'margin' sim(object, n = 1000) ## S4 method for signature 'margin' show(object)
## S4 method for signature 'margin' coef(object) ## S4 method for signature 'margin' sim(object, n = 1000) ## S4 method for signature 'margin' show(object)
object |
an object of the class. |
n |
length of realization. |
coef(margin)
: Coef method for margin class
sim(margin)
: Simulation method for margin class
show(margin)
: Show method for margin class
name
name of the marginal model class.
pars
a numeric vector containing the named parameters of the distribution which are passed as arguments to pname, qname, dname and rname.
new("margin", name = "gauss", pars = c(mu = 0, sigma = 1)) margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) sim(margmod, n = 500)
new("margin", name = "gauss", pars = c(mu = 0, sigma = 1)) margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) sim(margmod, n = 500)
Fitted marginal model for time series
## S4 method for signature 'marginfit' logLik(object)
## S4 method for signature 'marginfit' logLik(object)
object |
an object of the class. |
logLik(marginfit)
: logLik method for marginfit class
margin
an object of class margin.
data
numeric vector or time series of data.
fit
a list containing details of the maximum likelihood fit.
Normal inverse Gaussian distribution
pnig(q, shape = 1, gamma = 0, mu = 0, sigma = 1) qnig(p, shape = 1, gamma = 0, mu = 0, sigma = 1) dnig(x, shape = 1, gamma = 0, mu = 0, sigma = 1, log = FALSE) rnig(n, shape = 1, gamma = 0, mu = 0, sigma = 0)
pnig(q, shape = 1, gamma = 0, mu = 0, sigma = 1) qnig(p, shape = 1, gamma = 0, mu = 0, sigma = 1) dnig(x, shape = 1, gamma = 0, mu = 0, sigma = 1, log = FALSE) rnig(n, shape = 1, gamma = 0, mu = 0, sigma = 0)
q |
vector of quantiles. |
shape |
shape parameter. |
gamma |
skewness parameter. |
mu |
location parameter. |
sigma |
scale parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
Check for invertibility of ARMA process
non_invert(ma)
non_invert(ma)
ma |
vector of moving average parameters. |
A logical variable stating whether ARMA process is invertible.
Check for causality of ARMA process
non_stat(ar)
non_stat(ar)
ar |
vector of autoregressive parameters |
A logical variable stating whether ARMA process is causal.
Compute autocorrelations from partial autocorrelations
pacf2acf(alpha)
pacf2acf(alpha)
alpha |
vector of partial autocorrelation values. |
A vector of autocorrelation values with same length as alpha
.
alpha <- ARMAacf(ar = -0.9, ma = 0.8, lag.max = 50, pacf = TRUE) rho <- pacf2acf(alpha)
alpha <- ARMAacf(ar = -0.9, ma = 0.8, lag.max = 50, pacf = TRUE) rho <- pacf2acf(alpha)
Compute autoregressive coefficients from partial autocorrelations
pacf2ar(alpha)
pacf2ar(alpha)
alpha |
vector of partial autocorrelation values. |
A vector of autoregressive coefficients with same length as alpha
.
alpha <- ARMAacf(ar = -0.9, ma = 0.8, lag.max = 50, pacf = TRUE) phi <- pacf2ar(alpha)
alpha <- ARMAacf(ar = -0.9, ma = 0.8, lag.max = 50, pacf = TRUE) phi <- pacf2ar(alpha)
Computes the probability that if we v-transform a uniform random variable and then stochastically invert the v-transform, we get back to the original value.
pcoincide(x)
pcoincide(x)
x |
an object of class Vtransform. |
The probability of coincidence.
pcoincide(Vlinear(delta = 0.4)) pcoincide(V3p(delta = 0.45, kappa = 0.5, xi = 1.3))
pcoincide(Vlinear(delta = 0.4)) pcoincide(V3p(delta = 0.45, kappa = 0.5, xi = 1.3))
Adjusted empirical distribution function
pedf(x, data, proper = FALSE)
pedf(x, data, proper = FALSE)
x |
argument of empirical distribution function. |
data |
vector of data for constructing empirical distribution function. |
proper |
logical variable which when set to TRUE will return the standard empirical distribution function. |
a vector of same length as x
Plot method for marginfit class
## S4 method for signature 'marginfit,missing' plot(x, bw = FALSE)
## S4 method for signature 'marginfit,missing' plot(x, bw = FALSE)
x |
an object of class marginfit. |
bw |
logical variable specifying whether black-white options should be chosen. |
No return value, generates plot.
Plot method for tscmfit class
## S4 method for signature 'tscmfit,missing' plot(x, plottype = "residual", bw = FALSE, lagmax = 30)
## S4 method for signature 'tscmfit,missing' plot(x, plottype = "residual", bw = FALSE, lagmax = 30)
x |
an object of class tscmfit. |
plottype |
type of plot required. |
bw |
logical variable specifying whether black-white options should be chosen. |
lagmax |
maximum lag value for dvinecopula2 plots |
No return value, generates plot.
Plot method for tscopulafit class
## S4 method for signature 'tscopulafit,missing' plot(x, plottype = "residual", bw = FALSE, lagmax = 30)
## S4 method for signature 'tscopulafit,missing' plot(x, plottype = "residual", bw = FALSE, lagmax = 30)
x |
an object of class tscopulafit. |
plottype |
type of plot required. |
bw |
logical variable specifying whether black-white options should be chosen. |
lagmax |
maximum lag value for Kendall plots |
No return value, generates plot.
data <- sim(armacopula(list(ar = 0.5, ma = 0.4)), n = 1000) fit <- fit(armacopula(list(ar = 0.5, ma = 0.4)), data) plot(fit)
data <- sim(armacopula(list(ar = 0.5, ma = 0.4)), n = 1000) fit <- fit(armacopula(list(ar = 0.5, ma = 0.4)), data) plot(fit)
Plots the v-transform as well as its gradient or inverse. Can also plot the conditional probability that a series PIT falls below the fulcrum for a given volatility PIT value v.
## S4 method for signature 'Vtransform,missing' plot( x, type = "transform", shading = TRUE, npoints = 200, lower = 0, upper = 1 )
## S4 method for signature 'Vtransform,missing' plot( x, type = "transform", shading = TRUE, npoints = 200, lower = 0, upper = 1 )
x |
an object of class Vtransform. |
type |
type of plot: 'transform' for plot of transform, 'inverse' for plot of inverse, 'gradient' for plot of gradient or 'pdown' for plot of conditional probability. |
shading |
logical variable specifying whether inadmissible zone for v-transform should be shaded |
npoints |
number of plotting points along x-axis. |
lower |
the lower x-axis value for plotting. |
upper |
the upper x-axis value for plotting |
No return value, generates plot.
plot(Vsymmetric()) plot(V2p(delta = 0.45, kappa = 0.8), type = "inverse") plot(V2p(delta = 0.45, kappa = 0.8), type = "gradient")
plot(Vsymmetric()) plot(V2p(delta = 0.45, kappa = 0.8), type = "inverse") plot(V2p(delta = 0.45, kappa = 0.8), type = "gradient")
Compute the cumulative distribution function of the marginal model.
pmarg(x, q)
pmarg(x, q)
x |
an object of class margin. |
q |
vector of values at which CDF should be computed. |
A vector of values for the CDF.
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) pmarg(margmod, c(-2, 0, 2))
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) pmarg(margmod, c(-2, 0, 2))
Profile likelihood for fulcrum parameter
profilefulcrum( data, tscopula = dvinecopula(family = 1, pars = list(0.1)), locations = seq(0, 1, by = 0.1), plot = TRUE )
profilefulcrum( data, tscopula = dvinecopula(family = 1, pars = list(0.1)), locations = seq(0, 1, by = 0.1), plot = TRUE )
data |
a vector or time series of data on (0,1). |
tscopula |
|
locations |
vector containing locations of different values for fulcrum. |
plot |
logical values specifying whether plot should be created. |
A matrix containing fulcrum values and log likelihood values.
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) vtcop <- vtscopula(copobject, Vtransform = V2p()) y <- sim(vtcop) profilefulcrum(y, vtcop)
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) vtcop <- vtscopula(copobject, Vtransform = V2p()) y <- sim(vtcop) profilefulcrum(y, vtcop)
Compute the quantile function of the marginal model.
qmarg(x, p)
qmarg(x, p)
x |
an object of class margin. |
p |
vector of probabilities for which quantiles should be computed. |
A vector of values for the quantile function.
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) qmarg(margmod, c(0.05, 0.5, 0.95))
margmod <- margin("gauss", pars = c(mu = 0, sigma = 1)) qmarg(margmod, c(0.05, 0.5, 0.95))
Quantile calculation method for VT-ARMA models
## S4 method for signature 'tscmfit' quantile(x, alpha, last = FALSE)
## S4 method for signature 'tscmfit' quantile(x, alpha, last = FALSE)
x |
an object of class tscmfit based on underlying copula of class armacopula. |
alpha |
a scalar probability value |
last |
logical value asserting that only the last volatility prediction should be returned |
a vector of the same length as the data embedded in the tscmfit object.
Rosenblatt backward function with v-transforms
Rbackward(x, u, pcs, vt1, vt2)
Rbackward(x, u, pcs, vt1, vt2)
x |
vector argument of Rosenblatt functiom |
u |
matrix of conditioning values. Number of rows must be either 1 or same length as x. Number of columns should not be much more than 15 (due to repeated recursive calling) |
pcs |
list of pair copulas |
vt1 |
first v-transform |
vt2 |
second v-transform |
vector of same length as x
Inverse Rosenblatt forward function with v-transforms
RforwardI(x, u, pcs, vt1, vt2)
RforwardI(x, u, pcs, vt1, vt2)
x |
vector argument of Rosenblatt functiom |
u |
matrix of conditioning values. Number of rows must be either 1 or same length as x. Number of columns should not be much more than 15 (due to repeated recursive calling) |
pcs |
list of pair copulas |
vt1 |
first v-transform |
vt2 |
second v-transform |
vector of same length as x
Calculate standard errors safely
safe_ses(hess)
safe_ses(hess)
hess |
a Hessian matrix from a model fit. |
a vector of standard errors.
Transform a sarmacopula object into an armacopula object
sarma2arma(object)
sarma2arma(object)
object |
an object of class sarmacopula. |
An object of class armacopula.
sarma2arma(sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4))
sarma2arma(sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4))
Transform a sarmacopula into a dvinecopula2 object
sarma2dvine(object)
sarma2dvine(object)
object |
an object of class sarmacopula. |
An object of class dvinecopula2.
sarma2dvine(sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4))
sarma2dvine(sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4))
Constructor function for SARMA copula process
sarmacopula(pars = list(ar = 0, ma = 0, sar = 0, sma = 0), period = 4)
sarmacopula(pars = list(ar = 0, ma = 0, sar = 0, sma = 0), period = 4)
pars |
list consisting of vector of AR parameters named 'ar' and vector of MA parameters named 'ma', SAR parameters named 'sar' and vector of SMA parameters named 'sma'. |
period |
period of seasonal model. |
An object of class sarmacopula.
sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4)
sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4)
Class of objects for seasonal ARMA copula processes.
## S4 method for signature 'sarmacopula' coef(object) ## S4 method for signature 'sarmacopula' show(object) ## S4 method for signature 'sarmacopula' sim(object, n = 1000) ## S4 method for signature 'sarmacopula' kendall(object, lagmax = 20) ## S4 method for signature 'sarmacopula' predict(object, data, x, type = "df")
## S4 method for signature 'sarmacopula' coef(object) ## S4 method for signature 'sarmacopula' show(object) ## S4 method for signature 'sarmacopula' sim(object, n = 1000) ## S4 method for signature 'sarmacopula' kendall(object, lagmax = 20) ## S4 method for signature 'sarmacopula' predict(object, data, x, type = "df")
object |
an object of the class. |
n |
length of realization. |
lagmax |
maximum value of lag. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
coef(sarmacopula)
: Coef method for SARMA copula class
show(sarmacopula)
: Show method for SARMA copula process
sim(sarmacopula)
: Simulation method for sarmacopula class
kendall(sarmacopula)
: Calculate Kendall's tau values for sarmacopula model
predict(sarmacopula)
: Prediction method for sarmacopula class
name
name of seasonal ARMA copula process.
modelspec
vector containing number of AR, MA, SAR and SMA parameters as well as the order D of seasonal differencing.
pars
list consisting of vector of AR parameters named 'ar' and vector of MA parameters named 'ma', SAR parameters named 'sar' and vector of SMA parameters named 'sma'.
sim(sarma2arma(sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4))) mod <- sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4) kendall(mod)
sim(sarma2arma(sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4))) mod <- sarmacopula(list(ar = 0.5, ma = 0.4, sar = 0.2, sma = 0.6), period = 4) kendall(mod)
Turn vector of SARMA parameters into list
sarmavec2list(theta, order)
sarmavec2list(theta, order)
theta |
vector of SARMA model parameters |
order |
order of model |
a list containing SARMA parameters in components ar, ma, sar and sma
Skew double Weibull distribution
dsdoubleweibull(x, mu = 0.05, shape = 1, scale = 1, gamma = 1, log = FALSE) psdoubleweibull(q, mu = 0.05, shape = 1, scale = 1, gamma = 1) qsdoubleweibull(p, mu = 0.05, shape = 1, scale = 1, gamma = 1) rsdoubleweibull(n, mu = 0.05, shape = 1, scale = 1, gamma = 1)
dsdoubleweibull(x, mu = 0.05, shape = 1, scale = 1, gamma = 1, log = FALSE) psdoubleweibull(q, mu = 0.05, shape = 1, scale = 1, gamma = 1) qsdoubleweibull(p, mu = 0.05, shape = 1, scale = 1, gamma = 1) rsdoubleweibull(n, mu = 0.05, shape = 1, scale = 1, gamma = 1)
x |
vector of values. |
mu |
location parameter. |
shape |
shape parameter. |
scale |
scale parameter. |
gamma |
skewness parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
This function sets up a stationary d-vine process of finite or infinite order. In general, models models consist of
base copulas and substituted copulas, which form a copula sequence. The copulas are parameterized using the
Kendall partial autocorrelation function (kpacf) specified by the kpacf
argument.
sdvinecopula( pars = list(ar = 0, ma = 0), kpacf = "kpacf_arma", family = NULL, posrot = 0, negrot = 90, basefamily = "gauss", baseposrot = 0, basenegrot = 0, auxpar = NA, tautol = 1e-04, maxlag = Inf )
sdvinecopula( pars = list(ar = 0, ma = 0), kpacf = "kpacf_arma", family = NULL, posrot = 0, negrot = 90, basefamily = "gauss", baseposrot = 0, basenegrot = 0, auxpar = NA, tautol = 1e-04, maxlag = Inf )
pars |
a list containing the parameters of the model |
kpacf |
a character string giving the name of the Kendall pacf (default is kpacf_arma) |
family |
vector of family names for copula substitutions |
posrot |
vector of rotations for substituted families under positive dependence (default is 0) |
negrot |
vector of rotations for substituted families under negative dependence (default is 90) |
basefamily |
scalar specifying base copula family (default is "gauss") |
baseposrot |
scalar specifying copula rotation under positive dependence (default is 0) |
basenegrot |
scalar specifying copula rotation under negative dependence (default is 0) |
auxpar |
vector of additional parameters for two-parameter copulas |
tautol |
scalar value at which kpacf is truncated |
maxlag |
a scalar which can be used to force a given value for maximum lag |
The default choice is the
kpacf of a standard ARMA process which is implemented in the function kpacf_arma
. The parameters
of the kpacf should be set as a named list using the pars
argument; the required parameters should usually
be clear from the documentation of the chosen kpacf function and must be correctly named.
The base copula sequence is specified by the name of a single 1-parameter copula in basefamily
,
which can be Gauss, Frank, Gumbel, Clayton or Joe. For choices other than Gauss or Frank, the
user must specify the rotation that should be used for positive dependencies (0 or 180) and the rotation that
should be used for negative dependencies (90 or 270). These are specified by the arguments baseposrot
and
basenegrot
respectively.
The number of copulas to be replaced is determined by the length of the family
vector, which should be
a vector of character strings representing copula names. The default value is NULL
meaning no substitutions.
If family
has length one, the same copula name is repeated for all substitutions.
The substituted families can be Gauss, Gumbel, Clayton, Joe, Frank, t and BB1 copulas as implemented by the
bicop_dist
in the rvinecopulib
package.
For the substituted copulas (other than Gauss, t and Frank) the user should specify the rotation that should be used for
positive dependencies (0 or 180) and the rotation that should be used for negative dependencies (90 or 270). These are
specified by the arguments posrot
and negrot
respectively, which have default values 0 and 90.
These vectors should be the same length as family
or length one, in which case the values are repeated.
In practice, the sequence of copulas will be truncated at the last copula for which the kpacf exceeds tautol
.
The maxlag
parameter is typically used to force the truncation to take place at a lower lag (to increase speed).
This can also be achieved by increasing the value of tautol
.
If one or more of the substituted copulas are t or BB1 copulas the argument auxpar
should be used to
specify the additional parameters. These are the degree-of-freedom parameter for t and the delta parameter for BB1;
the former must be greater or equal 2 and the latter greater or equal 1.
An object of class sdvinecopula.
sdvinecopula(pars = list(ar = 0.95, ma = 0.85), kpacf = "kpacf_arma", family = c("Gumbel", "clayton"), posrot = c(0, 180), negrot = c(90, 270), tautol = 1e-04)
sdvinecopula(pars = list(ar = 0.95, ma = 0.85), kpacf = "kpacf_arma", family = c("Gumbel", "clayton"), posrot = c(0, 180), negrot = c(90, 270), tautol = 1e-04)
Class of objects for stationary d-vine copula processes. See sdvinecopula for more details.
## S4 method for signature 'sdvinecopula' coef(object) ## S4 method for signature 'sdvinecopula' kendall(object, lagmax = 20) ## S4 method for signature 'sdvinecopula' show(object) ## S4 method for signature 'sdvinecopula' sim(object, n = 1000) ## S4 method for signature 'sdvinecopula' predict(object, data, x, type = "df")
## S4 method for signature 'sdvinecopula' coef(object) ## S4 method for signature 'sdvinecopula' kendall(object, lagmax = 20) ## S4 method for signature 'sdvinecopula' show(object) ## S4 method for signature 'sdvinecopula' sim(object, n = 1000) ## S4 method for signature 'sdvinecopula' predict(object, data, x, type = "df")
object |
an object of the class. |
lagmax |
maximum value of lag to be considered. |
n |
length of realization. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
coef(sdvinecopula)
: Coef Method for sdvinecopula class
kendall(sdvinecopula)
: Calculate Kendall's tau values for pair copulas in type 3 d-vine copula
show(sdvinecopula)
: Show method for sdvinecopula class
sim(sdvinecopula)
: Simulation method for sdvinecopula class
predict(sdvinecopula)
: Prediction method for sdvinecopula class
name
name of the stationary d-vine copula process.
modelspec
list containing the family, rotation, and name of KPACF
pars
list comprising of the parameters.
Uses the function tacvfARMA
in the ltsa library.
sigmastarma(x)
sigmastarma(x)
x |
an object of class armacopula. |
The standard deviation of the standardized ARMA innovation distribution.
sigmastarma(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)))
sigmastarma(armacopula(list(ar = c(0.5, 0.4), ma = -0.8)))
Methods are available for objects of class swncopula, armacopula, dvinecopula, dvinecopula2, margin and tscm.
sim(object, ...)
sim(object, ...)
object |
an object of the model class. |
... |
further arguments to be passed to the simulation. |
A simulated realization from the time series model.
Skew Laplace distribution
dslaplace(x, mu = 0.05, scale = 1, gamma = 1, log = FALSE) pslaplace(q, mu = 0.05, scale = 1, gamma = 1) qslaplace(p, mu = 0.05, scale = 1, gamma = 1) rslaplace(n, mu = 0.05, scale = 1, gamma = 1)
dslaplace(x, mu = 0.05, scale = 1, gamma = 1, log = FALSE) pslaplace(q, mu = 0.05, scale = 1, gamma = 1) qslaplace(p, mu = 0.05, scale = 1, gamma = 1) rslaplace(n, mu = 0.05, scale = 1, gamma = 1)
x |
vector of values. |
mu |
location parameter. |
scale |
scale parameter. |
gamma |
skewness parameter. |
log |
flag for log density. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Skew Student t distribution
psst(q, df = 10, gamma = 1, mu = 0, sigma = 1) qsst(p, df, gamma, mu, sigma) dsst(x, df, gamma, mu, sigma, log = FALSE) rsst(n, df, gamma, mu, sigma)
psst(q, df = 10, gamma = 1, mu = 0, sigma = 1) qsst(p, df, gamma, mu, sigma) dsst(x, df, gamma, mu, sigma, log = FALSE) rsst(n, df, gamma, mu, sigma)
q |
vector of quantiles. |
df |
degrees of freedom. |
gamma |
skewness parameter. |
mu |
location parameter. |
sigma |
scale parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Student t distribution
pst(q, df = 10, mu = 0, sigma = 1) qst(p, df, mu, sigma) dst(x, df, mu, sigma, log = FALSE) rst(n, df, mu, sigma)
pst(q, df = 10, mu = 0, sigma = 1) qst(p, df, mu, sigma) dst(x, df, mu, sigma, log = FALSE) rst(n, df, mu, sigma)
q |
vector of quantiles. |
df |
degrees of freedom. |
mu |
location parameter. |
sigma |
scale parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Centred Student t distribution
pst0(q, df = 10, sigma = 1) qst0(p, df, sigma) dst0(x, df, sigma, log = FALSE) rst0(n, df, sigma)
pst0(q, df = 10, sigma = 1) qst0(p, df, sigma) dst0(x, df, sigma, log = FALSE) rst0(n, df, sigma)
q |
vector of quantiles. |
df |
degrees of freedom. |
sigma |
scale parameter. |
p |
vector of probabilities. |
x |
vector of values. |
log |
flag for log density. |
n |
number of observations. |
A vector of density, distribution function, quantile or random values.
Stochastic inverse of a v-transform
stochinverse(x, v, tscopula = NULL, tol = .Machine$double.eps^0.75)
stochinverse(x, v, tscopula = NULL, tol = .Machine$double.eps^0.75)
x |
an object of class Vtransform. |
v |
a vector, matrix or time series with values in [0, 1]. |
tscopula |
a time series copula object. |
tol |
the desired accuracy (convergence tolerance) that is passed to
|
A vector, matrix or time series with values in [0, 1].
stochinverse(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
stochinverse(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
Calculate standardized ranks of data
strank(x)
strank(x)
x |
a vector or time series of data. |
A vector or time series of standardized ranks in the interval (0,1)
strank(rnorm(100))
strank(rnorm(100))
Constructor function for strict white noise copula process
swncopula()
swncopula()
Object of class swncopula.
swncopula()
swncopula()
Strict white noise copula process
## S4 method for signature 'swncopula' sim(object, n = 1000) ## S4 method for signature 'swncopula' coef(object) ## S4 method for signature 'swncopula' show(object)
## S4 method for signature 'swncopula' sim(object, n = 1000) ## S4 method for signature 'swncopula' coef(object) ## S4 method for signature 'swncopula' show(object)
object |
an object of class swncopula. |
n |
numeric value for length of simulated realisation. |
sim(swncopula)
: Simulation method for strict white noise copula
coef(swncopula)
: Coef method for strict white noise copula
show(swncopula)
: Show method for strict white noise copula
sim(swncopula())
sim(swncopula())
Constructor function for time series
tscm(tscopula, margin = new("margin", name = "unif"))
tscm(tscopula, margin = new("margin", name = "unif"))
tscopula |
an object of class tscopula. |
margin |
an object of class margin. |
An object of class tscm.
tscm(dvinecopula(family = "gauss", pars = 0.5), margin("doubleweibull"))
tscm(dvinecopula(family = "gauss", pars = 0.5), margin("doubleweibull"))
Class of objects for composite time series models consisting of stationary copula processes and marginal distributions.
## S4 method for signature 'tscm' show(object) ## S4 method for signature 'tscm' coef(object) ## S4 method for signature 'tscm' sim(object, n = 1000) ## S4 method for signature 'tscm' predict(object, data, x, type = "df", qtype = 7, proper = FALSE) ## S4 method for signature 'tscm' kendall(object, lagmax = 20)
## S4 method for signature 'tscm' show(object) ## S4 method for signature 'tscm' coef(object) ## S4 method for signature 'tscm' sim(object, n = 1000) ## S4 method for signature 'tscm' predict(object, data, x, type = "df", qtype = 7, proper = FALSE) ## S4 method for signature 'tscm' kendall(object, lagmax = 20)
object |
an object of the class. |
n |
length of realization. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
qtype |
type of empirical quantile estimate. |
proper |
logical variable stating whether the standard empirical distribution function should be used when the margin is empirical; otherwise an improper distribution that is bounded away from 0 and 1 is used. |
lagmax |
maximum value of lag. |
show(tscm)
: Show method for tscm class
coef(tscm)
: Coefficient method for tscm class
sim(tscm)
: Simulation method for tscm class
predict(tscm)
: Prediction method for tscm class
kendall(tscm)
: Calculate Kendall's tau values for pair copulas for tscm class
mod <- tscm(dvinecopula(family = "gauss", pars = 0.5), margin("doubleweibull")) sim(mod)
mod <- tscm(dvinecopula(family = "gauss", pars = 0.5), margin("doubleweibull")) sim(mod)
Class of objects for fitted tscm models.
## S4 method for signature 'tscmfit' logLik(object) ## S4 method for signature 'tscmfit' resid(object, trace = FALSE) ## S4 method for signature 'tscmfit' predict(object, x, type = "df", qtype = 7, proper = FALSE)
## S4 method for signature 'tscmfit' logLik(object) ## S4 method for signature 'tscmfit' resid(object, trace = FALSE) ## S4 method for signature 'tscmfit' predict(object, x, type = "df", qtype = 7, proper = FALSE)
object |
an object of the class. |
trace |
extract trace instead of residuals. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
qtype |
type of empirical quantile estimate. |
proper |
logical variable stating whether the standard empirical distribution function should be used when the margin is empirical; otherwise an improper distribution that is bounded away from 0 and 1 is used. |
logLik(tscmfit)
: method for tscmfit class
resid(tscmfit)
: Residual method for tscmfit class
predict(tscmfit)
: Prediction method for tscmfit class
tscopula
an object of class tscopula.
margin
an object of class margin.
data
a vector or time series of data to which process has been fitted.
fit
a list containing details of the fit.
Class of objects for fitted time series copula processes.
## S4 method for signature 'tscopulafit' sim(object, n = 1000) ## S4 method for signature 'tscopulafit' kendall(object, lagmax = 20) ## S4 method for signature 'tscopulafit' coef(object) ## S4 method for signature 'tscopulafit' show(object) ## S4 method for signature 'tscopulafit' logLik(object) ## S4 method for signature 'tscopulafit' resid(object, trace = FALSE) ## S4 method for signature 'tscopulafit' predict(object, x, type = "df")
## S4 method for signature 'tscopulafit' sim(object, n = 1000) ## S4 method for signature 'tscopulafit' kendall(object, lagmax = 20) ## S4 method for signature 'tscopulafit' coef(object) ## S4 method for signature 'tscopulafit' show(object) ## S4 method for signature 'tscopulafit' logLik(object) ## S4 method for signature 'tscopulafit' resid(object, trace = FALSE) ## S4 method for signature 'tscopulafit' predict(object, x, type = "df")
object |
an object of class tscopulafit. |
n |
length of realization. |
lagmax |
maximum value of lag. |
trace |
extract trace instead of residuals. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
sim(tscopulafit)
: Simulation method for tscopulafit class
kendall(tscopulafit)
: Calculate Kendall's tau values for pair copulas for tscopulafit class
coef(tscopulafit)
: Coef method for tscopulafit class
show(tscopulafit)
: Show method for tscopulafit objects
logLik(tscopulafit)
: logLik method for tscopulafit class
resid(tscopulafit)
: Residual method for tscopulafit class
predict(tscopulafit)
: Prediction method for tscopulafit class
tscopula
an object of class tscopula.
data
a vector or time series of data.
fit
a list containing details of the fit.
ar1 <- armacopula(list(ar = 0.7)) data <- sim(ar1, 1000) ar1fit <- fit(ar1, data) sim(ar1fit)
ar1 <- armacopula(list(ar = 0.7)) data <- sim(ar1, 1000) ar1fit <- fit(ar1, data) sim(ar1fit)
S4 Class union for basic time series copula types. These are armacopula, dvinecopula and dvinecopula2,
Constructor function for 2-parameter beta v-transform
V2b(delta = 0.5, kappa = 1)
V2b(delta = 0.5, kappa = 1)
delta |
a value in (0, 1) specifying the fulcrum of the v-transform. |
kappa |
additional positive parameter of v-transform. |
An object of class Vtransform.
V2b(delta = 0.45, kappa = 1.2)
V2b(delta = 0.45, kappa = 1.2)
Constructor function for 2-parameter v-transform
V2p(delta = 0.5, kappa = 1)
V2p(delta = 0.5, kappa = 1)
delta |
a value in (0, 1) specifying the fulcrum of the v-transform. |
kappa |
additional positive parameter of v-transform. |
An object of class Vtransform.
V2p(delta = 0.45, kappa = 1.2)
V2p(delta = 0.45, kappa = 1.2)
Constructor function for 3-parameter beta v-transform
V3b(delta = 0.5, kappa = 1, xi = 1)
V3b(delta = 0.5, kappa = 1, xi = 1)
delta |
a value in (0, 1) specifying the fulcrum of the v-transform. |
kappa |
additional positive parameter of v-transform. |
xi |
additional positive parameter of v-transform. |
An object of class Vtransform.
V3b(delta = 0.45, kappa = 1.2, xi = 1.2)
V3b(delta = 0.45, kappa = 1.2, xi = 1.2)
Constructor function for 3-parameter v-transform
V3p(delta = 0.5, kappa = 1, xi = 1)
V3p(delta = 0.5, kappa = 1, xi = 1)
delta |
a value in (0, 1) specifying the fulcrum of the v-transform. |
kappa |
additional positive parameter of v-transform. |
xi |
additional positive parameter of v-transform. |
An object of class Vtransform.
V3p(delta = 0.45, kappa = 0.8, xi = 1.1)
V3p(delta = 0.45, kappa = 0.8, xi = 1.1)
Constructor function for degenerate v-transform
Vdegenerate()
Vdegenerate()
An object of class VtransformI.
Vdegenerate()
Vdegenerate()
Calculate conditional down probability of v-transform
vdownprob(x, v)
vdownprob(x, v)
x |
an object of class Vtransform. |
v |
a vector or time series with values in [0, 1]. |
A vector or time series of values of gradient.
vdownprob(V2p(delta = 0.55, kapp = 1.2), c(0, 0.25, 0.5, 0.75, 1))
vdownprob(V2p(delta = 0.55, kapp = 1.2), c(0, 0.25, 0.5, 0.75, 1))
Calculate gradient of v-transform
vgradient(x, u)
vgradient(x, u)
x |
an object of class Vtransform. |
u |
a vector or time series with values in [0, 1]. |
A vector or time series of values of gradient.
vgradient(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
vgradient(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
If the Vtransform object is also a VtransformI object (an
invertible v-transform) then the analytical inverse is used. Otherwise
an inverse is found by numerical root finding with uniroot
.
vinverse(x, v, tol = .Machine$double.eps^0.75)
vinverse(x, v, tol = .Machine$double.eps^0.75)
x |
an object ofc lass Vtransform. |
v |
a vector or time series with values in [0, 1]. |
tol |
the desired accuracy (convergence tolerance) that is passed to
|
A vector or time series with values in [0, 1].
vinverse(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
vinverse(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
Constructor function for linear v-transform
Vlinear(delta = 0.5)
Vlinear(delta = 0.5)
delta |
a value in (0, 1) specifying the fulcrum of the v-transform. |
An object of class VtransformI.
Vlinear(delta = 0.45)
Vlinear(delta = 0.45)
Constructor function for symmetric v-transform
Vsymmetric()
Vsymmetric()
An object of class VtransformI.
Vsymmetric()
Vsymmetric()
Evaluate a v-transform
vtrans(x, u)
vtrans(x, u)
x |
an object of class Vtransform. |
u |
a vector or time series with values in [0, 1]. |
A vector or time series with values in [0, 1].
vtrans(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
vtrans(Vsymmetric(), c(0, 0.25, 0.5, 0.75, 1))
This is the class of v-transforms. It contains the VtransformI subclass consisting of v-transforms with an analytical expression for the inverse.
## S4 method for signature 'Vtransform' show(object) ## S4 method for signature 'Vtransform' coef(object)
## S4 method for signature 'Vtransform' show(object) ## S4 method for signature 'Vtransform' coef(object)
object |
an object of the class. |
show(Vtransform)
: Show method for Vtransform class
coef(Vtransform)
: Coef method for Vtransform class
name
a name for the v-transform of class character.
Vtrans
function to evaluate the v-transform.
pars
vector containing the named parameters of the v-transform.
gradient
function to evaluate the gradient of the v-transform.
V2p(delta = 0.5, kappa = 1.2)
V2p(delta = 0.5, kappa = 1.2)
This class inherits from the Vtransform class and contains v-transforms with an analytical expression for the inverse.
name
a name for the v-transform of class character.
Vtrans
function to evaluate the v-transform.
pars
vector containing the named parameters of the v-transform.
gradient
function to evaluate the gradient of the v-transform.
inverse
function to evaluate the inverse of the v-transform.
Vlinear(delta = 0.55)
Vlinear(delta = 0.55)
Constructor function for vtscopula object
vtscopula(tscopulaU, Vtransform = Vlinear(), Wcopula = swncopula())
vtscopula(tscopulaU, Vtransform = Vlinear(), Wcopula = swncopula())
tscopulaU |
an object of class armacopula, dvinecopula or dvinecopula2. |
Vtransform |
an object of class Vtransform. |
Wcopula |
an object of class tscopula. |
An object of class vtscopula.
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) vtscopula(copobject, Vtransform = V2p())
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) vtscopula(copobject, Vtransform = V2p())
Class of objects for v-transformed time series copula processes.
## S4 method for signature 'vtscopula' show(object) ## S4 method for signature 'vtscopula' coef(object) ## S4 method for signature 'vtscopula' predict(object, data, x, type = "df") ## S4 method for signature 'vtscopula' sim(object, n = 1000) ## S4 method for signature 'vtscopula' kendall(object, lagmax = 20)
## S4 method for signature 'vtscopula' show(object) ## S4 method for signature 'vtscopula' coef(object) ## S4 method for signature 'vtscopula' predict(object, data, x, type = "df") ## S4 method for signature 'vtscopula' sim(object, n = 1000) ## S4 method for signature 'vtscopula' kendall(object, lagmax = 20)
object |
an object of the class. |
data |
vector of past data values. |
x |
vector of arguments of prediction function. |
type |
type of prediction function ("df" for density, "qf" for quantile function or "dens" for density). |
n |
length of realization. |
lagmax |
maximum value of lag. |
show(vtscopula)
: Show method for vtscopula objects
coef(vtscopula)
: Coef method for vtscopula class
predict(vtscopula)
: Prediction method for vtscopula class
sim(vtscopula)
: Simulation method for vtscopula class
kendall(vtscopula)
: Calculate Kendall's tau values for vtscopula model
Vcopula
object of class tscopulaU.
Vtransform
object of class Vtransform.
Wcopula
object of class tscopula.
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) sim(vtscopula(copobject, Vtransform = V2p())) mod <- vtscopula(armacopula(list(ar = 0.95, ma = -0.85))) kendall(mod)
copobject <- armacopula(pars = list(ar = 0.6, ma = 0.2)) sim(vtscopula(copobject, Vtransform = V2p())) mod <- vtscopula(armacopula(list(ar = 0.95, ma = -0.85))) kendall(mod)