Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

Initialization of numerical optimization

The {ino} package provides tools for the analysis of the initialization for numerical optimization in R. For detailed examples and usage instructions, please refer to the vignettes accompanying the package.

Installation

You can install the released version from CRAN with:

install.packages("ino")

And the development version from GitHub with:

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

Example

The Ackley function has multiple local minima and one global minimum in the origin.

f_ackley <- function(x) {
  stopifnot(is.numeric(x), length(x) == 2)
  -20 * exp(-0.2 * sqrt(0.5 * (x[1]^2 + x[2]^2))) -
    exp(0.5 * (cos(2 * pi * x[1]) + cos(2 * pi * x[2]))) + exp(1) + 20
}
f_ackley(c(0, 0))
#> [1] 0

The optimization result depends on the initial value:

library("ino")
Nop$new(f = f_ackley, npar = 2)$
  set_optimizer(optimizer_nlm())$
  optimize(initial = "random", runs = 100, verbose = FALSE)$
  optima()
#>   value frequency
#> 1     0        39
#> 2  2.58        34
#> 3  3.57        12
#> 4  5.38         6
#> 5  4.88         5
#> 6  6.56         2
#> 7  6.88         2

Contact

Have a question, found a bug, request a feature, want to contribute? Please file an issue.

Copy Link

Version

Install

install.packages('ino')

Monthly Downloads

258

Version

1.0.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Lennart Oelschläger

Last Published

September 29th, 2023

Functions in ino (1.0.2)

f_ackley

Ackley function
Nop

Nop Object (R6 Class)
f_ll_hmm

Log-likelihood function of a Gaussian-hidden Markov model
f_beale

Beale function
build_initial

Unified function call for initial parameter specifications
hmm_ino

Example application to HMM likelihood
f_easom

Easom function
f_ll_mnp

Log-likelihood function of the (normally mixed) multinomial probit model
is_proportion

Check for proper proportion
is_time_limit

Check for proper time limit
ino-package

ino: Initialization of Numerical Optimization
subset_argument

Subset argument
is_number

Check for proper number
f_matyas

Matyas function
standardize_argument

Standardize argument
is_TRUE_FALSE

Check for proper boolean
filter_results

Filter optimization results
mixture_ino

Example application to mixture likelihood
is_count

Check for proper count
is_index_vector

Check for proper index vector
test_nop

Test Nop object
is_name_vector

Check for proper name vector
sim_mnp

Simulate data from a (normally mixed) multinomial probit model
simplify_results

Simplify optimization results
is_name

Check for proper name
sim_hmm

Simulate a time series from a Gaussian-hidden Markov model
probit_ino

Example application of to probit likelihood