123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- clear all
- load('behavdata/dat.mat')
- aCue{1}=squeeze(accrot_cu_uncue(:,1,:)); %Accuracy 1st Test
- bCue{1}=squeeze(bias_cue(:,1,:)); %Bias 1st Test
- aCue{2}=squeeze(accrot_cu_uncue(:,2,:)); %Accuracy 2st Test
- bCue{2}=squeeze(bias_uncue(:,1,:)); %Bias 2st Test
- %Averaging between 1st and 2nd test
- aCueg = ((aCue{1}+aCue{2})./2)
- bCueg = ((bCue{1}+bCue{2})./2)
- %% order the data in standard presentation
- ao=deg2rad(accrot_cu_uncue(:,3,1))
- ao2=abs(2*pi-ao) %move anticlockwise
- ao3=(angdiff(-ao2,-(ones(16,1).*pi*1.5)))+pi
- [ao2,ao3]
- [bb ind]=sort(ao3)
- aCueo=aCueg(ind,:)
- bCueo=bCueg(ind,:)
- %%
- % aCueGo = ((aCue1o+aCue2o)./2)
- % bCueGo = ((bCue1o+bCue2o)./2)
- %% With general accuracy (1st and 2nd test combined)
- % Keep C=1
- %
- % (i) SSQ based on ave between acuSSQ and biasSSQ
- % (ii) SSQ based only biasSSQ
- % (iii) SSQ based on ave between acuSSQ and biasSSQ (but acuSSQ is calculated on general accu)
- %%
- BestParams=nan(size(accrot_cu_uncue,3),4);
- parfor ppp =1:size(accrot_cu_uncue,3)
-
-
- aaCue=(aCueo(:,ppp)');
- bbCue=(bCueo(:,ppp)');
-
- CvetIn=0:0.1:1;%vector grid search of C
-
- BestParams(ppp,:)=gridsearch_jld(aaCue,bbCue,0,2,CvetIn,0.1); % This fuction is the the same as original, but we can add some input (ssqmat only based on accu,granularity for the grid search)
-
- end
- %%
- all=BestParams
- %%
- s=BestParams(1,1); % noise (in memory/decision-making)
- A=BestParams(1,2); % Key Parameter (squircle) 0: all circle; 1: all square
- C=BestParams(1,3); % Reduce noise near cardinal by this factor (1: off)
- makefig=0;
-
- behB=bCueo(:,ppp)'; %BehaviouralBias
-
- figure;
- [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
- %% Changing format
- Params{1}= squeeze(BestParams(:,:,1));% info about test 1
- Params{2}= squeeze(BestParams(:,:,2));% info about test 1
- %% Anova
- %%
- %% and Group plot
- figure;
- for test=1:0
- oi=bCueo{test};
- yourBias=[];
- yourAccu=[];
- for ppp=1:size(oi,2)
- behB=oi(:,ppp)'; %BehaviouralBias
-
- s=Params{test}(ppp,1); % noise (in memory/decision-making)
- A=Params{test}(ppp,2); % Key Parameter (squircle) 0: all circle; 1: all square
- C=Params{test}(ppp,3); % Reduce noise near cardinal by this factor (1: off)
- makefig=0;
- [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
-
- end
- subplot(1,2,test)
- quickplotcompB(bb',mean(yourBias,2)',mean(oi,2)',['Group plot Bias - test- ' num2str(test)]);
- end
- %%
- for ig=1:2;
-
- if ig==1
- p=1:15;
- else
- p=16:29;
- end
-
- figure;
- counter=1;
- for ppp =p
- behB=bCue1o(:,ppp)'; %BehaviouralBias
-
- s=BestParams(ppp,1); % noise (in memory/decision-making)
- A=BestParams(ppp,2); % Key Parameter (squircle) 0: all circle; 1: all square
- C=BestParams(ppp,3); % Reduce noise near cardinal by this factor (1: off)
- makefig=0;
- subplot(4,4,counter)
- [yourAccu yourBias]=squircleBehave2compB(s,A,C,behB,makefig);
- rlim([0 1]);
- counter=counter+1;
-
- end
- end
- %%
- colores=(colormap((winter(6))));
- figure
- %Cue Acc
- for ppp=1:29
- subplot(6,5,ppp)
- accrottask_mod=accrot_cu_uncue;
- accrottask_mod(size(accrottask_mod,1)+1,:,:)=accrot_cu_uncue(1,:,:);
- dat=squeeze(accrottask_mod(:,1,ppp));
- ap=(dat);
- theta=deg2rad(accrottask_mod(:,3,1));
- theta2=(max(theta)-theta);
- theta3=abs(2*pi-theta);
- chance=ap;
- chance(:)=0.5;
- polarplot(theta3,chance,'k-.','Color',colores(5,:),'LineWidth',1.5);hold on;
- polarplot(theta3,ap,'-','Color',colores(3,:),'LineWidth',1.5);hold on;
- r=polarplot(theta3,ap,'o','Color',colores(3,:),'MarkerFaceColor',colores(5,:),'LineWidth',2);
- set(gca,'ThetaZeroLocation','top','FontSize',12);hold on;
- title(['sigma = ' num2str(BestParams(ppp,1)) ' A= ' num2str(BestParams(ppp,2))])
- end
|