Post Reply 
PYTHON program not work
09-05-2021, 03:58 PM (This post was last modified: 09-05-2021 04:28 PM by Albert Chan.)
Post: #4
RE: PYTHON program not work
(09-05-2021 05:59 AM)robmio Wrote:  Hello, below is a program to calculate the incomplete regularized beta function ...

This answered another thread of yours, regarding log of incomplete beta

(08-23-2021 04:17 AM)robmio Wrote:  There remains the problem of the incomplete Beta function, which cannot be "transformed" into other functions (at least I think).

Code:
def log_beta(a, b, x=1):
    'return Log[Beta[x,a,b]], assumed a>0, b>0, 0<=x<=1'
    if x==0: return float('-inf')

    b0 = a * log(x) + b * log(1-x)
    if x*(a+b+2) < (a+1): return b0 + log(contfractbeta(a, b, x) / a)

    b1 = -lgamma(a+b) + lgamma(a) + lgamma(b)
    if x < 1: b1 += log1p(-exp(b0-b1) * contfractbeta(b, a, 1-x) / b)
    return b1
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PYTHON program not work - robmio - 09-05-2021, 05:59 AM
RE: PYTHON program not work - robmio - 09-05-2021, 08:54 AM
RE: PYTHON program not work - robmio - 09-05-2021, 11:06 AM
RE: PYTHON program not work - Albert Chan - 09-05-2021 03:58 PM
RE: PYTHON program not work - robmio - 09-05-2021, 04:54 PM



User(s) browsing this thread: 1 Guest(s)