Learn R Programming

LICORS (version 0.2.0)

compute_mixture_penalty: Penalty of mixture weights

Description

Computes the penalty \(\Omega(\mathbf{W})\) of the weight matrix (or vector) for a mixture model.

Usage

compute_mixture_penalty(weigh.matrix, type = c("entropy", "Lq", "lognorm", "MDL"), 
    q = 2, row.average = TRUE, base = 2)

Arguments

weigh.matrix

\(N \times K\) weight matrix

type

type of penalty: c("entropy", "1-Lq", "lognorm"). Default: "entropy"

q

exponent for \(L_q\) norm.

row.average

logical; if TRUE (default) then an average penalty over all rows will be returned (one single number); if FALSE a vector of length \(N\) will be returned.

base

logarithm base for the "entropy" penalty. Default: base = 2. Any other real number is allowed; if base = "num.states" then it will internally assign it base = ncol(weigh.matrix).

See Also

compute_LICORS_loglik compute_NEC

Examples

Run this code
# NOT RUN {
WW <- matrix(c(rexp(10, 1/10), runif(10), 1/10), ncol = 3, byrow = FALSE)
WW[1, 1] <- 0
WW <- normalize(WW)
compute_mixture_penalty(WW, row.average = FALSE)
compute_mixture_penalty(WW, row.average = TRUE)  # default: average penalty
# }

Run the code above in your browser using DataLab