|
1 | | -function [problemDef,outProblem,result,bayesResults] = runDram(problemDef,problemDefCells,problemDefLimits,controls,allPriors) |
| 1 | +function [problemStruct,outProblem,result,bayesResults] = runDram(problemStruct,problemCells,problemLimits,controls,allPriors) |
2 | 2 |
|
3 | 3 | %#codegen |
4 | 4 |
|
5 | | -%coder.varsize('problemDef.contrastBacks',[1 Inf],[0 1]); |
| 5 | +%coder.varsize('problemStruct.contrastBacks',[1 Inf],[0 1]); |
6 | 6 |
|
7 | 7 | checks = controls.checks; |
8 | | -[problemDef,fitNames] = packParams(problemDef,problemDefCells,problemDefLimits,checks); |
| 8 | +[problemStruct,fitNames] = packParams(problemStruct,problemCells,problemLimits,checks); |
9 | 9 | %fitPriors = packPriors(priors,checks); |
10 | 10 |
|
11 | 11 | % Seed the Random Number Generator |
|
15 | 15 |
|
16 | 16 | %First deal with priors. |
17 | 17 | prior = {}; |
18 | | -lims = problemDef.fitLimits; |
| 18 | +lims = problemStruct.fitLimits; |
19 | 19 |
|
20 | 20 | % Preallocate params array to keep the compiler happy |
21 | 21 | params = cell(length(fitNames),1); |
|
117 | 117 | for i = 1:length(fitNames) |
118 | 118 | coder.varsize('name',[1 Inf],[0 1]); |
119 | 119 | name = fitNames{i}; |
120 | | - value = problemDef.fitParams(i); |
| 120 | + value = problemStruct.fitParams(i); |
121 | 121 | min = lims(i,1); |
122 | 122 | max = lims(i,2); |
123 | 123 |
|
|
149 | 149 | burnin = controls.burnin; |
150 | 150 | adaptint = 100;%controls.adaptint; |
151 | 151 |
|
152 | | -problem = {problemDef ; controls ; problemDefLimits ; problemDefCells}; |
| 152 | +problem = {problemStruct ; controls ; problemLimits ; problemCells}; |
153 | 153 |
|
154 | 154 | output = runBayes(loop,nsimu,burnin,adaptint,params,problem,controls); |
155 | 155 |
|
156 | | -[problemDef,outProblem,result,bayesResults] = processBayes(output,problem); |
| 156 | +[problemStruct,outProblem,result,bayesResults] = processBayes(output,problem); |
157 | 157 |
|
158 | | -% problemDef.fitParams = bayesResults.bestPars_Mean; |
| 158 | +% problemStruct.fitParams = bayesResults.bestPars_Mean; |
159 | 159 |
|
160 | 160 |
|
161 | 161 | % Post processing of Bayes |
|
170 | 170 | % bestPars_mean = output.results.mean; |
171 | 171 | % |
172 | 172 | % % Calulate Max best fit curves |
173 | | -% problemDef.fitParams = bestPars_max; |
174 | | -% problemDef = unpackParams(problemDef,controls); |
175 | | -% [outProblem,result] = reflectivityCalculation(problemDef,problemDefCells,controls); |
| 173 | +% problemStruct.fitParams = bestPars_max; |
| 174 | +% problemStruct = unpackParams(problemStruct,controls); |
| 175 | +% [outProblem,result] = reflectivityCalculation(problemStruct,problemCells,controls); |
176 | 176 | % bestFitMax_Ref = result(1); |
177 | 177 | % bestFitMax_Sld = result(5); |
178 | 178 | % bestFitMax_chi = outProblem.calculations.sumChi; |
179 | 179 | % |
180 | 180 | % % Calculate 'mean' best fit curves |
181 | | -% problemDef.fitParams = bestPars_mean; |
182 | | -% problemDef = unpackParams(problemDef,controls); |
183 | | -% [outProblem,result] = reflectivityCalculation(problemDef,problemDefCells,controls); |
| 181 | +% problemStruct.fitParams = bestPars_mean; |
| 182 | +% problemStruct = unpackParams(problemStruct,controls); |
| 183 | +% [outProblem,result] = reflectivityCalculation(problemStruct,problemCells,controls); |
184 | 184 | % bestFitMean_Ref = result(1); |
185 | 185 | % bestFitMean_Sld = result(5); |
186 | 186 | % bestFitMean_chi = outProblem.calculations.sumChi; |
|
0 commit comments