# Dynamic Model Averaging in Economics and Finance with fDMA: A Package for R
## 6 Alternative Forecasts  
It was already mentioned that in order to make this package an easy tool for a practitioner, some other than DMA, DMS or Median Probability Model methods were also implemented. The aim was to provide a few other, in some sense similar, or competitive, methods of model averaging. Then, the user is able to quickly compare DMA, DMS or Median Probability Model with some other forecast. Moreover, putting them into one package allows to have a visualisation of the outcomes in a similar fashion, which might greatly ease the work. The function alft computes a few basic and common models. In particular:  
* naive forecast (_naive_), i.e., all forecasts are set to be the value of the last observation,
* Ordinary Least Squares linear regression (_OLS_),
* recursive OLS (_rec. OLS_), i.e., later described rec.reg,
* rolling OLS (_roll. OLS_), i.e., later described roll.reg,
* _AR(1)_ estimated by Least Squares method,
* _AR(2)_ estimated by Least Squares method,
* _TVP_ linear regression, i.e., vvp with V = 1 and lambda = 0.99,
* _TVP-AR(1)_, i.e., TVP as above with explanatory set expanded by the first lags of the dependent variable,
* _TVP-AR(2)_, i.e., TVP as above with explanatory set expanded by the first and the second lags of the dependent variable,
* _Auto ARIMA_, i.e., auto.arima from the package forecast of [PERSON] and [PERSON] [20]. ME (Mean Error), RMSE (Root Mean Squared Error), MAE (Mean Absolute Error), MPE (Mean Percentage Error) and MAPE (Mean Absolute Percentage Error) are computed by accuracy from forecast by [PERSON] and [PERSON] [20]. HR (Hit Ratio) is computed as the later described hit.ratio. altf(y, x, window = NULL, initial.period = NULL, d = NULL, f = NULL, fmod = NULL, c = NULL)  
Using this function is similar to using the already described function altf2. The arguments for this function are the following:  
* y should be a numeric or a column matrix of the dependent variable,
* x should be a matrix of the explanatory variables, where different columns correspond to different explanatory variables,
* window is optional. This numeric represents the size of a rolling regression window (a number of observations). If not specified, then 10% of all observations are taken. For the details, please see the description of the function roll.reg further,
* initial.period is optional. This numeric represents the number of observation since which forecast quality measures are computed. If not specified the whole sample is used, i.e., initial.period = 1 is taken, this argument also divides the sample into in-sample and out-of-sample for non-recursive methods (OLS, AR(1), AR(2), auto ARIMA),
* d is optional. This logical is a parameter used for HR (Hit Ratio) calculation. It should be d = FALSE taken for level time-series in the dependent variable, and d = TRUE if the dependent time-series represents changes. If not specified, then d = FALSE is taken,
* f is optional. This logical vector indicates which of the alternative forecasts:  
1. _naive_,
2. _OLS_,
3. _rec. OLS_,
4. _roll. OLS_,
5. _TVP_,
6. _AR(1)_,_AR(2),_
* _Auto ARIMA,_
* _TVP-AR(1),_
* _TVP-AR(2),_  
should be computed. If not specified, then f = c(rep(TRUE, 10)) is taken, i.e., all the alternative forecasts are computed,
* fmod is optional. This should be a class dma object--a model which will be compared with the alternative forecast,
* c is optional. This logical indicates whether a constant term should be included in the models. If not specified c = TRUE is used, i.e., constant term is included in the estimated models. The outcomes are a class altf object, i.e., a list of:  
* $summary: a matrix of forecast quality measures ordered by columns (forecast methods are ordered by rows),
* $y.hat: a list of predicted values from all forecasting methods which were applied,
* $y: the dependent (forecasted) time-series,
* $coeff.