Performs a least-squares inversion of an arbitrary radiative transfer model (passed as an R function). The inversion attempts to minimize the sum of residual least squares between modeled and observed spectra via the Levenberg-Marquardt algorithm (nls.lm function from the minpack.lm package).

invert.lsq(observed, inits, model, lower = NULL, upper = NULL)

Arguments

observed

Vector of observations (e.g. a reflectance spectrum).

inits

Vector of initial conditions for the parameters.

model

An R function that calls the RTM and returns the error to be minimized. Be sure to include constants here.

lower

Lower bounds on parameters (default=NULL, which means -Inf).

uppper

Upper bounds on parameters (default=NULL, which means +Inf).