Beta function
From Script | Spoken-Tutorial
The beta function is defined by:
<math>\Beta(m,n)=\int_0^1 x^{m-1}(1-x)^{n-1}dx</math>
in scilab beta(m,n) evaluates the beta function at all the elements of m and n.
e.g.
-->beta(2,5) ans = 0.0333333
For the beta function
<math>\Beta(m,n)=\Beta(n,m)</math>
e.g.
-->beta(2,5) ans = 0.0333333 -->beta(5,2) ans = 0.0333333
Also
<math>\Beta(m,n)=\frac{\Gamma(m)\Gamma(n)}{\Gamma(m+n)}</math>
which is a relation between beta and gamma function and can be verify by using the example given below:
e.g. Recall
-->beta(2,5) ans = 0.0333333
and
-->gamma(2) ans = 1. -->gamma(5) ans = 24. -->gamma(7) ans = 720.
-->1*24/720 ans = 0.0333333
that is
<math>\Beta(2,5)=\frac{\Gamma(2)\Gamma(5)}{\Gamma(2+5)}</math>
also,
-->beta(1/2,1/2) ans = 3.1415927
and
-->(gamma(1/2)*gamma(1/2))/gamma(1) ans = 3.1415927