int_Rho: Integrate function

View source: R/int_Rho.R

int_RhoR Documentation

Integrate function

Description

Integrate function either from stats::integrate while overpassing errors or manual integration.

Usage

int_Rho(dt)

Arguments

dt

Numeric. The length of the intervals on which the function is assumed to be constant. If dt = 0 the function is integrated using stats::integrate while overpassing errors. If a positive dt is given as argument, the integral is computed using a piece-wise constant approximation.

Details

If dt = 0 any other arguments of stats::integrate can be specified. This function is a closure, it takes dt as argument and creates another function with arguments f, lower, upper and rel.tol.

Value

Returns an object of class "function". This function takes the following arguments and will return the final estimate of the integral:

f

Function. An R function of one variable on which to integrate.

lower

Numeric. Lower limit of integration.

upper

Numeric. Upper limit of integration.

rel.tol

Numeric. Relative accuracy requested.

Author(s)

Sophia Lambert

See Also

likelihood_bdRho, fitMCMC_bdRho


sophia-lambert/UDivEvo documentation built on Sept. 27, 2022, 11:05 p.m.