Description Usage Arguments Value Author(s) References See Also Examples
For the toy function h(x)=(cos(50*x)+sin(20*x))^2, this function represents simulated annealing sequences converging to a local or global maxima as paths on top of the function h itself. The simulated annealing parameters ratemp and powemp can be changed, as well as the stopping rule tolerance.
1 |
tolerance |
maximal difference in the target value needed to stop the simulated annealing algorithm |
ratemp |
scale factor of temp that determines the scale of the random walk |
powemp |
power of 1/(1+t) used to set the temperature schedule |
The value of this function is a list, with components
x |
coordinates of the successive values of the random walk produced by the simulated annealing algorithm |
y |
corresponding values of h(x), of the same length as x |
Christian P. Robert and George Casella
From Chapter 5 of EnteR Monte Carlo Statistical Methods
dyadic
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Section 5.2.2, artificial function example 5.8
h=function(x){(cos(50*x)+sin(20*x))^2}
par(mar=c(4,4,1,1),mfrow=c(2,2))
for (tt in 1:4){
curve(h,from=0,to=1,n=10001,col="grey",lwd=2)
sam=maximple()
xgo=sam$x
hgo=sam$y
lines(xgo,hgo,col="steelblue4",lwd=2)
points(xgo,hgo,col="steelblue4",cex=.5,pch=19)
}
|
Loading required package: MASS
Loading required package: coda
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.