DrawFreq {chickn} R Documentation

## Draw frequency vectors

### Description

Function samples frequency vectors from the selected frequency distribution law.

### Usage

DrawFreq(
m,
n,
sigma,
alpha = rep(1, length(sigma)),
TypeDist = "AR",
ncores = 1,
parallel = FALSE
)


### Arguments

 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.

### Details

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.

### Value

A matrix m x n, with frequency vectors in rows.

### Note

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..

### See Also

EstimSigma, GenerateFrequencies, Sketch

### Examples

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")


[Package chickn version 1.2.3 Index]