mixobjective: Compute objective optimized by mixsqp.

mixobjectiveR Documentation

Compute objective optimized by mixsqp.

Description

See mixsqp for a full description of the objective function optimized by the mix-SQP algorithm.

Usage

mixobjective(L, x, w = rep(1, nrow(L)))

Arguments

L

Matrix specifying the optimization problem to be solved. In the context of mixture-model fitting, L[j,k] should be the value of the kth mixture component density at the jth data point. L should be a numeric matrix with at least two columns, with all entries being non-negative and finite (and not missing). Further, no column should be entirely zeros. For large matrices, it is preferrable that the matrix is stored in double-precision; see storage.mode.

x

The point at which the objective is evaluated in mixobjective; see argument x0 in mixsqp for details.

w

An optional numeric vector, with one entry for each row of L, specifying the "weights" associated with the rows of L. All weights must be finite, non-negative and not missing. Internally, the weights are normalized to sum to 1, which does not change the problem, but does change the value of the objective function reported. By default, all weights are equal.

Value

The value of the objective at x. If any entry of L %*% x is less than or equal to zero, Inf is returned.

See Also

mixsqp


stephenslab/mixsqp documentation built on Jan. 4, 2024, 1 a.m.