Exemplo n.º 1
0
 def fit(self, x, y):
     x1 = Accumulation.ago(y, None, True)
     z1 = ModelMethods.based(x1)
     ones_array = np.diff(x).astype(np.float64)
     ones_array = ones_array.reshape([-1, 1])
     B = ModelMethods.construct_matrix(-z1, ones_array)
     self.x_orig = y
     self.params = ModelMethods.get_params(B, x1)
     return self
Exemplo n.º 2
0
 def fit(self, x, y):
     x1 = NewInformationPriorityAccumulation.nipago(y, self.r)
     z1 = ModelMethods.based(x1)
     ones_array = np.diff(x).astype(np.float64)
     ones_array = ones_array.reshape([-1, 1])
     range_array = np.arange(len(x) - 1)
     range_array = range_array.reshape([-1, 1])
     B1 = ModelMethods.construct_matrix(-z1, range_array)
     B = ModelMethods.construct_matrix(-B1, ones_array)
     self.x_orig = y
     self.params = ModelMethods.get_params(B, x1)
     self.x1 = x1
     return self
Exemplo n.º 3
0
 def fit(self, x, y):
     x1 = Accumulation.ago(y, None, True)
     z1 = ModelMethods.based(x1)
     ones_array = np.diff(x).astype(np.float64)
     ones_array = ones_array.reshape([-1, 1])
     range_array = np.arange(len(x) - 1)
     range_array = range_array.reshape([-1, 1])
     B1 = ModelMethods.construct_matrix(-z1, range_array)
     self.B = ModelMethods.construct_matrix(-B1, ones_array)
     self.x_orig = y
     self.params = ModelMethods.get_params(self.B, x1)
     self.x1 = x1
     self.is_fitted = True
     return self