{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _lsq / common / build_quadratic_1d

function

scipy.optimize._lsq.common:build_quadratic_1d

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

Signature

def   build_quadratic_1d ( J g s diag = None s0 = None )

Summary

Parameterize a multivariate quadratic function along a line.

Extended Summary

The resulting univariate quadratic function is given as follows

f(t) = 0.5 * (s0 + s*t).T * (J.T*J + diag) * (s0 + s*t) +
       g.T * (s0 + s*t)

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 (n,)

Direction vector of a line.

diag : None or ndarray with shape (n,), optional

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

s0 : None or ndarray with shape (n,), optional

Initial point. If None, assumed to be 0.

Returns

a : float

Coefficient for t**2.

b : float

Coefficient for t.

c : float

Free term. Returned only if s0 is provided.

Aliases

  • scipy.optimize._lsq.common.build_quadratic_1d