[R] Estimation of AR(1) model by QML.
Dear Users, I am trying to estimate a model Y(t)=alpha+rho*Y(t-1)+e(t) where i know e(t)~t(3). a) I want to estimate (alpha, rho) by QML estimation assuming (wrongly) that e(t)~N(0,sigma2) and calculate the standard errors. b) Estimate (alpha, rho) by ML estimation assuming (correctly) e(t)~t(3) and compute standard errors. Can anyone help me out to figure out how I could answer this question in R? Thank you beforehand. Cheers, Chuse [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Estimation of AR(1) model by QML.
Why not using optim on the likelihood in a) with normally distributed standard errors and for b) optim with a likelihood with t(3)-distributed standard errors? Best Simon On 30 Dec 2013, at 21:19, Xuse Chuse chus...@gmail.com wrote: Dear Users, I am trying to estimate a model Y(t)=alpha+rho*Y(t-1)+e(t) where i know e(t)~t(3). a) I want to estimate (alpha, rho) by QML estimation assuming (wrongly) that e(t)~N(0,sigma2) and calculate the standard errors. b) Estimate (alpha, rho) by ML estimation assuming (correctly) e(t)~t(3) and compute standard errors. Can anyone help me out to figure out how I could answer this question in R? Thank you beforehand. Cheers, Chuse [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Estimation of AR(1) model by QML.
On 30/12/2013 22:57, Simon Zehnder wrote: Why not using optim on the likelihood in a) with normally distributed standard errors and for b) optim with a likelihood with t(3)-distributed standard errors? Because evaluating the likelihood is a tricky business here. I don't know what is meant by 'QML' here (even if the Q means 'quasi', the term is used in several distinct senses, none common for time-series). Suppose you observe (Y(1) ... Y(T)). Note that Y(1) depends on the unobserved Y(0). In the Gaussian case you can write down the joint multilvariate normal distribution and compute it with some matrix algebra (assuming stationarity, which means a constrained optimization). But in case b) the joint distribution is not multivariate T. An approach from 50+ years ago is to condition on Y(1), when this is just a regression. For the Gaussian case, see ar.ols(): for the t(3) case you can use a robust regression function (but beware that the optimization can be tricky). Best Simon On 30 Dec 2013, at 21:19, Xuse Chuse chus...@gmail.com wrote: Dear Users, I am trying to estimate a model Y(t)=alpha+rho*Y(t-1)+e(t) where i know e(t)~t(3). a) I want to estimate (alpha, rho) by QML estimation assuming (wrongly) that e(t)~N(0,sigma2) and calculate the standard errors. b) Estimate (alpha, rho) by ML estimation assuming (correctly) e(t)~t(3) and compute standard errors. Can anyone help me out to figure out how I could answer this question in R? Thank you beforehand. Cheers, Chuse -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.