functiontapas_sutton_k1_binary_plotTraj(r)% Plots trajectories estimated by tapas_fitModel for the tapas_rw_binary perceptual model% Usage: est = tapas_fitModel(responses, inputs); tapas_rw_binary_plotTraj(est);%% --------------------------------------------------------------------------------------------------% Copyright (C) 2013 Christoph Mathys, TNU, UZH & ETHZ%% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public% Licence (GPL), version 3. You can redistribute it and/or modify it under the terms of the GPL% (either version 3 or, at your option, any later version). For further details, see the file% COPYING or <http://www.gnu.org/licenses/>.% Set up display
scrsz = get(0,'screenSize');
outerpos = [0.2*scrsz(3),0.7*scrsz(4),0.8*scrsz(3),0.3*scrsz(4)];
figure(...
'OuterPosition', outerpos,...
'Name','RW binary fit results');
% Number of trials
t = length(r.u(:,1));
% Plotplot(0:t, [r.p_prc.vhat_1; r.traj.v], 'r', 'LineWidth', 2);
hold all;
plot(0, r.p_prc.vhat_1, 'or', 'LineWidth', 2); % priorplot(1:t, r.u(:,1), '.', 'Color', [00.60]); % inputsif ~isempty(find(strcmp(fieldnames(r),'y'))) && ~isempty(r.y)
y = r.y(:,1) -0.5; y = 1.16 *y; y = y +0.5; % stretchif ~isempty(find(strcmp(fieldnames(r),'irr')))
y(r.irr) = NaN; % weed out irregular responsesplot(r.irr, 1.08.*ones([1length(r.irr)]), 'x', 'Color', [10.70], 'Markersize', 11, 'LineWidth', 2); % irregular responsesplot(r.irr, -0.08.*ones([1length(r.irr)]), 'x', 'Color', [10.70], 'Markersize', 11, 'LineWidth', 2); % irregular responsesendplot(1:t, y, '.', 'Color', [10.70]); % responses
title(['Response y (orange), input u (green), and value v (red) for \mu=', ...
num2str(r.p_prc.mu), ', Rhat=', num2str(r.p_prc.Rhat)], 'FontWeight', 'bold');
ylabel('y, u, v');
axis([0 t -0.151.15]);
else
title(['Input u (green) and value v (red) for \mu=', ...
num2str(r.p_prc.mu), ', Rhat=', num2str(r.p_prc.Rhat)], 'FontWeight', 'bold');
ylabel('u, v');
axis([0 t -0.11.1]);
endplot(1:t, 0.5, 'k');
xlabel('Trial number');
hold off;