Learn R Programming

pi0 (version 1.4-1)

dt.int2: INTerpolation of INTeger degrees of freedom noncentral t-density

Description

This funciton evaluates the noncentral t-density using an iterative procedure for integer degrees of freedom. This is much faster than two calls to the pt approach. For non-integer degrees of freedom, the polynomial interpolation is used to approximate the density.

Usage

dt.int2(x, df, ncp, log = FALSE, ndiv = 8)

Arguments

x

A numeric vector of quantiles

df

A numeric vector degrees of freedom

ncp

A numeric vector of noncentrality parameters

log

logical; if TRUE, log densities are returned.

ndiv

numeric; the number of points used for polynomial interpolation

Value

A numeric vector of densities.

Details

This function uses the iterative relation for the integral in the noncentral t-density. It starts with df=0 and df=1, and then iteratively computes the integral for larger df. For non-integer df, it uses ndiv nearest points to perform a divided difference polynomial interpolation approximation. For integer df, this function is about 2 to 3 times faster than dt function and is exact.

See Also

dtn.mix, dt, dt.lap, dt.sad, mTruncNorm