10. (B) Program for Bernoulli distribution
| ||
N=sum(obsfre); | ||
xbar=sum(x*obsfre')/N; | ||
p=xbar/n; | ||
q=1-p; | ||
for r=0:n | ||
prob(r+1)=p^r*q^(n-r); | ||
end | ||
expfre=round(prob*N); | ||
printf('expected frequencies\n'); | ||
printf('------------------------------\n'); | ||
return(expfre); | ||
endfunction | ||
x=[0,1]; | ||
obsfre=[12,25]; | ||
bernfit(x,obsfre) | ||
10. (B) Program for Bernoulli distribution
Reviewed by admin
on
December 24, 2019
Rating:
![10. (B) Program for Bernoulli distribution](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX0wscVDWpcXcmjf1FgZEM9pO0MxkFSTpXnxM4sjqXqhDP-qLRs9BxjLMfiTQy6KWOyppL_I2SEeAZQ6UCs46VldNP8qqibUPG8gMlnX2GMWE3W7Q_jdjokzM2u2CfcuquCQBVx2UeBVo/s72-c/Imperative+Programming+Bscit+mumbai+university.png)
No comments: