public
Created

answer to Get Used To It

  • Download Gist
fourpercent.pl
Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
prob(spx(bear), 0.308).
prob(spx(bull), 0.692).
prob(spx(down_four), 0.00242).
conprob(spx(bear) ^ spx(down_four), 0.757).
conprob(spx(bull) ^ spx(down_four), 0.243).
isprob(A,P) :-
prob(A,P), !.
isprob(A^B, P) :-
conprob(A^B, P), !.
isprob(A^B, P) :-
conprob(B^A, PBA),
isprob(A, PA),
isprob(B, PB),
P is PBA * PA / PB.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.