src/estimagic/examples/logit.py
def logit_hessian(params, y, x):
    """Hessian matrix of the log-likelihood.

    Args:
        params (pd.DataFrame): The index consists of the parmater names,
            the "value" column are the parameter values.
        y (np.array): 1d numpy array with the dependent variable
        x (np.array): 2d numpy array with the independent variables

    Returns:
        hessian (np.array) : 2d numpy array with the hessian of the
            logl-ikelihood function evaluated at `params`

    """
    c = 1 / (1 + np.exp(-(np.dot(x, params["value"]))))
    return -np.dot(c * (1 - c) * x.T, x)
Hessian matrix of the log-likelihood.

    Args:
        params (pd.DataFrame): The index consists of the parmater names,
            the "value" column are the parameter values.
        y (np.array): 1d numpy array with the dependent variable
        x (np.array): 2d numpy array with the independent variables

    Returns:
        hessian (np.array) : 2d numpy array with the hessian of the
            logl-ikelihood function evaluated at `params`

    
Hessian matrix of the log-likelihood.
Hessian matrix of the log - likelihood .
def logit_hessian(params, y, x):
    c = 1 / (1 + np.exp(-(np.dot(x, params["value"]))))
    return -np.dot(c * (1 - c) * x.T, x)
def logit_hessian ( params , y , x ) : c = 1 / ( 1 + np . exp ( - ( np . dot ( x , params [ "value" ] ) ) ) ) return - np . dot ( c * ( 1 - c ) * x . T , x )
Hessian matrix of the log-likelihood.
Hessian matrix of the log - likelihood .
"""Hessian matrix of the log-likelihood.

    Args:
        params (pd.DataFrame): The index consists of the parmater names,
            the "value" column are the parameter values.
        y (np.array): 1d numpy array with the dependent variable
        x (np.array): 2d numpy array with the independent variables

    Returns:
        hessian (np.array) : 2d numpy array with the hessian of the
            logl-ikelihood function evaluated at `params`

    """
hessian (np.array) : 2d numpy array with the hessian of the
logl-ikelihood function evaluated at `params`
hessian ( np . array ) : 2d numpy array with the hessian of the logl - ikelihood function evaluated at ` params `
params
The index consists of the parmater names,
the "value" column are the parameter values.
The index consists of the parmater names the " value " column are the parameter values .
y
1d numpy array with the dependent variable
1d numpy array with the dependent variable
x
2d numpy array with the independent variables
2d numpy array with the independent variables