Vinecop.__init__¶
- Vinecop.__init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pyvinecopulib.Vinecop, d: int) -> None
Instantiates a D-vine with all pair-copulas set to independence.
- Parameter
d
: The dimension (= number of variables) of the model.
__init__(self: pyvinecopulib.Vinecop, structure: pyvinecopulib.RVineStructure, pair_copulas: List[List[pyvinecopulib.Bicop]] = [], var_types: List[str] = []) -> None
Instantiates an arbitrary vine copula model.
- Parameter
structure
: An RVineStructure object specifying the vine structure.
- Parameter
pair_copulas
: Bicop objects specifying the pair-copulas, namely a nested list such that
pc_store[t][e]
contains aBicop
object for the pair copula corresponding to treet
and edgee
.- Parameter
var_types
: Strings specifying the types of the variables, e.g.,
("c", "d")
means first variable continuous, second discrete. If empty, then all variables are set as continuous.
__init__(self: pyvinecopulib.Vinecop, matrix: numpy.ndarray[numpy.uint64[m, n]], pair_copulas: List[List[pyvinecopulib.Bicop]] = [], var_types: List[str] = []) -> None
Instantiates an arbitrary vine copula model.
- Parameter
matrix
: An R-vine matrix specifying the vine structure.
- Parameter
pair_copulas
: Bicop objects specifying the pair-copulas, namely a nested list such that
pc_store[t][e]
contains aBicop
object for the pair copula corresponding to treet
and edgee
.- Parameter
var_types
: Strings specifying the types of the variables, e.g.,
("c", "d")
means first variable continuous, second discrete. If empty, then all variables are set as continuous.
4. __init__(self: pyvinecopulib.Vinecop, data: numpy.ndarray[numpy.float64[m, n]], structure: pyvinecopulib.RVineStructure = <pyvinecopulib.RVineStructure> 1 , var_types: List[str] = [], controls: pyvinecopulib.FitControlsVinecop = FitControlsVinecop()) -> None
Instantiates from data.
Equivalent to creating a default
Vinecop()
and then selecting the model usingselect()
.- Parameter
data
: An \(n \times d\) matrix of observations.
- Parameter
structure
: An RVineStructure object specifying the vine structure. If empty, then it is selected as part of the fit.
- Parameter
var_types
: Strings specifying the types of the variables, e.g.,
("c", "d")
means first variable continuous, second discrete. If empty, then all variables are set as continuous.- Parameter
controls
: See
FitControlsVinecop()
.
__init__(self: pyvinecopulib.Vinecop, data: numpy.ndarray[numpy.float64[m, n]], matrix: numpy.ndarray[numpy.uint64[m, n]] = array([], shape=(0, 0), dtype=uint64), var_types: List[str] = [], controls: pyvinecopulib.FitControlsVinecop = FitControlsVinecop()) -> None
Instantiates from data.
Equivalent to creating a default
Vinecop()
and then selecting the model usingselect()
.- Parameter
data
: An \(n \times d\) matrix of observations.
- Parameter
matrix
: Either an empty matrix (default) or an R-vine structure matrix, see
select()
. If empty, then it is selected as part of the fit.- Parameter
var_types
: Strings specifying the types of the variables, e.g.,
("c", "d")
means first variable continuous, second discrete. If empty, then all variables are set as continuous.- Parameter
controls
: See
FitControlsVinecop()
.
__init__(self: pyvinecopulib.Vinecop, filename: str, check: bool = True) -> None
Instantiates from a JSON file.
The input file contains 2 attributes :
"structure"
for the vine structure, which itself contains attributes"array"
for the structure triangular array and"order"
for the order vector, and"pair copulas"
."pair copulas"
contains a list of attributes for the trees ("tree1"
,"tree2"
, etc), each containing a list of attributes for the edges ("pc1"
,"pc2"
, etc). See the corresponding method ofBicop
objects for the encoding of pair-copulas.- Parameter
filename
: The name of the JSON file to read.
- Parameter
check
: Whether to check if the
"structure"
node of the input represents a valid R-vine structure.