# calculateAges: Calculate the ages from electron microprobe measurements In NiLeDAM: Monazite Datation for the NiLeDAM team

## Description

This function calculates the ages, confidence intervals and standard deviations from triplets (U,Th,Ph), obtained by electron microprobe, given together with corresponding errors.

## Usage

 ```1 2``` ``` calculateAges(measures, nloops = 1000, level = 0.05, verbose = TRUE, seed = NULL) ```

## Arguments

 `measures` a data.frame object with one electron microprobe measurement by row and with columns U, corresponding error for U, Th, corresponding error for Th, Pb, corresponding error for Pb, all expressed in ppm. See an example with `data(srilanka)`. `nloops` the number of Monte Carlo (MC) simulations used to estimate the confidence intervals for the ages. Default is `1000`. `level` the level of significance of the confidence intervals for the ages. Default is `0.05`. `verbose` logical; activates the verbose mode. Default is `TRUE`. `seed` if supplied, initialize the random seed. Default is `NULL` (the random seed is not initialized).

## Details

the ages are calculated by solving the Equation (1) of Montel et al. (1996). The equation is solved by the Broyden method implemented in the `nleqslv` function.

The standard deviations and the confidence intervals are calculated using a MC approach: randomized observations of the triplets are generated from normal distributions with standard deviations equal to error/2 where 'error' denotes the error in the measurement of Th, U or Pb, passed in measures. Standard deviations are estimated by the empirical standard deviations and confidence intervals by quantiles for probabilities level/2 and 1-level/2, respectively.

## Value

an object of class `ages`.

## Note

You should use at least 1000 MC simulations otherwise the estimated confidence intervals and standard deviations will not be reliable. Such simulations can take a few seconds/minutes for fifty or so triplets and corresponding errors.

## Author(s)

Jean-Marc Montel [email protected]

Nathalie Villa-Vialaneix [email protected]

## References

Montel J.M., Foret S., Veschambre M., Nicollet C., Provost A. (1996) Electron microprobe dating of monazite. Chemical Geology, 131, 37–53.

`ages` `tests`
 ```1 2 3 4``` ```## Load the data data(srilanka) ## Calculate the ages calculateAges(srilanka, nloops=10) ```