rpgnorm: A random number generator for the p-generalized normal...

Description Usage Arguments Value Author(s) References Examples

View source: R/rpgnorm.R

Description

The function simulates the univariate p-generalized normal distribution by using one of the following methods: the p-generalized polar method (pgenpolar), the p-generalized rejecting polar method (pgenpolarrej), the Monty Python method (montypython), the Ziggurat method (ziggurat) and the method of Nardon and Pianca (nardonpianca).

Usage

1
rpgnorm(n, p, mean, sigma, method)

Arguments

n

The natural number of random variables to be simulated.

p

A positive number expressing the form parameter of the distribution. The default is 2. In case of the Monty Python method and the Ziggurat method, p can be chosen from (1, ∞) \cup \{ 0.25, 0.45, 0.5, 0.6, 0.75 \} .

mean

A real number expressing the expectation of the distribution. The default is 0.

sigma

A positive number expressing the standard deviation of the distribution. The default is σ_p=p^{1/p} \, √{Γ(3/p)/ Γ(1/p)}, the natural standard deviation of the p-generalized normal distribution.

method

A string expressing the method to be used for the simulation ("pgenpolar", "pgenpolarrej", "montypython", "ziggurat" or "nardonpianca"). The default is "nardonpianca".

Value

An n-dimensional, real vector.

Author(s)

Steve Kalke

References

S. Kalke and W.-D. Richter (2013)."Simulation of the p-generalized Gaussian distribution." Journal of Statistical Computation and Simulation. Volume 83. Issue 4.

Examples

1
y<-rpgnorm(10000,3,method="pgenpolar")

pgnorm documentation built on May 1, 2019, 7:55 p.m.