A simple tool to generate points on the (n−1)-dimensional simplex.
This repository contains a function that utilises the Dirichlet distribution method to generate points on the (n−1)
-dimensional simplex. The randomSimplexMatrix.m
generates m x n
matrices where each row is a random sample from the (n−1)
-dimensional simplex, i.e., it produces vectors where each element is a non-negative number and the sum of all elements in each vector is 1.
Generation of K Unit-Exponential Distributed Random Draws:
y_i
from the open interval (0,1]
.x_i = -log(y_i)
.Normalization:
S
of all x_i
values.Calculation of Simplex Coordinates:
t_1, ..., t_K
of the final point on the unit simplex are computed as t_i = x_i / S
.Output:
(n-1)
-dimensional simplex.Polynomial Stability/Stability of discrete-time control systems:
Use simplex sampling to generate coefficients for polynomials and analyse their stability by checking if all roots lie within the unit circle.
Lyapunov Functions:
Construct Lyapunov functions with randomly sampled coefficients to study the stability of equilibrium points in dynamical systems.
Parameter Space Exploration:
Investigate the behavior of dynamical systems under different parameter regimes by sampling parameters from a simplex. Identify bifurcation points where system behavior changes qualitatively.
Nonlinear Dynamics:
Model/simulate nonlinear systems to study chaos, where initial conditions or parameters are sampled from a simplex.
simplexSpace.m
Demonstrates various plots and visualisations of simplex sampling.
MultivariateND.m
Showcases an application of simplex sampling for sampling from a multivariate normal distribution.
VoronoiDiagram.m
Visualise the Voronoi diagram of random points on a 2-dimensional simplex, divides regions based on proximity.
n = 100; % Number of columns (dimensionality of simplex)
m = 1500; % Number of rows (number of samples)
y = randomSimplexMatrix(n, m);
disp('Generated simplex matrix:');
disp(y);