dt: Evaluating density of t distribution

Description Usage Arguments Details Value

View source: R/nptfixedcomp.R

Description

density of t distribution

Usage

1
dt(x, df, ncp, log = FALSE, use.integration = FALSE)

Arguments

x

the vector of quantiles.

df

the degree of freedom. can be real if use.integration = TRUE, integer otherwise.

ncp

the non-centrality parameters.

log

logical; if TRUE, the density is return on log scale.

use.integration

logical; if TRUE, the density is evaluated using numerical integration.,

Details

Computes the t distribution with primary focus on evaluating non-central t distribution

Two methods are provided for evaluating the density. The first kind is using the numerical intergtation. The result should be precise, but it uses more time when df is low. Use this if you want demand a high accuracy. The implementation for |ncp| < 5 and |x| < 5 and/or |ncp-x|<10.0 is provided by R::dnt.

The second one is of the integration by part type. This is fast and relative accurate when df is small. when df is large use numerical integration or normal integration. Using this method, the density is evaluated using sucessive number of gaussian integral.

Value

a matrix of length(x) * length(ncp)


xiangjiexue/npfixedcomp documentation built on June 15, 2020, 9:18 a.m.