LRsim: Low Rank Simulation

Description Usage Arguments Details Value Examples

View source: R/LRsim.R

Description

This function simulates a data set as a low-rank signal corrupted by Gaussian noise.

Usage

1
LRsim(n, p, k, SNR)

Arguments

n

integer, number of rows

p

integer, number of columns

k

integer, rank of the signal

SNR

numeric, signal to noise ratio

Details

A data set of size n*p and of rank k is simulated. More precisely, it is simulated as follows: A SVD is performed on a n*p matrix generated from a standard multivariate normal distribution. Then, the signal is computed using the first k singular vectors and singular values U_q D_q V_q'. The signal is scaled in such a way that the variance of each column is 1 and then a Gaussian noise with variance sigma^2 is added. The SNR is calculated as 1/ sigma sqrt(np).

Value

X the simulated data

mu the true signal

sigma the standard deviation of the noise added to the signal

Examples

1
Xsim= LRsim(100, 30, 2, 2)

julierennes/denoiseR documentation built on July 29, 2019, 3:38 a.m.