Learn R Programming

convergenceDFM (version 0.1.4)

diagnose_data: Diagnose and prepare data matrices

Description

Performs data validation, missing value imputation, and variance checks on input matrices to prepare them for factor analysis. Handles dimension compatibility, NA values, and zero-variance columns.

Usage

diagnose_data(X_matrix, Y_matrix, verbose = TRUE)

Value

List with components:

X_matrix

Cleaned and prepared X matrix.

Y_matrix

Cleaned and prepared Y matrix.

Arguments

X_matrix

Numeric matrix or data frame of X variables (e.g., Marxist prices).

Y_matrix

Numeric matrix or data frame of Y variables (e.g., market prices/CPI).

verbose

Logical; print diagnostic information. Default TRUE.

Details

The function:

  • Converts to matrix format if needed

  • Validates dimensional compatibility

  • Imputes missing values via interpolation (using zoo if available)

  • Adds minimal noise to zero-variance columns

  • Reports diagnostic information