calc_trapez_weights: Calculate integration weights assuming the midpoint rule

Description Usage Arguments Value

View source: R/density_calculations.R

Description

x is a vector of locations where a function to be integrated is evaluated (the function values, f, are not input). Let x_n be the locations of integration and f_n the corresponding function values for g=1, 2, ... N. Assuming trapezoidal integration at the midpoints between elements of xu, the weights to use for integration are dx_n = (x_(n+1) - x_(n-1)) / 2, where the conventions x_0 = x_1 and x_(N+1) = tau_N are used.

Usage

1

Arguments

x

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

Value

A vector of integration weights the same length as x


MichaelHoltonPrice/yada documentation built on Sept. 19, 2021, 11:27 p.m.