Autoregressive (AR(1)) Covariance Matrix for Mediator Simulation
Source:R/mediation_ar1_cov.R
mediation_ar1_cov.RdBuilds the \(p \times p\) first-order autoregressive covariance matrix \(\Sigma = (\rho^{|i-j|})_{i,j}\), the intercorrelation structure imposed on the mediator noise throughout the article's Monte Carlo studies. It is exported as a small reusable utility so a user can inspect or reuse the exact covariance the simulations use.
Arguments
- p
Number of mediators (matrix dimension); a positive integer.
- rho
Autocorrelation parameter in \((-1, 1)\). The covariance between mediators \(i\) and \(j\) is \(\rho^{|i-j|}\), so nearby mediators are more strongly correlated and the correlation decays geometrically with separation. Default 0.5, the value used in the article.
Value
A \(p \times p\) numeric matrix with ones on the diagonal and \(\rho^{|i-j|}\) off the diagonal.
See also
simulate_mediation_data(), which uses this covariance to
draw correlated mediator noise.
Other mediation simulation:
guo_calibration,
pe_identification_study(),
pe_power_curve(),
pe_simulation_study(),
plot.poemed_tbl(),
simulate_guo_mediation(),
simulate_mediation_data(),
ss_power_pe_mediation()