function [Est] = HMMVAR(trajec, initViterbi)

javaclasspath({
   '/home/cocktail/luedge/mbtoolkit/torsten/FRETanalyser/netbeans_project/dist/lib/MolTools.jar', ...
   '/home/cocktail/luedge/mbtoolkit/torsten/FRETanalyser/netbeans_project/build/classes', ...
   '/home/cocktail/luedge/mbtoolkit/torsten/FRETanalyser/netbeans_project/dist/lib/colt103.jar',...
   '/home/cocktail/luedge/NetBeansProjects/Metamacs/dist/Metamacs.jar'});
import biocomp.metamacs.hmm.newImplementation.HMMVAR;


hmm=HMMVAR(trajec, 4, 1, []); 
hmm.initializeModel(InitVP);
MLH=hmm.EMcorrect(1000, 0.00001, true);

S=hmm.getCovariances();
Phi=hmm.getRegressionMatrices;
expTauF=Phi(:,2:size(Phi,2));


Est.VitP = hmm.computeViterbiPath(); 
Est.RegM = squeeze(Phi(1,:,:));
Est.CovM = squeeze(S(1,:,:));
Est.TransM = hmm.getTransitionMatrix();
Est.mu = inv(eye(size(expTauF))-expTauF)*Phi(1,:);
Est.expTauF = expTauF;
Est.mlh=MLH;
