{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _lsq / common / evaluate_quadratic

function

scipy.optimize._lsq.common:evaluate_quadratic

source: /scipy/optimize/_lsq/common.py :325

Signature

def   evaluate_quadratic ( J g s diag = None )

Summary

Compute values of a quadratic function arising in least squares.

Extended Summary

The function is 0.5 * s.T * (J.T * J + diag) * s + g.T * s.

Parameters

J : ndarray, sparse array or LinearOperator, shape (m, n)

Jacobian matrix, affects the quadratic term.

g : ndarray, shape (n,)

Gradient, defines the linear term.

s : ndarray, shape (k, n) or (n,)

Array containing steps as rows.

diag : ndarray, shape (n,), optional

Addition diagonal part, affects the quadratic term. If None, assumed to be 0.

Returns

values : ndarray with shape (k,) or float

Values of the function. If s was 2-D, then ndarray is returned, otherwise, float is returned.

Aliases

  • scipy.optimize._lsq.common.evaluate_quadratic