Skip to content

Commit

Permalink
Merge pull request #331 from AdityaSavara/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AdityaSavara authored Jan 2, 2023
2 parents a26dde0 + 5ecda3c commit c77443e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PEUQSE/InverseProblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def __init__(self, UserInput = None):
else:
#Getting initial guess of parameters and populating the internal variable for it.
if ('InputParameterInitialGuess' not in self.UserInput.model) or (len(self.UserInput.model['InputParameterInitialGuess'])== 0): #if an initial guess is not provided, we use the prior.
self.UserInput.model['InputParameterInitialGuess'] = np.array(self.UserInput.mu_prior, dtype='float')
self.UserInput.model['InputParameterInitialGuess'] = np.array(UserInput.model['InputParameterPriorValues'], dtype='float')
#From now, we switch to self.UserInput.InputParameterInitialGuess because this is needed in case we're going to do reducedParameterSpace or grid sampling.
self.UserInput.InputParameterInitialGuess = np.array(self.UserInput.model['InputParameterInitialGuess'], dtype='float')
# reassure the initial guess is a numpy array
Expand Down
2 changes: 1 addition & 1 deletion PEUQSE/UserInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
model['simulateByInputParametersOnlyFunction'] = None #A function must be provided! This cannot be left as None. The function should normally return an array the same size and shape as responses_observed, or should return a None object when the simulation fails or the result is considered non-physical. Alternatively, the function can written an object that needs to be processed further by SimulationOutputProcessingFunction.
model['simulationOutputProcessingFunction'] = None #An optional function may be provided which takes the outputs from simulateByInputParametersOnlyFunction and then processes them to match the size, shape, and scale of responses_observed. A None object can be returned when the simulation fails or the result is considered non-physical.
model['reducedParameterSpace'] = [] #This is to keep parameters as 'constants'. Any parameter index in this list will be allowed to change, the rest will be held as constants. For example, using [0,3,4] would allow the first, fourth, and fifth parameters to vary and would keep the rest as constants (note that array indexing is used).
model['responses_simulation_uncertainties'] = None #Optional. Can be none (not used in that case), a blank list [], or a list of lists the same shape as the observed responses with scalars that represent 1 standard deviation of uncertainty, or can be a function that returns such a list of the uncertainties after each simulation is done. For the function way, easiest way would be to have a function that extracts a list that gets updated in another namespace after each simulation. If a blank list is provided, [], then a heurestic will be used.
model['responses_simulation_uncertainties'] = None #Optional. Can be none (not used in that case), a blank list [], or a list of lists the same shape as the observed responses with scalars that represent 1 standard deviation of uncertainty, or can be a function that returns such a list of the uncertainties after each simulation is done. For the function way, it should take the same type of discrete parameter vector as the simulation function. To avoid having the simulations run twice, one can use a a function that extracts a list that gets updated in another namespace after each simulation. If a blank list is provided, [], then a heurestic will be used.
model['custom_logLikelihood'] = None #Optional. This should point to a function that takes the discrete parameter values as an argument and returns "logLikelihood, simulatedResponses". So the function returns a value for the logLikelihood (or proportional to it). The function must *also* return the simulated response output, though technically can just return the number 0 as the ssecond return. The function can be a simple as accessing a global dictionary. This feature is intended for cases where the likelihood cannot be described by a normal/gaussian distribution.
model['custom_logPrior'] = None #Optional. This feature has been implemented but not tested, it is intended for cases where the prior distribution is not described by a normal distribution. The user will provide a function that takes in the parameters and returns a logPrior (or something proportional to a logPrior). If MCMC will be performed, the user will still need to fill out InputParametersPriorValuesUncertainties with std deviations or a covariance matrix since that is used to decide the mcmc steps.
model['InputParameterPriorValues_upperBounds'] = [] #Optional. This should be a list/array of the same shape as InputParameterPriorValues. Use a value of "None" for any parameter that should not be bounded in this direction. The code then truncates any distribution to have a probability of 0 when any of the parameters go beyond their bounds (parameters equal to the bounds do not cause 0 probability to occur). ##As of May 4th 2020, this only has been checked for parameter_estimation_settings['scaling_uncertainties_type'] = 'off'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
AUTHOR = 'Aditya Savara'
REQUIRES_PYTHON = '>=3.5.0'

VERSION = '1.2.4'
VERSION = '1.2.5'

LICENSE = 'BSD-3-Clause'

Expand Down

0 comments on commit c77443e

Please sign in to comment.