StarVine
starvine.bvcopula.pc_base.PairCopula Class Reference

Stores bivariate data for pair copula construction. More...

Inheritance diagram for starvine.bvcopula.pc_base.PairCopula:
starvine.vine.pcc.PairCopulaConstruction

Public Member Functions

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)
 

Public Attributes

 copulaParams
 
 id
 
 x
 
 y
 
 v
 
 weights
 
 rankMethod
 
 u
 
 trialFamily
 
 copulaBank
 
 pval_
 
 copulaModel
 
 UU
 
 VV
 
 rotation
 

Detailed Description

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.

Constructor & Destructor Documentation

§ __init__()

def starvine.bvcopula.pc_base.PairCopula.__init__ (   self,
  x,
  y,
  weights = None,
  kwargs 
)

Bivariate data set init.

Parameters
xnp_1darray first marginal data set
ynp_1darray second marginal data set
weightsnp_1darray (optional) data weights normalized or unormalized weights accepted Note: len(u) == len(v) == len(weights)

Member Function Documentation

§ 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
copulaCopulaBase Copula instance
thetaGuesstuple (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
methodint 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
uRanked data vector
vRanked data vector
rotationint 1==90deg, 2==180deg, 3==270, 0==0deg

The documentation for this class was generated from the following file: