# Probability Density Function, Integration, Area under Curve, Continuous Random Variable (Migrated from community.research.microsoft.com) • ### Question

• freddycct posted on 08-11-2009 12:44 AM

Hi,

So I define a Beta Distribution in this way.

Variable<double> f = Variable.Beta(a, b);

which mathematically means

p(f) = ((a+b - 1) ! / (a-1)!) * (b-1)! * f ^(a-1) * (1-f)^(b-1)

My question is, how do i obtain the value for P( c < f < d ) ?

What I really need is an integration function of the beta density function.

Friday, June 3, 2011 5:12 PM

• minka replied on 08-11-2009 3:56 AM

You can compute this value using the incomplete Beta function.  Infer.NET does not have this function, but it is included in matlab as function "betainc".  A Bing search turns up lots of code for it around the web.  If there is interest, we could add this function to Infer.NET.  Infer.NET already has ConstrainBetween so you could just constrain f to be between c and d and this could (in the future) automatically call the incomplete Beta function.

Friday, June 3, 2011 5:12 PM

### All replies

• minka replied on 08-11-2009 3:56 AM

You can compute this value using the incomplete Beta function.  Infer.NET does not have this function, but it is included in matlab as function "betainc".  A Bing search turns up lots of code for it around the web.  If there is interest, we could add this function to Infer.NET.  Infer.NET already has ConstrainBetween so you could just constrain f to be between c and d and this could (in the future) automatically call the incomplete Beta function.

Friday, June 3, 2011 5:12 PM
• Infer.NET 2.6 now includes the incomplete Beta function.
Saturday, November 29, 2014 6:05 PM