GaussInt: Arc length of Gaussian PDF.

Description Usage Arguments Details Value Examples

View source: R/RcppExports.R

Description

Calculate the arc length for a univariate Gaussian probability density function over a specified interval.

Usage

1
2
3
GaussInt(mu, sigma, q1, q2, quantile)

GaussInt2(mu, sigma, q1, q2, quantile)

Arguments

mu

A real number specifying the location parameter.

sigma

A positive real number specifying the scale parameter.

q1

The point (or vector for GaussInt2) specifying the lower limit of the arc length integral.

q2

The point (or vector for GaussInt2) specifying the upper limit of the arc length integral.

quantile

Logical, TRUE/FALSE, whether q1 and q2 are quantiles, or actual points in the domain.

Details

The arc length of a univariate Gaussian probability density function is approximated using the numerical integration C code implimented for R's integrate functions, i.e. using Rdqags. For this approximation, subdiv = 100 (100 subdivisions), and eps_abs = eps_rel = 1e-10, i.e. the absolute and relative errors respectively.

Value

GaussInt: A list with the following components:

GaussInt2: A vector having length equal to that of the vector of lower quantile bounds, containing the arc lengths requested for a Gaussian probability density function.

Examples

1
2
3
4
5
6
7
8
library(alR)
mu <- 2
sigma <- 3.5
GaussInt(mu, sigma, 0.025, 0.975, TRUE)
GaussInt(mu, sigma, -1.96, 1.96, FALSE)

GaussInt2(mu, sigma, c(0.025, 0.5), c(0.5, 0.975), TRUE)
GaussInt2(mu, sigma, c(-1.96, 0), c(0, 1.96), FALSE)

alR documentation built on Dec. 7, 2017, 5:03 p.m.