How to generate distributions given, mean, SD, skew and kurtosis in R?

前端 未结 8 1890
既然无缘
既然无缘 2020-11-28 04:03

Is it possible to generate distributions in R for which the Mean, SD, skew and kurtosis are known? So far it appears the best route would be to create random numbers and tra

8条回答
  •  离开以前
    2020-11-28 04:32

    I agree you need density estimation to replicate any distribution. However, if you have hundreds of variables, as is typical in a Monte Carlo simulation, you would need to have a compromise.

    One suggested approach is as follows:

    1. Use the Fleishman transform to get the coefficient for the given skew and kurtosis. Fleishman takes the skew and kurtosis and gives you the coefficients
    2. Generate N normal variables (mean = 0, std = 1)
    3. Transform the data in (2) with the Fleishman coefficients to transform the normal data to the given skew and kurtosis
    4. In this step, use data from from step (3) and transform it to the desired mean and standard deviation (std) using new_data = desired mean + (data from step 3)* desired std

    The resulting data from Step 4 will have the desired mean, std, skewness and kurtosis.

    Caveats:

    1. Fleishman will not work for all combinations of skewness and kurtois
    2. Above steps assume non-correlated variables. If you want to generate correlated data, you will need a step before the Fleishman transform

提交回复
热议问题