Description Usage Arguments Value Note Author(s) References See Also Examples

Fit MLP neural network.

1 2 3 4 5 6 | ```
mlp(y,m=frequency(y),hd=NULL,reps=20,comb=c("median","mean","mode"),
lags=NULL,keep=NULL,difforder=NULL,outplot=c(FALSE,TRUE),
sel.lag=c(TRUE,FALSE),allow.det.season=c(TRUE,FALSE),
det.type=c("auto","bin","trg"),xreg=NULL, xreg.lags=NULL,
xreg.keep=NULL,hd.auto.type=c("set","valid","cv","elm"),
hd.max=NULL, ...)
``` |

`y` |
Input time series. Can be ts or msts object. |

`m` |
Frequency of the data. |

`hd` |
Number of hidden nodes. This can be a vector. |

`reps` |
Number of networks to train. |

`comb` |
Combination operator for forecasts when reps > 1. Can be "median", "mode" (based on KDE estimation) and "mean". |

`lags` |
Lags of y to use as inputs. If none provided then 1:frequency(y) is used. Use 0 for no univariate lags. |

`keep` |
Logical vector to force lags to stay in the model if sel.lag == TRUE. If NULL then it keep = rep(FALSE,length(lags)). |

`difforder` |
Vector including the differencing lags. For example c(1,12) will apply first and seasonal (12) differences. For no differencing use 0. For automatic selection use NULL. |

`outplot` |
Provide plot of model fit. Can be TRUE or FALSE. |

`sel.lag` |
Use selective lags only. Can be TRUE or FALSE. |

`allow.det.season` |
Permit modelling seasonality with deterministic dummies. |

`det.type` |
Type of deterministic seasonality dummies to use. This can be "bin" for binary or "trg" for a sine-cosine pair. With "auto" if ony a single seasonality is used and periodicity is up to 12 then "bin" is used, otherwise "trg". |

`xreg` |
Exogenous regressors. Each column is a different regressor and the sample size must be at least as long as the target in-sample set, but can be longer. |

`xreg.lags` |
This is a list containing the lags for each exogenous variable. Each list is a numeric vector containing lags. If xreg has 3 columns then the xreg.lags list must contain three elements. If NULL then it is automatically specified. |

`xreg.keep` |
List of logical vectors to force lags of xreg to stay in the model if sel.lag == TRUE. If NULL then all exogenous lags can be removed. |

`hd.auto.type` |
Used only if hd==NULL. "set" fixes hd=5. "valid" uses a 20% validation set (randomly) sampled to find the best number of hidden nodes. "cv" uses 5-fold cross-validation. "elm" uses ELM to estimate the number of hidden nodes (experimental). |

`hd.max` |
When hd.auto.type is set to either "valid" or "cv" then this argument can be used to set the maximum number of hidden nodes to evaluate, otherwise the maximum is set automatically. |

`...` |
Additional inputs for neuralnet function. |

An object of class "`mlp`

".
The function `plot`

produces a plot the network architecture.
An object of class `"mlp"`

is a list containing the following elements:

`net` |
MLP networks. |

`hd` |
Number of hidden nodes. |

`lags` |
Input lags used. |

`xreg.lags` |
xreg lags used. |

`difforder` |
Differencing used. |

`sdummy` |
Use of deterministic seasonality. |

`ff` |
Seasonal frequencies detected in data (taken from ts or msts object). |

`ff.det` |
Seasonal frequencies coded using deterministic dummies. |

`det.type` |
Type of determistic seasonality. |

`y` |
Input time series. |

`minmax` |
Scaling structure. |

`xreg.minmax` |
Scaling structure for xreg variables. |

`comb` |
Combination operator used. |

`fitted` |
Fitted values. |

`MSE` |
In-sample Mean Squared Error. |

`MSEH` |
If hd.auto.type is set to either "valid" or "cv" an array of the MSE error for each network size is provided. Otherwise this is NULL. |

To use mlp with Temporal Hierarchies (thief package) see `mlp.thief`

.

Nikolaos Kourentzes, [email protected]s.com

For combination operators see: Kourentzes N., Barrow B.K., Crone S.F. (2014) Neural network ensemble operators for time series forecasting.

*Expert Systems with Applications*,**41**(**9**), 4235-4244.

`forecast.mlp`

, `plot.mlp`

, `mlp.thief`

, `elm`

.

1 2 3 4 5 | ```
fit <- mlp(AirPassengers)
print(fit)
plot(fit)
frc <- forecast(fit,h=36)
plot(frc)
``` |

trnnick/TStools documentation built on Aug. 12, 2018, 4:31 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.