Package trunk :: Package BIP :: Package Bayes :: Module Melding
[hide private]

Module Melding

source code

Classes [hide private]
  FitModel
Fit a model to data generating Bayesian posterior distributions of input and outputs of the model.
  Meld
Bayesian Melding class
Functions [hide private]
 
basicfit(s1, s2)
Calculates a basic fitness calculation between a model- generated time series and a observed time series. it uses a Mean square error.
source code
 
clearNaN(obs)
Loops through an array with data series as columns, and Replaces NaNs with the mean of the other series.
source code
 
enumRun(model, theta, k)
Returns model results plus run number.
source code
 
model_as_ra(theta, model, phinames)
Does a single run of self.model and returns the results as a record array
source code
 
model(theta, n=1)
Model (r,p0, n=1) Simulates the Population dynamic Model (PDM) Pt = rP0 for n time steps. P0 is the initial population size. Example model for testing purposes.
source code
 
plotRaHist(arr)
Plots a record array as a panel of histograms
source code
 
main2() source code
 
mh_test() source code
Variables [hide private]
  Viz = False
  dtplot = RTplot()
  phiplot = RTplot()
  thplot = RTplot()
Function Details [hide private]

basicfit(s1, s2)

source code 
Calculates a basic fitness calculation between a model- generated time series and a observed time series. it uses a Mean square error.
Parameters:
  • s1 - : model-generated time series. record array.
  • s2 - : observed time series. dictionary with keys matching names of s1
Returns:
Root mean square deviation between ´s1´ and ´s2´.

clearNaN(obs)

source code 
Loops through an array with data series as columns, and Replaces NaNs with the mean of the other series.
Parameters:
  • obs - : 2-dimensional numpy array
Returns:
array of the same shape as obs

enumRun(model, theta, k)

source code 
Returns model results plus run number.
Parameters:
  • model - : model callable
  • theta - : model input list
  • k - : run number
Returns:
  • res: result list
  • k: run number