compute_mixture_penalty: Penalty of mixture weights

Description Usage Arguments See Also Examples

View source: R/compute_mixture_penalty.R

Description

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

Usage

1
2
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

1
2
3
4
5
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

LICORS documentation built on May 1, 2019, 10:13 p.m.