AdityaSavara / PEUQSE

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

Closed AdityaSavara closed 4 years ago

AdityaSavara commented 5 years ago

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:

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)

AdityaSavara commented 4 years ago

Considered fixed in this merge. https://github.com/AdityaSavara/ODE-KIN-BAYES-SG-EW/pull/41