gendata_rmfm: Generate simulated data

View source: R/gendata_rmfm.R

gendata_rmfmR Documentation

Generate simulated data

Description

Generate simulated data from robust matrix factor models

Usage

gendata_rmfm(
  Tt = 100,
  p1 = 50,
  p2 = 40,
  r1 = 4,
  r2 = 3,
  rho = 0.01,
  type = c("MatrixT", "MatrixN"),
  nu = 1
)

Arguments

Tt

a positive integer, specify the sample size.

p1

a positive integer, specify the row dimension of the observed matrix.

p2

a positive integer, specify the column dimension of the observed matrix.

r1

a positive integer, specify the number of row factors; default as 4

r2

a positive integer, specify the number of column factors; default as 3.

rho

a positive real, specify the signal strength of factor matrices.

type

a string, specify the type of error matrix, default as type='MatrixN'; supportint matrix t distribution 'MatrixT' and matrix normal distribution 'MatrixN'.

nu

a positive integer, specify the degree freedom of the matrix t distribution when type='MatrixT'.

Value

return a list including the following components:

  • X - p1* p2*T array, which is the observed matrix from each individual, where T is the sample size.

  • CC - p1* p2*T array, which is the common component matrix for each individual.

  • F0 - r1* r2*T array, which is the generated factor matrix for each individual, where T is the sample size.

  • R0 - a p1-by-r1 matrix, the row loading matrix.

  • C0 - a p2-by-r2 matrix, the column loading matrix.

  • mu0 - a p1-by-p2 matrix, the mean matrix.

Examples

r1 <- 4; r2 <- 3;
Tt <- 100; type <- 'MatrixT'
p1 <- 100; p2 <- 50
datlist <- gendata_rmfm(Tt = Tt,p1 =p1, p2=p2, r1=r1, r2=r2,
                         rho=0.01, type=type, nu=1)
str(datlist)

RMFM documentation built on April 3, 2025, 6:22 p.m.

Related to gendata_rmfm in RMFM...