全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Gauss专版
2015 1
2010-09-04
各位大侠
我在运行下面程序时,总是提示:   Label undefined G0090 : 'skip' ,错误指向:endp;
下面是程序:
library maxlik;
#include maxlik.ext;
fname="c:\gauss7.0\examples\crisp.w";
range="c5:c1331";
{bp,names}=import(fname,range,1);
var=vcx(bp);
u=(bp-meanc(bp))^2;
maxset;
_max_active={1,1,1};
_max_gradtol=1e-5;
_max_algorithm=5;
_max_linesearch=5;
_max_maxiters=1000;
_max_maxtry=5;
_max_randradious=1e-3;
_max_covpar=3;
__output=1;
iv=0.001|0.97|0.02;
{est,fmax,grad,cov,retcode}maxlik(u,1,&lr,iv);
proc lr(miv,u);
local a0,a1,a2,h,t,ll;
a0=miv[1]; a1=miv[2]; a2=miv[3];
if a0<=0;ll=1000000; goto skip;endif;
if a1<0;ll=-1000000; goto skip; endif;
if a2<0; ll=-1000000; goto skip; endif;
if (a1+a2)>1; ll=-1000000; goto skip; endif;
h=zeros(rows(u),1);
h[1]=a0+(a1+a2)*var;
t=2;
do until t>rows(u);
h[t]=a0+a1*h[t-1]+a2*u[t-1];
t=t+1;
endo;
ll=-.5*ln(2*pi)-.5*ln(h[2:rows(u)])-.5*(u[2:rows(u)]./h[2:rows(u)]);
skip:
retp (lr);
endp;
__title="garch(1,1) estimates";
print maxprt(est,fmax,grad,cov,retcode);

另外,我使用是GAUSS7.0
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2010-9-4 09:24:57
所编程序在下面文章中可见
GAUSS Programming for Econometricians
Soosung Hwang
Dept. of Banking and Finance,
City University Business School
September 25, 2001
这篇文章在论坛中可以下载
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群