1 / 11

Nonlinear Model by Gauss

Nonlinear Model by Gauss. An example Exercise 20(g) at the ending of Chapter 3 (page 112). new; library optmum; @ Data Generation Process @ beta1=2; alpha=0.5; x1=Rndn(100,1); u=2.5*Rndn(100,1); Y=alpha+EXP(beta1*x1)+u; T=rows(y); @ Sample Number @. C1=0.4; @ alpha @

kelvin
Download Presentation

Nonlinear Model by Gauss

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nonlinear Model by Gauss An example Exercise 20(g) at the ending of Chapter 3 (page 112)

  2. new; • library optmum; • @ Data Generation Process @ • beta1=2; alpha=0.5; • x1=Rndn(100,1); u=2.5*Rndn(100,1); • Y=alpha+EXP(beta1*x1)+u; • T=rows(y); @ Sample Number @

  3. C1=0.4; @ alpha @ • C2=1.5; @ beta 1@ • PRMTR_IN=C1~C2; • PRMTR_IN=PRMTR_IN'; • @ OLS estimation @ • @==================================================@ • {xout,fout,gout,cout}=optmum(&lik_fcn,PRMTR_in); • PRM_FNL=TRANS(xout); @ Estimated coefficients, constrained@

  4. "Calculating Hessian..... Please be patient!!!!"; • hout0=hessp(&lik_fcn,xout); • hout=inv(hout0); • grdn_fnl=gradfd(&TRANS,xout); • Hsn_fnl=grdn_fnl*hout*grdn_fnl'; • SD_fnl =sqrt(diag(Hsn_fnl)); @Standard errors of the estimated coefficients@ • cls; • print "SSE is "; fout; • print "Estimated parameters are:"; prm_fnl'; • print "Standard errors of parameters are:"; sd_fnl'; • end;

  5. PROC LIK_FCN(PRMTR1); • local prmtr,ppr,qpr,pr_vl,pr_val,likv,lik,pr_tr,prob_t,prob_dd,A,EN, • i,PAI,e,prob_,pr_trf,pro_,VAR,u1, • phi0,phi1,a1,a2,r0,r1,r2,r3,Lanta,b1,b2,b3,b4,T0,Id,d1,d2,d3,d4,g1,g2,g3,v,f1,f2,f3,f4,lage,beta1,beta2,beta3,sigma,alpha,SSE; • PRMTR=TRANS(PRMTR1); • LOCATE 15,1; PRMTR'; • /* DEFINE PARAMETERS */ • alpha=PRMTR[1,1]; • beta1=PRMTR[2,1];

  6. SSE=0.0; • i=1; • DO UNTIL i>T; • e=(y[i,1]-alpha-EXP(beta1*x1[i,1])); • SSE=SSE+e^2; • i= i+1; • ENDO; • LOCATE 2,35;"SSE=";;SSE; • RETP(SSE); • ENDP;

  7. Homework (option) • Use gauss program to estimate the model specification of “Q.20(h)”. • Download the program for “Q.20 (g)” from my personal web site. • Rewrite this program by yourself • Alpha=0.5; beta=0.8 and c=2.0

More Related