diff --git a/ddToolbox/models/nonparametric_models/DF_NonParametric.m b/ddToolbox/models/nonparametric_models/DF_NonParametric.m index 1b6f8286..ffbe4e93 100644 --- a/ddToolbox/models/nonparametric_models/DF_NonParametric.m +++ b/ddToolbox/models/nonparametric_models/DF_NonParametric.m @@ -9,6 +9,7 @@ properties delays % vector of delays AUC % A Stochastic object + timeUnits = 'days' %<------------------- TODO: inject this end methods (Access = public) @@ -36,21 +37,24 @@ function plot(obj) + % visualise the discount function + SAMPLES_TO_PLOT = 100; + timeUnitFunction = str2func(obj.timeUnits); - %% visualise the posterior predictive indifference points - intervals = [50 95]; - - % RIBBON PLOT + %% RIBBON PLOT + %intervals = [50 95]; %<----------- TODO: inject this %ribbon_plot(obj.delays, obj.theta, intervals); % TODO: replace, or inject the plot style we want - % PLOT N EXAMPLES - N = 200; - plot(obj.delays, obj.theta([1:N],:), 'Color',[0 0 0 0.05]) - + %% PLOT N EXAMPLES + % dont ask for more samples than we actually have + samples_to_plot = [1:min(SAMPLES_TO_PLOT, size(obj.theta,1))]; + plot(timeUnitFunction(obj.delays),... + obj.theta(samples_to_plot,:),... + 'Color',[0 0 0 0.05]) hold on - % ~~~~~~~~~~~~~ - obj.data.plot() + dataPlotType = '2D' %<----------- TODO: inject this + obj.data.plot(dataPlotType, obj.timeUnits) % ~~~~~~~~~~~~~ %% formatting @@ -65,9 +69,6 @@ function plot(obj) %% add AUC measure text to graph %auc_str = sprintf('mean AUC: %1.2f', mean(personInfo.AUCsamples)); %addTextToFigure('TR',auc_str, 15, 'latex') - - - end diff --git a/tests/test_AllNonParametricModels.m b/tests/test_AllNonParametricModels.m index 5cb36038..4765f5bc 100644 --- a/tests/test_AllNonParametricModels.m +++ b/tests/test_AllNonParametricModels.m @@ -60,7 +60,8 @@ function defaultSampler(testCase, model) 'mcmcParams', struct('nsamples', 100,... 'nchains', 2,... 'nburnin', 10),... - 'shouldPlot','no'); + 'shouldPlot','no',... + 'shouldExport',false); % TODO: DO AN ACTUAL TEST HERE !!!!!!!!!!!!!!!!!!!!!! model.plot()