get_data_singular: Simulate Data from Eigenvalue Structure

Description Usage Arguments Value Examples

View source: R/sim_data_singular.R

Description

The function returns either the results of penalized profile log-likelihood given a matrix of data or a vector of sample eigenvalues. The data matrix has the following decomposition X = WL + error, where the rows of X are linear projections onto the subspace W by some arbitrary latent vector plus error. The solution finds the rank of W, which represents the hidden structure in the data, such that X-WL have independent and identically distributed components.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
get_data_singular(
  N,
  K,
  M,
  sq_singular = NULL,
  sigma2 = NULL,
  last = NULL,
  trend = NULL,
  rho = NULL,
  df = NULL,
  dist = "norm",
  datamat = FALSE
)

Arguments

N

the full dimension of the data

K

the true dimension of the

M

the number of features of observations

sq_singular

a vector of numeric values for the squared singular values. The other parameters can be skipped if this is supplied along with N, K, M.

sigma2

a positive numeric between 0 and 1 for the error variance.

last

a positive numeric within reasonable range for the difference between the Kth eigenvalue and the (K+1)th, a very large difference might not be possible if K is large.

trend

a character, one of equal, exponential, linear and quadratic for the type of trend in squared singular values

rho

a numeric value between 0 and 1 for the amount of auto-correlation, i.e. correlation between sequential observations or features.

df

an integer for the degrees of freedom if dist == t

dist

a character specifying the error distribution to be one of norm, t, for normal and student's t-distribution, respectively.

datamat

a logical to indicate whether both the data matrix and sample eigenvalues or only the sample eigenvalues should be returned

Value

a list containing the simulated data matrix and sample eigenvalues or a numerical vector of sample eigenvalues.

Examples

1
2
3
4
5
6
7
## Not run: 
get_data_singular(N = 200, K = 5, M = 1000, sq_singular = c(5,4,2,1,1))
get_data_singular(N = 200, K = 5, M = 1000, sigma2 = 0.2, last= 0.1, trend = "exponential")
get_data_singular(N = 200, K = 5, M = 1000, sigma2 = 0.8, last= 0.1, trend = "exponential",
   rho = 0.2, df = 5, dist = "t")

## End(Not run)

WeiAkaneDeng/SPAC2 documentation built on Jan. 15, 2022, 5:01 a.m.