Question

In: Computer Science

Please assist with how I can solve this in R For the usgdp series: if necessary,...

Please assist with how I can solve this in R

For the usgdp series:

  1. if necessary, find a suitable Box-Cox transformation for the data;
  2. fit a suitable ARIMA model to the transformed data using auto.arima();
  3. try some other plausible models by experimenting with the orders chosen;
  4. choose what you think is the best model and check the residual diagnostics;
  5. produce forecasts of your fitted model. Do the forecasts look reasonable?
  6. compare the results with what you would obtain using ets() (with no transformation).

Solutions

Expert Solution

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

# a. if necessary, find a suitable Box-Cox transformation for the data;


autoplot(usgdp)
autoplot(BoxCox(usgdp, BoxCox.lambda(usgdp)))
# When I transformed the original data, I could get more linearly increasing line. Therefore I'm going to do Box-Cox transformation.
lambda_usgdp <- BoxCox.lambda(usgdp)


# b.fit a suitable ARIMA model to the transformed data using auto.arima();


usgdp_autoarima <- auto.arima(usgdp,
lambda = lambda_usgdp)
autoplot(usgdp, series = "Data") +
autolayer(usgdp_autoarima$fitted, series = "Fitted")
# It looked like the model fits well to the data.
usgdp_autoarima
#ARIMA(2, 1, 0) with drift model after Box-Cox transformation.


# c. try some other plausible models by experimenting with the orders chosen;


ndiffs(BoxCox(usgdp, lambda_usgdp))
# the data need 1 first differencing to be stationary.
ggtsdisplay(diff(BoxCox(usgdp, lambda_usgdp)))
# ACF plot shows sinusoidal decrease while PACF plot shows significant spikes at lag 1 and 12. I think that I can ignore the spike at lag 12 because the data are aggregated quarterly, not monthly. Therefore, I'll experiment with ARIMA(1, 1, 0) model.
usgdp_arima.1.1.0 <- Arima(
usgdp, lambda = lambda_usgdp, order = c(1, 1, 0)
)
usgdp_arima.1.1.0
autoplot(usgdp, series = "Data") +
autolayer(usgdp_arima.1.1.0$fitted, series = "Fitted")
# I'll also try ARIMA(1, 1, 0) with drift model.
usgdp_arima.1.1.0.drift <- Arima(
usgdp, lambda = lambda_usgdp, order = c(1, 1, 0),
include.drift = TRUE
)
usgdp_arima.1.1.0.drift
autoplot(usgdp, series = "Data") +
autolayer(usgdp_arima.1.1.0.drift$fitted, series = "Fitted")
# It looked like that these models also fit well to the data.


# d. choose what you think is the best model and check the residual diagnostics;


accuracy(usgdp_autoarima)
accuracy(usgdp_arima.1.1.0)
accuracy(usgdp_arima.1.1.0.drift)
# Some errors show that ARIMA(2, 1, 0) with drift is the best model while others show that ARIMA(1, 1, 0) with drift is the best. Check the residuals of both cases.
checkresiduals(usgdp_autoarima)
checkresiduals(usgdp_arima.1.1.0.drift)
# In either case, the residuals are like white noise series and are not normally distributed.
# I'll choose the best model as ARIMA(2, 1, 0) with drift model. With the model, RMSE and MASE values were lower. And there wasn't significant spike at lag 2 in ACF plot of ARIMA(2, 1, 0) with drift model, even if it exists in ARIMA(1, 1, 0) with drift model.


# e. produce forecasts of your fitted model. Do the forecasts look reasonable?


fc_usgdp_autoarima <- forecast(
usgdp_autoarima
)
autoplot(fc_usgdp_autoarima)
# It looked like the forecasts are reasonable.


# f. compare the results with what you would obtain using ets() (with no transformation).


fc_usgdp_ets <- forecast(
ets(usgdp)
)
autoplot(fc_usgdp_ets)
# It looked like these forecasts are more likely than the ones with ARIMA model. When trend is obvious, is ETS better than ARIMA model? I wonder about it.
```

Kindly revert for any queries

Thanks.


Related Solutions

How can I solve this in Excel? Please show how to solve it in excel step...
How can I solve this in Excel? Please show how to solve it in excel step by step. 1) Speedy Wheels is a wholesale distributor of bicycles for the western United States. Its Inventory Manager, Ricky Sapolo, is currently reviewing the inventory policy for one popular model — a small, one-speed girl's bicycle that is selling at the rate of 250 per month. The administrative cost for placing an order for this model from the manufacturer is $200 and the...
How can I solve this problem? Can you please show step by step how to solve...
How can I solve this problem? Can you please show step by step how to solve this? Qd = 2,000 − 10P MC = 0.1Q
Can someone please assist me with this question. The information that I found was not of...
Can someone please assist me with this question. The information that I found was not of help. Discuss how using systems thinking will influence your decision-making. I have to do a full paragraph on this question.
How do I check something is analytic. C-R is necessary but not sufficient. i was told...
How do I check something is analytic. C-R is necessary but not sufficient. i was told that I must also check if the partial derivatives are continuous. How would I do that?
***** PLEASE solve using MATHCAD, I am unsure on how to solve properly with this application....
***** PLEASE solve using MATHCAD, I am unsure on how to solve properly with this application. Thank you so much! Problem 7: Design a Silicon diode that has a breakdown voltage =20V and has a junction capacitance of 1 pF at no biasing.
Hello, I have been struggling with the problem for a while now. Can someone please assist?...
Hello, I have been struggling with the problem for a while now. Can someone please assist? I cannot find the data online much less calculate the standard deviation. 1. Go to finance.yahoo.com and find them monthly rates of return over a 2 year period for five companies of your choice. Now assume you form each month an equally weighted portfolio of five firms (a portfolio with equal investments in each firm). What is the rate of return each month on...
please, I need it with 30 minutes . can someone solve this ASAP and post ,...
please, I need it with 30 minutes . can someone solve this ASAP and post , I really appreciate. 4. "Machine A has an immediate cost of $15,000, and it will earn a net income of $4300 per year for a total of 7 years. Machine B has an immediate cost of $17,000, and it will earn a net income of $4400 per year for a total of 35 years. Assume that Machine A can continually be replaced at the...
Please explain how the Balanced Scorecard can be used to assist a company in executing its...
Please explain how the Balanced Scorecard can be used to assist a company in executing its strategy.
Please explain how the Balanced Scorecard can be used to assist a company in executing its...
Please explain how the Balanced Scorecard can be used to assist a company in executing its strategy.
How can interactive reporting assist organizations in decision making? please provide reference
How can interactive reporting assist organizations in decision making? please provide reference
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT