n(ntrials,ncov,nsamples); 
    Z = k.test(U);
    figure
    plot(squeeze(Y(1,:,:))','k--','LineWidth',2);
    hold on;
    plot(zscore(squeeze(Z(1,:,:))'),'r','LineWidth',2);
    plot(squeeze(X(1,:,:))','bo');
    legend('real','predicted','observed');
  
    k = dml.lds('inference','smooth','verbose',true);
    k = k.train(X,[Y nan(size(Y))]); % mixture of hidden + observed states
    U = repmat(Y,[1 ncov 1]) + 0.1*randn(ntrials,ncov,nsamples); 
    Z = k.test(X);
    figure
    plot(zscore(squeeze(Y(1,:,