sigma_sim: Simulated Covariance Matrix

View source: R/cov_help_funcs.R

sigma_simR Documentation

Simulated Covariance Matrix

Description

Simulates a covariance matrix with specific properties

Usage

sigma_sim(p, corr_min, corr_max, vola_min, vola_max)

Arguments

p

an integer, indicating the number of variables.

corr_min

a double, indicating the minimum possible correlation across the p variables.

corr_max

a double, indicating the maximum possible correlation across the p variables (except the correlation with self of 1).

vola_min

a double, indicating the minimum possible volatility of the p variables.

vola_max

a double, indicating the maximum possible volatility of the p variables.

Details

The correlation and volatility values are drown from a uniform distribution. A condition for positive-definiteness of the resulting covariance matrix is not implemented.

Value

a pxp covariance matrix.

Examples

sim_sigma <- sigma_sim(100, corr_min = 0.01, corr_max = 0.40, vola_min = 0.05, vola_max = 0.30)


antshi/CovEstim documentation built on June 10, 2025, 3:11 a.m.