If I have calculated the sample mean, variance, skew and kurtosis of a set of data, how would I go about fitting a probability distribution to match these moments (i.e. choosing a probability distribution and optimizing its parameters to fit the sample moments). Are there any packages in R/MATLAB/etc. that are capable of this?
For context, I believe I can calculate these moments for a portfolio's return distribution, but I actually need a whole probability density function for the portfolio's returns in order to perform additional analysis.