Is there a way to compare ARIMA models across different variables? I noticed you had 5 variables in your dataframe but when you create the time series object you only select one of the columns. I have hourly temperature data I would like to compare across sites. Is ARIMA still the right way to go?
Thanks for tthis lecture, i kindly want to ask, is there are larger part of this dataset, i want to explore more approaches from all your lecture series..... i mean like, where cam i get the original dataset
You’re welcome! The full dataset is available here: zenodo.org/doi/10.5281/zenodo.1215988 There is a R package designed to make it easy to download and get the pieces of the data you want in useful formats as well: weecology.github.io/portalr/ Let us know if there is anything else we can do to help as you explore the data. You are welcome to email us at portal@weecology.org
Hi Is there any chance you can check my assignment report on Forecasting in Business and Economics on time Series and analysis. Just corrections and see if it meets the objectives of the report. Thanks
You're welcome! Glad it helped! I don't work with the dygraph package frequently, but here's the basic idea based on my understanding. dygraph takes a group of time-series as input. In this case if you want to plot the predictions (like shown in the Predicted Lunch Deaths example on rstudio.github.io/dygraphs/) then we just need to get them in the right format. To make this simpler let's work with a version of the seasonal Arima that only has 1 set of prediction intervals: # rerun the forecast with just a single prediction internal seasonal_arima_forecast = seasonal_arima_model, h = 36, level = 80) # store the data as a group of time-series forecasts_for_dygraph = cbind(lower = seasonal_arima_forecast$lower, mean = seaonal_arima_forecast$mean, upper = seasonal_arima_forecast$upper) # make a dygraph following the instructions in the example dygraph(forecasts_for_dygraph) %>% dySeries(c("lower", "mean", "upper") Hope that helps!
Thanks! It depends a bit on what kind of model you're interested in using. Both the ARIMA based models illustrated here and the exponential smoothing models in forecast will take an xreg argument for drivers that will be modeled linearly. If you want to build what I'd call a time-series linear model then that's available in the next generation package that is slated to replace forecast, fable (fable.tidyverts.org/reference/TSLM.html). Fable also lets you do the same things with ARIMA & ETS as forecast (as well as some more complex approaches), so it probably has what you need fable.tidyverts.org/index.html
Is it possible to make rstudio produce a table vs a plot graph to display the forecasted numbers? If I want to forecast 2023 sales, how can I see the values arima is producing in the plot graph?
Definitely. The data for the point forecast is stored in the $mean object, which you can access using your_forecast$mean. The video shows how to extract this information at around 11 minutes. You can also extract the upper and lower prediction intervals using $upper and $lower as shown in ua-cam.com/video/hGlnIVYFUgg/v-deo.html.
NDVI is a remotely sensed measure of greenness that captures how much vegetation there is. See en.wikipedia.org/wiki/Normalized_difference_vegetation_index
@@ChifundoBita You're welcome! If you're interested in this stuff we have significantly expanded written tutorials using the newer fable R package. Here's the key lessons: * course.naturecast.org/lessons/r-time-series-modeling/ * course.naturecast.org/lessons/r-time-series-modeling-2/ * course.naturecast.org/lessons/r-time-series-modeling-3/
It depends on how the data is structure in the .txt file. If it's comma delimited you can do it the exact same way. If there is a different delimiter the you specify that delimiter using the optional `sep` argument in `read.csv`
Thanks! The (0, 0, 0) there is setting the model parameters/structure. Since they are all zeros (no autoregressive component, no integration, no moving average component) the model then just becomes the mean value with normally distributed error. So we're just starting with the simplest model possible. If you're interested in learning more about what those three components of ARIMA models are checkout these two videos: * ua-cam.com/video/hD13nv8SK6A/v-deo.html * ua-cam.com/video/6gmCNGRrRBs/v-deo.html
@weecology gives a nice answer, but to illustrate, even further suppose you use ARIMA(p,0,q) (i.e. there are no differencing parameters), which is basically an ARMA(p,q): the theoretical formula of ARMA(p,q,) is: yt = constant + sum of p lags of past y values + sum of q lags of past error terms When p = q = 0, yt = constant (i.e. your average)
Source code for this lesson is available in the text version of the tutorial here: course.naturecast.org/lessons/r-intro-to-forecasting/r_tutorial/, but note that it's been updated to use the newer fable package. The text version of this tutorial is available in our GitHub history here: github.com/weecology/forecasting-course/blob/2e7be6bc4f0aeb265ab55836cdf535f4a863d6c9/content/lessons/R-intro-to-forecasting/r_tutorial.md In general you can find text versions of all tutorials at course.naturecast.org/
@@researchmadeeasybydr.tanvi7663 OK, thanks. If we look at the model description is it ARIMA(0, 1, ). Assuming that you fit this with `auto.arima()`, this tells us that model that the best fitting model has no autoregressive component (the first zero), a first order difference (the 1 in the middle), and no moving average component (the last zero). This means that there is a trend, but once it is accounted for there is no meaningful autocorrelation in the time-series. As a result, your forecast is a directional trend with no wiggles in it. Does that help?
Well done! Very good explanation of time series.
Thanks!
Is there a way to compare ARIMA models across different variables? I noticed you had 5 variables in your dataframe but when you create the time series object you only select one of the columns. I have hourly temperature data I would like to compare across sites. Is ARIMA still the right way to go?
Thanks for tthis lecture, i kindly want to ask, is there are larger part of this dataset, i want to explore more approaches from all your lecture series..... i mean like, where cam i get the original dataset
You’re welcome!
The full dataset is available here: zenodo.org/doi/10.5281/zenodo.1215988
There is a R package designed to make it easy to download and get the pieces of the data you want in useful formats as well: weecology.github.io/portalr/
Let us know if there is anything else we can do to help as you explore the data. You are welcome to email us at portal@weecology.org
Hi
Is there any chance you can check my assignment report on Forecasting in Business and Economics on time Series and analysis.
Just corrections and see if it meets the objectives of the report. Thanks
Hi @weecology thankyou for your excellent explanation of time series this save me for my defense. btw how can i put dygraph for that.
You're welcome! Glad it helped! I don't work with the dygraph package frequently, but here's the basic idea based on my understanding. dygraph takes a group of time-series as input. In this case if you want to plot the predictions (like shown in the Predicted Lunch Deaths example on rstudio.github.io/dygraphs/) then we just need to get them in the right format. To make this simpler let's work with a version of the seasonal Arima that only has 1 set of prediction intervals:
# rerun the forecast with just a single prediction internal
seasonal_arima_forecast = seasonal_arima_model, h = 36, level = 80)
# store the data as a group of time-series
forecasts_for_dygraph = cbind(lower = seasonal_arima_forecast$lower, mean = seaonal_arima_forecast$mean, upper = seasonal_arima_forecast$upper)
# make a dygraph following the instructions in the example
dygraph(forecasts_for_dygraph) %>% dySeries(c("lower", "mean", "upper")
Hope that helps!
Really nice video! I am trying to to a forecast useing times series regression is this posiable to do useing the forecast package?
Thanks! It depends a bit on what kind of model you're interested in using. Both the ARIMA based models illustrated here and the exponential smoothing models in forecast will take an xreg argument for drivers that will be modeled linearly. If you want to build what I'd call a time-series linear model then that's available in the next generation package that is slated to replace forecast, fable (fable.tidyverts.org/reference/TSLM.html). Fable also lets you do the same things with ARIMA & ETS as forecast (as well as some more complex approaches), so it probably has what you need fable.tidyverts.org/index.html
@@weecology wow thank you for your help. You should make a video on that pack too
Is it possible to make rstudio produce a table vs a plot graph to display the forecasted numbers?
If I want to forecast 2023 sales, how can I see the values arima is producing in the plot graph?
Definitely. The data for the point forecast is stored in the $mean object, which you can access using your_forecast$mean. The video shows how to extract this information at around 11 minutes. You can also extract the upper and lower prediction intervals using $upper and $lower as shown in ua-cam.com/video/hGlnIVYFUgg/v-deo.html.
what are basic temporal statistical summaries in time series?
Hi, sorry, what is NDVI? I have sales and I can see correlations at 1 month as well as at 5th, and annual.
NDVI is a remotely sensed measure of greenness that captures how much vegetation there is. See en.wikipedia.org/wiki/Normalized_difference_vegetation_index
Where can i get the dataset you have used. i want to practice while following the video. Thanks@@weecology
@@ChifundoBita It's posted here course.naturecast.org/data/portal_timeseries.csv. I'll also add a link to the description
@@weecology Thanks alot
@@ChifundoBita You're welcome! If you're interested in this stuff we have significantly expanded written tutorials using the newer fable R package. Here's the key lessons:
* course.naturecast.org/lessons/r-time-series-modeling/
* course.naturecast.org/lessons/r-time-series-modeling-2/
* course.naturecast.org/lessons/r-time-series-modeling-3/
what if i want r studio to read data from a .txt file?
It depends on how the data is structure in the .txt file. If it's comma delimited you can do it the exact same way. If there is a different delimiter the you specify that delimiter using the optional `sep` argument in `read.csv`
Why are the argument (0, 0, 0) for the Arima function? great vid btw, subscribed
Thanks! The (0, 0, 0) there is setting the model parameters/structure. Since they are all zeros (no autoregressive component, no integration, no moving average component) the model then just becomes the mean value with normally distributed error. So we're just starting with the simplest model possible. If you're interested in learning more about what those three components of ARIMA models are checkout these two videos:
* ua-cam.com/video/hD13nv8SK6A/v-deo.html
* ua-cam.com/video/6gmCNGRrRBs/v-deo.html
@@weecology Thank you!!
@weecology gives a nice answer, but to illustrate, even further suppose you use ARIMA(p,0,q) (i.e. there are no differencing parameters), which is basically an ARMA(p,q):
the theoretical formula of ARMA(p,q,) is:
yt = constant + sum of p lags of past y values + sum of q lags of past error terms
When p = q = 0,
yt = constant (i.e. your average)
can i have the source code please ?
Source code for this lesson is available in the text version of the tutorial here: course.naturecast.org/lessons/r-intro-to-forecasting/r_tutorial/, but note that it's been updated to use the newer fable package. The text version of this tutorial is available in our GitHub history here: github.com/weecology/forecasting-course/blob/2e7be6bc4f0aeb265ab55836cdf535f4a863d6c9/content/lessons/R-intro-to-forecasting/r_tutorial.md
In general you can find text versions of all tutorials at course.naturecast.org/
@@weecology thanks for the immediate response !
@@ΓιάννηςΑθανασιάδης-ε8δ you're welcome!
Hi, my forecast plot looks like a straight line. Can you provide me with an explanation? Great video btw
Thanks! For which model?
ARIMA @@weecology
@@researchmadeeasybydr.tanvi7663 Is this with the data in the video or your own data? If you run the name of your model what is the output?
thank you for reply. own data.
Series: cefta_afro_res
ARIMA(0,1,0)
sigma^2 = 110.1: log likelihood = -37.7
AIC=77.4 AICc=77.9 BIC=77.7@@weecology
@@researchmadeeasybydr.tanvi7663 OK, thanks. If we look at the model description is it ARIMA(0, 1, ). Assuming that you fit this with `auto.arima()`, this tells us that model that the best fitting model has no autoregressive component (the first zero), a first order difference (the 1 in the middle), and no moving average component (the last zero). This means that there is a trend, but once it is accounted for there is no meaningful autocorrelation in the time-series. As a result, your forecast is a directional trend with no wiggles in it. Does that help?
Which is the next video please?
thanks
You’re welcome!