gaussW: Gaussian weighting of dates relative to

View source: R/utilities.R

gaussWR Documentation

Gaussian weighting of dates relative to

Description

Rescale a numeric vector to a specified minimum and maximum.

Usage

gaussW(x, mean, sd, type = "weights")

Arguments

x

A numeric vector or an object of class CalDates.

mean

A single numeric value indicating the value to centre the Gaussian kernel on.

sd

A single numeric value indicating the standard deviation of the Gaussian kernel to be used.

type

The type of output to produce: currently either "weighted" (for a simple total weight value for each date) or "raw" (a list of reweighted calibrated radiocarbon probabilities for each calibrated date).

Value

A numeric vector of weights (or optionally a list of reweighted calibrated radiocarbon probabilities).

Examples

## Example weighting fo a set of dates versus a focal date of 5950 calBP
years <- seq(6500, 5500, -10)
plot(cbind(years, gaussW(years, 5950, 50)))
## Example weighting of three calibrated dates  versus a focal date of 5950 calBP
dates <- calibrate(c(5280, 5180, 5080), c(30,30,30), normalised=FALSE)
gaussW(dates, 5950, 50)
## Or the same with raw output
dateswt <- gaussW(dates, 5950, 50, type="raw")
head(dateswt[[1]])

rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.