simSVD {rsvddpd}R Documentation

Simulate SVD and measure performances of various algorithms

Description

simSVD simulates various models for the errors in the data matrix, and summarize performance of a singular value decomposition algorithm under presence or absence of outlying data introduced through various outlying schemes, using Monte Carlo approach.

Usage

simSVD(
  trueSVD,
  svdfun,
  B = 100,
  seed = NULL,
  dist = "normal",
  tau = 0.95,
  outlier = FALSE,
  out_method = "element",
  out_value = 10,
  out_prop = 0.1,
  return_details = FALSE,
  ...
)

Arguments

trueSVD

list, containing three different named components.

  • d - a vector containing the singular values.

  • u - a matrix with left singular vectors, each column being a singular vector.

  • v - a matrix with right singular vectors, each column being a singular vector.

svdfun

function which takes a numeric matrix as first argument and returns singular value decomposition of it as a list, with three components d, u and v as indicated before.

B

numeric, denoting the number of Monte Carlo simulation.

seed

numeric, a seed value used for reproducibility.

dist

character string, denoting the distribution from which errors will be generated. It must be equal to one of the following: normal, cauchy, exp, logis, lognormal

tau

numeric, a value between 0 and 1, see details for more.

outlier

logical, if TRUE, simulates the situation by adding outliers.

out_method

character, the method to add outliers. Must be one of "element", "row" or "col". See AddOutlier for details.

out_value

numeric, the outlying observation. See AddOutlier for details.

out_prop

a numeric, between 0 and 1 denoting the proportion of contamination. See AddOutlier for details.

return_details

logical, whether to return detailed results for each Monte Carlo simulation. See value for details.

...

extra arguments to be passed to svdfun function.

Value

Based on whether return_details is TRUE or FALSE, returns a list with two or one components.

If return_details is FALSE, only Summary component of the larger list is returned.


[Package rsvddpd version 1.0.0 Index]