function [error_prediction,error_fitted,y_prediction]=near_null(x,V,N,p)

beta=V(1,:)*V(1,:)';
theta=V*V(1,:)'/beta;
a=theta(2:p+1);
y_prediction=toeplitz(x(N:length(x)-1), x(N:-1:N-p+1))*a;
y_fitted=Toeplitz(x(p:N-1),x(p:-1:1))*a;
error_prediction=norm(x(N+1:length(x)) -y_prediction)/norm(x(N+1:length(x)));
error_fitted=norm(x(p+1:N) -y_fitted)/norm(x(p+1:N));
