Hi, Can anyone explain how the standard error in arima() is calculated? Also, how can I extract it from the Arima object? I don't see it in there. > x <- rnorm(1000) > a <- arima(x, order = c(4, 0, 0)) > a Call: arima(x = x, order = c(4, 0, 0)) Coefficients: ar1 ar2 ar3 ar4 intercept -0.0451 0.0448 0.0139 -0.0688 0.0010 s.e. 0.0316 0.0316 0.0317 0.0316 0.0296 sigma^2 estimated as 0.9775: log likelihood = -1407.56, aic = 2827.12 > names(a) [1] "coef" "sigma2" "var.coef" "mask" "loglik" "aic" "arma" "residuals" "call" "series" "code" "n.cond" "model" Thanks, Gad -- Gad Abraham Department of Mathematics and Statistics The University of Melbourne Parkville 3010, Victoria, Australia email: g.abraham at ms.unimelb.edu.au web: http://www.ms.unimelb.edu.au/~gabraham
Hi Gad, try:> class(a)[1] "Arima"> getAnywhere(print.Arima)... Cheers, Andrew On Fri, Mar 16, 2007 at 01:47:25PM +1100, Gad Abraham wrote:> Hi, > > Can anyone explain how the standard error in arima() is calculated? > > Also, how can I extract it from the Arima object? I don't see it in there. > > > x <- rnorm(1000) > > a <- arima(x, order = c(4, 0, 0)) > > a > > Call: > arima(x = x, order = c(4, 0, 0)) > > Coefficients: > ar1 ar2 ar3 ar4 intercept > -0.0451 0.0448 0.0139 -0.0688 0.0010 > s.e. 0.0316 0.0316 0.0317 0.0316 0.0296 > > sigma^2 estimated as 0.9775: log likelihood = -1407.56, aic = 2827.12 > > names(a) > [1] "coef" "sigma2" "var.coef" "mask" "loglik" "aic" > "arma" "residuals" "call" "series" "code" > "n.cond" "model" > > > Thanks, > Gad > > -- > Gad Abraham > Department of Mathematics and Statistics > The University of Melbourne > Parkville 3010, Victoria, Australia > email: g.abraham at ms.unimelb.edu.au > web: http://www.ms.unimelb.edu.au/~gabraham > > ______________________________________________ > R-help at stat.math.ethz.ch 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.-- Andrew Robinson Department of Mathematics and Statistics Tel: +61-3-8344-9763 University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599 http://www.ms.unimelb.edu.au/~andrewpr http://blogs.mbs.edu/fishing-in-the-bay/
Andrew Robinson wrote:> Hi Gad, > > try: > > >> class(a) > [1] "Arima" >> getAnywhere(print.Arima)Thanks Andrew. For the record, the standard error is the square root of the diagonal of the covariance matrix a$var.coef (itself obtained through some magic): ses[x$mask] <- round(sqrt(diag(x$var.coef)), digits = digits) Cheers, Gad -- Gad Abraham Department of Mathematics and Statistics The University of Melbourne Parkville 3010, Victoria, Australia email: g.abraham at ms.unimelb.edu.au web: http://www.ms.unimelb.edu.au/~gabraham
On Fri, 16 Mar 2007, Gad Abraham wrote:> Andrew Robinson wrote: >> Hi Gad, >> >> try: >> >> >>> class(a) >> [1] "Arima" >>> getAnywhere(print.Arima) > > Thanks Andrew. > > For the record, the standard error is the square root of the diagonal of > the covariance matrix a$var.coef (itself obtained through some magic): > > ses[x$mask] <- round(sqrt(diag(x$var.coef)), digits = digits)And for the record, ?arima does tell you about the component var.coef, and also suggests the vcov() method to extract the variance matrix. -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595