0

I have some data and I just plotted the empirical cumulative distribution using Ecdf like this:

Ecdf(data)

Now, I tried to adjust the parameters (lambda, mu, sigma) for a mixture of two normals to this data, and now I would like to plot the cdf of this model using and explicit function over the plot created by Ecdf, is there any way to do this or I just have to simulate data so then I can use again Ecdf?

The explicit function, just to illustrate is something like:

ipc_values_EM$lambda[1] * dnorm(x, ipc_values_EM$mu[1], ipc_values_EM$sigma[1]) 
+
ipc_values_EM$lambda[2] * dnorm(x, ipc_values_EM$mu[2], ipc_values_EM$sigma[2]) 

(as you can note, is the mixture of two normals different mu's and different sigmas)

user1317221_G
  • 15,087
  • 3
  • 52
  • 78
natorro
  • 2,793
  • 3
  • 19
  • 16
  • This is more of a stats question but you could easily define a function which is the cdf of the mixture. You would just replace the dnorm by pnorm in your case. – Dason May 20 '12 at 12:10
  • Thank you very much, I just tried it and it worked perfectly :-) (I'll try to post any question like that to the stats forum next time). – natorro May 21 '12 at 10:11

0 Answers0