add_estimation_function_to_model: Add an estimation function to a model

Description Usage Arguments Value Details Examples

View source: R/FIT-models.R

Description

This function adds an estimation function to a model.

Usage

1
add_estimation_function_to_model(model, estimation_function)

Arguments

model

The model object to which the estimation function should be added (see details)

Value

The model object

Details

The model function recieves the scan number, initial guess and xy data. It should return a list of parameter estimates (can be a sparse list)

Examples

1
2
3
4
5
6
# estimates the height of a peak based on the intensity at its (guessed) centre
guess_height <- function(n, guess, xy) {
  guess_height <- rev(xy[[2]])[findInterval(guess$centre, rev(xy[[1]]))]
  list(height=guess_height)
}
add_estimation_function_to_model(model, guess_height)

jmstrat/NMR.Utils documentation built on July 14, 2019, 11:35 p.m.