Learn R Programming

mmtdiff (version 1.0.0)

mm_tdiff_univariate: Moment-Matching Approximation for Univariate t-Differences

Description

Approximates the distribution of the difference between two independent non-standardized t-distributed random variables using the moment-matching method.

Usage

mm_tdiff_univariate(mu1, sigma1, nu1, mu2, sigma2, nu2)

Value

An S3 object of class "mm_tdiff_univariate" containing:

mu_diff

Location parameter of difference (mu1 - mu2)

sigma_star

Scale parameter

nu_star

Degrees of freedom

input_params

List of input parameters for reference

method

Character string "univariate"

Arguments

mu1

Location parameter of first distribution

sigma1

Scale parameter of first distribution (must be > 0)

nu1

Degrees of freedom of first distribution (must be > 4)

mu2

Location parameter of second distribution

sigma2

Scale parameter of second distribution (must be > 0)

nu2

Degrees of freedom of second distribution (must be > 4)

Details

For two independent non-standardized t-distributed random variables:

  • X1 ~ t(mu1, sigma1^2, nu1)

  • X2 ~ t(mu2, sigma2^2, nu2)

The difference Z = X1 - X2 is approximated as: Z ~ t(mu1 - mu2, sigma_star^2, nu_star)

where the effective parameters are computed through moment matching:

  • sigma_star is derived from the second moment matching

  • nu_star is derived from the fourth moment matching

The method requires nu1 > 4 and nu2 > 4 for the existence of fourth moments. The approximation quality improves as degrees of freedom increase and approaches exactness as nu -> infinity (normal limit).

References

Yamaguchi, Y., Homma, G., Maruo, K., & Takeda, K. Moment-Matching Approximation for Difference of Non-Standardized t-Distributed Variables. (unpublished).

See Also

dtdiff, ptdiff, qtdiff, rtdiff for density, distribution function, quantile function, and random generation respectively

Examples

Run this code
# Example 1: Different scale parameters
result <- mm_tdiff_univariate(
  mu1 = 0, sigma1 = 1, nu1 = 10,
  mu2 = 0, sigma2 = 1.5, nu2 = 15
)
print(result)

# Example 2: Equal parameters (special case)
result_equal <- mm_tdiff_univariate(
  mu1 = 5, sigma1 = 2, nu1 = 20,
  mu2 = 3, sigma2 = 2, nu2 = 20
)
print(result_equal)

Run the code above in your browser using DataLab