# Unconditional Maximum Likelihood of an AR(10) model.

0

Is it possible to estimate the Unconditional Maximum Likelihood of an AR(10) model (see Hamilton pp.123 [5.3.6]) with maxlik library and loglik proc? If yes can you explain how to write the retp(  ???  ) part of the procedute?. If not what do you suggest doing?

Thank you very much.

T

0
accepted

For Maxlikmt you are required to write a procedure that returns the log-likelihood of your model.

From your description I'm assuming you have a univariate time series and you want to estimate an AR(10) model. The log-likelihood procedure takes two arguments, a PV structure containing the parameters of the model, in your case a vector of 10 autoregression parameters. The second argument is a DS structure containing the time series. To us the varmaml() function in the Run-Time Library you must remove the means from the data, i.e., there'll be no interecept. You can compute an intercept after you have the estimates.

So in your command file you'll have initialized a PV structure and a DS structure:

struct PV par;
par = pvPack(pvCreate,.01*ones(10,1),"AR");

load y[500,1] = "mydata.txt"; // assumes a vector of time series data
// in a text file called mydata.txt
struct DS ts;
ts.dataMatrix = y;

// your procedure looks like this
proc ll(struct PV p, struct DS d);

// res = varmares(w,phi,theta);
// we'll compute the residuals and compute
// the log-likelihood from that.
// This procedure assumes a univariate time series.
// It will have to be modified for multivariate series

local e,ar,ma,oldt,sse;
ar = pvUnpack(p,"AR");
ma = error(0);
oldt = trapchk(2);
e = varmares(d.dataMatrix,ar,ma);
trap oldt,2;
// we trapped the call to varmares because if it fails it'll
// return a missing value and MaxlikMT might be able to
// recover and try some different ar parameters

if not scalmiss(e);
retp(lnpdfn(e));
else;
retp(error(0));
endif;
endp;
0

The varmal() function in the Run-Time Library computes an unconditional VARMA log-likelihood. Call that procedure in your log-likelihood proc.

0

Could you please give me a simple example how to combine these to procedures (varmall and loglik) or/and give me some reference?

Thanks,

T

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!