Giter Club home page Giter Club logo

thief's Introduction

thief's People

Contributors

imgbotapp avatar khalida avatar robjhyndman 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thief's Issues

Issue with reconcilethief()

I'm trying to optimize which methods I use at each temporal aggregate. In order to do this I must use reconcilethief(). I can get this function to work with other data sets such as AirPassengers, but for some reason not this. I receiver the error: "Error: length(n) == 1L is not TRUE". If you want to see it work, change tsaggregates(train) to tsaggregates(AirPassengers). Consider:

tsdata <- c(5669,6845,7320,7443,8031,8394,9321,8904,7982,7981,
7896,7733,8618,7013,8088,7069,6380,7171,7091,6491,
6184,6881,5480,7068,7004,6001,6890,6192,5904,6676,
6444,6181,5842,5861,5511,6941,7838,7185,7034,6446,
5920,6221,5391,7064,5687,5385,5929,7345,7157,6681,
8043,5570,6590,7365,6806)
train <- ts(tsdata, start=c(2013,1), f=12)
seriesagg <- tsaggregates(train)

model1 <- forecast(tslm(seriesagg$Monthly ~ season), h=48)
model2 <- forecast(snaive(seriesagg$'2-Monthly', h=24), h=24)
model3 <- thief(seriesagg$Quarterly, h=16)
model4 <- forecast(seriesagg$'4-Monthly', h=12)
model5 <- forecast(seriesagg$Biannual, h=8)
model6 <- forecast(seriesagg$Annual, h=4)

fc <- list()
fc[[1]] <- model1
fc[[2]] <- model2
fc[[3]] <- model3
fc[[4]] <- model4
fc[[5]] <- model5
fc[[6]] <- model6
reconciled <- reconcilethief(fc)

thief generates NaN as forecast mean

I am running thief (version 0.3) with 'usemodel' set to 'theta' and getting NaN as forecast mean.
here is 2 examples with quarterly series.
ts1 <- c(1820,1640,1890,2340,2480,2910,2800,2960,3150,3290,3100,2290,2070,2240,2030,2270,2200,2350,2580,2740,3050,3060,3280)

ts2<-c(2993,954,2072,2078,911,1841,3196,2648,1486,1261,1516,1314,1029,1948,1545,1723,1723,1925,2858,2624,2066,2354,2306)

Thank you.
Arsa

Issue using baggedETS with thief

I am attempting to use the forecast package baggedETS with the thief package. I'm running into an error when attempting to do so, but when I use the same function on each aggregate level it works fine. Consider:

AirPassengers2 <- window(AirPassengers, start=c(1956,1))
model1 <- thief(AirPassengers2, h=41) # works

bagets <- function(y, h,...){forecast(baggedETS(y), h)} # attempting to use bagged ETS model

# Does not work
model2 <- thief(AirPassengers2, forecastfunction=bagets, h=41)

# individually they work
agg <- tsaggregates(AirPassengers2)
t1 <- bagets(agg[[1]],h=36)
t2 <- bagets(agg[[2]],h=18)
t3 <- bagets(agg[[3]],h=12)
t4 <- bagets(agg[[4]],h=9)
t5 <- bagets(agg[[5]],h=6)
t6 <- bagets(agg[[6]],h=4) # works now but generates warning from HoltWintersZZ

Previously I figured out baggedETS wouldn't work on < 8 observations. This was fixed (thank you!), but a new error now occurs:
Error in [.default(fc$lower, , 1) : incorrect number of dimensions

I apologize if this is a forecast package error, I'm not familiar enough with the source code to know where the root cause lies.

How to incorporate regressors?

Hi Rob,

Thanks for another awesome package, I was wondering if there is a way to use regressors while aggregating temporal hierarchical forecasts ?

Thanks,
Sagar

Better Yearly Data Handling

Currently the thief() function cannot handle yearly data, presumably because there is no hierarchy to estimate. Instead of it erroring out, could it just trigger a warning and then default to the forecast function used?

data(M3)
thief(M3[[1]]$x, h = 1)

Error in thief(M3[[1]]$x, h = 1) :
Seasonal period (m) must be greater than 1

non-conformable arrays

When running hts forecast would get Error in -.default(y, fits) : non-conformable arrays
is the thief function not returning fitted values in an easily accessible form resulting in the described error?

Code:
forecast(object = x,
h = 12,
method = "comb",
keep.fitted = TRUE,
weights = "mint",
positive = TRUE,
FUN = function(i) thief(i,m=12))

forecast function of thief

Is it possible to run thief with forecastfunction equal to user-defined stlf function while stlf function has its own user-defined forecastfunction which is tbats?

I get below error in stlf function when running thief on it.
Error in stlf(x, h = h) : y is not a seasonal ts object

Thanks,

Install thief in rstudio

Will this 'thief' package will be installed in r studio. I tried this

install.packages('thief', dependencies = TRUE)

in r studio but i got installation error.

Thanks

ERROR: dependency 'TStools' is not available for package 'thief'

Hi there,
Not sure this is the proper channel...complete newbie here. sorry.

With input

install.packages("devtools") devtools::install_github("robjhyndman/thief") library(thief)

RStudio gives:

install.packages("devtools")

devtools::install_github("robjhyndman/thief")
Downloading GitHub repo robjhyndman/thief@master
from URL https://api.github.com/repos/robjhyndman/thief/zipball/master
Installing thief
"C:/PROGRA1/R/R-331.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet
CMD INSTALL
"C:/Users/dh/AppData/Local/Temp/Rtmpaidvgs/devtools21b419b2650a/robjhyndman-thief-9302849"
--library="C:/Users/dh/Documents/R/win-library/3.3" --install-tests
ERROR: dependency 'TStools' is not available for package 'thief'

  • removing 'C:/Users/dh/Documents/R/win-library/3.3/thief'
    Error: Command failed (1)

What should I try next?

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.