Skip to content

Commit

Permalink
small tweaks to run_me()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Vincent committed Sep 24, 2016
1 parent 27f6276 commit 5600ec8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions demo/run_me.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@
% See also: Data, Model

% --------- USE THE CODE BELOW AS A TEMPLATE FOR YOUR OWN ANALYSES --------

% USERS TO REPLACE THIS CODE... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% USERS TO REPLACE THIS CODE BLOCK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
path_of_this_mfile = strrep(which(mfilename),[mfilename '.m'],'');
toolbox_path = fullfile(path_of_this_mfile,'..','ddToolbox');
datapath = fullfile(path_of_this_mfile,'datasets','kirby');
% ...WITH THIS (update the paths as appropriate) ~~~~~~~~~~~~~~~~~~~~~~~~~~
% WITH THIS (update the paths as appropriate) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% addpath('~/git-local/delay-discounting-analysis/ddToolbox')
% datapath = '~/git-local/delay-discounting-analysis/demo/data';
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -96,14 +95,26 @@
ddAnalysisSetUp();

% Do an analysis
model = ModelMixedME(...
model = ModelHierarchicalME(...
Data(datapath, 'files', allFilesInFolder(datapath, 'txt')),...
'savePath', fullfile(pwd,'output','my_analysis'),...
'pointEstimateType','median',...
'pointEstimateType', 'median',...
'sampler', 'jags',...
'shouldPlot', 'no',...
'mcmcParams', struct('nsamples', 500,...
'chains', 2,...
'nburnin', 100));
'shouldPlot', 'yes',...
'shouldExportPlots', true,...
'mcmcParams', struct('nsamples', 5000,...
'chains', 4,...
'nburnin', 1000));

% NOTE:
% - you will want to increase the 'nburnin' and 'nsamples' when you are
% running proper analyses. I have provided small numbers here just to
% confirm the code is working without having to wait a long time.
% - you can change the point estimate type to mean, median, or mode
% - the sampler can be 'jags' or 'stan', although stan models are not yet
% full complete


% model.plot('shouldExportPlots', false)
% If we didn't ask for plots when we ran the model, then we do that
% after with this command...
% model.plot('shouldExportPlots', false)
2 changes: 1 addition & 1 deletion runalltests.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%RUNALLTESTS
%runalltests
% A script to run the tests
%
% Manually run specific tests like this...
Expand Down

0 comments on commit 5600ec8

Please sign in to comment.