# NOT RUN {
x <- c(1, 2)
f <- function(x, a) prop.table(c(sum(x), a * prod(x)^(1 / 2)))
iterate(x, f, 100, a = 3)
iterate(x, f, 100, tol = 1e-5, a = 3)
x <- c(1, 2, 3)
f <- function(x) {
n <- length(x)
sigma <- seq(-1, 1, length.out = n)
result <- rep(NA, n)
for (k in 1:n) result[k] <- CES(sigma[k], 1, rep(1 / n, n), x, rep(1 / n, n))
prop.table(result)
}
iterate(x, f, 100)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab