SAMPLE_GAUSSIAN

All functions > BUSINESS_SIMULATIONS > SAMPLE_GAUSSIAN

Returns a value chosen from a normal distribution between two bounds based on the given hashing key.

Syntax

SAMPLE_GAUSSIAN(hashing_key: VARCHAR, mean: DOUBLE, stdev: DOUBLE, lower: DOUBLE, upper: DOUBLE) → DOUBLE
sql

Arguments

ParameterTypeRequiredDescription
hashing_keyVARCHARYesString value to hash (typically user ID or session ID)
meanDOUBLEYesMean of the normal distribution
stdevDOUBLEYesStandard deviation of the distribution
lowerDOUBLEYesLower bound (values clamped to this minimum)
upperDOUBLEYesUpper bound (values clamped to this maximum)

Returns

DOUBLE - Deterministic value from normal distribution, clamped to [lower, upper]

Notes

  • Deterministic - same key always produces same value
  • Uses Box-Muller transform to generate normal distribution
  • Values follow Gaussian/bell curve centered at mean
  • Results clamped to [lower, upper] bounds
  • Useful for realistic simulations with natural variation
  • Common for modeling human behavior, response times, usage patterns
Last update at: 2025/10/13 10:23:46