Skip to content

Commit

Permalink
#191 plotPosteriorClusterPlot now callable method of model
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Vincent committed Jun 2, 2017
1 parent 1068d9b commit ab9fcdc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
14 changes: 14 additions & 0 deletions ddToolbox/models/Model.m
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,20 @@ function plotUnivarateSummary(obj, varargin)
obj.export_it(plot_savename)

end

function plotPosteriorClusterPlot(obj, subplot_handle)
%plotPosteriorClusterPlot(H) Plots posterior distributions for
% all experiments, in the axis handle H.

subplot(subplot_handle)
% TODO: put clusterPlot function code here rather than have it as a separate function?
clusterPlot(...
obj.coda,...
obj.data,...
[1 0 0],...
obj.plotOptions,...
obj.varList.discountFunctionParams)
end

end

Expand Down
16 changes: 4 additions & 12 deletions ddToolbox/models/parametric_models/Parametric.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,13 @@ function plot(obj, varargin)

% Plot univariate summary stats
obj.plotUnivarateSummary('variablesToPlot', 'all')
% plot_savename = 'UnivariateSummary';
% variables = obj.varList.participantLevel;
% obj.coda.plotUnivariateSummaries(variables,...
% obj.plotOptions,...
% obj.data.getParticipantNames());
% obj.export_it(plot_savename)
% obj.export_it('UnivariateSummary')

% summary figure of core discounting parameters
plot_savename = 'summary_plot';
clusterPlot(...
obj.coda,...
obj.data,...
[1 0 0],...
obj.plotOptions,...
obj.varList.discountFunctionParams)
figure
h = subplot(1,1,1);
obj.plotPosteriorClusterPlot(h)
obj.export_it(plot_savename)


Expand Down
3 changes: 0 additions & 3 deletions ddToolbox/utils-plot/plot1Dclusters.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function plot1Dclusters(mcmcContainer, data, col, plotOptions, varInfo)

% plot posteriors over log(k) for all participants


figure(12), clf

%% REAL EXPERIMENT DATA
% build samples
for p = 1:data.getNExperimentFiles()
Expand Down
2 changes: 0 additions & 2 deletions ddToolbox/utils-plot/plot2Dclusters.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ function plot2Dclusters(mcmcContainer, data, col, plotOptions, varInfo)

probMass = 0.5;

figure(12), clf

% build samples
for p = 1:data.getNExperimentFiles()
tempx = mcmcContainer.getSamplesAtIndex_asMatrix(p, {varInfo(1).name});
Expand Down

0 comments on commit ab9fcdc

Please sign in to comment.