Learn R Programming

gasfluxes (version 0.4)

HMR.orig: HMR fit using the Pedersen fitting algorithm

Description

Fit the HMR model using the algorithm from the HMR package.

Usage

HMR.orig(t, C, A = 1, V, serie = "", verbose = TRUE, ngrid = 1000,
  plot = FALSE, ...)

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

verbose

logical, TRUE prints message after each flux calculation

ngrid

see the HMR documentation

plot

logical, mainly intended for use in gasfluxes

further parameters, currently none

Value

A list of

f0

flux estimate

f0.se

standard error of flux estimate

f0.p

p-value of flux estimate

kappa, phi

other parameters of the HMR model

AIC

Akaike information criterion

AICc

Akaike information criterion with small sample correction

diagnostics

error or warning messages

Details

The HMR model (Pedersen et al., 2010) is \(C(t)=\phi+f_0 \frac{e^{-\kappa t}}{-\kappa V/A}\). The algorthm from the HMR package version 0.3.1 is used for fitting. Note that this is very inefficient and standard errors and p-values are over-estimated. HMR.fit is recommended instead and this function is only provided to be able to reproduce results obtained with older versions of the HMR package.

References

Pedersen, A.R., Petersen, S.O., Schelde, K., 2010. A comprehensive approach to soil-atmosphere trace-gas flux estimation with static chambers. European Journal of Soil Science 61(6), 888-902.

Examples

Run this code
# NOT RUN {
#a single fit
t <- c(0, 1/3, 2/3, 1)
C <- c(320, 341, 352, 359)
print(fit <- HMR.orig(t, C, 1, 0.3, "a"))
plot(C ~ t)
curve({fit$phi + fit$f0 * exp(-fit$kappa * x)/(-fit$kappa*0.3)}, 
      from = 0, to = 1, add = TRUE)

# }

Run the code above in your browser using DataLab