Skip to content

Danielwohlr/zikkurat-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom RNG implementation using Zikkurat method in MATLAB

This report presents the implementation of the Ziggurat method for generating pseudorandom numbers using MATLAB. It extends the method to both Normal (Gaussian) and Generalized Inverse Gaussian (GIG) distributions, exploring algorithmic adaptations for these specific cases. The GIG distribution is of the form $$f(x) = \frac{(\frac{a}{b})^{p/2}}{2 \mathcal{K}_p(\sqrt{ab})} \Theta(x) x^{p-1} \mathrm{exp}\left(-\frac{ax +\frac{b}{x}}{2}\right),$$

where $\Theta(x)$ is the Heaviside step function, $\mathcal{K}_p$ is the modified Bessel function of the second kind, and the parameters are $a,b>0, p \in \mathbb{R}$.

The final report is in english-version.pdf.

Project Screenshot Project Screenshot

Table of Contents

GAUSS

Contains MATLAB scripts for the Zikkurat algorithm (rejection rules, statistical checks, fallback, etc.) implementation in the case of the Normal (Gaussian) distribution.

GIG

Contains MATLAB scripts for the Zikkurat algorithm (rejection rules, statistical checks, fallback, etc.) implementation in the case of the GIG distribution.

Images

All the generated images are saved in the directory images. It is usually not a good practice to upload images to github.

About

Implementation of RNG Zikkurat method. Finished 2020

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages