I am using R version 1.0.1 both under Linux and Windows 98. A simple question: After fitting an ARIMA model, how can I plot in the same graph both the original series (solid line, say) and the fitted values implied by the estimated model (dotted line, say)? Example: library(ts) data(LakeHuron) arima0(LakeHuron, order=c(2,0,0), xreg=1:98) How can I plot both the original series (LakeHuron) and the fitted values in the same graph? Thank you in advance. Francisco. -- Francisco Cribari-Neto voice: +55-81-2718420 Departamento de Estatistica fax: +55-81-2718422 Universidade Federal de Pernambuco e-mail: cribari at de.ufpe.br Recife/PE, 50740-540, Brazil web: www.de.ufpe.br/~cribari/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> From: Francisco Cribari <cribari at de.ufpe.br> > To: r-help at stat.math.ethz.ch > Subject: [R] [?] ARIMA in R > Date: Mon, 22 May 2000 08:34:40 -0300 > > > I am using R version 1.0.1 both under Linux and Windows 98. > > A simple question: After fitting an ARIMA model, how can I > plot in the same graph both the original series (solid line, > say) and the fitted values implied by the estimated model > (dotted line, say)? > > Example: > > library(ts) > data(LakeHuron) > arima0(LakeHuron, order=c(2,0,0), xreg=1:98) > > How can I plot both the original series (LakeHuron) and the > fitted values in the same graph?What do you mean by the fitted values? (For dependent data it is not a very useful concept.) Do you mean successive one-step predictions? Or the predictions from the regression terms? Or ...? I suspect the answer is that it is not easy in R, but please specify what you want. -- Brian D. Ripley, ripley at 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Francisco Cribari wrote:> I am using R version 1.0.1 both under Linux and Windows 98. > > A simple question: After fitting an ARIMA model, how can I > plot in the same graph both the original series (solid line, > say) and the fitted values implied by the estimated model > (dotted line, say)? > > Example: > > library(ts) > data(LakeHuron) > arima0(LakeHuron, order=c(2,0,0), xreg=1:98)What about md <- arima0(LakeHuron, order=c(2,0,0), xreg=1:98) plot(LakeHuron) lines(LakeHuron-md$resid,col="red") Adrian -- Adrian Trapletti, Vienna University of Economics and Business Ad- ministration, Operations Research, Augasse 2-6, 1090 Vienna, Austria Phone: ++43-(0)1-31336-4561 Email: adrian.trapletti at wu-wien.ac.at Fax: ++43-(0)1-31336-708 WWW: http://quor.wu-wien.ac.at/adrian.html -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._