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
Parameter | Type | Required | Description |
---|---|---|---|
hashing_key | VARCHAR | Yes | String value to hash (typically user ID or session ID) |
mean | DOUBLE | Yes | Mean of the normal distribution |
stdev | DOUBLE | Yes | Standard deviation of the distribution |
lower | DOUBLE | Yes | Lower bound (values clamped to this minimum) |
upper | DOUBLE | Yes | Upper 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