File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 168168 % plots of the results.
169169 arguments
170170 SMM
171- parameters
171+ parameters = []
172172 makeplot = false
173173 fignums = [];
174174 end
175+
176+ if isempty(parameters )
177+ parameters = SMM .parameters ;
178+ end
179+
175180 Nmods = length(SMM .SSITModels );
176181 for i = 1 : Nmods
177182 SMM.SSITModels{i }.parameters(SMM.SSITModels{i }.fittingOptions.modelVarsToFit,2 ) = ...
209214 end
210215
211216 function totalLogLikelihood = computeTotalLogLikelihood(SMM ,parameterGuess )
217+ arguments
218+ SMM
219+ parameterGuess = [];
220+ end
212221 % Method that computes the total log likeihood of all data and
213222 % all models for the provided parameter combination.
214223 Nmods = length(SMM .logLikelihoodFunctions );
215224 logLs = zeros(1 ,Nmods );
216225
226+ if isempty(parameterGuess )
227+ parameterGuess = SMM .parameters ;
228+ end
229+
217230 G = cell(1 ,Nmods );
218231 for i = 1 : Nmods
219232 G{i } = SMM.logLikelihoodFunctions{i };
284297
285298 x0 = log(parGuess );
286299
300+ if isfield(fitOptions ,' suppressExpansion' )&&fitOptions .suppressExpansion == true
301+ for iModel = 1 : length(SMM .SSITModels )
302+ oldFspTols(iModel ) = SMM.SSITModels{iModel }.fspOptions.fspTol;
303+ SMM.SSITModels{iModel }.fspOptions.fspTol = inf ;
304+ end
305+ end
306+
287307 objFun = @(x )-SMM .computeTotalLogLikelihood(exp(x )); % We want to MAXIMIZE the likelihood.
288308
289309 switch fitAlgorithm
405425 SMM.parameters = pars ;
406426 SMM = SMM .updateModels(pars );
407427
428+ if isfield(fitOptions ,' suppressExpansion' )&&fitOptions .suppressExpansion == true
429+ for iModel = 1 : length(SMM .SSITModels )
430+ SMM.SSITModels{iModel }.fspOptions.fspTol = oldFspTols(iModel );
431+ end
432+ end
433+
408434 end
409435 function compareParameters(SMM ,fignum ,relative )
410436 % This function makes a heatmap plot to compare parameters in a
You can’t perform that action at this time.
0 commit comments