ott_gRW_RPE_curr.m 571 B

1234567891011121314151617181920
  1. function [LH, probSpike, V, mean_predictedSpikes, RPE] = ott_gRW_RPE_curr(startValues, spikeRate, rewards, timeLocked)
  2. % firing rate only correlates with current reward; no real learning happens
  3. slope = startValues(1);
  4. intercept = startValues(2);
  5. sigma = startValues(3);
  6. rateParam = slope*rewards + intercept;
  7. probSpike = normpdf(spikeRate, rateParam(timeLocked), sigma); % normal distribution
  8. mean_predictedSpikes = rateParam(timeLocked);
  9. if any(isinf(log(probSpike)))
  10. LH = 1e9;
  11. else
  12. LH = -1 * sum(log(probSpike));
  13. end
  14. V = NaN;
  15. RPE = NaN;