dTPSC {GUD}R Documentation

The TPSC-Student-t Distribution

Description

The TPSC-Student-t Distribution

Usage

dTPSC(x, w, theta, sigma, delta)

rTPSC(n, w, theta, sigma, delta)

Arguments

x

vector of quantiles.

w

vector of weight parameters.

theta

vector of the location parameters.

sigma

vector of the scale parameters.

delta

the degree of freedom.

n

number of observations.

Details

The TPSC-Student-t distribution has the density

f_{\mathrm{TPSC}}(y \mid w, \theta, \sigma, \delta)=w f_{\mathrm{LT}}\left(y \mid \theta, \sigma \sqrt{\frac{w}{1-w}}, \delta\right)+(1-w) f_{\mathrm{RT}}\left(y \mid \theta, \sigma \sqrt{\frac{1-w}{w}}, \delta\right),

where

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

dTPSC gives the density. rTPSC 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 <- rTPSC(n = 1e5,w = 0.7,theta = -1,sigma = 3,delta = 5)

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

# The red dashed line should match the underlining histogram
points(x = seq(-70,50,length.out = 1000),
       y = dTPSC(x = seq(-70,50,length.out = 1000),
                 w = 0.7,theta = -1,sigma = 3,delta = 5),
       type = "l",
       col = "red",
       lwd = 3,
       lty = 2)

[Package GUD version 1.0.2 Index]