Dear Eric and William, Why do the 1st and 2nd incantation of arima return sigma^2 as 5.233 vs .9999? The help for arima says ---> sigma2: the MLE of the innovations variance. By that account the 1st result is incorrect. I am a little confused. set.seed(123) b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000000,sd=1) # Variance of the innovations, e_t = 1 # Variance of b = Var(e_t)/(1-Phi^2) = 1 / (1-.81) = 5.263158 arima(b)> arima(b)Call: arima(x = b) Coefficients: intercept -0.0051 s.e. 0.0023 sigma^2 estimated as 5.233: log likelihood = -2246450, aic = 4492903>arima(b,order= c(1,0,0)) Call: arima(x = b, order = c(1, 0, 0)) Coefficients: ar1 intercept 0.8994 -0.0051 s.e. 0.0004 0.0099 sigma^2 estimated as 0.9999: log likelihood = -1418870, aic = 2837747>On Tue, Nov 13, 2018 at 11:07 PM William Dunlap <wdunlap at tibco.com> wrote:> Try supplying the order argument to arima. It looks like the default is > to estimate only the mean. > > > arima(b, order=c(1,0,0)) > > Call: > arima(x = b, order = c(1, 0, 0)) > > Coefficients: > ar1 intercept > 0.8871 0.2369 > s.e. 0.0145 0.2783 > > sigma^2 estimated as 1.002: log likelihood = -1420.82, aic = 2847.63 > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Tue, Nov 13, 2018 at 4:02 AM, Ashim Kapoor <ashimkapoor at gmail.com> > wrote: > >> Dear All, >> >> Here is a reprex: >> >> set.seed(123) >> b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000,sd=1) >> arima(b) >> >> Call: >> arima(x = b) >> >> Coefficients: >> intercept >> 0.2250 >> s.e. 0.0688 >> >> sigma^2 estimated as 4.735: log likelihood = -2196.4, aic = 4396.81 >> > >> >> Should sigma^2 not be equal to 1 ? Where do I misunderstand ? >> >> Many thanks, >> Ashim >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> > >[[alternative HTML version deleted]]
Hi Ashim, Per the help page for arima(), it fits an ARIMA model to the specified time series - but the caller has to specify the order - i.e. (p,d,q) - of the model. The default order is (0,0,0) (per the help page). Hence your two calls are different. The first call is equivalent to order=c(0,0,0) and the second specifies order=c(1,0,0). In the first, since there is no auto-regression, all the variance is "assigned" to the innovations, hence sigma^2 = 5.233. The second case you understand. A clue that this was happening is that the first call only returns a single coefficient (where is the autoregressive coefficient? - not there because you didn't ask for it). The second call returns two coefficients, as requested/expected. HTH, Eric On Wed, Nov 14, 2018 at 12:08 PM Ashim Kapoor <ashimkapoor at gmail.com> wrote:> Dear Eric and William, > > Why do the 1st and 2nd incantation of arima return sigma^2 as 5.233 vs > .9999? > The help for arima says ---> sigma2: the MLE of the innovations variance. > By that account the 1st result is incorrect. I am a little confused. > > set.seed(123) > b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000000,sd=1) > > # Variance of the innovations, e_t = 1 > > # Variance of b = Var(e_t)/(1-Phi^2) = 1 / (1-.81) = 5.263158 > > arima(b) > > > arima(b) > > Call: > arima(x = b) > > Coefficients: > intercept > -0.0051 > s.e. 0.0023 > > sigma^2 estimated as 5.233: log likelihood = -2246450, aic = 4492903 > > > > > arima(b,order= c(1,0,0)) > > Call: > arima(x = b, order = c(1, 0, 0)) > > Coefficients: > ar1 intercept > 0.8994 -0.0051 > s.e. 0.0004 0.0099 > > sigma^2 estimated as 0.9999: log likelihood = -1418870, aic = 2837747 > > > > On Tue, Nov 13, 2018 at 11:07 PM William Dunlap <wdunlap at tibco.com> wrote: > > > Try supplying the order argument to arima. It looks like the default is > > to estimate only the mean. > > > > > arima(b, order=c(1,0,0)) > > > > Call: > > arima(x = b, order = c(1, 0, 0)) > > > > Coefficients: > > ar1 intercept > > 0.8871 0.2369 > > s.e. 0.0145 0.2783 > > > > sigma^2 estimated as 1.002: log likelihood = -1420.82, aic = 2847.63 > > > > > > Bill Dunlap > > TIBCO Software > > wdunlap tibco.com > > > > On Tue, Nov 13, 2018 at 4:02 AM, Ashim Kapoor <ashimkapoor at gmail.com> > > wrote: > > > >> Dear All, > >> > >> Here is a reprex: > >> > >> set.seed(123) > >> b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000,sd=1) > >> arima(b) > >> > >> Call: > >> arima(x = b) > >> > >> Coefficients: > >> intercept > >> 0.2250 > >> s.e. 0.0688 > >> > >> sigma^2 estimated as 4.735: log likelihood = -2196.4, aic = 4396.81 > >> > > >> > >> Should sigma^2 not be equal to 1 ? Where do I misunderstand ? > >> > >> Many thanks, > >> Ashim > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > >> 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. > >> > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]
Dear Eric, Many thanks for your reply. Best Regards, Ashim On Wed, Nov 14, 2018 at 4:05 PM Eric Berger <ericjberger at gmail.com> wrote:> Hi Ashim, > Per the help page for arima(), it fits an ARIMA model to the specified > time series - but the caller has to specify the order - i.e. (p,d,q) - of > the model. > The default order is (0,0,0) (per the help page). Hence your two calls are > different. The first call is equivalent to order=c(0,0,0) and the second > specifies order=c(1,0,0). > In the first, since there is no auto-regression, all the variance is > "assigned" to the innovations, hence sigma^2 = 5.233. > The second case you understand. > A clue that this was happening is that the first call only returns a > single coefficient (where is the autoregressive coefficient? - not there > because you didn't ask for it). > The second call returns two coefficients, as requested/expected. > > HTH, > Eric > > > On Wed, Nov 14, 2018 at 12:08 PM Ashim Kapoor <ashimkapoor at gmail.com> > wrote: > >> Dear Eric and William, >> >> Why do the 1st and 2nd incantation of arima return sigma^2 as 5.233 vs >> .9999? >> The help for arima says ---> sigma2: the MLE of the innovations >> variance. >> By that account the 1st result is incorrect. I am a little confused. >> >> set.seed(123) >> b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000000,sd=1) >> >> # Variance of the innovations, e_t = 1 >> >> # Variance of b = Var(e_t)/(1-Phi^2) = 1 / (1-.81) = 5.263158 >> >> arima(b) >> >> > arima(b) >> >> Call: >> arima(x = b) >> >> Coefficients: >> intercept >> -0.0051 >> s.e. 0.0023 >> >> sigma^2 estimated as 5.233: log likelihood = -2246450, aic = 4492903 >> > >> >> >> arima(b,order= c(1,0,0)) >> >> Call: >> arima(x = b, order = c(1, 0, 0)) >> >> Coefficients: >> ar1 intercept >> 0.8994 -0.0051 >> s.e. 0.0004 0.0099 >> >> sigma^2 estimated as 0.9999: log likelihood = -1418870, aic = 2837747 >> > >> >> On Tue, Nov 13, 2018 at 11:07 PM William Dunlap <wdunlap at tibco.com> >> wrote: >> >> > Try supplying the order argument to arima. It looks like the default is >> > to estimate only the mean. >> > >> > > arima(b, order=c(1,0,0)) >> > >> > Call: >> > arima(x = b, order = c(1, 0, 0)) >> > >> > Coefficients: >> > ar1 intercept >> > 0.8871 0.2369 >> > s.e. 0.0145 0.2783 >> > >> > sigma^2 estimated as 1.002: log likelihood = -1420.82, aic = 2847.63 >> > >> > >> > Bill Dunlap >> > TIBCO Software >> > wdunlap tibco.com >> > >> > On Tue, Nov 13, 2018 at 4:02 AM, Ashim Kapoor <ashimkapoor at gmail.com> >> > wrote: >> > >> >> Dear All, >> >> >> >> Here is a reprex: >> >> >> >> set.seed(123) >> >> b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000,sd=1) >> >> arima(b) >> >> >> >> Call: >> >> arima(x = b) >> >> >> >> Coefficients: >> >> intercept >> >> 0.2250 >> >> s.e. 0.0688 >> >> >> >> sigma^2 estimated as 4.735: log likelihood = -2196.4, aic = 4396.81 >> >> > >> >> >> >> Should sigma^2 not be equal to 1 ? Where do I misunderstand ? >> >> >> >> Many thanks, >> >> Ashim >> >> >> >> [[alternative HTML version deleted]] >> >> >> >> ______________________________________________ >> >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> >> 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. >> >> >> > >> > >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> >[[alternative HTML version deleted]]