Example #1
0
 def __init__(self, targetVol, positionName, estimateName, scaledPos):
     """Initializer.
     
     INPUTS:
     
     -- targetVol:        Floating point target volatility.
     
     -- positionName:     String naming position field.   
     
     -- estimateName:     String naming vol estimate field.   
     
     -- scaledPos:        String naming output scaled position.
     """
     self.targetVol = targetVol
     SeqXform.__init__(self, [positionName, estimateName], [scaledPos])
Example #2
0
    def __init__(self, levelParams, dateColName, mean):
        
        levelNames = levelParams.levelNames
        
        self.levelParams = levelParams
        self.dateColName = dateColName
        self.rets = dict([(n, 0.0) for n in levelNames])
        self.vars = dict(self.levelParams.omegas)
        self.dateCol = dateColName
        self.mean = mean
        self.annualizingMults = dict(self.levelParams.multipliers)

        
        for num, name in enumerate(levelNames[1:]):
            self.annualizingMults[name] = (
                self.levelParams.multipliers[name] /
                self.levelParams.multipliers[levelNames[0]])
            self.vars[name] = (
                self.vars[levelNames[num]] * self.levelParams.omegas[name]
                * self.levelParams.multipliers[levelNames[num]]
                / self.levelParams.multipliers[name])

        SeqXform.__init__(self, [dateColName],
                          levelParams.annualizedVolNames + levelParams.retNames)
Example #3
0
    def __init__(self, levelParams, dateColName, mean):

        levelNames = levelParams.levelNames

        self.levelParams = levelParams
        self.dateColName = dateColName
        self.rets = dict([(n, 0.0) for n in levelNames])
        self.vars = dict(self.levelParams.omegas)
        self.dateCol = dateColName
        self.mean = mean
        self.annualizingMults = dict(self.levelParams.multipliers)

        for num, name in enumerate(levelNames[1:]):
            self.annualizingMults[name] = (
                self.levelParams.multipliers[name] /
                self.levelParams.multipliers[levelNames[0]])
            self.vars[name] = (self.vars[levelNames[num]] *
                               self.levelParams.omegas[name] *
                               self.levelParams.multipliers[levelNames[num]] /
                               self.levelParams.multipliers[name])

        SeqXform.__init__(
            self, [dateColName],
            levelParams.annualizedVolNames + levelParams.retNames)
Example #4
0
 def __init__(self, estimator, estName):
     self.estimator = estimator
     SeqXform.__init__(self, [estimator.returnColName], [estName])