NDFE.fit {gasfluxes} | R Documentation |
NDFE fit
Description
Fit the the non-steady-state diffusive flux extimator model using the Golub-Pereyra algorithm for partially linear least-squares models.
Usage
NDFE.fit(
t,
C,
A = 1,
V,
serie = "",
k = log(0.01),
verbose = TRUE,
plot = FALSE,
maxiter = 100,
...
)
Arguments
t |
time values (usually in hours) |
C |
concentration values |
A |
area covered by the chamber |
V |
effective volume of the chamber |
serie |
id of the flux measurement |
k |
starting value for nls function |
verbose |
logical, TRUE prints message after each flux calculation |
plot |
logical, mainly intended for use in |
maxiter |
see |
... |
further parameters, currently none |
Details
The NDFE model (Livingston et al., 2006) is .
To ensure the lower bound
, the substituion
is used. The resulting reparameterized model is then
fit using
nls
with algorithm = "plinear"
.
Note that according to the reference the model is not valid for negative fluxes. Warning: This function does not check if fluxes are positive. It's left to the user to handle negative fluxes.
The default starting value assumes that time is in hours. If you use a different time unit, you should adjust it accordingly.
Note that nls
is used internally and thus this function should not be used with artificial "zero-residual" data.
Value
A list of
f0 |
flux estimate |
f0.se |
standard error of flux estimate |
f0.p |
p-value of flux estimate |
C0 , tau |
other parameters of the NDFE model |
AIC |
Akaike information criterion |
AICc |
Akaike information criterion with small sample correction |
RSE |
residual standard error (sigma from summary.nls) |
diagnostics |
error or warning messages |
References
Livingston, G.P., Hutchinson, G.L., Spartalian, K., 2006. Trace gas emission in chambers: A non-steady-state diffusion model. Soil Sci. Soc. Am. J. 70(5), 1459-1469.
Examples
#a single fit
t <- c(0, 1/3, 2/3, 1)
C <- c(320, 340, 355, 362)
print(fit <- NDFE.fit(t, C, 1, 0.3, "a"))
plot(C ~ t)
curve({fit$C0+fit$f0*fit$tau*1/0.3*(2/sqrt(pi)*sqrt(x/fit$tau)+
exp(x/fit$tau)*erfc(sqrt(x/fit$tau))-1)},
from = 0, to = 1, add = TRUE)
#note that the flux estimate is very uncertain because
#there are no data points in the region of high curvature