R 第三节课

2016-09-06  本文已影响0人  太非

期中考试 9.27

生日概率
> pBirthday <- function(k)
+ 1 - exp(lfactorial(365)-lfactorial(365-k)-k*log(365))
> pBirthday(50)
The capture and recapture problem
極大似然估計
> Pn <-function(n) {
+ tmp <- choose (50,3)*choose(n-50,47)
+ tmp/choose(n,50)
+}
> plot(n, Pn(n),type='l')

Combinatorics

Conditional Probability

Bayes' theorem

P(A1|B)=$\frac{P(A1B)}{P(B)}$=$\frac{p(P(B|A1)P(A1))}{P(B|A1)P(A1)+P(B|A2)P(A2)}$

上一篇 下一篇

猜你喜欢

热点阅读