Commit graph

63 commits

Author SHA1 Message Date
Ben Letham
aaa89445a1 R use GMT for all dates to avoid daylight savings (#1501) 2021-03-03 16:53:39 -08:00
Ben Letham
8f1c1d5a27 Fix bug in timezone handling in R (#1501) 2021-03-03 14:35:36 -08:00
Cuong Duong
fae1ac1f9a
add mdape and smape to performance metrics tests (#1804) 2021-03-02 08:30:23 -08:00
Cuong Duong
2d56e71fed
Add regressor_coefficients function for R (#1803)
* function code

* add tests for regressor coefficients utility

* add documentation for regressor_coefficients util function

* generate Rd docs

* add regressor_coefficients to R namespace

* minor formatting nit

* fix bugs
2021-03-02 08:30:00 -08:00
Sam Snarr
2d8e6c7fd1
Added growth='flat' functionality in R (#1778)
* added `flat_growth_init()` function

* added validation for 'flat'

* changed `fit.prophet()` to handle `growth='flat'`

* added `trend='flat'` capabilities to `sample_predictive_trend()` and `fit.prophet()`

* updated STAN code to handle flat trend

* [Syntax fix] Removed unnecessary bracket

* updated documentation

* undid formatting that was accidentally applied by autoformatter

* undid more formatting that was accidentally applied by autoformatter

* added tests

* typo in `sample_predictive_trend()`

* updated notebook with example in R

* updated documentation
2021-01-14 13:53:08 -08:00
Ben Letham
77da5b8c06 Update test to match Py 2020-09-03 17:21:30 -07:00
Ben Letham
a88f6458ad Fix test issues 2020-08-17 18:36:29 -07:00
Ryan Nazareth
f16d9df333
Add mdape performance metric to R (#1472)
* add test and initial function for mdape in R

* Add separate rolling_median_func and tests

* Modify rolling median function

* fix syntax in rolling median function

* sort by h

* R/diagnostics.R

* update .rd docs and notebook

* Add mdape to performance metrics params docstring
2020-05-20 12:28:50 -07:00
Ryan Nazareth
16e632a695
Add custom cutoff option to R (#1484)
* Add test for custom cutoff cv

* implement custom cutoff logic in cv function

* add docstring

* add description in notebook and rebuild .Rd docs

* fix bug and add test case for period is NULL

* replace s.POSIXct set_date
2020-05-15 14:32:54 -07:00
Hadley Wickham
cded5c41b0 Fix failure with dplyr 1.0.0
I'm not sure why a data frame ends up with names and a tibble does not, but it doesn't seem like an important enough problem to investigate in detail, and this is a simple fix.
2020-04-28 17:51:36 -05:00
Ben Letham
9320ed1fb5 Add test for MCMC with 0 changepoints (R) 2020-02-04 13:32:26 -08:00
Ben Letham
be25372090 improvements in docstrings and testing for disabling uncertainty 2020-02-04 13:22:08 -08:00
Ben Letham
8d0f23f8be Add unit tests for disabling uncertainty estimation in R 2020-02-04 13:05:28 -08:00
Ben Letham
6e51130f28 Use fit kwargs in cross validation (#1040) 2020-02-03 17:02:23 -08:00
Ben Letham
4fcecdb3df Fix bugs that were introduced into R cross validation 2020-02-03 16:18:46 -08:00
ben-schwen
bbadf65e3b added test case for valid_metrics 2020-01-27 13:53:11 -08:00
Jireh Tan
e8ddded4fe [BUG] Ensure regressor/seasonality names are valid; fixes #996
Ensures that `add_regressor` and `add_seasonality` are valid column names
to R, to ensure that the generated columns are then used downstream to fit
the model.

Why not put it in `validate_column_names`? Because `validate_column_names` is
also used to validate if holiday names (which can be scalar values in columns) are
valid. We want to allow `c('seans-bday', 'Xmas')` as a valid holiday input, so we
cannot then put it there.

Tested these changes by using devtools::testthat().

Resolves: #996
2019-06-25 09:39:14 -07:00
Jireh Tan
a554873a38 [BUG/TST] Add validation to prevent fourier.order <= 0; addresses #980
In reverse order of importance, this change addresses:
  - #980, by adding validation to ensure that `fourier.order` > 0
  - changes all the tests that `expect_error` using the argument
    `fourier_order`, as the argument is named `fourier.order`, so
    the intent of the test is to validate the holiday names rather
    than to check the use of the correct argument name

Resolves: #980
2019-06-21 15:27:31 -07:00
Ben Letham
7ff33137eb Change to MIT license 2019-05-21 11:40:04 -07:00
Ben Letham
269133c133 Change cross validation performance metrics to first aggregate over horizon before computing rolling average (#839, #863) 2019-05-08 10:47:26 -07:00
Ben Letham
c5db6f8619 Update R tests with condition.name 2019-03-22 10:52:53 -07:00
Olof Höjvall
0092638abe Added conditional seasonality for R (#894) 2019-03-22 10:43:52 -07:00
Ben Letham
c9f1ccaa63 Version bump; test fixes; R build 2018-12-03 22:21:37 -08:00
Ben Letham
287fb2f6de Move built-in country holidays to a function (R) 2018-11-30 23:12:19 -08:00
ziye666
95fa4460a9 Fix bug about holiday year different from input year and others (#670)
* Allow both both hoidays and append holidays

Match holidays in predict and fit

Add test for append_holiday features; minor fixes

Add column name validation for append_holidays names; allow only one country

Fix bug about holiday year different from input year and also other bugs

Change function description

Add append holiday feature for R

* Add test for R/Pyrhon; fix bugs
2018-10-18 17:40:17 -07:00
Sean J. Taylor
cd84356968 Allow CRAN to build packages on OSX 2018-06-13 11:39:42 -07:00
Sean J. Taylor
4f224e5ec7 Merge of v0.3 into master 2018-06-02 10:50:58 -07:00
Ben Letham
107f74f0f2 Allow constant extra regressors 2018-06-01 14:53:45 -07:00
bl
3b20680bfc Add test i386 test skips for stan tests 2018-05-30 16:40:34 -07:00
Ben Letham
218283f157 Simplify logic/interfaces for cross_validation, to better handle irregularly spaced data and actually respect initial window 2018-05-30 12:09:54 -07:00
Ben Letham
68ff9e577d Fix issue in Python when changepoint_range=1 2018-05-25 17:00:27 -07:00
Ben Letham
cb0b47994b Validation and tests for setting range for automatic changepoints 2018-05-25 16:45:24 -07:00
Ben Letham
7c010aac51 Multiplicative seasonality (R) 2018-05-15 10:07:38 -07:00
Ben Letham
8e8e04858a Move copy test to test_diagnostics 2018-05-04 16:15:43 -07:00
Ben Letham
b052b56d33 Refactor cross validation metrics for rolling window, add visualization, put example in notebook (R) 2018-05-04 15:07:35 -07:00
Ben Letham
aa4e223152 Combine trend models into a single stan file (R) 2018-04-20 17:23:11 -07:00
Ben Letham
1f84fa960f Move changepoint matrix calculation into stan (R) 2018-04-20 15:20:38 -07:00
Andy Pohl
1722e99554 unaddressed warnings from unit tests (#450)
* unaddressed warnings from unit tests

* devtools wants Encoding set or it complains through testthat::check()
2018-04-18 17:06:39 -07:00
Nagi Teramo
14d5028a73 Implement metrics for time series forecasts (#384)
* Add metrics for model validation

* Update to reflect comments on Github

* Change all_metrics() implementation to more sophisticated style

* Update metrics functions

* Remove redundant argument

* Use v0.3 files for diagnostics.R and prophet.R

* Use v0.3 file for man/predict.prophet.Rd

* Change the interface and do some refactoring
2018-01-05 16:05:58 -08:00
Ben Letham
014b3b5919
Merge bugfixes from master into v0.3 (#393)
* Update memory requirement description per #326

* Fix R warning with extra regressor; disallow constant extra regressors.

* Fix unit test broken in new pandas

* Fix diagnostics unit tests for new pandas

* Fix copy with extra seasonalities / regressors Py

* Fix copy with extra seasonalities / regressors R

* Fix weekly_start and yearly_start in R plot_components

* Fix plotting in pandas 0.21 by using pydatetime instead of numpy

* Version bump

* Update README for new version

* Fix missing columns in SHF with extra regressor
2017-12-22 16:30:18 -08:00
bletham
5d453c1d05 Fix missing columns in SHF with extra regressor 2017-11-09 21:19:51 -08:00
Ben Letham
e78f583f90
Merge in bugfixes from master (#349)
* Update memory requirement description per #326

* Fix R warning with extra regressor; disallow constant extra regressors.

* Fix unit test broken in new pandas

* Fix diagnostics unit tests for new pandas

* Fix copy with extra seasonalities / regressors Py

* Fix copy with extra seasonalities / regressors R

* Fix weekly_start and yearly_start in R plot_components

* Fix plotting in pandas 0.21 by using pydatetime instead of numpy
2017-11-08 10:09:08 -08:00
bletham
0addabcad7 Fix copy with extra seasonalities / regressors R 2017-11-04 21:40:45 -07:00
bl
feb7be397b Fix R warning with extra regressor; disallow constant extra regressors. 2017-11-04 16:40:20 -07:00
Sean J. Taylor
c0a7eac3b3 Fix for broken tests (using local timezone) 2017-09-08 11:30:43 -07:00
Ben Letham
2ab01c5d77 Fix flaky unit test 2017-09-08 07:59:52 -07:00
Ben Letham
2ddcf54930 Saturating minimum R 2017-09-01 11:16:59 -07:00
Ben Letham
66ea9444eb Custom seasonality prior scales R, handle NAs in holiday priors 2017-09-01 10:04:20 -07:00
Ben Letham
ddbb353278 Custom prior scales R 2017-08-31 10:56:06 -07:00
Ben Letham
23d8bc25dc R unit tests for added regressors 2017-08-30 17:10:43 -07:00