weblogolib.logomath

Package weblogolib :: Module logomath |

# Module logomath

source code

Classes
| Dirichlet The Dirichlet probability distribution.
| Gamma The gamma probability distribution.

Functions
find_root(f, x, y=None, fprime=None, tolerance=1.48e-8, max_iterations=50) Return argument 'x' of the function f(x), such that f(x)=0 to within the given tolerance. | source code

Function Details

### find_root(f, x, y=None, fprime=None, tolerance=1.48e-8, max_iterations=50) | source code
    Return argument 'x' of the function f(x), such that f(x)=0 to
    within the given tolerance.

    f : The function to optimize, f(x)
    x : The initial guess
    y : An optional second guess that shoudl bracket the root.
    fprime : The derivate of f'(x) (Optional)
    tolerance : The error bounds
    max_iterations : Maximum number of iterations

    Raises:
        ArithmeticError :
            Failure to converge to the given tolerence

    Notes:
        Uses Newton-Raphson algorihtm if f'(x) is given, else uses bisect if
        y is given and brackets the root, else uses secant.

    Status : Beta (Not fully tested)