dDTP {GUD}R Documentation

The DTP-Student-t Distribution

Description

The DTP-Student-t Distribution

Usage

dDTP(x, theta, sigma1, sigma2, delta1, delta2)

rDTP(n, theta, sigma1, sigma2, delta1, delta2)

Arguments

x

vector of quantiles.

theta

vector of the location parameters.

sigma1

vector of the scale parameters of the left skewed part.

sigma2

vector of the scale parameters of the right skewed part.

delta1

the degree of freedom of the left skewed part.

delta2

the degree of freedom of the right skewed part.

n

number of observations.

Details

The DTP-Student-t distribution has the density

f_{\mathrm{DTP}}\left(y \mid \theta, \sigma_1, \sigma_2, \delta_1, \delta_2\right)=w f_{\mathrm{LT}}\left(y \mid \theta, \sigma_1, \delta_1\right)+(1-w) f_{\mathrm{RT}}\left(y \mid \theta, \sigma_2, \delta_2\right),

where

w=\frac{\sigma_1 f\left(0 \mid \delta_2\right)}{\sigma_1 f\left(0 \mid \delta_2\right)+\sigma_2 f\left(0 \mid \delta_1\right)},

f(0 \mid \delta) represents

f((y-\theta) / \sigma \mid \delta)\text{ evaluated at } y=\theta,

f_{\mathrm{LT}}(y \mid \theta, \sigma, \delta)=\frac{2}{\sigma} f\left(\left.\frac{y-\theta}{\sigma} \right\rvert\, \delta\right) \mathbb{I}(y<\theta),

and

f_{\mathrm{RT}}(y \mid \theta, \sigma, \delta)=\frac{2}{\sigma} f\left(\left.\frac{y-\theta}{\sigma} \right\rvert\, \delta\right) \mathbb{I}(y \geq \theta).

Additionally, f(y \mid \delta) represents the density function of the standardized Student-t distribution with the degree of freedom \delta.

Value

dDTP gives the density. rDTP generates random deviates.

References

Liu Q, Huang X, Bai R (2024). “Bayesian Modal Regression Based on Mixture Distributions.” Computational Statistics &amp; Data Analysis, 108012. doi:10.1016/j.csda.2024.108012.

Examples

set.seed(100)
require(graphics)

# Random Number Generation
X <- rDTP(n = 1e5,theta = 5,sigma1 = 7,sigma2 = 3,delta1 = 5,delta2 = 6)

# Plot the histogram
hist(X, breaks = 100, freq = FALSE)

# The red dashed line should match the underlining histogram
points(x = seq(-100,40,length.out = 1000),
       y = dDTP(x = seq(-100,40,length.out = 1000),
                theta = 5,sigma1 = 7,sigma2 = 3,delta1 = 5,delta2 = 6),
       type = "l",
       col = "red",
       lwd = 3,
       lty = 2)

[Package GUD version 1.0.2 Index]