src/estimagic/optimization/pounders_auxiliary.py
def _evaluate_main_model(
    x,
    linear_terms,
    square_terms,
):
    """Evaluate the criterion and derivative of the main model.

    Args:
        x (np.ndarray): Parameter vector of zeros.
        linear_terms (np.ndarray): Linear terms of the main model of shape (n,).
        square_terms (np.ndarray): Square terms of the main model of shape (n, n).

    Returns:
        Tuple:
        - criterion (float): Criterion value of the main model.
        - derivative (np.ndarray): Derivative of the main model of shape (n,).
    """
    criterion = np.dot(linear_terms, x) + 0.5 * np.dot(np.dot(x, square_terms), x)
    derivative = linear_terms + np.dot(square_terms, x)

    return criterion, derivative
Evaluate the criterion and derivative of the main model.

    Args:
        x (np.ndarray): Parameter vector of zeros.
        linear_terms (np.ndarray): Linear terms of the main model of shape (n,).
        square_terms (np.ndarray): Square terms of the main model of shape (n, n).

    Returns:
        Tuple:
        - criterion (float): Criterion value of the main model.
        - derivative (np.ndarray): Derivative of the main model of shape (n,).
    
Evaluate the criterion and derivative of the main model.
Evaluate the criterion and derivative of the main model .
def _evaluate_main_model(
    x,
    linear_terms,
    square_terms,
):
    criterion = np.dot(linear_terms, x) + 0.5 * np.dot(np.dot(x, square_terms), x)
    derivative = linear_terms + np.dot(square_terms, x)
    return criterion, derivative
def _evaluate_main_model ( x , linear_terms , square_terms , ) : criterion = np . dot ( linear_terms , x ) + 0.5 * np . dot ( np . dot ( x , square_terms ) , x ) derivative = linear_terms + np . dot ( square_terms , x ) return criterion , derivative
Evaluate the criterion and derivative of the main model.
Evaluate the criterion and derivative of the main model .
"""Evaluate the criterion and derivative of the main model.

    Args:
        x (np.ndarray): Parameter vector of zeros.
        linear_terms (np.ndarray): Linear terms of the main model of shape (n,).
        square_terms (np.ndarray): Square terms of the main model of shape (n, n).

    Returns:
        Tuple:
        - criterion (float): Criterion value of the main model.
        - derivative (np.ndarray): Derivative of the main model of shape (n,).
    """
criterion (float): Criterion value of the main model.
derivative (np.ndarray): Derivative of the main model of shape (n,).
criterion ( float ) : Criterion value of the main model . derivative ( np . ndarray ) : Derivative of the main model of shape ( n ) .
Tuple
x
Parameter vector of zeros.
Parameter vector of zeros .
linear_terms
Linear terms of the main model of shape (n,).
Linear terms of the main model of shape ( n ) .
square_terms
Square terms of the main model of shape (n, n).
Square terms of the main model of shape ( n n ) .