function [X_simul_disc,X_simul_new_disc,dX_total,dX_kids,dX_pre,dX_post]=...
          calc_dc(X_simul,X_simul_new,discfact,pre,kids,post)

    X_simul_disc = discfact.*X_simul;
    X_simul_new_disc = discfact.*X_simul_new;

    dX_total=mean(X_simul_new_disc(:))/mean(X_simul_disc(:))-1;
    dX_kids=mean(X_simul_new_disc(kids==1))/mean(X_simul_disc(kids==1))-1;
    dX_pre=mean(X_simul_new_disc(pre==1))/mean(X_simul_disc(pre==1))-1;
    dX_post=mean(X_simul_new_disc(post==1))/mean(X_simul_disc(post==1))-1;

end
