library(TheSource)
cost = function(x) {
  x^2
}

b = data.frame(min = -10, max = 10)

m = parameter.search(n = 1, cost = cost, bounds = b)
str(m)
plot(m$grid$x, m$grid$cost)
abline(v = m$min$x)
cost = function(x) {
  x^2
}

b = data.frame(min = -10, max = 10)

m = parameter.search(n = 10, cost = cost, bounds = b, progression = 1)


par(mfrow=c(1,2))
plot(m$history$x, m$history$cost, xlim = c(-10,10), main = m$min$x)
plot(m$history$x, m$history$cost)
abline(v = m$min$x)
cost = test.function(1)
m = parameter.search(n = 10, cost = cost, bounds = b, progression = 1)


tbrycekelly/TheSource documentation built on Nov. 7, 2023, 12:48 a.m.