vineknockoffs.vine_copulas.DVineCopula#
- class vineknockoffs.vine_copulas.DVineCopula(copulas)#
Methods
compute_pits
(u)Compute probability integral transforms (PITs) from a simplified D-vine copula.
compute_pits_d_par
(which_tree, which_cop, u)Compute probability integral transforms (PITs) and their derivative with respect to a parameter \(\theta_{k,l}\).
compute_pits_par_jacobian_fast
(u[, return_w])cop_select
(u[, families, rotations, indep_test])get_par_vec
([from_tree])get_par_vec_w_info
([from_tree])ll
(u)set_par_vec
(par_vec[, from_tree, ...])sim
([n_obs, w])Simulate random observations from a simplified D-vine copula.
sim_d_par
(which_tree, which_cop[, n_obs, w])Simulate random observations from a simplified D-vine copula and compute the derivative with respect to a parameter \(\theta_{k,l}\).
sim_par_jacobian
([n_obs, w])sim_par_jacobian_fast
([n_obs, w, ...])Attributes
copulas
n_pars
n_vars
- DVineCopula.compute_pits(u)#
Compute probability integral transforms (PITs) from a simplified D-vine copula.
Parameters#
- u
numpy.ndarray
Array of copula observations.
Returns#
- res
numpy.ndarray
Result array.
Notes#
Implements Algorithm 1 from Kurz (2022) to compute the probability integral transforms
\[ \begin{align}\begin{aligned}W_{1:d} &:= \big( U_1, U_{2|1}, U_{3|1:2}, \ldots, U_{d|1:d-1}\big)\\&:= \big( F_1(U_1), F_{2|1}(U_2|U_1), F_{3|1:2}(U_3|U_{1:2}), \ldots, F_{d|1:d-1}(U_d|U_{1:d-1}) \big).\end{aligned}\end{align} \]References#
Kurz, M. S. (2022), Vine copula based knockoff generation for high-dimensional controlled variable selection. arXiv:2210.11196 [stat.ME].
- u
- DVineCopula.compute_pits_d_par(which_tree, which_cop, u, return_w=False)#
Compute probability integral transforms (PITs) and their derivative with respect to a parameter \(\theta_{k,l}\).
Parameters#
- which_treeint
Determines \(\theta_{k,l}\) (copula in which tree?)
- which_copint
Determines \(\theta_{k,l}\) (which copula within the tree?)
- u
numpy.ndarray
Array of copula observations.
- return_wboolean
Whether the PITs should also be returned (in addition to the derivatives).
Returns#
- res
numpy.ndarray
Result array(s).
Notes#
Implements Algorithm 5 from Kurz (2022) to compute the probability integral transforms and their derivative with respect to a parameter \(\theta_{k,l}\)
\[ \begin{align}\begin{aligned}W_{1:d} &:= \big( U_1, U_{2|1}, U_{3|1:2}, \ldots, U_{d|1:d-1}\big),\\\check{W}_{1:d} &:= \big( \partial_{\theta_{k,l}} U_{1}, \partial_{\theta_{k,l}} U_{2|1}, \partial_{\theta_{k,l}} U_{3|1:2}, \ldots, \partial_{\theta_{k,l}} U_{d|1:d-1} \big)\end{aligned}\end{align} \]References#
Kurz, M. S. (2022), Vine copula based knockoff generation for high-dimensional controlled variable selection. arXiv:2210.11196 [stat.ME].
- DVineCopula.compute_pits_par_jacobian(u)#
- DVineCopula.compute_pits_par_jacobian_fast(u, return_w=False)#
- classmethod DVineCopula.cop_select(u, families='all', rotations=True, indep_test=True)#
- DVineCopula.get_par_vec(from_tree=1)#
- DVineCopula.get_par_vec_w_info(from_tree=1)#
- DVineCopula.ll(u)#
- DVineCopula.set_par_vec(par_vec, from_tree=1, assert_to_bounds=False)#
- DVineCopula.sim(n_obs=100, w=None)#
Simulate random observations from a simplified D-vine copula.
Parameters#
- n_obs :
The number of observations to simulate. Default is 100.
- wNone or
numpy.ndarray
Array of iid standard uniform observations. If None, iid standard uniform observations are drawn. Default is None.
Returns#
- res
numpy.ndarray
Result array.
Notes#
Implements Algorithm 2 from Kurz (2022) to simulate from a simplified D-vine copula based on standard uniform random variables.
References#
Kurz, M. S. (2022), Vine copula based knockoff generation for high-dimensional controlled variable selection. arXiv:2210.11196 [stat.ME].
- DVineCopula.sim_d_par(which_tree, which_cop, n_obs=100, w=None)#
Simulate random observations from a simplified D-vine copula and compute the derivative with respect to a parameter \(\theta_{k,l}\).
Parameters#
- which_treeint
Determines \(\theta_{k,l}\) (copula in which tree?)
- which_copint
Determines \(\theta_{k,l}\) (which copula within the tree?)
- n_obs :
The number of observations to simulate. Default is 100.
- wNone or
numpy.ndarray
Array of iid standard uniform observations. If None, iid standard uniform observations are drawn. Default is None.
Returns#
- res
numpy.ndarray
Result array(s).
Notes#
Implements Algorithm 6 from Kurz (2022) to simulate from a simplified D-vine copula and compute the derivative with respect to a parameter \(\theta_{k,l}\).
\[ \begin{align}\begin{aligned}U_{1:d} &\sim C_{1:d},\\\check{U}_{1:d} &:= \big(\partial_{\theta_{k,l}}U_1, \ldots, \partial_{\theta_{k,l}}U_d)\end{aligned}\end{align} \]References#
Kurz, M. S. (2022), Vine copula based knockoff generation for high-dimensional controlled variable selection. arXiv:2210.11196 [stat.ME].
- DVineCopula.sim_par_jacobian(n_obs=100, w=None)#
- DVineCopula.sim_par_jacobian_fast(n_obs=100, w=None, w_jacobian=None, from_tree=1, return_u=False)#