create_ThetaMatrix function

Create Theta Matrix

Create Theta Matrix

Create the Θ\Theta matrix with the shared uncertainties that can used as input in, e.g., AgeS_Computation and Age_OSLC14 which is used for the covariance matrix Σ\Sigma (Combès & Philippe, 2017)

create_ThetaMatrix(input, output_file = NULL, sigma_s, ...)

Arguments

  • input: character or data.frame (optional): input data frame or file connection to import a CSV-file with the needed information. If nothing is provided the function returns an input template. The argument output_file can be used to write this input template to the file system

  • output_file: character (optional): file path for the output CSV-file, the field separator is hard set to ",". Please use utils::write.table for more flexibility.

  • sigma_s: numeric (required ): named character with values for systematic uncertainties. Those values are lab-specific. Can be set to NULL to remove systematic uncertainties. The order of the named

    vector is not important, but the naming! Note : some of the uncertainties have a unit, please check details.

  • ...: further arguments that can be passed to utils::read.table (for the CSV-file import)

Returns

A symmetric ThetaTheta matrix or if input is missing, a data.frame with an input template

Details

The function intends to ease the creation of the ThetaTheta matrix, which cannot be created straight forward, e.g., base R functions such as stats::cov. The relationship between the covariance matrix SigmaSigma and ThetaTheta is given with

Σij=AiAjΘij \Sigma_ij = A_i * A_j * \Theta_ij

For details see Combès & Philippe, 2017 and Guérin et al. (2021).

Input modes

The function supports two different operation modes:

  1. input is left empty: the function returns a data.frame template that can be used as input (the option output_file works as well)
  2. input is fed with a data.frame or a character (file path), the Θ\Theta matrix is returned

Input format

The function expects either a CSV-file or a data.frame as input. To create template you can run the function leaving the argument input empty (see example). Please note the format of the input table (data.frame ) needs to kept as specified in the template.

The following table lists the meaning of the columns:

COLUMNDESCRIPTIONUNIT
SAMPLE_IDsample name-
DR_BETA_Kstandard error beta-dose rate KGy/ka
DR_BETA_Ustandard error beta-dose rate UGy/ka
DR_BETA_Thstandard error beta-dose rate ThGy/ka
DR_GAMMA_Kstandard error gamma-dose rate KGy/ka
DR_GAMMA_Ustandard error gamma-dose rate UGy/ka
DR_GAMMA_Thstandard error gamma-dose rate ThGy/ka
DR_GAMMA_TOTALstandard error total gamma-dose rateGy/ka
DR_TOTALtotal dose rateGy/ka
DR_TOTAL_Xstandard error total dose rateGy/ka

Note: All columns can be set to 0 or NA but no column must be left empty! If a value > 0 is provided for DR_GAMMA_TOTAL this value is taken and values in, e.g., DR_GAMMA_K are discarded (set to 0)!

Systematic uncertainties

The following table provides information on the named argument that can be provided via the argument sigma_s. Missing values are not allowed, all values must be set.

ARGUMENTDESCRIPTIONUNIT
s_betaKrelative uncertainty K concentration-
s_betaUrelative uncertainty U concentration-
s_betaThrelative uncertainty Th concentration-
s_gammaKrelative uncertainty K concentration-
s_gammaUrelative uncertainty U concentration-
s_gammaThrelative uncertainty Th concentration-
s_gammaDRrelative uncertainty gamma-dose rate-
s_CALrelative uncertainty beta-source calibration-
s_intDRabsolute uncertainty internal dose rateGy/ka

Function version

0.1.0

Examples

##(1) return template data.frame (no file output) create_ThetaMatrix() ## Not run: ##(2) return template as data.frame + file file_path <- tempfile(fileext = ".csv") create_ThetaMatrix(output_file = file_path ) ##NOT RUNNING EXAMPLE for sigma_s calc_ThetaMatrix(..., sigma_s = c( s_betaK = 0.010, s_betaU = 0.007, s_betaTh = 0.006, s_gammaK = 0.010, s_gammaU = 0.007, s_gammaTh = 0.006, s_gammaDR = 0.05, s_CAL = 0.020, s_intDR = 0.030)) ## End(Not run)

References

Combès, B., Philippe, A., 2017. Bayesian analysis of individual and systematic multiplicative errors for estimating ages with stratigraphic constraints in optically stimulated luminescence dating. Quaternary Geochronology 39, 24–34. tools:::Rd_expr_doi("10.1016/j.quageo.2017.02.003")

Guérin, G., Lahaye, C., Heydari, M., Autzen, M., Buylaert, J.-P., Guibert, P., Jain, M., Kreutzer, S., Lebrun, B., Murray, A.S., Thomsen, K.J., Urbanova, P., Philippe, A., 2021. Towards an improvement of optically stimulated luminescence (OSL) age uncertainties: modelling OSL ages with systematic errors, stratigraphic constraints and radiocarbon ages using the R package BayLum. Geochronology 3, 229—245. tools:::Rd_expr_doi("10.5194/gchron-3-229-2021")

See Also

AgeS_Computation , Age_OSLC14 , utils::read.table , utils::write.table

Author(s)

Sebastian Kreutzer, IRAMAT-CRP2A, UMR 5060, CNRS-Université Bordeaux Montaigne (France), based on an 'MS Excel' sheet by Guillaume Guérin, IRAMAT-CRP2A, UMR 5060, CNRS-Université Bordeaux Montaigne (France) , RLum Developer Team

  • Maintainer: Anne Philippe
  • License: GPL-3
  • Last published: 2024-06-16