Parameter estimation for complex physical problems often suffers from finding ‘solutions’ that are not physically realistic. The PEUQSE software provides tools for finding physically realistic parameter estimates, graphs of the parameter estimate positions within parameter space, and plots of the final simulation results.
13
stars
5
forks
source link
Make functions in ip class truly black box functions #11
I have thought about it, and in general there are simulation functions which return outputs. However, those outputs might not be in the form that we need (for example, it might return too many outputs or the negative of the rate we need etc).
So you should make your blackbox take in several arguments:
a) Priors (mu, and errors)
b) Simulation function
c) observedResponses (such as rate versus time)
d) observed Responses errors
e) Optional Argument: simulation Output Processing Function this is a user defined function that takes the simulation output and then converts it into the desired observables. Essentially, it’s like a wrapper function. For codeflow reasons, it is convenient if we let users pass it into our function if they would like to.
So the code might look a bit like this:
def BPEfromKineticSimulation(simulationFunction, simulationInputArguments,
inputParametersErrors, observedResponses,
observedResponsesErrors, simulationOutputProcessingFunction=None, makePlots = True, plot2DplotsForChosenParameters =[], plotHistogramsForChosenParameters = []):
# if self.UserInput.plot2DplotsForChosenParameters =[], then 2D plots are made for each variable. Else, pairs must be provided. This feature will not be implemented before release.
# if self.UserInput.plotHistogramsForChosenParameters = [], then histograms are made for each variable. Else, a list of variables must be provided. This feature will not be implemented before release.
simulationOutput = self.UserInput.simulationFunction(self.UserInput.simulationInputArguments)
#Note that the above line will in general return some kind of list.
If self.UserInput.simulationOutputProcessingFunction == None: simulatedResponses = simulationOutput
if self.UserInput.simulationOutputProcessingFunction != None:
simulatedResponses = simulationOutputProcessingFunction(simulationOutput)
#this will also return something like an array or list,
#but only the ones that are relevant for our BPE or parameter optimization.
Related to Issue #3 (cantera generalization) and Issue #10 (priors etc. generalization, closed)
I have thought about it, and in general there are simulation functions which return outputs. However, those outputs might not be in the form that we need (for example, it might return too many outputs or the negative of the rate we need etc).
So you should make your blackbox take in several arguments:
So the code might look a bit like this:
Related to Issue #3 (cantera generalization) and Issue #10 (priors etc. generalization, closed)