DrawFreq {chickn} | R Documentation |
Function samples frequency vectors from the selected frequency distribution law.
DrawFreq( m, n, sigma, alpha = rep(1, length(sigma)), TypeDist = "AR", ncores = 1, parallel = FALSE )
m |
Number of frequency vectors. |
n |
Length of frequency vector. |
sigma |
Data variance, a scalar or a vector in the case of the Gaussian distribution mixture. |
alpha |
Variance weights. By default all are equal to 1. |
TypeDist |
Frequency distribution type. Possible values: "G" (Gaussian), "FG" (Folded Gaussian radial) or "AR" (Adapted radius). Default is "AR". |
ncores |
Number of cores. Multicore computation should be used only when the data is a mixture of Gaussian distributions. |
parallel |
logical parameter that defines whether to perform the parallel computations. Default is FALSE. |
The frequency vectors w_1, …, w_m are randomly sampled from
the predefined frequency distribution. The distribution law can be either
N(0, Σ^{-1}) (typeDist
= "G") or p_R \cdot \varphi \cdot Σ^{-\frac{1}{2}}
(typeDist
= c("FG", "AR")), where \varphi is a vector
uniformly distributed on the unit sphere, Σ is a diagonal matrix with the data variance sigma
on the diagonal
and where p_R is the radius density function.
For "FG" the radius distribution is N(0,1)^+ and for "AR"
p_R = C \cdot (R^2 + \frac{R^4}{4})^{0.5} \cdot \exp{(-0.5 \cdot R^2)}, where C is a normalization constant.
A matrix m x n, with frequency vectors in rows.
The implemented method of the frequency sampling has been proposed in Keriven N, Bourrier A, Gribonval R, PĂ©rez P (2018). “Sketching for large-scale learning of mixture models.” Information and Inference: A Journal of the IMA, 7(3), 447–508..
EstimSigma
, GenerateFrequencies
, Sketch
W1 = DrawFreq(m = 20, n = 10, sigma = 1e-3, TypeDist = "AR") W2 = DrawFreq(m = 20, n = 10, sigma = 1e-3, TypeDist = "FG") W3 = DrawFreq(m = 20, n = 10, sigma = 1e-3, TypeDist = "G")