function ttY = GMRpredict(ttX, model)
	% ttX is the pose values (#frames x 3)
	%project ttX onto GMs and do reconstruction.
	nttX = size(ttX,1);
	ttXp = zeros(nttX, length(model.Gmean(:)));
	E =ones(size(model.Gmean,1),1);

    % size(ttX) % 833 x 3
    % size(model.Gmean) % 8 x 3
    % size(E) % 8 x 1

%    tmpSigma1=(2*E*model.Gsigma.^2)
%    tmpSigma2=(E*model.Gsigma * sqrt(2*pi))

	for i=1:nttX
%        if( i == 1 )
%            debug=-(E*ttX(i,:) - model.Gmean).^2
%        end
		% f=exp(-(E*ttX(i,:) - model.Gmean).^2 ./ (2*E*model.Gsigma.^2)) ./ (E*model.Gsigma * sqrt(2*pi));
		f=exp(-(E*ttX(i,:) - model.Gmean).^2 ./ (2*E*model.Gsigma.^2)) ./ (E*model.Gsigma * sqrt(2*pi));
		ttXp(i,:) = f(:)';
	end

	%prediction
%    ttY = ttXp;
	ttY = ttXp * model.c;
