StarVine
starvine.vine.C_vine.Ctree Class Reference

A C-tree is a tree with a single root node. More...

Inheritance diagram for starvine.vine.C_vine.Ctree:
starvine.vine.tree.Vtree

Public Member Functions

def __init__ (self, data, lvl=None, kwargs)
 A single tree within vine. More...
 
def seqCopulaFit (self)
 Iterate through all edges in tree, fit copula models at each edge. More...
 
def treeNLLH (self, treeCopulaParams=None)
 Compute this tree's negative log likelyhood. More...
 
def evalH (self)
 Define nodes of the T+1 level tree. More...
 
- Public Member Functions inherited from starvine.vine.tree.Vtree
def __init__ (self, data, lvl, parentTree=None, kwargs)
 A generic tree within vine. More...
 
def addNode (self, dataLabel, data)
 Add a node to the tree. More...
 
def buildNodes (self)
 Assign each data column to a networkx node.
 
def setEdges (self, nodePairs=None)
 Sets the node to node connections in the tree. More...
 
def lowerTree (self, lowerTree=None)
 Gets lower tree. More...
 
def lowerTree (self, lTree)
 Sets lower tree.
 
def upperTree (self, upperTree=None)
 Gets upper tree. More...
 
def upperTree (self, uTree)
 Sets upper tree.
 

Public Attributes

 rootNodeID
 VV is OK UU is wrong!
 
 treeCopulaParams
 
- Public Attributes inherited from starvine.vine.tree.Vtree
 data
 
 nT
 
 level
 
 tree
 

Private Member Functions

def _optimNodePairs (self)
 Selects the node-pairings which maximizes the sum over all edge weights provided the constraint of a C-tree stucture. More...
 
def _evalH (self)
 Computes $ F(x|v, \theta) $ data set at each node for use in the next level tree. More...
 
def _getEdgeCopulaParams (self, u, v)
 Get copula paramters of particular edge in tree. More...
 
def _initTreeParamMap (self)
 Pack all copula paramters in the tree into a 1d numpy array for simulatneous MLE optimization. More...
 

Detailed Description

A C-tree is a tree with a single root node.

Each level of a cononical vine is a C-tree.

Constructor & Destructor Documentation

§ __init__()

def starvine.vine.C_vine.Ctree.__init__ (   self,
  data,
  lvl = None,
  kwargs 
)

A single tree within vine.

Parameters
dataDataFrame multivariate data set. Each data column will be assigned to a node.
lvlint: tree level in the vine
weightsDataFrame: (optional) data weights
labelslist of str or ints: (optional) data labels

Member Function Documentation

§ _evalH()

def starvine.vine.C_vine.Ctree._evalH (   self)
private

Computes $ F(x|v, \theta) $ data set at each node for use in the next level tree.

Returns
DataFame : conditional distribution at tree edges.

§ _getEdgeCopulaParams()

def starvine.vine.C_vine.Ctree._getEdgeCopulaParams (   self,
  u,
  v 
)
private

Get copula paramters of particular edge in tree.

Returns
np_1darray Copula parameters of edge

§ _initTreeParamMap()

def starvine.vine.C_vine.Ctree._initTreeParamMap (   self)
private

Pack all copula paramters in the tree into a 1d numpy array for simulatneous MLE optimization.

Sets the tree copula paramters.

§ _optimNodePairs()

def starvine.vine.C_vine.Ctree._optimNodePairs (   self)
private

Selects the node-pairings which maximizes the sum over all edge weights provided the constraint of a C-tree stucture.

It is feasible to try all C-tree configuations since if we have nT variables in the top level tree the number of unique C-trees is == nT.

Returns
nd_array: (nT-1, 3) shape array with PCC pairs Each row is a len 3 tuple: (rootNodeID, nodeID, kTau)

§ evalH()

def starvine.vine.C_vine.Ctree.evalH (   self)

Define nodes of the T+1 level tree.

Use the conditional distribution (h()) to obtain marginal distributions at the next tree level.

§ seqCopulaFit()

def starvine.vine.C_vine.Ctree.seqCopulaFit (   self)

Iterate through all edges in tree, fit copula models at each edge.

This is a sequential fitting operation.

See simultaneousCopulaFit() for a tree-wide simulltaneous parameter estimation.

§ treeNLLH()

def starvine.vine.C_vine.Ctree.treeNLLH (   self,
  treeCopulaParams = None 
)

Compute this tree's negative log likelyhood.

For C-trees this is just the sum of copula-log-likeyhoods over all node-pairs.

Parameters
treeCopulaParamsnp_1darray Copula parameter array. Contains parameters for all PCC in the tree.
paramMapMaps edges to parameter len and location in treeCopulaParams {[u, v]: (start, Params_len_0), [u, v]: (start, Params_len), ...}

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