currycarbon-0.3.0.1: A package for simple, fast radiocarbon calibration
Safe HaskellSafe-Inferred
LanguageHaskell2010

Currycarbon.Calibration.Calibration

Synopsis

Calibration functions

getRelevantCalCurveSegment :: UncalC14 -> CalCurveBP -> CalCurveBP Source #

Take an uncalibrated date and a raw calibration curve and return the relevant segment of the calibration curve

prepareCalCurveSegment :: Bool -> CalCurveBP -> CalCurveBCAD Source #

Modify a calibration curve (segment) with multiple optional steps, including interpolation and transforming dates to BC/AD format

makeCalCurveMatrix :: UncalPDF -> CalCurveBCAD -> CalCurveMatrix Source #

Construct a matrix representation of a calibration curve for a given date

uncalToPDF :: UncalC14 -> UncalPDF Source #

Transform an uncalibrated date to an uncalibrated probability density table

calibrateDate Source #

Arguments

:: CalibrateDatesConf

Configuration options to consider

-> CalCurveBP

A calibration curve

-> UncalC14

An uncalibrated radiocarbon date

-> Either CurrycarbonException CalPDF

The function returns either an exception if the calibration failed for some reason, or a CalPDF

Calibrates a date with the provided calibration curve

calibrateDates Source #

Arguments

:: CalibrateDatesConf

Configuration options to consider

-> CalCurveBP

A calibration curve

-> [UncalC14]

A list of uncalibrated radiocarbon dates

-> [Either CurrycarbonException CalPDF]

The function returns a list for each input date, with either an exception if the calibration failed for some reason, or a CalPDF

Calibrates a list of dates with the provided calibration curve

refineCalDates :: [CalPDF] -> [Either CurrycarbonException CalC14] Source #

Transforms the raw, calibrated probability density table to a meaningful representation of a calibrated radiocarbon date

data CalibrateDatesConf Source #

A data type to cover the configuration options of the calibrateDates function

Constructors

CalibrateDatesConf 

Fields

defaultCalConf :: CalibrateDatesConf Source #

A default configuration that should yield almost identical calibration results to the Bchron R package

data AgeSamplingConf Source #

A data type to define the settings for age sampling

Constructors

AgeSamplingConf 

Fields

sampleAgesFromCalPDF :: AgeSamplingConf -> CalPDF -> Either CurrycarbonException RandomAgeSample Source #

Draw random samples from a probability density table