Input functionsΒΆ

One of the main features of uravu is making Bayesian data modelling for a user defined function as straight forward as scipy.optimize.curve_fit().

The input functions in uravu are currently designed to be as straightforward as possible. It should be a function, where the first argument is the abscissa and the other arguments are variables.

[1]:
def my_straight_line(x, m, c):
    """
    A straight line function.

    Args:
        x (array_like): Abscissa data.
        m (float): Gradient.
        c (float): Intercept.

    Returns:
        (array_like): Model
    """
    return x * m + c

Note that the function variables must each be a single float or int value. This is due to underlying mechanics of uravu limiting the use of array or variable-length arguments.

Additionally, the return of the function should only be the resulting model data, no other blob of information is accepted unfortunately.

In future, we will work on enabling the more flexible function definitions. If you have any ideas, please feel free to contribute.