/* Pareto type IV distribution in Picat. From Mathematica ParetoDistribution. ParetoDistribution[k,alpha,gamma,mu] represents a Pareto type IV distribution with - minimum parameter k, - shape parameter alpha - shape parameter gamma - location parameter mu Cf my Gamble model gamble_pareto4_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): 194.575800643995763: 0.0001000000000000 182.974310127591508: 0.0001000000000000 151.803743450382996: 0.0001000000000000 145.886281658358115: 0.0001000000000000 ......... 1.000003477991948: 0.0001000000000000 1.000002584333255: 0.0001000000000000 1.000002463880333: 0.0001000000000000 1.000002308074664: 0.0001000000000000 mean = 2.20205 [len = 10000,min = 1.0,mean = 2.20205,median = 1.26166,max = 194.576,variance = 25.0377,stdev = 5.00377] var : p Probabilities: false: 0.9769000000000000 true: 0.0231000000000000 mean = 0.0231 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, Alpha = 3, Gamma = 1, Mu = 1.5, D = pareto4_dist(K,Alpha,Gamma,Mu), P = check(D >= pareto4_dist_quantile(K,Alpha,Gamma,Mu,0.99)), add("d",D), add("p",P).