Aptech Systems, Inc. Worldwide Headquarters
Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286
Ready to Get Started?
Request Quote & Product Information
Training & Events
Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.
Have a Specific Question?
Q&A: Register and Login
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.
Join our community to see why our users are considered some of the most active and helpful in the industry!
Where to Buy
Recent Tagsapplications character vectors CML CMLMT Constrained Optimization datasets dates dlibrary dllcall error error handling errors Excel file i/o floating network GAUSS Engine graphics GUI hotkeys installation Java API license licensing linux loading data loops matrices matrix matrix manipulation Maxlik MaxLikMT Memory optimization Optmum output PQG graphics procs RAM random numbers string functions strings structures threading Time Series writing data
Time Series 2.0 MT
Find out more now
Time Series MT 2.1
Find out more now
Unconditional Maximum Likelihood of an AR(10) model.
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.
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;
The varmal() function in the Run-Time Library computes an unconditional VARMA log-likelihood. Call that procedure in your log-likelihood proc.
Could you please give me a simple example how to combine these to procedures (varmall and loglik) or/and give me some reference?