calc_trapez_weights: Calculate integration weights assuming the midpoint rule

View source: R/radiocarbon_functions.R

calc_trapez_weightsR Documentation

Calculate integration weights assuming the midpoint rule

Description

tau is a vector of locations where a function to be integrated is evaluated (the function values, f, are not input). Let tau_g be the locations of integration and f_g the corresponding function values for g=1, 2, ... G. Assuming trapezoidal integration at the midpoints between elements of tau, the weights to use for integration are dtau_g = (tau_(g+1) - tau_(g-1)) / 2, where the conventions tau_0 = tau_1 and tau_(G+1) = tau_G are used.

Usage

calc_trapez_weights(tau)

Arguments

tau

A vector of locations where the function is sampled, possibly irregularly

Value

A vector of integration weights the same length as tau


eehh-stanford/baydem documentation built on June 3, 2024, 5:46 p.m.