simulates a factor model in R for debugging and testing factor models