From 4fc8aac0fe0d1088e25b015be9b9e89615eb1e27 Mon Sep 17 00:00:00 2001 From: MMenchero <47995617+MMenchero@users.noreply.github.com> Date: Sat, 3 Feb 2024 19:34:46 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Nixtla/n?= =?UTF-8?q?ixtlar@a80013ab126ba73c3c0a809177f4ad168e5365dd=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/get-started.html | 5 ++++- pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/articles/get-started.html b/articles/get-started.html index ad11cb2..e6fc2f7 100644 --- a/articles/get-started.html +++ b/articles/get-started.html @@ -138,7 +138,10 @@

b. Using an environment variable
 # Inside the .Renviron file 
 TIMEGPT_TOKEN="paste your token here"
-

You’ll need to restart R for changes to take effect.

+

You’ll need to restart R for changes to take effect. Keep in mind +that modifying the .Renviron file affects all of your R +sessions, so if you’re not comfortable with this, set your token using +the nixtla_set_token function.

Validate your token diff --git a/pkgdown.yml b/pkgdown.yml index 3681db2..5895d2f 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -6,7 +6,7 @@ articles: cross-validation: cross-validation.html get-started: get-started.html historical-forecast: historical-forecast.html -last_built: 2024-02-02T03:02Z +last_built: 2024-02-03T19:34Z urls: reference: https://nixtla.github.io/nixtlar/reference article: https://nixtla.github.io/nixtlar/articles diff --git a/search.json b/search.json index 0ae5b67..f82d030 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 TimeGPT token. 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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05"},{"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::timegpt_anomaly_detection. 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). anomaly_detection method TimeGPT evaluates observation uses prediction interval determine anomaly . default, nixtlar::timegpt_anomaly_detection 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::timegpt_anomaly_detection use maximum.","code":"timegpt_anomalies <- nixtlar::timegpt_anomaly_detection(df, id_col = \"unique_id\") #> Frequency chosen: H head(timegpt_anomalies) #> unique_id ds y anomaly TimeGPT-lo-99 TimeGPT #> 1 BE 2016-12-06 00:00:00 60.63 0 28.24067 55.75632 #> 2 BE 2016-12-06 01:00:00 50.74 0 25.30454 52.82020 #> 3 BE 2016-12-06 02:00:00 52.10 0 19.33541 46.85107 #> 4 BE 2016-12-06 03:00:00 49.73 0 23.12522 50.64088 #> 5 BE 2016-12-06 04:00:00 48.19 0 24.90475 52.42040 #> 6 BE 2016-12-06 05:00:00 54.14 0 28.14027 55.65592 #> TimeGPT-hi-99 #> 1 83.27198 #> 2 80.33585 #> 3 74.36673 #> 4 78.15653 #> 5 79.93606 #> 6 83.17158"},{"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::timegpt_forecast, nixtlar::timegpt_historic, nixtlar::timegpt_anomaly_detection nixtlar::timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::timegpt_plot output nixtlar::timegpt_anomaly_detection, set plot_anomalies=TRUE plot anomalies.","code":"nixtlar::timegpt_plot(df, timegpt_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 TimeGPT token. 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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05"},{"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::timegpt_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":"timegpt_cv <- timegpt_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) #> Frequency chosen: H head(timegpt_cv) #> unique_id ds cutoff y TimeGPT #> 1 BE 2016-12-29 08:00:00 2016-12-29 07:00:00 53.30 50.92544 #> 2 BE 2016-12-29 09:00:00 2016-12-29 07:00:00 53.93 55.10679 #> 3 BE 2016-12-29 10:00:00 2016-12-29 07:00:00 56.63 56.22322 #> 4 BE 2016-12-29 11:00:00 2016-12-29 07:00:00 55.66 54.72299 #> 5 BE 2016-12-29 12:00:00 2016-12-29 07:00:00 48.00 53.99146 #> 6 BE 2016-12-29 13:00:00 2016-12-29 07:00:00 46.53 53.56912"},{"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::timegpt_forecast, nixtlar::timegpt_historic, nixtlar::timegpt_anomaly_detection nixtlar::timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::timegpt_plot output nixtlar::timegpt_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":"timegpt_plot(df, timegpt_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-authentication-token","dir":"Articles","previous_headings":"","what":"1. Setting up your authentication token","title":"Get Started","text":"First, need set authentication token. token string characters allows authenticate requests using TimeGPT via nixtlar. token needs provided Nixtla, don’t one, please request one . using nixtlar, two ways setting token:","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"a--using-the-nixtla_set_token-function","dir":"Articles","previous_headings":"1. Setting up your authentication token","what":"a. Using the nixtla_set_token function","title":"Get Started","text":"nixtlar function easily set token current R session. Simply call Keep mind close R session re-start , ’ll need set token .","code":"nixtla_set_token(token = \"paste your token 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 authentication token","what":"b. Using an environment variable","title":"Get Started","text":"persistent method can used across different projects, set token environment variable. , first need load usethis package. open .Reviron file. Place token named TIMEGPT_TOKEN. ’ll need restart R changes take effect.","code":"library(usethis) usethis::edit_r_environ() # Inside the .Renviron file TIMEGPT_TOKEN=\"paste your token here\""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"validate-your-token","dir":"Articles","previous_headings":"1. Setting up your authentication token","what":"Validate your token","title":"Get Started","text":"want validate token, call nixtla_validate_token. don’t need validate token every time set , want check ’s valid.","code":"nixtla_validate_token() #> Token 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":"token set , ’re ready use TimeGPT. ’ll show done using dataset contains prices different electricity markets. generate forecast dataset, use timegpt_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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05 timegpt_fcst <- timegpt_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(timegpt_fcst) #> unique_id ds TimeGPT TimeGPT-lo-95 TimeGPT-lo-80 #> 1 BE 2016-12-31 00:00:00 46.15118 40.11228 41.65808 #> 2 BE 2016-12-31 01:00:00 42.42660 36.34587 38.53782 #> 3 BE 2016-12-31 02:00:00 40.24289 32.62376 34.97455 #> 4 BE 2016-12-31 03:00:00 38.26534 27.71345 33.37666 #> 5 BE 2016-12-31 04:00:00 36.61880 21.07923 30.73447 #> 6 BE 2016-12-31 05:00:00 37.91309 25.92234 31.29036 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 50.64427 52.19007 #> 2 46.31538 48.50734 #> 3 45.51123 47.86201 #> 4 43.15402 48.81723 #> 5 42.50313 52.15837 #> 6 44.53581 49.90383"},{"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 timegpt_forecast, timegpt_historic, timegpt_anomaly_detection timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"timegpt_plot(df, timegpt_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 TimeGPT token. 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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05"},{"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::timegpt_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":"timegpt_fitted_values <- timegpt_historic(df, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(timegpt_fitted_values) #> unique_id ds TimeGPT TimeGPT-lo-80 TimeGPT-lo-95 #> 1 BE 2016-12-06 00:00:00 55.75632 42.06646 34.81949 #> 2 BE 2016-12-06 01:00:00 52.82020 39.13034 31.88337 #> 3 BE 2016-12-06 02:00:00 46.85107 33.16121 25.91424 #> 4 BE 2016-12-06 03:00:00 50.64088 36.95103 29.70406 #> 5 BE 2016-12-06 04:00:00 52.42040 38.73055 31.48357 #> 6 BE 2016-12-06 05:00:00 55.65593 41.96607 34.71910 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 69.44617 76.69314 #> 2 66.51005 73.75703 #> 3 60.54093 67.78790 #> 4 64.33074 71.57771 #> 5 66.11026 73.35723 #> 6 69.34579 76.59276"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"fitted-values-from-nixtlartimegpt_forecast","dir":"Articles","previous_headings":"3. Forecast historical data","what":"3.1 Fitted values from nixtlar::timegpt_forecast","title":"Historical Forecast","text":"nixtlar::timegpt_historic dedicated function calls TimeGPT’s method generating fitted values. However, can also use nixtlar::timegpt_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 timegpt_forecast, timegpt_historic, timegpt_anomaly_detection timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"timegpt_plot(df, timegpt_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: R SDK Nixtla's TimeGPT. R package version 1.0.0, https://nixtla.github.io/nixtlar/.","code":"@Manual{, title = {nixtlar: R SDK for Nixtla's TimeGPT}, author = {Mariana Menchero}, year = {2024}, note = {R package version 1.0.0}, url = {https://nixtla.github.io/nixtlar/}, }"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"nixtlar-","dir":"","previous_headings":"","what":"R SDK for Nixtla's TimeGPT","title":"R SDK for Nixtla's TimeGPT","text":"nixtlar package provides R users SDK Nixtla’s TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"your-gateway-to-timegpt","dir":"","previous_headings":"","what":"Your gateway to TimeGPT","title":"R SDK for Nixtla's TimeGPT","text":"TimeGPT cutting-edge generative pre-trained transformer model trained largest collection publicly available time series data. Accessible R users via nixtlar package, TimeGPT democratizes forecasting, enabling rapid accurate predictions, even datasets seen training. Learn TimeGPT .","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R SDK 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":"example","dir":"","previous_headings":"","what":"Example","title":"R SDK for Nixtla's TimeGPT","text":"Get started TimeGPT now. Using TimeGPT nixtlar requires token provided Nixtla. see obtain learn different ways set , please read Get Started guide. , can also find detailed explanation forecast plot functions work.","code":"library(nixtlar) # Load sample dataset df <- nixtlar::electricity # this can also be a tsibble! # Set TIMEGPT Token nixtlar::nixtla_set_token(\"TIMEGPT TOKEN\") # Forecast the next 8 steps using TimeGPT fcst <- nixtlar::timegpt_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) # Plot TimeGPT forecast nixtlar::timegpt_plot(df, fcst, h = 8, id_col = \"unique_id\", max_insample_length = 100)"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"main-features-of-nixtlar","dir":"","previous_headings":"","what":"Main features of nixtlar","title":"R SDK for Nixtla's TimeGPT","text":"Works data frames tsibbles. Allows use TimeGPT’s main features, including: Anomaly detection Exogenous variables Prediction intervals Finetuning Multiple time series Historical forecast Cross-validation Includes plot function. Please read Articles check Reference understand can use features.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"python-sdk","dir":"","previous_headings":"","what":"Python SDK","title":"R SDK for Nixtla's TimeGPT","text":"Python user? yes, check Python SDK TimeGPT.","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_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"Get TIMEGPT_TOKEN options .Renviron private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"","code":".get_token()"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"available, TIMEGTP_TOKEN. Otherwise returns error message asking user set token.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"","code":"if (FALSE) { .get_token() }"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"Prepares data TimeGPT's API private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"","code":".timegpt_data_prep(df, freq, id_col, time_col, target_col)"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_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-timegpt_data_prep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"list given inferred frequency, prepared data, original data frame renamed.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"","code":"df <- nixtlar::electricity data <- .timegpt_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)\nThis is a private function of nixtlar — .validate_exogenous","title":"Validate exogenous variables (if applicable)\nThis 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)\nThis 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)\nThis 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)\nThis is a private function of nixtlar — .validate_exogenous","text":"list result validation (TRUE/FALSE) error message (applicable)","code":""},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":null,"dir":"Reference","previous_headings":"","what":"Electricity short dataset — electricity","title":"Electricity short 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 short 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 short dataset — electricity","text":"data frame 3,600 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 short 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/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: R SDK for Nixtla's TimeGPT — nixtlar-package","title":"nixtlar: R SDK for Nixtla's TimeGPT — nixtlar-package","text":"SDK interface Nixtla's TimeGPT R. provides functions setting validating tokens generating forecasts TimeGPT via API calls. Compatible tsibble package base R.","code":""},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/nixtlaR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nixtlar: R SDK 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_set_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Set token in global environment — nixtla_set_token","title":"Set token in global environment — nixtla_set_token","text":"Set token global environment","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set token in global environment — nixtla_set_token","text":"","code":"nixtla_set_token(token)"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set token in global environment — nixtla_set_token","text":"token user's token. Get : https://dashboard.nixtla.io/","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set token in global environment — nixtla_set_token","text":"message indicating token set global environment.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set token in global environment — nixtla_set_token","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate token — nixtla_validate_token","title":"Validate token — nixtla_validate_token","text":"Validate token","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate token — nixtla_validate_token","text":"","code":"nixtla_validate_token()"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate token — nixtla_validate_token","text":"status code message indicating whether token valid.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate token — nixtla_validate_token","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") nixtlar::nixtla_validate_token }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_anomaly_detection.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"Detect anomalies TimeGPT","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_anomaly_detection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"","code":"timegpt_anomaly_detection( 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/timegpt_anomaly_detection.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","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/timegpt_anomaly_detection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"tsibble data frame anomalies detected historical period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_anomaly_detection.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_anomaly_detection(df, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform cross validation with TimeGPT. — timegpt_cross_validation","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"Perform cross validation TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"","code":"timegpt_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, clean_ex_first = TRUE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform cross validation with TimeGPT. — timegpt_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. 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/timegpt_cross_validation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"tsibble data frame TimeGPT's cross validation.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast — timegpt_forecast","title":"Generate TimeGPT forecast — timegpt_forecast","text":"Generate TimeGPT forecast","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast — timegpt_forecast","text":"","code":"timegpt_forecast( df, h = 8, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", X_df = NULL, level = NULL, finetune_steps = 0, clean_ex_first = TRUE, add_history = FALSE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast — timegpt_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. 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/timegpt_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast — timegpt_forecast","text":"TimeGPT's forecast.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast — timegpt_forecast","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"Generate TimeGPT forecast -sample period (historical period).","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"","code":"timegpt_historic( df, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", level = NULL, finetune_steps = 0, clean_ex_first = TRUE )"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_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. clean_ex_first Clean exogenous signal making forecasts using TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"TimeGPT's forecast -sample period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_historic(df, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot forecast and insample values. — timegpt_plot","title":"Plot forecast and insample values. — timegpt_plot","text":"Plot forecast insample values.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot forecast and insample values. — timegpt_plot","text":"","code":"timegpt_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/timegpt_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot forecast and insample values. — timegpt_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/timegpt_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot forecast and insample values. — timegpt_plot","text":"Plot forecast insample values","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot forecast and insample values. — timegpt_plot","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) nixtlar::timegpt_plot(df, fcst, h=8, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/news/index.html","id":"nixtlar-100","dir":"Changelog","previous_headings":"","what":"nixtlar 1.0.0","title":"nixtlar 1.0.0","text":"Initial CRAN submission. Includes functions set validate token, call TimeGPT main methods (forecast, historical forecast, anomaly detection cross-validation), plot results.","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 TimeGPT token. 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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05"},{"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::timegpt_anomaly_detection. 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). anomaly_detection method TimeGPT evaluates observation uses prediction interval determine anomaly . default, nixtlar::timegpt_anomaly_detection 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::timegpt_anomaly_detection use maximum.","code":"timegpt_anomalies <- nixtlar::timegpt_anomaly_detection(df, id_col = \"unique_id\") #> Frequency chosen: H head(timegpt_anomalies) #> unique_id ds y anomaly TimeGPT-lo-99 TimeGPT #> 1 BE 2016-12-06 00:00:00 60.63 0 28.24067 55.75632 #> 2 BE 2016-12-06 01:00:00 50.74 0 25.30454 52.82020 #> 3 BE 2016-12-06 02:00:00 52.10 0 19.33541 46.85107 #> 4 BE 2016-12-06 03:00:00 49.73 0 23.12522 50.64088 #> 5 BE 2016-12-06 04:00:00 48.19 0 24.90475 52.42040 #> 6 BE 2016-12-06 05:00:00 54.14 0 28.14027 55.65592 #> TimeGPT-hi-99 #> 1 83.27198 #> 2 80.33585 #> 3 74.36673 #> 4 78.15653 #> 5 79.93606 #> 6 83.17158"},{"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::timegpt_forecast, nixtlar::timegpt_historic, nixtlar::timegpt_anomaly_detection nixtlar::timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::timegpt_plot output nixtlar::timegpt_anomaly_detection, set plot_anomalies=TRUE plot anomalies.","code":"nixtlar::timegpt_plot(df, timegpt_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 TimeGPT token. 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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05"},{"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::timegpt_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":"timegpt_cv <- timegpt_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) #> Frequency chosen: H head(timegpt_cv) #> unique_id ds cutoff y TimeGPT #> 1 BE 2016-12-29 08:00:00 2016-12-29 07:00:00 53.30 50.92544 #> 2 BE 2016-12-29 09:00:00 2016-12-29 07:00:00 53.93 55.10679 #> 3 BE 2016-12-29 10:00:00 2016-12-29 07:00:00 56.63 56.22322 #> 4 BE 2016-12-29 11:00:00 2016-12-29 07:00:00 55.66 54.72299 #> 5 BE 2016-12-29 12:00:00 2016-12-29 07:00:00 48.00 53.99146 #> 6 BE 2016-12-29 13:00:00 2016-12-29 07:00:00 46.53 53.56912"},{"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::timegpt_forecast, nixtlar::timegpt_historic, nixtlar::timegpt_anomaly_detection nixtlar::timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full). using nixtlar::timegpt_plot output nixtlar::timegpt_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":"timegpt_plot(df, timegpt_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-authentication-token","dir":"Articles","previous_headings":"","what":"1. Setting up your authentication token","title":"Get Started","text":"First, need set authentication token. token string characters allows authenticate requests using TimeGPT via nixtlar. token needs provided Nixtla, don’t one, please request one . using nixtlar, two ways setting token:","code":""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"a--using-the-nixtla_set_token-function","dir":"Articles","previous_headings":"1. Setting up your authentication token","what":"a. Using the nixtla_set_token function","title":"Get Started","text":"nixtlar function easily set token current R session. Simply call Keep mind close R session re-start , ’ll need set token .","code":"nixtla_set_token(token = \"paste your token 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 authentication token","what":"b. Using an environment variable","title":"Get Started","text":"persistent method can used across different projects, set token environment variable. , first need load usethis package. open .Reviron file. Place token named TIMEGPT_TOKEN. ’ll need restart R changes take effect. Keep mind modifying .Renviron file affects R sessions, ’re comfortable , set token using nixtla_set_token function.","code":"library(usethis) usethis::edit_r_environ() # Inside the .Renviron file TIMEGPT_TOKEN=\"paste your token here\""},{"path":"https://nixtla.github.io/nixtlar/articles/get-started.html","id":"validate-your-token","dir":"Articles","previous_headings":"1. Setting up your authentication token","what":"Validate your token","title":"Get Started","text":"want validate token, call nixtla_validate_token. don’t need validate token every time set , want check ’s valid.","code":"nixtla_validate_token() #> Token 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":"token set , ’re ready use TimeGPT. ’ll show done using dataset contains prices different electricity markets. generate forecast dataset, use timegpt_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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05 timegpt_fcst <- timegpt_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(timegpt_fcst) #> unique_id ds TimeGPT TimeGPT-lo-95 TimeGPT-lo-80 #> 1 BE 2016-12-31 00:00:00 46.15118 40.11228 41.65808 #> 2 BE 2016-12-31 01:00:00 42.42660 36.34587 38.53782 #> 3 BE 2016-12-31 02:00:00 40.24289 32.62376 34.97455 #> 4 BE 2016-12-31 03:00:00 38.26534 27.71345 33.37666 #> 5 BE 2016-12-31 04:00:00 36.61880 21.07923 30.73447 #> 6 BE 2016-12-31 05:00:00 37.91309 25.92234 31.29036 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 50.64427 52.19007 #> 2 46.31538 48.50734 #> 3 45.51123 47.86201 #> 4 43.15402 48.81723 #> 5 42.50313 52.15837 #> 6 44.53581 49.90383"},{"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 timegpt_forecast, timegpt_historic, timegpt_anomaly_detection timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"timegpt_plot(df, timegpt_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 TimeGPT token. 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-12-01 00:00:00 72.00 #> 2 BE 2016-12-01 01:00:00 65.80 #> 3 BE 2016-12-01 02:00:00 59.99 #> 4 BE 2016-12-01 03:00:00 50.69 #> 5 BE 2016-12-01 04:00:00 52.58 #> 6 BE 2016-12-01 05:00:00 65.05"},{"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::timegpt_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":"timegpt_fitted_values <- timegpt_historic(df, id_col = \"unique_id\", level = c(80,95)) #> Frequency chosen: H head(timegpt_fitted_values) #> unique_id ds TimeGPT TimeGPT-lo-80 TimeGPT-lo-95 #> 1 BE 2016-12-06 00:00:00 55.75632 42.06646 34.81949 #> 2 BE 2016-12-06 01:00:00 52.82020 39.13034 31.88337 #> 3 BE 2016-12-06 02:00:00 46.85107 33.16121 25.91424 #> 4 BE 2016-12-06 03:00:00 50.64088 36.95103 29.70406 #> 5 BE 2016-12-06 04:00:00 52.42040 38.73055 31.48357 #> 6 BE 2016-12-06 05:00:00 55.65593 41.96607 34.71910 #> TimeGPT-hi-80 TimeGPT-hi-95 #> 1 69.44617 76.69314 #> 2 66.51005 73.75703 #> 3 60.54093 67.78790 #> 4 64.33074 71.57771 #> 5 66.11026 73.35723 #> 6 69.34579 76.59276"},{"path":"https://nixtla.github.io/nixtlar/articles/historical-forecast.html","id":"fitted-values-from-nixtlartimegpt_forecast","dir":"Articles","previous_headings":"3. Forecast historical data","what":"3.1 Fitted values from nixtlar::timegpt_forecast","title":"Historical Forecast","text":"nixtlar::timegpt_historic dedicated function calls TimeGPT’s method generating fitted values. However, can also use nixtlar::timegpt_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 timegpt_forecast, timegpt_historic, timegpt_anomaly_detection timegpt_cross_validation. long series, can use max_insample_length plot last N historical values (forecast always plotted full).","code":"timegpt_plot(df, timegpt_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: R SDK Nixtla's TimeGPT. R package version 1.0.0, https://nixtla.github.io/nixtlar/.","code":"@Manual{, title = {nixtlar: R SDK for Nixtla's TimeGPT}, author = {Mariana Menchero}, year = {2024}, note = {R package version 1.0.0}, url = {https://nixtla.github.io/nixtlar/}, }"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"nixtlar-","dir":"","previous_headings":"","what":"R SDK for Nixtla's TimeGPT","title":"R SDK for Nixtla's TimeGPT","text":"nixtlar package provides R users SDK Nixtla’s TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"your-gateway-to-timegpt","dir":"","previous_headings":"","what":"Your gateway to TimeGPT","title":"R SDK for Nixtla's TimeGPT","text":"TimeGPT cutting-edge generative pre-trained transformer model trained largest collection publicly available time series data. Accessible R users via nixtlar package, TimeGPT democratizes forecasting, enabling rapid accurate predictions, even datasets seen training. Learn TimeGPT .","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R SDK 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":"example","dir":"","previous_headings":"","what":"Example","title":"R SDK for Nixtla's TimeGPT","text":"Get started TimeGPT now. Using TimeGPT nixtlar requires token provided Nixtla. see obtain learn different ways set , please read Get Started guide. , can also find detailed explanation forecast plot functions work.","code":"library(nixtlar) # Load sample dataset df <- nixtlar::electricity # this can also be a tsibble! # Set TIMEGPT Token nixtlar::nixtla_set_token(\"TIMEGPT TOKEN\") # Forecast the next 8 steps using TimeGPT fcst <- nixtlar::timegpt_forecast(df, h = 8, id_col = \"unique_id\", level = c(80,95)) # Plot TimeGPT forecast nixtlar::timegpt_plot(df, fcst, h = 8, id_col = \"unique_id\", max_insample_length = 100)"},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"main-features-of-nixtlar","dir":"","previous_headings":"","what":"Main features of nixtlar","title":"R SDK for Nixtla's TimeGPT","text":"Works data frames tsibbles. Allows use TimeGPT’s main features, including: Anomaly detection Exogenous variables Prediction intervals Finetuning Multiple time series Historical forecast Cross-validation Includes plot function. Please read Articles check Reference understand can use features.","code":""},{"path":"https://nixtla.github.io/nixtlar/index.html","id":"python-sdk","dir":"","previous_headings":"","what":"Python SDK","title":"R SDK for Nixtla's TimeGPT","text":"Python user? yes, check Python SDK TimeGPT.","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_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"Get TIMEGPT_TOKEN options .Renviron private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"","code":".get_token()"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"available, TIMEGTP_TOKEN. Otherwise returns error message asking user set token.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-get_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get TIMEGPT_TOKEN from options or from .Renviron\nThis is a private function of nixtlar — .get_token","text":"","code":"if (FALSE) { .get_token() }"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"Prepares data TimeGPT's API private function nixtlar","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"","code":".timegpt_data_prep(df, freq, id_col, time_col, target_col)"},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_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-timegpt_data_prep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"list given inferred frequency, prepared data, original data frame renamed.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/dot-timegpt_data_prep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prepares data for TimeGPT's API\nThis is a private function of nixtlar — .timegpt_data_prep","text":"","code":"df <- nixtlar::electricity data <- .timegpt_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)\nThis is a private function of nixtlar — .validate_exogenous","title":"Validate exogenous variables (if applicable)\nThis 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)\nThis 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)\nThis 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)\nThis is a private function of nixtlar — .validate_exogenous","text":"list result validation (TRUE/FALSE) error message (applicable)","code":""},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/electricity.html","id":null,"dir":"Reference","previous_headings":"","what":"Electricity short dataset — electricity","title":"Electricity short 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 short 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 short dataset — electricity","text":"data frame 3,600 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 short 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/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: R SDK for Nixtla's TimeGPT — nixtlar-package","title":"nixtlar: R SDK for Nixtla's TimeGPT — nixtlar-package","text":"SDK interface Nixtla's TimeGPT R. provides functions setting validating tokens generating forecasts TimeGPT via API calls. Compatible tsibble package base R.","code":""},{"path":[]},{"path":"https://nixtla.github.io/nixtlar/reference/nixtlaR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nixtlar: R SDK 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_set_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Set token in global environment — nixtla_set_token","title":"Set token in global environment — nixtla_set_token","text":"Set token global environment","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set token in global environment — nixtla_set_token","text":"","code":"nixtla_set_token(token)"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set token in global environment — nixtla_set_token","text":"token user's token. Get : https://dashboard.nixtla.io/","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set token in global environment — nixtla_set_token","text":"message indicating token set global environment.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_set_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set token in global environment — nixtla_set_token","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate token — nixtla_validate_token","title":"Validate token — nixtla_validate_token","text":"Validate token","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate token — nixtla_validate_token","text":"","code":"nixtla_validate_token()"},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate token — nixtla_validate_token","text":"status code message indicating whether token valid.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/nixtla_validate_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate token — nixtla_validate_token","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") nixtlar::nixtla_validate_token }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_anomaly_detection.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"Detect anomalies TimeGPT","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_anomaly_detection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"","code":"timegpt_anomaly_detection( 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/timegpt_anomaly_detection.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","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/timegpt_anomaly_detection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"tsibble data frame anomalies detected historical period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_anomaly_detection.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect anomalies with TimeGPT — timegpt_anomaly_detection","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_anomaly_detection(df, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform cross validation with TimeGPT. — timegpt_cross_validation","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"Perform cross validation TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"","code":"timegpt_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, clean_ex_first = TRUE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform cross validation with TimeGPT. — timegpt_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. 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/timegpt_cross_validation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"tsibble data frame TimeGPT's cross validation.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_cross_validation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform cross validation with TimeGPT. — timegpt_cross_validation","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_cross_validation(df, h = 8, id_col = \"unique_id\", n_windows = 5) }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast — timegpt_forecast","title":"Generate TimeGPT forecast — timegpt_forecast","text":"Generate TimeGPT forecast","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast — timegpt_forecast","text":"","code":"timegpt_forecast( df, h = 8, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", X_df = NULL, level = NULL, finetune_steps = 0, clean_ex_first = TRUE, add_history = FALSE, model = \"timegpt-1\" )"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast — timegpt_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. 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/timegpt_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast — timegpt_forecast","text":"TimeGPT's forecast.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast — timegpt_forecast","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"Generate TimeGPT forecast -sample period (historical period).","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"","code":"timegpt_historic( df, freq = NULL, id_col = NULL, time_col = \"ds\", target_col = \"y\", level = NULL, finetune_steps = 0, clean_ex_first = TRUE )"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_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. clean_ex_first Clean exogenous signal making forecasts using TimeGPT.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"TimeGPT's forecast -sample period.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_historic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate TimeGPT forecast for the in-sample period (historical period). — timegpt_historic","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_historic(df, id_col=\"unique_id\", level=c(80,95)) }"},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot forecast and insample values. — timegpt_plot","title":"Plot forecast and insample values. — timegpt_plot","text":"Plot forecast insample values.","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot forecast and insample values. — timegpt_plot","text":"","code":"timegpt_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/timegpt_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot forecast and insample values. — timegpt_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/timegpt_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot forecast and insample values. — timegpt_plot","text":"Plot forecast insample values","code":""},{"path":"https://nixtla.github.io/nixtlar/reference/timegpt_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot forecast and insample values. — timegpt_plot","text":"","code":"if (FALSE) { nixtlar::nixtla_set_token(\"YOUR_TOKEN\") df <- nixtlar::electricity fcst <- nixtlar::timegpt_forecast(df, h=8, id_col=\"unique_id\", level=c(80,95)) nixtlar::timegpt_plot(df, fcst, h=8, id_col=\"unique_id\") }"},{"path":"https://nixtla.github.io/nixtlar/news/index.html","id":"nixtlar-100","dir":"Changelog","previous_headings":"","what":"nixtlar 1.0.0","title":"nixtlar 1.0.0","text":"Initial CRAN submission. Includes functions set validate token, call TimeGPT main methods (forecast, historical forecast, anomaly detection cross-validation), plot results.","code":""}]