/* Pareto type II distribution in Picat. From Mathematica ParetoDistribution ParetoDistribution[k,alpha,mu] represents a Pareto type II distribution with - minimum parameter k, - shape parameter alpha - location parameter mu Cf my Gamble model gamble_pareto2_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): 50.672960015629542: 0.0001000000000000 46.089334508696915: 0.0001000000000000 41.323229715073097: 0.0001000000000000 37.660891819075538: 0.0001000000000000 ......... 3.500219106244304: 0.0001000000000000 3.50015276147717: 0.0001000000000000 3.500109378724807: 0.0001000000000000 3.500065889204516: 0.0001000000000000 mean = 4.49397 [len = 10000,min = 3.50007,mean = 4.49397,median = 4.02297,max = 50.673,variance = 3.03325,stdev = 1.74162] var : p Probabilities: false: 0.9808000000000000 true: 0.0192000000000000 mean = 0.0192 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, Mu = 1.5, D = pareto2_dist(K,Alpha,Mu), P = check(D >= pareto2_dist_quantile(K,Alpha,Mu,0.99)), add("d",D), add("p",P).