Darts - How to get Nbeats seasonal and trend forecasts separately - u8darts

How can I get partial forecasts of the trend and the seasonality in the interpretable mode of NBEATS in DARTS?
Thank you!

Related

How to fit Holt Winters predictions to the original data?

The original time series isn't stationary, it has trend and seasonality.
I prepared my dataset removing autocorrelation, trend and seasonality in order to have a stationary series and I made the predictions with Holt-Winters method.
How can I apply trend and seasonality to HW predictions?
Just to clarify my doubts: last demand data is around 3000 (with trend and seasonality), with HW I have a prediction around 0, how can I come back to real data to understand the "real" demand prediction?
I'm using R-Studio, do you have any specific function to suggest?
Thank you in advance

Can arima() or sarima() be used for additive seasonal data?

I have searched about arima() and sarima() function and found out that those functions work for multiplicative seasonal data. My data has additive seasonality, is there any function that would work for additive seasonal data?
I'm looking for your help, thank you!

Problem with creating stationarity in a time series

I have a problem with my code. I want to forecast stock returns with an ARIMA model in R but I can not get my data stationary. Besides transforming the stock prices into returns, I also tried the diff function for differencing my time-series. I always assumed that data becomes stationary by using one of the 2 methods. However, when I run an augmented dickey fuller test (adf.test in R) my p-value shows me that the data remains non-stationary. What am I doing wrong?
enter image description here
Thanks in advance.
You must perform time series decomposition into data, seasonal, trend and residuals:
library('forecast')
library('tseries')
data$moving_average=ma(data$original, order=7)
moving_average = ts(na.omit(data$moving_average), frequency=30)
decomposition = stl(moving_average, s.window="periodic")
stationary <- seasadj(decomposition)
plot(decomposition)
You will get:

Forecast in R - Period (h) doesn't change when using external regressors

I'm trying to change the number of forecasted period using auto.arima model with regressors. Let's denote X as my variable that comes from my auto.arima model and Xreg my regressors.
When I'm using these commands to get my predicted values: forecast(X, xreg = Xreg, h=50) or the command forecast(X, xreg = Xreg, h=200), there is no difference when I'm plotting the results in the forecasted period (I would expect 50 forecasted points from first command and 200 from the second).
However, when I remove the xreg arguments from both my auto.arima model and my forecast command, it works. I'm plotting forecast(X, h=50) and I have 50 forecasted points and then I plot forecast(X, h=200) and I have 200 forecasted points.
I'm just wondering if it's something that is working as intended or if I missed somethings.
Thanks.

Avoiding seasonality assumption for stl() or decompose() in R

I have high frequency commodity price data that I need to analyze. My objective is to not assume any seasonal component and just identify a trend. Here is where I run into problems with R. There are two main functions that I know of to analyze this time series: decompose() and stl(). The problem is that they both take a ts object type with a frequency parameter greater than or equal to 2. Is there some way I can assume a frequency of 1 per unit time and still analyze this time series using R? I'm afraid that if I assume frequency greater than 1 per unit time, and seasonality is calculated using the frequency parameter, then my forecasts are going to depend on that assumption.
names(crude.data)=c('Date','Time','Price')
names(crude.data)
freq = 2
win.graph()
plot(crude.data$Time,crude.data$Price, type="l")
crude.data$Price = ts(crude.data$Price,frequency=freq)
I want frequency to be 1 per unit time but then decompose() and stl() don't work!
dim(crude.data$Price)
decom = decompose(crude.data$Price)
win.graph()
plot(decom$random[2:200],type="line")
acf(decom$random[freq:length(decom$random-freq)])
Thank you.
Both stl() and decompose() are for seasonal decomposition, so you must have a seasonal component. If you just want to estimate a trend, then any nonparametric smoothing method will do the job. For example:
fit <- loess(crude.data$Price ~ crude.data$Time)
plot(cbind(observed=crude.data$Price,trend=fit$fitted,random=fit$residuals),main="")

Resources