Noninteger binomial coefficients

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

miranda
Posts: 4
Joined: Thu Nov 25, 2010 6:28 am

Noninteger binomial coefficients

Postby miranda » Wed Dec 01, 2010 2:06 am

how can i calculate the value of C(5,0.5)? @binom function expects integer values for both n and k.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Noninteger binomial coefficients

Postby trubador » Wed Dec 01, 2010 2:41 am

The following piece of code uses the generalized version of the computation of binomial coefficents and should do the trick for you:

Code: Select all

call gbinom(5,0.5) subroutine gbinom(scalar n,scalar k) scalar gbcoef = @exp(@gammalog(n+1)-@gammalog(k+1)-@gammalog(n-k+1)) endsub

miranda
Posts: 4
Joined: Thu Nov 25, 2010 6:28 am

Re: Noninteger binomial coefficients

Postby miranda » Thu Dec 02, 2010 4:53 am

great, thanks!!


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests