[Jprogramming] Bayesian Stats

Bo Jacoby bojacoby at yahoo.dk
Thu Nov 25 06:35:40 HKT 2010


Chito Jovellanos asked: Are there other examples anyone could point me to re J implementations of Bayesian stats?  

If you know the distribution of a population, then deduc computes the distribution of a sample. 

If you know the distribution of a sample, then induc computes the distribution of the population.

      deduc =. (* (% +/)) ([ ,: %:@*) *`%`:3@(-.@((,: , 1"_) % +/@]))
      T     =. -@(+#)
      induc =. (T&}:,}.)@(T~ deduc T)

If you pick 10 items from a population of 50 good and 50 bad items, then you get 5 plusminus 1.5 of each sort. 

   10 deduc 50 50
      5       5
1.50756 1.50756

If you pick the whole population, then the standard deviation is zero, of course. 

   10 deduc 5 5
5 5
0 0

If you pick 5 good and 5 bad items from a population of 100, then the population is expected to contain 50 plusminus 13 of each. 

   5 5 induc 100
     50      50
13.2868 13.2868

If you pick the whole population, then the standard deviation is zero, of course. 

   5 5 induc 10
5 5
0 0

If your sample is empty, but there may be 3 types of items in a population of 3 items, then the population contains 1 plusminus 1 of each type.

   0 0 0 induc 3
1 1 1
1 1 1

induc is Bayesian stats!

--- Den ons 24/11/10 skrev Chito Jovellanos <chito at forwardlook.com>:

> Fra: Chito Jovellanos <chito at forwardlook.com>
> Emne: [Jprogramming] Bayesian Stats
> Til: programming at jsoftware.com
> Dato: onsdag 24. november 2010 21.17
> Are there other examples anyone could
> point me to re J implementations of
> Bayesian stats?  In searching various forum posts,
> I've only seen one re
> coin tosses in http://www.jsoftware.com/jwiki/SeanOByrne   
> 
> 
>  
> 
> My problem domain is estimating the likelihood that a
> transaction will not
> be processed correctly (per some set of messaging
> attributes such as number
> of tags, degree of nesting/recursion, messaging standard
> used, etc)
> 
>  
> 
> Thanks in advance
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 




More information about the Programming mailing list