# Introduction to Convergence Analysis with convergenceDFM

    library(convergenceDFM)
    #> convergenceDFM 0.1.4 - Dynamic Factor Models for Economic Convergence
    #> Type vignette('convergence-analysis') for an introduction

## Introduction

The `convergenceDFM` package provides a comprehensive framework for analyzing economic convergence using Dynamic Factor Models (DFM) and Factor Ornstein-Uhlenbeck processes.

## Basic Usage

    # Load example data
    data("example_marxist_data")

    # Run complete analysis
    results <- run_complete_factor_analysis_robust(
      X_matrix = marxist_prices[, -1],
      Y_matrix = bayesian_cpi[, -1],
      max_comp = 3,
      dfm_lags = 1,
      ou_chains = 4,
      ou_iter = 2000
    )

    # View results
    summary(results)

## Convergence Tests

The package includes several convergence tests:

1. Formal convergence tests: Unit root tests, cointegration
2. Robustness tests: Permutation, reweighting, jackknife
3. Rotation null tests: Testing coupling between factor spaces

## Visualization

    # Visualize factor dynamics
    visualize_factor_dynamics(
      dfm_result = results$dfm,
      ou_result = results$factor_ou,
      factors_data = results$factors
    )