[R] Calculating AIC for the whole model in VAR
Bernhard Pfaff
bernhard at pfaffikus.de
Tue May 21 22:37:17 CEST 2013
Am Dienstag, den 21.05.2013, 16:17 +0100 schrieb Prof Brian Ripley:
> On 21/05/2013 16:11, Dimitri Liakhovitski wrote:
> > Sorry, I am using package "vars"
>
> So you need to report the bug in that package to its maintainer.
> ?logLik says
>
> Value:
>
> Returns an object of class ‘logLik’. This is a number with at
> least one attribute, ‘"df"’ (*d*egrees of *f*reedom), giving the
> number of (estimated) parameters in the model.
>
> and the methods in vars do not comply.
>
Dear Prof. Ripley,
many thanks for pointing this out. The attributes 'df' and 'nobs' have
been added to logLik.varest() on R-Forge (project 'AICTS II', revision
>= 90); soon to be released on CRAN (package version 1.5-1).
Best,
Bernhard
> >
> >
> > On Tue, May 21, 2013 at 11:09 AM, Prof Brian Ripley
> > <ripley at stats.ox.ac.uk <mailto:ripley at stats.ox.ac.uk>> wrote:
> >
> > On 21/05/2013 16:00, Dimitri Liakhovitski wrote:
> >
> > Hello!
> >
> > I am using package "VAR".
> >
> >
> > What is that? There is no such package on CRAN nor BioC.
> >
> >
> > I've fitted my model:
> > mymodel<-VAR(mydata,myp,type="__const")
> >
> > I can extract the Log Liklihood for THE WHOLE MODEL:
> >
> > logLik(mymodel)
> >
> > How could I calculate (other than manually) the corresponding Akaike
> > Information Criterion (AIC)?
> >
> > I tried AIC - but it does not take mymodel:
> > AIC(mymodel)
> > # numeric(0)
> >
> > Thank you!
> >
> >
> > This is not reproducible, pace the posting guide. The default
> > method for AIC() should work if the logLik() method is written
> > correctly, so I guess it was not.
> >
> > --
> > Brian D. Ripley, ripley at stats.ox.ac.uk <mailto:ripley at stats.ox.ac.uk>
> > Professor of Applied Statistics,
> > http://www.stats.ox.ac.uk/~__ripley/
> > <http://www.stats.ox.ac.uk/~ripley/>
> > University of Oxford, Tel: +44 1865 272861
> > <tel:%2B44%201865%20272861> (self)
> > 1 South Parks Road, +44 1865 272866 <tel:%2B44%201865%20272866> (PA)
> > Oxford OX1 3TG, UK Fax: +44 1865 272595
> > <tel:%2B44%201865%20272595>
> >
> >
> >
> >
> > --
> > Dimitri Liakhovitski
>
>
More information about the R-help
mailing list