ao {ao} | R Documentation |
This function performs alternating optimization on the function f
.
ao( f, partition, initial = 0, iterations = 10, tolerance = 1e-06, minimize = TRUE, progress = FALSE, plot = TRUE )
f |
An object of class |
partition |
A list of vectors of parameter indices 1,...,n of the function.
For example, choosing |
initial |
A vector of length |
iterations |
The number of iterations through all subsets. |
tolerance |
A non-negative numeric value. The function terminates prematurely if the
euclidean distance between the current solution and the one from the last
iteration is smaller than |
minimize |
If |
progress |
If |
plot |
If |
This function depends on optimx
.
An object of class ao
, which is a list of
optimum
, the optimal value,
estimate
, the parameter vector that yields the optimum,
sequence
, a data frame of the estimates in the single iterations,
time
, the total estimation time in seconds.
himmelblau <- function(x) (x[1]^2 + x[2] - 11)^2 + (x[1] + x[2]^2 - 7)^2 f <- set_f(f = himmelblau, npar = 2, lower = -5, upper = 5) ao(f = f, partition = list(1, 2))