spm_MDP_da.m 1.0 KB

1234567891011121314151617181920212223242526272829
  1. function spm_MDP_da(MDP)
  2. % Simulated histograms of dopamine firing
  3. % FORMAT spm_MDP_da(MDP)
  4. %
  5. % See also: spm_MDP_game, which generalises this scheme and replaces prior
  6. % beliefs about KL control with minimisation of expected free energy.
  7. %__________________________________________________________________________
  8. % Copyright (C) 2015 Wellcome Trust Centre for Neuroimaging
  9. % Karl Friston
  10. % $Id: spm_MDP_da.m 6451 2015-05-26 09:26:03Z karl $
  11. % deconvolve to simulate dopamine responses
  12. %--------------------------------------------------------------------------
  13. wn = MDP.d;
  14. da = pinv( tril(toeplitz(exp(-((1:length(wn)) - 1)'/8))) )*wn;
  15. da = da(4:end);
  16. % peristimulus time histogram
  17. %--------------------------------------------------------------------------
  18. pst = (1:length(da))*256;
  19. r = 256;
  20. psth = r*da + randn(size(da)).*sqrt(r*da);
  21. bar(pst,psth,1)
  22. title('Simulated dopamine responses','FontSize',16)
  23. xlabel('Peristimulus time (ms)','FontSize',12)
  24. ylabel('Spikes per bin','FontSize',12)
  25. axis([pst(1) pst(end) 0 max(psth)*(1 + 1/4)])
  26. axis square