sa: Simulated Annealing Algorithm

View source: R/sa.R

saR Documentation

Simulated Annealing Algorithm

Description

Simulated Annealing Algorithm

Usage

sa(n = 5000, x = c(-1.9, 1.9))

Arguments

n

number of generated points MC

x

grid of measurements

Details

h=function(x) if(is.vector(x)) dim(x)=c(1,2) cos(10*x[,1]^2)-5*x[,1]^2+cos(10*x[,2]^2)-5*x[,2]*2

uwalk = function(x, step = c(0.1, 0.1), valid) xn = x + runif(length(x), -1, 1) * step while (!valid(xn)) xn = x + runif(length(x),-1, 1) * step xn

hv = function(x) !any(x <= -2 | x >= 2)

tempf = function(n) 0.995^(1:n) * 10000


ferielachaibou/stat617course documentation built on May 9, 2022, 12:05 a.m.