def objective(param_scales=(<NUM_LIT:1>, <NUM_LIT:1>), xstar=None, seed=None):
ndim = len(param_scales)<EOL>def decorator(func):<EOL><INDENT>@wraps(func)<EOL>def wrapper(theta):<EOL><INDENT>return func(theta)<EOL><DEDENT>def param_init():<EOL><INDENT>np.random.seed(seed)<EOL>return np.random.randn(ndim,) * np.array(param_scales)<EOL><DEDENT>wrapper.ndim = ndim<EOL>wrapper.param_init = param_init<EOL>wrapper.xstar = xstar<EOL>return wrapper<EOL><DEDENT>return decorator<EOL>
Gives objective functions a number of dimensions and parameter range

    Parameters
    ----------
    param_scales : (int, int)
        Scale (std. dev.) for choosing each parameter

    xstar : array_like
        Optimal parameters