% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/robust_m_step.R
\name{robust_m_step}
\alias{robust_m_step}
\title{Perform a Robust M-Step for Latent Profile Analysis}
\usage{
robust_m_step(data, z, alpha = 0.05)
}
\arguments{
\item{data}{A matrix or data.frame of observations.}

\item{z}{A numeric vector containing the posterior probabilities of belonging to this cluster.}

\item{alpha}{Significance level for the Chi-squared outlier cutoff (default is 0.05).}
}
\value{
A list containing the robust 'mean' vector and the robust 'covariance' matrix.
}
\description{
Perform a Robust M-Step for Latent Profile Analysis
}
\examples{
data(iris)
# Simulate initial probabilities for a single profile
z_init <- runif(30)
z_init <- z_init / sum(z_init)

m_step_res <- robust_m_step(iris[1:30, 1:2], z = z_init)

# Print the robust mean calculated in the M-step
m_step_res$mean
}
