Dear All,
I used my taper data to fit a variable-form taper model Kozak 2004-2 ,which is a nonlinear model. The data is longitudinal data that is irregularly spaced and unbalanced.so we need to overcome the inherent autocorrelation by using continuous-time autoregressive error structure CAR().I read some papers in which the authors use SAS /ETS to fit the models.Take A.Rojo2005 ,for example.In A.Rojo(2005),the author incorporated CAR(2) error process into the models to minimize the effect of autocorrelation inherent in the logitudinal data.I did like what Rojo said in the paper.When I add CAR(1) to the model, I can get the result of autoregressive parameter ρ1 .But when I add CAR(2),It is difficult to converge for ρ2.
Could someone can help me to incorporate CAR(2) into Kozak2004-2?
I add the paper A.Rojo(2005) .Thank you very much.
Here are my SAS codes
proc import out=work.taper
datafile='E:/zzs7.csv' dbms=csv replace; getnames=yes;
RUN; /*read data */
data fit_taper;set taper;
if p="f" then output fit_taper;
run;/*Select data for fitting*/
PROC model data=fit_taper method=marquardt sur dw collin;
exogenous bolt tht dbh;
endogenous dob ;
parms b0 0.9884 b1 0.9478 b2 0.0735 b3 0.4884 b4 -0.9783 b5 0.5511 b6 0.1 b7 0.0389 b8 -0.1579 p1 0.8 ;/*start ualue*/
dob=b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))); /*Kozak2004-2*/
fit dob ;
run;
PROC model data=fit_taper method=marquardt sur dw collin;
exogenous bolt tht dbh;
endogenous dob ;
parms b0 0.9884 b1 0.9478 b2 0.0735 b3 0.4884 b4 -0.9783
b5 0.5511 b6 0.1 b7 0.0389 b8 -0.1579 p1 0.8 ;
dob=b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3))))
+(J>1)*p1**(bolt-zlag1(bolt))*zlag1(dob-(b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))))); /*Kozak2004-2 with CAR(1)*/
fit dob ;
run;
PROC model data=fit_taper method=marquardt sur dw collin;
exogenous bolt tht dbh;
endogenous dob ;
parms b0 0.9884 b1 0.9478 b2 0.0735 b3 0.4884 b4 0.2783
b5 0.5511 b6 -1.1 b7 -0.0389 b8 0.2579 p1 0.6 p2 0.001;
dob=b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3))))
+(J>1)*p1**(bolt-zlag1(bolt))*zlag1(dob-(b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3))))))
+(J>2)*p2**(bolt-zlag2(bolt))*zlag2(dob-(b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3))))
+(J>1)*p1**(bolt-zlag1(bolt))*zlag1(dob-(b0*(dbh**b1)*(tht**b2)*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)
**(1/3)))**(b3*(bolt/tht)**4+b4*(1/exp(dbh/tht))
+b5*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3)))**0.1
+b6*(1/dbh)+b7*tht**(1-(bolt/tht)**(1/3))
+b8*((1-(bolt/tht)**(1/3))/(1-(1.3/tht)**(1/3))))));/*Kozak2004-2 with CAR(2)*/
fit dob ;
run;