diff --git a/404.html b/404.html index a9404a0..be60e8c 100644 --- a/404.html +++ b/404.html @@ -56,6 +56,8 @@ + + diff --git a/LICENSE.html b/LICENSE.html index 64a9675..f511c48 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -34,6 +34,8 @@ + + diff --git a/articles/anomaly-detection.html b/articles/anomaly-detection.html index 08542b4..24a78bf 100644 --- a/articles/anomaly-detection.html +++ b/articles/anomaly-detection.html @@ -58,6 +58,8 @@ + + diff --git a/articles/cross-validation.html b/articles/cross-validation.html index 4b8087b..2902815 100644 --- a/articles/cross-validation.html +++ b/articles/cross-validation.html @@ -58,6 +58,8 @@ + + diff --git a/articles/exogenous-variables.html b/articles/exogenous-variables.html new file mode 100644 index 0000000..1b61e11 --- /dev/null +++ b/articles/exogenous-variables.html @@ -0,0 +1,247 @@ + + + + + + + + +Exogenous Variables • nixtlar + + + + + + + + + + + + + + + + + Skip to contents + + +
+ + + + +
+
+ + + + +
+

1. Exogenous variables +

+

Exogenous variables are external factors that provide additional +information about the behavior of the target variable in time series +forecasting. These variables, which are correlated with the target, can +significantly improve predictions. Examples of exogenous variables +include weather data, economic indicators, holiday markers, and +promotional sales.

+

TimeGPT allows you to include exogenous variables when +generating a forecast. This vignette will show you how to include them. +It assumes you have already set up your API key. If you haven’t done +this, please read the Get +Started vignette first.

+
+
+

2. Load data +

+

For this vignette, we will use the electricity consumption dataset +with exogenous variables included in nixtlar. This dataset +contains hourly prices from five different electricity markets, along +with two exogenous variables related to the prices and binary variables +indicating the day of the week.

+
+df_exo_vars <- nixtlar::electricity_exo_vars
+head(df_exo_vars)
+#>   unique_id                  ds     y Exogenous1 Exogenous2 day_0 day_1 day_2
+#> 1        BE 2016-10-22 00:00:00 70.00      49593      57253     0     0     0
+#> 2        BE 2016-10-22 01:00:00 37.10      46073      51887     0     0     0
+#> 3        BE 2016-10-22 02:00:00 37.10      44927      51896     0     0     0
+#> 4        BE 2016-10-22 03:00:00 44.75      44483      48428     0     0     0
+#> 5        BE 2016-10-22 04:00:00 37.10      44338      46721     0     0     0
+#> 6        BE 2016-10-22 05:00:00 35.61      44504      46303     0     0     0
+#>   day_3 day_4 day_5 day_6
+#> 1     0     0     1     0
+#> 2     0     0     1     0
+#> 3     0     0     1     0
+#> 4     0     0     1     0
+#> 5     0     0     1     0
+#> 6     0     0     1     0
+

When using exogenous variables, you must provide their future values +to cover the complete forecast horizon; otherwise, TimeGPT +will result in an error. Ensure that the dates of the future exogenous +variables exactly match the forecast horizon. For the electricity +consumption dataset with exogenous variables, nixtlar +provides their values for the next 24 steps ahead.

+
+future_exo_vars <- nixtlar::electricity_future_exo_vars
+head(future_exo_vars)
+#>   unique_id                  ds Exogenous1 Exogenous2 day_0 day_1 day_2 day_3
+#> 1        BE 2016-12-31 00:00:00      64108      70318     0     0     0     0
+#> 2        BE 2016-12-31 01:00:00      62492      67898     0     0     0     0
+#> 3        BE 2016-12-31 02:00:00      61571      68379     0     0     0     0
+#> 4        BE 2016-12-31 03:00:00      60381      64972     0     0     0     0
+#> 5        BE 2016-12-31 04:00:00      60298      62900     0     0     0     0
+#> 6        BE 2016-12-31 05:00:00      60339      62364     0     0     0     0
+#>   day_4 day_5 day_6
+#> 1     0     1     0
+#> 2     0     1     0
+#> 3     0     1     0
+#> 4     0     1     0
+#> 5     0     1     0
+#> 6     0     1     0
+
+
+

3. Forecast with exogenous variables +

+

To generate a forecast with exogenous variables, use the +nixtla_client_forecast function as you would for forecasts +without them. The only difference is that you must add the exogenous +variables using the X_df argument.

+

Keep in mind that the default names for the time and target columns +are ds and y, respectively. If your time and +target columns have different names, specify them with +time_col and target_col. Since this dataset +has multiple ids (one for every electricity market), you will need to +specify the name of the column that contains these ids, which in this +case is unique_id. To do this, simply use +id_col="unique_id".

+
+fcst_exo_vars <- nixtla_client_forecast(df_exo_vars, h = 24, id_col = "unique_id", X_df = future_exo_vars)
+#> Frequency chosen: H
+
+head(fcst_exo_vars)
+#>   unique_id                  ds  TimeGPT
+#> 1        BE 2016-12-31 00:00:00 74.54077
+#> 2        BE 2016-12-31 01:00:00 43.34429
+#> 3        BE 2016-12-31 02:00:00 44.42922
+#> 4        BE 2016-12-31 03:00:00 38.09440
+#> 5        BE 2016-12-31 04:00:00 37.38914
+#> 6        BE 2016-12-31 05:00:00 39.08574
+

For comparison, we will also generate a forecast without the +exogenous variables.

+
+df <- nixtlar::electricity # same dataset but without the exogenous variables
+
+fcst <- nixtla_client_forecast(df, h = 24, id_col = "unique_id")
+#> Frequency chosen: H
+
+head(fcst)
+#>   unique_id                  ds  TimeGPT
+#> 1        BE 2016-12-31 00:00:00 45.19045
+#> 2        BE 2016-12-31 01:00:00 43.24445
+#> 3        BE 2016-12-31 02:00:00 41.95839
+#> 4        BE 2016-12-31 03:00:00 39.79649
+#> 5        BE 2016-12-31 04:00:00 39.20453
+#> 6        BE 2016-12-31 05:00:00 40.10878
+
+
+

4. Plot TimeGPT forecast +

+

nixtlar includes a function to plot the historical data +and any output from nixtla_client_forecast, +nixtla_client_historic, +nixtla_client_anomaly_detection and +nixtla_client_cross_validation. If you have long series, +you can use max_insample_length to only plot the last N +historical values (the forecast will always be plotted in full).

+
+nixtla_client_plot(df_exo_vars, fcst_exo_vars, id_col = "unique_id", max_insample_length = 500)
+#> Frequency chosen: H
+

+
+
+
+ + + + +
+ + + + + + + diff --git a/articles/exogenous-variables_files/figure-html/unnamed-chunk-6-1.png b/articles/exogenous-variables_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..c2764c5 Binary files /dev/null and b/articles/exogenous-variables_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/articles/get-started.html b/articles/get-started.html index 6ce36dd..808c5c3 100644 --- a/articles/get-started.html +++ b/articles/get-started.html @@ -58,6 +58,8 @@ + + diff --git a/articles/historical-forecast.html b/articles/historical-forecast.html index aaffa25..68468de 100644 --- a/articles/historical-forecast.html +++ b/articles/historical-forecast.html @@ -58,6 +58,8 @@ + + diff --git a/articles/index.html b/articles/index.html index 1403202..a781aa6 100644 --- a/articles/index.html +++ b/articles/index.html @@ -34,6 +34,8 @@ + + @@ -65,6 +67,8 @@

All vignettes

Cross-Validation
+
Exogenous Variables
+
Get Started
Historical Forecast
diff --git a/authors.html b/authors.html index 0a7f125..613233d 100644 --- a/authors.html +++ b/authors.html @@ -34,6 +34,8 @@ + + diff --git a/index.html b/index.html index 867db89..c1a8ee8 100644 --- a/index.html +++ b/index.html @@ -58,6 +58,8 @@ + + diff --git a/news/index.html b/news/index.html index 687c01e..0d2f8fc 100644 --- a/news/index.html +++ b/news/index.html @@ -34,6 +34,8 @@ + + diff --git a/pkgdown.yml b/pkgdown.yml index e0f18ea..d128790 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,9 +4,10 @@ pkgdown_sha: ~ articles: anomaly-detection: anomaly-detection.html cross-validation: cross-validation.html + exogenous-variables: exogenous-variables.html get-started: get-started.html historical-forecast: historical-forecast.html -last_built: 2024-05-28T05:59Z +last_built: 2024-05-29T02:41Z urls: reference: https://nixtla.github.io/nixtlar/reference article: https://nixtla.github.io/nixtlar/articles diff --git a/reference/date_conversion.html b/reference/date_conversion.html index ef3c853..58f58fa 100644 --- a/reference/date_conversion.html +++ b/reference/date_conversion.html @@ -34,6 +34,8 @@ + + diff --git a/reference/dot-get_api_key.html b/reference/dot-get_api_key.html index f78c193..b6c3eb3 100644 --- a/reference/dot-get_api_key.html +++ b/reference/dot-get_api_key.html @@ -36,6 +36,8 @@ + + diff --git a/reference/dot-nixtla_data_prep.html b/reference/dot-nixtla_data_prep.html index d49471d..dcbd57e 100644 --- a/reference/dot-nixtla_data_prep.html +++ b/reference/dot-nixtla_data_prep.html @@ -36,6 +36,8 @@ + + diff --git a/reference/dot-validate_exogenous.html b/reference/dot-validate_exogenous.html index d07494f..20fb8a3 100644 --- a/reference/dot-validate_exogenous.html +++ b/reference/dot-validate_exogenous.html @@ -36,6 +36,8 @@ + + diff --git a/reference/electricity.html b/reference/electricity.html index 54358d2..818f797 100644 --- a/reference/electricity.html +++ b/reference/electricity.html @@ -34,6 +34,8 @@ + + diff --git a/reference/electricity_exo_vars.html b/reference/electricity_exo_vars.html index 477cb0f..f9ab950 100644 --- a/reference/electricity_exo_vars.html +++ b/reference/electricity_exo_vars.html @@ -34,6 +34,8 @@ + + diff --git a/reference/electricity_future_exo_vars.html b/reference/electricity_future_exo_vars.html index 3bba22a..578212a 100644 --- a/reference/electricity_future_exo_vars.html +++ b/reference/electricity_future_exo_vars.html @@ -34,6 +34,8 @@ + + diff --git a/reference/index.html b/reference/index.html index f1f8aa3..7aea2fb 100644 --- a/reference/index.html +++ b/reference/index.html @@ -34,6 +34,8 @@ + + diff --git a/reference/infer_frequency.html b/reference/infer_frequency.html index 8034ac3..d1286de 100644 --- a/reference/infer_frequency.html +++ b/reference/infer_frequency.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtlaR-package.html b/reference/nixtlaR-package.html index 30cdc76..959c5e7 100644 --- a/reference/nixtlaR-package.html +++ b/reference/nixtlaR-package.html @@ -36,6 +36,8 @@ + + diff --git a/reference/nixtla_client_cross_validation.html b/reference/nixtla_client_cross_validation.html index 308d437..72a5436 100644 --- a/reference/nixtla_client_cross_validation.html +++ b/reference/nixtla_client_cross_validation.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtla_client_detect_anomalies.html b/reference/nixtla_client_detect_anomalies.html index bf81f20..fc403f6 100644 --- a/reference/nixtla_client_detect_anomalies.html +++ b/reference/nixtla_client_detect_anomalies.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtla_client_forecast.html b/reference/nixtla_client_forecast.html index bdc1954..aac15f7 100644 --- a/reference/nixtla_client_forecast.html +++ b/reference/nixtla_client_forecast.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtla_client_historic.html b/reference/nixtla_client_historic.html index 93a39df..3905254 100644 --- a/reference/nixtla_client_historic.html +++ b/reference/nixtla_client_historic.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtla_client_plot.html b/reference/nixtla_client_plot.html index f3cc46c..be719b8 100644 --- a/reference/nixtla_client_plot.html +++ b/reference/nixtla_client_plot.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtla_set_api_key.html b/reference/nixtla_set_api_key.html index edaa64f..3e11a3f 100644 --- a/reference/nixtla_set_api_key.html +++ b/reference/nixtla_set_api_key.html @@ -34,6 +34,8 @@ + + diff --git a/reference/nixtla_validate_api_key.html b/reference/nixtla_validate_api_key.html index c3d235a..3d58c30 100644 --- a/reference/nixtla_validate_api_key.html +++ b/reference/nixtla_validate_api_key.html @@ -34,6 +34,8 @@ + + diff --git a/search.json b/search.json index 41276a9..9f3bfd2 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://nixtla.github.io/nixtlar/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS CONDITIONS USE, REPRODUCTION, DISTRIBUTION Definitions. “License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work. Grant Copyright License. Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form. Grant Patent License. Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed. Redistribution. may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: must give recipients Work Derivative Works copy License; must cause modified files carry prominent notices stating changed files; must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License. Submission Contributions. Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions. Trademarks. License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file. Disclaimer Warranty. Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License. Limitation Liability. event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages. Accepting Warranty Additional Liability. redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"anomaly-detection","dir":"Articles","previous_headings":"","what":"1. Anomaly detection","title":"Anomaly Detection","text":"Anomaly detection plays crucial role time series analysis forecasting. Anomalies, also known outliers, unusual observations don’t follow expected time series patterns. can caused variety factors, including errors data collection process, unexpected events, sudden changes patterns time series. Anomalies can provide critical information system, like potential problem malfunction. identifying , important understand caused , decide whether remove, replace, keep . TimeGPT method detecting anomalies, users can call nixtlar. vignette explain . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Anomaly Detection","text":"vignette, ’ll use electricity consumption dataset included nixtlar, contains hourly prices five different electricity markets.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61"},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"detect-anomalies","dir":"Articles","previous_headings":"","what":"3. Detect anomalies","title":"Anomaly Detection","text":"detect anomalies, use nixtlar::nixtla_client_detect_anomalies. key parameters method : df: data frame tsibble time series data. include least column datestamps column observations. Default names columns ds y. different, please specify names. id_col: data contains multiple ids, case, please specify column contains . working single series, leave default (NULL). anomaly_detection method TimeGPT evaluates observation uses prediction interval determine anomaly . default, nixtlar::nixtla_client_detect_anomalies uses 99% prediction interval. Observations fall outside interval considered anomalies value 1 anomaly column (zero otherwise). change prediction interval, example 95%, use argument level=c(95). Keep mind multiple levels allowed, given several values, nixtlar::nixtla_client_detect_anomalies use maximum.","code":"nixtla_client_anomalies <- nixtlar::nixtla_client_detect_anomalies(df, id_col = \"unique_id\") #> Frequency chosen: H head(nixtla_client_anomalies) #> unique_id ds y anomaly TimeGPT-lo-99 TimeGPT #> 1 BE 2016-10-27 00:00:00 52.58 0 -28.58336 56.07623 #> 2 BE 2016-10-27 01:00:00 44.86 0 -32.23986 52.41973 #> 3 BE 2016-10-27 02:00:00 42.31 0 -31.84485 52.81474 #> 4 BE 2016-10-27 03:00:00 39.66 0 -32.06933 52.59026 #> 5 BE 2016-10-27 04:00:00 38.98 0 -31.98661 52.67297 #> 6 BE 2016-10-27 05:00:00 42.31 0 -30.55300 54.10659 #> TimeGPT-hi-99 #> 1 140.7358 #> 2 137.0793 #> 3 137.4743 #> 4 137.2498 #> 5 137.3326 #> 6 138.7662"},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"plot-anomalies","dir":"Articles","previous_headings":"","what":"4. Plot anomalies","title":"Anomaly Detection","text":"nixtlar includes function plot historical data output nixtlar::nixtla_client_forecast, nixtlar::nixtla_client_historic, nixtlar::nixtla_client_detect_anomalies nixtlar::nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::nixtla_client_plot output nixtlar::nixtla_client_detect_anomalies, set plot_anomalies=TRUE plot anomalies.","code":"nixtlar::nixtla_client_plot(df, nixtla_client_anomalies, id_col = \"unique_id\", plot_anomalies = TRUE) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"time-series-cross-validation","dir":"Articles","previous_headings":"","what":"1. Time series cross-validation","title":"Cross-Validation","text":"Cross-validation method evaluating performance forecasting model. Given time series, carried defining sliding window across historical data predicting period following . accuracy model computed averaging accuracy across cross-validation windows. method results better estimation model’s predictive abilities, since considers multiple periods instead just one, respecting sequential nature data. TimeGPT method performing time series cross-validation, users can call nixtlar. vignette explain . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Cross-Validation","text":"vignette, ’ll use electricity consumption dataset included nixtlar, contains hourly prices five different electricity markets.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61"},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"perform-time-series-cross-validation","dir":"Articles","previous_headings":"","what":"3. Perform time series cross-validation","title":"Cross-Validation","text":"perform time series cross-validation using TimeGPT, use nixtlar::nixtla_client_cross_validation. key parameters method : df: dataframe tsibble time series data. include least column datestamps column observations. Default names columns ds y. different, please specify names. h: forecast horizon. id_col: data contains multiple ids, case, please specify column contains . working single series, leave default (NULL). n_windows: number windows evaluate. Default value 1. step_size: gap cross-validation window. Default value NULL.","code":"nixtla_client_cv <- nixtla_client_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) #> Frequency chosen: H head(nixtla_client_cv) #> unique_id ds cutoff y TimeGPT #> 1 BE 2016-12-29 08:00:00 2016-12-29 07:00:00 53.30 51.79829 #> 2 BE 2016-12-29 09:00:00 2016-12-29 07:00:00 53.93 55.48120 #> 3 BE 2016-12-29 10:00:00 2016-12-29 07:00:00 56.63 55.86470 #> 4 BE 2016-12-29 11:00:00 2016-12-29 07:00:00 55.66 54.45249 #> 5 BE 2016-12-29 12:00:00 2016-12-29 07:00:00 48.00 54.76038 #> 6 BE 2016-12-29 13:00:00 2016-12-29 07:00:00 46.53 53.56611"},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"plot-cross-validation-results","dir":"Articles","previous_headings":"","what":"4. Plot cross-validation results","title":"Cross-Validation","text":"nixtlar includes function plot historical data output nixtlar::nixtla_client_forecast, nixtlar::nixtla_client_historic, nixtlar::nixtla_client_anomaly_detection nixtlar::nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::nixtla_client_plot output nixtlar::nixtla_client_cross_validation, cross-validation window visually represented vertical dashed lines. given pair lines, data first line forms training set. set used forecast data two lines.","code":"nixtla_client_plot(df, nixtla_client_cv, id_col = \"unique_id\", max_insample_length = 200) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"setting-up-your-api-key","dir":"Articles","previous_headings":"","what":"1. Setting up your API key","title":"Get Started","text":"First, need set API key. API key string characters allows authenticate requests using TimeGPT via nixtlar. API key needs provided Nixtla, don’t one, please request one . using nixtlar, two ways setting API key:","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"a--using-the-nixtla_set_api_key-function","dir":"Articles","previous_headings":"1. Setting up your API key","what":"a. Using the nixtla_set_api_key function","title":"Get Started","text":"nixtlar function easily set API key current R session. Simply call Keep mind close R session re-start , ’ll need set API key .","code":"nixtla_set_api_key(api_key = \"paste your API key here\")"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"b--using-an-environment-variable","dir":"Articles","previous_headings":"1. Setting up your API key","what":"b. Using an environment variable","title":"Get Started","text":"persistent method can used across different projects, set API key environment variable. , first need load usethis package. open .Reviron file. Place API key named NIXTLA_API_KEY. ’ll need restart R changes take effect. Keep mind modifying .Renviron file affects R sessions, ’re comfortable , set API key using nixtla_set_api_key function.","code":"library(usethis) usethis::edit_r_environ() # Inside the .Renviron file NIXTLA_API_KEY=\"paste your API key here\""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"validate-your-api-key","dir":"Articles","previous_headings":"1. Setting up your API key","what":"Validate your API key","title":"Get Started","text":"want validate API key, call nixtla_validate_api_key. don’t need validate API key every time set , want check ’s valid.","code":"nixtla_validate_api_key() #> API key validation successful. Happy forecasting! :) #> If you have questions or need support, please email ops@nixtla.io"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"generate-timegpt-forecast","dir":"Articles","previous_headings":"","what":"2. Generate TimeGPT forecast","title":"Get Started","text":"API key set , ’re ready use TimeGPT. ’ll show done using dataset contains prices different electricity markets. generate forecast dataset, use nixtla_client_forecast. Default names time target columns ds y. time target columns different names, specify time_col target_col. Since multiple ids (one every electricity market), ’ll need specify name column contains ids, case unique_id. , simply use id_col=\"unique_id\". can also choose confidence levels (0-100) prediction intervals level.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61 nixtla_client_fcst <- nixtla_client_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(nixtla_client_fcst) #> unique_id ds TimeGPT TimeGPT-lo-95 TimeGPT-lo-80 #> 1 BE 2016-12-31 00:00:00 45.19045 32.60115 40.42074 #> 2 BE 2016-12-31 01:00:00 43.24445 29.30454 36.91513 #> 3 BE 2016-12-31 02:00:00 41.95839 28.17721 35.55863 #> 4 BE 2016-12-31 03:00:00 39.79649 25.42790 33.45859 #> 5 BE 2016-12-31 04:00:00 39.20454 23.53869 30.35095 #> 6 BE 2016-12-31 05:00:00 40.10878 26.90472 31.60236 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 49.96017 57.77975 #> 2 49.57376 57.18435 #> 3 48.35815 55.73957 #> 4 46.13438 54.16507 #> 5 48.05812 54.87038 #> 6 48.61520 53.31284"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"plot-timegpt-forecast","dir":"Articles","previous_headings":"","what":"3. Plot TimeGPT forecast","title":"Get Started","text":"nixtlar includes function plot historical data output nixtla_client_forecast, nixtla_client_historic, nixtla_client_anomaly_detection nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"nixtla_client_plot(df, nixtla_client_fcst, id_col = \"unique_id\", max_insample_length = 200) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"timegpt-historical-forecast","dir":"Articles","previous_headings":"","what":"1. TimeGPT Historical Forecast","title":"Historical Forecast","text":"generating forecast, sometimes might interested forecasting historical observations. predictions, known fitted values, can help better understand evaluate model’s performance time. TimeGPT method generating fitted values, users can call nixtlar. vignette explain . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Historical Forecast","text":"vignette, ’ll use electricity consumption dataset included nixtlar, contains hourly prices five different electricity markets.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"forecast-historical-data","dir":"Articles","previous_headings":"","what":"3. Forecast historical data","title":"Historical Forecast","text":"generate forecast historical data, use nixtlar::nixtla_client_historic. key parameters method : df: dataframe tsibble time series data. include least column datestamps column observations. Default names columns ds y. different, please specify names. id_col: data contains multiple ids, case, please specify column contains . working single series, leave default (NULL). level: prediction intervals forecast. Notice fitted values initial observations. TimeGPT requires minimum number values generate reliable forecasts. fitted values generated using rolling window, meaning fitted value observation \\(T\\) generated using first \\(T-1\\) observations.","code":"nixtla_client_fitted_values <- nixtla_client_historic(df, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(nixtla_client_fitted_values) #> unique_id ds TimeGPT TimeGPT-lo-80 TimeGPT-lo-95 #> 1 BE 2016-10-27 00:00:00 56.07623 13.95557 -8.341764 #> 2 BE 2016-10-27 01:00:00 52.41973 10.29907 -11.998258 #> 3 BE 2016-10-27 02:00:00 52.81474 10.69408 -11.603250 #> 4 BE 2016-10-27 03:00:00 52.59026 10.46960 -11.827729 #> 5 BE 2016-10-27 04:00:00 52.67297 10.55231 -11.745015 #> 6 BE 2016-10-27 05:00:00 54.10659 11.98593 -10.311399 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 98.19688 120.4942 #> 2 94.54039 116.8377 #> 3 94.93540 117.2327 #> 4 94.71092 117.0082 #> 5 94.79363 117.0910 #> 6 96.22725 118.5246"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"fitted-values-from-nixtlarnixtla_client_forecast","dir":"Articles","previous_headings":"3. Forecast historical data","what":"3.1 Fitted values from nixtlar::nixtla_client_forecast","title":"Historical Forecast","text":"nixtlar::nixtla_client_historic dedicated function calls TimeGPT’s method generating fitted values. However, can also use nixtlar::nixtla_client_forecast add_history=TRUE. generate forecast historical data next \\(h\\) future observations.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"plot-historical-forecast","dir":"Articles","previous_headings":"","what":"4. Plot historical forecast","title":"Historical Forecast","text":"nixtlar includes function plot historical data output nixtla_client_forecast, nixtla_client_historic, nixtla_client_anomaly_detection nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"nixtla_client_plot(df, nixtla_client_fitted_values, id_col = \"unique_id\", max_insample_length = 200) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Mariana Menchero. Author, maintainer. First author maintainer Nixtla. Copyright holder. Copyright held Nixtla","code":""},{"path":"https://nixtla.github.io/nixtlar/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Menchero M (2024). nixtlar: Software Development Kit Nixtla's TimeGPT. R package version 0.5.0, https://docs.nixtla.io/, https://nixtla.github.io/nixtlar/.","code":"@Manual{, title = {nixtlar: A Software Development Kit for Nixtla's TimeGPT}, author = {Mariana Menchero}, year = {2024}, note = {R package version 0.5.0, https://docs.nixtla.io/}, url = {https://nixtla.github.io/nixtlar/}, }"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"timegpt-1","dir":"","previous_headings":"","what":"TimeGPT-1","title":"A Software Development Kit for Nixtla's TimeGPT","text":"first foundation model time series forecasting anomaly detection TimeGPT production-ready, generative pretrained transformer time series forecasting, developed Nixtla. capable accurately predicting various domains retail, electricity, finance, IoT, just lines code. Additionally, can detect anomalies time series data. TimeGPT initially developed Python now available R users nixtlar package.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of Contents","title":"A Software Development Kit for Nixtla's TimeGPT","text":"Installation Forecast Using TimeGPT 3 Easy Steps Anomaly Detection Using TimeGPT 3 Easy Steps Features Capabilities Documentation API Support Cite License Get Touch","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"quickstart","dir":"","previous_headings":"","what":"Quickstart","title":"A Software Development Kit for Nixtla's TimeGPT","text":"https://github.com/Nixtla/nixtlar/assets/47995617/1be6d63c-7cfd-4c29-b8e8-f7378c982724","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A Software Development Kit for Nixtla's TimeGPT","text":"can install development version nixtlar GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"Nixtla/nixtlar\")"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"forecast-using-timegpt-in-3-easy-steps","dir":"","previous_headings":"","what":"Forecast Using TimeGPT in 3 Easy Steps","title":"A Software Development Kit for Nixtla's TimeGPT","text":"Set API key. Get dashboard.nixtla.io Load sample data Forecast next 8 steps ahead Optionally, plot results","code":"library(nixtlar) nixtla_set_api_key(api_key = \"Your API key here\") df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61 nixtla_client_fcst <- nixtla_client_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(nixtla_client_fcst) #> unique_id ds TimeGPT TimeGPT-lo-95 TimeGPT-lo-80 #> 1 BE 2016-12-31 00:00:00 45.19045 32.60115 40.42074 #> 2 BE 2016-12-31 01:00:00 43.24445 29.30454 36.91513 #> 3 BE 2016-12-31 02:00:00 41.95839 28.17721 35.55863 #> 4 BE 2016-12-31 03:00:00 39.79649 25.42790 33.45859 #> 5 BE 2016-12-31 04:00:00 39.20454 23.53869 30.35095 #> 6 BE 2016-12-31 05:00:00 40.10878 26.90472 31.60236 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 49.96017 57.77975 #> 2 49.57376 57.18435 #> 3 48.35815 55.73957 #> 4 46.13438 54.16507 #> 5 48.05812 54.87038 #> 6 48.61520 53.31284 nixtla_client_plot(df, nixtla_client_fcst, id_col = \"unique_id\", max_insample_length = 200)"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"anomaly-detection-using-timegpt-in-3-easy-steps","dir":"","previous_headings":"","what":"Anomaly Detection Using TimeGPT in 3 Easy Steps","title":"A Software Development Kit for Nixtla's TimeGPT","text":"anomaly detection TimeGPT, also 3 easy steps! Follow steps 1 2 previous section use nixtla_client_detect_anomalies nixtla_client_plot functions.","code":"nixtla_client_anomalies <- nixtlar::nixtla_client_detect_anomalies(df, id_col = \"unique_id\") #> Frequency chosen: H head(nixtla_client_anomalies) #> unique_id ds y anomaly TimeGPT-lo-99 TimeGPT #> 1 BE 2016-10-27 00:00:00 52.58 0 -28.58336 56.07623 #> 2 BE 2016-10-27 01:00:00 44.86 0 -32.23986 52.41973 #> 3 BE 2016-10-27 02:00:00 42.31 0 -31.84485 52.81474 #> 4 BE 2016-10-27 03:00:00 39.66 0 -32.06933 52.59026 #> 5 BE 2016-10-27 04:00:00 38.98 0 -31.98661 52.67297 #> 6 BE 2016-10-27 05:00:00 42.31 0 -30.55300 54.10659 #> TimeGPT-hi-99 #> 1 140.7358 #> 2 137.0793 #> 3 137.4743 #> 4 137.2498 #> 5 137.3326 #> 6 138.7662 nixtlar::nixtla_client_plot(df, nixtla_client_anomalies, id_col = \"unique_id\", plot_anomalies = TRUE)"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"features-and-capabilities","dir":"","previous_headings":"","what":"Features and Capabilities","title":"A Software Development Kit for Nixtla's TimeGPT","text":"nixtlar provides access TimeGPT’s features capabilities, : Zero-shot Inference: TimeGPT can generate forecasts detect anomalies straight box, requiring prior training data. allows immediate deployment quick insights time series data. Fine-tuning: Enhance TimeGPT’s capabilities fine-tuning model specific datasets, enabling model adapt nuances unique time series data improving performance tailored tasks. Add Exogenous Variables: Incorporate additional variables might influence predictions enhance forecast accuracy. (E.g. Special Dates, events prices) Multiple Series Forecasting: Simultaneously forecast multiple time series data, optimizing workflows resources. Custom Loss Function: Tailor fine-tuning process custom loss function meet specific performance metrics. Cross Validation: Implement box cross-validation techniques ensure model robustness generalizability. Prediction Intervals: Provide intervals predictions quantify uncertainty effectively. Irregular Timestamps: Handle data irregular timestamps, accommodating non-uniform interval series without preprocessing.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"A Software Development Kit for Nixtla's TimeGPT","text":"comprehensive documentation, please refer vignettes, cover wide range topics help effectively use nixtlar. current documentation includes guides : Get started set API key anomaly detection Generate historical forecasts Perform time series cross-validation documentation ongoing effort, working expanding coverage.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"api-support","dir":"","previous_headings":"","what":"API Support","title":"A Software Development Kit for Nixtla's TimeGPT","text":"Python user? yes, check Python SDK TimeGPT. can also refer API reference support programming languages.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"how-to-cite","dir":"","previous_headings":"","what":"How to Cite","title":"A Software Development Kit for Nixtla's TimeGPT","text":"find TimeGPT useful research, please consider citing TimeGPT-1 paper. associated reference shown . Garza, ., Challu, C., & Mergenthaler-Canseco, M. (2024). TimeGPT-1. arXiv preprint arXiv:2310.03589. Available https://arxiv.org/abs/2310.03589","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"A Software Development Kit for Nixtla's TimeGPT","text":"TimeGPT closed source. However, SDK open source available Apache 2.0 License, feel free contribute!","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"get-in-touch","dir":"","previous_headings":"","what":"Get in Touch","title":"A Software Development Kit for Nixtla's TimeGPT","text":"welcome input contributions nixtlar package! Report Issues: encounter bug suggestion improve package, please open issue GitHub. Contribute: can contribute opening pull request repository. Whether fixing bug, adding new feature, improving documentation, appreciate help making nixtlar better.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":null,"dir":"Reference","previous_headings":"","what":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"Infer frequency tsibble convert index date string.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"","code":"date_conversion(df)"},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"df tsibble.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"list inferred frequency df new index.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"","code":"df <- AirPassengers tsbl <- tsibble::as_tsibble(df) names(tsbl) <- c(\"ds\", \"y\") date_conversion(tsbl) #> Frequency chosen: MS #> $df #> # A tibble: 144 × 2 #> ds y #> #> 1 1949-01-01 112 #> 2 1949-02-01 118 #> 3 1949-03-01 132 #> 4 1949-04-01 129 #> 5 1949-05-01 121 #> 6 1949-06-01 135 #> 7 1949-07-01 148 #> 8 1949-08-01 148 #> 9 1949-09-01 136 #> 10 1949-10-01 119 #> # ℹ 134 more rows #> #> $freq #> [1] \"MS\" #>"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"Get NIXTLA_API_KEY options .Renviron private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"","code":".get_api_key()"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"available, NIXTLA_API_KEY. Otherwise returns error message asking user set API key.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"","code":"if (FALSE) { .get_api_key() }"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"Prepares data TimeGPT's API private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"","code":".nixtla_data_prep(df, freq, id_col, time_col, target_col)"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"df tsibble data frame time series data. freq Frequency data. id_col Column identifies series. named unique_id. time_col Column identifies timestep. named ds. target_col Column contains target variable. named y.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"list given inferred frequency, prepared data, original data frame renamed.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"","code":"df <- nixtlar::electricity data <- .nixtla_data_prep(df, freq=\"H\")"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"Validate exogenous variables (applicable) private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"","code":".validate_exogenous(df, h, X_df)"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"df tsibble data frame time series data. h Forecast horizon. X_df tsibble data frame future exogenous variables.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"list result validation (TRUE/FALSE) error message (applicable)","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"","code":"if (FALSE) { df <- nixtlar::electricity_exo_vars X_df <- nixtlar::electricity_future_exo_vars .validate_exogenous(df, h=24, X_df) }"},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":null,"dir":"Reference","previous_headings":"","what":"Electricity dataset — electricity","title":"Electricity dataset — electricity","text":"Contains prices different electricity markets.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Electricity dataset — electricity","text":"","code":"electricity"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":"electricity","dir":"Reference","previous_headings":"","what":"electricity","title":"Electricity dataset — electricity","text":"data frame 8400 rows 3 columns: unique_id Unique identifiers electricity markets. ds Date format YYYY:MM:DD hh:mm:ss. y Price given market date.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Electricity dataset — electricity","text":"https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Electricity dataset with exogenous variables — electricity_exo_vars","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"Contains prices different electricity markets exogenous variables.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"","code":"electricity_exo_vars"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":"electricity-exo-vars","dir":"Reference","previous_headings":"","what":"electricity_exo_vars","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"data frame 8400 rows 12 columns: unique_id Unique identifiers electricity markets. ds Date format YYYY:MM:DD hh:mm:ss. y Price given market date. Exogenous1 external factor influencing prices. markets, form day-ahead load forecast. Exogenous2 external factor influencing prices. \"\" \"FR\" markets, day-ahead generation forecast. \"NP\", day-ahead wind generation forecast. \"PJM\", day-ahead load forecast specific zone. \"DE\", aggregated day-ahead wind solar generation forecasts. day_0 Binary variable indicating weekday. day_1 Binary variable indicating weekday. day_2 Binary variable indicating weekday. day_3 Binary variable indicating weekday. day_4 Binary variable indicating weekday. day_5 Binary variable indicating weekday. day_6 Binary variable indicating weekday.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"Contains future values exogenous variables electricity dataset (24 steps-ahead). used electricity_exo_vars.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"","code":"electricity_future_exo_vars"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":"electricity-future-exo-vars","dir":"Reference","previous_headings":"","what":"electricity_future_exo_vars","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"data frame 120 rows 11 columns: unique_id Unique identifiers electricity markets. ds Date format YYYY:MM:DD hh:mm:ss. Exogenous1 external factor influencing prices. markets, form day-ahead load forecast. Exogenous2 external factor influencing prices. \"\" \"FR\" markets, day-ahead generation forecast. \"NP\", day-ahead wind generation forecast. \"PJM\", day-ahead load forecast specific zone. \"DE\", aggregated day-ahead wind solar generation forecasts. day_0 Binary variable indicating weekday. day_1 Binary variable indicating weekday. day_2 Binary variable indicating weekday. day_3 Binary variable indicating weekday. day_4 Binary variable indicating weekday. day_5 Binary variable indicating weekday. day_6 Binary variable indicating weekday.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short-future-ex-vars.csv","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":null,"dir":"Reference","previous_headings":"","what":"Infer frequency of a data frame. — infer_frequency","title":"Infer frequency of a data frame. — infer_frequency","text":"Infer frequency data frame.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Infer frequency of a data frame. — infer_frequency","text":"","code":"infer_frequency(df)"},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Infer frequency of a data frame. — infer_frequency","text":"df data frame time series data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Infer frequency of a data frame. — infer_frequency","text":"inferred frequency.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Infer frequency of a data frame. — infer_frequency","text":"","code":"df <- nixtlar::electricity infer_frequency(df) #> Frequency chosen: H #> [1] \"H\""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtlaR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"nixtlar: A Software Development Kit for Nixtla's TimeGPT — nixtlar-package","title":"nixtlar: A Software Development Kit for Nixtla's TimeGPT — nixtlar-package","text":"Software Development Kit working Nixtla’s TimeGPT, foundation model time series forecasting. \"API\" acronym \"application programming interface\"; package allows users interact TimeGPT via API. can set validate API keys generate forecasts via API calls. compatible 'tsibble' base R. details visit https://docs.nixtla.io/.","code":""},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/nixtlaR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nixtlar: A Software Development Kit for Nixtla's TimeGPT — nixtlar-package","text":"Maintainer: Mariana Menchero mariana@nixtla.io (First author maintainer) contributors: Nixtla (Copyright held Nixtla) [copyright holder]","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"Perform cross validation TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"","code":"nixtla_client_cross_validation( df, h = 8, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", X_df = NULL, level = NULL, n_windows = 1, step_size = NULL, finetune_steps = 0, finetune_loss = \"default\", clean_ex_first = TRUE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"df tsibble data frame time series data. h Forecast horizon. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. X_df tsibble data frame future exogenous variables. level confidence levels (0-100) prediction intervals. n_windows Number windows evaluate. step_size Step size cross validation window. NULL, equal forecast horizon (h). finetune_steps Number steps used finetune TimeGPT new data. finetune_loss Loss function use finetuning. Options : \"default\", \"mae\", \"mse\", \"rmse\", \"mape\", \"smape\". clean_ex_first Clean exogenous signal making forecasts using TimeGPT. model Model use, either \"timegpt-1\" \"timegpt-1-long-horizon\". Use \"timegpt-1-long-horizon\" want forecast one seasonal period given frequency data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"tsibble data frame TimeGPT's cross validation.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"Detect anomalies TimeGPT","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"","code":"nixtla_client_detect_anomalies( df, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", level = c(99), clean_ex_first = TRUE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"df tsibble data frame time series data. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. level confidence level (0-100) prediction interval used anomaly detection. Default 99. clean_ex_first Clean exogenous signal making forecasts using TimeGPT. model Model use, either \"timegpt-1\" \"timegpt-1-long-horizon\". Use \"timegpt-1-long-horizon\" want forecast one seasonal period given frequency data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"tsibble data frame anomalies detected historical period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_anomaly_detection(df, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast — nixtla_client_forecast","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"Generate TimeGPT forecast","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"","code":"nixtla_client_forecast( df, h = 8, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", X_df = NULL, level = NULL, finetune_steps = 0, finetune_loss = \"default\", clean_ex_first = TRUE, add_history = FALSE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"df tsibble data frame time series data. h Forecast horizon. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. X_df tsibble data frame future exogenous variables. level confidence levels (0-100) prediction intervals. finetune_steps Number steps used finetune TimeGPT new data. finetune_loss Loss function use finetuning. Options : \"default\", \"mae\", \"mse\", \"rmse\", \"mape\", \"smape\". clean_ex_first Clean exogenous signal making forecasts using TimeGPT. add_history Return fitted values model. model Model use, either \"timegpt-1\" \"timegpt-1-long-horizon\". Use \"timegpt-1-long-horizon\" want forecast one seasonal period given frequency data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"TimeGPT's forecast.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"Generate TimeGPT forecast -sample period (historical period).","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"","code":"nixtla_client_historic( df, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", level = NULL, finetune_steps = 0, finetune_loss = \"default\", clean_ex_first = TRUE )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"df tsibble data frame time series data. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. level confidence levels (0-100) prediction intervals. finetune_steps Number steps used finetune TimeGPT new data. finetune_loss Loss function use finetuning. Options : \"default\", \"mae\", \"mse\", \"rmse\", \"mape\", \"smape\". clean_ex_first Clean exogenous signal making forecasts using TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"TimeGPT's forecast -sample period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_historic(df, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"Plot output following nixtla_client functions: forecast, historic, anomaly_detection, cross_validation.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"","code":"nixtla_client_plot( df, fcst = NULL, h = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", unique_ids = NULL, max_insample_length = NULL, plot_anomalies = FALSE )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"df tsibble data frame time series data (insample values). fcst tsibble data frame TimeGPT point forecast prediction intervals (available). h Forecast horizon. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. unique_ids Time series plot. NULL (default), selection random. max_insample_length Max number insample observations plotted. plot_anomalies Whether plot anomalies.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"Corresponding plot.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) nixtlar::timegpt_plot(df, fcst, h=8, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Set API key in global environment — nixtla_set_api_key","title":"Set API key in global environment — nixtla_set_api_key","text":"Set API key global environment","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set API key in global environment — nixtla_set_api_key","text":"","code":"nixtla_set_api_key(api_key)"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set API key in global environment — nixtla_set_api_key","text":"api_key user's API key. Get : https://dashboard.nixtla.io/","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set API key in global environment — nixtla_set_api_key","text":"message indicating API key set global environment.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set API key in global environment — nixtla_set_api_key","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate API key — nixtla_validate_api_key","title":"Validate API key — nixtla_validate_api_key","text":"Validate API key","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate API key — nixtla_validate_api_key","text":"","code":"nixtla_validate_api_key()"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate API key — nixtla_validate_api_key","text":"status code message indicating whether API key valid.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate API key — nixtla_validate_api_key","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") nixtlar::nixtla_validate_api_key }"},{"path":"https://nixtla.github.io/nixtlar/news/index.html","id":"nixtlar-050","dir":"Changelog","previous_headings":"","what":"nixtlar 0.5.0","title":"nixtlar 0.5.0","text":"Initial CRAN submission.","code":""}] +[{"path":"https://nixtla.github.io/nixtlar/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS CONDITIONS USE, REPRODUCTION, DISTRIBUTION Definitions. “License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work. Grant Copyright License. Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form. Grant Patent License. Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed. Redistribution. may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: must give recipients Work Derivative Works copy License; must cause modified files carry prominent notices stating changed files; must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License. Submission Contributions. Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions. Trademarks. License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file. Disclaimer Warranty. Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License. Limitation Liability. event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages. Accepting Warranty Additional Liability. redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"anomaly-detection","dir":"Articles","previous_headings":"","what":"1. Anomaly detection","title":"Anomaly Detection","text":"Anomaly detection plays crucial role time series analysis forecasting. Anomalies, also known outliers, unusual observations don’t follow expected time series patterns. can caused variety factors, including errors data collection process, unexpected events, sudden changes patterns time series. Anomalies can provide critical information system, like potential problem malfunction. identifying , important understand caused , decide whether remove, replace, keep . TimeGPT method detecting anomalies, users can call nixtlar. vignette explain . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Anomaly Detection","text":"vignette, ’ll use electricity consumption dataset included nixtlar, contains hourly prices five different electricity markets.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61"},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"detect-anomalies","dir":"Articles","previous_headings":"","what":"3. Detect anomalies","title":"Anomaly Detection","text":"detect anomalies, use nixtlar::nixtla_client_detect_anomalies. key parameters method : df: data frame tsibble time series data. include least column datestamps column observations. Default names columns ds y. different, please specify names. id_col: data contains multiple ids, case, please specify column contains . working single series, leave default (NULL). anomaly_detection method TimeGPT evaluates observation uses prediction interval determine anomaly . default, nixtlar::nixtla_client_detect_anomalies uses 99% prediction interval. Observations fall outside interval considered anomalies value 1 anomaly column (zero otherwise). change prediction interval, example 95%, use argument level=c(95). Keep mind multiple levels allowed, given several values, nixtlar::nixtla_client_detect_anomalies use maximum.","code":"nixtla_client_anomalies <- nixtlar::nixtla_client_detect_anomalies(df, id_col = \"unique_id\") #> Frequency chosen: H head(nixtla_client_anomalies) #> unique_id ds y anomaly TimeGPT-lo-99 TimeGPT #> 1 BE 2016-10-27 00:00:00 52.58 0 -28.58336 56.07623 #> 2 BE 2016-10-27 01:00:00 44.86 0 -32.23986 52.41973 #> 3 BE 2016-10-27 02:00:00 42.31 0 -31.84485 52.81474 #> 4 BE 2016-10-27 03:00:00 39.66 0 -32.06933 52.59026 #> 5 BE 2016-10-27 04:00:00 38.98 0 -31.98661 52.67297 #> 6 BE 2016-10-27 05:00:00 42.31 0 -30.55300 54.10659 #> TimeGPT-hi-99 #> 1 140.7358 #> 2 137.0793 #> 3 137.4743 #> 4 137.2498 #> 5 137.3326 #> 6 138.7662"},{"path":"https://nixtla.github.io/nixtlar/articles/anomaly-detection.html","id":"plot-anomalies","dir":"Articles","previous_headings":"","what":"4. Plot anomalies","title":"Anomaly Detection","text":"nixtlar includes function plot historical data output nixtlar::nixtla_client_forecast, nixtlar::nixtla_client_historic, nixtlar::nixtla_client_detect_anomalies nixtlar::nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::nixtla_client_plot output nixtlar::nixtla_client_detect_anomalies, set plot_anomalies=TRUE plot anomalies.","code":"nixtlar::nixtla_client_plot(df, nixtla_client_anomalies, id_col = \"unique_id\", plot_anomalies = TRUE) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"time-series-cross-validation","dir":"Articles","previous_headings":"","what":"1. Time series cross-validation","title":"Cross-Validation","text":"Cross-validation method evaluating performance forecasting model. Given time series, carried defining sliding window across historical data predicting period following . accuracy model computed averaging accuracy across cross-validation windows. method results better estimation model’s predictive abilities, since considers multiple periods instead just one, respecting sequential nature data. TimeGPT method performing time series cross-validation, users can call nixtlar. vignette explain . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Cross-Validation","text":"vignette, ’ll use electricity consumption dataset included nixtlar, contains hourly prices five different electricity markets.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61"},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"perform-time-series-cross-validation","dir":"Articles","previous_headings":"","what":"3. Perform time series cross-validation","title":"Cross-Validation","text":"perform time series cross-validation using TimeGPT, use nixtlar::nixtla_client_cross_validation. key parameters method : df: dataframe tsibble time series data. include least column datestamps column observations. Default names columns ds y. different, please specify names. h: forecast horizon. id_col: data contains multiple ids, case, please specify column contains . working single series, leave default (NULL). n_windows: number windows evaluate. Default value 1. step_size: gap cross-validation window. Default value NULL.","code":"nixtla_client_cv <- nixtla_client_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) #> Frequency chosen: H head(nixtla_client_cv) #> unique_id ds cutoff y TimeGPT #> 1 BE 2016-12-29 08:00:00 2016-12-29 07:00:00 53.30 51.79829 #> 2 BE 2016-12-29 09:00:00 2016-12-29 07:00:00 53.93 55.48120 #> 3 BE 2016-12-29 10:00:00 2016-12-29 07:00:00 56.63 55.86470 #> 4 BE 2016-12-29 11:00:00 2016-12-29 07:00:00 55.66 54.45249 #> 5 BE 2016-12-29 12:00:00 2016-12-29 07:00:00 48.00 54.76038 #> 6 BE 2016-12-29 13:00:00 2016-12-29 07:00:00 46.53 53.56611"},{"path":"https://nixtla.github.io/nixtlar/articles/cross-validation.html","id":"plot-cross-validation-results","dir":"Articles","previous_headings":"","what":"4. Plot cross-validation results","title":"Cross-Validation","text":"nixtlar includes function plot historical data output nixtlar::nixtla_client_forecast, nixtlar::nixtla_client_historic, nixtlar::nixtla_client_anomaly_detection nixtlar::nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::nixtla_client_plot output nixtlar::nixtla_client_cross_validation, cross-validation window visually represented vertical dashed lines. given pair lines, data first line forms training set. set used forecast data two lines.","code":"nixtla_client_plot(df, nixtla_client_cv, id_col = \"unique_id\", max_insample_length = 200) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/exogenous-variables.html","id":"exogenous-variables","dir":"Articles","previous_headings":"","what":"1. Exogenous variables","title":"Exogenous Variables","text":"Exogenous variables external factors provide additional information behavior target variable time series forecasting. variables, correlated target, can significantly improve predictions. Examples exogenous variables include weather data, economic indicators, holiday markers, promotional sales. TimeGPT allows include exogenous variables generating forecast. vignette show include . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/exogenous-variables.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Exogenous Variables","text":"vignette, use electricity consumption dataset exogenous variables included nixtlar. dataset contains hourly prices five different electricity markets, along two exogenous variables related prices binary variables indicating day week. using exogenous variables, must provide future values cover complete forecast horizon; otherwise, TimeGPT result error. Ensure dates future exogenous variables exactly match forecast horizon. electricity consumption dataset exogenous variables, nixtlar provides values next 24 steps ahead.","code":"df_exo_vars <- nixtlar::electricity_exo_vars head(df_exo_vars) #> unique_id ds y Exogenous1 Exogenous2 day_0 day_1 day_2 #> 1 BE 2016-10-22 00:00:00 70.00 49593 57253 0 0 0 #> 2 BE 2016-10-22 01:00:00 37.10 46073 51887 0 0 0 #> 3 BE 2016-10-22 02:00:00 37.10 44927 51896 0 0 0 #> 4 BE 2016-10-22 03:00:00 44.75 44483 48428 0 0 0 #> 5 BE 2016-10-22 04:00:00 37.10 44338 46721 0 0 0 #> 6 BE 2016-10-22 05:00:00 35.61 44504 46303 0 0 0 #> day_3 day_4 day_5 day_6 #> 1 0 0 1 0 #> 2 0 0 1 0 #> 3 0 0 1 0 #> 4 0 0 1 0 #> 5 0 0 1 0 #> 6 0 0 1 0 future_exo_vars <- nixtlar::electricity_future_exo_vars head(future_exo_vars) #> unique_id ds Exogenous1 Exogenous2 day_0 day_1 day_2 day_3 #> 1 BE 2016-12-31 00:00:00 64108 70318 0 0 0 0 #> 2 BE 2016-12-31 01:00:00 62492 67898 0 0 0 0 #> 3 BE 2016-12-31 02:00:00 61571 68379 0 0 0 0 #> 4 BE 2016-12-31 03:00:00 60381 64972 0 0 0 0 #> 5 BE 2016-12-31 04:00:00 60298 62900 0 0 0 0 #> 6 BE 2016-12-31 05:00:00 60339 62364 0 0 0 0 #> day_4 day_5 day_6 #> 1 0 1 0 #> 2 0 1 0 #> 3 0 1 0 #> 4 0 1 0 #> 5 0 1 0 #> 6 0 1 0"},{"path":"https://nixtla.github.io/nixtlar/articles/exogenous-variables.html","id":"forecast-with-exogenous-variables","dir":"Articles","previous_headings":"","what":"3. Forecast with exogenous variables","title":"Exogenous Variables","text":"generate forecast exogenous variables, use nixtla_client_forecast function forecasts without . difference must add exogenous variables using X_df argument. Keep mind default names time target columns ds y, respectively. time target columns different names, specify time_col target_col. Since dataset multiple ids (one every electricity market), need specify name column contains ids, case unique_id. , simply use id_col=\"unique_id\". comparison, also generate forecast without exogenous variables.","code":"fcst_exo_vars <- nixtla_client_forecast(df_exo_vars, h = 24, id_col = \"unique_id\", X_df = future_exo_vars) #> Frequency chosen: H head(fcst_exo_vars) #> unique_id ds TimeGPT #> 1 BE 2016-12-31 00:00:00 74.54077 #> 2 BE 2016-12-31 01:00:00 43.34429 #> 3 BE 2016-12-31 02:00:00 44.42922 #> 4 BE 2016-12-31 03:00:00 38.09440 #> 5 BE 2016-12-31 04:00:00 37.38914 #> 6 BE 2016-12-31 05:00:00 39.08574 df <- nixtlar::electricity # same dataset but without the exogenous variables fcst <- nixtla_client_forecast(df, h = 24, id_col = \"unique_id\") #> Frequency chosen: H head(fcst) #> unique_id ds TimeGPT #> 1 BE 2016-12-31 00:00:00 45.19045 #> 2 BE 2016-12-31 01:00:00 43.24445 #> 3 BE 2016-12-31 02:00:00 41.95839 #> 4 BE 2016-12-31 03:00:00 39.79649 #> 5 BE 2016-12-31 04:00:00 39.20453 #> 6 BE 2016-12-31 05:00:00 40.10878"},{"path":"https://nixtla.github.io/nixtlar/articles/exogenous-variables.html","id":"plot-timegpt-forecast","dir":"Articles","previous_headings":"","what":"4. Plot TimeGPT forecast","title":"Exogenous Variables","text":"nixtlar includes function plot historical data output nixtla_client_forecast, nixtla_client_historic, nixtla_client_anomaly_detection nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"nixtla_client_plot(df_exo_vars, fcst_exo_vars, id_col = \"unique_id\", max_insample_length = 500) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"setting-up-your-api-key","dir":"Articles","previous_headings":"","what":"1. Setting up your API key","title":"Get Started","text":"First, need set API key. API key string characters allows authenticate requests using TimeGPT via nixtlar. API key needs provided Nixtla, don’t one, please request one . using nixtlar, two ways setting API key:","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"a--using-the-nixtla_set_api_key-function","dir":"Articles","previous_headings":"1. Setting up your API key","what":"a. Using the nixtla_set_api_key function","title":"Get Started","text":"nixtlar function easily set API key current R session. Simply call Keep mind close R session re-start , ’ll need set API key .","code":"nixtla_set_api_key(api_key = \"paste your API key here\")"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"b--using-an-environment-variable","dir":"Articles","previous_headings":"1. Setting up your API key","what":"b. Using an environment variable","title":"Get Started","text":"persistent method can used across different projects, set API key environment variable. , first need load usethis package. open .Reviron file. Place API key named NIXTLA_API_KEY. ’ll need restart R changes take effect. Keep mind modifying .Renviron file affects R sessions, ’re comfortable , set API key using nixtla_set_api_key function.","code":"library(usethis) usethis::edit_r_environ() # Inside the .Renviron file NIXTLA_API_KEY=\"paste your API key here\""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"validate-your-api-key","dir":"Articles","previous_headings":"1. Setting up your API key","what":"Validate your API key","title":"Get Started","text":"want validate API key, call nixtla_validate_api_key. don’t need validate API key every time set , want check ’s valid.","code":"nixtla_validate_api_key() #> API key validation successful. Happy forecasting! :) #> If you have questions or need support, please email ops@nixtla.io"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"generate-timegpt-forecast","dir":"Articles","previous_headings":"","what":"2. Generate TimeGPT forecast","title":"Get Started","text":"API key set , ’re ready use TimeGPT. ’ll show done using dataset contains prices different electricity markets. generate forecast dataset, use nixtla_client_forecast. Default names time target columns ds y. time target columns different names, specify time_col target_col. Since multiple ids (one every electricity market), ’ll need specify name column contains ids, case unique_id. , simply use id_col=\"unique_id\". can also choose confidence levels (0-100) prediction intervals level.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61 nixtla_client_fcst <- nixtla_client_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(nixtla_client_fcst) #> unique_id ds TimeGPT TimeGPT-lo-95 TimeGPT-lo-80 #> 1 BE 2016-12-31 00:00:00 45.19045 32.60115 40.42074 #> 2 BE 2016-12-31 01:00:00 43.24445 29.30454 36.91513 #> 3 BE 2016-12-31 02:00:00 41.95839 28.17721 35.55863 #> 4 BE 2016-12-31 03:00:00 39.79649 25.42790 33.45859 #> 5 BE 2016-12-31 04:00:00 39.20454 23.53869 30.35095 #> 6 BE 2016-12-31 05:00:00 40.10878 26.90472 31.60236 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 49.96017 57.77975 #> 2 49.57376 57.18435 #> 3 48.35815 55.73957 #> 4 46.13438 54.16507 #> 5 48.05812 54.87038 #> 6 48.61520 53.31284"},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"plot-timegpt-forecast","dir":"Articles","previous_headings":"","what":"3. Plot TimeGPT forecast","title":"Get Started","text":"nixtlar includes function plot historical data output nixtla_client_forecast, nixtla_client_historic, nixtla_client_anomaly_detection nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"nixtla_client_plot(df, nixtla_client_fcst, id_col = \"unique_id\", max_insample_length = 200) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"timegpt-historical-forecast","dir":"Articles","previous_headings":"","what":"1. TimeGPT Historical Forecast","title":"Historical Forecast","text":"generating forecast, sometimes might interested forecasting historical observations. predictions, known fitted values, can help better understand evaluate model’s performance time. TimeGPT method generating fitted values, users can call nixtlar. vignette explain . assumes already set API key. haven’t done , please read Get Started vignette first.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"load-data","dir":"Articles","previous_headings":"","what":"2. Load data","title":"Historical Forecast","text":"vignette, ’ll use electricity consumption dataset included nixtlar, contains hourly prices five different electricity markets.","code":"df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"forecast-historical-data","dir":"Articles","previous_headings":"","what":"3. Forecast historical data","title":"Historical Forecast","text":"generate forecast historical data, use nixtlar::nixtla_client_historic. key parameters method : df: dataframe tsibble time series data. include least column datestamps column observations. Default names columns ds y. different, please specify names. id_col: data contains multiple ids, case, please specify column contains . working single series, leave default (NULL). level: prediction intervals forecast. Notice fitted values initial observations. TimeGPT requires minimum number values generate reliable forecasts. fitted values generated using rolling window, meaning fitted value observation \\(T\\) generated using first \\(T-1\\) observations.","code":"nixtla_client_fitted_values <- nixtla_client_historic(df, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(nixtla_client_fitted_values) #> unique_id ds TimeGPT TimeGPT-lo-80 TimeGPT-lo-95 #> 1 BE 2016-10-27 00:00:00 56.07623 13.95557 -8.341764 #> 2 BE 2016-10-27 01:00:00 52.41973 10.29907 -11.998258 #> 3 BE 2016-10-27 02:00:00 52.81474 10.69408 -11.603250 #> 4 BE 2016-10-27 03:00:00 52.59026 10.46960 -11.827729 #> 5 BE 2016-10-27 04:00:00 52.67297 10.55231 -11.745015 #> 6 BE 2016-10-27 05:00:00 54.10659 11.98593 -10.311399 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 98.19688 120.4942 #> 2 94.54039 116.8377 #> 3 94.93540 117.2327 #> 4 94.71092 117.0082 #> 5 94.79363 117.0910 #> 6 96.22725 118.5246"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"fitted-values-from-nixtlarnixtla_client_forecast","dir":"Articles","previous_headings":"3. Forecast historical data","what":"3.1 Fitted values from nixtlar::nixtla_client_forecast","title":"Historical Forecast","text":"nixtlar::nixtla_client_historic dedicated function calls TimeGPT’s method generating fitted values. However, can also use nixtlar::nixtla_client_forecast add_history=TRUE. generate forecast historical data next \\(h\\) future observations.","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"plot-historical-forecast","dir":"Articles","previous_headings":"","what":"4. Plot historical forecast","title":"Historical Forecast","text":"nixtlar includes function plot historical data output nixtla_client_forecast, nixtla_client_historic, nixtla_client_anomaly_detection nixtla_client_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"nixtla_client_plot(df, nixtla_client_fitted_values, id_col = \"unique_id\", max_insample_length = 200) #> Frequency chosen: H"},{"path":"https://nixtla.github.io/nixtlar/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Mariana Menchero. Author, maintainer. First author maintainer Nixtla. Copyright holder. Copyright held Nixtla","code":""},{"path":"https://nixtla.github.io/nixtlar/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Menchero M (2024). nixtlar: Software Development Kit Nixtla's TimeGPT. R package version 0.5.0, https://docs.nixtla.io/, https://nixtla.github.io/nixtlar/.","code":"@Manual{, title = {nixtlar: A Software Development Kit for Nixtla's TimeGPT}, author = {Mariana Menchero}, year = {2024}, note = {R package version 0.5.0, https://docs.nixtla.io/}, url = {https://nixtla.github.io/nixtlar/}, }"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"timegpt-1","dir":"","previous_headings":"","what":"TimeGPT-1","title":"A Software Development Kit for Nixtla's TimeGPT","text":"first foundation model time series forecasting anomaly detection TimeGPT production-ready, generative pretrained transformer time series forecasting, developed Nixtla. capable accurately predicting various domains retail, electricity, finance, IoT, just lines code. Additionally, can detect anomalies time series data. TimeGPT initially developed Python now available R users nixtlar package.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of Contents","title":"A Software Development Kit for Nixtla's TimeGPT","text":"Installation Forecast Using TimeGPT 3 Easy Steps Anomaly Detection Using TimeGPT 3 Easy Steps Features Capabilities Documentation API Support Cite License Get Touch","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"quickstart","dir":"","previous_headings":"","what":"Quickstart","title":"A Software Development Kit for Nixtla's TimeGPT","text":"https://github.com/Nixtla/nixtlar/assets/47995617/1be6d63c-7cfd-4c29-b8e8-f7378c982724","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A Software Development Kit for Nixtla's TimeGPT","text":"can install development version nixtlar GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"Nixtla/nixtlar\")"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"forecast-using-timegpt-in-3-easy-steps","dir":"","previous_headings":"","what":"Forecast Using TimeGPT in 3 Easy Steps","title":"A Software Development Kit for Nixtla's TimeGPT","text":"Set API key. Get dashboard.nixtla.io Load sample data Forecast next 8 steps ahead Optionally, plot results","code":"library(nixtlar) nixtla_set_api_key(api_key = \"Your API key here\") df <- nixtlar::electricity head(df) #> unique_id ds y #> 1 BE 2016-10-22 00:00:00 70.00 #> 2 BE 2016-10-22 01:00:00 37.10 #> 3 BE 2016-10-22 02:00:00 37.10 #> 4 BE 2016-10-22 03:00:00 44.75 #> 5 BE 2016-10-22 04:00:00 37.10 #> 6 BE 2016-10-22 05:00:00 35.61 nixtla_client_fcst <- nixtla_client_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(nixtla_client_fcst) #> unique_id ds TimeGPT TimeGPT-lo-95 TimeGPT-lo-80 #> 1 BE 2016-12-31 00:00:00 45.19045 32.60115 40.42074 #> 2 BE 2016-12-31 01:00:00 43.24445 29.30454 36.91513 #> 3 BE 2016-12-31 02:00:00 41.95839 28.17721 35.55863 #> 4 BE 2016-12-31 03:00:00 39.79649 25.42790 33.45859 #> 5 BE 2016-12-31 04:00:00 39.20454 23.53869 30.35095 #> 6 BE 2016-12-31 05:00:00 40.10878 26.90472 31.60236 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 49.96017 57.77975 #> 2 49.57376 57.18435 #> 3 48.35815 55.73957 #> 4 46.13438 54.16507 #> 5 48.05812 54.87038 #> 6 48.61520 53.31284 nixtla_client_plot(df, nixtla_client_fcst, id_col = \"unique_id\", max_insample_length = 200)"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"anomaly-detection-using-timegpt-in-3-easy-steps","dir":"","previous_headings":"","what":"Anomaly Detection Using TimeGPT in 3 Easy Steps","title":"A Software Development Kit for Nixtla's TimeGPT","text":"anomaly detection TimeGPT, also 3 easy steps! Follow steps 1 2 previous section use nixtla_client_detect_anomalies nixtla_client_plot functions.","code":"nixtla_client_anomalies <- nixtlar::nixtla_client_detect_anomalies(df, id_col = \"unique_id\") #> Frequency chosen: H head(nixtla_client_anomalies) #> unique_id ds y anomaly TimeGPT-lo-99 TimeGPT #> 1 BE 2016-10-27 00:00:00 52.58 0 -28.58336 56.07623 #> 2 BE 2016-10-27 01:00:00 44.86 0 -32.23986 52.41973 #> 3 BE 2016-10-27 02:00:00 42.31 0 -31.84485 52.81474 #> 4 BE 2016-10-27 03:00:00 39.66 0 -32.06933 52.59026 #> 5 BE 2016-10-27 04:00:00 38.98 0 -31.98661 52.67297 #> 6 BE 2016-10-27 05:00:00 42.31 0 -30.55300 54.10659 #> TimeGPT-hi-99 #> 1 140.7358 #> 2 137.0793 #> 3 137.4743 #> 4 137.2498 #> 5 137.3326 #> 6 138.7662 nixtlar::nixtla_client_plot(df, nixtla_client_anomalies, id_col = \"unique_id\", plot_anomalies = TRUE)"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"features-and-capabilities","dir":"","previous_headings":"","what":"Features and Capabilities","title":"A Software Development Kit for Nixtla's TimeGPT","text":"nixtlar provides access TimeGPT’s features capabilities, : Zero-shot Inference: TimeGPT can generate forecasts detect anomalies straight box, requiring prior training data. allows immediate deployment quick insights time series data. Fine-tuning: Enhance TimeGPT’s capabilities fine-tuning model specific datasets, enabling model adapt nuances unique time series data improving performance tailored tasks. Add Exogenous Variables: Incorporate additional variables might influence predictions enhance forecast accuracy. (E.g. Special Dates, events prices) Multiple Series Forecasting: Simultaneously forecast multiple time series data, optimizing workflows resources. Custom Loss Function: Tailor fine-tuning process custom loss function meet specific performance metrics. Cross Validation: Implement box cross-validation techniques ensure model robustness generalizability. Prediction Intervals: Provide intervals predictions quantify uncertainty effectively. Irregular Timestamps: Handle data irregular timestamps, accommodating non-uniform interval series without preprocessing.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"A Software Development Kit for Nixtla's TimeGPT","text":"comprehensive documentation, please refer vignettes, cover wide range topics help effectively use nixtlar. current documentation includes guides : Get started set API key anomaly detection Generate historical forecasts Perform time series cross-validation documentation ongoing effort, working expanding coverage.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"api-support","dir":"","previous_headings":"","what":"API Support","title":"A Software Development Kit for Nixtla's TimeGPT","text":"Python user? yes, check Python SDK TimeGPT. can also refer API reference support programming languages.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"how-to-cite","dir":"","previous_headings":"","what":"How to Cite","title":"A Software Development Kit for Nixtla's TimeGPT","text":"find TimeGPT useful research, please consider citing TimeGPT-1 paper. associated reference shown . Garza, ., Challu, C., & Mergenthaler-Canseco, M. (2024). TimeGPT-1. arXiv preprint arXiv:2310.03589. Available https://arxiv.org/abs/2310.03589","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"A Software Development Kit for Nixtla's TimeGPT","text":"TimeGPT closed source. However, SDK open source available Apache 2.0 License, feel free contribute!","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"get-in-touch","dir":"","previous_headings":"","what":"Get in Touch","title":"A Software Development Kit for Nixtla's TimeGPT","text":"welcome input contributions nixtlar package! Report Issues: encounter bug suggestion improve package, please open issue GitHub. Contribute: can contribute opening pull request repository. Whether fixing bug, adding new feature, improving documentation, appreciate help making nixtlar better.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":null,"dir":"Reference","previous_headings":"","what":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"Infer frequency tsibble convert index date string.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"","code":"date_conversion(df)"},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"df tsibble.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"list inferred frequency df new index.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/date_conversion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Infer frequency of a tsibble and convert its index to date or string. — date_conversion","text":"","code":"df <- AirPassengers tsbl <- tsibble::as_tsibble(df) names(tsbl) <- c(\"ds\", \"y\") date_conversion(tsbl) #> Frequency chosen: MS #> $df #> # A tibble: 144 × 2 #> ds y #> #> 1 1949-01-01 112 #> 2 1949-02-01 118 #> 3 1949-03-01 132 #> 4 1949-04-01 129 #> 5 1949-05-01 121 #> 6 1949-06-01 135 #> 7 1949-07-01 148 #> 8 1949-08-01 148 #> 9 1949-09-01 136 #> 10 1949-10-01 119 #> # ℹ 134 more rows #> #> $freq #> [1] \"MS\" #>"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"Get NIXTLA_API_KEY options .Renviron private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"","code":".get_api_key()"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"available, NIXTLA_API_KEY. Otherwise returns error message asking user set API key.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get NIXTLA_API_KEY from options or from .Renviron This is a private function of nixtlar — .get_api_key","text":"","code":"if (FALSE) { .get_api_key() }"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"Prepares data TimeGPT's API private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"","code":".nixtla_data_prep(df, freq, id_col, time_col, target_col)"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"df tsibble data frame time series data. freq Frequency data. id_col Column identifies series. named unique_id. time_col Column identifies timestep. named ds. target_col Column contains target variable. named y.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"list given inferred frequency, prepared data, original data frame renamed.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-nixtla_data_prep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prepares data for TimeGPT's API This is a private function of nixtlar — .nixtla_data_prep","text":"","code":"df <- nixtlar::electricity data <- .nixtla_data_prep(df, freq=\"H\")"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"Validate exogenous variables (applicable) private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"","code":".validate_exogenous(df, h, X_df)"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"df tsibble data frame time series data. h Forecast horizon. X_df tsibble data frame future exogenous variables.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"list result validation (TRUE/FALSE) error message (applicable)","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-validate_exogenous.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate exogenous variables (if applicable) This is a private function of nixtlar — .validate_exogenous","text":"","code":"if (FALSE) { df <- nixtlar::electricity_exo_vars X_df <- nixtlar::electricity_future_exo_vars .validate_exogenous(df, h=24, X_df) }"},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":null,"dir":"Reference","previous_headings":"","what":"Electricity dataset — electricity","title":"Electricity dataset — electricity","text":"Contains prices different electricity markets.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Electricity dataset — electricity","text":"","code":"electricity"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":"electricity","dir":"Reference","previous_headings":"","what":"electricity","title":"Electricity dataset — electricity","text":"data frame 8400 rows 3 columns: unique_id Unique identifiers electricity markets. ds Date format YYYY:MM:DD hh:mm:ss. y Price given market date.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Electricity dataset — electricity","text":"https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Electricity dataset with exogenous variables — electricity_exo_vars","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"Contains prices different electricity markets exogenous variables.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"","code":"electricity_exo_vars"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":"electricity-exo-vars","dir":"Reference","previous_headings":"","what":"electricity_exo_vars","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"data frame 8400 rows 12 columns: unique_id Unique identifiers electricity markets. ds Date format YYYY:MM:DD hh:mm:ss. y Price given market date. Exogenous1 external factor influencing prices. markets, form day-ahead load forecast. Exogenous2 external factor influencing prices. \"\" \"FR\" markets, day-ahead generation forecast. \"NP\", day-ahead wind generation forecast. \"PJM\", day-ahead load forecast specific zone. \"DE\", aggregated day-ahead wind solar generation forecasts. day_0 Binary variable indicating weekday. day_1 Binary variable indicating weekday. day_2 Binary variable indicating weekday. day_3 Binary variable indicating weekday. day_4 Binary variable indicating weekday. day_5 Binary variable indicating weekday. day_6 Binary variable indicating weekday.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_exo_vars.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Electricity dataset with exogenous variables — electricity_exo_vars","text":"https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"Contains future values exogenous variables electricity dataset (24 steps-ahead). used electricity_exo_vars.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"","code":"electricity_future_exo_vars"},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":"electricity-future-exo-vars","dir":"Reference","previous_headings":"","what":"electricity_future_exo_vars","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"data frame 120 rows 11 columns: unique_id Unique identifiers electricity markets. ds Date format YYYY:MM:DD hh:mm:ss. Exogenous1 external factor influencing prices. markets, form day-ahead load forecast. Exogenous2 external factor influencing prices. \"\" \"FR\" markets, day-ahead generation forecast. \"NP\", day-ahead wind generation forecast. \"PJM\", day-ahead load forecast specific zone. \"DE\", aggregated day-ahead wind solar generation forecasts. day_0 Binary variable indicating weekday. day_1 Binary variable indicating weekday. day_2 Binary variable indicating weekday. day_3 Binary variable indicating weekday. day_4 Binary variable indicating weekday. day_5 Binary variable indicating weekday. day_6 Binary variable indicating weekday.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/electricity_future_exo_vars.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Future values for the electricity dataset with exogenous variables — electricity_future_exo_vars","text":"https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short-future-ex-vars.csv","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":null,"dir":"Reference","previous_headings":"","what":"Infer frequency of a data frame. — infer_frequency","title":"Infer frequency of a data frame. — infer_frequency","text":"Infer frequency data frame.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Infer frequency of a data frame. — infer_frequency","text":"","code":"infer_frequency(df)"},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Infer frequency of a data frame. — infer_frequency","text":"df data frame time series data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Infer frequency of a data frame. — infer_frequency","text":"inferred frequency.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/infer_frequency.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Infer frequency of a data frame. — infer_frequency","text":"","code":"df <- nixtlar::electricity infer_frequency(df) #> Frequency chosen: H #> [1] \"H\""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtlaR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"nixtlar: A Software Development Kit for Nixtla's TimeGPT — nixtlar-package","title":"nixtlar: A Software Development Kit for Nixtla's TimeGPT — nixtlar-package","text":"Software Development Kit working Nixtla’s TimeGPT, foundation model time series forecasting. \"API\" acronym \"application programming interface\"; package allows users interact TimeGPT via API. can set validate API keys generate forecasts via API calls. compatible 'tsibble' base R. details visit https://docs.nixtla.io/.","code":""},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/nixtlaR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nixtlar: A Software Development Kit for Nixtla's TimeGPT — nixtlar-package","text":"Maintainer: Mariana Menchero mariana@nixtla.io (First author maintainer) contributors: Nixtla (Copyright held Nixtla) [copyright holder]","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"Perform cross validation TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"","code":"nixtla_client_cross_validation( df, h = 8, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", X_df = NULL, level = NULL, n_windows = 1, step_size = NULL, finetune_steps = 0, finetune_loss = \"default\", clean_ex_first = TRUE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"df tsibble data frame time series data. h Forecast horizon. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. X_df tsibble data frame future exogenous variables. level confidence levels (0-100) prediction intervals. n_windows Number windows evaluate. step_size Step size cross validation window. NULL, equal forecast horizon (h). finetune_steps Number steps used finetune TimeGPT new data. finetune_loss Loss function use finetuning. Options : \"default\", \"mae\", \"mse\", \"rmse\", \"mape\", \"smape\". clean_ex_first Clean exogenous signal making forecasts using TimeGPT. model Model use, either \"timegpt-1\" \"timegpt-1-long-horizon\". Use \"timegpt-1-long-horizon\" want forecast one seasonal period given frequency data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"tsibble data frame TimeGPT's cross validation.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_cross_validation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform cross validation with TimeGPT. — nixtla_client_cross_validation","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"Detect anomalies TimeGPT","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"","code":"nixtla_client_detect_anomalies( df, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", level = c(99), clean_ex_first = TRUE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"df tsibble data frame time series data. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. level confidence level (0-100) prediction interval used anomaly detection. Default 99. clean_ex_first Clean exogenous signal making forecasts using TimeGPT. model Model use, either \"timegpt-1\" \"timegpt-1-long-horizon\". Use \"timegpt-1-long-horizon\" want forecast one seasonal period given frequency data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"tsibble data frame anomalies detected historical period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_detect_anomalies.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect anomalies with TimeGPT — nixtla_client_detect_anomalies","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_anomaly_detection(df, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast — nixtla_client_forecast","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"Generate TimeGPT forecast","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"","code":"nixtla_client_forecast( df, h = 8, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", X_df = NULL, level = NULL, finetune_steps = 0, finetune_loss = \"default\", clean_ex_first = TRUE, add_history = FALSE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"df tsibble data frame time series data. h Forecast horizon. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. X_df tsibble data frame future exogenous variables. level confidence levels (0-100) prediction intervals. finetune_steps Number steps used finetune TimeGPT new data. finetune_loss Loss function use finetuning. Options : \"default\", \"mae\", \"mse\", \"rmse\", \"mape\", \"smape\". clean_ex_first Clean exogenous signal making forecasts using TimeGPT. add_history Return fitted values model. model Model use, either \"timegpt-1\" \"timegpt-1-long-horizon\". Use \"timegpt-1-long-horizon\" want forecast one seasonal period given frequency data.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"TimeGPT's forecast.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast — nixtla_client_forecast","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"Generate TimeGPT forecast -sample period (historical period).","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"","code":"nixtla_client_historic( df, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", level = NULL, finetune_steps = 0, finetune_loss = \"default\", clean_ex_first = TRUE )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"df tsibble data frame time series data. freq Frequency data. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. level confidence levels (0-100) prediction intervals. finetune_steps Number steps used finetune TimeGPT new data. finetune_loss Loss function use finetuning. Options : \"default\", \"mae\", \"mse\", \"rmse\", \"mape\", \"smape\". clean_ex_first Clean exogenous signal making forecasts using TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"TimeGPT's forecast -sample period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_historic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast for the in-sample period (historical period). — nixtla_client_historic","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_historic(df, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"Plot output following nixtla_client functions: forecast, historic, anomaly_detection, cross_validation.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"","code":"nixtla_client_plot( df, fcst = NULL, h = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", unique_ids = NULL, max_insample_length = NULL, plot_anomalies = FALSE )"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"df tsibble data frame time series data (insample values). fcst tsibble data frame TimeGPT point forecast prediction intervals (available). h Forecast horizon. id_col Column identifies series. time_col Column identifies timestep. target_col Column contains target variable. unique_ids Time series plot. NULL (default), selection random. max_insample_length Max number insample observations plotted. plot_anomalies Whether plot anomalies.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"Corresponding plot.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_client_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the output of the following nixtla_client functions: forecast, historic, anomaly_detection, and cross_validation. — nixtla_client_plot","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") df <- nixtlar::electricity fcst <- nixtlar::nixtla_client_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) nixtlar::timegpt_plot(df, fcst, h=8, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Set API key in global environment — nixtla_set_api_key","title":"Set API key in global environment — nixtla_set_api_key","text":"Set API key global environment","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set API key in global environment — nixtla_set_api_key","text":"","code":"nixtla_set_api_key(api_key)"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set API key in global environment — nixtla_set_api_key","text":"api_key user's API key. Get : https://dashboard.nixtla.io/","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set API key in global environment — nixtla_set_api_key","text":"message indicating API key set global environment.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set API key in global environment — nixtla_set_api_key","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate API key — nixtla_validate_api_key","title":"Validate API key — nixtla_validate_api_key","text":"Validate API key","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate API key — nixtla_validate_api_key","text":"","code":"nixtla_validate_api_key()"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate API key — nixtla_validate_api_key","text":"status code message indicating whether API key valid.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate API key — nixtla_validate_api_key","text":"","code":"if (FALSE) { nixtlar::nixtla_set_api_key(\"YOUR_API_KEY\") nixtlar::nixtla_validate_api_key }"},{"path":"https://nixtla.github.io/nixtlar/news/index.html","id":"nixtlar-050","dir":"Changelog","previous_headings":"","what":"nixtlar 0.5.0","title":"nixtlar 0.5.0","text":"Initial CRAN submission.","code":""}] diff --git a/sitemap.xml b/sitemap.xml index 8f219cd..25e861d 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -12,6 +12,9 @@ https://nixtla.github.io/nixtlar/articles/cross-validation.html + + https://nixtla.github.io/nixtlar/articles/exogenous-variables.html + https://nixtla.github.io/nixtlar/articles/get-started.html