Different to Maple alike, SAS is data-driven. You cannot directly compute formulas. In fact, maximum log likelihood is based on data. As my understanding, you should have data with n observations. You should indicate which parameters to be estimated as well. I guess here is α and ε while αt and εt may be αi and εi from your data.
usually in SAS procedures, you don't need to specified accumulative sum, it is caculated within a procedure. You only need to specify the likelihood function at each observation level. When you take a log function of likelihood function, it becomes a sum.
Here is an example to do a probit model in your own program. you will see the results are the same as that from canned procedures.
data tmp;
do t=1 to 100;
x=rannor(123);
y=1+1*x> rannor(123);
output;
end;
run;
proc logistic data=tmp;
model y(event='1')=x/link=probit;
run;
proc nlmixed data=tmp;
parms a=0 b=0;
xbeta=a+b*x;
p=probnorm(xbeta);
if y=1 then p=p;
else p=1-p;
loglik=log(p);
model y ~ general(loglik);
run;
2066
2067 proc nlp data=t1;
2068 f=1/(sqart(alpha0+alpha1*b**2+beta*c**2)*beta(1+(epsilon*a)/beta)**(1+1/epsilon));
ERROR: The function BETA requires at least 2 arguments. There are too few arguments for the function
BETA at line 2068 column 46.
2069 parms alpha0=0,alpha1=0.8,beta=0.1,epsilon=1/2,beta=1.;
-
22
-
200
ERROR 22-322: Syntax error, expecting one of the following: a numeric constant, a datetime constant,
;, ',', TO.
ERROR 200-322: The symbol is not recognized and will be ignored.
2070 bounds epsilon>0,delta>0;
2071 logf=log(f);
2072 max logf;
2073 run;
NOTE: Your code contains 0 program statements.
NOTE: PROCEDURE NLP used (Total process time):
real time 0.32 seconds
cpu time 0.06 seconds
哪位大哥知道麻烦帮小弟改改!!
2066
2067 proc nlp data=t1;
2068 f=1/(sqart(alpha0+alpha1*b**2+beta*c**2)*beta(1+(epsilon*a)/beta)**(1+1/epsilon));
ERROR: The function BETA requires at least 2 arguments. There are too few arguments for the function
BETA at line 2068 column 46.
2069 parms alpha0=0,alpha1=0.8,beta=0.1,epsilon=1/2,beta=1.;
-
22
-
200
ERROR 22-322: Syntax error, expecting one of the following: a numeric constant, a datetime constant,
;, ',', TO.
ERROR 200-322: The symbol is not recognized and will be ignored.
2070 bounds epsilon>0,delta>0;
2071 logf=log(f);
2072 max logf;
2073 run;
NOTE: Your code contains 0 program statements.
NOTE: PROCEDURE NLP used (Total process time):
real time 0.32 seconds
cpu time 0.06 seconds
哪位大哥知道麻烦帮小弟改改!!
I think first you work on a simple garch model with a sas provided pakeage or sas provided programs. When you fully understand it and then extend it to your problem. That is a easy way and efficient way. You should be able to find programs from GARCH models on SAS(www.sas.com) website.
全部评论 8