[R-SIG-Finance] loglik() in urca function

Pfaff, Bernhard Dr. Bernhard_Pfaff at fra.invesco.com
Thu Sep 24 11:15:56 CEST 2009


Dear Karla,

see help("ur.za-class") for the details of a returned object from ur.za, in particular "testreg" and in your case A at testreg. This is an S3 summary.lm object. Unfortunately, a logLik-method is only available for lm-type objects. However, you can determine an "optimal" lag length by employing ur.df() for the whole sample or a sub-sample, by using either "AIC" or "BIC" as information criteria. 

hth,
Bernhard 

>
>
>
>Dear Group:
> 
>I want to get the loglik of the regresion associated to the 
>estimation of the unit root test Zivot-Andrews of the package 
>urca. I am new using R, then I simply tried the next sequence:
> 
>> A<-ur.za(var,model="intercept",lag=2)
>> logLik(A)
> 
>but the result is an error, and I think it is because A (the 
>result of the function) is not class S4.
> 
>> class(A)
>[1] "ur.za"
>attr(,"package")
>[1] "urca"
>
>I want to use the logLik to compare different number of lags, 
>in order to know the optimal one.
> 
>I will be really grateful if someone can tell me how to 
>calculate the logLik or the optimal number of lags.
> 
>Thank you very much!,
> 
>Karla
> 
>
>
>
>¿Cuál de estas 16 personalidades es la tuya? ¡Descubre quién 
>eres realmente! 		 	   		  
>_________________________________________________________________
>[[elided Hotmail spam]]
>
>	[[alternative HTML version deleted]]
>
>
*****************************************************************
Confidentiality Note: The information contained in this ...{{dropped:10}}



More information about the R-SIG-Finance mailing list