API Types
This page documents all core types in MacroEconometricModels.jl.
Module
MacroEconometricModels.MacroEconometricModels — Module
MacroEconometricModelsA Julia package for macroeconomic time series analysis, providing tools for:
- Vector Autoregression (VAR) estimation
- Bayesian VAR (BVAR) with Minnesota priors
- Structural identification (Cholesky, sign restrictions, narrative, long-run)
- Impulse Response Functions (IRF)
- Forecast Error Variance Decomposition (FEVD)
- Factor models via Principal Component Analysis
- Local Projections (LP) with various extensions:
- HAC standard errors (Jordà 2005)
- Instrumental Variables (Stock & Watson 2018)
- Smooth IRF via B-splines (Barnichon & Brownlees 2019)
- State-dependent LP (Auerbach & Gorodnichenko 2013)
- Propensity Score Matching (Angrist et al. 2018)
- ARIMA/ARMA model estimation, forecasting, and order selection
- Generalized Method of Moments (GMM) estimation
Quick Start
using MacroEconometricModels
# Estimate a VAR model
Y = randn(100, 3)
model = estimate_var(Y, 2)
# Compute IRFs with bootstrap confidence intervals
irf_result = irf(model, 20; ci_type=:bootstrap)
# Local Projection IRFs with HAC standard errors
lp_result = estimate_lp(Y, 1, 20; cov_type=:newey_west)
lp_irf_result = lp_irf(lp_result)
# Bayesian estimation
post = estimate_bvar(Y, 2; prior=:minnesota)References
- Bańbura, M., Giannone, D., & Reichlin, L. (2010). Large Bayesian vector auto regressions.
- Lütkepohl, H. (2005). New Introduction to Multiple Time Series Analysis.
- Rubio-Ramírez, J. F., Waggoner, D. F., & Zha, T. (2010). Structural vector autoregressions.
- Jordà, Ò. (2005). Estimation and Inference of Impulse Responses by Local Projections.
- Stock, J. H., & Watson, M. W. (2018). Identification and Estimation of Dynamic Causal Effects.
- Barnichon, R., & Brownlees, C. (2019). Impulse Response Estimation by Smooth Local Projections.
- Auerbach, A. J., & Gorodnichenko, Y. (2013). Fiscal Multipliers in Recession and Expansion.
- Angrist, J. D., Jordà, Ò., & Kuersteiner, G. M. (2018). Semiparametric Estimates of Monetary Policy Effects.
Data Containers
MacroEconometricModels.AbstractMacroData — Type
AbstractMacroDataAbstract supertype for all MacroEconometricModels data containers. Subtypes: TimeSeriesData, PanelData, CrossSectionData.
MacroEconometricModels.TimeSeriesData — Type
TimeSeriesData{T<:AbstractFloat} <: AbstractMacroDataContainer for time series data with metadata.
Fields
data::Matrix{T}— Tobs × nvars data matrixvarnames::Vector{String}— variable namesfrequency::Frequency— data frequencytcode::Vector{Int}— FRED transformation codes per variable (default: all 1 = levels)time_index::Vector{Int}— integer time identifiers (default: 1:T)T_obs::Int— number of observationsn_vars::Int— number of variablesdesc::Vector{String}— dataset description (length-1 vector for mutability)vardesc::Dict{String,String}— per-variable descriptions keyed by variable namesource_refs::Vector{Symbol}— reference keys for bibliographic citations (seerefs())dates::Vector{String}— date labels (default: empty; useset_dates!to populate)
Constructors
TimeSeriesData(data::Matrix; varnames, frequency=Other, tcode, time_index, desc, vardesc, source_refs, dates)
TimeSeriesData(data::Vector; varname="x1", frequency=Other, desc, vardesc, source_refs, dates)
TimeSeriesData(df::DataFrame; frequency=Other, varnames, desc, vardesc, source_refs, dates)MacroEconometricModels.PanelData — Type
PanelData{T<:AbstractFloat} <: AbstractMacroDataContainer for panel (longitudinal) data with group and time identifiers.
Fields
data::Matrix{T}— stacked data matrix (sum of obs across groups × n_vars)varnames::Vector{String}— variable namesfrequency::Frequency— data frequencytcode::Vector{Int}— FRED transformation codes per variablegroup_id::Vector{Int}— group identifier per rowtime_id::Vector{Int}— time identifier per rowcohort_id::Union{Vector{Int}, Nothing}— treatment cohort per row (nothingif unused)group_names::Vector{String}— unique group labelsn_groups::Int— number of groupsn_vars::Int— number of variablesT_obs::Int— total number of rowsbalanced::Bool— true if all groups have same number of observationsdesc::Vector{String}— dataset description (length-1 vector for mutability)vardesc::Dict{String,String}— per-variable descriptions keyed by variable namesource_refs::Vector{Symbol}— reference keys for bibliographic citations (seerefs())
MacroEconometricModels.CrossSectionData — Type
CrossSectionData{T<:AbstractFloat} <: AbstractMacroDataContainer for cross-sectional data (single time point, multiple observations).
Fields
data::Matrix{T}— Nobs × nvars data matrixvarnames::Vector{String}— variable namesobs_id::Vector{Int}— observation identifiersN_obs::Int— number of observationsn_vars::Int— number of variablesdesc::Vector{String}— dataset description (length-1 vector for mutability)vardesc::Dict{String,String}— per-variable descriptions keyed by variable namesource_refs::Vector{Symbol}— reference keys for bibliographic citations (seerefs())
MacroEconometricModels.Frequency — Type
FrequencyEnumeration of time series data frequencies.
Values: Daily, Monthly, Quarterly, Yearly, Mixed, Other.
MacroEconometricModels.DataDiagnostic — Type
DataDiagnosticResult of diagnose(d) — per-variable issue counts and overall cleanliness.
Fields
n_nan::Vector{Int}— NaN count per variablen_inf::Vector{Int}— Inf count per variableis_constant::Vector{Bool}— true if variable has zero varianceis_short::Bool— true if series has fewer than 10 observationsvarnames::Vector{String}— variable namesis_clean::Bool— true if no issues detected
MacroEconometricModels.DataSummary — Type
DataSummaryResult of describe_data(d) — per-variable summary statistics.
Fields
varnames::Vector{String}— variable namesn::Vector{Int}— non-NaN observation count per variablemean::Vector{Float64}— mean of finite valuesstd::Vector{Float64}— standard deviationmin::Vector{Float64}— minimump25::Vector{Float64}— 25th percentilemedian::Vector{Float64}— median (50th percentile)p75::Vector{Float64}— 75th percentilemax::Vector{Float64}— maximumskewness::Vector{Float64}— skewnesskurtosis::Vector{Float64}— excess kurtosisT_obs::Int— total observationsn_vars::Int— number of variablesfrequency::Frequency— data frequency
Time Series Filters
MacroEconometricModels.AbstractFilterResult — Type
Abstract supertype for trend-cycle decomposition filter results.
MacroEconometricModels.HPFilterResult — Type
HPFilterResult{T} <: AbstractFilterResultResult of the Hodrick-Prescott filter (Hodrick & Prescott 1997).
Fields
trend::Vector{T}: Estimated trend component (length T_obs)cycle::Vector{T}: Cyclical component y - trend (length T_obs)lambda::T: Smoothing parameter usedT_obs::Int: Number of observations
MacroEconometricModels.HamiltonFilterResult — Type
HamiltonFilterResult{T} <: AbstractFilterResultResult of the Hamilton (2018) regression filter.
Regresses $y_{t+h}$ on $[1, y_t, y_{t-1}, \ldots, y_{t-p+1}]$. Residuals are the cyclical component; fitted values are the trend.
Fields
trend::Vector{T}: Fitted values (length T_obs - h - p + 1)cycle::Vector{T}: Residuals (length T_obs - h - p + 1)beta::Vector{T}: OLS coefficients [intercept; lag coefficients]h::Int: Forecast horizonp::Int: Number of lagsT_obs::Int: Original series lengthvalid_range::UnitRange{Int}: Indices into original series where results are valid
MacroEconometricModels.BeveridgeNelsonResult — Type
BeveridgeNelsonResult{T} <: AbstractFilterResultResult of the Beveridge-Nelson (1981) trend-cycle decomposition.
Decomposes a unit-root process into a permanent (random walk + drift) component and a transitory (stationary) component using the ARIMA representation.
Fields
permanent::Vector{T}: Permanent (trend) componenttransitory::Vector{T}: Transitory (cycle) componentdrift::T: Estimated drift (mean of first differences)long_run_multiplier::T: Long-run multiplier psi(1) = 1 + sum(psi weights)arima_order::Tuple{Int,Int,Int}: (p, d, q) order usedT_obs::Int: Number of observations
MacroEconometricModels.BaxterKingResult — Type
BaxterKingResult{T} <: AbstractFilterResultResult of the Baxter-King (1999) band-pass filter.
Isolates cyclical fluctuations in a specified frequency band while removing both low-frequency trend and high-frequency noise.
Fields
cycle::Vector{T}: Band-pass filtered component (length T_obs - 2K)trend::Vector{T}: Residual trend y - cycle (length T_obs - 2K)weights::Vector{T}: Symmetric filter weights [a0, a1, ..., a_K]pl::Int: Lower period bound (e.g., 6 quarters)pu::Int: Upper period bound (e.g., 32 quarters)K::Int: Truncation length (observations lost at each end)T_obs::Int: Original series lengthvalid_range::UnitRange{Int}: Indices into original series where results are valid
MacroEconometricModels.BoostedHPResult — Type
BoostedHPResult{T} <: AbstractFilterResultResult of the boosted HP filter (Phillips & Shi 2021).
Iteratively re-applies the HP filter to the cyclical component until a stopping criterion is met, improving trend estimation by removing remaining unit root behavior.
Fields
trend::Vector{T}: Final trend estimate (length T_obs)cycle::Vector{T}: Final cyclical component (length T_obs)lambda::T: Smoothing parameter usediterations::Int: Number of boosting iterations performedstopping::Symbol: Stopping criterion used (:ADF, :BIC, or :fixed)bic_path::Vector{T}: BIC value at each iterationadf_pvalues::Vector{T}: ADF p-values at each iterationT_obs::Int: Number of observations
ARIMA Models
MacroEconometricModels.AbstractARIMAModel — Type
AbstractARIMAModel{T<:AbstractFloat} <: StatsAPI.RegressionModelAbstract supertype for all univariate ARIMA-class models, parametric on the floating-point element type T.
MacroEconometricModels.ARModel — Type
ARModel{T} <: AbstractARIMAModelAutoregressive AR(p) model: yₜ = c + φ₁yₜ₋₁ + ... + φₚyₜ₋ₚ + εₜ
Fields
y::Vector{T}: Original datap::Int: AR orderc::T: Interceptphi::Vector{T}: AR coefficients [φ₁, ..., φₚ]sigma2::T: Innovation varianceresiduals::Vector{T}: Estimated residualsfitted::Vector{T}: Fitted valuesloglik::T: Log-likelihoodaic::T: Akaike Information Criterionbic::T: Bayesian Information Criterionmethod::Symbol: Estimation method (:ols, :mle)converged::Bool: Whether optimization convergediterations::Int: Number of iterations (0 for OLS)
MacroEconometricModels.MAModel — Type
MAModel{T} <: AbstractARIMAModelMoving average MA(q) model: yₜ = c + εₜ + θ₁εₜ₋₁ + ... + θqεₜ₋q
Fields
y::Vector{T}: Original dataq::Int: MA orderc::T: Intercepttheta::Vector{T}: MA coefficients [θ₁, ..., θq]sigma2::T: Innovation varianceresiduals::Vector{T}: Estimated residualsfitted::Vector{T}: Fitted valuesloglik::T: Log-likelihoodaic::T: Akaike Information Criterionbic::T: Bayesian Information Criterionmethod::Symbol: Estimation method (:css, :mle, :css_mle)converged::Bool: Whether optimization convergediterations::Int: Number of iterations
MacroEconometricModels.ARMAModel — Type
ARMAModel{T} <: AbstractARIMAModelAutoregressive moving average ARMA(p,q) model: yₜ = c + φ₁yₜ₋₁ + ... + φₚyₜ₋ₚ + εₜ + θ₁εₜ₋₁ + ... + θqεₜ₋q
Fields
y::Vector{T}: Original datap::Int: AR orderq::Int: MA orderc::T: Interceptphi::Vector{T}: AR coefficients [φ₁, ..., φₚ]theta::Vector{T}: MA coefficients [θ₁, ..., θq]sigma2::T: Innovation varianceresiduals::Vector{T}: Estimated residualsfitted::Vector{T}: Fitted valuesloglik::T: Log-likelihoodaic::T: Akaike Information Criterionbic::T: Bayesian Information Criterionmethod::Symbol: Estimation method (:css, :mle, :css_mle)converged::Bool: Whether optimization convergediterations::Int: Number of iterations
MacroEconometricModels.ARIMAModel — Type
ARIMAModel{T} <: AbstractARIMAModelAutoregressive integrated moving average ARIMA(p,d,q) model. The model is fit to the d-times differenced series as ARMA(p,q).
Fields
y::Vector{T}: Original (undifferenced) datay_diff::Vector{T}: Differenced seriesp::Int: AR orderd::Int: Integration order (number of differences)q::Int: MA orderc::T: Intercept (on differenced series)phi::Vector{T}: AR coefficientstheta::Vector{T}: MA coefficientssigma2::T: Innovation varianceresiduals::Vector{T}: Estimated residualsfitted::Vector{T}: Fitted values (on differenced series)loglik::T: Log-likelihoodaic::T: Akaike Information Criterionbic::T: Bayesian Information Criterionmethod::Symbol: Estimation methodconverged::Bool: Whether optimization convergediterations::Int: Number of iterations
MacroEconometricModels.ARIMAForecast — Type
ARIMAForecast{T}Forecast result from an ARIMA-class model.
Fields
forecast::Vector{T}: Point forecastsci_lower::Vector{T}: Lower confidence interval boundci_upper::Vector{T}: Upper confidence interval boundse::Vector{T}: Standard errors of forecastshorizon::Int: Forecast horizonconf_level::T: Confidence level (e.g., 0.95)
MacroEconometricModels.ARIMAOrderSelection — Type
ARIMAOrderSelection{T}Result from automatic ARIMA order selection.
Fields
best_p_aic::Int: Best AR order by AICbest_q_aic::Int: Best MA order by AICbest_p_bic::Int: Best AR order by BICbest_q_bic::Int: Best MA order by BICaic_matrix::Matrix{T}: AIC values for all (p,q) combinationsbic_matrix::Matrix{T}: BIC values for all (p,q) combinationsbest_model_aic::AbstractARIMAModel: Fitted model with best AICbest_model_bic::AbstractARIMAModel: Fitted model with best BIC
VAR Models
MacroEconometricModels.VARModel — Type
VARModel{T} <: AbstractVARModelVAR model estimated via OLS.
Fields: Y (data), p (lags), B (coefficients), U (residuals), Sigma (covariance), aic, bic, hqic, varnames.
MacroEconometricModels.AbstractVARModel — Type
Abstract supertype for Vector Autoregression models.
VECM Models
MacroEconometricModels.VECMModel — Type
VECMModel{T} <: AbstractVARModelVector Error Correction Model estimated via Johansen MLE or Engle-Granger two-step.
The VECM representation: ΔYₜ = αβ'Yₜ₋₁ + Γ₁ΔYₜ₋₁ + ... + Γₚ₋₁ΔYₜ₋ₚ₊₁ + μ + uₜ
where Π = αβ' is the long-run matrix (n × n, rank r), α (n × r) are adjustment speeds, and β (n × r) are cointegrating vectors.
Fields
Y: Original data in levels (T_obs × n)p: Underlying VAR order (VECM has p-1 lagged differences)rank: Cointegrating rank ralpha: Adjustment coefficients (n × r)beta: Cointegrating vectors (n × r), Phillips-normalizedPi: Long-run matrix αβ' (n × n)Gamma: Short-run dynamics [Γ₁, ..., Γₚ₋₁]mu: Intercept (n)U: Residuals (T_eff × n)Sigma: Residual covariance (n × n)aic,bic,hqic: Information criterialoglik: Log-likelihooddeterministic::none,:constant, or:trendmethod::johansenor:engle_grangerjohansen_result: Johansen test result (if applicable)
MacroEconometricModels.VECMForecast — Type
VECMForecast{T}Forecast result from a VECM, preserving cointegrating relationships.
Fields
levels: Forecasts in levels (h × n)differences: Forecasts in first differences (h × n)ci_lower,ci_upper: Confidence interval bounds in levels (h × n)horizon: Forecast horizonci_method: CI method used (:none,:bootstrap,:simulation)conf_level: Confidence level for CIs (e.g., 0.95)
MacroEconometricModels.VECMGrangerResult — Type
VECMGrangerResult{T}VECM Granger causality test result with short-run, long-run, and strong (joint) tests.
Fields
short_run_stat,short_run_pvalue,short_run_df: Wald test on Γ coefficientslong_run_stat,long_run_pvalue,long_run_df: Wald test on α (error correction)strong_stat,strong_pvalue,strong_df: Joint testcause_var,effect_var: Variable indices
Analysis Result Types
MacroEconometricModels.AbstractAnalysisResult — Type
AbstractAnalysisResultAbstract supertype for all innovation accounting and structural analysis results. Provides a unified interface for accessing results from various methods (IRF, FEVD, HD).
Subtypes should implement:
point_estimate(result)- return point estimatehas_uncertainty(result)- return true if uncertainty bounds availableuncertainty_bounds(result)- return (lower, upper) bounds if available
MacroEconometricModels.AbstractFrequentistResult — Type
AbstractFrequentistResult <: AbstractAnalysisResultFrequentist analysis results with point estimates and optional confidence intervals.
MacroEconometricModels.AbstractBayesianResult — Type
AbstractBayesianResult <: AbstractAnalysisResultBayesian analysis results with posterior quantiles and means.
Impulse Response and FEVD
MacroEconometricModels.ImpulseResponse — Type
ImpulseResponse{T} <: AbstractImpulseResponseIRF results with optional confidence intervals.
Fields: values (H×n×n), cilower, ciupper, horizon, variables, shocks, citype. Internal: _draws (raw bootstrap/simulation draws for correct cumulative IRF), _conflevel.
MacroEconometricModels.BayesianImpulseResponse — Type
BayesianImpulseResponse{T} <: AbstractImpulseResponseBayesian IRF with posterior quantiles.
Fields: quantiles (H×n×n×q), pointestimate (H×n×n), horizon, variables, shocks, quantilelevels. Internal: _draws (raw posterior draws for correct cumulative IRF).
MacroEconometricModels.AbstractImpulseResponse — Type
Abstract supertype for impulse response function results.
MacroEconometricModels.FEVD — Type
FEVD results: decomposition (n×n×H), proportions, variable/shock names.
MacroEconometricModels.BayesianFEVD — Type
Bayesian FEVD with posterior quantiles.
MacroEconometricModels.AbstractFEVD — Type
Abstract supertype for forecast error variance decomposition results.
Historical Decomposition
MacroEconometricModels.HistoricalDecomposition — Type
HistoricalDecomposition{T} <: AbstractHistoricalDecompositionFrequentist historical decomposition result.
Fields:
contributions: Shock contributions (Teff × nvars × n_shocks)initial_conditions: Initial condition component (Teff × nvars)actual: Actual data values (Teff × nvars)shocks: Structural shocks (Teff × nshocks)T_eff: Effective number of time periodsvariables: Variable namesshock_names: Shock namesmethod: Identification method used
MacroEconometricModels.BayesianHistoricalDecomposition — Type
BayesianHistoricalDecomposition{T} <: AbstractHistoricalDecompositionBayesian historical decomposition with posterior quantiles.
Fields:
quantiles: Contribution quantiles (Teff × nvars × nshocks × nquantiles)point_estimate: Mean contributions (Teff × nvars × n_shocks)initial_quantiles: Initial condition quantiles (Teff × nvars × n_quantiles)initial_point_estimate: Mean initial conditions (Teff × nvars)shocks_point_estimate: Mean structural shocks (Teff × nshocks)actual: Actual data values (Teff × nvars)T_eff: Effective number of time periodsvariables: Variable namesshock_names: Shock namesquantile_levels: Quantile levels (e.g., [0.16, 0.5, 0.84])method: Identification method used
MacroEconometricModels.AbstractHistoricalDecomposition — Type
Abstract supertype for historical decomposition results.
Factor Models
MacroEconometricModels.FactorModel — Type
FactorModel{T} <: AbstractFactorModelStatic factor model via PCA: Xₜ = Λ Fₜ + eₜ.
Fields: X, factors, loadings, eigenvalues, explainedvariance, cumulativevariance, r, standardized, block_names.
MacroEconometricModels.DynamicFactorModel — Type
DynamicFactorModel{T} <: AbstractFactorModelDynamic factor model: Xₜ = Λ Fₜ + eₜ, Fₜ = Σᵢ Aᵢ Fₜ₋ᵢ + ηₜ.
Fields: X, factors, loadings, A (VAR coefficients), factorresiduals, Sigmaeta, Sigmae, eigenvalues, explainedvariance, cumulative_variance, r, p, method, standardized, converged, iterations, loglik.
MacroEconometricModels.GeneralizedDynamicFactorModel — Type
GeneralizedDynamicFactorModel{T} <: AbstractFactorModelGDFM with frequency-dependent loadings: Xₜ = χₜ + ξₜ.
Fields: X, factors, commoncomponent, idiosyncratic, loadingsspectral, spectraldensityX, spectraldensitychi, eigenvaluesspectral, frequencies, q (dynamic factors), r (static factors), bandwidth, kernel, standardized, varianceexplained.
MacroEconometricModels.FactorForecast — Type
FactorForecast{T<:AbstractFloat}Result of factor model forecasting with optional confidence intervals.
Fields: factors, observables, factorslower, factorsupper, observableslower, observablesupper, factorsse, observablesse, horizon, conflevel, cimethod.
When ci_method == :none, CI and SE fields are zero matrices.
MacroEconometricModels.AbstractFactorModel — Type
Abstract supertype for factor models (static and dynamic).
Local Projections
MacroEconometricModels.AbstractLPImpulseResponse — Type
Abstract supertype for LP impulse response results.
MacroEconometricModels.AbstractLPModel — Type
Abstract supertype for Local Projection models.
MacroEconometricModels.LPFEVD — Type
LPFEVD{T} <: AbstractFEVDLP-based Forecast Error Variance Decomposition (Gorodnichenko & Lee 2019).
Uses R²-based estimator: regress estimated LP forecast errors on identified structural shocks to measure the share of forecast error variance attributable to each shock. Includes VAR-based bootstrap bias correction and CIs.
Fields
proportions: Raw FEVD estimates (n × n × H),[i,j,h]= share of variable i's h-step forecast error variance due to shock jbias_corrected: Bias-corrected FEVD (n × n × H)se: Bootstrap standard errors (n × n × H)ci_lower: Lower CI bounds (n × n × H)ci_upper: Upper CI bounds (n × n × H)method: Estimator (:r2, :lpa, :lpb)horizon: Maximum FEVD horizonn_boot: Number of bootstrap replications usedconf_level: Confidence level for CIsbias_correction: Whether bias correction was applied
Reference
Gorodnichenko, Y. & Lee, B. (2019). "Forecast Error Variance Decompositions with Local Projections." JBES, 38(4), 921–933.
MacroEconometricModels.LPForecast — Type
LPForecast{T}Direct multi-step LP forecast result.
Each horizon h uses its own regression coefficients directly (no recursion), producing ŷ{T+h} = αh + βh·shockh + Γh·controlsT.
Fields:
forecast: Point forecasts (H × n_response)ci_lower: Lower CI bounds (H × n_response)ci_upper: Upper CI bounds (H × n_response)se: Standard errors (H × n_response)horizon: Maximum forecast horizonresponse_vars: Response variable indicesshock_var: Shock variable indexshock_path: Assumed shock trajectoryconf_level: Confidence levelci_method: CI method (:analytical, :bootstrap, :none)
MacroEconometricModels.LPImpulseResponse — Type
LPImpulseResponse{T} <: AbstractLPImpulseResponseLP-based impulse response function with confidence intervals from robust standard errors.
Fields:
- values: Point estimates (H+1 × n_response)
- ci_lower: Lower CI bounds
- ci_upper: Upper CI bounds
- se: Standard errors
- horizon: Maximum horizon
- response_vars: Names of response variables
- shock_var: Name of shock variable
- cov_type: Covariance estimator type
- conf_level: Confidence level used
MacroEconometricModels.LPModel — Type
LPModel{T} <: AbstractLPModelLocal Projection model estimated via OLS with robust standard errors (Jordà 2005).
The LP regression for horizon h: y{t+h} = αh + βh * shockt + Γh * controlst + ε_{t+h}
Fields:
- Y: Response data matrix (Tobs × nvars)
- shock_var: Index of shock variable in Y
- response_vars: Indices of response variables (default: all)
- horizon: Maximum IRF horizon H
- lags: Number of control lags included
- B: Vector of coefficient matrices, one per horizon h=0,...,H
- residuals: Vector of residual matrices per horizon
- vcov: Vector of robust covariance matrices per horizon
- T_eff: Effective sample sizes per horizon
- cov_estimator: Covariance estimator used
MacroEconometricModels.StructuralLP — Type
StructuralLP{T} <: AbstractFrequentistResultStructural Local Projection result combining VAR-based identification with LP estimation.
Estimates multi-shock IRFs by computing orthogonalized structural shocks from a VAR model and using them as regressors in LP regressions (Plagborg-Møller & Wolf 2021).
Fields:
irf: 3D impulse responses (H × n × n) — reusesImpulseResponse{T}structural_shocks: Structural shocks (T_eff × n)var_model: Underlying VAR model used for identificationQ: Rotation/identification matrixmethod: Identification method used (:cholesky, :sign, :long_run, :fastica, etc.)lags: Number of LP control lagscov_type: HAC estimator typese: Standard errors (H × n × n)lp_models: Individual LP model per shock
MacroEconometricModels.BSplineBasis — Type
BSplineBasis{T} <: AnyB-spline basis for smooth LP (Barnichon & Brownlees 2019).
Fields:
- degree: Spline degree (typically 3 for cubic)
- ninteriorknots: Number of interior knots
- knots: Full knot vector including boundary knots
- basismatrix: Precomputed basis matrix at horizon points (H+1 × nbasis)
- horizons: Horizon points where basis is evaluated
MacroEconometricModels.LPIVModel — Type
LPIVModel{T} <: AbstractLPModelLocal Projection with Instrumental Variables (Stock & Watson 2018). Uses 2SLS estimation at each horizon.
Fields:
- Y: Response data matrix
- shock_var: Index of endogenous shock variable
- response_vars: Indices of response variables
- instruments: Instrument matrix (T × n_instruments)
- horizon: Maximum horizon
- lags: Number of control lags
- B: 2SLS coefficient matrices per horizon
- residuals: Residuals per horizon
- vcov: Robust covariance matrices per horizon
- firststageF: First-stage F-statistics per horizon (for weak IV test)
- firststagecoef: First-stage coefficients per horizon
- T_eff: Effective sample sizes
- cov_estimator: Covariance estimator used
MacroEconometricModels.PropensityLPModel — Type
PropensityLPModel{T} <: AbstractLPModelLocal Projection with Inverse Propensity Weighting (Angrist et al. 2018).
Estimates Average Treatment Effect (ATE) at each horizon using IPW.
Fields:
- Y: Response data matrix
- treatment: Binary treatment indicator vector
- response_vars: Response variable indices
- covariates: Covariate matrix for propensity model
- horizon: Maximum horizon
- propensity_scores: Estimated propensity scores P(D=1|X)
- ipw_weights: Inverse propensity weights
- B: IPW-weighted regression coefficients per horizon
- residuals: Residuals per horizon
- vcov: Robust covariance matrices per horizon
- ate: Average treatment effects per horizon (for each response var)
- ate_se: Standard errors of ATE
- config: Propensity score configuration
- T_eff: Effective sample sizes
- cov_estimator: Covariance estimator used
MacroEconometricModels.PropensityScoreConfig — Type
PropensityScoreConfig{T} <: AnyConfiguration for propensity score estimation and IPW.
Fields:
- method: Propensity model (:logit, :probit)
- trimming: (lower, upper) bounds for propensity scores
- normalize: Normalize weights to sum to 1 within groups
MacroEconometricModels.SmoothLPModel — Type
SmoothLPModel{T} <: AbstractLPModelSmooth Local Projection with B-spline basis (Barnichon & Brownlees 2019).
The IRF is parameterized as: β(h) = Σj θj Bj(h) where Bj are B-spline basis functions.
Fields:
- Y: Response data matrix
- shock_var: Shock variable index
- response_vars: Response variable indices
- horizon: Maximum horizon
- lags: Number of control lags
- spline_basis: B-spline basis configuration
- theta: Spline coefficients (nbasis × nresponse)
- vcov_theta: Covariance of theta (vectorized)
- lambda: Smoothing penalty parameter
- irfvalues: Smoothed IRF point estimates (H+1 × nresponse)
- irf_se: Standard errors of smoothed IRF
- residuals: Pooled residuals
- T_eff: Effective sample size
- cov_estimator: Covariance estimator used
MacroEconometricModels.StateLPModel — Type
StateLPModel{T} <: AbstractLPModelState-dependent Local Projection (Auerbach & Gorodnichenko 2013).
Model: y{t+h} = F(zt)[αE + βE * shockt + ...] + (1-F(zt))[αR + βR * shock_t + ...]
F(z) is a smooth transition function, typically logistic. State E = expansion (high z), State R = recession (low z).
Fields:
- Y: Response data matrix
- shock_var: Shock variable index
- response_vars: Response variable indices
- horizon: Maximum horizon
- lags: Number of control lags
- state: StateTransition configuration
- B_expansion: Coefficients in expansion state (per horizon)
- B_recession: Coefficients in recession state (per horizon)
- residuals: Residuals per horizon
- vcov_expansion: Covariance in expansion (per horizon)
- vcov_recession: Covariance in recession (per horizon)
- vcov_diff: Covariance of difference (per horizon)
- T_eff: Effective sample sizes
- cov_estimator: Covariance estimator used
MacroEconometricModels.StateTransition — Type
StateTransition{T} <: AnySmooth state transition function for state-dependent LP.
F(zt) = exp(-γ(zt - c)) / (1 + exp(-γ(z_t - c)))
Fields:
- state_var: State variable values (standardized)
- gamma: Transition smoothness parameter (higher = sharper)
- threshold: Transition threshold c
- method: Transition function type (:logistic, :exponential, :indicator)
- F_values: Precomputed transition function values
Panel VAR Types
MacroEconometricModels.PVARModel — Type
PVARModel{T} <: StatsAPI.RegressionModelPanel VAR model estimated via GMM or FE-OLS.
Stores coefficient matrices, robust standard errors, GMM internals for specification tests, and panel descriptors. GMM internals (instruments, weighting matrix, residuals) are retained to support Hansen J-test, bootstrap, and Andrews-Lu MMSC without re-estimation.
Fields
Phi::Matrix{T}— m × K coefficient matrix (rows = equations, K = m*p + npredet + nexog [+ 1])Sigma::Matrix{T}— m × m residual covariance (from level residuals)se::Matrix{T}— same shape as Phi (robust SEs, Windmeijer-corrected for 2-step)pvalues::Matrix{T}— same shape as Phim::Int— number of endogenous variablesp::Int— number of lagsn_predet::Int— number of predetermined variablesn_exog::Int— number of strictly exogenous variablesvarnames::Vector{String}— endogenous variable namespredet_names::Vector{String}— predetermined variable namesexog_names::Vector{String}— exogenous variable namesmethod::Symbol— :fdgmm, :systemgmm, :fe_olstransformation::Symbol— :fd, :fod, :demeansteps::Symbol— :onestep, :twostep, :mstepsystem_constant::Bool— whether level equation includes a constantn_groups::Int— number of panel groupsn_periods::Int— number of time periods (max)n_obs::Int— total effective observationsobs_per_group::NamedTuple{(:min,:avg,:max), Tuple{Int,Float64,Int}}instruments::Vector{Matrix{T}}— per-group instrument matricesresiduals_transformed::Vector{Matrix{T}}— per-group transformed residualsweighting_matrix::Matrix{T}— final weighting matrix Wn_instruments::Int— number of moment conditionsdata::PanelData{T}— original panel data
References
- Holtz-Eakin, Newey & Rosen (1988), Econometrica 56(6), 1371-1395.
- Arellano & Bond (1991), Review of Economic Studies 58(2), 277-297.
- Blundell & Bond (1998), Journal of Econometrics 87(1), 115-143.
MacroEconometricModels.PVARStability — Type
PVARStability{T} <: AnyEigenvalue stability analysis for a PVARModel.
Fields
eigenvalues::Vector{Complex{T}}— eigenvalues of companion matrixmoduli::Vector{T}— moduli |λ|is_stable::Bool— true if all |λ| < 1
MacroEconometricModels.PVARTestResult — Type
PVARTestResult{T} <: StatsAPI.HypothesisTestSpecification test result for Panel VAR (Hansen J-test, etc.).
Fields
test_name::String— e.g. "Hansen J-test"statistic::T— test statistic valuepvalue::T— p-valuedf::Int— degrees of freedomn_instruments::Int— number of instruments (moment conditions)n_params::Int— number of estimated parameters
Difference-in-Differences Types
MacroEconometricModels.DIDResult — Type
DIDResult{T} <: AbstractFrequentistResultDifference-in-Differences estimation result.
Stores event-study ATT coefficients, confidence intervals, and optionally group-time ATTs for Callaway-Sant'Anna. All DiD methods return this type.
Fields
att::Vector{T}— ATT by event-timese::Vector{T}— standard errorsci_lower::Vector{T}— lower CI boundsci_upper::Vector{T}— upper CI boundsevent_times::Vector{Int}— event-time grid (e.g., [-3,-2,-1,0,1,...,H])reference_period::Int— omitted period (typically -1)group_time_att::Union{Matrix{T}, Nothing}— ncohorts x nperiods (CS only)cohorts::Union{Vector{Int}, Nothing}— treatment cohort identifiersoverall_att::T— single aggregate ATToverall_se::T— SE of aggregate ATTn_obs::Int— total observationsn_groups::Int— number of panel unitsn_treated::Int— number of ever-treated unitsn_control::Int— number of never-treated unitsmethod::Symbol— :twfe or :callaway_santannaoutcome_var::String— outcome variable nametreatment_var::String— treatment variable namecontrol_group::Symbol— :nevertreated or :notyet_treatedcluster::Symbol— clustering level (:unit, :time, :twoway)conf_level::T— confidence level
References
- Callaway, B. & Sant'Anna, P. H. C. (2021). JoE 225(2), 200-230.
- Goodman-Bacon, A. (2021). JoE 225(2), 254-277.
MacroEconometricModels.EventStudyLP — Type
EventStudyLP{T<:AbstractFloat}Event Study Local Projection result with panel fixed effects.
Stores dynamic treatment effect coefficients at each event-time horizon, along with per-horizon regression details for diagnostics.
Fields
coefficients::Vector{T}— beta_h for h = -leads, ..., 0, ..., Hse::Vector{T}— standard errorsci_lower::Vector{T}— lower CI boundsci_upper::Vector{T}— upper CI boundsevent_times::Vector{Int}— event-time gridreference_period::Int— omitted period (typically -1)B::Vector{Matrix{T}}— full coefficient matrices per horizonresiduals_per_h::Vector{Matrix{T}}— residuals per horizonvcov::Vector{Matrix{T}}— VCV matrices per horizonT_eff::Vector{Int}— effective obs per horizonoutcome_var::String— outcome variable nametreatment_var::String— treatment variable namen_obs::Int— total observationsn_groups::Int— number of panel unitslags::Int— number of control lagsleads::Int— number of pre-treatment leadshorizon::Int— post-treatment horizon Hclean_controls::Bool— LP-DiD flag (true = only not-yet-treated controls)cluster::Symbol— clustering levelconf_level::T— confidence leveldata::PanelData{T}— original data
References
- Jorda, O. (2005). AER 95(1), 161-182.
- Dube, A. et al. (2025). JAE.
MacroEconometricModels.BaconDecomposition — Type
BaconDecomposition{T<:AbstractFloat}Goodman-Bacon (2021) decomposition of the TWFE DiD estimator.
Decomposes the TWFE estimate into a weighted average of all possible 2x2 DiD comparisons. Weights reflect sample size and variance of treatment.
Fields
estimates::Vector{T}— 2x2 DiD estimatesweights::Vector{T}— corresponding weights (sum to 1)comparison_type::Vector{Symbol}— :earliervslater, :latervsearlier, :treatedvsuntreatedcohort_i::Vector{Int}— first cohort in each 2x2cohort_j::Vector{Int}— second cohort (or 0 for never-treated)overall_att::T— weighted average = TWFE estimate
Reference
Goodman-Bacon, A. (2021). JoE 225(2), 254-277.
MacroEconometricModels.PretrendTestResult — Type
PretrendTestResult{T<:AbstractFloat}Joint F-test result for parallel trends assumption.
Tests H0: all pre-treatment event-time coefficients are jointly zero. A rejection suggests violation of parallel trends.
Fields
statistic::T— F-statistic (or Wald chi-squared)pvalue::T— p-valuedf::Int— degrees of freedom (number of pre-treatment periods)pre_coefficients::Vector{T}— pre-treatment coefficientspre_se::Vector{T}— SEs of pre-treatment coefficientstest_type::Symbol— :f_test or :wald
MacroEconometricModels.NegativeWeightResult — Type
NegativeWeightResult{T<:AbstractFloat}de Chaisemartin & D'Haultfoeuille (2020) negative weight diagnostic.
Checks whether the TWFE estimator places negative weights on some group-time ATTs, which can cause sign reversal of the overall estimate.
Fields
has_negative_weights::Bool— true if any weights are negativen_negative::Int— count of negative weightstotal_negative_weight::T— sum of negative weightsweights::Vector{T}— all weightscohort_time_pairs::Vector{Tuple{Int,Int}}— (cohort, time) for each weight
MacroEconometricModels.HonestDiDResult — Type
HonestDiDResult{T<:AbstractFloat}Rambachan & Roth (2023) HonestDiD sensitivity analysis result.
Provides robust confidence sets under bounded violations of parallel trends. The Mbar parameter controls the maximum allowed violation magnitude.
Fields
Mbar::T— violation bound usedrobust_ci_lower::Vector{T}— robust CI lower bounds per post-periodrobust_ci_upper::Vector{T}— robust CI upper bounds per post-periodoriginal_ci_lower::Vector{T}— original CIs for comparisonoriginal_ci_upper::Vector{T}breakdown_value::T— smallest Mbar making result insignificantpost_event_times::Vector{Int}— post-treatment event-time gridpost_att::Vector{T}— post-treatment point estimatesconf_level::T
Reference
Rambachan, A. & Roth, J. (2023). RES 90(5), 2555-2591.
GMM Types
MacroEconometricModels.AbstractGMMModel — Type
Abstract supertype for GMM models.
MacroEconometricModels.GMMModel — Type
GMMModel{T} <: AbstractGMMModelGeneralized Method of Moments estimator.
Minimizes: g(θ)'W g(θ) where g(θ) = (1/n) Σᵢ gᵢ(θ)
Fields:
- theta: Parameter estimates
- vcov: Asymptotic covariance matrix
- n_moments: Number of moment conditions
- n_params: Number of parameters
- n_obs: Number of observations
- weighting: Weighting specification
- W: Final weighting matrix
- g_bar: Sample moment vector at solution
- J_stat: Hansen's J-test statistic
- J_pvalue: p-value for J-test
- converged: Convergence flag
- iterations: Number of iterations
MacroEconometricModels.SMMModel — Type
SMMModel{T} <: AbstractGMMModelSimulated Method of Moments estimator.
Shares the AbstractGMMModel interface with GMMModel –- coef, vcov, nobs, stderror, show, refs, report, j_test all work.
Fields
theta::Vector{T}–- estimated parametersvcov::Matrix{T}–- asymptotic covariance matrixn_moments::Int–- number of moment conditionsn_params::Int–- number of parametersn_obs::Int–- number of data observationsweighting::GMMWeighting{T}–- weighting specificationW::Matrix{T}–- final weighting matrixg_bar::Vector{T}–- moment discrepancy at solutionJ_stat::T–- Hansen J-test statisticJ_pvalue::T–- J-test p-valueconverged::Bool–- convergence flagiterations::Int–- optimizer iterationssim_ratio::Int–- tau = simulation periods / data periods
MacroEconometricModels.GMMWeighting — Type
GMMWeighting{T} <: AnyGMM weighting matrix specification.
Fields:
- method: Weighting method (:identity, :optimal, :two_step, :iterated)
- max_iter: Maximum iterations for iterated GMM
- tol: Convergence tolerance
Prior Types
MacroEconometricModels.MinnesotaHyperparameters — Type
MinnesotaHyperparameters{T} <: AbstractPriorMinnesota prior hyperparameters: tau (tightness), decay, lambda (sum-of-coef), mu (co-persistence), omega (covariance).
MacroEconometricModels.AbstractPrior — Type
Abstract supertype for Bayesian prior specifications.
Bayesian Posterior Types
MacroEconometricModels.BVARPosterior — Type
BVARPosterior{T} <: AnyPosterior draws from Bayesian VAR estimation.
Replaces MCMCChains.Chains — stores i.i.d. or Gibbs draws from the Normal-Inverse-Wishart posterior directly.
Fields
B_draws::Array{T,3}: Coefficient draws (n_draws × k × n)Sigma_draws::Array{T,3}: Covariance draws (n_draws × n × n)n_draws::Int: Number of posterior drawsp::Int: Number of VAR lagsn::Int: Number of variablesdata::Matrix{T}: Original Y matrix (for residual computation downstream)prior::Symbol: Prior used (:normal or :minnesota)sampler::Symbol: Sampler used (:direct or :gibbs)varnames::Vector{String}: Variable names
Forecast Types
MacroEconometricModels.AbstractForecastResult — Type
AbstractForecastResult{T<:AbstractFloat}Abstract supertype for all forecast result types. Subtypes: ARIMAForecast, VolatilityForecast, LPForecast, VECMForecast, FactorForecast.
All subtypes have at least a horizon::Int field.
MacroEconometricModels.VARForecast — Type
VARForecast{T} <: AbstractForecastResult{T}VAR model forecast with optional bootstrap confidence intervals.
Fields: forecast (h×n), cilower (h×n), ciupper (h×n), horizon, cimethod, conflevel, varnames.
MacroEconometricModels.BVARForecast — Type
BVARForecast{T} <: AbstractForecastResult{T}Bayesian VAR forecast with posterior credible intervals.
Fields: forecast (h×n), cilower (h×n), ciupper (h×n), horizon, conflevel, pointestimate, varnames.
Covariance Estimators
MacroEconometricModels.AbstractCovarianceEstimator — Type
Abstract supertype for covariance estimators.
MacroEconometricModels.NeweyWestEstimator — Type
NeweyWestEstimator{T} <: AbstractCovarianceEstimatorNewey-West HAC covariance estimator configuration.
Fields:
- bandwidth: Truncation lag (0 = automatic via Newey-West 1994 formula)
- kernel: Kernel function (:bartlett, :parzen, :quadraticspectral, :tukeyhanning)
- prewhiten: Use AR(1) prewhitening
MacroEconometricModels.WhiteEstimator — Type
WhiteEstimator <: AbstractCovarianceEstimatorWhite heteroscedasticity-robust covariance estimator (HC0). Does not correct for serial correlation.
MacroEconometricModels.DriscollKraayEstimator — Type
DriscollKraayEstimator{T} <: AbstractCovarianceEstimatorDriscoll-Kraay standard errors for panel data with cross-sectional dependence.
Unit Root Test Types
MacroEconometricModels.AbstractUnitRootTest — Type
Abstract supertype for all unit root test results.
MacroEconometricModels.ADFResult — Type
ADFResult{T} <: AbstractUnitRootTestAugmented Dickey-Fuller test result.
Fields:
statistic: ADF test statistic (t-ratio on γ)pvalue: Approximate p-value (MacKinnon 1994, 2010)lags: Number of augmenting lags usedregression: Regression specification (:none, :constant, :trend)critical_values: Critical values at 1%, 5%, 10% levelsnobs: Effective number of observations
MacroEconometricModels.KPSSResult — Type
KPSSResult{T} <: AbstractUnitRootTestKPSS stationarity test result.
Fields:
statistic: KPSS test statisticpvalue: Approximate p-valueregression: Regression specification (:constant, :trend)critical_values: Critical values at 1%, 5%, 10% levelsbandwidth: Bartlett kernel bandwidth usednobs: Number of observations
MacroEconometricModels.PPResult — Type
PPResult{T} <: AbstractUnitRootTestPhillips-Perron test result.
Fields:
statistic: PP test statistic (Zt or Zα)pvalue: Approximate p-valueregression: Regression specification (:none, :constant, :trend)critical_values: Critical values at 1%, 5%, 10% levelsbandwidth: Newey-West bandwidth usednobs: Effective number of observations
MacroEconometricModels.ZAResult — Type
ZAResult{T} <: AbstractUnitRootTestZivot-Andrews structural break unit root test result.
Fields:
statistic: Minimum t-statistic across all break pointspvalue: Approximate p-valuebreak_index: Index of estimated structural breakbreak_fraction: Break point as fraction of sampleregression: Break specification (:constant, :trend, :both)critical_values: Critical values at 1%, 5%, 10% levelslags: Number of augmenting lagsnobs: Effective number of observations
MacroEconometricModels.NgPerronResult — Type
NgPerronResult{T} <: AbstractUnitRootTestNg-Perron unit root test result (MZα, MZt, MSB, MPT).
Fields:
MZa: Modified Zα statisticMZt: Modified Zt statisticMSB: Modified Sargan-Bhargava statisticMPT: Modified Point-optimal statisticregression: Regression specification (:constant, :trend)critical_values: Dict mapping statistic name to critical valuesnobs: Effective number of observations
MacroEconometricModels.JohansenResult — Type
JohansenResult{T} <: AbstractUnitRootTestJohansen cointegration test result.
Fields:
trace_stats: Trace test statistics for each ranktrace_pvalues: P-values for trace testsmax_eigen_stats: Maximum eigenvalue test statisticsmax_eigen_pvalues: P-values for max eigenvalue testsrank: Estimated cointegration rank (at 5% level)eigenvectors: Cointegrating vectors (β), columns are vectorsadjustment: Adjustment coefficients (α)eigenvalues: Eigenvalues from reduced rank regressioncritical_values_trace: Critical values for trace test (rows: ranks, cols: 10%, 5%, 1%)critical_values_max: Critical values for max eigenvalue testdeterministic: Deterministic specificationlags: Number of lags in VECMnobs: Effective number of observations
MacroEconometricModels.VARStationarityResult — Type
VARStationarityResult{T}VAR model stationarity check result.
Fields:
is_stationary: true if all eigenvalues have modulus < 1eigenvalues: Eigenvalues of companion matrix (may be real or complex)max_modulus: Maximum eigenvalue moduluscompanion_matrix: The companion form matrix F
Model Comparison Types
MacroEconometricModels.LRTestResult — Type
LRTestResult{T} <: StatsAPI.HypothesisTestResult from a likelihood ratio test comparing nested models.
Fields
statistic::T: LR statistic = -2(ℓR - ℓU)pvalue::T: p-value from χ²(df) distributiondf::Int: Degrees of freedom (dofU - dofR)loglik_restricted::T: Log-likelihood of restricted modelloglik_unrestricted::T: Log-likelihood of unrestricted modeldof_restricted::Int: Parameters in restricted modeldof_unrestricted::Int: Parameters in unrestricted modelnobs_restricted::Int: Observations in restricted modelnobs_unrestricted::Int: Observations in unrestricted model
MacroEconometricModels.LMTestResult — Type
LMTestResult{T} <: StatsAPI.HypothesisTestResult from a Lagrange multiplier (score) test comparing nested models.
Fields
statistic::T: LM statistic = s'(-H)⁻¹spvalue::T: p-value from χ²(df) distributiondf::Int: Degrees of freedom (dofU - dofR)nobs::Int: Number of observationsscore_norm::T: ‖s‖₂ diagnostic (Euclidean norm of score vector)
Granger Causality Types
MacroEconometricModels.GrangerCausalityResult — Type
GrangerCausalityResult{T} <: StatsAPI.HypothesisTestResult from a Granger causality test in a VAR model.
Fields
statistic::T: Wald χ² statisticpvalue::T: p-value from χ²(df) distributiondf::Int: Degrees of freedom (number of restrictions)cause::Vector{Int}: Indices of causing variable(s)effect::Int: Index of effect variablen::Int: Number of variables in VARp::Int: Lag ordernobs::Int: Effective number of observationstest_type::Symbol::pairwiseor:block
Nowcasting Types
MacroEconometricModels.AbstractNowcastModel — Type
Abstract supertype for nowcasting models (DFM, BVAR, Bridge).
MacroEconometricModels.NowcastDFM — Type
NowcastDFM{T<:AbstractFloat} <: AbstractNowcastModelDynamic factor model nowcasting result (Bańbura & Modugno 2014).
Estimates factors from mixed-frequency data with arbitrary missing patterns using EM algorithm + Kalman smoother.
Fields
X_sm::Matrix{T}— smoothed data (NaN filled)F::Matrix{T}— smoothed factors (Tobs × statedim)C::Matrix{T}— observation loadingsA::Matrix{T}— state transition matrixQ::Matrix{T}— state innovation covarianceR::Matrix{T}— observation noise covariance (diagonal)Mx::Vector{T}— data column means (for standardization)Wx::Vector{T}— data column stdsZ_0::Vector{T}— initial state meanV_0::Matrix{T}— initial state covariancer::Int— number of factorsp::Int— VAR lags in factor dynamicsblocks::Matrix{Int}— block structure (N × n_blocks)loglik::T— log-likelihood at convergencen_iter::Int— EM iterations usednM::Int— number of monthly variablesnQ::Int— number of quarterly variablesidio::Symbol— idiosyncratic spec (:ar1 or :iid)data::Matrix{T}— original data with NaN
MacroEconometricModels.NowcastBVAR — Type
NowcastBVAR{T<:AbstractFloat} <: AbstractNowcastModelLarge Bayesian VAR nowcasting result (Cimadomo et al. 2022).
Uses GLP-style normal-inverse-Wishart prior with hyperparameter optimization via marginal likelihood maximization.
Fields
X_sm::Matrix{T}— smoothed data (NaN filled)beta::Matrix{T}— posterior mode VAR coefficientssigma::Matrix{T}— posterior mode error covariancelambda::T— overall shrinkagetheta::T— cross-variable shrinkagemiu::T— sum-of-coefficients prior weightalpha::T— co-persistence prior weightlags::Int— number of lagsloglik::T— marginal log-likelihoodnM::Int— number of monthly variablesnQ::Int— number of quarterly variablesdata::Matrix{T}— original data with NaN
MacroEconometricModels.NowcastBridge — Type
NowcastBridge{T<:AbstractFloat} <: AbstractNowcastModelBridge equation combination nowcasting result (Bańbura et al. 2023).
Combines multiple OLS bridge regressions (each using a pair of monthly indicators) via median combination.
Fields
X_sm::Matrix{T}— smoothed data (NaN filled by interpolation)Y_nowcast::Vector{T}— combined nowcast for target variable (per quarter)Y_individual::Matrix{T}— individual equation nowcasts (nquarters × nequations)n_equations::Int— number of bridge equationscoefficients::Vector{Vector{T}}— OLS coefficients per equationnM::Int— number of monthly variablesnQ::Int— number of quarterly variableslagM::Int— monthly indicator lagslagQ::Int— quarterly indicator lagslagY::Int— autoregressive lagsdata::Matrix{T}— original data with NaN
MacroEconometricModels.NowcastResult — Type
NowcastResult{T<:AbstractFloat}Unified nowcast result wrapping any AbstractNowcastModel.
Fields
model::AbstractNowcastModel— underlying modelX_sm::Matrix{T}— smoothed/nowcasted datatarget_index::Int— column index of target variablenowcast::T— current-quarter nowcast valueforecast::T— next-quarter forecast valuemethod::Symbol—:dfm,:bvar, or:bridge
MacroEconometricModels.NowcastNews — Type
NowcastNews{T<:AbstractFloat}News decomposition result (Bańbura & Modugno 2014).
Decomposes nowcast revision into contributions from new data releases (news), data revisions, and parameter re-estimation.
Fields
old_nowcast::T— previous nowcast valuenew_nowcast::T— updated nowcast valueimpact_news::Vector{T}— per-release news impactimpact_revision::T— data revision impactimpact_reestimation::T— parameter re-estimation impact (residual)group_impacts::Vector{T}— news aggregated by variable groupvariable_names::Vector{String}— names for each news release
SVAR Identification Types
MacroEconometricModels.ZeroRestriction — Type
Zero restriction: variable doesn't respond to shock at horizon.
MacroEconometricModels.SignRestriction — Type
Sign restriction: variable response to shock has required sign at horizon.
MacroEconometricModels.SVARRestrictions — Type
Container for SVAR restrictions.
MacroEconometricModels.SignIdentifiedSet — Type
SignIdentifiedSet{T} <: AbstractAnalysisResultFull identified set from sign-restricted SVAR identification.
Stores all accepted rotation matrices and corresponding IRFs, enabling characterization of the identified set (Baumeister & Hamilton, 2015).
Fields:
Q_draws::Vector{Matrix{T}}— accepted rotation matricesirf_draws::Array{T,4}— stacked IRFs (n_accepted × horizon × n × n)n_accepted::Int— number of accepted drawsn_total::Int— total draws attemptedacceptance_rate::T— fraction acceptedvariables::Vector{String}— variable namesshocks::Vector{String}— shock names
MacroEconometricModels.AriasSVARResult — Type
Result from Arias et al. (2018) identification.
MacroEconometricModels.UhligSVARResult — Type
UhligSVARResult{T<:AbstractFloat}Result from Mountford-Uhlig (2009) penalty function identification.
Fields
Q::Matrix{T}: Optimal rotation matrixirf::Array{T,3}: Impulse responses (horizon × n × n)penalty::T: Total penalty at optimum (negative = better)shock_penalties::Vector{T}: Per-shock penalty valuesrestrictions::SVARRestrictions: The imposed restrictionsconverged::Bool: Whether all sign restrictions are satisfied
Volatility Models
MacroEconometricModels.AbstractVolatilityModel — Type
Abstract supertype for univariate volatility models (ARCH/GARCH/SV).
MacroEconometricModels.ARCHModel — Type
ARCHModel{T} <: AbstractVolatilityModelARCH(q) model (Engle 1982): εₜ = σₜ zₜ, σ²ₜ = ω + α₁ε²ₜ₋₁ + ... + αqε²ₜ₋q
Fields
y::Vector{T}: Original dataq::Int: ARCH ordermu::T: Mean (intercept)omega::T: Variance intercept (ω > 0)alpha::Vector{T}: ARCH coefficients [α₁, ..., αq]conditional_variance::Vector{T}: Estimated conditional variances σ²ₜstandardized_residuals::Vector{T}: Standardized residuals zₜ = εₜ/σₜresiduals::Vector{T}: Raw residuals εₜ = yₜ - μfitted::Vector{T}: Fitted values (mean)loglik::T: Log-likelihoodaic::T: Akaike Information Criterionbic::T: Bayesian Information Criterionmethod::Symbol: Estimation methodconverged::Bool: Whether optimization convergediterations::Int: Number of iterations
MacroEconometricModels.GARCHModel — Type
GARCHModel{T} <: AbstractVolatilityModelGARCH(p,q) model (Bollerslev 1986): σ²ₜ = ω + α₁ε²ₜ₋₁ + ... + αqε²ₜ₋q + β₁σ²ₜ₋₁ + ... + βpσ²ₜ₋p
Fields
y::Vector{T}: Original datap::Int: GARCH order (lagged variances)q::Int: ARCH order (lagged squared residuals)mu::T: Mean (intercept)omega::T: Variance intercept (ω > 0)alpha::Vector{T}: ARCH coefficients [α₁, ..., αq]beta::Vector{T}: GARCH coefficients [β₁, ..., βp]conditional_variance::Vector{T}: Estimated conditional variances σ²ₜstandardized_residuals::Vector{T}: Standardized residuals zₜ = εₜ/σₜresiduals::Vector{T}: Raw residuals εₜ = yₜ - μfitted::Vector{T}: Fitted values (mean)loglik::T: Log-likelihoodaic::T: Akaike Information Criterionbic::T: Bayesian Information Criterionmethod::Symbol: Estimation methodconverged::Bool: Whether optimization convergediterations::Int: Number of iterations
MacroEconometricModels.EGARCHModel — Type
EGARCHModel{T} <: AbstractVolatilityModelEGARCH(p,q) model (Nelson 1991): log(σ²ₜ) = ω + Σαᵢ(|zₜ₋ᵢ| - E|zₜ₋ᵢ|) + Σγᵢzₜ₋ᵢ + Σβⱼlog(σ²ₜ₋ⱼ)
The log specification ensures σ² > 0 without parameter constraints, and γᵢ captures leverage effects (typically γ < 0).
MacroEconometricModels.GJRGARCHModel — Type
GJRGARCHModel{T} <: AbstractVolatilityModelGJR-GARCH(p,q) model (Glosten, Jagannathan & Runkle 1993): σ²ₜ = ω + Σ(αᵢ + γᵢI(εₜ₋ᵢ < 0))ε²ₜ₋ᵢ + Σβⱼσ²ₜ₋ⱼ
γᵢ > 0 means negative shocks increase variance more than positive shocks.
MacroEconometricModels.SVModel — Type
SVModel{T} <: AbstractVolatilityModelStochastic Volatility model (Taylor 1986), estimated via Kim-Shephard-Chib (1998) Gibbs sampler: yₜ = exp(hₜ/2) εₜ, εₜ ~ N(0,1) hₜ = μ + φ(hₜ₋₁ - μ) + σ_η ηₜ, ηₜ ~ N(0,1)
Fields
y::Vector{T}: Original datah_draws::Matrix{T}: Posterior draws of latent log-volatilities (nsamples × nobs)mu_post::Vector{T}: Posterior draws of μ (log-variance level)phi_post::Vector{T}: Posterior draws of φ (persistence)sigma_eta_post::Vector{T}: Posterior draws of σ_η (volatility of volatility)volatility_mean::Vector{T}: Posterior mean of exp(hₜ) at each time tvolatility_quantiles::Matrix{T}: Quantiles of exp(hₜ) (T × n_quantiles)quantile_levels::Vector{T}: Quantile levels (e.g., [0.025, 0.5, 0.975])dist::Symbol: Error distribution (:normal or :studentt)leverage::Bool: Whether leverage effect was estimatedn_samples::Int: Number of posterior samples
MacroEconometricModels.VolatilityForecast — Type
VolatilityForecast{T}Forecast result from a volatility model.
Fields
forecast::Vector{T}: Point forecasts of conditional varianceci_lower::Vector{T}: Lower confidence interval boundci_upper::Vector{T}: Upper confidence interval boundse::Vector{T}: Standard errors of forecastshorizon::Int: Forecast horizonconf_level::T: Confidence level (e.g., 0.95)model_type::Symbol: Source model type (:arch, :garch, :egarch, :gjr_garch, :sv)
Cross-Sectional Models
MacroEconometricModels.RegModel — Type
RegModel{T} <: StatsAPI.RegressionModelLinear regression model estimated via OLS, WLS, or IV/2SLS.
Fields
y::Vector{T}— dependent variableX::Matrix{T}— regressor matrix (includes intercept if present)beta::Vector{T}— estimated coefficientsvcov_mat::Matrix{T}— variance-covariance matrix of coefficientsresiduals::Vector{T}— OLS/WLS residualsfitted::Vector{T}— fitted values X * betassr::T— sum of squared residualstss::T— total sum of squares (demeaned)r2::T— R-squaredadj_r2::T— adjusted R-squaredf_stat::T— F-statistic for joint significancef_pval::T— p-value of the F-testloglik::T— Gaussian log-likelihoodaic::T— Akaike information criterionbic::T— Bayesian information criterionvarnames::Vector{String}— coefficient namesmethod::Symbol— estimation method (:ols, :wls, :iv)cov_type::Symbol— covariance estimator (:ols, :hc0, :hc1, :hc2, :hc3, :cluster)weights::Union{Nothing,Vector{T}}— WLS weights (nothing for OLS)Z::Union{Nothing,Matrix{T}}— instrument matrix (IV only)endogenous::Union{Nothing,Vector{Int}}— indices of endogenous regressors (IV only)first_stage_f::Union{Nothing,T}— first-stage F-statistic (IV only)sargan_stat::Union{Nothing,T}— Sargan overidentification statistic (IV only)sargan_pval::Union{Nothing,T}— Sargan test p-value (IV only)
References
- White, H. (1980). Econometrica 48(4), 817-838.
- MacKinnon, J. G. & White, H. (1985). JBES 3(3), 305-314.
MacroEconometricModels.LogitModel — Type
LogitModel{T} <: StatsAPI.RegressionModelBinary logistic regression model estimated via maximum likelihood (IRLS).
Fields
y::Vector{T}— binary dependent variable (0/1)X::Matrix{T}— regressor matrixbeta::Vector{T}— estimated coefficientsvcov_mat::Matrix{T}— variance-covariance matrixresiduals::Vector{T}— deviance residualsfitted::Vector{T}— predicted probabilities P(y=1|X)loglik::T— maximized log-likelihoodloglik_null::T— null model log-likelihoodpseudo_r2::T— McFadden's pseudo R-squaredaic::T— Akaike information criterionbic::T— Bayesian information criterionvarnames::Vector{String}— coefficient namesconverged::Bool— whether IRLS convergediterations::Int— number of IRLS iterationscov_type::Symbol— covariance estimator (:ols, :hc1, etc.)
References
- McCullagh, P. & Nelder, J. A. (1989). Generalized Linear Models. Chapman & Hall.
- Agresti, A. (2002). Categorical Data Analysis. 2nd ed. Wiley.
MacroEconometricModels.ProbitModel — Type
ProbitModel{T} <: StatsAPI.RegressionModelBinary probit regression model estimated via maximum likelihood (IRLS).
Fields
Same as LogitModel{T}, using the standard normal CDF as the link function.
References
- Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data. 2nd ed. MIT Press.
MacroEconometricModels.MarginalEffects — Type
MarginalEffects{T}Marginal effects computed from a Logit or Probit model.
Fields
effects::Vector{T}— marginal effects (AME, MEM, or MER)se::Vector{T}— delta-method standard errorsz_stat::Vector{T}— z-statisticsp_values::Vector{T}— two-sided p-values (normal distribution)ci_lower::Vector{T}— lower CI boundsci_upper::Vector{T}— upper CI boundsvarnames::Vector{String}— variable namestype::Symbol— :ame (average), :mem (at-mean), or :mer (at-representative)conf_level::T— confidence level
References
- Cameron, A. C. & Trivedi, P. K. (2005). Microeconometrics. Cambridge University Press.
Non-Gaussian SVAR Types
MacroEconometricModels.AbstractNormalityTest — Type
Abstract supertype for multivariate normality test results.
MacroEconometricModels.AbstractNonGaussianSVAR — Type
Abstract supertype for non-Gaussian SVAR identification results.
MacroEconometricModels.NormalityTestResult — Type
NormalityTestResult{T} <: AbstractNormalityTestResult of a multivariate normality test.
Fields:
test_name::Symbol—:jarque_bera,:mardia_skewness,:mardia_kurtosis,:doornik_hansen,:henze_zirklerstatistic::T— test statisticpvalue::T— p-valuedf::Int— degrees of freedom (for chi-squared tests)n_vars::Int— number of variablesn_obs::Int— number of observationscomponents::Union{Nothing, Vector{T}}— per-component statistics (for component-wise tests)component_pvalues::Union{Nothing, Vector{T}}— per-component p-values
MacroEconometricModels.NormalityTestSuite — Type
NormalityTestSuite{T}Collection of normality test results from normality_test_suite.
Fields:
results::Vector{NormalityTestResult{T}}— individual test resultsresiduals::Matrix{T}— the residual matrix testedn_vars::Intn_obs::Int
MacroEconometricModels.ICASVARResult — Type
ICASVARResult{T} <: AbstractNonGaussianSVARResult from ICA-based SVAR identification.
Fields:
B0::Matrix{T}— structural impact matrix (n × n): ut = B₀ εtW::Matrix{T}— unmixing matrix (n × n): εt = W utQ::Matrix{T}— rotation matrix forcompute_Qintegrationshocks::Matrix{T}— recovered structural shocks (T_eff × n)method::Symbol—:fastica,:jade,:sobi,:dcov,:hsicconverged::Booliterations::Intobjective::T— final objective value
MacroEconometricModels.NonGaussianMLResult — Type
NonGaussianMLResult{T} <: AbstractNonGaussianSVARResult from non-Gaussian maximum likelihood SVAR identification.
Fields:
B0::Matrix{T}— structural impact matrix (n × n)Q::Matrix{T}— rotation matrixshocks::Matrix{T}— structural shocks (T_eff × n)distribution::Symbol—:student_t,:mixture_normal,:pml,:skew_normalloglik::T— log-likelihood at MLEloglik_gaussian::T— Gaussian log-likelihood (for LR test)dist_params::Dict{Symbol, Any}— distribution parametersvcov::Matrix{T}— asymptotic covariance of B₀ elementsse::Matrix{T}— standard errors for B₀converged::Booliterations::Intaic::Tbic::T
MacroEconometricModels.MarkovSwitchingSVARResult — Type
MarkovSwitchingSVARResult{T} <: AbstractNonGaussianSVARResult from Markov-switching heteroskedasticity SVAR identification.
Fields:
B0::Matrix{T}— structural impact matrixQ::Matrix{T}— rotation matrixSigma_regimes::Vector{Matrix{T}}— covariance per regimeLambda::Vector{Vector{T}}— relative variances per regimeregime_probs::Matrix{T}— smoothed regime probabilities (T × K)transition_matrix::Matrix{T}— Markov transition probabilities (K × K)loglik::Tconverged::Booliterations::Intn_regimes::Int
MacroEconometricModels.GARCHSVARResult — Type
GARCHSVARResult{T} <: AbstractNonGaussianSVARResult from GARCH-based SVAR identification.
Fields:
B0::Matrix{T}— structural impact matrixQ::Matrix{T}— rotation matrixgarch_params::Matrix{T}— (n × 3): [ω, α, β] per shockcond_var::Matrix{T}— (T_eff × n) conditional variancesshocks::Matrix{T}— structural shocksloglik::Tconverged::Booliterations::Int
MacroEconometricModels.SmoothTransitionSVARResult — Type
SmoothTransitionSVARResult{T} <: AbstractNonGaussianSVARResult from smooth-transition heteroskedasticity SVAR identification.
Fields:
B0::Matrix{T}— structural impact matrixQ::Matrix{T}— rotation matrixSigma_regimes::Vector{Matrix{T}}— covariance matrices for extreme regimesLambda::Vector{Vector{T}}— relative variances per regimegamma::T— transition speed parameterthreshold::T— transition location parametertransition_var::Vector{T}— transition variable valuesG_values::Vector{T}— transition function G(s_t) valuesloglik::Tconverged::Booliterations::Int
MacroEconometricModels.ExternalVolatilitySVARResult — Type
ExternalVolatilitySVARResult{T} <: AbstractNonGaussianSVARResult from external volatility instrument SVAR identification.
Fields:
B0::Matrix{T}— structural impact matrixQ::Matrix{T}— rotation matrixSigma_regimes::Vector{Matrix{T}}— covariance per regimeLambda::Vector{Vector{T}}— relative variances per regimeregime_indices::Vector{Vector{Int}}— observation indices per regimeloglik::T
MacroEconometricModels.IdentifiabilityTestResult — Type
IdentifiabilityTestResult{T}Result from an identifiability or specification test.
Fields:
test_name::Symbol— test identifierstatistic::T— test statisticpvalue::T— p-valueidentified::Bool— whether identification appears to holddetails::Dict{Symbol, Any}— method-specific details
Plotting Types
MacroEconometricModels.PlotOutput — Type
PlotOutputSelf-contained HTML document with inline D3.js visualization.
Fields
html::String: Complete HTML document string
Usage
p = plot_result(irf_result)
save_plot(p, "irf.html") # save to file
display_plot(p) # open in browserType Hierarchy
AbstractMacroData
├── TimeSeriesData{T}
├── PanelData{T}
└── CrossSectionData{T}
DataDiagnostic
DataSummary
Frequency (enum: Daily, Monthly, Quarterly, Yearly, Mixed, Other)
AbstractARIMAModel <: StatsAPI.RegressionModel
├── ARModel{T}
├── MAModel{T}
├── ARMAModel{T}
└── ARIMAModel{T}
AbstractVARModel
├── VARModel{T}
└── VECMModel{T}
VECMForecast{T}
VECMGrangerResult{T}
PVARModel{T} <: StatsAPI.RegressionModel
PVARStability{T}
PVARTestResult{T} <: StatsAPI.HypothesisTest
DIDResult{T} <: AbstractFrequentistResult
EventStudyLP{T}
BaconDecomposition{T}
PretrendTestResult{T}
NegativeWeightResult{T}
HonestDiDResult{T}
AbstractAnalysisResult
├── AbstractFrequentistResult
│ ├── ImpulseResponse{T}, FEVD{T}, HistoricalDecomposition{T}
└── AbstractBayesianResult
├── BayesianImpulseResponse{T}, BayesianFEVD{T}, BayesianHistoricalDecomposition{T}
AbstractImpulseResponse
├── ImpulseResponse{T}
├── BayesianImpulseResponse{T}
└── AbstractLPImpulseResponse
└── LPImpulseResponse{T}
AbstractFEVD
├── FEVD{T}
├── BayesianFEVD{T}
└── LPFEVD{T}
AbstractHistoricalDecomposition
├── HistoricalDecomposition{T}
└── BayesianHistoricalDecomposition{T}
AbstractFactorModel
├── FactorModel{T}
├── DynamicFactorModel{T}
└── GeneralizedDynamicFactorModel{T}
FactorForecast{T}
AbstractLPModel
├── LPModel{T}
├── LPIVModel{T}
├── SmoothLPModel{T}
├── StateLPModel{T}
└── PropensityLPModel{T}
StructuralLP{T}
LPForecast{T}
AbstractCovarianceEstimator
├── NeweyWestEstimator{T}
├── WhiteEstimator
└── DriscollKraayEstimator{T}
AbstractGMMModel
└── GMMModel{T}
AbstractPrior
└── MinnesotaHyperparameters{T}
BVARPosterior{T}
AbstractUnitRootTest <: StatsAPI.HypothesisTest
├── ADFResult{T}
├── KPSSResult{T}
├── PPResult{T}
├── ZAResult{T}
├── NgPerronResult{T}
└── JohansenResult{T}
VARStationarityResult{T}
LRTestResult{T} <: StatsAPI.HypothesisTest
LMTestResult{T} <: StatsAPI.HypothesisTest
GrangerCausalityResult{T} <: StatsAPI.HypothesisTest
AbstractNormalityTest <: StatsAPI.HypothesisTest
└── NormalityTestResult{T}
NormalityTestSuite{T}
AbstractNonGaussianSVAR
├── ICASVARResult{T}
├── NonGaussianMLResult{T}
├── MarkovSwitchingSVARResult{T}
├── GARCHSVARResult{T}
├── SmoothTransitionSVARResult{T}
└── ExternalVolatilitySVARResult{T}
IdentifiabilityTestResult{T}
AbstractVolatilityModel <: StatsAPI.RegressionModel
├── ARCHModel{T}
├── GARCHModel{T}
├── EGARCHModel{T}
├── GJRGARCHModel{T}
└── SVModel{T}
VolatilityForecast{T}
AbstractNowcastModel
├── NowcastDFM{T}
├── NowcastBVAR{T}
└── NowcastBridge{T}
NowcastResult{T}
NowcastNews{T}
DSGESpec{T}
LinearDSGE{T}
DSGESolution{T}
PerfectForesightPath{T}
AbstractDSGEModel
└── DSGEEstimation{T}
OccBinConstraint{T}
OccBinRegime{T}
OccBinSolution{T}
OccBinIRF{T}
StatsAPI.RegressionModel
├── RegModel{T} (OLS/WLS/IV)
├── LogitModel{T} (Binary logit MLE)
└── ProbitModel{T} (Binary probit MLE)
MarginalEffects{T}DSGE Models
MacroEconometricModels.AbstractDSGEModel — Type
Abstract supertype for DSGE models.
MacroEconometricModels.DSGESpec — Type
DSGESpec{T}Parsed DSGE model specification. Created by the @dsge macro.
Fields:
endog::Vector{Symbol}— endogenous variable names (possibly augmented)exog::Vector{Symbol}— exogenous shock namesparams::Vector{Symbol}— parameter namesparam_values::Dict{Symbol,T}— calibrated parameter valuesequations::Vector{Expr}— raw Julia equation expressions (possibly augmented)residual_fns::Vector{Function}— callablef(y_t, y_lag, y_lead, ε, θ) → scalarn_endog::Int— number of endogenous variables (including auxiliaries)n_exog::Int— number of exogenous shocksn_params::Int— number of parametersn_expect::Int— number of expectation errors (forward-looking variables)forward_indices::Vector{Int}— indices of equations with[t+1]termssteady_state::Vector{T}— steady state valuesvarnames::Vector{String}— display namesss_fn::Union{Nothing, Function}— optional analytical steady-state functionθ → y_ssoriginal_endog::Vector{Symbol}— pre-augmentation endogenous variable namesoriginal_equations::Vector{Expr}— pre-augmentation equation expressionsn_original_endog::Int— number of original endogenous variablesn_original_eq::Int— number of original equationsaugmented::Bool— whether model was augmented with auxiliary variablesmax_lag::Int— maximum lag order in the model (1 for standard, >1 if augmented)max_lead::Int— maximum lead order in the model (1 for standard, >1 if augmented)
MacroEconometricModels.LinearDSGE — Type
LinearDSGE{T}Linearized DSGE in Sims canonical form: Γ₀·y_t = Γ₁·y_{t-1} + C + Ψ·ε_t + Π·η_t.
Fields:
Gamma0::Matrix{T}— n × n coefficient on y_tGamma1::Matrix{T}— n × n coefficient on y_{t-1}C::Vector{T}— n × 1 constantsPsi::Matrix{T}— n × n_shocks shock loadingPi::Matrix{T}— n × n_expect expectation error selectionspec::DSGESpec{T}— back-reference to specification
MacroEconometricModels.DSGESolution — Type
DSGESolution{T}Rational expectations solution: y_t = G1·y_{t-1} + impact·ε_t + C_sol.
Fields:
G1::Matrix{T}— n × n state transition matriximpact::Matrix{T}— n × n_shocks impact matrixC_sol::Vector{T}— n × 1 constantseu::Vector{Int}— [existence, uniqueness]: 1=yes, 0=no, -1=indeterminatemethod::Symbol—:gensysor:blanchard_kahneigenvalues::Vector{ComplexF64}— generalized eigenvalues from QZspec::DSGESpec{T}— model specificationlinear::LinearDSGE{T}— linearized form
MacroEconometricModels.PerturbationSolution — Type
PerturbationSolution{T}Higher-order perturbation solution with Kim et al. (2008) pruning.
For order k, the decision rule is:
- Order 1:
z_t = z̄ + g_x·x̂_t - Order 2:
+ (1/2)·g_xx·(x̂_t ⊗ x̂_t) + (1/2)·g_σσ·σ² - Order 3:
+ (1/6)·g_xxx·(x̂_t ⊗ x̂_t ⊗ x̂_t) + (3/6)·g_σσx·σ²·x̂_t
Fields:
order— perturbation order (1, 2, or 3)gx, hx— first-order coefficients (controls: ny×nv, states: nx×nv)gxx, hxx, gσσ, hσσ— second-order (nothing if order < 2)gxxx, hxxx, gσσx, hσσx, gσσσ, hσσσ— third-order (nothing if order < 3)eta— shock loading matrix (nv × nu)steady_state— full steady state vectorstate_indices, control_indices— variable partitioneu— [existence, uniqueness] from first-ordermethod—:perturbationspec— model specificationlinear— linearized form
MacroEconometricModels.ProjectionSolution — Type
ProjectionSolution{T}Global policy function approximation via Chebyshev collocation.
The policy function is y = Σ_k coefficients[k] * T_k(x_scaled) where T_k are Chebyshev polynomials evaluated at states mapped to [-1,1].
Fields:
coefficients—n_vars × n_basisChebyshev coefficientsstate_bounds—nx × 2domain bounds[lower upper]per stategrid_type—:tensoror:smolyakdegree— polynomial degree (tensor) or Smolyak level μcollocation_nodes—n_nodes × nxgrid pointsresidual_norm— final||R||n_basis— number of basis functionsmulti_indices—n_basis × nxmulti-index matrixquadrature—:gauss_hermiteor:monomialspec— model specificationlinear— linearized formsteady_state— cached steady state vectorstate_indices, control_indices— variable partitionconverged— Newton convergence flagiterations— Newton iterations usedmethod—:projection
MacroEconometricModels.PerfectForesightPath — Type
PerfectForesightPath{T}Deterministic perfect foresight path.
Fields:
path::Matrix{T}— Tperiods × nendog level valuesdeviations::Matrix{T}— Tperiods × nendog deviations from SSconverged::Bool— Newton convergence flagiterations::Int— Newton iterations usedspec::DSGESpec{T}— model specification
MacroEconometricModels.DSGEEstimation — Type
DSGEEstimation{T} <: AbstractDSGEModelDSGE model estimated via GMM (IRF matching or Euler equation moments).
Fields:
theta::Vector{T}— estimated deep parametersvcov::Matrix{T}— asymptotic covariance matrixparam_names::Vector{Symbol}— names of estimated parametersmethod::Symbol—:irf_matchingor:euler_gmmJ_stat::T— Hansen J-test statisticJ_pvalue::T— J-test p-valuesolution::Union{DSGESolution{T}, PerturbationSolution{T}}— solution at estimated parametersconverged::Bool— optimization convergencespec::DSGESpec{T}— model specification
MacroEconometricModels.BayesianDSGE — Type
BayesianDSGE{T} <: AbstractDSGEModelBayesian DSGE estimation result container.
Fields:
theta_draws::Matrix{T}— ndraws x nparams posterior drawslog_posterior::Vector{T}— log posterior at each drawparam_names::Vector{Symbol}— parameter namespriors::DSGEPrior{T}— prior specificationlog_marginal_likelihood::T— log marginal likelihood (model evidence)method::Symbol— estimation method (:smc, :rwmh, :csmc, etc.)acceptance_rate::T— MCMC acceptance rateess_history::Vector{T}— ESS history (SMC) or empty (MCMC)phi_schedule::Vector{T}— tempering schedule (SMC) or empty (MCMC)spec::DSGESpec{T}— model specificationsolution::Union{DSGESolution{T}, PerturbationSolution{T}}— solution at posterior modestate_space::Union{DSGEStateSpace{T}, NonlinearStateSpace{T}}— state space at posterior mode
MacroEconometricModels.BayesianDSGESimulation — Type
BayesianDSGESimulation{T}Posterior predictive simulation result with pointwise quantile bands.
Fields:
quantiles::Array{T,3}— Tperiods x nvars x n_quantilespoint_estimate::Matrix{T}— Tperiods x nvars (posterior median)T_periods::Int— number of simulation periodsvariables::Vector{String}— variable namesquantile_levels::Vector{T}— quantile levels (e.g. [0.05, 0.16, 0.84, 0.95])all_paths::Array{T,3}— ndraws x Tperiods x n_vars (raw draws)
MacroEconometricModels.DSGEConstraint — Type
DSGEConstraint{T}Abstract type for DSGE model constraints (variable bounds and nonlinear inequalities).
MacroEconometricModels.VariableBound — Type
VariableBound{T} <: DSGEConstraint{T}Box constraint on an endogenous variable: lower <= var <= upper.
Fields
var_name::Symbol— endogenous variable name (must exist inspec.endog)lower::Union{T, Nothing}— lower bound (nothing = unbounded below)upper::Union{T, Nothing}— upper bound (nothing = unbounded above)
MacroEconometricModels.NonlinearConstraint — Type
NonlinearConstraint{T} <: DSGEConstraint{T}Nonlinear inequality constraint: fn(y, y_lag, y_lead, e, theta) <= 0.
The function signature matches @dsge residual functions. For steady state: evaluated with y_lag = y_lead = y, e = 0. For perfect foresight: evaluated at each period t.
Fields
fn::Function—(y, y_lag, y_lead, e, theta) -> scalar(must be <= 0 when satisfied)label::String— display label for diagnostics
MacroEconometricModels.ParameterTransform — Type
ParameterTransform{T<:AbstractFloat}Bijective parameter transform specification for constrained optimization.
Transform rules per element:
(-Inf, Inf)→ identity(0, Inf)→ exp/log(-Inf, 0)→ -exp/-log(a, b)→ logistic:a + (b-a) / (1 + exp(-x))
Fields
lower::Vector{T}— lower bounds (-Inf = unbounded below)upper::Vector{T}— upper bounds (Inf = unbounded above)
MacroEconometricModels.OccBinConstraint — Type
OccBinConstraint{T}A single occasionally binding constraint for OccBin piecewise-linear solution.
Fields:
expr::Expr— full constraint expression (e.g.,:(R >= 0))variable::Symbol— constrained variable namebound::T— constraint bound valuedirection::Symbol—:geqor:leqbind_expr::Expr— expression substituted when the constraint binds
MacroEconometricModels.OccBinRegime — Type
OccBinRegime{T}Linearized coefficient matrices for one regime (binding or slack).
Fields:
A::Matrix{T}— coefficient ony[t+1](expectation terms)B::Matrix{T}— coefficient ony[t](contemporaneous terms)C::Matrix{T}— coefficient ony[t-1](lagged terms)D::Matrix{T}— coefficient onε[t](shock impact)
MacroEconometricModels.OccBinSolution — Type
OccBinSolution{T}Piecewise-linear solution from the OccBin algorithm (Guerrieri & Iacoviello 2015).
Fields:
linear_path::Matrix{T}— Tperiods × nendog unconstrained linear pathpiecewise_path::Matrix{T}— Tperiods × nendog piecewise-linear pathsteady_state::Vector{T}— steady state valuesregime_history::Matrix{Int}— Tperiods × nconstraints regime indicators (0 = slack, 1+ = binding)converged::Bool— convergence flagiterations::Int— number of guess-and-verify iterationsspec::DSGESpec{T}— model specificationvarnames::Vector{String}— variable display namesconstraints::Vector{OccBinConstraint{T}}— constraint(s) used in the solve
MacroEconometricModels.OccBinIRF — Type
OccBinIRF{T}Impulse response comparison between unconstrained linear and OccBin piecewise-linear paths.
Fields:
linear::Matrix{T}— H × n_endog linear IRFpiecewise::Matrix{T}— H × n_endog piecewise-linear IRFregime_history::Matrix{Int}— H × n_constraints regime indicatorsvarnames::Vector{String}— variable display namesshock_name::String— name of the shocked variable
Panel Regression Models
MacroEconometricModels.PanelRegModel — Type
PanelRegModel{T} <: StatsAPI.RegressionModelLinear panel regression model estimated via Fixed Effects (FE), Random Effects (RE), First-Difference (FD), Between, or Correlated Random Effects (CRE).
Fields
beta::Vector{T}— estimated coefficientsvcov_mat::Matrix{T}— variance-covariance matrix of coefficientsresiduals::Vector{T}— residualsfitted::Vector{T}— fitted valuesy::Vector{T}— dependent variableX::Matrix{T}— regressor matrixr2_within::T— within R-squaredr2_between::T— between R-squaredr2_overall::T— overall R-squaredsigma_u::T— between-group standard deviationsigma_e::T— within-group standard deviationrho::T— fraction of variance due to ui: sigmau^2 / (sigmau^2 + sigmae^2)theta::Union{Nothing,T}— quasi-demeaning parameter (RE only)f_stat::T— F-statistic for joint significancef_pval::T— p-value of the F-testloglik::T— log-likelihoodaic::T— Akaike information criterionbic::T— Bayesian information criterionvarnames::Vector{String}— coefficient namesmethod::Symbol— :fe, :re, :fd, :between, :cretwoway::Bool— whether time fixed effects are includedcov_type::Symbol— covariance estimator (:ols, :robust, :cluster, :driscoll_kraay)n_obs::Int— number of observationsn_groups::Int— number of groupsn_periods_avg::T— average number of periods per groupgroup_effects::Union{Nothing,Vector{T}}— estimated group effects (FE only)data::PanelData{T}— original panel data
References
- Baltagi, B. H. (2021). Econometric Analysis of Panel Data. 6th ed. Springer.
- Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data. 2nd ed. MIT Press.
MacroEconometricModels.PanelIVModel — Type
PanelIVModel{T} <: StatsAPI.RegressionModelPanel instrumental-variables regression model (FE-IV, RE-IV, FD-IV, Hausman-Taylor).
Fields
beta::Vector{T}— estimated coefficientsvcov_mat::Matrix{T}— variance-covariance matrixresiduals::Vector{T}— residualsfitted::Vector{T}— fitted valuesy::Vector{T}— dependent variableX::Matrix{T}— regressor matrixZ::Matrix{T}— instrument matrixr2_within::T— within R-squaredr2_between::T— between R-squaredr2_overall::T— overall R-squaredsigma_u::T— between-group standard deviationsigma_e::T— within-group standard deviationrho::T— fraction of variance due to u_ifirst_stage_f::T— first-stage F-statisticsargan_stat::Union{Nothing,T}— Sargan overidentification statisticsargan_pval::Union{Nothing,T}— Sargan test p-valuevarnames::Vector{String}— coefficient namesendog_names::Vector{String}— endogenous variable namesinstrument_names::Vector{String}— instrument namesmethod::Symbol— :feiv, :reiv, :fdiv, :hausmantaylorcov_type::Symbol— covariance estimatorn_obs::Int— number of observationsn_groups::Int— number of groupsdata::PanelData{T}— original panel data
References
- Baltagi, B. H. (2021). Econometric Analysis of Panel Data. 6th ed. Springer.
- Hausman, J. A. & Taylor, W. E. (1981). Econometrica 49(6), 1377-1398.
MacroEconometricModels.PanelLogitModel — Type
PanelLogitModel{T} <: StatsAPI.RegressionModelPanel logistic regression model (pooled, FE conditional, RE, CRE).
Fields
beta::Vector{T}— estimated coefficientsvcov_mat::Matrix{T}— variance-covariance matrixy::Vector{T}— binary dependent variable (0/1)X::Matrix{T}— regressor matrixfitted::Vector{T}— predicted probabilitiesloglik::T— maximized log-likelihoodloglik_null::T— null model log-likelihoodpseudo_r2::T— McFadden's pseudo R-squaredaic::T— Akaike information criterionbic::T— Bayesian information criterionsigma_u::Union{Nothing,T}— RE standard deviation (nothing for FE/pooled)rho::Union{Nothing,T}— fraction of variance due to u_i (RE only)varnames::Vector{String}— coefficient namesmethod::Symbol— :pooled, :fe, :re, :crecov_type::Symbol— covariance estimatorconverged::Bool— whether optimization convergediterations::Int— number of iterationsn_obs::Int— number of observationsn_groups::Int— number of groupsdata::PanelData{T}— original panel data
References
- Chamberlain, G. (1980). Review of Economic Studies 47(1), 225-238.
- Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data. 2nd ed. MIT Press.
MacroEconometricModels.PanelProbitModel — Type
PanelProbitModel{T} <: StatsAPI.RegressionModelPanel probit regression model (pooled, FE conditional, RE, CRE). Identical structure to PanelLogitModel{T}, using the standard normal CDF link.
References
- Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data. 2nd ed. MIT Press.
Ordered and Multinomial Models
MacroEconometricModels.OrderedLogitModel — Type
OrderedLogitModel{T} <: StatsAPI.RegressionModelOrdered logistic regression model estimated via maximum likelihood.
Fields
y::Vector{Int}– dependent variable (remapped to 1:J)X::Matrix{T}– regressor matrix (no intercept)beta::Vector{T}– slope coefficients (K)cutpoints::Vector{T}– cutpoints/thresholds (J-1)vcov_mat::Matrix{T}– joint vcov of beta; cutpointsfitted::Matrix{T}– predicted probabilities (n x J)loglik::T– maximized log-likelihoodloglik_null::T– null model log-likelihood (cutpoints only)pseudo_r2::T– McFadden's pseudo R-squaredaic::T– Akaike information criterionbic::T– Bayesian information criterionvarnames::Vector{String}– coefficient namescategories::Vector– original category valuesconverged::Bool– whether optimization convergediterations::Int– number of iterations performedcov_type::Symbol– covariance estimator
References
- McCullagh, P. (1980). JRSS B 42(2), 109-142.
- Agresti, A. (2010). Analysis of Ordinal Categorical Data. 2nd ed. Wiley.
MacroEconometricModels.OrderedProbitModel — Type
OrderedProbitModel{T} <: StatsAPI.RegressionModelOrdered probit regression model estimated via maximum likelihood.
Same fields as OrderedLogitModel{T}, using the standard normal CDF as the link function.
References
- McCullagh, P. (1980). JRSS B 42(2), 109-142.
- Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data. 2nd ed. MIT Press.
MacroEconometricModels.MultinomialLogitModel — Type
MultinomialLogitModel{T} <: StatsAPI.RegressionModelMultinomial logistic regression model estimated via maximum likelihood.
Fields
y::Vector{Int}– dependent variable (remapped to 1:J)X::Matrix{T}– regressor matrix (n x K, with intercept if desired)beta::Matrix{T}– coefficient matrix (K x (J-1)), base category = 1vcov_mat::Matrix{T}– vcov of vec(beta), K(J-1) x K(J-1)fitted::Matrix{T}– predicted probabilities (n x J)loglik::T– maximized log-likelihoodloglik_null::T– null model log-likelihood: n * log(1/J)pseudo_r2::T– McFadden's pseudo R-squaredaic::T– Akaike information criterionbic::T– Bayesian information criterionvarnames::Vector{String}– coefficient namescategories::Vector– original category valuesconverged::Bool– whether optimization convergediterations::Int– number of iterations performedcov_type::Symbol– covariance estimator
References
- McFadden, D. (1974). Conditional logit analysis of qualitative choice behavior. In P. Zarembka (Ed.), Frontiers in Econometrics (pp. 105-142). Academic Press.
- Train, K. E. (2009). Discrete Choice Methods with Simulation. 2nd ed. Cambridge Univ. Press.
FAVAR Models
MacroEconometricModels.FAVARModel — Type
FAVARModel{T} <: AbstractVARModelFactor-Augmented VAR model (Bernanke, Boivin & Eliasz, 2005).
The FAVAR system estimates a VAR on [Ft, Ykey,t] where Ft are latent factors extracted from a large panel X, and Ykey are observed key variables (e.g., the federal funds rate).
Fields
Y::Matrix{T}: Augmented data [F, Ykey] used in VAR (Teff × (r+n_key))p::Int: VAR lag orderB::Matrix{T}: VAR coefficient matrix ((1+p*(r+nkey)) × (r+nkey))U::Matrix{T}: VAR residualsSigma::Matrix{T}: Residual covariancevarnames::Vector{String}: Variable names in VAR (["F1","F2",...,"Y1","Y2",...])X_panel::Matrix{T}: Original panel data (T_obs × N)panel_varnames::Vector{String}: Panel variable names (length N)Y_key_indices::Vector{Int}: Column indices of key variables in X_paneln_factors::Int: Number of latent factors rn_key::Int: Number of key observed variablesfactors::Matrix{T}: Extracted factors (T_obs × r)loadings::Matrix{T}: Factor loadings (N × r)factor_model::FactorModel{T}: Underlying factor model from PCAaic::T: Akaike information criterionbic::T: Bayesian information criterionloglik::T: Log-likelihood
MacroEconometricModels.BayesianFAVAR — Type
BayesianFAVAR{T}Bayesian FAVAR with posterior draws of coefficients, covariances, factors, and loadings.
Fields
B_draws::Array{T,3}: Coefficient draws (ndraws × k × nvar)Sigma_draws::Array{T,3}: Covariance draws (ndraws × nvar × n_var)factor_draws::Array{T,3}: Factor draws (ndraws × Tobs × r)loadings_draws::Array{T,3}: Loading draws (n_draws × N × r)X_panel::Matrix{T}: Original panel data (T_obs × N)panel_varnames::Vector{String}: Panel variable namesY_key_indices::Vector{Int}: Key variable column indicesn_factors::Int: Number of factorsn_key::Int: Number of key variablesn::Int: Total VAR variables (r + n_key)p::Int: VAR lag orderdata::Matrix{T}: Augmented VAR data [F, Y_key]varnames::Vector{String}: VAR variable names
Structural DFM
MacroEconometricModels.StructuralDFM — Type
StructuralDFM{T} <: AbstractFactorModelStructural Dynamic Factor Model combining GDFM with structural identification.
Fields
gdfm::GeneralizedDynamicFactorModel{T}: Underlying GDFM estimationfactor_var::VARModel{T}: VAR(p) fitted on q common factorsB0::Matrix{T}: Impact matrix (q x q), B0 = chol(Sigma) * QQ::Matrix{T}: Rotation/identification matrix (q x q)identification::Symbol: Identification method (:cholesky or :sign)structural_irf::Array{T,3}: Panel-wide structural IRFs (H x N x q)loadings_td::Matrix{T}: Time-domain loadings (N x q), Lambda = (F'F)^{-1} F' Xp_var::Int: VAR lag order on factorsshock_names::Vector{String}: Names for structural shocks
Spectral Analysis Types
MacroEconometricModels.SpectralDensityResult — Type
SpectralDensityResult{T} <: AbstractAnalysisResultResult from spectral density estimation (periodogram, Welch, smoothed, AR).
Fields
freq::Vector{T}— frequency grid [0, π]density::Vector{T}— estimated spectral densityci_lower::Vector{T}— lower confidence boundci_upper::Vector{T}— upper confidence boundmethod::Symbol— estimation method (:periodogram, :welch, :smoothed, :ar)bandwidth::T— effective bandwidthnobs::Int— number of observations
MacroEconometricModels.CrossSpectrumResult — Type
CrossSpectrumResult{T} <: AbstractAnalysisResultResult from cross-spectral analysis between two series.
Fields
freq::Vector{T}— frequency grid [0, π]co_spectrum::Vector{T}— co-spectrum (real part of cross-spectral density)quad_spectrum::Vector{T}— quadrature spectrum (negative imaginary part)coherence::Vector{T}— squared coherence ∈ [0, 1]phase::Vector{T}— phase spectrum (radians)gain::Vector{T}— gain (amplitude ratio)nobs::Int— number of observations
MacroEconometricModels.TransferFunctionResult — Type
TransferFunctionResult{T} <: AbstractAnalysisResultResult from transfer function (frequency response) analysis of a filter.
Fields
freq::Vector{T}— frequency grid [0, π]gain::Vector{T}— gain (amplitude) at each frequencyphase::Vector{T}— phase shift (radians) at each frequencyfilter::Symbol— filter type (:hp, :bk, :hamilton, :ideal_bandpass)
MacroEconometricModels.ACFResult — Type
ACFResult{T} <: AbstractAnalysisResultResult from autocorrelation, partial autocorrelation, or cross-correlation analysis.
Fields
lags::Vector{Int}— lag indicesacf::Vector{T}— autocorrelation valuespacf::Vector{T}— partial autocorrelation valuesci::T— confidence interval half-width (±1.96/√n by default)ccf::Union{Nothing,Vector{T}}— cross-correlation values (forccf())q_stats::Vector{T}— cumulative Ljung-Box Q-statisticsq_pvalues::Vector{T}— p-values of Q-statisticsnobs::Int— number of observations
Portmanteau Test Types
MacroEconometricModels.LjungBoxResult — Type
LjungBoxResult{T} <: StatsAPI.HypothesisTestResult from the Ljung-Box Q test for serial correlation.
Fields
statistic::T— Q-statisticpvalue::T— p-value (χ² distribution)df::Int— degrees of freedomlags::Int— number of lags testednobs::Int— number of observations
MacroEconometricModels.BoxPierceResult — Type
BoxPierceResult{T} <: StatsAPI.HypothesisTestResult from the Box-Pierce Q test for serial correlation.
Fields
statistic::T— Q₀-statisticpvalue::T— p-value (χ² distribution)df::Int— degrees of freedomlags::Int— number of lags testednobs::Int— number of observations
MacroEconometricModels.DurbinWatsonResult — Type
DurbinWatsonResult{T} <: StatsAPI.HypothesisTestResult from the Durbin-Watson test for first-order serial correlation.
Fields
statistic::T— DW statistic ∈ [0, 4]pvalue::T— approximate p-valuenobs::Int— number of observations
MacroEconometricModels.BartlettWhiteNoiseResult — Type
BartlettWhiteNoiseResult{T} <: StatsAPI.HypothesisTestResult from Bartlett's cumulative periodogram test for white noise.
Fields
statistic::T— Kolmogorov-Smirnov statistic (max deviation from uniform)pvalue::T— approximate p-valuenobs::Int— number of observations
MacroEconometricModels.FisherTestResult — Type
FisherTestResult{T} <: StatsAPI.HypothesisTestResult from Fisher's test for periodicity (hidden periodicities in data).
Fields
statistic::T— Fisher's g statistic (max periodogram / sum)pvalue::T— p-valuepeak_freq::T— frequency with maximum periodogram valuenobs::Int— number of observations
Advanced Test Types
MacroEconometricModels.FourierADFResult — Type
FourierADFResult{T} <: AbstractUnitRootTestFourier ADF unit root test result (Enders & Lee 2012).
MacroEconometricModels.FourierKPSSResult — Type
FourierKPSSResult{T} <: AbstractUnitRootTestFourier KPSS stationarity test result (Becker, Enders & Lee 2006).
MacroEconometricModels.DFGLSResult — Type
DFGLSResult{T} <: AbstractUnitRootTestDF-GLS unit root test result (Elliott, Rothenberg & Stock 1996). Also reports ERS Pt statistic and Ng-Perron MGLS statistics.
MacroEconometricModels.LMUnitRootResult — Type
LMUnitRootResult{T} <: AbstractUnitRootTestLM unit root test result (Schmidt-Phillips 1992; Lee-Strazicich 2003, 2013).
MacroEconometricModels.ADF2BreakResult — Type
ADF2BreakResult{T} <: AbstractUnitRootTestADF unit root test with two structural breaks (Narayan & Popp 2010).
MacroEconometricModels.GregoryHansenResult — Type
GregoryHansenResult{T} <: AbstractUnitRootTestGregory-Hansen cointegration test with structural break (Gregory & Hansen 1996).
MacroEconometricModels.AndrewsResult — Type
AndrewsResult{T} <: AbstractUnitRootTestAndrews (1993) / Andrews-Ploberger (1994) structural break test result.
Tests for a single unknown structural break point in a linear regression by computing sup-Wald, exp-Wald, or mean-Wald statistics over a trimmed range of candidate break dates.
Fields:
statistic: Test statistic (sup-Wald, exp-Wald, or mean-Wald)pvalue: Approximate p-value from Hansen (1997) critical valuesbreak_index: Index of estimated break date (for sup-Wald)break_fraction: Break date as fraction of sampletest_type: Type of test (:supwald, :expwald, :meanwald)critical_values: Critical values at 1%, 5%, 10% levelsstat_sequence: Full sequence of Wald statistics across candidate breakstrimming: Trimming fraction (e.g., 0.15)nobs: Number of observationsn_params: Number of parameters tested for instability
MacroEconometricModels.BaiPerronResult — Type
BaiPerronResult{T} <: AbstractUnitRootTestBai-Perron (1998, 2003) multiple structural break test result.
Tests for multiple unknown structural break points using sequential and simultaneous procedures, with BIC/LWZ information criteria for break number selection.
Fields:
n_breaks: Estimated number of breaksbreak_dates: Estimated break date indicesbreak_cis: Confidence intervals for break dates as (lower, upper) tuplesregime_coefs: Coefficient estimates for each regimeregime_ses: Standard errors for each regimesupf_stats: sup-F(l) statistics for l = 1, ..., max_breakssupf_pvalues: P-values for sup-F testssequential_stats: Sequential sup-F(l+1|l) statisticssequential_pvalues: P-values for sequential testsbic_values: BIC for each number of breaks (0, 1, ..., max_breaks)lwz_values: LWZ (modified Schwarz) for each number of breakstrimming: Trimming fraction (e.g., 0.15)nobs: Number of observations
MacroEconometricModels.FactorBreakResult — Type
FactorBreakResult{T} <: AbstractUnitRootTestStructural break test for factor models.
Tests for structural instability in factor loadings or the number of factors, following Breitung-Eickmeier (2011) or Chen-Dolado-Gonzalo (2014).
Fields:
statistic: Test statisticpvalue: P-valuebreak_date: Estimated break date index (nothing if no break detected)method: Test method (:breitungeickmeier, :chendolado_gonzalo)n_factors: Number of factors in the modelnobs: Time dimension (T)n_vars: Number of observed variables
MacroEconometricModels.PANICResult — Type
PANICResult{T} <: AbstractUnitRootTestBai-Ng (2004, 2010) PANIC (Panel Analysis of Nonstationarity in Idiosyncratic and Common components) test result.
Decomposes panel data into common factors and idiosyncratic components via principal components, then tests each for unit roots separately.
Fields:
factor_adf_stats: ADF statistics for each estimated common factorfactor_adf_pvalues: P-values for factor ADF testspooled_statistic: Pooled test statistic for idiosyncratic componentspooled_pvalue: P-value for pooled testindividual_stats: Individual unit ADF statistics on defactored dataindividual_pvalues: Individual unit p-valuesn_factors: Number of common factors usedmethod: Pooling method (:pooled, :modified)nobs: Time dimension (T)n_units: Cross-section dimension (N)
MacroEconometricModels.PesaranCIPSResult — Type
PesaranCIPSResult{T} <: AbstractUnitRootTestPesaran (2007) CIPS (Cross-sectionally Augmented IPS) panel unit root test result.
Augments individual ADF regressions with cross-section averages to account for cross-sectional dependence. The CIPS statistic is the average of individual CADF statistics.
Fields:
cips_statistic: Cross-sectionally augmented IPS statistic (average of CADF)pvalue: Approximate p-value from Pesaran (2007) critical value tablesindividual_cadf_stats: CADF statistics for each cross-section unitcritical_values: Critical values at 1%, 5%, 10% levelslags: Number of augmenting lagsdeterministic: Deterministic specification (:none, :constant, :trend)nobs: Time dimension (T)n_units: Cross-section dimension (N)
MacroEconometricModels.MoonPerronResult — Type
MoonPerronResult{T} <: AbstractUnitRootTestMoon-Perron (2004) panel unit root test result.
Uses factor-adjusted t-statistics for testing the unit root null in panels with cross-sectional dependence. Reports two test statistics (ta and tb) with different bias corrections.
Fields:
t_a_statistic: First modified t-statistic (t_a^*)t_b_statistic: Second modified t-statistic (t_b^*)pvalue_a: P-value for t_a^* (standard normal under H0)pvalue_b: P-value for t_b^* (standard normal under H0)n_factors: Number of common factors estimatednobs: Time dimension (T)n_units: Cross-section dimension (N)
LP-DiD Types
MacroEconometricModels.LPDiDResult — Type
LPDiDResult{T<:AbstractFloat}LP-DiD estimation result with full Dube, Girardi, Jordà & Taylor (2025) specification.
Fields
Event Study
coefficients::Vector{T}— treatment effects β_h at each event-timese::Vector{T}— standard errorsci_lower::Vector{T}— lower CI boundsci_upper::Vector{T}— upper CI boundsevent_times::Vector{Int}— event-time gridreference_period::Int— omitted period (typically -1)nobs_per_horizon::Vector{Int}— effective observations per horizon
Pooled Estimates
pooled_post— NamedTuple (coef, se, cilower, ciupper, nobs) or nothingpooled_pre— NamedTuple (coef, se, cilower, ciupper, nobs) or nothing
Regression Details
vcov::Vector{Matrix{T}}— VCV matrices per horizon
Metadata
outcome_var::String— outcome variable nametreatment_var::String— treatment variable nameT_obs::Int— total observations in paneln_groups::Int— number of panel unitsspecification::Symbol— :absorbing, :nonabsorbing, or :oneoffpmd::Union{Nothing,Symbol,Int}— PMD specificationreweight::Bool— whether IPW reweighting was usednocomp::Bool— whether composition changes were ruled outylags::Int— number of outcome lags as controlsdylags::Int— number of ΔY lags as controlspre_window::Int— pre-treatment event windowpost_window::Int— post-treatment event windowcluster::Symbol— clustering levelconf_level::T— confidence leveldata::PanelData{T}— original panel data
References
- Dube, A., Girardi, D., Jordà, Ò. & Taylor, A.M. (2025). JAE.
- Acemoglu, D. et al. (2019). JPE 127(1), 47-100.