Learn R Programming

mixopt (version 0.1.3)

full_index_line_search: Optimize over array using line search

Description

Optimize over array using line search

Usage

full_index_line_search(
  f,
  xarray,
  startind,
  plot = "none",
  ystart = NULL,
  verbose = 0
)

Value

List

Arguments

f

Function

xarray

Array of values

startind

Starting index

plot

Should plots be made?

ystart

Value of f when evaluated on element of xarray at index startind, aka f(xarray[startind])

verbose

Level of info to print

Examples

Run this code
full_index_line_search(function(x) {(x-50)^2}, 3:12, 5)
full_index_line_search(function(x) {(x-50)^2}, 3, 1)
full_index_line_search(function(x) {(x-50)^2}, 3:4, 1)
full_index_line_search(function(x) {(x-50)^2}, 3:5, 1)
full_index_line_search(function(x) {(x+50)^2}, 3, 1)
full_index_line_search(function(x) {(x+50)^2}, 3:4, 1)
full_index_line_search(function(x) {(x+50)^2}, 3:5, 1)
full_index_line_search(function(x) {(x-50)^2}, 12:3, 8)
full_index_line_search(function(x) {(x-50)^2}, 0:1000, 8)
full_index_line_search(function(x) {(x-50)^2}, 0:1000, 999)
full_index_line_search(function(x) {sin(x/30)}, 0:1000, 999)

Run the code above in your browser using DataLab