Skip to content

Commit e5c2e0d

Browse files
- Adaptive Expectation transformation [Cheng, 2008]
1 parent 55638cb commit e5c2e0d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

common/Transformations.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ def inverse(self,data, param):
6060
return inc
6161

6262

63+
class AdaptiveExpectation(Transformation):
64+
65+
def __init__(self, parameters):
66+
super(AdaptiveExpectation, self).__init__(parameters)
67+
self.h = parameters
68+
69+
def apply(self, data, param=None):
70+
return data
71+
72+
def inverse(self, data, param):
73+
n = len(data)
74+
75+
inc = [param[t] + self.h*(data[t] - param[t]) for t in np.arange(0, n)]
76+
77+
if n == 1:
78+
return inc[0]
79+
else:
80+
return inc
81+
82+
6383
def boxcox(original, plambda):
6484
n = len(original)
6585
if plambda != 0:

0 commit comments

Comments
 (0)