netfit: Fits any standard feedforward neural net model from...

View source: R/netfit.R

netfitR Documentation

Fits any standard feedforward neural net model from time-series data

Description

This function fits any standard feedforward neural net model from time-series data.

Usage

netfit(
  serie,
  m = 1:4,
  lag = 1:1,
  timelapse = c("FIXED", "VARIABLE"),
  h = 2:10,
  w0maxit = 100,
  wtsmaxit = 1e+06,
  pre.white = TRUE,
  trace = 1,
  seed.t = TRUE,
  seed = 56666459
)

Arguments

serie

a vector, a time-series object ts or xts, a data.frame, a data.table or a matrix depending on the method selected in timelapse.

m

a non-negative integer denoting a lower and upper bound for the embedding dimension (Default 1:4).

lag

a non-negative integer denoting a lower and upper bound for the the reconstruction delay (Default 1:1).

timelapse

a character denoting if the time-series data are sampled at uniform time-frequency e.g., 1-month, 1-day, 1-hour, 30-min, 5-min, 1-min and so on FIXED or non-uniform time-frequency which are not equally spaced in time VARIABLE (Default FIXED).

h

a non-negative integer denoting a lower and upper bound for the number of neurones (or nodes) in the single hidden layer (Default 2:10).

w0maxit

a non-negative integer denoting the maximum iterations to estimate the initial parameter vector of the neural net models (Default 100).

wtsmaxit

a non-negative integer denoting the maximum iterations to estimate the weights parameter vector of the neural net models (Default 1e6).

pre.white

a logical value denoting if the user wants to use as points to evaluate the partial derivatives the delayed vectors filtered by the neural net model chosen TRUE or not FALSE (Default TRUE).

trace

a binary value denoting if the user wants to print the output on the console 1 or not 0 (Default 1).

seed.t

a logical value denoting if the user wants to fix the seed TRUE or not FALSE (Default TRUE).

seed

a non-negative integer denoting the value of the seed selected if seed.t = TRUE (Default 56666459).

Value

This function returns several objects considering the parameter set selected by the user. The best-fitted feed-forward single hidden layer neural net model is saved. It also contains some useful information about the best set of weights found, the fitted values, the residuals obtained or the best embedding parameters set chosen. The best 10 models are displayed on the console. The first column is the neural net number, the second column is the embedding dimension, the third column is the lag or reconstruction delay considered, the fourth column is the number of neurones (or nodes) in the single hidden layer and the fifth column is the Bayesian Information Criterion (BIC) value corresponding to that neural net. Notice that the neural net models are sorted from lowest to highest BIC values.

Note

The process of adjustment to a neural net model often suffers from being trapped in local optima and different initialization strategies should be taken into account. For this reason the function w0.net have been implemented. This function estimates previously the initial parameter vector of the neural net model being able to set the maximum number of iterations that the user wants to obtain setting w0maxit. In addition, by default the neural network estimation is initialized with a fixed seed denoted by seed.t=TRUE with a value equal to seed=56666459. The R user can let the seed be fixed either randomly by seed.t=FALSE or even fix other value of the seed to be able to replicate the results obtained.

Author(s)

Julio E. Sandubete, Lorenzo Escot

References

Ripley, B.D. 1996 Pattern Recognition and Neural Networks. Cambridge.

Venables, W.N., Ripley, B.D. 2002 Modern Applied Statistics with S. Fourth edition. Springer.

Hornik, K., Stinchcombe, M., White, H. 1989 Multilayer feedforward networks are universal approximators. Neural Networks 2(5):359-366.

Examples

## set.seed(34)
## Simulates time-series data from the Logistic map with chaos
## ts        <- DChaos::logistic.sim(n=1000, a=4)
## show(head(ts, 5))

## Provides the best-fitted neural network models for certain parameter set
## model    <- DChaos::netfit(ts, m=1:4, lag=1:3, timelapse="FIXED", h=2:10)
## summary(model)

DChaos documentation built on March 31, 2023, 6:48 p.m.

Related to netfit in DChaos...