Gaussian approx of x_t --> f_t(y_t|x_t)

def approx_likelihood(self, yt):
        """ Gaussian approx of x_t --> f_t(y_t|x_t)
        """     
        x = np.zeros(self.dx) 
        max_nb_attempts = 100
        tol = 1e-3
        for i in range(max_nb_attempts):
            grad, hess = self.diff_ft(x, yt)
            xnew = x - linalg.solve(hess, grad)  # Newton Raphson 
            if linalg.norm(xnew - x, ord=1) < tol:
                break 
            x = xnew
        return (x, -hess)