/* Pareto type III distribution Picat. From Mathematica ParetoDistribution ParetoDistribution[k,1,gamma,mu] i.e. pareto_dist4(k,1,gamma,mu) Cf my Gamble model gamble_pareto3_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 : d Probabilities (truncated): 54813.207905154296895: 0.0001000000000000 22136.621979730352905: 0.0001000000000000 19607.873809258242545: 0.0001000000000000 17125.690850430641149: 0.0001000000000000 ......... 0.300479905509335: 0.0001000000000000 0.300373917676933: 0.0001000000000000 0.300269754847247: 0.0001000000000000 0.300114222060926: 0.0001000000000000 mean = 28.0637 [len = 10000,min = 0.300114,mean = 28.0637,median = 2.31472,max = 54813.2,variance = 458257.0,stdev = 676.947] var : p Probabilities: false: 0.8088000000000000 true: 0.1912000000000000 mean = 0.1912 show_simple_stats: no numeric data */ go ?=> reset_store, run_model(10_000,$model,[show_probs_trunc,mean, show_simple_stats % , % show_percentiles, % show_hpd_intervals,hpd_intervals=[0.84,0.9,0.94,0.99,0.99999], % show_histogram, % min_accepted_samples=1000,show_accepted_samples=true ]), nl, % show_store_lengths,nl, % fail, nl. go => true. model() => K = 2, Gamma = 0.3, Mu = 1, D = pareto3_dist(K,Gamma,Mu), P = check(D >= pareto3_dist_quantile(K,Gamma,Mu,0.99)), add("d",D), add("p",P).