Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 9124ee20fcbc67db053ebb59cdebae3aad266593 authored by nwbarendregt on 02 May 2022, 17:06:36 UTC, committed by GitHub on 02 May 2022, 17:06:36 UTC
Add files via upload
1 parent f843c31
  • Files
  • Changes
  • ac994f9
  • /
  • Figure 4 -- Known Reward Performance
  • /
  • RC_NB_Opt.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:9124ee20fcbc67db053ebb59cdebae3aad266593
directory badge
swh:1:dir:354557c2a9886c2869b33de3e4b79306e8421abd
content badge
swh:1:cnt:d73dbf736b74c6f5e632350d3c674f22616bd8f0

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
RC_NB_Opt.m
% RC_NB_Opt.m
% Calculates reward rate of the noise-free NB model for the reward change
% task from Barendregt et al., 2022.

clear

% Define simulation parameters for the reward change task:
T = 5; dt = 0.005;  t_i = 1;
dg = 0.001;
m = 5; c = 1;
R_1 = linspace(1,10); R_2 = 11-R_1;

% Pre-allocate reward rate storage:
NB_RR_Opt = NaN(1,length(R_1));

for i = 1:length(R_1)

    % Construct reward timeseries:
    R = NaN(1,T/dt+1); R(1:100) = R_1(i); R(101:end) = R_2(i);

    % Calculate model reward rate using dynamic programming:
    [~,NB_RR_Opt(i)] = dynamic_reward_det(T,dt,t_i,dg,m,@(t) c,R);
end
save('RC_NB_Opt_Data.mat','NB_RR_Opt','R_1','R_2');
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API