R/fitlbc.R

Defines functions fitlbc

Documented in fitlbc

fitlbc <-
function(theta, sigmaP, ...)
{
   if (length(theta) != length(sigmaP))
      stop ("incompatible dimensions!")
   dat <- data.frame(theta, sigmaP)
   ini <- try( getInitiallbc(theta, sigmaP) )
   if (inherits(ini, "try-error")) {
      ini <- coef(lm(log10(sigmaP) ~ theta, data = dat))
   }
   fit <- nls(sigmaP ~ SSlbc(theta, b0, b1), data = dat,
      start = list(b0 = ini[1], b1 = ini[2]), ...)
   return(fit)
}

Try the soilphysics package in your browser

Any scripts or data that you put into this service are public.

soilphysics documentation built on June 7, 2022, 5:06 p.m.