📄 randist.texi
字号:
@deftypefunx double gsl_cdf_exponential_Pinv (double @var{P}, double @var{mu})@deftypefunx double gsl_cdf_exponential_Qinv (double @var{Q}, double @var{mu})These functions compute the cumulative distribution functions@math{P(x)}, @math{Q(x)} and their inverses for the exponentialdistribution with mean @var{mu}.@end deftypefun@page@node The Laplace Distribution@section The Laplace Distribution@deftypefun double gsl_ran_laplace (const gsl_rng * @var{r}, double @var{a})@cindex two-sided exponential distribution@cindex Laplace distributionThis function returns a random variate from the Laplace distributionwith width @var{a}. The distribution is,@tex\beforedisplay$$p(x) dx = {1 \over 2 a} \exp(-|x/a|) dx$$\afterdisplay@end tex@ifinfo@examplep(x) dx = @{1 \over 2 a@} \exp(-|x/a|) dx@end example@end ifinfo@noindentfor @math{-\infty < x < \infty}.@end deftypefun@deftypefun double gsl_ran_laplace_pdf (double @var{x}, double @var{a})This function computes the probability density @math{p(x)} at @var{x}for a Laplace distribution with width @var{a}, using the formulagiven above.@end deftypefun@sp 1@tex\centerline{\input rand-laplace.tex}@end tex@deftypefun double gsl_cdf_laplace_P (double @var{x}, double @var{a})@deftypefunx double gsl_cdf_laplace_Q (double @var{x}, double @var{a})@deftypefunx double gsl_cdf_laplace_Pinv (double @var{P}, double @var{a})@deftypefunx double gsl_cdf_laplace_Qinv (double @var{Q}, double @var{a})These functions compute the cumulative distribution functions@math{P(x)}, @math{Q(x)} and their inverses for the Laplacedistribution with width @var{a}.@end deftypefun@page@node The Exponential Power Distribution@section The Exponential Power Distribution@deftypefun double gsl_ran_exppow (const gsl_rng * @var{r}, double @var{a}, double @var{b})@cindex Exponential power distributionThis function returns a random variate from the exponential power distributionwith scale parameter @var{a} and exponent @var{b}. The distribution is,@tex\beforedisplay$$p(x) dx = {1 \over 2 a \Gamma(1+1/b)} \exp(-|x/a|^b) dx$$\afterdisplay@end tex@ifinfo@examplep(x) dx = @{1 \over 2 a \Gamma(1+1/b)@} \exp(-|x/a|^b) dx@end example@end ifinfo@noindentfor @c{$x \ge 0$}@math{x >= 0}. For @math{b = 1} this reduces to the Laplacedistribution. For @math{b = 2} it has the same form as a gaussiandistribution, but with @c{$a = \sqrt{2} \sigma$}@math{a = \sqrt@{2@} \sigma}.@end deftypefun@deftypefun double gsl_ran_exppow_pdf (double @var{x}, double @var{a}, double @var{b})This function computes the probability density @math{p(x)} at @var{x}for an exponential power distribution with scale parameter @var{a}and exponent @var{b}, using the formula given above.@end deftypefun@sp 1@tex\centerline{\input rand-exppow.tex}@end tex@deftypefun double gsl_cdf_exppow_P (double @var{x}, double @var{a}, double @var{b})@deftypefunx double gsl_cdf_exppow_Q (double @var{x}, double @var{a}, double @var{b})These functions compute the cumulative distribution functions@math{P(x)}, @math{Q(x)} for the exponential power distribution withparameters @var{a} and @var{b}.@end deftypefun@page@node The Cauchy Distribution@section The Cauchy Distribution@deftypefun double gsl_ran_cauchy (const gsl_rng * @var{r}, double @var{a})@cindex Cauchy distributionThis function returns a random variate from the Cauchy distribution withscale parameter @var{a}. The probability distribution for Cauchyrandom variates is,@tex\beforedisplay$$p(x) dx = {1 \over a\pi (1 + (x/a)^2) } dx$$\afterdisplay@end tex@ifinfo@examplep(x) dx = @{1 \over a\pi (1 + (x/a)^2) @} dx@end example@end ifinfo@noindentfor @math{x} in the range @math{-\infty} to @math{+\infty}. The Cauchydistribution is also known as the Lorentz distribution.@end deftypefun@deftypefun double gsl_ran_cauchy_pdf (double @var{x}, double @var{a})This function computes the probability density @math{p(x)} at @var{x}for a Cauchy distribution with scale parameter @var{a}, using the formulagiven above.@end deftypefun@sp 1@tex\centerline{\input rand-cauchy.tex}@end tex@deftypefun double gsl_cdf_cauchy_P (double @var{x}, double @var{a})@deftypefunx double gsl_cdf_cauchy_Q (double @var{x}, double @var{a})@deftypefunx double gsl_cdf_cauchy_Pinv (double @var{P}, double @var{a})@deftypefunx double gsl_cdf_cauchy_Qinv (double @var{Q}, double @var{a})These functions compute the cumulative distribution functions@math{P(x)}, @math{Q(x)} and their inverses for the Cauchydistribution with scale parameter @var{a}.@end deftypefun@page@node The Rayleigh Distribution@section The Rayleigh Distribution@deftypefun double gsl_ran_rayleigh (const gsl_rng * @var{r}, double @var{sigma})@cindex Rayleigh distributionThis function returns a random variate from the Rayleigh distribution withscale parameter @var{sigma}. The distribution is,@tex\beforedisplay$$p(x) dx = {x \over \sigma^2} \exp(- x^2/(2 \sigma^2)) dx$$\afterdisplay@end tex@ifinfo@examplep(x) dx = @{x \over \sigma^2@} \exp(- x^2/(2 \sigma^2)) dx@end example@end ifinfo@noindentfor @math{x > 0}.@end deftypefun@deftypefun double gsl_ran_rayleigh_pdf (double @var{x}, double @var{sigma})This function computes the probability density @math{p(x)} at @var{x}for a Rayleigh distribution with scale parameter @var{sigma}, using theformula given above.@end deftypefun@sp 1@tex\centerline{\input rand-rayleigh.tex}@end tex@deftypefun double gsl_cdf_rayleigh_P (double @var{x}, double @var{sigma})@deftypefunx double gsl_cdf_rayleigh_Q (double @var{x}, double @var{sigma})@deftypefunx double gsl_cdf_rayleigh_Pinv (double @var{P}, double @var{sigma})@deftypefunx double gsl_cdf_rayleigh_Qinv (double @var{Q}, double @var{sigma})These functions compute the cumulative distribution functions@math{P(x)}, @math{Q(x)} and their inverses for the Rayleighdistribution with scale parameter @var{sigma}.@end deftypefun@page@node The Rayleigh Tail Distribution@section The Rayleigh Tail Distribution@deftypefun double gsl_ran_rayleigh_tail (const gsl_rng * @var{r}, double @var{a}, double @var{sigma})@cindex Rayleigh Tail distributionThis function returns a random variate from the tail of the Rayleighdistribution with scale parameter @var{sigma} and a lower limit of@var{a}. The distribution is,@tex\beforedisplay$$p(x) dx = {x \over \sigma^2} \exp ((a^2 - x^2) /(2 \sigma^2)) dx$$\afterdisplay@end tex@ifinfo@examplep(x) dx = @{x \over \sigma^2@} \exp ((a^2 - x^2) /(2 \sigma^2)) dx@end example@end ifinfo@noindentfor @math{x > a}.@end deftypefun@deftypefun double gsl_ran_rayleigh_tail_pdf (double @var{x}, double @var{a}, double @var{sigma})This function computes the probability density @math{p(x)} at @var{x}for a Rayleigh tail distribution with scale parameter @var{sigma} andlower limit @var{a}, using the formula given above.@end deftypefun@sp 1@tex\centerline{\input rand-rayleigh-tail.tex}@end tex@page@node The Landau Distribution@section The Landau Distribution@deftypefun double gsl_ran_landau (const gsl_rng * @var{r})@cindex Landau distributionThis function returns a random variate from the Landau distribution. Theprobability distribution for Landau random variates is definedanalytically by the complex integral,@tex\beforedisplay$$p(x) = {1 \over {2 \pi i}} \int_{c-i\infty}^{c+i\infty} ds\, \exp(s \log(s) + x s) $$\afterdisplay@end tex@ifinfo@examplep(x) = (1/(2 \pi i)) \int_@{c-i\infty@}^@{c+i\infty@} ds exp(s log(s) + x s) @end example@end ifinfoFor numerical purposes it is more convenient to use the followingequivalent form of the integral,@tex\beforedisplay$$p(x) = (1/\pi) \int_0^\infty dt \exp(-t \log(t) - x t) \sin(\pi t).$$\afterdisplay@end tex@ifinfo@examplep(x) = (1/\pi) \int_0^\infty dt \exp(-t \log(t) - x t) \sin(\pi t).@end example@end ifinfo@end deftypefun@deftypefun double gsl_ran_landau_pdf (double @var{x})This function computes the probability density @math{p(x)} at @var{x}for the Landau distribution using an approximation to the formula givenabove.@end deftypefun@sp 1@tex\centerline{\input rand-landau.tex}@end tex@page@node The Levy alpha-Stable Distributions@section The Levy alpha-Stable Distributions@deftypefun double gsl_ran_levy (const gsl_rng * @var{r}, double @var{c}, double @var{alpha})@cindex Levy distributionThis function returns a random variate from the Levy symmetric stabledistribution with scale @var{c} and exponent @var{alpha}. The symmetricstable probability distribution is defined by a fourier transform,@tex\beforedisplay$$p(x) = {1 \over 2 \pi} \int_{-\infty}^{+\infty} dt \exp(-it x - |c t|^\alpha)$$\afterdisplay@end tex@ifinfo@examplep(x) = @{1 \over 2 \pi@} \int_@{-\infty@}^@{+\infty@} dt \exp(-it x - |c t|^alpha)@end example@end ifinfo@noindentThere is no explicit solution for the form of @math{p(x)} and thelibrary does not define a corresponding @code{pdf} function. For@math{\alpha = 1} the distribution reduces to the Cauchy distribution. For@math{\alpha = 2} it is a Gaussian distribution with @c{$\sigma = \sqrt{2} c$} @math{\sigma = \sqrt@{2@} c}. For @math{\alpha < 1} the tails of thedistribution become extremely wide.The algorithm only works for @c{$0 < \alpha \le 2$}@math{0 < alpha <= 2}.@end deftypefun@sp 1@tex\centerline{\input rand-levy.tex}@end tex@page@node The Levy skew alpha-Stable Distribution@section The Levy skew alpha-Stable Distribution@deftypefun double gsl_ran_levy_skew (const gsl_rng * @var{r}, double @var{c}, double @var{alpha}, double @var{beta})@cindex Levy distribution, skew@cindex Skew Levy distributionThis function returns a random variate from the Levy skew stabledistribution with scale @var{c}, exponent @var{alpha} and skewnessparameter @var{beta}. The skewness parameter must lie in the range@math{[-1,1]}. The Levy skew stable probability distribution is definedby a fourier transform,@tex\beforedisplay$$p(x) = {1 \over 2 \pi} \int_{-\infty}^{+\infty} dt \exp(-it x - |c t|^\alpha (1-i \beta \sign(t) \tan(\pi\alpha/2)))$$\afterdisplay@end tex@ifinfo@examplep(x) = @{1 \over 2 \pi@} \int_@{-\infty@}^@{+\infty@} dt \exp(-it x - |c t|^alpha (1-i beta sign(t) tan(pi alpha/2)))@end example@end ifinfo@noindentWhen @math{\alpha = 1} the term @math{\tan(\pi \alpha/2)} is replaced by@math{-(2/\pi)\log|t|}. There is no explicit solution for the form of@math{p(x)} and the library does not define a corresponding @code{pdf}function. For @math{\alpha = 2} the distribution reduces to a Gaussiandistribution with @c{$\sigma = \sqrt{2} c$} @math{\sigma = \sqrt@{2@} c} and the skewness parameter has no effect. For @math{\alpha < 1} the tails of the distribution become extremelywide. The symmetric distribution corresponds to @math{\beta =0}.The algorithm only works for @c{$0 < \alpha \le 2$}@math{0 < alpha <= 2}.@end deftypefunThe Levy alpha-stable distributions have the property that if @math{N}alpha-stable variates are drawn from the distribution @math{p(c, \alpha,\beta)} then the sum @math{Y = X_1 + X_2 + \dots + X_N} will also bedistributed as an alpha-stable variate,@c{$p(N^{1/\alpha} c, \alpha, \beta)$} @math{p(N^(1/\alpha) c, \alpha, \beta)}.@comment PDF not available because there is no analytic expression for it@comment@comment @deftypefun double gsl_ran_levy_pdf (double @var{x}, double @var{mu})@comment This function computes the probability density @math{p(x)} at @var{x}@comment for a symmetric Levy distribution with scale parameter @var{mu} and@comment exponent @var{a}, using the formula given above.@comment @end deftypefun@sp 1@tex\centerline{\input rand-levyskew.tex}@end tex@page@node The Gamma Distribution@section The Gamma Distribution@deftypefun double gsl_ran_gamma (const gsl_rng * @var{r}, double @var{a}, double @var{b})@cindex Gamma distributionThis function returns a random variate from the gammadistribution. The distribution function is,@tex\beforedisplay$$p(x) dx = {1 \over \Gamma(a) b^a} x^{a-1} e^{-x/b} dx$$\afterdisplay@end tex@ifinfo@examplep(x) dx = @{1 \over \Gamma(a) b^a@} x^@{a-1@} e^@{-x/b@} dx@end example@end ifinfo@noindent
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -