https://github.com/danielwohlr/zikkurat-implementation
Matlab implementation of RNG Zikkurat method. Finished 2020
https://github.com/danielwohlr/zikkurat-implementation
fallback generalized-inversed-gaussian matlab rng
Last synced: 16 days ago
JSON representation
Matlab implementation of RNG Zikkurat method. Finished 2020
- Host: GitHub
- URL: https://github.com/danielwohlr/zikkurat-implementation
- Owner: Danielwohlr
- Created: 2024-01-13T22:22:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T13:56:35.000Z (over 1 year ago)
- Last Synced: 2025-02-27T15:08:57.201Z (over 1 year ago)
- Topics: fallback, generalized-inversed-gaussian, matlab, rng
- Language: MATLAB
- Homepage:
- Size: 1000 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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```.


## Table of Contents
- [GAUSS](#gauss)
- [GIG](#gig)
- [Images](#images)
## 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.