Last chance! 50% off unlimited learning
Sale ends in
Penalty(X, ...)
Penalty
function construct a penalty matrix according to
the arguments passed by the user. Additional arguments are :
[object Object],.,[object Object],[object Object],[object Object]
If rho
is not specified, a default value is computed, function
of the data variance, the risk
and the size $n$ of the
sample. This default value is very conservative and leads to very
sparse graphs. As a matter of fact, the probability of
misclassification holds for the $p^2$ potential edges. Thus, a
correction can be applied by multiplying the risk by the expected
number of edges. For instance, when one expects as many edges as
nodes, a typical risk to apply is $0.05 /p^2 \times p = 0.05 \times p$.
If classes
is NULL
, a uniform penalty matrix is
returned. If a vector of classes belonging is specified, a classified
version of the penalty matrix is built that enforces an affiliation
structure, by penalizing more intra-class connections. The
multpliers
argument is a list with inter
, intra
and dust
that permits to adjust the penalty according to the
involved nodes' classes.
SimDataAffiliation
, Mplot
library(simone)
## Data set generation
p <- 100 # number of nodes
n <- 200 # sample size
proba.in <- 0.15
proba.out <- 0.005
alpha <- c(.3,.2,.5)
X <- SimDataAffiliation (p, n, proba.in, proba.out, alpha, proba.dust=0.2)
## Build a penalty matrix with an arbitrary base-value of rho and
## multiplier values that encourage affiliation structure
P <- Penalty(X$data, rho = 0.1, classes = X$cl.theo,
multipliers = list(intra=1,inter=1.5,dust=2))
par(mfrow=c(1,2))
Mplot(P, main="Penalty matrix")
Mplot(P, X$cl.theo, main="Ordered penalty matrix")
Run the code above in your browser using DataLab