Skip to main content
added 1529 characters in body
Source Link
user135784
  • 286
  • 1
  • 3
  • 11

Edit: data stored in DAP is domestic passenger data (Jan 2003 - May 2014) from 1: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1Example

Edit 2: Data

dput(DAP) structure(c(43032450L, 41166780L, 49992700L, 47033260L, 49152352L, 52209516L, 55810773L, 53920973L, 44213408L, 49944935L, 47059495L, 49757124L, 43815481L, 45306644L, 54147227L, 53253194L, 53030873L, 56959142L, 59614287L, 57380873L, 47671785L, 54167489L, 51782564L, 52640057L, 47977657L, 47074882L, 58838975L, 54908859L, 57323876L, 59724061L, 62396446L, 59110633L, 50600325L, 53738093L, 52766404L, 52801276L, 48886043L, 47348142L, 58286011L, 55828555L, 57145193L, 59297121L, 60838606L, 58303233L, 49949551L, 55088986L, 53852209L, 53538970L, 50022168L, 47766421L, 59244232L, 57398267L, 59285571L, 61493934L, 63457403L, 62660179L, 52310402L, 57208618L, 55047116L, 53291139L, 50245100L, 50118363L, 59213077L, 55611053L, 58047400L, 59559171L, 61401480L, 58966473L, 47680101L, 52956023L, 47658141L, 50253800L, 44825056L, 43680328L, 53534891L, 52247781L, 52951246L, 55898027L, 59468957L, 56568180L, 48235025L, 52279405L, 48584832L, 49793527L, 45501620L, 42440614L, 54424077L, 52498074L, 53842422L, 56689853L, 59142493L, 57370748L, 50304708L, 54826050L, 51420519L, 51076415L, 46305000L, 43657818L, 55649428L, 52858479L, 55982234L, 57778699L, 60310568L, 57403835L, 50982170L, 54124363L, 51660083L, 51534990L, 47080840L, 46405385L, 56200391L, 53691570L, 55749349L, 57903293L, 59688267L, 58646304L, 50134504L, 53779646L, 51844482L, 51165451L, 47814031L, 45736763L, 56564538L, 53226735L, 56557964L, 57986530L, 59306473L, 58110953L, 50761250L, 54682312L, 50538227L, 54329096L, 47941907L, 45486064L, 57729464L, 54821717L, 57145762L ), .Tsp = c(2003, 2014.33333333333, 12), class = "ts")

Edit: data stored in DAP is domestic passenger data (Jan 2003 - May 2014) from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1

Edit 1: Example

Edit 2: Data

dput(DAP) structure(c(43032450L, 41166780L, 49992700L, 47033260L, 49152352L, 52209516L, 55810773L, 53920973L, 44213408L, 49944935L, 47059495L, 49757124L, 43815481L, 45306644L, 54147227L, 53253194L, 53030873L, 56959142L, 59614287L, 57380873L, 47671785L, 54167489L, 51782564L, 52640057L, 47977657L, 47074882L, 58838975L, 54908859L, 57323876L, 59724061L, 62396446L, 59110633L, 50600325L, 53738093L, 52766404L, 52801276L, 48886043L, 47348142L, 58286011L, 55828555L, 57145193L, 59297121L, 60838606L, 58303233L, 49949551L, 55088986L, 53852209L, 53538970L, 50022168L, 47766421L, 59244232L, 57398267L, 59285571L, 61493934L, 63457403L, 62660179L, 52310402L, 57208618L, 55047116L, 53291139L, 50245100L, 50118363L, 59213077L, 55611053L, 58047400L, 59559171L, 61401480L, 58966473L, 47680101L, 52956023L, 47658141L, 50253800L, 44825056L, 43680328L, 53534891L, 52247781L, 52951246L, 55898027L, 59468957L, 56568180L, 48235025L, 52279405L, 48584832L, 49793527L, 45501620L, 42440614L, 54424077L, 52498074L, 53842422L, 56689853L, 59142493L, 57370748L, 50304708L, 54826050L, 51420519L, 51076415L, 46305000L, 43657818L, 55649428L, 52858479L, 55982234L, 57778699L, 60310568L, 57403835L, 50982170L, 54124363L, 51660083L, 51534990L, 47080840L, 46405385L, 56200391L, 53691570L, 55749349L, 57903293L, 59688267L, 58646304L, 50134504L, 53779646L, 51844482L, 51165451L, 47814031L, 45736763L, 56564538L, 53226735L, 56557964L, 57986530L, 59306473L, 58110953L, 50761250L, 54682312L, 50538227L, 54329096L, 47941907L, 45486064L, 57729464L, 54821717L, 57145762L ), .Tsp = c(2003, 2014.33333333333, 12), class = "ts")

added 14 characters in body
Source Link
user135784
  • 286
  • 1
  • 3
  • 11

I have been using the forecast package in R to make forecasts based on an ARIMA model and have noticed a difference in the output of the forecast and simulate functions when calculating confidence intervals.

For example the 95% quantile calculated by the forecast function is about 0.5% higher than that based on 10000 applications of the simulate() function. Also the mean of the simulated values and the point forecasts provided by the forecast functions are slightly different.

Which one of the functions will do the job better? Or are the differences too small to worry about? (The only reason I decided to try simulate was so that a distribution could be fitted to the simulated data).

Edit: data stored in DAP is domestic passenger data (Jan 2003 - May 2014) from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1

library(forecast)

#Fit arima model to data
dm1 = arima(DAP, order = c(1,1,0), method = "ML", seasonal = list(order = c(0,1,1)))    

#Simulate 10000 times
n.mnths = 7
    n.sim = 10000
    domesticsimulator = function(i){
      simulate(dm1, nsim = n.mnths)
    }

sim.d <- sapply(1:n.sim, function(x)domesticsimulator(x))
distr.d.mat<-t(sim.d); distr.d.mat
distr.d<-data.frame(Jun = distr.d.mat[,1],Jul = distr.d.mat[,2], Aug = distr.d.mat[,3], Sep = distr.d.mat[,4], Oct = distr.d.mat[,5], Nov = distr.d.mat[,6], Dec = distr.d.mat[,7]); distr.d 

#Compare to forecast
forecast(dm1)

I have been using the forecast package in R to make forecasts based on an ARIMA model and have noticed a difference in the output of the forecast and simulate functions when calculating confidence intervals.

For example the 95% quantile calculated by the forecast function is about 0.5% higher than that based on 10000 applications of the simulate() function. Also the mean of the simulated values and the point forecasts provided by the forecast functions are slightly different.

Which one of the functions will do the job better? Or are the differences too small to worry about? (The only reason I decided to try simulate was so that a distribution could be fitted to the simulated data).

Edit: data is domestic passenger data (Jan 2003 - May 2014) from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1

library(forecast)
dm1 = arima(DAP, order = c(1,1,0), method = "ML", seasonal = list(order = c(0,1,1)))   
n.mnths = 7
    n.sim = 10000
    domesticsimulator = function(i){
      simulate(dm1, nsim = n.mnths)
    }

sim.d <- sapply(1:n.sim, function(x)domesticsimulator(x))
distr.d.mat<-t(sim.d); distr.d.mat
distr.d<-data.frame(Jun = distr.d.mat[,1],Jul = distr.d.mat[,2], Aug = distr.d.mat[,3], Sep = distr.d.mat[,4], Oct = distr.d.mat[,5], Nov = distr.d.mat[,6], Dec = distr.d.mat[,7]); distr.d

forecast(dm1)

I have been using the forecast package in R to make forecasts based on an ARIMA model and have noticed a difference in the output of the forecast and simulate functions when calculating confidence intervals.

For example the 95% quantile calculated by the forecast function is about 0.5% higher than that based on 10000 applications of the simulate() function. Also the mean of the simulated values and the point forecasts provided by the forecast functions are slightly different.

Which one of the functions will do the job better? Or are the differences too small to worry about? (The only reason I decided to try simulate was so that a distribution could be fitted to the simulated data).

Edit: data stored in DAP is domestic passenger data (Jan 2003 - May 2014) from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1

library(forecast)

#Fit arima model to data
dm1 = arima(DAP, order = c(1,1,0), method = "ML", seasonal = list(order = c(0,1,1)))    

#Simulate 10000 times
n.mnths = 7
    n.sim = 10000
    domesticsimulator = function(i){
      simulate(dm1, nsim = n.mnths)
    }

sim.d <- sapply(1:n.sim, function(x)domesticsimulator(x))
distr.d.mat<-t(sim.d); distr.d.mat
distr.d<-data.frame(Jun = distr.d.mat[,1],Jul = distr.d.mat[,2], Aug = distr.d.mat[,3], Sep = distr.d.mat[,4], Oct = distr.d.mat[,5], Nov = distr.d.mat[,6], Dec = distr.d.mat[,7]); distr.d 

#Compare to forecast
forecast(dm1)
added 671 characters in body
Source Link
user135784
  • 286
  • 1
  • 3
  • 11

I have been using the forecast package in R to make forecasts based on an ARIMA model and have noticed a difference in the output of the forecast and simulate functions when calculating confidence intervals.

For example the 95% quantile calculated by the forecast function is about 0.5% higher than that based on 10000 applications of the simulate() function. Also the mean of the simulated values and the point forecasts provided by the forecast functions are slightly different.

Which one of the functions will do the job better? Or are the differences too small to worry about? (The only reason I decided to try simulate was so that a distribution could be fitted to the simulated data).

Edit: data is domestic passenger data (Jan 2003 - May 2014) from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1

library(forecast)
dm1 = arima(DAP, order = c(1,1,0), method = "ML", seasonal = list(order = c(0,1,1)))   
n.mnths = 7
    n.sim = 10000
    domesticsimulator = function(i){
      simulate(dm1, nsim = n.mnths)
    }

sim.d <- sapply(1:n.sim, function(x)domesticsimulator(x))
distr.d.mat<-t(sim.d); distr.d.mat
distr.d<-data.frame(Jun = distr.d.mat[,1],Jul = distr.d.mat[,2], Aug = distr.d.mat[,3], Sep = distr.d.mat[,4], Oct = distr.d.mat[,5], Nov = distr.d.mat[,6], Dec = distr.d.mat[,7]); distr.d

forecast(dm1)

I have been using the forecast package in R to make forecasts based on an ARIMA model and have noticed a difference in the output of the forecast and simulate functions when calculating confidence intervals.

For example the 95% quantile calculated by the forecast function is about 0.5% higher than that based on 10000 applications of the simulate() function. Also the mean of the simulated values and the point forecasts provided by the forecast functions are slightly different.

Which one of the functions will do the job better? Or are the differences too small to worry about? (The only reason I decided to try simulate was so that a distribution could be fitted to the simulated data)

I have been using the forecast package in R to make forecasts based on an ARIMA model and have noticed a difference in the output of the forecast and simulate functions when calculating confidence intervals.

For example the 95% quantile calculated by the forecast function is about 0.5% higher than that based on 10000 applications of the simulate() function. Also the mean of the simulated values and the point forecasts provided by the forecast functions are slightly different.

Which one of the functions will do the job better? Or are the differences too small to worry about? (The only reason I decided to try simulate was so that a distribution could be fitted to the simulated data).

Edit: data is domestic passenger data (Jan 2003 - May 2014) from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=1

library(forecast)
dm1 = arima(DAP, order = c(1,1,0), method = "ML", seasonal = list(order = c(0,1,1)))   
n.mnths = 7
    n.sim = 10000
    domesticsimulator = function(i){
      simulate(dm1, nsim = n.mnths)
    }

sim.d <- sapply(1:n.sim, function(x)domesticsimulator(x))
distr.d.mat<-t(sim.d); distr.d.mat
distr.d<-data.frame(Jun = distr.d.mat[,1],Jul = distr.d.mat[,2], Aug = distr.d.mat[,3], Sep = distr.d.mat[,4], Oct = distr.d.mat[,5], Nov = distr.d.mat[,6], Dec = distr.d.mat[,7]); distr.d

forecast(dm1)
Source Link
user135784
  • 286
  • 1
  • 3
  • 11
Loading