Coder Social home page Coder Social logo

mes's Introduction

mes

CRAN_Status_Badge Downloads

MES stands for "Mixed Exponential Smoothing". The package implements the model that encompasses the classical ETS and allows dealing with data with multiple frequencies (including the fractional ones), using explanatory variables and working with intermittent data - all in one flexible framework.

mes's People

Contributors

config-i1 avatar

Watchers

 avatar  avatar  avatar  avatar

mes's Issues

Develop a method to smooth states of the model

This should lead to smoother seasonals and smoother level / trend. This should be a separate method, applied by a user, returning smooth ADAM (reconstructed model).

In order to see the issue run the following:
test <- adam(forecast::taylor,"MNM",lags=c(48,336),h=336,holdout=T,initial="b",silent=F)

auto.adam

The function that selects the most appropriate distribution.
Potential functionality - combination of models.

  • For future work - ARMA selection, issues #13 and #21

Advanced loss functions

Implement the parameter loss with all the multiple steps ahead losses for mes().

The distribution parameter will be potentially detachable from the losses.

Create testthat scripts for ADAM

This should test:

  1. ETS;
  2. ARIMA;
  3. Regression;
  4. All their combinations;
  5. Basic methods;
  6. Different loss and distribution values;
  7. forecast() with different interval types.

Tune the optimiser

Normalise all the parameter before the nloptr(), then denormalise them in the loop. See if this improves the speed of calculation and accuracy.

Speed up adam with ARIMA

This involves:

  1. Code tuning and optimisation: make sure that there are no duplicates, check C++;
  2. Memory usage: remove redundant variables.
  3. Profiling - see, where the slowest parts are.

Develop simulation functions

The stuff that needs to be done:

  1. sim.oes()
  2. sim.oesg()
  3. sim.mes(), combining sim.es() and sim.oes() / sim.oesg()

ARIMA orders selection in adam

Develop a mechanism of order selection inside the function. Should be something similar to auto.msarima... but maybe smarter, considering several special cases?

Make level accept vector

This is relevant to forecast.adam() and predict.adam() functions. Make them return matrices in $lower and $upper if several levels are provided.

xreg for factors

If a user provides a factor, then expand it and make one and the same smoothing parameter for all levels of it. This way, if we provide factor for week of year, we would have a mechanism similar to the proper seasonal component.

Develop the basic ETS model with normal distribution

This means the implementation similar to Hyndman et al. (2008)

  1. Initialiser of the ETS model;
  2. Fitter of the ETS model;
  3. Estimator;
  4. Likelihood extractor;
  5. Conditional variance method;
  6. vcov() method;
  7. summary() in the alm() style;

Keep in mind the future lags variable and flexible structure of mes()

Rewrite the seasonal part of the model

An example. When lags=c(7,365), instead of having two components with respective lags, it should be done as one component with lags=7 and another with lags = 365/7...

In the ideal world a model should have "monthly", "weekly" and "daily" components for this situation. Not clear, how to get there from lags=c(7,365)...

Advanced loss functions to implement

The analytical counterparts of MSEh, TMSE, GTMSE and GPL are still not implemented. This can be useful for high frequency data / small samples.

formula parameter

Introduce formula, which defines what variables to use, when it comes to xreg

Use Rectified Normal distribution for the summary

Use Truncated Normal distribution for the summary of smoothing parameters. Things to do:

  1. Save bounds type in adam();
  2. Depending on the type, get the restrictions;
  3. Use qtruncnorm from truncnorm package.

mes simulator

Develop function for the data generation from the basic ETS models with different distributions.

This is needed for the prediction interval and mean of mes().

Separate seasonal and non-seasonal initials

Possible solutions:

  1. Separate initial and initialSeason;
  2. Accept a list in initial, so that initial[[1]] is the vector of non-seasonal ones and then [[2]], [[3]] correspond to specific seasonalities. If a seasonal is not provided, it should have NA.

ETS(NNN)

This is supposed to switch off the ETS and leave ARIMAX components only.

Develop ETS with other distributions

This means likelihood calculation + prediction intervals for:

  1. Inverse Gaussian,
  2. Laplace,
  3. Logistic,
  4. Student's T,
  5. Teacher's S,
  6. Asymmetric Laplace,
  7. Log Normal,
  8. Box-Cox Normal.

Integrate mes with alm

This implies:

  1. is.alm() for the occurrence in mes(),
  2. is.oes() for the occurrence in alm(),
  3. working predict() and forecast() for both.

Deal with the fractional frequencies

This should involve the new type of seasonals based on dummies and a vector of dates for the values of y (date parameter) in mes() and omes()

xreg with predicted values

There should be a mechanism of defining, which variables should be predicted and which should be used as is. A method preparing explanatory variables is needed.

When the variable is marked for prediction this is what should happen inside the function:

  1. Predict each marked explanatory variable;
  2. Use fitted values for the estimation;
  3. Use point forecasts for forecasting;
  4. Use covariances between variables for the variance calculation;
  5. Use (3) and (4) for the final forecasts.

Mechanism for the missing values treatment

This should be done for mes() for the data, when there are NAs. omes() should treat those cases as ot=0.

The missing values will need to be interpolated using the model itself.

Move adam() to smooth

This involves:

  1. Moving C++ code and making sure that there's no conflict with the existing one;
  2. Moving R code;
  3. Moving tests and vignettes;
  4. Making sure that the package passes all the tests;

Potentially:
5. Updating es(), ssarima(), msarima(), gum(), sma(), so that they use the new C++ code instead of the old one.
6. Removal of the old code.

Correct distributions in ADAM

This relates to: lnorm, llaplace, ls and lgnorm and the assumptions for the mean (mu=-sigma^2 / 2). Things that need fixing:

  1. Scale calculation;
  2. Likelihoods;
  3. Prediction intervals;
  4. Residuals: standardised and studentised;
  5. Outlierdummy;
  6. Diagnostic plots;
  7. PointLik.

Let persistence accept lists

This can be either named or none, accepting something like:
list(level=0.1,trend=0.2,seasonal=c(0.3,0.1),xreg=c(0.1,0.1,0.1))
If some of the options are not provided, then they are estimated.

If a vector is provided, use values in the mentioned order.

Methods to implement:

  1. cvar() - conditional variance,
  2. predict(), forecast(),
  3. resid(), rstandard(), rstudent(),
  4. plot() with which option, similar to alm(),
  5. vcov(),
  6. confint(),
  7. summary() similar to alm().

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.