Description Usage Arguments Value Note Author(s) References Examples

Wrapper function for optimizing any combination of a given `seasonal.factor`

vector in NNS.ARMA. Minimum sum of squared errors (forecast-actual) is used to determine optimum across all NNS.ARMA methods.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
NNS.ARMA.optim(
variable,
training.set,
seasonal.factor,
negative.values = FALSE,
obj.fn = expression(sum((predicted - actual)^2)),
objective = "min",
linear.approximation = TRUE,
lin.only = FALSE,
print.trace = TRUE,
ncores = NULL
)
``` |

`variable` |
a numeric vector. |

`training.set` |
integer; Sets the number of variable observations as the training set. See |

`seasonal.factor` |
integers; Multiple frequency integers considered for NNS.ARMA model, i.e. |

`negative.values` |
logical; |

`obj.fn` |
expression; |

`objective` |
options: ("min", "max") |

`linear.approximation` |
logical; |

`lin.only` |
logical; |

`print.trace` |
logical; |

`ncores` |
integer; value specifying the number of cores to be used in the parallelized procedure. If NULL (default), the number of cores to be used is equal to half the number of cores of the machine. |

Returns a list containing:

`$period`

a vector of optimal seasonal periods`$weights`

the optimal weights of each seasonal period between an equal weight or NULL weighting`$obj.fn`

the objective function value`$method`

the method identifying which NNS.ARMA method was used.`$bias.shift`

a numerical result of the overall bias of the optimum objective function result. To be added to the final result when using the NNS.ARMA with the derived parameters.

Typically,

`(training.set = length(variable) - 2 * length(forecast horizon))`

is used for optimization. Smaller samples would use`(training.set = length(variable) - length(forecast horizon))`

in order to preserve information.The number of combinations will grow prohibitively large, they should be kept as small as possible.

`seasonal.factor`

containing an element too large will result in an error. Please reduce the maximum`seasonal.factor`

.If variable cannot logically assume negative values, then the

`$bias.shift`

must be limited to 0 via a`pmax(0,...)`

call.

Fred Viole, OVVO Financial Systems

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" https://www.amazon.com/dp/1490523995/ref=cm_sw_su_dp

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
## Nonlinear NNS.ARMA period optimization using 2 yearly lags on AirPassengers monthly data
## Not run:
nns.optims <- NNS.ARMA.optim(AirPassengers[1:132], training.set = 120,
seasonal.factor = seq(12, 24, 6))
## Then use optimal parameters in NNS.ARMA to predict 12 periods in-sample.
## Note the {$bias.shift} usage in the {NNS.ARMA} function:
nns.estimates <- NNS.ARMA(AirPassengers, h = 12, training.set = 132,
seasonal.factor = nns.optims$periods, method = nns.optims$method) + nns.optims$bias.shift
## If variable cannot logically assume negative values
nns.estimates <- pmax(0, nns.estimates)
## End(Not run)
``` |

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.