Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: extras for copulas, notes #7258

Open
josef-pkt opened this issue Jan 15, 2021 · 7 comments
Open

ENH: extras for copulas, notes #7258

josef-pkt opened this issue Jan 15, 2021 · 7 comments

Comments

@josef-pkt
Copy link
Member

josef-pkt commented Jan 15, 2021

see also #4046

random notes because results are all over the literature, and it's often difficult to find a specific item

Savu, Cornelia and Trede, Mark(2008) 'Goodness-of-fit tests for parametric families of Archimedean
copulas', Quantitative Finance, 8: 2, 109 — 116
http://dx.doi.org/10.1080/14697680701207639

@josef-pkt
Copy link
Member Author

josef-pkt commented Jan 15, 2021

List of copulas

package evd extreme value copulas and distributions

evd has "log", "alog", "hr", "neglog", "aneglog", "bilog", "negbilog", "ct", "amix"
"log"istic is gumbel, symmetric version of alog
"neglog" is galambos, symmetric version of aneglog

we are missing "negbilog" and "ct", AFAICS
we have t-ev which evd doesn't have

package copula

basic copulas, not nested nor vines

EV copulas

evCopula(family, param, dim = 2, ...)

galambosCopula(param)
huslerReissCopula(param)
tawnCopula(param)
tevCopula(param, df = 4, df.fixed = FALSE)

AFAICS, restricted to one parameter, symmetric, bivariate copulas

Archimedean

"clayton", "frank", "amh", "gumbel", and "joe".

archmCopula(family, param = NA_real_, dim = 2, ...)

claytonCopula(param = NA_real_, dim = 2, use.indepC = c("message", "TRUE", "FALSE"))
frankCopula(param = NA_real_, dim = 2, use.indepC = c("message", "TRUE", "FALSE"))
gumbelCopula(param = NA_real_, dim = 2, use.indepC = c("message", "TRUE", "FALSE"))
amhCopula(param = NA_real_, dim = 2, use.indepC = c("message", "TRUE", "FALSE"))
joeCopula(param = NA_real_, dim = 2, use.indepC = c("message", "TRUE", "FALSE"))

elliptical

ellipCopula (family, param, dim = 2, dispstr = "ex", df = 4, ...)

normalCopula(param, dim = 2, dispstr = "ex")
tCopula(param, dim = 2, dispstr = "ex", df = 4, df.fixed = FALSE, df.min = 0.01)

other

indepCopula(dim = 2)
plackettCopula(param)
fgmCopula(param, dim = 2)
moCopula(param = NA_real_, dim = 2L) Marshall-Olkin

Fréchet-Hoeffding Bound Copula Objects

fhCopula(family = c("upper", "lower"), dim = 2L)
lowfhCopula(dim = 2L)
upfhCopula(dim = 2L)

They also have an empirical copula class that looks interesting

empCopula(X, smoothing = c("none", "beta", "checkerboard"), offset = 0,
ties.method = c("max", "average", "first", "last", "random", "min"))

They also have some copula constructors based on other copulas, e.g. mixture of copulas.

@josef-pkt
Copy link
Member Author

josef-pkt commented Jan 20, 2021

aside for univariate marginal EV distributions:
scipy genextreme and evd package gev use opposite sign for power parameter c = -s
scipy weibull_max and evd negative weibull use the same sign
scipy gumbel_r is the same as evd's gumbel

@josef-pkt
Copy link
Member Author

other things that would be nice to have for multivariate distribution

Conditional pdf, cdf and/or ppf are needed for some methods for simulations and for gof testing, and maybe later for conditional regression.
Rosenblattt transform makes transformed variables independent by successive conditioning.

old code and idea
sandbox distributions mv_normal contains my start on MV elliptical distributions, class for normal distribution includes method to get the conditional distribution, but it's specific to normal distribution.

For some copulas, we have explicit formulas for conditional distribution.

(Having general elliptical, distribution helper functions and classes would be nice for many applications,
e.g. I ran into them for generating new nonlinear transformation distribution families.
Several methods for robust cov estimation are based on elliptical distributions.
Random sampling for elliptical distributions would be available if we have a collection of which distribution is used as scale mixing distribution, like chi2-normal scale mixture for t.
)

@josef-pkt
Copy link
Member Author

gof tests

for EV copulas we can estimate the Pickand's dependence function from data.
Several algorithms are available. I don't remember seeing hypothesis test versions and pvalues for it, but I didn't look closely or widely enough or I didn't look at those sections.
one example using splines and quantile regression, includes an A-plot to plot data scatter and related Pickands dependence function.
Cormier, Eric, Christian Genest, and Johanna G. Nešlehová. "Using B-splines for nonparametric inference on bivariate extreme-value copulas." Extremes 17, no. 4 (2014): 633-659.

gof tests in general require simulated pvalues (they call it bootstrap but it uses parametrically simulated values), is pretty slow
several articles by Genest and coauthors. e.g. larger simulation study with 7 methods:
Genest, Christian, Bruno Rémillard, and David Beaudoin. "Goodness-of-fit tests for copulas: A review and a power study." Insurance: Mathematics and economics 44, no. 2 (2009): 199-213.
some methods for some copulas are expensive because we need a "double bootstrap", the second set of simulation is for computing statistics that don't have a closed form expression, e.g. using MonteCarlo integration. (*)

A faster approximate version for simulating p-values is to simulate using an asymptotic approximation. e.g.
Kojadinovic, Ivan, and Jun Yan. "A goodness-of-fit test for multivariate multiparameter copulas based on multiplier central limit theorems." Statistics and Computing 21, no. 1 (2011): 17-30.

(*) aside
I have seen an abstract of an article that talks about quasi-random numbers, something like Monte Carlo integration based on Halton sequences. I didn't look at it and I didn't keep the reference.

@josef-pkt
Copy link
Member Author

https://cran.r-project.org/web/packages/SimCop/SimCop.pdf
has multivariate asymmetric ev copulas,
e.g. NewMEVAsyLogisticCopula cdf looks (kind of) easy. For density, pdf they only mention that they are using automatic differentiation.

@josef-pkt
Copy link
Member Author

aside: IEEE shows latex expression for formulas
e.g. https://ieeexplore.ieee.org/abstract/document/9299492

@josef-pkt
Copy link
Member Author

josef-pkt commented Jan 30, 2023

sampling from archimedean
Joe 2014 p. 272, 273
rosenblatt transform p. 270

conditional cdfs of copulas nd multivariate distributions (general case) p. 29
conditional copula for archimedean subset of x given values of complementary subset p. 92 equ (3.8)
(conditional copula of archimedean is also archimedean with different implied generator)

for generator phi phi(0)=inf, phi(1) = 0 (greek xi in Joe) p. 91 below equ. (3.5)
i.e. marginal copula of archimedean, remainders disappear in sum of phi.

multivariate survival function, survival copula prob(X1 > x1, ..., Xd > xd) p.27 bottom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant