Learn R Programming

cdom (version 0.1.0)

cdom_fit_exponential: Fit an exponential model to CDOM data.

Description

Fit an exponential model to CDOM data.

Usage

cdom_fit_exponential(wl, absorbance, wl0 = 350, startwl, endwl)

Arguments

wl
The wavelength vector.
absorbance
The absorbance vector.
wl0
The reference wavelength (ex.: 350).
startwl
The starting wavelength (ex.: 240).
endwl
The ending wavelength (ex.: 600).

Value

  • A list containing: [object Object],[object Object],[object Object]

    The function will return NULL if the model did not converged.

Details

$$y = a0 + e^{(-S(x - \lambda_0))} + K$$

Examples

Run this code
# Fit an exponential model using the reference wavelength 350 between 190 and 900 nm.

data(spectra)

fit <- cdom_fit_exponential(spectra$wavelength, spectra$spc1, 350, 190, 900)
str(fit)

plot(spectra$wavelength, spectra$spc1)
lines(spectra$wavelength, fit$data$.fitted, col = "red")

Run the code above in your browser using DataLab