tfd_doublesided_maxwell: Double-sided Maxwell distribution.

View source: R/distributions.R

tfd_doublesided_maxwellR Documentation

Double-sided Maxwell distribution.

Description

This distribution is useful to compute measure valued derivatives for Gaussian distributions. See Mohamed et al. (2019) for more details.

Usage

tfd_doublesided_maxwell(
  loc,
  scale,
  validate_args = FALSE,
  allow_nan_stats = TRUE,
  name = "doublesided_maxwell"
)

Arguments

loc

Floating point tensor; location of the distribution

scale

Floating point tensor; the scales of the distribution. Must contain only positive values.

validate_args

Logical, default FALSE. When TRUE distribution parameters are checked for validity despite possibly degrading runtime performance. When FALSE invalid inputs may silently render incorrect outputs. Default value: FALSE.

allow_nan_stats

Logical, default TRUE. When TRUE, statistics (e.g., mean, mode, variance) use the value NaN to indicate the result is undefined. When FALSE, an exception is raised if one or more of the statistic's batch members are undefined.

name

string prefixed to Ops created by this class. Default value: 'doublesided_maxwell'.

Details

Mathematical details

The double-sided Maxwell distribution generalizes the Maxwell distribution to the entire real line.

pdf(x; mu, sigma) = 1/(sigma*sqrt(2*pi)) * ((x-mu)/sigma)^2 * exp(-0.5 ((x-mu)/sigma)^2)

where loc = mu and scale = sigma. The DoublesidedMaxwell distribution is a member of the location-scale family, i.e., it can be constructed as,

X ~ DoublesidedMaxwell(loc=0, scale=1)
Y = loc + scale * X

The double-sided Maxwell is a symmetric distribution that extends the one-sided maxwell from R+ to the entire real line. Their densities are therefore the same up to a factor of 0.5.

It has several methods for generating random variates from it. The version here uses 3 Gaussian variates and a uniform variate to generate the samples The sampling path is:

mu + sigma* sgn(U-0.5)* sqrt(X^2 + Y^2 + Z^2) U~Unif; X,Y,Z ~N(0,1)

In the sampling process above, the random variates generated by sqrt(X^2 + Y^2 + Z^2) are samples from the one-sided Maxwell (or Maxwell-Boltzmann) distribution.

Value

a distribution instance.

References

See Also

For usage examples see e.g. tfd_sample(), tfd_log_prob(), tfd_mean().


rstudio/tfprobability documentation built on Sept. 11, 2022, 4:32 a.m.