R/m.step.2normal.R

Defines functions m.step.2normal

Documented in m.step.2normal

m.step.2normal <-
function(z.1, z.2, e.z){

  p <- mean(e.z)
  mu <- sum((z.1+z.2)*e.z)/2/sum(e.z) 
  sigma <- sqrt(sum(e.z*((z.1-mu)^2+(z.2-mu)^2))/2/sum(e.z))
  rho <- 2*sum(e.z*(z.1-mu)*(z.2-mu))/(sum(e.z*((z.1-mu)^2+(z.2-mu)^2)))

  return(list(p=p, mu=mu, sigma=sigma, rho=rho))
}

Try the idr package in your browser

Any scripts or data that you put into this service are public.

idr documentation built on June 21, 2022, 9:05 a.m.