I have an input dataframe df_input with 10 variables and 100 rows. This data are not normal distributed.
I would like to generate an output dataframe with 10 variables and 10,000 rows, such that the covariance matrix and mean of the new dataframe are the same as those of the original one. The output variables should not be normal distributed, but rather have a distribution similar to the input variables.
That is:
Cov(df_output) = Cov(df_input) and
mean(df_ouput) = mean(df_input)
Is there a Python function that does it?
Note: np.random.multivariate_normal(mean_input,Cov_input,10000) does almost this, but the output variables are normal distributed, whereas I need them to have the same (or similar) distribution as the input.
question from:
https://stackoverflow.com/questions/65877211/how-can-i-generate-samples-from-a-non-normal-multivariable-distribution-in-pytho 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…