function Est=HMMG(trajec, dimHmm, previterbi, steps)
javaclasspath({
   '/home/cocktail/meerbach/Netbeans_projects/Metamacs/dist/lib/colt.jar'...
   '/home/cocktail/meerbach/javawerkstatt/Metamacs/lib/concurrent.jar'...
   '/home/cocktail/meerbach/Netbeans_projects/Metamacs/build/classes/'...
   '/home/cocktail/luedge/mbtoolkit/torsten/FRETanalyser/netbeans_project/build/classes'...
   
  });


import biocomp.metamacs.hmm.newImplementation.HMMGAUSSIAN;

size(trajec,1)
precision=1.0000e-04;
%% -------- Create random Viterbipath if not given (poor results)
if  previterbi==0;
previterbi=randViterbi(dimHmm,size(trajec,1));
Est.preVit=previterbi;
else
end
%% -       Estimate with HMMGAUSSIAN    -
hmm=HMMGAUSSIAN(trajec, dimHmm); 
hmm.initializeModel(previterbi)
Est.hmm=hmm;
Est.MLH = hmm.EM(steps, precision);




%% -       final Viterbi-path        -
Est.viterbi=hmm.computeViterbiPath(); 

%% --------get-estimated parameter----------
Est.TransitionMatrix=hmm.P;
Est.mu=hmm.Mu;
Est.RegM=hmm.R;
Est.ObsProb = hmm.B;
Est.InitDist = hmm.startDistMC;
Est.FwBw = hmm.gammas;
Est.FW = hmm.alphas;
Est.BW = hmm.betas;



