proc likeprocAR(th,y); local c,phi,sigma,eps,loglik; c = th[1]; phi = th[2]; sigma = th[3]; eps= y-c-phi*ylmat; loglik = ln(1/(sqrt(2*pi*sigma^2)))- (eps.^2./(2*sigma^2)); retp(loglik); endp;