Skip to content
Back to formatted view

Raw Message

Message-ID: <B89F0CE41D45644A97CCC93DF548C1C31E136B1C@GBHENXMB02.corp.amvescap.net>
Date: 2009-09-24T09:15:56Z
From: Pfaff, Bernhard Dr.
Subject: loglik() in urca function
In-Reply-To: <COL124-W45F61F1D713B632D0BA4FE5DB0@phx.gbl>

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}}