Raul, thank you for your interest! I don't quite understand what you are doing.
If a variable only assumes the values 0 and 1, then the mean value of that variable is the same thing as the probability that it is =1. Otherwise there is no mixing between probabilities and mean values. Some examples. 1 1 deduce 1 0.5 0.5 0.5 0.5 You have one white and one black pebble in an urn, and randomly pick one pebble out of the urn. The number of white pebbles picked is 0.5 plusminus 0.5. That is, the mean number of white pebbles picked is 0.5, and the standard deviation is 0.5. The number of black pebbles picked is also 0.5 plusminus 0.5. 1 1 predict 1 0.5 0.5 0.5 0.5 You have randomly picked one white and one black pebble out of an urn, and are ready to pick yet one more pebble out of the urn. The number of white pebbles picked will be 0.5 plusminus 0.5. The number of black pebbles picked will be 0.5 plusminus 0.5. (0, 365.25*2012-30) predict 1 1.38135e_6 0.999999 0.00117531 0.00117531 Christ will return some day, but till now he didn't. It is then 99.9999% certain that he won't return tomorroweither. (0, 365.25*2012-30) predict 365.25e6 504.539 3.65249e8 505.039 505.039 But in the next million years he will return 505 times, give or take 505 times. The mathematics behind the deduce formula is that the mean number of white pebbles in the sample is N%~K*n where N is the total number of pebbles in the urn, K is the number of white pebbles in the urn, and n is the number of pebbles in the sample. This expression can also be written (%N)%~(K%N)*(n%N) . The variance-to-mean ratio is (1-%N)%~(1-K%N)*(1-n%N) . This is the clue to the expression deduce =:%~`*/"2@(,:(%:@*-.))@(+/@[%~1,,:) where N=:K(+/@[)n Now K is the list of numbers of pebbles in the different colors, white, black and so on. The prediction formula predict=:(deduce~-@>:)~ is simple, but the proof is not trivial. - Bo >________________________________ > Fra: Raul Miller <rauldmil...@gmail.com> >Til: programm...@jsoftware.com >Sendt: 22:40 fredag den 21. december 2012 >Emne: Re: [Jprogramming] Deduction, Induction, and Prediction. > >I am not completely sure I follow the math here, so I threw together a >crude symbolic version (which builds expressions rather than computes >results). > > >paren=: ('(', ], ')'"_)^:(1 ~: #@;:) >ident=:2 :0 >: > if. n -: x do. y > elseif. n -: y do. x > elseif. 1 do. x u y > end. >) >zero=:2 :0 >: > if. n -: x do. n > elseif. n -: y do. n > elseif. 1 do. x u y > end. >) >rident=:2 :0 >: > if. n -: y do. x > else. x u y > end. >) > >add=: (paren@[, '+', ])&": ident 0 &.> >sub=: (paren@[, '-', ])&": rident 0 &.> >mul=: (paren@[, '*', ])&": ident 1 zero 0 &.> >div=: (paren@[, '%', ])&": rident 1 &.> >sqrt=: '%:'&,&":&.> > > >deduce =: *`%/"2@(,:(%:@*-.))@((,:,1:)%+/@[) >predict=: (deduce~-@>:)~ >induce =: (,:0:)+[predict(-+/)~ > >deduce =: mul`div/"2@(,:(sqrt@mul 1&sub))@((,:,(<1)"_)div add/@[)&(add&0) >predict=: (deduce~ 0&sub@(1&add))~ >induce =: (,:(<0)"_)&(0&add)add[predict(sub add/)~ > >a =: 20 5 0 > >(I'm doing crude stuff like adding 0 to normalize argument formats, >and using 0-x to represent negation.) > >Anyways, I'm still not completely comfortable with this >representation. I think I am uncomfortable with the way that >probabilities get mixed in with expected values, but I'm not >completely sure. Mostly, I think it's that I do not have the time to >really think this through. > >Still, maybe this is of use to someone else... > >-- >Raul >---------------------------------------------------------------------- >For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm