Math::Random::SkewNormal - Handy, easy-to-use Skew-Normal random number generator
use Math::Random::SkewNormal; $skewness = 1; $delta = [0, 0]; $omega = [[1, 0], [0, 1]]; # following functions generate realizations: generate_sn($skewness) # SkewNormal(0,1,$skewness) generate_sn_multi($delta, $omega) # SkewNormal_n($delta, $omega)
This module transforms uniformly spaced random variable realizations into realizations that follow the Skew-Normal (SN) Probability Density Function (PDF).
We accept following definition of the Skew-Normal Distribution:
[ 1 delta ] [ delta Omega ]
Omega is a matrix and delta is a vector. Then (X_1, ..., X_n)|(X_0 > 0) follows n-dimensional Skew Normal distribution.
We use following algorithms:
Returns realization of SN(0,1, a), where a is the only parameter. The meaning of a is "skewness" (see definition above).
Returns realization of centralized n-dimensional Skew-Normal distribution.
1st parameter is correlation matrix of the form
[[row_1], [row_2], ..., [row_n]], for example
[[1, 0], [0, 1]] for 2-dimensional unit matrix.
2nd parameter is delta vector of the form
[delta_1, ..., delta_n], e. g.
The examples in examples/ subdirectory of this distribution contains example of generated data with histogram.
The scripts in bin/ directory of this distribution contains tools for generating realizations on command line.
Jiri Vaclavik, <my name dot my last name at gmail dot com>
Copyright (C) 2011 by Jiri Vaclavik
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8 or, at your option, any later version of Perl 5 you may have available.