TrainIBHM function which creates IBHM approximation
models.
ConfigureIBHM( stop.criterion = IterationSC(3), weighting.function = function(y, w.par){ 0.01+dnorm(y,sd=abs(w.par))}, scal.optim = 'multi.CMAES', scal.optim.params = list(retries=3, inner=list(maxit=50, stopfitness=-1)), scal.candidates = c('dot.pr','radial','root.radial'), activ.optim = 'multi.CMAES', activ.optim.params = list(retries=3, inner=list(maxit=100, stopfitness=-1)), activ.candidates = c('tanh','logsig','lin'), jit=TRUE, verbose=FALSE, final.estimation = 'all', final.estimation.x = NULL, final.estimation.y = NULL, final.estimation.maxit = 100 )IterationSC (the default) or ValidationSC.
For simplicity, the default value causes the method to construct a model with a fixed number of components (3), however it's actually best to use ValidationSC criterion with a separate validation set.
CMAES, multi.CMAES(default), DE, multi.DE.
The parameter values set the optimization methods as follows:
CMAES uses covariance matrix evolution strategy implemented in the cmaes package,
multi.CMAES is multistart cmaes,
DE uses differential evolution implemented in DEoptim package,
multi.DE is multistart DE.
CMAES this should be a list, in case of DE this should be a DEoptim::DEoptim.control object.
In case of multistart versions of optimization methods this parameter is a list with two fields:
retries denoting the number of restarts and inner containing the parameters passed
during each restart to the underlying optimization method.
scal.optim.
scal.optim.params.
compiler package.
weights and all for all parameters.
x values used during the final estimation step. If not given then the training data is used.
y values used during the final estimation step. If not given then the training data is used.
TrainIBHM.
TrainIBHM, ValidationSC,IterationSC
x <- seq(-3,3,length.out=400)
y <- tanh(x)
x.val <- runif(50,min=-6,max=6)
y.val <- tanh(x.val)
m <- TrainIBHM(x,y, ConfigureIBHM( scal.candidates = 'dot.pr',
activ.candidates = 'tanh',
stop.criterion = ValidationSC(x.val, y.val)))
summary(m)
plot(y.val,predict(m,x.val),asp=1)
Run the code above in your browser using DataLab