View source: R/fluxEstimates.R
regressFluxExp | R Documentation |
Estimate the initial flux by fitting an exponentially saturating function
regressFluxExp(conc, times, start = c(),
tryAutoCorr = TRUE, cSatFac = 1.5)
conc |
numeric vector of CO2 concentrations [] |
times |
times of conc measurements [seconds] |
start |
numeric vector of starting parameters. May provide from last bootstrap to speed up fitting |
tryAutoCorr |
set to FALSE to not try to fit model with autocorrelation |
cSatFac |
Position of the initial saturation (0 start, 1 end, >1 outside measured range) |
The flux is calculated as the slope of the concentration change. By changing the concentration gradient, however, the flux is disturbed. In effect the flux will decline over time and concentrations go towards a saturation.
This method fits a polynomial regression to the concentrations and infers the slope at reports the slope at the initial time. Make sure to remove lag time period before.
Other functional forms can be fitted to estimate the initial slope:
Linear: regressFluxLinear
Hyperbolic tangent saturating function: regressFluxTanh
Exponential: regressFluxExp
Quadratic polinomial: regressFluxSquare
The hyperbolic tangent form (regressFluxTanh
)
has the advantage that
initially the flux is changing only very slowly. In contrast, whith the
exponential form the
slope changes much at the beginning.
The exponential form, is more consistent with a theoretical model of saturating flux (Kutzbach 2006).
stat |
numeric vector with 4 entries:
|
flux |
flux estimate at starting time |
sdFlux |
standard deviation of flux |
AIC |
model fit diagnostics |
autoCorr |
coefficient of autocorrelation or NA if model with autocorrelation could not be fitted or had higher AIC than model without autocorrelation |
times |
used predictor vector, can be used for return for plotting |
model |
the model-fit object (here of class gnls) |
Thomas Wutzler, Oscar Perez Priego
RespChamberProc
#data(chamberLoggerEx1s)
ds <- chamberLoggerEx1s
conc <- ds$CO2_dry <- corrConcDilution(ds)
times <- ds$TIMESTAMP
#trace(regressFluxExp, recover) #untrace(regressFluxExp)
(res <- regressFluxExp( conc, times ))
plot( conc ~ times)
lines( fitted(res$model) ~ times )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.