Predicts the electron donating capacity from mid infrared spectra
irp_edc_1.Rd
irp_edc_1
predicts the electron accepting capacity (EDC) from mid
infrared spectra of the peat samples. This function may also work for
organic matter in general (Teickner et al. 2022)
.
Arguments
- x
An object of class
ir
. Some tests are applied to check if the supplied spectra match the spectra used to fit the models (the spectral range is checked). The spectral resolution of the original spectral data should not be smaller than 4 cm\(^{-1}\) and it is not checked if this assumption is met.- ...
Additional arguments passed to
rstanarm::posterior_predict.stanreg()
.- do_summary
A logical value indicating if the predicted values should be returned in a summarized version (
TRUE
) or not (FALSE
).If
do_summary = FALSE
, a list column is returned and each element of the list column is a numeric vector with draws from the posterior distribution, including the residual variance of the model.If
do_summary = TRUE
, each element is aquantities::quantities()
object with theerror
attribute being the standard deviation of the unsummarized values.
Note
The model still has a relatively large uncertainty because it is fitted with few samples. Moreover, the model is known to produce biased predictions (Teickner et al. 2022) . For further limitations, see Teickner et al. (2022) .
References
Teickner H, Gao C, Knorr K (2022). “Electrochemical Properties of Peat Particulate Organic Matter on a Global Scale: Relation to Peat Chemistry and Degree of Decomposition.” Global Biogeochemical Cycles. ISSN 0886-6236, 1944-9224, doi:10.1029/2021GB007160 .
Examples
library(ir)
# make predictions
irpeat::irp_edc_1(ir::ir_sample_data[1, ], do_summary = TRUE)
#> # A tibble: 1 × 8
#> id_measurement id_sample sample_type sample_comment klason_lignin
#> * <int> <chr> <chr> <chr> [1]
#> 1 1 GN 11-389 needles Abies Firma Momi fir 0.360
#> # … with 3 more variables: holocellulose [1], spectra <named list>,
#> # edc (err) [umol/g]