
Generate TimeGPT forecast
timegpt_forecast.Rd
Generate TimeGPT forecast
Usage
timegpt_forecast(
df,
h = 8,
freq = NULL,
id_col = NULL,
time_col = "ds",
target_col = "y",
X_df = NULL,
level = NULL,
finetune_steps = 0,
clean_ex_first = TRUE,
add_history = FALSE,
model = "timegpt-1"
)
Arguments
- df
A tsibble or a data frame with time series data.
- h
Forecast horizon.
- freq
Frequency of the data.
- id_col
Column that identifies each series.
- time_col
Column that identifies each timestep.
- target_col
Column that contains the target variable.
- X_df
A tsibble or a data frame with future exogenous variables.
- level
The confidence levels (0-100) for the prediction intervals.
- finetune_steps
Number of steps used to finetune TimeGPT in the new data.
- clean_ex_first
Clean exogenous signal before making the forecasts using TimeGPT.
- add_history
Return fitted values of the model.
- model
Model to use, either "timegpt-1" or "timegpt-1-long-horizon". Use "timegpt-1-long-horizon" if you want to forecast more than one seasonal period given the frequency of the data.
Examples
if (FALSE) {
nixtlar::nixtla_set_token("YOUR_TOKEN")
df <- nixtlar::electricity
fcst <- nixtlar::timegpt_forecast(df, h=8, id_col="unique_id", level=c(80,95))
}