def estimate(self, a, y, initial_x=None):
"""
:param a: MxN matrix A in the y=Ax equation
:type a: numpy.ndarray
:param y: M vector y in the y=Ax equation
:type y: numpy.ndarray
:param initial_x: N vector of an initial solution
:type initial_x: numpy.ndarray
:return: best estimation of the N vector x in the y=Ax equation
:rtype: numpy.ndarray
:Example:
>>> import numpy as np
>>> import linvpy as lp
>>> a = np.matrix([[1, 2], [3, 4], [5, 6]])
>>> y = np.array([1, 2, 3])
>>> m = lp.MEstimator()
>>> m.estimate(a,y)
array([ -2.95552481e-16, 5.00000000e-01])
>>> m_ = lp.MEstimator(loss_function=lp.Bisquare, clipping=2.23, \
regularization=lp.Lasso(), lamb=3)
>>> initial_solution = np.array([1, 2])
>>> m_.estimate(a, y, initial_x=initial_solution)
array([ 0., 0.])
"""
return self.irls(a, y, initial_x)
评论列表
文章目录