dmat_setversion(.31) N_datasets = 1; %number of subjects; for this illustration we'll just use one subject for i = 1:N_datasets %% First, load the right data if i==1 fn = 'C:\Documents and Settings\Jepma\\data\pp1.mat'; end s = load(fn); name = sort(fieldnames(s)); eval(['data = s.' name{1} ';']); %% this example fits the All free model % The designmatrix for the Ter-model is {[1,0;1,0;1,0;1,0;0,1;0,1;0,1;0,1],[1,0;1,0;0,1;0,1;1,0;1,0;0,1;0,1],[1,0;0,1;1,0;0,1;1,0;0,1;1,0;0,1],[1;1;1;1;1;1;1;1],[1,0;1,0;1,0;1,0;0,1;0,1;0,1;0,1],[1;1;1;1;1;1;1;1],[1,0;0,1;1,0;0,1;1,0;0,1;1,0;0,1]} % The designmatrix for the a-model is {[1,0,0,0;1,0,0,0;0,1,0,0;0,1,0,0;0,0,1,0;0,0,1,0;0,0,0,1;0,0,0,1],[1;1;1;1;1;1;1;1],[1,0;0,1;1,0;0,1;1,0;0,1;1,0;0,1],[1;1;1;1;1;1;1;1],[1,0,0,0;1,0,0,0;0,1,0,0;0,1,0,0;0,0,1,0;0,0,1,0;0,0,0,1;0,0,0,1],[1;1;1;1;1;1;1;1],[1,0;0,1;1,0;0,1;1,0;0,1;1,0;0,1]} % The designmatrix for the v-model is {[1,0;1,0;1,0;1,0;0,1;0,1;0,1;0,1],[1;1;1;1;1;1;1;1],[1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1;1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1],[1;1;1;1;1;1;1;1],[1,0;1,0;1,0;1,0;0,1;0,1;0,1;0,1],[1;1;1;1;1;1;1;1],[1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1;1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1]} %% All_free options(1) = struct('DesignMatrix',{{[1,0,0,0;1,0,0,0;0,1,0,0;0,1,0,0;0,0,1,0;0,0,1,0;0,0,0,1;0,0,0,1],[1,0;1,0;0,1;0,1;1,0;1,0;0,1;0,1],[1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1;1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1],[1;1;1;1;1;1;1;1],[1,0,0,0;1,0,0,0;0,1,0,0;0,1,0,0;0,0,1,0;0,0,1,0;0,0,0,1;0,0,0,1],[1;1;1;1;1;1;1;1],[1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1;1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1]}},... 'Display','off',... 'EWMA',struct('l',0.01,... 'L',1.5,... 's',0.5),... 'EstimationMethodScalar',6,... 'FixedBinEdges',[0.3,0.36,0.42,0.52,0.8;0.38,0.47,0.56,0.7,1],... 'FixedValues',[],... 'Guess',[],... 'GuessMethodScalar',1,... 'LongSimplexRuns',1,... 'MaxIter',5000,... 'Name','all_free',... 'NoFitting',0,... 'NonparametricBootstrap',0,... 'ObjectiveDecimals',7,... 'OutlierMax',2.5,... 'OutlierMin',0.3,... 'OutlierTreatment','Absolute cut-off',... 'ParameterDecimals',7,... 'ParametricBootstrap',0,... 'Percentiles',[10,30,50,70,90;10,30,50,70,90],... 'ShortSimplexRuns',3,... 'SpecificBias',[]); output = multiestv4(data,options) fid = fopen('IndividualSubjects_AllFreeModel.out', 'a'); % create a file and open it for *appending*. fprintf(fid, 'The name of the data file is:\n'); fprintf(fid, '%s\n', fn); fprintf(fid, 'The number of free parameters is:\n'); fprintf(fid, '%1i\n', output.Df); fprintf(fid, 'The BIC value is:\n'); fprintf(fid, '%3.4f\n', output.FitInfo.BIC); fprintf(fid, 'The best parameter estimates are:\n'); fprintf(fid, '%3.4f\n', output.Minimum); fprintf(fid, '\n'); fclose(fid); %closes the file. end