0

I am fitting mixture models to data and assessing how mixtures with more or less components will fit the data. To do this, I am going to plot the cdf of the empirical data and the cdf of my mixture model with k components. As an example, here is a cdf of the empirical data plotted beside a mixture of lognormal distributions with 2 components.

enter image description here

My question is: how do I use scipy's kstest to determine the goodness of fit for the mixture model on the empirical data?

ss.kstest(Y,y_cdf)

Above is the code that I tried where Y is the data I used to fit the model and make the empirical cdf and y_cdf is the cdf of the mixture model.

I am unsure if this is correct as the value for D returned seems quite high.

desertnaut
  • 2,154
  • 2
  • 16
  • 25

0 Answers0