My WebPPL page
WebPPL is a Probabilistic Programming Language system and is available at
http://webppl.org/ as an interactive system. The code is
available via GitHub (https://github.com/probmods/webppl). However, it's a good idea to install it via node.js (npm install -g webppl
) to be able to use it locally, especially since it is often faster (and IMHO neater) to run the models locally than via the web browser.
Unfortunately, WebPPL hasn't been updated for a while and to make it work properly requires a downgrade of the node.js version. Here's what I do when running WebPPL at command line:
$ nvm use v10.22.0
Some of the packages that are available when running via a browser is not automatically available via the standalone version, e.g. the viz functions, the nice graph functions as well as the physics engine, etc. However, some of them can easily be installed via npm, e.g. the viz
, see github.com/probmods/webppl-viz/blob/master/README.md for details.
Documentation and other resources
- WebPPL Documentation
- http://dippl.org/: "The Design and Implementation of Probabilistic Programming Languages" by Noah D. Goodman and Andreas Stuhlmüller
- https://probmods.org/: "Probabilistic Models of Cognition" by Noah D. Goodman, Joshua B. Tenenbaum & The ProbMods Contributors (This is an excellent introduction of probabilistic programming).
- Gregory Scontras, Michael Henry Tessler, and Michael Franke: Probabilistic language understanding - An introduction to the Rational Speech Act framework
- Owain Evans, Andreas Stuhlmüller, John Salvatier, and Daniel Filan: Modeling Agents with Probabilistic Programs
- http://forestdb.org/: Forest a repository for generative models. Many models in WebPPL (and also in Church, the precursor to WebPPL)
- https://github.com/mhtess/bdappl: Some tutorials for WebPPL
- RWebPPL: R interface to WebPPL
- YouTube: Noah Goodman on Stanford Seminar-Stories from CoCoLab: Probabilistic Programs, Cognative Modeling, & Smart Web Pages
- YouTube: On Church Programming language (precursor of WebPPL): Tutorial 5.1: Tomer Ullman - Church Programming Language Part 1, Tutorial 5.1: Tomer Ullman - Church Programming Language Part 2 (Church has different syntax but much the same semantics as WebPPL)
My WebPPL models
Many of these WebPPL model has been ports from (or via) my BLOG or PSI models. Inside the parenthesis, the "original" source are given. The models are also available at GitHub: github.com/hakank/hakank/tree/master/webppl (or will be soon)
Note that some most of the models use my WebPPL packages hakank_utils
/distributions
(in the directory node_modules/hakank_utils
). These must thus be run with the --require
parameter:
$ webppl--require hakank_utils model.wppl
Packages
The package includes the following utilities:
- hakank_utils.wppl
-
exp_map
: Show expectation, MAP, marginals for variables in a list
-
exp_map_all
: Show expectation, MAP, marginals for all variables
-
percentile
: Percentiles for chain (0..100)
-
percentile_pct
: Percentiles for chain (0.0..1.0)
-
show_stats1
: Show stats for a chain
-
show_stats
: Show stats for a chain
-
stat2
: Prints stats for a variable in chain: min, mean, max, stdev
-
stat3
: Prints stats for a variable in chain: min, mean, max, stdev (also works with Enumerate results)
-
num_bins
: number of bins (for histogram)
-
histogram
: show histogram for a chain
-
histogram1
(alias to the JavaScript function histogram1
, see below)
-
get_samples
: get samples for a variable in a chain
-
get_samples2
: get samples for a variable in a chain (works with Enumerate results)
-
credibleInterval
: credible interval for a variable
-
showCredibleInterval
: wrapper for credibleInterval
-
showCredibleInterval2
: wrapper for credibleInterval (work with Enumerate results)
-
checkCredibleInterval
: Check if a value is inside a credible interval
-
simplex
: simplex of an array (ensure that the values sums to 1)
-
draw_without_replacement
: draw values from an array without replacement (fast but removes all the values that was selected)
-
draw_without_replacement2
: draw values from an array without replacement (better but slower variant)
-
shuffle
: Shuffles an array (using shuffle() in hakank_utils.js )
-
shuffle2
: Shuffles an array (using draw_without_replacement2() )
-
resample
: Resamples n values from an array
-
rep
: Repeats a value n times
-
count
: Count the number of occurrences of a value in an array
-
accumulate_data
: Accumulate values in an array given a JS function(v1,v2)
-
accumulate_data
: As accumulate_date but includes the first value from the array
-
listMedian
: median of values in an array
-
quantile
: calculate the q'th quantile for a distribution (simulation)
-
quantiles
: calculate the qs'th quantiles for a distribution (simulation)
-
binomialf
: Binomial coefficients
-
factorial
: Factorial
-
gammaf
: Gamma function
-
betaf
: Beta function
-
erfInv
: Inverse of Erf (Error function). Note: This is not exact, so be careful.
-
harmonic_number
: Harmonic number(n)
-
harmonic_number_generalized
: Harmonic number(n,s)
-
zetaf
: Zeta function
- hakank_utils.js:
In WebPPL, one can not write all types of JS functions (e.g. loops), but one can export such a JS function which can then be used. Here are some of them, they are all imported in either the packages
hakank_utils.wppl
or distributions.wppl
.
-
histogram1
: histogram, This is aliased as histogram
in hakank_utils.wppl
-
pluck
: Pluck values (key) from an array of dicts
-
shuffle
: Shuffle an array (note: this use Math.rand() so it can mess things up)
-
binomial_coeff
: Binomial coefficients
-
factorial
: Factorial
-
erfInv
: Inverse error function (note very good, though. Used in normal_quantile/gaussian_dist_quantile)
-
poisson_quantileJS
: Poisson quantile
-
normal_quantileJS
: Normal quantile
-
binomial_quantileJS
: Binomial quantile
-
geometric_quantileJS
: Geometric quantile
-
negative_binomial_quantileJS
: Negative binomial quantile
-
correlation_coefficientJS
: correlation coefficient
-
collect
: collect values from an array into a dict
- distributions.wppl: Collection of the probability distribution in the *_dist.wppl programs. See below ("Distributions") for some tests of these functions.
-
bernoulli_dist
-
bernoulli_dist_quantile
-
bernoulli_pdf
-
binomial_dist
-
binomial_dist_quantile
-
binomial_pdf
-
cauchy_dist
-
cauchy_dist_quantile
-
cauchy_pdf
-
chi_dist
-
chi_squared_dist
-
inverse_chi_squared_dist
-
non_central_chi_squared_dist
-
erlang_dist
-
exponential_dist
-
exponential_dist_quantile
-
exponential_dist2
-
exponential_dist2_quantile
-
exponential_pdf
-
inverse_exponential_dist
-
inverse_exponential_dist_quantile
-
shifted_exponential_dist
-
shifted_exponential_dist_quantile
-
gamma_int_dist (only integer version)
-
generalized_gamma_dist
-
inverse_gamma_dist
-
inversed_transformed_gamma_dist
-
gaussian01
-
gaussian_dist
-
gaussian_dist_quantile
(note: this is not very exact!)
-
gaussian_pdf
-
geometric_dist
-
geometric_dist_quantile
-
geometric_pdf
-
geometric_exact_dist
(exact version, can take very long time)
-
zero_inflated_geometric_dist
-
geometric_zero_truncated_dist
-
hypergeometric_dist
(note: this is really a PDF)
-
hypergeometric_count
(returns the count which is more what we want)
-
hypergeometric_pdf
-
hypergeometric2_pdf
(same parameter order as Mathematica's HypergeometricDistribution)
-
hypergeometric2_pdf
-
laplace_dist
-
laplace_dist_quantile
-
laplace_pdf
-
log_gamma_dist
-
log_normal_dist
-
shifted_log_normal_dist
-
negative_binomial_dist
-
negative_binomial_dist_quantile
-
negative_binomial_pd
-
negative_binomial_exact_dist
(exact version)
-
pareto_dist
-
pareto_dist_quantile
-
pareto_i_dist
(not compliant with Mathematica's ParetoDistribution variants)
-
pareto_i_dist_quantile
-
pareto_ii_dist
-
pareto_ii_dist_quantile
-
pareto_iii_dist
-
pareto_iii_dist_quantile
-
pareto_iv_dist
-
pareto_iv_dist_quantile
-
pareto_i_dist2
(compliant with Mathematica's ParetoDistribution variants)
-
pareto_i_dist2_quantile
-
pareto_ii_dist2
-
pareto_ii_dist2_quantile
-
pareto_iii_dist2
-
pareto_iii_dist2_quantile
-
pareto_iv_dist2
-
pareto_iv_dist2_quantile
-
generalized_pareto_dist
-
inverse_pareto_dist
-
pascal_dist
-
poisson_dist
-
poisson_dist_quantile
-
poisson_pdf
-
zero_modified_poisson_dist
-
zero_truncated_poisson_dist
-
student_t_dist
-
triangular_dist
-
uniform_discrete_dist
-
uniform_pdf
-
weibull_dist
-
weibull_dist_quantile
-
inverse_weibull_dist
-
inverse_weibull_expectation
-
gumbel_dist
-
gumbel_dist_quantile
-
gumbel_pdf
-
kumaraswamy_dist
-
kumaraswamy_dist_quantile
-
logistic_dist
-
logistic_dist_quantile
-
logistic1_dist (variant)
-
logistic1_dist_quantile
-
logistic_pdf
-
extreme_value_dist1
-
extreme_value_dist1_quantile
-
extreme_value_dist2
-
extreme_value_dist2_quantile
-
frechet_dist
-
frechet_dist_quantile
-
generalized_extreme_value_dist
-
generalized_extreme_value_dist_quantile
-
uniform_dist_quantile
-
power_dist
-
power_dist_quantile
-
beta_binomial_dist
-
beta_binomial_pdf
-
beta_binomial_cdf
-
zipf_dist
-
zipf_pdf
-
zipf_cdf
-
zipf_quantile
-
zipf1_dist
(approx)
-
zipf1_pdf
-
zipf1_cdf
Models
Here are the models. As mentioned above, some model uses the hakank_util
package (i.e. add --require hakank_utils
when running from command line). Some models might also require the webppl-viz package (--require webppl-viz
).
- 6_consecutive_cards_in_a_card_deck.wppl: 6 consecutive cards in a card deck
- 6_digit_numbers.wppl: 6 Digit Numbers (Blom, Holst, Sandell)
- 8_schools.wppl: 8 Schools problem (Stan)
- ab_test_simple.wppl: AB Test (Stan)
- ab_testing.wppl: AB Testing (Rasmus Bååth)
- ab_testing2.wppl: AB Testing (PyMC3)
- adding_to_7.wppl: Adding to 7 (Anglican)
- alarm_multi.wppl: Alarm problem (ProbLog)
- actors_award.wppl: Actors award (Figaro)
- aircraft_position.wppl: Aircraft and Blips model (BLOG)
- aircraft_static.wppl: Aircraft and Blips model (BLOG)
- all_different.wppl: all different (of different sizes)
- animal_population.wppl: Animal population (Statistics101/Resample Stats)
- all_girls_world.wppl: All Girls World (Brain Stellar)
- appears_tall.wppl: Appears tall (HAL-Problog)
- ar1.wppl: AR(1) model (Stan)
- ar2.wppl: AR(2) model (BLOG)
- area_under_normal_curve.wppl: Area under normal curve (Statistics101/Resampling Stats)
- asia.wppl: Asia (Church)
- bag_of_marbles.wppl: Bag of marbles (Luc De Raedth, ProbLog)
- bag_of_marbles2.wppl: Bag of marbles, another approach (Luc De Raedth, ProbLog)
- ball_box.wppl: Ball in a box problem (HAL ProbLog)
- ball_entering_q.wppl: Ball entering q
- banachs_match_box_problem.wppl: Banach's Match Box problem (Blom, Holst, Sandell)
- bar_visiting.wppl: Bar visiting (probabilities of bar visiting)
- baseball_hitting_skills.wppl: Baseball hitting skills (Hierarchical Partial Pooling) (PyMC)
- baseball_payroll.wppl: Baseball payroll (Statistics101/Resample Stats)
- battalion.wppl: Battalion model (BLOG)
- battery_comparison.wppl: Battery comparison (Statistics101/Resample Stats)
- bayes.wppl: Bayes calculation of disease om a population (Statistics101/Resample Stats)
- bayesian_linear_regression.wppl: Bayesian linear regression (BLOG)
- bayesian_network.wppl: Bayesian network
- bernoulli_test.wppl: Bernoilli test
- bertrands_paradox.wppl: Bertrand's Box Paradox
- bertrands_paradox_resampling.wppl: Bertrand's Box Paradox (Resampling Stats and another "pure" PPL approach)
- beta_binomial_recover.wppl: Beta Binomial example
- beta_binomial_urn_model.wppl: Urn model, including Beta Binomial derived related distributions.
- beta_comparison.wppl: Beta comparison (Infer.NET)
- biased_coin.wppl: Biased coin (cpling)
- binomial_basketball.wppl: Basketball player problem (Wolfram)
- binomial_coin.wppl: Binomial coin problem (Wolfram)
- binomial_dice2.wppl: Binomial dice problem (Wolfram)
- binomial_trial_count.wppl: Binomial Trial Count (Infer.NET)
- birthday.wppl: Birthday problem (BLOG/Swift)
- birthday4.wppl: Birthday problem, two stage model (optimizing the number of people)
- birthday_coincidence.wppl: Birthday coincidence (Anglican)
- book_bags.wppl: Book bags (Netica)
- break_a_stick_in_two.wppl: Break a stick in two pieces (Mosteller)
- breaking_a_stick_in_three_pieces.wppl: Breaking a stick in three pieces
- brian_ate_pizza_last_night.wppl: Brian ate pizza last night (Pfeffer)
- bridge.wppl: Bridge problem (Statistics101/Resample Stats)
- bugs_book_2_1_2.wppl: Example 2.1.2 from the BUGS book
- bugs_book_2_4_1.wppl: Example 2.4.1 from the BUGS book
- bugs_book_2_5_1.wppl: Example 2.5.1 from the BUGS book
- bugs_book_2_6_1.wppl: Example 2.6.1 from the BUGS book
- bugs_book_2_7_1.wppl: Example 2.7.1 from the BUGS book
- bugs_book_2_7_2.wppl: Example 2.7.2 from the BUGS book
- bugs_book_3_3_2.wppl: Example 3.3.2 from the BUGS book
- bugs_book_3_3_3.wppl: Example 3.3.3 from the BUGS book
- bugs_book_3_4_1.wppl: Example 3.4.1 from the BUGS book
- bugs_book_3_4_1b.wppl: Example 3.4.1b from the BUGS book
- bugs_book_3_5_1.wppl: Example 3.5.1 from the BUGS book
- burglary_multihouse.wppl: Burglary, multihouse (BLOG)
- car_buyer.wppl: Car buyer problem (Netica)
- card_problem.wppl: Card problem (math stackexchange)
- cards.wppl: Card problem (cplint)
- cat.wppl: 3 cats problem (YouTube)
- cats_rats_and_elephants.wppl: Cats, rats, and elephants problem (Allen Downey)
- changepoint.wppl: Changepoint detection problem (JAGS model)
- changepoint_coal_miners.wppl: Coal miners changepont detection problem (PyMC3)
- changepoint_text_messages.wppl: Changepont detection of text messages counts (Cam Davidson-Pilon, PyMC3)
- cheating.wppl: Cheating model (PyMC3, Cameron Davidson Pilon)
- cheating2.wppl: Cheating model, variant (PyMC3, Cameron Davidson Pilon)
- chicken_pecking.wppl: Chicken pecking (PSI)
- choosing_a_restaurant.wppl: Choosing a restaurant
- clickGraph.wppl: Click Graph (PSI)
- clinical_trial.wppl: Clinical trial (Infer.NET)
- cloud_duration.wppl: Cloud duration (Mathematica)
- cluster_watching_birth_days.wppl: Cluster watching (birth days)
- cluster_watching_birth_months.wppl: Cluster watching (birth months)
- coin_bias.wppl: Coin bias (R2)
- coin_flip_game.wppl: Coin flip game
- coin_flip_probability_independent_or_not.wppl: Coin flips probability independent or not (StackOverflow)
- coin_flips.wppl: Coin flips (DC-ProbLog)
- coin_hh_vs_ht.wppl: Coins flips: HH vs HT (Litt)
- coin_toss.wppl: Coin toss problem (Stan)
- coin_tosses.wppl: Coin tosses problem (cplint)
- coin_tosses2.wppl: Coin tosses problem, alternative approach (cplint)
- coincidences.wppl: Coincidences (Birthday conundrum) (Diaconis and Mosteller)
- coincidences2.wppl: Coincidences with more than one attribute (Diaconis and Mosteller)
- coins_learning.wppl: Coins learning (ProbLog)
- coins_learning2.wppl: Coins learning, alternative approach (ProbLog)
- color_of_the_taxi.wppl: Color of the taxi problem (Kahnemann, Bayesia)
- comparing_two_proportions.wppl: Comparing two proportions (Statistics101/Resampling Stats)
- condExponential.wppl: Conditioned exponentials (PSI)
- cookie_problem.wppl: Cookie problem (Allen Downey)
- coupon_collector.wppl: Coupon collector problem
- coupon_collector2.wppl: Coupon collector problem, alternative approach
- coupon_collector3.wppl: Coupon collector problem, alternative approach
- covid_prob.wppl: Covid prob (difference between P(vacc|infected) and P(infected|vacc)
- craps.wppl: Craps
- credible_interval_test.wppl: Credible interval
- credit_card_fraud.wppl: Credit card fraud problem (Heckerman)
- csi.wppl: Context specific independence (BLOG)
- cycling_time1.wppl: Cycling time problem (Infer.NET)
- dartboard: Dartboard (Statistics101/Resampling Stats)
- decay_of_digoxin: Decat of Digoxin
- derangements.wppl: Derangements
- dice_6_throws.wppl: Dice 6 throws (cplint)
- dice_6_throws2.wppl: Dice 6 throws, alternative approach (cplint)
- dice_problem.wppl: Dice problem (Allen Downey)
- dice_puzzle.wppl: Dice puzzle
- disease_infection.wppl: Disease infection (SPPL)
- distinct_six_dice.wppl: Number of distinct numbers for six dice
- doomsday.wppl: Doomsday
- drug_trial_evaluation.wppl: Drug trial evaluation (PyMC)
- duelling_cowboys.wppl: Duelling Cowboys ()
- ehrenfest_urn_scheme.wppl: Ehrenfest Urn scheme
- either_a_spade_or_an_ace.wppl: Either a spade or an ace (Statistics101/Resample Stats)
- election.wppl: Election (SPPL)
- euro_coin_problem.wppl: Euro coin problem (Allen Downey)
- euro_coin_problem_unreliable_measurements.wppl: Euro coin problem with unreliable measurements (Allen Downey)
- eval_program.wppl: Evalutating simple WebPPL models from command line. eval_program is a wrapper for this
- factorial.wppl: Factorial
- factorial2.wppl: Probabilistic factorial (BLOG)
- fair_coin2.wppl: Fair coin (7 heads on 10 coin tosses) (Statistics101/Resampling Stats)
- fair_coin_from_a_biased_coin.wppl: Fair coin from biased coin (cplint)
- fair_coin_tosses.wppl: Fair coin tosses
- fairness_hiring_model1.wppl: Fairness hiring model (SPPL)
- fairness_hiring_model2.wppl: Fairness hiring model (SPPL)
- fairness_income_model.wppl: Fairness income model (SPPL)
- family_out_problem.wppl: Family out problem (Cherniak)
- firings.wppl: Firing staff problem (Statistics101/Resample Stats)
- firing_squad.wppl: Firing squad problem (Pearl)
- firm_bid.wppl: Firm bidding (Figaro)
- five_coins.wppl: Five coins problem (Math Exchange)
- flights_noshow.wppl: Flights noshow (Statistics101/Resample Stats)
- flipping_three_coins.wppl: Flipping three coins (Statistics101/Resample Stats)
- football_bet_simple.wppl: Football Bet (Netica)
- four_cards.wppl: Four cards (Bar-Hillel, Falk)
- four_girls_and_one_boy.wppl: Four girls and one boy (Resampling Stats)
- frustration_patience.wppl: Frustration Patience, aka Frustration Solitaire (Grinstead and Snell)
- galaxy.wppl: Galaxy (BLOG)
- game_of_ur_problem.wppl: Game of Ur problem (Allen Downey)
- game_of_ur_problem2.wppl: Game of Ur problem, alternative approach (Allen Downey)
- game_show_problem.wppl: Game show problem (selecting boxes)
- gaussian_mixture_model.wppl: Gaussian mixture model (BLOG), , R version: gaussian_mixture_model.R
- gaussian_mixture_model2.wppl: Gaussian mixture model
- gender_height.wppl: Identify gender/height via height/gender
- geometric_cereal_box.wppl: Geometric Cereal Box, Coupon Collector's problem (Mathematica)
- geometric_coin.wppl: Geometric distribution coins (Mathematica)
- geometric_counting_cars.wppl: Geometric distribution counting cars (Mathematica)<
li> german_tank.wppl: German tank problem
- german_tank_int.wppl: German tank problem, alternative approach
- german_tank_int2.wppl: German tank problem, yet an alternative approach
- girl_births.wppl: Girl birhts (Gelman)
- golf_putting_logit.wppl: Golf putting logic (PyMC)
- golf_putting_geometry_based1.wppl: Golf putting, geometry based (PyMC)
- golf_putting_geometry_based2.wppl: Golf putting, geometry based (PyMC)
- grades.wppl: Grade model (BLOG)
- gradient_descent.wppl: Gradient descent (PSI)
- grass.wppl: Grass (R2)
- growth_in_yeast_culture.wppl: Growth in Yeast culture
- handedness.wppl: Handedness (Infer.NET)
- healthiness.wppl: Healthiness model (BLOG)
- heart_disease_regression.wppl: Heart disease regression model (Hugin)
- heights.wppl: Male and female heights
- hierarchical_markov_switching.wppl: Hierarchical Markov switching (SPPL)
- histogram_test.wppl: Test of
histogram
function (uses hakank_util
package)
- hiv.wppl: Hiv (R2)
- hmm1.wppl: Hidden Markov Model (BLOG)
- holmes_clock_problem.wppl: Holmes clock problem (Grinstead, Snell)
- how_many_sons.wppl: How many sons? (Ruma Falk)
- how_tall_is_a.wppl: How tall is X? (Allen Downey)
- hurricane.wppl: Hurricane (BLOG)
- hypothesis_testing.wppl: Hypothesis testing (AgenaRisk)
- hypothesis_testing2.wppl: Hypothesis testing (Statistics101/Resample Stats)
- icy_road.wppl: Icy road problem (Hugin)
- indian_gpa.wppl: Indian GPA
- indistinguishable_dice.wppl: Indistinguishable Dice
- infinite_dice.wppl: Infinite Dice
- infinite_gaussian_mixture.wppl: Infinite Gaussian Mixture model (BLOG)
- inhibition_infection.wppl: Inhibition infection (ProbLog)
- inhibition1.wppl: Inhibition infection (ProbLog)
- insurance_cost.wppl: Insurance cost (Statistics101, ResampleStats)
- intelligence_test.wppl: Intelligence Test (Koller, Friedman via Mathematica StackExchange)
- italian_murder.wppl: Italian Murder mystery (Bellodi et.al.)
- jaywalking.wppl: Simple model of jaywalking
- jungs_fish_stories.wppl: Jung's fish stories (Diaconis)
- kruskal_count.wppl: Kruskal Count
- laplace_births.wppl: Laplace's births problem (Stan)
- linear_regression.wppl: Linear regression (Stan)
- linear_regression2.wppl: Linear regression
- linear_regression3.wppl: Linear regression (PyMC)
- linear_regression4.wppl: Linear regression (PyMC)
- lda.wppl: Latent Dirichlet Allocation (BLOG)
- length_age.wppl: Lengths and age of infants
- librarian_or_farmer.wppl: Librarian or farmer (Cam Davidson-Pilon11)
- light_bulbs.wppl: Two light bulbs
- linear_regression2.wppl: Linear regression
- lions_tigers_and_bears.wppl: Lions, Tigers, and Bears problem (Allen Downey)
- lions_tigers_and_bears2.wppl: Lions, Tigers, and Bears problem, alternative approach (Allen Downey)
- lions_tigers_and_bears3.wppl: Lions, Tigers, and Bears problem, alternative approach (Allen Downey)
- loaded_coin.wppl: Loaded coin (Martin)
- locomotive_problem.wppl: Locomotive problem (Mosterller via Allen Downey)
- logistic_regression.wppl: Logistic regression Challenger data
- logistic_regression_challenger.wppl: Logistic regression Challenger data (JAGS)
- lottery.wppl: Lottery (Mathematica)
- lotto_not_two_consecutive_numbers.wppl: Lotto: not two consecutive numbers
- lucky_candy.wppl: Lucky candy (optimizing the number of godd/bad candies in one of two boxes) (Brain Stellar)
- m_and_m_problem.wppl: M & M problem (Allen Downey)
- machine_working.wppl: Machine working (DC-ProbLog)
- machine_working_gaussian.wppl: Machine working, Gaussian (DC-ProbLog)
- machine_working_gaussian2.wppl: Machine working, Gaussian (DC-ProbLog)
- mailing.wppl: Mailing (Statistics101/Resample Stats)
- medical_diagnosis.wppl: Medican diagnosis (cplint)
- medical_test.wppl: Medical test
- mean_and_stdev_for_10_flips_of_a_fair_coin.wppl: Mean and stdev for 10 flips of a fair coin (Statistics101/Resample Stats)
- mean_of_uniform.wppl: Mean of Uniform
- meeting_problem.wppl: Meeting problem
- meeting_under_the_clock.wppl: Meeting under the clock (Julian Simon)
- meeting_under_the_clock2.wppl: Meeting under the clock, variant (Julian Simon)
- mixture_of_gaussian.wppl: Mixture of Gaussian (BLOG)
- mixture_of_gaussian2.wppl: Mixture of Gaussian (BLOG)
- mixture_of_gaussian_infinite.wppl: Mixture of Gaussian (BLOG)
- monty_hall.wppl: Monty Hall problem
- monty_hall_problem.wppl: Monty Hall problem (Statistics101/Resample Stats)
- monty_hall_test.wppl: Monty Hall problem and some tests
- mr_shearers_class.wppl: Mr Shearer's class (Minverva)
- multinomial_balls.wppl: Multinomial balls (Mathematica)
- multinomial_callcenter.wppl: Multinomial callcenter (Mathematica)
- multinomial_voting.wppl: Multinomial voting (Wikipedia)
- multinomial_voting2.wppl: Multinomial voting (Mathematica)
- murder_mystery.wppl: Murder Mystery (Andy Gordon)
- murphys_knots.wppl: Murphy's Knots (Random walk in different dimensions) (Robert Matthews)
- murphys_law_of_queues.wppl: Murphy's Law of Queues (Robert Matthews)
- my_neighbour.wppl: My neighbour (looking out of our windows)
- native_fish.wppl: Native Fish model
- negative_binomial_basketball.wppl: Negative Binomial basketball (Mathematica)
- negative_binomial_basketball2.wppl: Negative Binomial basketball (Mathematica)
- negative_binomial_coins.wppl: Negative Binomial coins (Mathematica)
- negative_binomial_coins2.wppl: Negative Binomial coins (Mathematica)
- negative_binomial_selling_candies.wppl: Negative Binomial selling candies
- negative_binomial_test.wppl: Negative Binomial test
- newton_pepys_problem.wppl: Newton-Pepys problem
- nine_spades_four_clubs.wppl: Nine spades and four clubs (Resampling Stats)
- no_birthdays.wppl: No birthdays (Paulos)
- noisyOr.wppl: Noisy OR (PSI, Dice)
- number_guessing_game.wppl: Number guessing game (Church model via BLOG model)
- number_lock.wppl: Number lock problem (Presh Talwalkar, MindYourDecisions)
- number_lock2.wppl: Number lock problem, alternative approach (Presh Talwalkar, MindYourDecisions)
- number_of_walks_until_no_shoes.wppl: Number of walks until no shoes (Blom, Holst, Sandell)
- oil_rig.wppl: Oil Rig problem (BayesiaLab)
- one_ace.wppl: One Ace problem (Statistics101/Resample Stats)
- one_spade_or_one_club.wppl: One spade or one club (Statistics101/Resample Stats)
- OneRM.wppl: One RM calculation
- orchs.wppl: Orchs (Church)
- one_rigged_coin.wppl: One rigged coin (Litt)
- path.wppl: Path problem (cplint)
- pennies.wppl: Pennies (ruin) problem (Statistics101/Resample Stats)
- penneys_game.wppl: Penney's Game (some experiments)
- pepperoni_pizza.wppl: Pepperoni pizza problem (Statistics101/Resample Stats)
- person_login.wppl: Login model (BLOG)
- pesticides.wppl: Pesticides (Statistics101/Resampling Stats)
- pi.wppl: Simulation of Pi
- piecewise_transformation.wppl: Piecewise transformation (SPPL)
- pig_food.wppl: Pig food (Statistics101/Resample Stats)
- pill_puzzle.wppl: Pill puzzle
- piranha_puzzle.wppl: Piranha puzzle
- placebo_and_drugs.wppl: Placebo and drugs (Shasha and Wilson)
- political_survey.wppl: Political survey (Statistics101/Resample Stats)
- poisson_ball.wppl: Urn ball model (BLOG)
- poker.wppl: Poker hand calculations
- probabilistic_graphs.wppl: Probabilistic graphs (ProbLog)
- probability_of_missing_values.wppl: Probability of missing values
- profits.wppl: Profits (Statistics101/Resample Stats)
- quake_probability.wppl: Quake probability (Statistics101/Resample Stats)
- quantiles_closed_form.wppl: Tests of some of the closed form quantiles from the distributions package (see above)
- quantile_test.wppl: Tests of the
quantile/quantiles
functions
- queens.wppl: N-queens problem
- queens2.wppl: N-queens problem (using swap for ensuring permutations)
- random_permutation.wppl: Random permutation (using swap)
- random_walk_1.wppl: Classical Random Walk 1 (Blom, Holst, Sandell)
- rat_tumor.wppl: Rat tumor (BDA3, PyMC)
- regression_fallacy.wppl: Regression fallacy (Gelman et.al.)
- relative_survival_rate.wppl: Relative survival rate (Mathematica)
- robot_localization.wppl: Robot localization (SPPL)
- rolling_dice3.wppl: Rolling dice problem (ProbLog)
- rolling_dice4.wppl: Rolling dice problem (ProbLog)
- rolling_dice4_2.wppl: Rolling dice problem, alternative approach (ProbLog)
- rolling_dice5.wppl: Rolling dice problem (ProbLog)
- rolling_multiple_dice_and_picking_the_highest.wppl: Rolling multiple dice and picking the highest (Matt Parker)
- rolling_the_bullet.wppl: Rolling the bullet (Brain Stellar)
- rope_length.wppl: Rope length (Dirichlet distribution)
- ruin_problem.wppl: Ruin problem
- ruin_problem2.wppl: Ruin problem, alternative approach
- run_until_blue_ball.wppl: Draw balls until a blue ball is drawn
- russian_roulette.wppl: Russian roulette
- same_rank.wppl: Same rank (Blom, Holst, Sandell)
- sequence_waiting_times_1.wppl: Coin flipping sequence waiting times, part I) (Blom, Holst, Sandell)
- sequence_waiting_times_2.wppl: Coin flipping sequence waiting times between patterns, part 2) (Blom, Holst, Sandell)
- shuffle_test.wppl: Test of the
shuffle
function
- simple_aircraft.wppl: Simple Aircraft Blip model (BLOG)
- simple_mixture_model.wppl: Simple mixture model (SPPL)
- simpson.wppl: Simpson's paradox (Pearl, cplint)
- sixty_boys_out_of_next_100_births.wppl: Sixty boys out of next 100 births (Statistics101/Resampling Stats)
- size_of_group_of_people.wppl: Size of group of people (DC-ProbLog)
- size_of_material.wppl: Size of material (DC-ProbLog)
- smokers.wppl: Smokers problem (ProbLog)
- smoking_figaro.wppl: Smoking problem (Figaro)
- spread_of_traits.wppl: Spread of traits
- sprinkler.wppl: Sprinkler problem
- squid_game.wppl: Squid game (PSI)
- stochastic_volatility.wppl: Stochastic Volatility (BLOG)
- student_interviews.wppl: Student interviews (SPPL)
- student_mood_after_exam.wppl: Student's mood after exam (Katoen)
- sultans_children.wppl: Sultan's Children ()
- sultans_dowry.wppl: Sultan's Dowry (checking percentages)
- sultans_dowry2.wppl: Sultan's Dowry (optimal strategy)
- surfing_the_web.wppl: Surfing the web (Wolfram)
- survey_result_unbias.wppl: Survey result unbias (R2)
- taxi.wppl: Taxi problem (lpmln)
- test1.wppl: Test of mean in a distribution (just testing)
- testing_of_proportionality.wppl: Testing of proportionality
- the_car_and_the_goats.wppl: The Car and the Goats (generalized Monty Hall problem) (Blom, Holst, Sandel)
- the_generous_king.wppl: The Generous King(Blom, Holst, Sandel)
- thermostat.wppl: Thermostat problem (OMEGA/Julia)
- three_men_with_hats.wppl: Three men with hats (Ross)
- three_urns.wppl: Three urns problem (Stuhlmuller)
- three_urns2.wppl: Three urns problem (Stuhlmuller, Church)
- three_way_election.wppl: Three way election (Statistics101/Resample Stats)
- tourist_with_a_short_memory.wppl: Tourist with a short memory (visiting 4 cities) (Blom, Holst, Sandell)
- trip.wppl: Trip model (ProbLog)
- true_skill.wppl: Simplified True Skill model (Borgstrom et.al)
- true_skill_simple.wppl: True Skill simple (R2)
- trueskill_poisson_binomial.wppl: Trueskill poisson binomial (SPPL)
- tug_of_war.wppl: Tug of war (Hakaru)
- tugwar1.wppl: Tug of war (BLOG)
- tugwar2.wppl: Tug of war (BLOG)
- two_aces.wppl: Probability of two aces (Statistics101/Resampling Stats)
- two_children_problem.wppl: Two children problem
- two_coins.wppl: Two coins (R2)
- two_dice_wager.wppl: Two dice wager
- two_heads_in_three_coin_tosses.wppl: Two heads in three coin tosses (Statistics101/Resample Stats)
- two_coins.wppl: Two dimensional mixture model (SPPL)
- unfair_coin.wppl: Unfair coin
- uniform_ball.wppl: Ball in urn problem (BLOG)
- unknown_vending_machine.wppl: Unknown vending machine (PSI)
- urn_ball.wppl: Urn Ball problem (BLOG)
- urn_model_generalized.wppl: Urn model (generalized)
- urn_model1.wppl: Urn model (Wolfram)
- urn_puzzle.wppl: Urn puzzle
- urn_puzzle2.wppl: Urn puzzle (Litt)
- urns_and_balls.wppl: Urns and balls problem (cplint)
- urn_large_balls.wppl: Urns large balls (BLOG)
- valves.wppl: Valves model (BayesiaLab)
- weather_figaro.wppl: Weather greetings (Figaro)
- viral_marketing.wppl: Viral Marketing (cplint)
- where_is_my_bag.wppl: Where is my Bag problem (Judea Pearl, BayesiaLab)
- wppl.wppl: Weight scale (Pyro)
- who_killed_the_bosmer.wppl: Who killed the Bosmer? (logic puzzle)
Distributions
Here are some "decompositions" of methods to generate different distributions (i.e. simple implementation often using the quantile/indidrect method). Many of these are collected in the package node_modules/hakank_utils/distributions.wppl (see a full list above). Note that these are in general not as stable/fast/good as the built-in distribution; for example some of these decompositions are not good for recovering parameters.
Back to my homepage
Created by Hakan Kjellerstrand (hakank@gmail.com)