arx_test.cpp estim/arx.h stat/libEF.h int int main () main #include<estim/arx.h> #include<stat/libEF.h> usingnamespaceitpp; //Theselinesareneededforuseofcoutandendl usingstd::cout; usingstd::endl; intmain(){ //Setupmodel vecth("0.8-0.30.40.01"); intord=th.length(); doublesqr=1; //Testconstructor matV0=0.001*eye(ord+1);V0(0.0)*=10;// doublenu0=ord+1; RVthr("{theta_and_r}"); ARXAr(thr,V0,nu0); epdf&Ar_ep=Ar._epdf(); //Testestimation intndat=1000; intt,j; vecYt(ndat); vecLL(ndat); Yt.set_subvector(0,randn(ord));//initialvalues vecrgr(ord); cout<<Ar_ep.mean()<<endl; for(t=ord;t<ndat;t++){ for(j=0;j<(ord);j++){rgr(j)=Yt(t-j-1);} Yt(t)=th*rgr+sqr*NorRNG(); vecPsi=concat(Yt(t),rgr); Ar.bayes(Psi); LL(t)=Ar._ll(); } cout<<Ar_ep.mean()<<endl; //Testbrute-frocestructureestimation cout<<Ar.structure_est(egiw(thr,V0,nu0))<<endl; }