Package jline.api.mam
Class Me_sampleKt
-
- All Implemented Interfaces:
public final class Me_sampleKt
-
-
Method Summary
Modifier and Type Method Description final static DoubleArrayme_sample(Matrix alpha, Matrix A, Long n, Random random)Generates random samples from a Matrix Exponential (ME) distribution using inverse CDF interpolation. final static DoubleArrayme_sample(MatrixCell ME, Long n, Random random)Generates random samples from an ME distribution using matrices stored in a MatrixCell. -
-
Method Detail
-
me_sample
final static DoubleArray me_sample(Matrix alpha, Matrix A, Long n, Random random)
Generates random samples from a Matrix Exponential (ME) distribution using inverse CDF interpolation.
Algorithm:
Precompute a dense grid of CDF values from 0 to mean + 10*sigma
For each sample, generate u ~ Uniform(0,1)
Find the corresponding time value by: a. Binary search in the CDF grid to locate u b. Linear interpolation between adjacent grid points
- Parameters:
alpha- The initial vector of the ME distributionA- The matrix parameter of the ME distributionn- The number of samples to generaterandom- The random number generator to use- Returns:
Array of n samples from the ME distribution
-
me_sample
final static DoubleArray me_sample(MatrixCell ME, Long n, Random random)
Generates random samples from an ME distribution using matrices stored in a MatrixCell.
Note: For ME distributions stored in MatrixCell format {D0=A, D1=-Aealpha'}, we need to reconstruct alpha. However, for sampling purposes, it's better to use the explicit (alpha, A) overload.
- Parameters:
ME- The Matrix Exponential distribution stored in a MatrixCelln- The number of samples to generaterandom- The random number generator to use- Returns:
Array of n samples from the ME distribution
-
-
-
-