RandPro (version 0.1.0)

form_gauss_matrix: Form Gaussian Matrix

Description

In probability theory, Gaussian distribution is also called as normal distribution It is a continuous probability distribution used to represent real-valued random variables The elements in the random matrix are drawn from N(0,1/k), where k value calculated based on JL - Lemma.

Usage

form_gauss_matrix(n_rows, n_cols, JLT, eps = 0.1)

Arguments

n_rows

- number of rows in the sample

n_cols

- number of columns in the sample

JLT

- Boolean to set JL transform (TRUE or FALSE)

eps

- error tolerance level with default value 0.1

Value

Random Dense Matrix

Details

The function uses pnorm() function from stats package to generate random matrix with mean is zero and standard deviation is 1/sqrt(k), where k is the minimum number of dimension return from the find_dim_JL() function

References

[1] N.I.R. Ailon and B.Chazelle, "The Fast Johnson Lindenstrauss Transform and Approximate Nearest Neighbors(2009)"

Examples

Run this code
# NOT RUN {
# Load Library
library(RandPro)

# Without JLT
mat <- form_gauss_matrix(600,1000,FALSE)

# With JLT of eps = 0.5
mat <- form_gauss_matrix(300,100000,TRUE,0.5)

# With JLT of default eps value = 0.1
mat <- form_gauss_matrix(300,100000,TRUE)
# }

Run the code above in your browser using DataCamp Workspace