Commit a018a073 authored by Bernhard Spitzer's avatar Bernhard Spitzer
Browse files

supp fig noise

parent 8f870bd5
......@@ -88,7 +88,7 @@ for ex=1:2
figex=ncols*2*(ex-1);
mvup=0.04*(ex-1);
plotQcp(VI1collect{selsub},modRDM1,nrows,ncols,figex+1,mvup,lims1,lwidth,fsize,mstr{ex,1});
h=plotmap(perfmaps,as,a1,nrows,ncols,figex+2,mvup,markersize,fsize,0);
h=plotmap(perfmaps,as,a1,nrows,ncols,figex+2,markersize,fsize,0,[]);
h.Position(1)=h.Position(1)+0.055;
h.Position(2)=h.Position(2)-0.14+mvup;
h.Position(3)=h.Position(3)+0.01;
......
clear all;
addpath('tools');
%% settings
figure('units','normalized','outerposition',[0.2 0.1 0.4 0.61],'Color',[1 1 1]);
colormap(viridis());
nrows=2;
ncols=2;
fsize=13;
%% load exp
dataf=['..' filesep '..' filesep 'data' filesep 'combined_mat' filesep 'exp4.mat'];
load(dataf);
[datamat, nsubs] = rmloperf(behav_result_mat,0.60);
%% parameters
as=0:0.001:0.1;
noises=[0 0.1 0.2 0.4];
% switch off pair-level -> Q models only
gam=0; lam=100; tauP=100; eta=8;
%% simulate
perfmaps=NaN(length(as),length(as),length(noises),nsubs);
for s=1:length(noises)
parfor n=1:nsubs
disp(['subject ' num2str(n) ' -started']);
[trials,FBtru,grT,nstims] = preptrials(datamat(:,:,:,n),0,0);
perfmaps(:,:,s,n) = simperf(as,eta,noises(s),gam,lam,tauP,trials,FBtru,grT,0);
end
end
%% plot
mperfmap=mean(perfmaps,4);
for s=1:length(noises)
plotmap(mperfmap(:,:,s),as,0,nrows,ncols,s,0,fsize,1,[]);
title(['\tau_{item} = ' num2str(noises(s))]);
end
function h=plotmap(maps,as,a1,nrows,ncols,panel,mvup,markersize,fsize,colbar)
function h=plotmap(maps,as,a1,nrows,ncols,panel,markersize,fsize,colbar,lims)
h=subplot(nrows,ncols,panel);
mmap=mean(maps,3);
imagesc(as,as,mmap(:,:));
if isempty(lims)
imagesc(as,as,mmap(:,:));
else
imagesc(as,as,mmap(:,:),lims);
end
if colbar
hcb=colorbar;
hcb.Title.String='p(correct)';
if panel==1
hcb.Title.String='p(correct)';
end
end
hold on
plot([as(1) as(end)],[as(1) as(end)],'w--','Linewidth',2);
xlabel('winner (\alpha^{+})')
ylabel('loser (\alpha^{-})')
set(gca,'Ydir','normal');
set(gca,'Ydir','normal')
set(gca,'FontSize',fsize)
set(gca,'box','off')
hold on
xticks([0 0.05 0.1]);
yticks([0 0.05 0.1]);
if markersize>0
scatter(a1, a1,markersize, 'o','MarkerFaceColor', 'k','MarkerEdgeColor', 'k');
scatter(a1, 0 ,markersize, '^','MarkerFaceColor', 'r','MarkerEdgeColor', 'r');
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment