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:
No comments: