tests/snmm_fit_em_002.R

library( datasets )
library( MixtureFitting )

x = faithful[,1]
# Resulting values taken from Lin et al. (2007), Statistica Sinica 17, 909-92, Table 3
p = c( 0.3487, 1 - 0.3487, 1.7267, 4.8026, 0.3801, 0.6857, 5.8026, -3.4951 )

sf = snmm_fit_em( x, snmm_init_vector( x, 2 ) )

if( !all( abs( sf - p ) < 0.1 ) ) {
    stop( sf )
}

Try the MixtureFitting package in your browser

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

MixtureFitting documentation built on May 18, 2026, 5:07 p.m.