# {ao}

This R package implements alternating optimization, which is an iterative procedure for optimizing some function jointly over all parameters by alternating restricted optimization over individual parameter subsets.

For more details see the help vignette:

vignette("ao", package = "ao")

## Installation

You can install the released version from CRAN with:

install.packages("ao")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("loelschlaeger/ao")

## Example

The following lines perform alternating optimization of the Himmelblau’s function, separately for $\dpi{110}&space;\bg_white&space;x_1$ and $\dpi{110}&space;\bg_white&space;x_2$, with the parameter restrictions $\dpi{110}&space;\bg_white&space;-5 \leq x_1, x_2 \leq 5$:

library("ao")
#> $optimum #> [1] 1.940035e-12 #> #>$estimate
#> $sequence #> iteration partition time p1 p2 #> 1 0 0 0.0000000000 0.000000 0.000000 #> 2 1 1 0.0314528942 3.395691 0.000000 #> 3 1 2 0.0003468990 3.395691 -1.803183 #> 4 2 1 0.0002689362 3.581412 -1.803183 #> 5 2 2 0.0002470016 3.581412 -1.847412 #> 6 3 1 0.0003299713 3.584381 -1.847412 #> 7 3 2 0.0002009869 3.584381 -1.848115 #> 8 4 1 0.0002000332 3.584427 -1.848115 #> 9 4 2 0.0001769066 3.584427 -1.848126 #> 10 5 1 0.0001850128 3.584428 -1.848126 #> 11 5 2 0.0001809597 3.584428 -1.848126 #> #>$time
#> Time difference of 0.03914905 secs