bonsai_ipcc package

Subpackages

Submodules

bonsai_ipcc.core module

class bonsai_ipcc.core.IPCC[source]

Bases: object

static inspect(func)[source]

Get the required parameters of a tier method.

Argument

funcfunction

tier sequence of a volume, chapter

returns:

VALUE – parameter names

rtype:

list of str

static metadata(volume, chapter, parameter)[source]

Get the metadata of a parameter.

Argument

volumestring

volume name

chapterstring

chapter name

paramaterstring

parameter name

returns:

VALUE – metadata pointing to the source in the IPCC pdf documents (year, volume, chapter, page, equation)

rtype:

dict

bonsai_ipcc.log_setup module

bonsai_ipcc.log_setup.setup_logger(level=20)[source]

bonsai_ipcc.uncertainties module

Chapter 3 (Uncertainties) of Volume 1 (General Guidance and Reporting)

Min and max values provided by the IPCC guidelines are considerred to be 2.5th and 97.5th percentile, respectively (p 3.9).

Two ways of uncertainty propagation are implemented: analytical error propagation and Monte Carlo simulation. If analytical error propagation is choosen, asymmetric parameter ranges are transferred by a simple rule of thumb into symmetric ranges. If Monte Carlo, propability distributions can be determined automatically in regard to the properties of the parameter (by “check”).

bonsai_ipcc.uncertainties.analytical(min95, max95)[source]

Creates ufloat value to be used in error propagation. Simple asumption of normal distribution.

Argument

minfloat

2.5th percentile

maxfloat

97.5th percentile

returns:

VALUE

rtype:

ufloat

bonsai_ipcc.uncertainties.monte_carlo(min95, max95, default=None, abs_min=None, abs_max=None, size=1000, distribution='check')[source]

Creates numpy array of random numbers to be used in monte carlo simulation. Choices of different distributions possible.

Argument

minfloat

2.5th percentile

maxfloat

97.5th percentile

defaultfloat

default value (mean)

abs_minfloat

theoretic lower bound of parameter

abs_maxfloat

theoretic upper bound of parameter

distributionstr

Specifies type of density distribution. ‘normal’, ‘lognormal’, ‘truncnormal’, ‘uniform’, ‘check’ for automatized choice

sizeint

Number of random numbers to be generated.

returns:

VALUE

rtype:

numpy.array

bonsai_ipcc.uncertainties.one_side_trunc(mobs, sobs)[source]

Helper function for adjusting mean and sd for one-sided truncated normal distribution.

Given observed mean m > 0.0 and std-dev, 0.0 < s < m, return parameter mean and std-dev of one-sided truncated Gaussian distribution X, with X > 0.0

Rodrigues 2015, Maximum-Entropy Prior Uncertainty and Correlation of Statistical Economic Data: Supplementary Informatiom.

Argument

mobsfloat

observed mean

sobsfloat

observed standard deviation

returns:

VALUES – adjusted mean, adjusted standard deviation

rtype:

float, float

bonsai_ipcc.uncertainties.two_side_trunc(mobs, sobs, vmin, vmax)[source]

Helper function for adjusting mean and sd for two-sided truncated normal distribution.

Given observed mean m, std-dev s, lower and upper bounds, vmin and vmax, (all floats) such that: vmin < mobs < vmax, and 0.0 < sobs < min(mobs - vmin, vmax - mobs)

Argument

mobsfloat

observed mean

sobsfloat

observed standard deviation

vminfloat

absolut minimum

vmaxfloat

absolut maximum

returns:

VALUES – adjusted mean, adjusted standard deviation

rtype:

float, float

Module contents