robjhyndman.com | Source files for robjhyndman.com | Theme library
kandi X-RAY | robjhyndman.com Summary
kandi X-RAY | robjhyndman.com Summary
Source files for robjhyndman.com
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of robjhyndman.com
robjhyndman.com Key Features
robjhyndman.com Examples and Code Snippets
Community Discussions
Trending Discussions on robjhyndman.com
QUESTION
I am using the book Forecasting: Methods and Applications by Makridakis, Wheelwright and Hyndman. I want to do the exercises along the way, but in Python, not R (as suggested in the book).
I do not know how to use R. I know that the datasets can be availed from an R package - fma
. This is the link to the package.
Is there a possible script, in R or Python, which will allow me to download the datasets as .csv
files? That way, I will be able to access them using Python.
ANSWER
Answered 2022-Apr-09 at 18:48one possibility:
QUESTION
Say I have an excel file with format like this (to download from this link):
Note the first column is year and the first row is month.
I try to convert it to time series object then draw a seasonal plot using ggseasonplot
or ggplot2
.
ANSWER
Answered 2022-Mar-25 at 08:44If it is a continuous time series, then you can drop the month
column and put all years into one column (and also remove the year after using melt
). Then, you can just specify your start year and month.
QUESTION
I use forecast
package in R.
Hyndman says:
The arima()
function in R (and Arima()
and auto.arima()
from the forecast
package) fits a regression with ARIMA errors.
I have an output for auto.arima()
ANSWER
Answered 2022-Mar-01 at 03:36Name the columns of the matrix to whatever you like.
QUESTION
I have the below time series for weekly fish caught in a specific location (period=52 for weekly data) and only 55 datapoints
...ANSWER
Answered 2021-Nov-01 at 23:14Your code works for me using v8.15 of the forecast
package. So perhaps you are using an old version of package -- there were some issues with matching regression variable names a few versions ago.
In any case, the model makes no sense. You have 55 observations, yet your model has 53 degrees of freedom. Perhaps you are misunderstanding the AIC values. They are on a scale from -∞ to ∞, and you want the one closest to -∞, not the one closest to zero. I would expect a value of K less than 5 with so few observations.
QUESTION
I am trying to forecast a time series in Python by using auto_arima and adding Fourier terms as exogenous features. The data come from kaggle's Store item demand forecasting challenge. It consists of a long format time series for 10 stores and 50 items resulting in 500 time series stacked on top of each other. The specificity of this time series is that it has daily data with weekly and annual seasonalities.
In order to capture these two levels of seasonality I first used TBATS as recommended by Rob J Hyndman in Forecasting with daily data which worked pretty well actually.
I also followed this medium article posted by the creator of TBATS python library who compared it with SARIMAX + Fourier terms (also recommended by Hyndman).
But now, when I tried to use the second approach with pmdarima's auto_arima and Fourier terms as exogenous features, I get unexpected results.
In the following code, I only used the train.csv file that I split into train and test data (last year used for forecasting) and set the maximum order of Fourier terms K = 2.
My problem is that I obtain a smoothed forecast (see Image below) that do not seem to capture the weekly seasonality which is different from the result at the end of this article. Is there something wrong with my code ?
Complete code :
...ANSWER
Answered 2021-Aug-27 at 16:02Here's the answer in case someone's interested. Thanks again Flavia Giammarino.
QUESTION
Here is my code:
...ANSWER
Answered 2020-Sep-10 at 21:00It is working fine with fableTools
‘0.2.1’
and fpp3
0.3
QUESTION
Here is my code:
...ANSWER
Answered 2020-Sep-10 at 20:23Here we, need as_tsibble
instead of as_tibble
. According to ?model
.data - A data structure suitable for the models (such as a tsibble)
QUESTION
I have to create demogdata object based on my data. ‘Fert’ and ‘Mort’ objects – rates, exposure – are all clear. But concerning the ‘Pop’ object. I understand it must be population as of Jan 01, not exposure (actually I checked it by comparing raw data from HMD txt files and Hyndman’s original ‘pop2010’ object). But what an argument must I put instead of ‘rates’?
What I have tried:
1. put an argument ‘skip’:
dnipop <- read.demogdata(file=skip, "pop.txt", )
It’s does not work.
2. put the same data as pop (sort of dummy variable):
dnipop <- read.demogdata("pop.txt", "pop.txt", )
Actually, it’s work seamlessly. I managed even to walk through to the completed forecast. But still, I’m curious how to do it correct, without 'rates' element.
Example you can find here
enter link description here
I other words, Hyndman's object has structure:
ANSWER
Answered 2020-Apr-18 at 08:59We can remove the "rate"
list by name using !=
operator.
QUESTION
stR package is based on Hyndman and Dokumentov 2015 and contains an STR()
function to which you may provide a description of topology of the seasonality you deal with, which is defined by a list of segments and a list of seasonal knots for each predictor you use (including trend). You may also provide a list of time knots. There is a vignette that is supposed to explain everything via examples, but neither the vignette nor the paper explains what these knots (time and seasonal) and segments are, and I failed to deduce that from the vignette, even though it's quite extensive. So, what are these things? What would they be for a simple model with, say, daily data and only trend + weekday/weekend seasonality?
Full disclosure - I haven't looked at the source code yet, but I doubt it would make things more clear for me.
ANSWER
Answered 2020-Apr-08 at 22:21We use piecewise linear regression splines. The trend knots are where the trend changes direction. A seasonal knot is where the seasonal component changes direction. The segments are the linear pieces.
The package uses an automated algorithm for selecting the fitted functions. So using the defaults (not specifying any knots or segments) should give you a good fit.
QUESTION
I am trying to use ETS
function from fable
package (following this tutorial link). Ideally I would like to do it without using tsibble
functionality. In particular I am trying to generate forecast:
ANSWER
Answered 2020-Feb-19 at 06:02You need to use tsibbles
, but it is very easy to do so.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install robjhyndman.com
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page