/* Inverse exponential dist in Picat. Note: Picat PPL currently supports only the random generation of inverse exponential dist. However, inverse_exponential_dist(Lambda) is the same as exponential_dist(1/Lambda) (For parameter recovery, see ppl_exponential_dist.pi) Cf my Gamble model gamble_exponential_inverse_dist.rkt This program was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import ppl_distributions, ppl_utils. import util. % import ordset. main => go. /* var : d1 Probabilities (truncated): 37.93462038516595: 0.0001000000000000 37.238446746717976: 0.0001000000000000 33.728340106723607: 0.0001000000000000 33.412497657026073: 0.0001000000000000 ......... 0.000781539805084: 0.0001000000000000 0.000172575933265: 0.0001000000000000 0.000164370635792: 0.0001000000000000 0.000010006142261: 0.0001000000000000 mean = 4.01317 HPD intervals: HPD interval (0.94): 0.00016437063579..11.29407136026462 var : d2 Probabilities (truncated): 43.22019350861278: 0.0001000000000000 38.302692440626444: 0.0001000000000000 34.421264018440937: 0.0001000000000000 32.680865952194068: 0.0001000000000000 ......... 0.001953294506768: 0.0001000000000000 0.001690307096966: 0.0001000000000000 0.000802045999014: 0.0001000000000000 0.00056522421346: 0.0001000000000000 mean = 4.02431 HPD intervals: HPD interval (0.94): 0.00056522421346..11.27465191935672 */ go ?=> reset_store, run_model(10_000,$model,[show_probs_trunc,mean, % show_percentiles,show_histogram, show_hpd_intervals,hpd_intervals=[0.94] % min_accepted_samples=1000,show_accepted_samples=true ]), nl, % show_store_lengths,nl, % fail, nl. go => true. model() => Lambda = 4, % Is 1/4 in Gamble D1 = inverse_exponential_dist(Lambda), D2 = exponential_dist(1/Lambda), add("d1",D1), add("d2",D2).