Giter Club home page Giter Club logo

forecasthybrid's Introduction

Travis-CI Build Status Coverage Status CRAN version CRAN RStudio mirror downloads

forecastHybrid

Convenient functions for ensemble forecasts in R combining approaches from the forecast package.

For a more detailed description of the package and usage, consult the vignette.

The package is still under development, but many basic features have been implemented. Some features (such as optimized parallelization between rather than within models and automatically selecting the optimal combination of base models) have not yet been developed.

Installation

The stable release of the package is hosted on CRAN and can be installed as usual:

install.packages("forecastHybrid")

The latest development version can be installed using the devtools package.

devtools::install_github("ellisp/forecastHybrid/pkg")

Version updates to CRAN will be published frequently after new features are implemented, so the development version is not recommended unless you plan to modify the code or a particular bugfix is needed.

Usage

library(forecastHybrid)

# Build a hybrid forecast on the wineind dataset using auto.arima, ets, and tbats models.
# Each model is given equal weight
hm1 <- hybridModel(wineind, models = "aet", weights = "equal")
## Fitting the auto.arima model
## Fitting the ets model
## Fitting the tbats model
# Now plot the forecast for the next 48 periods
plot(forecast(hm1, h = 48))

plot of chunk unnamed-chunk-2

# Build the ensemble model on the same data but this time use auto.arima, nnetar, stlm, and tbats models.
hm2 <- hybridModel(wineind, models = "anst", weights = "equal")
## Fitting the auto.arima model
## Fitting the nnetar model
## Fitting the stlm model
## Fitting the tbats model
# Now plot the forecast for the next 48 periods
plot(forecast(hm2, h = 48))

plot of chunk unnamed-chunk-2

# Extract the point forecasts from this model
fc <- forecast(hm2, h = 48)
fc$mean
##           Jan      Feb      Mar      Apr      May      Jun      Jul
## 1994                                                               
## 1995 16201.35 20881.82 24108.16 24289.46 24099.33 24461.89 29209.40
## 1996 15867.52 20527.05 24004.26 24567.30 23822.42 24483.89 29136.83
## 1997 15739.09 20266.73 23692.47 24480.22 23639.51 24186.83 29006.33
## 1998 15655.18 20278.66 23605.34 24629.38 23644.49 24286.92 29177.41
##           Aug      Sep      Oct      Nov      Dec
## 1994          24963.59 26536.81 31868.13 36154.68
## 1995 26880.68 24310.59 26440.99 31474.53 35888.28
## 1996 26157.92 24352.95 25981.21 31503.84 35587.18
## 1997 26435.72 24452.37 25985.84 31418.15 36013.63
## 1998 25880.67
# Extract the (default) upper 80% and 95% prediction intervals
fc$upper
##            80%      95%
##  [1,] 28787.15 30519.50
##  [2,] 30475.49 32052.98
##  [3,] 36277.30 38475.03
##  [4,] 40369.80 41955.43
##  [5,] 20128.66 21356.34
##  [6,] 24420.61 26024.45
##  [7,] 27275.07 28949.58
##  [8,] 28878.89 30503.16
##  [9,] 27202.87 28837.47
## [10,] 28331.57 29976.48
## [11,] 32902.53 34557.70
## [12,] 29897.88 31763.53
## [13,] 28248.31 30062.69
## [14,] 30773.89 32595.66
## [15,] 35453.14 37287.12
## [16,] 40866.07 42714.60
## [17,] 19605.19 21469.25
## [18,] 24971.92 26851.88
## [19,] 27486.70 29382.63
## [20,] 29457.39 31369.24
## [21,] 27792.47 29720.15
## [22,] 28931.70 30875.09
## [23,] 33512.87 35471.87
## [24,] 30140.86 32115.33
## [25,] 28869.58 30993.51
## [26,] 31403.97 33539.96
## [27,] 36093.19 38246.66
## [28,] 41516.39 43689.85
## [29,] 20265.81 22460.26
## [30,] 25642.77 27858.52
## [31,] 28167.67 30404.75
## [32,] 30148.37 32406.66
## [33,] 28493.33 30772.68
## [34,] 29642.31 31942.56
## [35,] 34233.13 36554.08
## [36,] 30870.66 33212.13
## [37,] 29596.42 32085.79
## [38,] 32139.67 34645.79
## [39,] 36838.33 39366.93
## [40,] 42271.07 44824.70
## [41,] 21029.97 23609.61
## [42,] 26416.32 29022.24
## [43,] 28950.51 31582.68
## [44,] 30940.39 33598.63
## [45,] 29294.43 31978.54
## [46,] 30452.40 33162.14
## [47,] 35052.10 37787.25
## [48,] 31698.41 34458.73
# Extract the (default) lower 80% and 95% prediction intervals
fc$lower
##            80%       95%
##  [1,] 22270.74 20694.346
##  [2,] 22902.75 21598.537
##  [3,] 29048.62 27389.280
##  [4,] 31109.96 29327.301
##  [5,] 13051.76 11457.589
##  [6,] 17863.48 16757.327
##  [7,] 20822.76 19208.789
##  [8,] 20909.59 19696.301
##  [9,] 21027.19 19392.591
## [10,] 20254.10 19071.600
## [11,] 25891.51 24375.319
## [12,] 23228.55 21563.174
## [13,] 21393.44 19579.060
## [14,] 21816.55 20527.275
## [15,] 27740.78 26096.665
## [16,] 29780.03 28009.915
## [17,] 12562.57 10698.506
## [18,] 17174.51 15989.302
## [19,] 20323.72 18427.796
## [20,] 20181.36 18967.695
## [21,] 20509.53 18581.853
## [22,] 19616.42 18429.956
## [23,] 25116.13 23592.762
## [24,] 22681.14 20706.670
## [25,] 20845.16 18721.224
## [26,] 21253.10 19953.022
## [27,] 27058.33 25398.686
## [28,] 29081.91 27293.298
## [29,] 11974.98  9780.527
## [30,] 16808.42 15055.683
## [31,] 19715.78 17478.701
## [32,] 19789.54 18559.089
## [33,] 19881.71 17602.349
## [34,] 19268.84 18064.344
## [35,] 24690.68 23143.212
## [36,] 22024.37 19682.903
## [37,] 20191.35 17701.976
## [38,] 20937.45 19614.730
## [39,] 26673.26 24756.450
## [40,] 28685.08 26863.729
## [41,] 11283.85  8704.202
## [42,] 16570.92 13964.995
## [43,] 19005.97 16373.807
## [44,] 19559.85 18239.075
## [45,] 19153.63 16469.523
## [46,] 19061.74 17504.990
## [47,] 24435.04 21983.305
## [48,] 21269.65 18509.331
# Produce a forecast with prediction intervals at the 70%, 80%, 90%, and 95% levels
fc2 <- forecast(hm2, h = 48, level = c(70, 80, 90, 95))

Citation

To cite package ‘forecastHybrid’ in publications use:

David Shaub and Peter Ellis (2020). forecastHybrid: Convenient Functions for Ensemble Time Series Forecasts. https://gitlab.com/dashaub/forecastHybrid, https://github.com/ellisp/forecastHybrid.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {forecastHybrid: Convenient Functions for Ensemble Time Series Forecasts},
    author = {David Shaub and Peter Ellis},
    year = {2020},
    note = {https://gitlab.com/dashaub/forecastHybrid,
https://github.com/ellisp/forecastHybrid},
  }

License

(c) 2016-2020 David Shaub and Peter Ellis.

This package is free software released under the GPL-3 license.

forecasthybrid's People

Contributors

asllohmann avatar dashaub avatar duju211 avatar ellisp avatar ganesh-krishnan avatar l4u532 avatar mitchelloharawild avatar nicholasmfong avatar vlahm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forecasthybrid's Issues

broken accuracy() method

Somewhere in preparing the S3 generic method accuracy() for CRAN the method became broken. This fix should also remove the useless documentation for the generic method and redirect to accuracy() from the "forecast" package.

problematic ets and stlm forecasts

ets() ignores seasonality for long-seasonal periods, e.g. plot(forecast(ets(taylor), h = 500)) These forecasts are really bad since we're not really estimating an ets model.

stlm() will produce an error on a series that is not periodic, e.g. set.seed(123); stlm(rnorm(100)). We could accept this error and concede that the user should manually remove the s model, or we could drop the ets/stlm models in these cases (and throw a warning). In the case of ets, it is easy to check if frequency > 24. Similarly for stlm(), we can easily check if it is a ts object with at least two periods. Both approaches have advantages/disadvantages.

messy function call

The function calls are not formatted the same was as the base models in the "forecast" package.
For example, compare

a1 <- auto.arima(wineind)
a1$call

with

h1 <- hybridModel(wineind)
h1$auto.arima$call

This might be able to be fixed by modifying the do.call() functions that call the individual component models.

parallelization

Implement parallelization between models. When training multiple models, parallelize between the models, but if additional cores are present, allow individual models (e.g. tbats, auto.arima) to run in parallel themselves.

Weights for nnetar objects

Forecast 6.2 does not support accuracy(nnetar(rnorm(100))). This will be fixed in v6.3 (see here robjhyndman/forecast#237)

We can probably ignore this for now and wait for this to be resolved in the forecast 6.3 release.

Edit: The same issue exists with accuracy(stlm(AirPassengers)) This has also been fixed for forecast 6.3.

deprecate weights = "insample.errors"

It probably never was a good idea to include this. Equal weights almost certainly lead to models with less variance, and cross validated error weights probably lead to lower model forecasting errors. It might be worth replacing this with the ability to set custom weights, e.g.

hybridModel(wineind, models = “aen”, weights = c(0.2, 0.6, 0.2))

warning message for unused lists

See below:

trainSet <- beaver1[1:100, ]
testSet <- beaver1[-(1:100), ]
trainXreg <- data.frame(trainSet$activ)
testXreg <- data.frame(testSet$activ)

beaverhm <- hybridModel(trainSet$temp,
                        models = "aest",
                        a.args = list(xreg = trainXreg),
                        n.args = list(xreg = trainXreg),
                        s.args = list(xreg = trainXreg))
forecast(beaverhm, xreg = testXreg)

Warning message:
In hybridModel(trainSet$temp, models = "aent", a.args = list(xreg = trainXreg), :
stlm was not selected in the models argument, but s.args was passed. Ignoring a.args

Remove fpp dependency

There are plenty of datasets that can be used as examples without importing fpp. At a minimum the individual fpp datasets should be imported rather than clobbering the namespace with all fpp objects.

accuracy() for forecast objects

Do we want accuracy (compared to a known forecast gold standard) to work on our forecast objects out of the box? At the moment you need to know to manually specify the mean of the forecast object is what is to be tested.

> series <- M3[[1]]
> x <- series$x      # ie the data to be fitted
> xx <- series$xx    # ie the true, actual values of the forecast period
> h <- length(xx)    # ie the length of the forecast period
> tmp <- forecast(hybridModel(x), h = h)
Warning message:
In hybridModel(x) :
  The stlm model requires that the input data be a seasonal ts object. The stlm model will not be used.
> accuracy(tmp, xx)
Error in NextMethod(.Generic) : cannot assign 'tsp' to zero-length vector
> accuracy(tmp$mean, xx)
               ME     RMSE      MAE      MPE     MAPE     ACF1 Theil's U
Test set 488.2159 635.8854 522.7854 5.853305 6.495892 0.489442 0.7779601

inputenc problem in Windows

When I run devtools::check("pkg") on Windows I get an error:

Package inputenc Error: inputenc is not designed for xetex or luatex.

But I don't have that problem on a Linux machine.

I'm not sure what this is - it might be only my own LaTeX setup - but we should work it out before submitting to CRAN.

Here's the full error message for posterity. I've assigned this to me to look into in the first instance by @dashaub if you've any ideas they'd be appreciated.

* checking PDF version of manual ... [37s]
 WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! Package inputenc Error: inputenc is not designed for xetex or luatex.
(inputenc)                only UTF-8 supported.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
* checking PDF version of manual without hyperrefs or index ...Warning: running command '"C:/PROGRA~1/R/R-32~1.4RE/bin/x64/Rcmd.exe" Rd2pdf  --batch --no-preview --build-dir="C:/Users/PETERE~1/AppData/Local/Temp/Rtmp8qwnBt/Rd2pdf131c2e4535dd" --no-clean -o  forecastHybrid-manual.pdf  "C:/Users/PETERE~1/DOCUME~1/GitHub/FORECA~3/FORECA~1.RCH/forecastHybrid"' had status 1
 ERROR
* DONE
Status: 1 ERROR, 1 WARNING, 1 NOTE
Warning: running command '"C:/PROGRA~1/R/R-32~1.4RE/bin/x64/Rcmd.exe" Rd2pdf  --batch --no-preview --build-dir="C:/Users/PETERE~1/AppData/Local/Temp/Rtmp8qwnBt/Rd2pdf131c34547cb7" --no-clean --no-index -o  forecastHybrid-manual.pdf  C:/Users/PETERE~1/DOCUME~1/GitHub/FORECA~3/FORECA~1.RCH/forecastHybrid' had status 1

See
  'C:/Users/Peter Ellis/Documents/GitHub/forecastHybrid/forecastHybrid.Rcheck/00check.log'
for details.

Error: Command failed (1)
Execution halted

Exited with status 1.

e.args passed to auto.arima

See below

hm2 <- hybridModel(y = gas, models = "aenst",
                   a.args = list(max.p = 12, max.q = 12, approximation = FALSE),
                   e.args = list(allow.multiplicative.trend = TRUE),
                   n.args = list(repeats = 50),
                   s.args = list(robust = TRUE),
                   t.args = list(use.armga.errors = FALSE))

calculate MASE for cvts objects

Currently cvts() only saves residuals in the object return. The actual or fitted values will need to be included and the accuracy.cvts() method will need to be modified to implement this.

Broken generic methods

The print() and summary() methods now don't print nice output after the switch to do.call() for each model call.

individual xreg in forecast.hybridModel

Currently forecast.hybridModel() issues a warning if the xreg was only used for one component model and not the others. This behavior could be kept, but more flexibility would be given by allowing forecast.hybridModel() to accept individual xreg arguments in a.xreg and n.xreg the same way a.args and n.args can be used with hybridModel(). This leads to more verbose function calls, but it is certainly conceivable that a user would want to use different xregs (e.g. fourier terms for seasonality) in different models. Scratchpad code below for demonstrating current xreg usage:

library(forecastHybrid)
dat <- wineind
set.seed(12354)
# Test 1
m <- matrix(rnorm(length(dat)), ncol = 1)
mm <- matrix(rnorm(2 * length(dat)), ncol = 2)
a1 <- auto.arima(dat, xreg = m)
h1 <- hybridModel(dat, a.args = list(xreg = m))
a1
h1$auto.arima
forecast(a1, xreg = m)$mean == forecast(h1, xreg = m)$auto.arima$mean


# Test 2
a2 <- auto.arima(dat, xreg = mm)
h2 <- hybridModel(dat, a.args = list(xreg = data.frame(mm)))
a2
h2$auto.arima
forecast(a2, xreg = mm)$mean == forecast(h2, xreg = mm)$auto.arima$mean

add thetaf as part of the ensemble?

was there a reason we didn't include thetaf in the ensemble, even as an option? If we just didn't get around to it, I'm happy to put some belated work in to add it.

fpp not explicitly imported

currently the build checks report a problem with {fpp} being listed as a dependency but never being imported. I'm presuming we're likely to use it for example data; so I'm just logging an issue so we remember to explicitly import either the whole namespace or just an explicit dataset when we get to that point.

The forecast horizon h must be a positive integer

Hi. I'm getting this error trying to forecast with a hybridmodel object.

forecast(x.ray.m1, h = 18) Error in forecast.hybridModel(x.ray.m1, h = 18) :

My data looks like this:

x.ray.ts
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2011 332 346 368 357 269 321 321 330 302 390 319 336
2012 366 334 367 370 378 324 305 353 307 374 397 298
2013 333 362 351 364 440 319 345 409 369 328 317 346
2014 394 322 281 313 293 210 422 483 584 534 444 499
2015 501 445 550 503 494 483 482 478 468 473 350 425
2016 479 519 511 461

Could it be because I'm forecasting by month up to April 2016?

Support for STL as one of the models?

This of course uses STL to de-seasonalize, model the trend-cycle-remainder using a non-seasonal forecasting method (typically ARIMA or ETS), and then re-seasonalizes using the last annum of seasonal components.

In my experience, this has worked as well an sometimes better than ARIMA or ETS. Any thoughts of including this as well?

nnetar not working with some multi-level prediction intervals

Spotted this error in the README while working on the branch, and I don't see what I might have done to it.

test_that("forecast nnetar prediction intervals with different levels work", {
   hm2 <- hybridModel(wineind, models = "anst", weights = "equal")
   expect_error(forecast(hm2, h = 48), NA)
   expect_error(forecast(hm2, h = 48, level = c(70, 80, 90, 95)), NA)
})

The first forecast in the above works, the second doesn't:

Error: forecast(hm2, h = 48, level = c(70, 80, 90, 95)) threw an error.
subscript out of bounds

I think there's an easy fix but I wanted to merge in first.

allow stlm with xreg

The documentation needs to be made consistent with the fact that xreg can be used with stlm models but only when stlm(..., method = "arima").

no error when forecast is given a single number as an object

Our tests expect an error in this situation but forecast::forecast does return a (uninteresting) forecast. I'm inclined to remove the test.

> expect_error(forecast(object = 1))
Error: forecast(object = 1) did not throw an error.
> forecast(object = 1)
   Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
1               1    NA    NA    NA    NA
2               1    NA    NA    NA    NA
3               1    NA    NA    NA    NA
4               1    NA    NA    NA    NA
5               1    NA    NA    NA    NA
6               1    NA    NA    NA    NA
7               1    NA    NA    NA    NA
8               1    NA    NA    NA    NA
9               1    NA    NA    NA    NA
10              1    NA    NA    NA    NA

Refitting a hybridModel object

Add the ability to update the weights/errorMethod on an existing hybridModel object. For errorMethod this can easily be achieved without recalculating the component models since the RMSE/MAE/MASE errors are all still extractable from the fit model. For weights, changes to any other method except cv.errors (which is currently unimplemented anyway) can similarly be done without recalculuating the component models.

ggplot graphics

The basic plots were closed in #1 , but we should still consider adding ggplot2 support.

documentation build fail

Cryptic warnings on CRAN winbuilder for Latex PDF files. Build on a local LInux machine to debug

Add Xgboost into models

Thank you for developing this package. This is awesome. Can we add xgboost into this hybridforecast. Most of the winning solutions for forecasting competitions having xgboost models in them. So that this package covers all time series models plus advanced machine learning algorithms (nnetar and xgboost).

Is the Point Forecast calculation wrong?

Forst of all, really great package with tons of adjustment possibilities.I really like it.
But for me it seems that the point forecast calculation is kind of weird. (Please check the attached image) If it is not wrong, can you please explain me the calculation of it? Thanks in advance.

rplot_060816_060538_pm

improve documentation

Improve documentation for list arguments (a.args, e.args, n.args, s.args, t.args), make it clear they take lists. Also change documentation so that xreg is a dataframe instead of a matrix.

Enhanced prediction intervals

Very conservative prediction intervals are not working (i.e. taking the highest prediction interval value from an individual model for the upper limit and the lowest individual prediction intervals value for the lower limit). We should consider how to enhance this with additional methods that we could expose through a pi.method argument. This could include taking the mean of the model intervals, applying the weights from the models to the intervals, taking the tightest intervals, or bootstrap simulations. There are lots of issues that could arise from the various combination methods (e.g. upper/lower limits that are lower/higher than the mean forecast, etc), so this will need careful thought.

Separate weights for each forecast horizon

We should consider the option of separate weights to each forecast horizon (e.g. auto.arima performs very well for short horizons, nnetar for medium horizons, and ets for long horizons, so if we are forecasting a series the first through sixth predictions receives higher weight from the auto.arima model, the 7th through 10th receives higher weight from the nnetar model, and later observations receive heavier weight from the ets model).

This would ideally be calculated for each horizon, so the weights could be stored in an h * n matrix (n models and h periods). This would involve a minor reworking of the way the weights are stored and used for forecasts, but the bigger issue is computing each horizon since we set the weights during the model selection process hybridModel(), but we wouldn't know how many periods in advance are needed until forecast.hybridModel() is called. We could fix this in several ways. Perhaps we could cap the horizon at some reasonably far distance (e.g. h no longer than twice the length of the input series) and compute these horizons during model selection. Or we could add an argument in hybridModel() that the user sets for the maximum horizon to compute if these separate weights are wanted. Finally, the separate weights could be exposed through an additional argument separate = TRUE. In any case we should consider what happens if h greater than these precomputed horizon weights is input (perhaps throw a warning and then fall back on equal weights or the weight values for the last available horizon)

The forecast horizon h must be a positive integer

Hi. I'm getting this error trying to forecast with a hybridmodel object.

forecast(x.ray.m1, h = 18) Error in forecast.hybridModel(x.ray.m1, h = 18) :

My data looks like this:

x.ray.ts
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2011 332 346 368 357 269 321 321 330 302 390 319 336
2012 366 334 367 370 378 324 305 353 307 374 397 298
2013 333 362 351 364 440 319 345 409 369 328 317 346
2014 394 322 281 313 293 210 422 483 584 534 444 499
2015 501 445 550 503 494 483 482 478 468 473 350 425
2016 479 519 511 461

Could it be because I'm forecasting by month up to April 2016?

broken xreg

Note that this works

m <- matrix(rnorm(1 * length(wineind)), ncol = 1)
h1 <- hybridModel(wineind, a.args = list(xreg = m))

but this doesn't

mm <- matrix(rnorm(2 * length(wineind)), ncol = 2)
hh <- hybridModel(wineind, a.args = list(xreg = mm))

It appears the problem occurs in do.call(), so this might be related and fixed with issue #27 anyway.

add unit tests

Add unit tests to enforce behavior between versions and add stringency during package building. Travis continuous integration would be nice.

OO approach instead of string approach for API

How do you feel about an OO to the API instead of using strings and if statements to specify the model? It might provide greater flexibility and cleaner code.

library(forecast)
library(forecastHybrid)

some_ts <- ts(1:144, frequency = 12)
model_1 <- forecast::stlf(some_ts)
model_2 <- forecast::ets(some_ts)
model_3 <- forecast::auto.arima(some_ts)
model_4 <- forecast::nnetar(some_ts)

ensembled_model <- forecastHybrid::hybridModel(model_1, model_2, model_3, model_4, ...) # other args
class(ensembled_model) # "forecast" "ensemble"

# other API calls consistent with forecast, e.g.
plot(forecast(ensembled_model, h = 14))

hybridModel <- function(models, ...) {
  for (model in models) {
    # code that fits and finds weights and ensembles
  }
  return(ensembled_model)
}

forecastHybrid::hybridModel auto-magically finds weights and returns an object of class c("forecast", "ensemble") that is consistent with all the other functions in the forecast package.

Additional models

We should consider handling additional models. If we implement issue #11 this will need to be considered.
Furthermore, once this package is stable I'd like to work on and include arar/ararma models (see robjhyndman/forecast#8)

bats() models might be an addition. Since they are quite similar to tbats() it may not be worth inclusion, but they can provide better fits with default settings in some causes (e.g. compare bats(taylor) to tbats(taylor)).

hybridModel behavior when component models perfectly fit data

Consider the case the individual component models perfectly fit the time series.

hm <- hybridModel(ts(1:100, f = 4), weights = "insample.errors")
hm #weights of 0/NaN
accuracy(hm)#NA/NaN
fitted(hm)#NA/NaN
forecast(hm)# NaN point forecasts

This is definitely a corner case and not likely to occur with real data, however, it's worth considering what the correct behavior should be (e.g. throw error, revert to weights = "equal", etc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.