Functions implementing Single Source of Error state space models for purposes of time series analysis and forecasting.
The package includes ADAM (Svetunkov, 2021, < https://openforecast.org/adam/>),
Exponential Smoothing (Hyndman et al., 2008,

The package *smooth* contains several smoothing (exponential and not) functions that are used in forecasting.

Here is the list of the included functions:

- es - the ETS function. It can handle exogenous variables and has a handy "holdout" parameter. There are several cost function implemented, including trace forecast based ones. Model selection is done via branch and bound algorithm and there's a possibility to use AIC weights in order to produce combined forecasts. Finally, all the possible ETS functions are implemented here.
- ces - Complex Exponential Smoothing. Function estimates CES and makes forecast. See documentation for details.
- gum - Generalised Exponential Smoothing. Next step from CES. The paper on this is in the process.
- sma - Simple Moving Average in state space form.
- ves - Vector Exponential Smoothing. Vector form of the ETS model.
- gsi - Vector exponential smoothing model with Group Seasonal Indices.
- ssarima - SARIMA estimated in state space framework.
- msarima - Multiple seasonal ARIMA, allows multiple seasonalities and works in a finite time.
- auto.ces - selection between seasonal and non-seasonal CES models.
- auto.ssarima - selection between different State-Space ARIMA models.
- auto.msarima - selection between different multiple SARIMA models.
- auto.gum - automatic selection of the most appropriate GUM model.
- sim.es - simulation of data using ETS framework with a predefined (or random) smoothing parameters and initial values.
- sim.ssarima - simulation of data using State-Space ARIMA framework with a predefined (or randomly generated) parameters and initial values.
- sim.ces - simulation of data using CES with a predefined (or random) complex smoothing parameters and initial values.
- sim.gum - simulation functions for GUM.
- sim.sma - simulates data from SMA.
- sim.ves - simulates data from VES.
- oes - occurrence state space exponential smoothing model. This function models the part with data occurrences using one of the following methods: fixed, odds ratio, inverse odds ratio, direct or general. It can also select the most appropriate between the five.
- viss - the vector counterpart of iss.
- sowhat - returns the ultimate answer to any question.
- smoothCombine - the function that combines forecasts from es(), ces(), gum(), ssarima() and sma() functions.
- cma - Centred Moving Average. This is the function used for smoothing of time series, not for forecasting.

Available methods:

- AICc, BICc;
- coef;
- covar - covariance matrix of multiple steps ahead forecast errors;
- errorType - the type of the error in the model: either additive or multiplicative;
- fitted;
- forecast;
- actuals;
- lags - lags of the model (mainly needed for ARIMA and GUM);
- logLik;
- modelType - type of the estimated model (mainly needed for ETS and CES);
- nobs;
- nparam - number of the estimated parameters in the model;
- orders - orders of the components of the model (mainly needed for ARIMA, GUM and SMA);
- plot;
- pls - Prediction Likelihood Score for the model and the provided holdout;
- pointLik - the vector of the individual likelihoods for each in-sample observation;
- pAIC - point AIC, based on pointLik
- print;
- sigma;
- simulate;
- summary;

Future works:

- nus - Non-uniform Smoothing. The estimation method used in order to update parameters of regression models.
- sofa - Survival of the fittest algorithm applied to state space models.

The stable version of the package is available on CRAN, so you can install it by running:

A recent, development version, is available via github and can be installed using "devtools" in R. First, make sure that you have devtools:

if (!require("devtools")){install.packages("devtools")}

and after that run:

devtools::install_github("config-i1/smooth")

The package depends on Rcpp and RcppArmadillo, which will be installed automatically.

However Mac OS users may need to install gfortran libraries in order to use Rcpp. Follow the link for the instructions: http://www.thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/

Sometimes after upgrade of smooth from previous versions some functions stop working. This is because C++ functions are occasionally stored in deeper unknown corners of R's mind. Restarting R usually solves the problem. If it doesn't, completely remove smooth (uninstall + delete the folder "smooth" from R packages folder), restart R and reinstall smooth.

Changes:

- New function - oes(). This will eventually substitute iss(). This aligns with the IJF paper by Svetunkov & Boylan (TBA). Only "fixed", "odds-ratio", "inverse-odds-ratio" and "probability" models are available at the moment. "general" is expected to arrive in several days...
- es(), ces(), ssarima(), msarima() and gum() now use "occurrence" parameter instead of "interemittent" and respectively oes() function instead of iss().
- New error measures: MIS, sMIS and RelMIS - based on the Interval Score of Gneiting and Raftery, 2017. This will be moved to greybox in the next version of smooth.
- New function - oesg(), implementing the General Beta-Bernoulli exponential smoothing model for the occurrence part of the data. This makes occurrence="g" available for the oes(), es() and all the other functions.
- The fitted values are now multiplied by the probability of occurrence in the case of intermittent model.
- The new likelihood for iETS models, which takes the missing values into account via EM-algorithm.
- The new estimate of the variance of the error for the iETS, based on the likelihood. It is obviously biased, but consistent and more efficient.
- Corrected optimisation of the iETS with rounded values, maximising SD directly in the function.
- The intermittent models are now returned in the "occurrence" rather than "imodel" parameter and should be provided in the functions via "occurrence".
- imodel is renamed into oesmodel for the univariate models. This is done for the consistency purposes.
- A vignette for oes() and the new intermittent model + references to the iETS and SSARIMA papers.
- Use actuals() method from greybox instead of getResponse() from forecast.
- cma() now relies on msarima() rather than on ssarima().

Bugfixes:

- Bugfix in oes with occurrence="d" and model="AZZ".
- Semiparametric intervals were broken.
- Wrong model name was produced on the graph of es().
- Fixed a bug in backcasting fitter with "Mat::col(): index out of bounds".

Changes:

- ves() now has an option of producing persistence="seasonal". Seasonal smoothing parameter will be common across the series in this case.
- New function - pinball(), which returns the value of the loss (either quantile, or expectile, or any other one).
- IMPORTANT!!! The variance of errors in the smooth functions is now calculated without the bias correction. This is because we claim that we use likelihood in the estimation. Expect the increase in prediction intervals!
- The number of parameters is now correctly taken into account in the calculation of AIC, AICc, BIC and BICc of ves().
- RelMSE is now substituted by RelRMSE in the accuracy calculation.

Bugfixes:

- sma and cma did not check the existance of model correctly. Now it is restricted with their environment only.
- Check if the data is positive for the multiplicative types of auto.gum() and gum() functions.
- auto.gum() sometimes failed, when IC values were the same.
- Accuracy has been calculated incorrectly for ves() models.
- gsi() now checks the provided weights for NAs.
- gum() would not work correctly, when length(lags)>length(orders).
- es() would kill R in cases of "MAN" model and small samples. Now it does not do that.

Changes:

- graphmaker() is now moved to greybox package.
- Moved sigma.ets() to greybox package.
- pls.smooth() returns more or less reasonable values, when the model overfits the data.
- A set of is-functions, checking whether the object is produced by smooth functions.
- New function - gsi() - ETS with Group Seasonal Indices. This is based on VES with some restrictions. The work in progress...
- The number of degrees of freedom in vector models (ves and gsi) is now calculated per series, not overall. This corresponds to Lutkepohl (2005), p.75.
- Minor updates in the vignettes for ves with references to Lutkepohl and a couple of papers.
- ETS(M,Z,Z) now returns correct semi and non parametric intervals in case of intermittent data.
- Given the recent update in greybox, changed the "b" to "scale" in distribution functions.

Bugfixes

- ETS(M,X,X) sometimes could not be optimised because of the too high smoothing parameters values and negative initials. This should be fixed now.
- sim.ves() wasn't working correctly in case of AAA models and provided initials.
- The error generated in sim.ves() was always multiplied by the initial state, so if it was zero, then nothing would happen.
- Found bug due to which the exogenous variables wer ignored for the forecasts from ETS(M,Z,Z) models.

Changes:

- All the multisteps estimators now have what they were supposed to originally have: smaller sample of T-h.
- graphmaker() function is now more flexible, allowing to tune parameters of plot.
- Centered Moving Average function is now available. This is not a model, but just a transfer function of SMA.
- New function - msarima() - Multiple Seasonal ARIMA. This is a reimplementation of ssarima() function, that relies on a different state-space model and works substantially faster.
- New function - auto.msarima() - for the order selection of msarima.
- Tuning of msarima() optimisation.
- New method - modelName - that returns the name of the model. e.g. "ETS(M,A,N)". Can be useful for summarising results. Also applicable to non-smooth classes (e.g. Arima, ar etc).
- A new internal function for determining the type of model used (smoothType).
- Moved pointLik, pAIC and errorType methods to greybox package.
- Added MAE, MSE and MRE in the Accuracy function.
- auto functions now switch to intermittent="n", when there's not enough non-zero observations.
- ges() is now renamed to gum() - Generalised Univariate Model.
- The code for prediction intervals in case of intermittent model is now simplified.
- Renamed several internal variables (y.for -> yForecast, y.fit -> yFitted, datafreq -> dataFreq etc) for the consitency purpose and convenience.
- The code of intervals="np" is optimised a little bit and should take less memory for the calculations.

Bugfixes

- Fixed a bug for logistic intermittent model, when the probability of occurrence was becoming 0 or 1.
- es() would not count damping parameter as parameter in the initialisation if model selection is chosen.
- Bugfix for pls(), when the multiple steps ahead covariance matrix is becoming too large to calculate its determinant.
- RelMAE, RelMSE and RelAME were calculated incorrectly in smoothCombine.
- No more warnings from iss(x, intermittent="p") when the data is only slightly intermittent.
- Fixed cases, when level of an intermittent model was becoming too large or too small.
- Fixed a bug, when auto-functions constructed only parametric prediction intervals.
- Functions failed with xregDo="s" when xreg was data.frame.
- nParam sometimes contained negative values for the "Provided" row.

Changes:

- The covariance matrix of VES now also contains named columns and rows.
- And so do residuals, fitted values and forecasts.
- errorType, pointLik and sigma now return something useful for ets class.
- Changed the set of default values for randomizer for simulate functions to "rnorm","rt","rlaplace" and "rs". sim.es() also works with "rlnorm".
- Started the work on sim.ves function.
- Added separate ham() function for HAM calculation.
- ssarima() now also accepts orders=c(p,d,q). lags are assumed to be equal to 1 in this case, so that a non-seasonal model is constructed.
- RelMSE and RelAME error measures are introduced. These should be useful for intermittent demand.
- sim.ves() now seems to work.
- sim.ves() is tested and now should work fine in the majority of cases.
- simulate() method for ves is now available.
- Code of simulate.smooth() is optimised and shortened.
- Small addition in vignette for sim.ves().
- New method for smooth functions - pAIC.
- Simplifications in the number of parameters calculation.

Bugfixes:

- ves() now produces the correct number of plots if silent=FALSE.
- iss() returned the wrong likelihood because of a typo in the formula.
- Fix for the internal likelihood calculation for intermittent logistic models.
- Corrections in pointLik() function. This should now be closer to the original likelihood if summed up. This is still an ongoing research, this thing will change in future.
- Bugfixes in sim.es and sim.ssarima, so that rlaplace and rs can be easily used.
- es(), ssarim(), ces() and ges() didn't work correctly when the already estimated model was reused with new xreg of a different size. The new fix partially solves the problem. Make sure that you provide the table with the correct exogenous variables!
- When a model is reused the nuber of parameters in AIC should be equal to 1 (because only variance is estimated, the rest is provided).

Changes:

- New methods for smooth and vsmooth classes: BICc and AICc.
- New restrictions on the seasonal multiplicative models, so that the indecies don't become rediculous.
- New function - smoothCombine - that combines forecasts from es(), ssarima(), ces(), ges() and sma().
- A reference to a paper about the combination of intervals.
- ves() now returns FI if the user asked for it.
- ves() now also returns error measures in cases of holdout=TRUE.
- Finally, we use the colnames of the provided data in the produced variables.
- modelType() and errorType() methods are now available for iss class.
- ves() now also has usual bounds (smoothing parameters between 0 and 1).
- Updated the description of the package and corrected several typos.

Bugfixes:

- MSCE, MSEh, MACE, MAEh, CHAM and HAMh returned the wrong values in the optimiser for multiplicative models. Now they are correct and the respective likelihoods are correct as well.
- es() in some cases could not find optimal solution because the returned 1e+100 was lower than the estimated value (especially in case of GTMSE and multiplicative models).
- ves() did not work, when the original data was less than 1 and the multiplicative model was needed.
- es() now returns forecast as a vector, not a matrix.
- ves() would not work correctly for provided persistence.
- ves() calculated number of parameters incorrectly in some cases.

Changes:

- Two new methods for the models: covar() returns covariance matrix of 1 to h steps ahead forecast errors; pls() returns Prediction Likelihood Score for the model.
- We now return measurent and persistence vectors and transition matrix from every smooth model. This is needed for the analytical covar().
- covar() now also produces analytical covariance matrix for all the additive models. The same code is used for multiplicative models and should work as an okay approximation.
- The code of prediction intervals has been updated. They should be more precise now.
- The prediction intervals for cfType=c("MAE","HAM") are now produced using Laplace and S distributions.
- After several rounds of derivations, it seems that the forecasts for multiplicative models still correspond to the median, so there is no need for bias correction.
- GES now has a restriction on transition matrix and measurement vector - (0, 1). The idea is that they represent Markov Chain elements.
- Model selection is now supported for MSEh and MSCE as well - we rely on quasi-likelihood of normal distribution.

Bugfixes:

- iss() produced wrong warnings, when wrong value of intermittent was specified.
- ges() and ssarima() used old versions of intermittent in the selection loop.
- ges(), ces(), ssarima() had problems with model selection for intermittent because of the ic parameter.

Changes:

- Moved AICc(), xregExpander(), stepwise() and nParam() to greybox package. We now depend on greybox (>=0.1.1).
- es(), ces(), ges(), ssarima() and all the automatic univariate functions now have model selection mechanism in case of cfType="MAE". This is based on Laplace distribution.
- The same thing is now available for cfType="HAM". This is based on a distribution that I have not yet met in the literature and had to derive myself.
- Corrections in AICc.smooth for intermittent models.
- Due to log-normality assumption in multiplicative models, the forecasts should have a bias correction. This means that ETS(M,N,N) does not produce straight line anymore, but a slowly increasig one. This has been corrected in this version of smooth.
- We now warn, when the number of degrees of freedom is too low for the reasonable estimation of variance (comparing with 5, because a median human being has 5 fingers per hand).

Bugfixes:

- Combinations in es() did not work in case of something like "CYY" because of the wrong pool of models.
- Found a bug in forecast production in cases, when prediction intervals were simulated.
- SBA was not written down, when used in iss. This did not allow to reuse the model properly.
- In some weird cases Croston would produce forecats of intervals < 1. Fixed that.
- Fix in iss() for the cases when intermittent model is applied to non-intermittent data.

Bugfixes:

- Fixed minor typos in the description of the package.
- Fix in iss() for Interval-based model, when for some reason the probability becomes greater than one.
- When the incorrect error/trend/season were specified in es() it would fail to work.
- Fix for the cases, when the names of several xreg variables are the same.
- When xreg is invalid and set to NULL, change xregDo to "use".

Changes:

- ves() model now accepts intermittent parameter. So we can construct multivariate intermittent models.
- ves() now prints information about the underlying intermittent model.
- New estimator - MSCE (Mean Squared Cumulative Error). Needed in cases of cumulative demand.

Bugfixes:

- ves(): Initial values for seasonal components in case of multiplicative models were incorrectly estimated.
- iETS could not be used in some cases of highly intermittent data and intermittent!="n".
- logLik was incorrectly calculated in iss() for cases of intermittent="p".
- The selection of intermittent model was done incorrectly due to the new return of ICs.
- Return NULL in logLik() function, when logLik is unavailable for the model (e.g. combination of models). Similar thing with nParam().
- Check if the data.frame is provided to ves.
- stepwise() now ignores NAs in the provided data.

Changes:

- The providedC is now used in case of xregDo="select". This should increase the speed of convergence and fix several bugs related to optimisation problems.
- The correct initialX are now used in cases of es("ZZZ") and es("CCC").
- We now return the matrix of ICs and ICweights in cases of model selection and combinations of es().
- maxeval in the optimiser now depends on the number of parameters. If we have more than 10, then maxeval=1000. Otherwise maxeval=500.
- Removed a silly SMAPE from the output of accuracies and substituted by a more useful sCE. Both are still available via ourModel$accuracy.

Bugfixes:

- ges() added an array to a vector, which caused dozens of warnings. Fixed.

Changes:

- es() now uses branch and bound mechanism for XXX and YYY models.
- intermittent="l" now allows dealing with seasonal models in imodel.
- make Accuracy() function available for users.
- ces(), ges() and ssarima() now produce some forecasts on small samples (e.g. less than 6 observations). This mechanism is not yet smart enough, and will be improved upon.

Bugfixes:

- es() now also checks if data is multiplicative in case of YYY and acts accordingly.
- dataStart and yForecastStart variables in the code.
- stepwise() now has a more userfriendly Call in the output.

Changes:

- New function, viss() - vector intermittent state space model. Allows modelling occurrence probability of several variables simultaneously.
- New initialisation for es(), ges() and ces(). This should help getting more accurate initial states in cases of high frequency data.
- The user can now control the optimiser via maxeval and xtol_rel provided in ellipsis of es() and ges() functions.

Bugfixes:

- smooth functions would return errors in case when some xreg variables were dropped and only one would be left.
- ETSX(Z,Z,Z) did not work when xreg contained negative data. Now it should.
- Number of parameters in case of xregDo="select" was incorrect.

Changes:

- Updated vignettes.
- New probability type for intermittent models - "logistic".
- In the case when we don't have binary xreg for the holdout, we now consider it as random and forecast it using iss().
- graphmaker() now only resets par() when legend=TRUE. This allows using layout and producing several plots with the function on one canvas.
- xregExpander() now uses iss() function in case of binary data.
- Updated an example in stepwise() function.
- ves() function now uses warning() instead of message() everywhere.
- iss() now also accepts and returns initialSeason (works with intermittent="l" only).

Bugfixes:

- Fixed Likelihood calculation for TSB probability model.

Changes:

- GES now has a multiplicative form. And auto.ges() allows selecting between additive and multiplicative models.
- intermittent now has "i" and "p" values instead of "c" and "t" respectively. This aligns with the recently published working paper on the subject.
- cfType now has a different set of values. RTFM.

Bugfixes:

- Corrected a bug in auto functions with intermittent data.

Changes:

- New function - auto.ges(). It's not fast, but it's pretty efficient.

Bugfixes:

- Number of parameters in ges() was not calculated correctly.
- ges() could not be initialised in cases of small samples and models with large orders.
- Fixed a bug in SSARIMA with multiple steps ahead cost functions.
- es() sometimes returned smoothing parameters values that did not satisfy the usual constrains.
- New initialisation of smoothing parameters in es() in case of cfType="HAM".

Changes:

- Changed the order of parameters in the sim-functions, so that the number of observations and number of simulations follow the very first parameter. This should simplify things.
- Removed some of the redundant alliases in documentation and model.type() function. Use modelType() instead.
- Variance in cases of seasonal models and cumulative=TRUE, are now produced using simulations.
- New function - sim.sma() - generate data from SMA model.

Bugfixes:

- Check of initials when model is not selected in es().
- sim.ssarima() did not take correctly into account the provided initials.

Changes:

- initials for parameters of AR now take into account the number of parameters. Should simplify optimisation of AR.
- Number of parameters in univariate models now consists of the part "estimated" and "provided". Each model now returns a table as nParam with a detailed info about what was estimated/provided. If something was provided, then it is no longer taken into account in calculation of statistics (i.e. AIC, sigma etc).
- Similar thing is now implemented for ves().
- ves() now can produce "independent" prediction intervals (when covariances for time series are ignored).
- Yet another change in the number of parameters to estimate in es(), ges() and ces(), taking that some values could be provided, while the others - left for optimisation.
- sma() now restricts the maximum order in case of order selection to 200. This corresponds to the case with global level for different time series and should be sufficient in 99.9% of cases.

Bugfixes:

- auto.ssarima() had a bug with dataMA.
- auto.ssarima() did not calculate correctly number of iterations for AR models.
- Several minor bugfixes in ges() and ssarima() functions (bugs with provided values).
- Because of R's unique feature of working with names of variables, the situation when CUpper is provided, but C is not, was not handled well.
- Check of maximum number of parameters to estimate did not take into account some of the provided values.
- sma() wasn't checking what is provided as order. Now it does.
- auto.ssarima() did not estimated percentage of estimated models correctly in cases of constant!=NULL.
- Cumulative variance was calculated incorrectly. Now the non-seasonal case is fixed. SEASONAL MODELS STILL HAVE THIS PROBLEM!
- Found bug in variance calculation for some seasonal models, which caused intervals for SSARIMA, GES and CES to be narrower than needed.

Changes:

- Occurrence part of TSB model now accepts ETS models. So you can have trends / seasonality in probability.
- Both Croston and TSB in iss() can now also accept exogenous variables.
- es() now accepts model estimated using ets() function from forecast package.
- Probability in TSB is now restricted with [0, 1] region.
- We can now fit es() even on 3 observations, but with persistence forced to be equal to zero. Don't expect a good model, though...
- auto.ssarima() now allows defining whether constant is needed or not. By default it will check this automatically.
- Initials of xreg before the optimisation are now based on OLS estimates.
- In case of updateX=TRUE, we now check a very basic forecastability condition.
- A couple of new examples in vignettes.

Bugfixes:

- Parameteric prediction intervals for cases of h=1 did not work for some models.
- Fixed model selection on non-positive data, when model="YYY", intermittent!="n", but we don't have enough non-zero observations.
- Models with boundary probabilities returned -Inf as likelihood value, which is incorrect.
- xregDo now works with only one variable as well.
- intermittent="a" did not work with auto.ssarima() and auto.ces() functions.
- initials of xreg did not work correctly when Etype="A".
- Now we force the provided xreg to become a matrix.
- xreg did not work well with zoo, when xreg contained NAs. Now it should work.
- auto.ssarima() did not allow selecting the best model between AR models only. Now it does.
- Fixed xreg selection in cases of xreg having special characters in names.
- Centering of errors in sim.es() is now done automatically only for runif.
- Number of parameters returned by models was not correct, missing exogenous variables and intermittent model.

Changes:

- Forecasts and prediction intervals of the rounded values are now produced analytically.
- PLS now needs vector of variances, which is produced only when intervals==TRUE. In all the other cases its value can be incorrect.
- New initials for the exogenous variables in case of multiplicative models + stricter check of correlations between the regressors.
- We also now check multiple correlations for exogenous variables.
- silent="all" is now the default value.

Bugfixes:

- Provided imodel sometimes would not be used correctly in the initialisation.
- Rounded values were not returned in cases when intervals=FALSE.
- PLS could not be calculated for some cases, when ts object was used.

Changes:

- New function - ves(). Currently the basic features of all the pure additive and pure multiplicative models are implemented. No prediction intervals, no intermittence, no automatic model selection.
- New parameter - imodel, which determines the type of model for probability in case of iSS models. Can also accept models previously estimated using iss() function.
- Point forecasts in case of simulated data are now based on the simulation rather than analytical expression.
- Max order of SMA is now equal to obsInSample.
- Introduced a hidden parameter, rounded, which determines whether the rounded up value of demand sizes is assumed in the model. This influences the cost function and leads to a different results in case of intermittent model.
- If cumulative==TRUE, then we now return cumulative holdout values as well.
- New method pointLik() for smooth class. It returns the vector of log-likelihoods for each separate observation.
- Better integration of sim.es() objects and es() function. Now you can do something like this to fit the "true" model: x <- sim.es("MNN"); es(x$data,model=x).
- es() now also returns transition matrix.
- Optimised C++ code, which should result in the growth of computational speed for ~25%.
- es() now returns PLS value in the accuracy for all the types of models.

Bugfixes:

- simulator function in Rcpp did not cover the cases, when level could become negative. This is now fixed.
- ssarima() now checks if the number of observations is enough for the model and stops if it is not.
- es() didn't work in some cases of seasonal models, when number of in-sample observations was less than twice frequency of data. The seasonal model should not be used there in the first place.
- getResponse() function now returns the in-sample actuals.
- exists() functions in the code would look into the parent environments. Now they don't.
- sim.ssarima() returned state vector with wrong names in case of constant.
- When coef() was applied to es() objects, the initialSeason parameters were not returned because of the old name of the variable.
- Corrected a problem with initials of iETSX models.

Changes:

- New parameter - cumulative - which makes functions return aggregated over the forecast horizon values (point and interval forecasts).
- graphmaker() now treats cumulative forecasts.
- Error measures take the possible cumulative nature of forecasts into account.
- auto() functions now also accept smooth.sim objects as data.
- polyroot() was working badly for multiple seasonal ARIMAs, so I had to ditch it in favour for my Rcpp function. SSARIMA now works even slower. Will need to optimise it somehow.
- Updated vignettes, showing how multiple seasonal ARIMA can be estimated.
- Renamed MLSTFE into GMSTFE - Geometric Mean Squared Trace Forecast Error. This is slightly easier to remember.
- Trace Forecast Likelihood is once again available as estimator.
- Started work on a new function - ves() - Vector Exponential Smoothing. It will be released in 2.0.0.

Bugfixes:

- datafreq is now used in all the functions.

Changes:

- New function in error measures category - pls() - Prediction Likelihood Score.
- PLS is now included in accuracy measures of es().

Bugfixes:

- Fixed a problem with phi estimation in cases, when initial values for the optimiser are provided.
- Now we don't check C / CLower / CUpper if they are not provided.
- Fixed a problem with prediction intervals construction for binary variables.

Changes:

- New function - sim.ges() - simulate data using GES model.

Bugfixes:

- Fixed bug with cfType="MSTFE" in case of multiplicative errors.

Changes:

- New function - xregExpander(), which creates matrix of xreg with lagged values based on provided data and automatically fills in NAs with forecasted values using es().
- "optimal" is now the default initialisation method for ces().
- Created templates for roxygen2 for the consistency purposes of the documentation.
- plot() methods for classes smooth and smooth.sim now accept main and ylab parameters. Do whatever you want!

Bugfixes:

- In cases of df<=0 we now produce a warning and prediction intervals based on Chebyshev's inequality.
- es() now does not complain about failing to estimate something when persistence is predefined.
- Fixed a bug, when predicting binary variables using any iSS model, we would end up with errors. Now in this case we just select among the intermittent models, ignoring non-intermittent one.

Changes:

- Mixed ETS models now produce negative forecasts. But it does not make much sense to my taste...
- The initial values of smoothing parameters before the optimisation are now set to 0.3, 0.2, 0.1 for both additive and multiplicative models.
- Some plot() methods for smooth now accept additional parameters.
- es() now also accepts hidden parameters C, CLower and CUpper for initialisation of optimiser and setting bounds in which to search for the optimal value.
- es(), ces(), ssarima() and ges() now accept smooth.sim objects and can automatically extract data from them. This is just for comfort...

Changes:

- The package now uses roxygen2. It's a bit messy at the moment, but will be sorted out soon.
- We now import a couple of functions from forecast package (forecast and getResponse). This helps us make better connection between methods in packages.
- forecast() function for smooth now returns $method as a name of applied model and $model as a fitted R model (corresponds to what forecast does in forecast package).

Bugfixes:

- If data passed to functions was a matrix, then functions wouldn't work. Now they say about that out loud.
- Fixed a bug with mixed models with multiplicative errors. They produce sometimes senseless forecasts, but at least they produce them.
- Added some stuff to src folder (registerDynamicSymbol.c) in order to make CRAN checks shut up about some irrelevant things (R_useDynamicSymbols? R_registerRoutines? WTF?!).

Changes:

- Added orders and lags method for the class Arima. This should allow easily extracting these values from models fitted using arima(), Arima() and auto.arima() functions from stats and forecast packages.
- modelType() is now renamed into model.type().
- If xreg contains NAs, we now substitute them with zeroes.

Bugfixes:

- Fixed a bug with initial value in backcasting, that was causing annoying problems in ssarima.
- Fixed a bug in sma() function and model provided to it.
- Fixed names of xreg in cases when we need to drop some of the variables.
- In some cases the second optimiser behaved badly and returned worsened value. Fixed it.
- Fixed a bug with phiEstimate becoming equal to TRUE, when phi is not needed at all.

Changes:

- Fixed a problem with ETS(M,Z,Z) and xreg.
- Function now removes xreg which is equal to the value we need to forecast (if there is one).
- We also now return formula in es(), which is accesible via formula() function. This should help when you have problems in understanding what model has been constructed.

Bugfixes:

- Corrected description of accuracy measures in es(), ces(), ges() and ssarima().
- Fixed some bugs relating combination of models with xregDo="s".

Changes:

- Addressed issue #58. Now matrix is first transposed and then model is fitted to data. This led to a tiny increase in speed.
- Prediction intervals for intermittent models are now rounded up.

Bugfixes:

- Non-parametric and semi-parametric intervals were broken since 1.6.0
- es() with backcasting and predefined persistence was complaining on estimation problems without any reason.
- Corrected initial quantiles for prediction intervals and optimisation mechanism (for correct prediction intervals for intermittent data).

Bugfixes:

- Corrected a bug with nExovars in es()

Changes:

- ssarima(), ges() and ces() now have xreg selection mechanism.
- auto.ssarima() and auto.ces() now also have that stuff.
- Finally es() does that as well.
- iSS models now return relevant error measures.
- es() now allows combining a pool of models, when the list includes "CCC".
- logLik() now also includes nobs as an attribute.
- We now report modelX if it includes xreg. For example, "ARIMAX" instead of ARIMA.
- Renamed some internal variables for consistency purpose.
- Redone prediction intervals for iSS models.

Bugfixes:

- Renamed some internal parameters for consistency purposes.
- Found a bug with nParam calculation in ges().
- Fixed a bug that did not allow to use combinations with intermittent demand in es().
- Fixed a bug in backcasting mechanism.
- Fixed a bug with incorrect df calculation for prediction intervals in combinations.

Changes:

- Instead of having dozens of methods based on AIC and BIC, we now have logLik, nobs and AICc.default. The latter should also work with other, non smooth, classes (e.g. "ets","lm").
- sim functions now return likelihood via logLik value rather than "likelihood". This allows using logLik, AIC and other functions.
- iss function now also does the same...
- Introduced "SBA" as a separate method for intermittent demand.

Bugfixes:

- Parametric prediction intervals for iSS models always had width of 95%. This is now fixed.
- Corrected bug in Croston's iSS, where the last observation of data was included as non-zero demand.
- Fixed a bug when MNN was fit to intermittent data without intermittency.

Changes:

- Now you can produce 0-steps ahead forecasts using smooth functions. Pretty cool, ah? And pretty useless for my taste. But here it is!
- iprob in sim functions now also accepts a vector, implying that probability may vary over time in style of TSB and Croston's method.

Bugfixes:

- intermittent data was not taken correctly into account in number of parameters calculation in functions.
- Fixed a bug with persistence not accepting matrices in es()
- persistence now looks nice in the output of sim.es()
- sim.ssarima() had a bug with array not becoming a matrix. Nailed it!

Changes:

- auto.ssarima() now allows combining forecasts using IC weights. This is a first try. Prediction intervals for the combined model are currently incorrect.
- Made important changes to initialisation of SARIMA and some tuning in backcasting mechanism.
- Some tuning in sim functions in parts with ellipsis checks.
- sim.ssarima() now accepts orders as list. This should be handy when doing sim.ssarima(orders=orders(ourModel)). No need to define each order separately anymore.
- ssarima() also accepts orders as list. No need to specify separate ar.orders, ma.orders and i.orders (they are now optional) if you want to extract value from another model. Plus it is handy just to write orders=list(ar=1,i=1,ma=c(1,2,3)).
- auto.ssarima() now also uses orders as a list variable instead of ar.max, i.max and ma.max.
- sim.ssarima() now uses burn-in period if the initials were generated.
- Uodated manuals, so they are a bit more consistent.
- Got rid of silent parameter in sim functionst, because all the info they give needs to be put in warnings.
- sim functions now print proper warnings.
- Tuned initial values of es(). This should be helpfull in cases with backcasting of initials.
- Optimised auto.ssarima() mechanism. Not faster, but more accurate.

Bugfixes:

- sim.ssarima() wouldn't work in cases of ARIMA(0,0,0) with/without constant.
- polynomials were multiplied inccorectly in cases of ARIMAs with d>1.
- Fixed a bug with phiEstimate not beeing used correctly.

Changes:

- New function - sim.ces(), that generates data from CES model with predefined parameters.
- Due to (1) simulate.smooth() now also works with CES.
- modelType() in cases of ces() now returns the full name of model instead of the first letter.
- auto.ces() has now a smaller pool of models: "none", "simple" and "full".

Bugfixes:

- Fixed problem with xreg length and provided initialX (issue #59 on github).
- Fixed a check of models pool in auto.ces().

Changes:

- New function - sim.ssarima() that allows generating data from any ARIMA with any provided parameters.
- New methods for smooth class: lags, orders and modelType. First two are for ssarima(), ges() and sma(), the last one is for es(), ces() and ets() from "forecast" package.
- Introduced new class for simulation functions, "smooth.sim" and created print and plot methods for them.
- es() now accepts "XXX" as model. This allows excluding multiplicative components from the pool. This does not use branch and bound. So model="ZXZ" will go through all the models with T="N", T="A" and T="Ad".
- Similarly es() can now select the most appropriate non-additive model. This is regulated with: model="YYY".

Minor changes:

- Updated print for "smooth" class for es() and ges(): now we produce a nice vector with names of smoothing parameters.
- simulate.smooth() method update in order to take sim.ssarima() into account.
- AICc now also extracts AICc from ets() of "forecast" package.

Bugfixes:

- Fixed a bug with provided model with damped trend.
- Fixed a bug in pool of models with damped trend ("ZAdZ").

Changes:

- Parameter intervals now accepts type of interval instead of intervalsType.
- Polynomials of ssarima() are now multiplied in C++. Initialisation is now done there as well. This slightly speeds up the estimation and construction of SSARIMA.

Bugfixes:

- Fixed names of returned smoothing parameters by es().

Changes:

- auto.ssarima() function uses now a different algorithm. This allows speeding up order selection process and selecting models closer to the "true" one.
- Some corrections in smooth-Documentation.
- Package will now tell its version when loaded.

Bugfixes:

- Corrected C++ bug that caused problems on Solar OS.

Changes:

- Removed "TFL" as a cost function type and "asymmetric" as intervals type. The functions still accept these parameters, but the parameters are now hidden, because currently they are not ready for wide audience.
- Changed how number of parameters is calculated when initials are provided. They should be counted in. Only backcasting now excludes initials in calculation of number of parameters.
- Prepared vignette for es(), ces(), ssarima(), ges(), sma() and sim.es(). This now includes examples with some comments.
- Uploaded documentation for the package to github (https://github.com/config-i1/smooth/smooth.pdf). This will be published as working paper and will be available via ResearchGate.

Bugfixes:

- Fixed a bug with intervalsType="s" not working for auto functions.
- data provided to auto functions is now checked.

Changes:

- We now use vignettes, explaining how to work with functions and what they return. This is just a start of the work. Vignettes will be updated. There is also a work on documentation for models underlying smooth package. This is currently reviewed and will be available as a working paper soon.
- New function - sma() - Simple Moving Average. It fits one as a state space model. So, apparantely there is a model underlying simple moving average method...
- Named transitionX and persistenceX are now returned, when using exogenous variables are used with updateX=TRUE. This should simplify the analysis of these matrices.

Bugfixes:

- A fix for plot(es(...)) in case of inclusion of exogenous variables leading to states containing more than 10 columns.
- Warnings are now always printed out for unstable SSARIMA.

Changes:

- We now suggest testthat package and do more extensive tests in order to make sure that everything works as it should.
- Introduced parameters A and B in ces() function.
- Got rid of parameter C in ces() function.

Bugfixes:

- ssarima() could not construct ARIMA(0,1,0) without constant. Fixed that.

Changes:

- Started this NEWS file.
- Fixed a bug with ssarima() not accepting previously estimated models in cases with constant=TRUE.
- Removed NUS and sim.ces. They will return when they are in a better condition.