% this script demonstrate why the slope a is critical manipulation % seperating the self-localization hypothesis from the homing hypothesis % To find a reduction in heading variance but not in homing variance, we % try to make the distances between two heading weights that produce the % largest reductions in homing variance and heading variance as far as % possible. %?_?^2=W_(?_PI)^2× ?_(?_PI)^2 + W_(?_LM)^2 × ?_(?_LM)^2, find W_(?_LM) %makes %?_?^2 minimum. %?_(?OPO’)^2=(a - W_(?_PI ) )^2× ?_(?_PI)^2 + W_(?_LM)^2 × ?_(?_LM)^2+ %?_ue^2. find W_(?_LM) makes %?_(?OPO’)^2 minimum. %get the distance between these two weights. the distance = (1-a)* %W_(?_LM)that makes %?_?^2 minimum. close all; a = [0.5,0.66,0.33]; % use three slope a H_STD_L=[20,20,20]; % assume variance in estimating heading from Landmark is 0.25 of that from PI H_STD_PI=2*H_STD_L; % H_STD_L the heading SD in the Landmark Condition, H_STD_PI Path integration condition H_Var_PI=H_STD_PI.^2; H_Var_L=H_STD_L.^2; %using our theory we can get beta_Var_PI, beta_Var_L, and also any beta_Var %in conflict condition using different weight of PI, the weight=1 for beta_Var_PI, weight=0 for beta_Var_L P_Var_PI=a.^2.*H_Var_PI; % position error variance is the same for all conditions. P_Var_L=P_Var_PI; beta_Var_PI=(a-1).^2.*H_Var_PI; % beta is the homing error beta_Var_L = a.^2.*H_Var_PI+H_Var_L; weight = [0:0.01:1]; % PI weight landmarWeight=1-weight; for j=1:size(a,2) beta_Var_BO_SelfLocalization (j,:) = (a(j)- weight).^2*H_Var_PI(j)+(1-weight).^2*H_Var_L(j);%homing error in the BOth condition according to self localization hypothesis , see table 7B or equation 10 beta_Var_BO_beta_combination(j,:)=weight.^2.*beta_Var_PI(j) + (1-weight).^2.*beta_Var_L(j); %homing error in the Both condition according to the homing hypothesis He_Var_BO_He_combination(j,:)=weight.^2.*H_Var_PI(j) + (1-weight).^2.*H_Var_L(j);%combination for heading Pe_Var_BO_Pe_combination(j,:)=weight.*P_Var_PI(j) + (1-weight).*P_Var_L(j);%combination for position, should be the same value end for j=1:size(a,2) figure ('position', [0, 0, 300, 250]) Y=sqrt(beta_Var_BO_SelfLocalization(j,:)); Y1=sqrt(beta_Var_BO_beta_combination(j,:)); Y2=sqrt(He_Var_BO_He_combination(j,:)); Y3=sqrt(Pe_Var_BO_Pe_combination(j,:)); plot (landmarWeight, Y , 'g-', landmarWeight, Y2 , 'r-', landmarWeight, Y3 , 'k-'); [M,I]=min(Y); text(landmarWeight(I)-0.1,M+1, ['Homing error' ]); hold on plot(landmarWeight(I),0,'--ro','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',5) %text(landmarWeight(I)-0.25,3, [ 'Weight for' char(10) 'smallest homing SD' ]); hold on [M,I]=min(Y2); text(landmarWeight(I),M, ['Heading error']); plot(landmarWeight(I),0,'--ro','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','r','MarkerSize',5) %text(landmarWeight(I)-0.1,3, ['Weight for ' char(10) 'smallest heading SD']); hold on plot(landmarWeight(I),Y(I),'--rs','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','r','MarkerSize',10) % text(landmarWeight(I),Y(I), ['both cue' char(10) '']); [M,I]=min(Y3); text(landmarWeight(I)/8,M, 'Position error'); hold on title (['a=',num2str(a(j))]) xlabel('Landmark weight in heading estimation') ylabel({'Predicted circular SD (°)'}) axis ([0,1,0,40]) set(findall(gcf,'-property','FontSize'),'FontSize',9) end