downhillsimplex: downhillsimplex function

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

View source: R/downhillsimplex.R

Description

Impementation of the downhillsimplex function for optimisation

Usage

1
2
3
downhillsimplex(fc,nParams,bp=NULL,lower=0,upper=1,it=1000,tol=1e-10,
control= list(alpha=1,gamma=2, beta=0.5,sigma = 0.5) )
  

Arguments

fc

Function to be minimized

nParams

Number of parameters that the function to be optimized requires

bp

Matrix used to start the optimisation. If no parameters is given, this matrix will be randamly initialized.

lower

Vector for the lower bound of the parameters

upper

Vector for the upper bound of the parameters

it

Maximium number of iterations done by the downhillsimplex algortihm

tol

tolearnce that is used to test for convergence

control

list of variables that control the behavior of the downhillsimpley algorithm. alpha = Reflexion gamma = Expansion beta = Contraktion sigma = Compression

Details

Implemented in C, will call you R function

Value

Returns estimated parameters

Note

Implementation according to Wikipedia page

Author(s)

Dennis Becker

References

Implementation according to describtion on wiki: https://en.wikipedia.org/wiki/Nelder

See Also

Package Overview: gpHist-Package

Function for hyperparameter estimation: estimateHyperParameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#simple function to be optimized
fn = function(x){
 x^2 
}


#call downhillsimplex
res = downhillsimplex(fn,1,lower=-10,upper=10,it=1000,tol=1e-10)

#plot results
x = seq(-10,10,0.01)
plot(x,fn(x),type='l')
points(res[1],fn(res[1]),col='red')


legend('topleft',legend=c('Function', 'Estimated minimum'), col=c('black','red'),
lty=c(1,NA),pch=c(NA,1))

gpHist documentation built on Nov. 24, 2017, 5:03 p.m.