[Fix] Pepper display probability calculation (#349)

Probability of persistent is now calculated to include very persistent.

Reviewed-on: enviPath/enviPy#349
Co-authored-by: Liam Brydon <lbry121@aucklanduni.ac.nz>
Co-committed-by: Liam Brydon <lbry121@aucklanduni.ac.nz>
This commit is contained in:
2026-03-11 19:12:55 +13:00
committed by jebus
parent b737fc93eb
commit ef0c45b203

View File

@ -79,9 +79,9 @@ class PepperPrediction(PredictedProperty):
dist = stats.lognorm(s=sigma_ln, scale=np.exp(mu_ln))
# Exact probabilities
p_green = dist.cdf(p) # P(X < a)
p_yellow = dist.cdf(vp) - p_green # P(a <= X <= b)
p_red = 1.0 - dist.cdf(vp) # P(X > b)
p_green = dist.cdf(p) # P(X < p) prob not persistent
p_yellow = 1.0 - dist.cdf(p) # P (X > p) prob persistent
p_red = 1.0 - dist.cdf(vp) # P(X > vp) prob very persistent
# Plotting range
q_low, q_high = dist.ppf(quantiles)