find_first_value: First Parameter Estimator

Description Usage Arguments Value Examples

Description

This function finds the value of the first parameter for a function that gives a desired value. Note, all other required parameters of f must have defualt values for this function to run.

Usage

1
2
find_first_value(f, val = 0, maximum = 1e+05, minimum = 0,
  only_integers = F, decimals = 4)

Arguments

f

the function that is being used (note f should be a monotonic function for this function to work properly).

val

the desired value for the function.

maximum

the maximum value for the search parameter (default = 100000).

minimum

the minimum value for the search parameter (default = 0).

only_integers

logical indicating whether the function only takes integers for the search parameter (default = F, allowing decimals).

decimals

the number of decimal places to use for the search parameter.

Value

A list will be returned containing the estimate for the first parameter, the function value when the parameter estimate is used in f, and a warning if the parameter estimate results in a function value that is more than 1 away from val.

Examples

1
2
find_first_value(log, val = 6.3, maximum = 10000)
find_first_value(sqrt, val = 17.8432)

cowandalton/MA585.Functions documentation built on June 16, 2019, 4:13 a.m.