rSparseWeightMatrix: Generate weight matrix

Description Usage Arguments Value Examples

View source: R/rSparseWeightMatrix.R

Description

Generate weight matrix

Usage

1
2
rSparseWeightMatrix(nb.samp, nb.arch, sparse.coeff = max(nb.samp,
  nb.arch)/(nb.samp * nb.arch))

Arguments

nb.samp

An integer that is the number of samples (number of rows).

nb.arch

An integer that is the number of archetypes (number of columns).

sparse.coeff

A numeric in [0,1] that control the sparsity by rows (the proportion of non-zero entries among all matrix entries).

Value

A matrix of weights (each row sums to one).

Examples

1
W <- rSparseWeightMatrix(nb.samp=10L, nb.arch=7L, sparse.coeff=0.5)

pneuvial/c3co documentation built on May 25, 2019, 10:21 a.m.