Skip to content

Commit

Permalink
- Adaptive Expectation transformation [Cheng, 2008]
Browse files Browse the repository at this point in the history
  • Loading branch information
petroniocandido committed Apr 20, 2017
1 parent 55638cb commit e5c2e0d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions common/Transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ def inverse(self,data, param):
return inc


class AdaptiveExpectation(Transformation):

def __init__(self, parameters):
super(AdaptiveExpectation, self).__init__(parameters)
self.h = parameters

def apply(self, data, param=None):
return data

def inverse(self, data, param):
n = len(data)

inc = [param[t] + self.h*(data[t] - param[t]) for t in np.arange(0, n)]

if n == 1:
return inc[0]
else:
return inc


def boxcox(original, plambda):
n = len(original)
if plambda != 0:
Expand Down

0 comments on commit e5c2e0d

Please # to comment.