LFM: Generate Laplace factor models

View source: R/LFM.R

LFMR Documentation

Generate Laplace factor models

Description

The function is to generate Laplace factor model data. The function supports various distribution types for generating the data, including: - 'truncated_laplace': Truncated Laplace distribution - 'log_laplace': Univariate Symmetric Log-Laplace distribution - 'Asymmetric Log_Laplace': Log-Laplace distribution - 'Skew-Laplace': Skew-Laplace distribution

Usage

LFM(n, p, m, distribution_type)

Arguments

n

An integer specifying the sample size.

p

An integer specifying the sample dimensionality or the number of variables.

m

An integer specifying the number of factors in the model.

distribution_type

A character string indicating the type of distribution to use for generating the data.

Value

A list containing the following elements:

data

A numeric matrix of the generated data.

A

A numeric matrix representing the factor loadings.

D

A numeric matrix representing the uniquenesses, which is a diagonal matrix.

Examples

library(MASS)
library(matrixcalc)
library(relliptical)
n <- 1000
p <- 10
m <- 5
sigma1 <- 1
sigma2 <- matrix(c(1,0.7,0.7,1), 2, 2)
distribution_type <- "truncated_laplace"
results <- LFM(n, p, m, distribution_type)
print(results)

LFM documentation built on April 16, 2025, 9:07 a.m.

Related to LFM in LFM...