Stores bivariate data for pair copula construction.
More...
|
def | __init__ (self, x, y, weights=None, kwargs) |
| Bivariate data set init. More...
|
|
def | rank (self, method=0) |
| rank transfom the data More...
|
|
def | rankInv (self) |
| Inverse rank transform data back to original scale.
|
|
def | setTrialCopula (self, family) |
|
def | empKTau (self) |
| Returns emperical kendall's tau of rank transformed data. More...
|
|
def | empSRho (self) |
| Returns emperical spearman rho, the rank correlation coefficient. More...
|
|
def | empPRho (self) |
| Returns linear correlation coefficient, pearson's rho. More...
|
|
def | copulaTournament (self, criterion='AIC', kwargs) |
| Determines the copula that best fits the rank transformed data based on the AIC criterion. More...
|
|
def | fitCopula (self, copula, thetaGuess=(None, None,)) |
| fit specified copula to data. More...
|
|
def | rotateData (self, u, v, rotation=-1) |
| Rotates the ranked data on the unit square. More...
|
|
def | setRotation (self, rotation=0) |
| Set the copula's orientation: 0 == 0 deg 1 == 90 deg rotation 2 == 180 deg rotation 3 == 270 deg rotation Allows for modeling negative dependence with the frank, gumbel, and clayton copulas (Archimedean Copula family is non-symmetric)
|
|
|
| copulaParams |
|
| id |
|
| x |
|
| y |
|
| v |
|
| weights |
|
| rankMethod |
|
| u |
|
| trialFamily |
|
| copulaBank |
|
| pval_ |
|
| copulaModel |
|
| UU |
|
| VV |
|
| rotation |
|
Stores bivariate data for pair copula construction.
Contains methods to:
- rank data transform
- rotate data
- remove nan or inf data points
- plot bivarate data
- fit copula to bivariate (ranked) data
- compute basic bivariate statistics (eg. kendall's tau)
Note: Depends on pandas for some useful statistical and plotting functionality.
§ __init__()
def starvine.bvcopula.pc_base.PairCopula.__init__ |
( |
|
self, |
|
|
|
x, |
|
|
|
y, |
|
|
|
weights = None , |
|
|
|
kwargs |
|
) |
| |
Bivariate data set init.
- Parameters
-
x | np_1darray first marginal data set |
y | np_1darray second marginal data set |
weights | np_1darray (optional) data weights normalized or unormalized weights accepted Note: len(u) == len(v) == len(weights) |
§ copulaTournament()
def starvine.bvcopula.pc_base.PairCopula.copulaTournament |
( |
|
self, |
|
|
|
criterion = 'AIC' , |
|
|
|
kwargs |
|
) |
| |
Determines the copula that best fits the rank transformed data based on the AIC criterion.
All Copula in self.trialFamily set are considered.
§ empKTau()
def starvine.bvcopula.pc_base.PairCopula.empKTau |
( |
|
self | ) |
|
Returns emperical kendall's tau of rank transformed data.
- Returns
- float Kendall's tau rank correlation coeff
§ empPRho()
def starvine.bvcopula.pc_base.PairCopula.empPRho |
( |
|
self | ) |
|
Returns linear correlation coefficient, pearson's rho.
- Returns
- float pearson's correlation coefficient
§ empSRho()
def starvine.bvcopula.pc_base.PairCopula.empSRho |
( |
|
self | ) |
|
Returns emperical spearman rho, the rank correlation coefficient.
- Returns
- float Spearman's rank correlation coeff
§ fitCopula()
def starvine.bvcopula.pc_base.PairCopula.fitCopula |
( |
|
self, |
|
|
|
copula, |
|
|
|
thetaGuess = (None, None, ) |
|
) |
| |
fit specified copula to data.
- Parameters
-
copula | CopulaBase Copula instance |
thetaGuess | tuple (optional) initial guess for copula params |
- Returns
- (copula type string, fitted copula params np_array)
§ rank()
def starvine.bvcopula.pc_base.PairCopula.rank |
( |
|
self, |
|
|
|
method = 0 |
|
) |
| |
rank transfom the data
- Parameters
-
method | int if == 0: use standard rank transform, else: use CDF data transform. |
§ rotateData()
def starvine.bvcopula.pc_base.PairCopula.rotateData |
( |
|
self, |
|
|
|
u, |
|
|
|
v, |
|
|
|
rotation = -1 |
|
) |
| |
Rotates the ranked data on the unit square.
- Parameters
-
u | Ranked data vector |
v | Ranked data vector |
rotation | int 1==90deg, 2==180deg, 3==270, 0==0deg |
The documentation for this class was generated from the following file:
- starvine/bvcopula/pc_base.py