
em: Expectation Maximization algorithm:
    computes the individual contributions of the components of a non-equilibrium
    work distribution given by a mixture of n normal distributions with n=1 to n=4.
    The free energy DG is computed using the CT formula
    exp(-beta DG) = sum_i c_i * exp(-beta( <W> -beta*sigma^2/2))
    

For EM see DOI: 10.1063/1.4918558 
For Unbiased CT-based estimates using normal mixtures see  DOI: 10.1063/1.4918558

Syntax: 
         em [frac seedx ] workfile
         workfile is the work file
            frac/seedx are optional arguments:
            frac -> is the bootstrap fraction 
            seedx -> is the seedx for random numbers
 

To run an expectation maximization  algorithm on the collection of work values
(given in kJ mole) reported in the 'test.wrk' file in  sample-data dir do the
following: 

cd into src/ and build the em executable using the command 

$ make

cd into sample-data/ and give the command 

$ ../src/em test.wrk

To run the em algorithm on half bootstrapped sample out of the test.wrk file do

$ ../src/em 0.5 1 test.wrk

To obtain the bootstrap error for (e.g.) a three component mixtures
using 20% of the values in the work file in 'test.wrk' issue the command:

$ for i in {1..40} ; do ../src/em 0.2 $i test.wrk    ; done  | grep "Components=  3" | awk '{a+=$4; a2+=$4^2; l+=$9 }END{print a/NR,"+/-",sqrt(a2/NR-(a/NR)^2),l/NR}'

