simulate_data_factor function

Simulate data according to factor model