diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..2dcbca4b --- /dev/null +++ b/404.html @@ -0,0 +1,980 @@ + + + +
+ + + + + + + + + + + + + + + + +
+ Bases: ChainConfig
The numerical chain with its configuration.
+ +src/chainconsumer/chain.py
97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 |
|
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶weight_column: ColumnName = Field(default='weight', description='The name of the weight column, if it exists')
+
class-attribute
+ instance-attribute
+
+
+¶posterior_column: ColumnName = Field(default='log_posterior', description='The name of the log posterior column, if it exists')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶num_free_params: int | None = Field(default=None, description='The number of free parameters in the chain', ge=0)
+
class-attribute
+ instance-attribute
+
+
+¶num_eff_data_points: float | None = Field(default=None, description='The number of effective data points', ge=0)
+
class-attribute
+ instance-attribute
+
+
+¶power: float = Field(default=1.0, description='Raise the posterior surface to this. Useful for inflating or deflating uncertainty for debugging.')
+
class-attribute
+ instance-attribute
+
+
+¶show_label_in_legend: bool = Field(default=True, description='Whether to show the label in the legend')
+
class-attribute
+ instance-attribute
+
+
+¶histogram_relative_height: float = Field(default=1.0, description='The relative height to plot the marginalised histogram. 1.0 will ensure a normalised histogram.', ge=0.0)
+
property
+
+
+¶The columns in the dataframe which are not weights or posteriors.
+property
+
+
+¶The subsection of the dataframe with data points (ie excluding weights and posterior)
+property
+
+
+¶The columns to be plotted, which are the dataframe columns +with the weights, posterior and colour coloumns removed.
+property
+
+
+¶If the chain will be skipped in plotting because it has nothing to plot.
+property
+
+
+¶The row of samples which correspond to the maximum posterior value. +None if the posterior is not supplied.
+property
+
+
+¶The column of weights in the samples.
+property
+
+
+¶The column of log posteriors in the samples. None if not set.
+property
+
+
+¶The data from the color column. None if not set.
+classmethod
+
+
+¶from_covariance(mean: np.ndarray | list[float], covariance: np.ndarray | list[list[float]], columns: list[ColumnName], name: ChainName, **kwargs: Any) -> Chain
+
Generate samples as per mean and covariance supplied. Useful for Fisher matrix forecasts.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mean |
+
+ ndarray | list[float]
+ |
+
+
+
+ The an array of mean values. + |
+ + required + | +
covariance |
+
+ ndarray | list[list[float]]
+ |
+
+
+
+ The 2D array describing the covariance.
+Dimensions should agree with the |
+ + required + | +
columns |
+
+ list[ColumnName]
+ |
+
+
+
+ A list of parameter names, one for each column (dimension) in the mean array. + |
+ + required + | +
name |
+
+ ChainName
+ |
+
+
+
+ The name of the chain. + |
+ + required + | +
kwargs |
+
+ Any
+ |
+
+
+
+ Any other arguments to pass to the Chain constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Chain
+ |
+
+
+
+ The generated chain. + |
+
src/chainconsumer/chain.py
Returns a ChainConsumer instance containing all the walks of a given chain +as individual chains themselves.
+This method might be useful if, for example, your chain was made using +MCMC with 4 walkers. To check the sampling of all 4 walkers agree, you could +call this to get a ChainConsumer instance with one chain for ech of the +four walks. If you then plot, hopefully all four contours +you would see agree.
+ + + +Returns:
+Type | +Description | +
---|---|
+ list[Chain]
+ |
+
+
+
+ One chain per walker, split evenly + |
+
src/chainconsumer/chain.py
Returns the maximum posterior point in the chain. If the posterior
+ + + +Returns:
+Name | Type | +Description | +
---|---|---|
MaxPosterior |
+ MaxPosterior | None
+ |
+
+
+
+ The maximum posterior point + |
+
src/chainconsumer/chain.py
Returns the covariance matrix of the chain.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
columns |
+
+ list[str] | None
+ |
+
+
+
+ The columns to use. None means all data columns. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Named2DMatrix |
+ Named2DMatrix
+ |
+
+
+
+ The covariance matrix + |
+
src/chainconsumer/chain.py
Returns the correlation matrix of the chain.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
columns |
+
+ list[str] | None
+ |
+
+
+
+ The columns to use. None means all data columns. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Named2DMatrix |
+ Named2DMatrix
+ |
+
+
+
+ The correlation matrix + |
+
src/chainconsumer/chain.py
classmethod
+
+
+¶from_emcee(sampler: emcee.EnsembleSampler, columns: list[str], name: str, thin: int = 1, discard: int = 0, **kwargs: Any) -> Chain
+
Constructor from an emcee sampler
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
sampler |
+
+ EnsembleSampler
+ |
+
+
+
+ The emcee sampler + |
+ + required + | +
columns |
+
+ list[str]
+ |
+
+
+
+ The names of the parameters + |
+ + required + | +
name |
+
+ str
+ |
+
+
+
+ The name of the chain + |
+ + required + | +
thin |
+
+ int
+ |
+
+
+
+ The thinning to apply to the chain + |
+
+ 1
+ |
+
discard |
+
+ int
+ |
+
+
+
+ The number of steps to discard from the start of the chain + |
+
+ 0
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Any other arguments to pass to the Chain constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Chain
+ |
+
+
+
+ A ChainConsumer Chain made from the emcee samples + |
+
src/chainconsumer/chain.py
classmethod
+
+
+¶from_numpyro(mcmc: numpyro.infer.MCMC, name: str, var_names: list[str] | None = None, **kwargs: Any) -> Chain
+
Constructor from numpyro samples
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mcmc |
+
+ MCMC
+ |
+
+
+
+ The numpyro sampler + |
+ + required + | +
name |
+
+ str
+ |
+
+
+
+ The name of the chain + |
+ + required + | +
var_names |
+
+ list[str] | None
+ |
+
+
+
+ The names of the parameters to include in the chain. If the entries of var_names start with ~, + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Any other arguments to pass to the Chain constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Chain
+ |
+
+
+
+ A ChainConsumer Chain made from numpyro samples + |
+
src/chainconsumer/chain.py
classmethod
+
+
+¶from_arviz(arviz_id: arviz.InferenceData, name: str, var_names: list[str] | None = None, **kwargs: Any) -> Chain
+
Constructor from an arviz InferenceData object
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
arviz_id |
+
+ InferenceData
+ |
+
+
+
+ The arviz inference data + |
+ + required + | +
name |
+
+ str
+ |
+
+
+
+ The name of the chain + |
+ + required + | +
var_names |
+
+ list[str] | None
+ |
+
+
+
+ The names of the parameters to include in the chain. If the entries of var_names start with ~, + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Any other arguments to pass to the Chain constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Chain
+ |
+
+
+
+ A ChainConsumer Chain made from the arviz chain + |
+
src/chainconsumer/chain.py
+ Bases: BetterBase
The configuration for a chain. This is used to set the default values for +plotting chains, and is also used to store the configuration of a chain.
+Note that some attributes are defaulted to None instead of their type hint. +Like color. This indicates that this parameter should be inferred if not explicitly +set, and that this inference requires knowledge of the other chains. For example, +if you have two chains, you probably want them to be different colors.
+ +src/chainconsumer/chain.py
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶summary_area: float = Field(default=0.6827, ge=0, le=1.0, description='The area to use for summary statistics')
+
class-attribute
+ instance-attribute
+
+
+¶sigmas: list[float] = Field(default=[0, 1, 2], description='The sigmas to use for summary statistics')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶smooth: int = Field(default=3, description='The smoothing for histograms. Set to 0 for no smoothing')
+
class-attribute
+ instance-attribute
+
+
+¶color_param: str | None = Field(default=None, description='The parameter (column) to use for coloring')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶shift_params: bool = Field(default=False, description='Whether to shift the parameters by subtracting each parameters mean')
+
The ChainConsumer acts as manager and state holder, to which you supply configured pydantic objects to dictate the behaviour of your plots and analyses.
+A class for consuming chains produced by an MCMC walk. Or grid searches. To make plots, +figures, tables, diagnostics, you name it.
+ +src/chainconsumer/chainconsumer.py
17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 |
|
instance-attribute
+
+
+¶Use this to access all the plotting functions
+instance-attribute
+
+
+¶Use this to access your diagnostics to see if chains have converged.
+instance-attribute
+
+
+¶Use this to compare chains to each other, like ranking the AIC, BIC, and DIC.
+instance-attribute
+
+
+¶Use this to access the analysis functions, like getting summary statistics from your chains.
+Add a truth to ChainConsumer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
truth |
+
+ Truth
+ |
+
+
+
+ The truth to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ ChainConsumer
+ |
+
+
+
+ Itself, to allow chaining calls. + |
+
src/chainconsumer/chainconsumer.py
Add a chain to ChainConsumer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
chain |
+
+ Chain
+ |
+
+
+
+ The chain to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ ChainConsumer
+ |
+
+
+
+ Itself, to allow chaining calls. + |
+
src/chainconsumer/chainconsumer.py
Set the plot config for ChainConsumer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
plot_config |
+
+ PlotConfig
+ |
+
+
+
+ The plot config to use. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ ChainConsumer
+ |
+
+
+
+ Itself, to allow chaining calls. + |
+
src/chainconsumer/chainconsumer.py
add_marker(location: dict[ColumnName, float], name: str, color: ColorInput | None = None, marker_size: float = 20.0, marker_style: str = '.', marker_alpha: float = 1.0) -> ChainConsumer
+
Add a marker to the plot at the given location.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
location |
+
+ dict[ColumnName, float]
+ |
+
+
+
+ The location of the marker. + |
+ + required + | +
name |
+
+ str
+ |
+
+
+
+ The name of the marker. + |
+ + required + | +
color |
+
+ ColorInput | None
+ |
+
+
+
+ The colour of the marker. Defaults to None. + |
+
+ None
+ |
+
marker_size |
+
+ float
+ |
+
+
+
+ The size of the marker. Defaults to 20.0. + |
+
+ 20.0
+ |
+
marker_style |
+
+ str
+ |
+
+
+
+ The style of the marker. Defaults to ".". + |
+
+ '.'
+ |
+
marker_alpha |
+
+ float
+ |
+
+
+
+ The alpha of the marker. Defaults to 1.0. + |
+
+ 1.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ ChainConsumer
+ |
+
+
+
+ Itself, to allow chaining calls. + |
+
src/chainconsumer/chainconsumer.py
Removes a chain from ChainConsumer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
remove |
+
+ str | Chain
+ |
+
+
+
+ The name of the chain to remove, or the chain itself. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ ChainConsumer
+ |
+
+
+
+ Itself, to allow chaining calls. + |
+
src/chainconsumer/chainconsumer.py
Apply a custom override config
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
override |
+
+ ChainConfig
+ |
+
+
+
+ The override config. Defaults to None. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ ChainConsumer
+ |
+
+
+
+ Itself, to allow chaining calls. + |
+
src/chainconsumer/chainconsumer.py
Get a chain by name.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ The name of the chain. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Chain
+ |
+
+
+
+ The chain. + |
+
src/chainconsumer/chainconsumer.py
Get the names of all chains.
+Returns: +The names of all chains.
+ + +
+ Bases: BetterBase
src/chainconsumer/plotting/config.py
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶diagonal_tick_labels: bool = Field(default=True, description='Whether to show tick labels on the diagonal')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶contour_label_font_size: int = Field(default=10, ge=0, description='Font size for contour labels')
+
class-attribute
+ instance-attribute
+
+
+¶show_legend: bool | None = Field(default=None, description='Whether to show the legend. None means determine automatically')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶legend_location: tuple[int, int] | None = Field(default=None, description='Which subplot to put the legend in')
+
class-attribute
+ instance-attribute
+
+
+¶legend_artists: bool | None = Field(default=None, description='Whether to show artists in the legend')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶watermark_text_kwargs: dict[str, Any] = Field(default={}, description='Kwargs to pass to the watermark text')
+
class-attribute
+ instance-attribute
+
+
+¶summarise: bool = Field(default=True, description='Whether to annotate the plot with summary statistics')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶sigma2d: bool = Field(default=False, description='Whether to use 2D sigmas for summary statistics. Ie in 2D a 1sigma contour does *not* encapsulate 68% of the volume, it covers 39.3% of the volume.')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶log_scales: list[ColumnName] = Field(default=[], description='Whether to use log scales for some parameters')
+
class-attribute
+ instance-attribute
+
+
+¶extents: dict[ColumnName, tuple[float, float]] = Field(default={}, description="Extents for parameters. Any you don't specify are determined automatically")
+
class-attribute
+ instance-attribute
+
+
+¶property
+
+
+¶property
+
+
+¶Generally accessible via:
+ + + +src/chainconsumer/plotter.py
108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + 445 + 446 + 447 + 448 + 449 + 450 + 451 + 452 + 453 + 454 + 455 + 456 + 457 + 458 + 459 + 460 + 461 + 462 + 463 + 464 + 465 + 466 + 467 + 468 + 469 + 470 + 471 + 472 + 473 + 474 + 475 + 476 + 477 + 478 + 479 + 480 + 481 + 482 + 483 + 484 + 485 + 486 + 487 + 488 + 489 + 490 + 491 + 492 + 493 + 494 + 495 + 496 + 497 + 498 + 499 + 500 + 501 + 502 + 503 + 504 + 505 + 506 + 507 + 508 + 509 + 510 + 511 + 512 + 513 + 514 + 515 + 516 + 517 + 518 + 519 + 520 + 521 + 522 + 523 + 524 + 525 + 526 + 527 + 528 + 529 + 530 + 531 + 532 + 533 + 534 + 535 + 536 + 537 + 538 + 539 + 540 + 541 + 542 + 543 + 544 + 545 + 546 + 547 + 548 + 549 + 550 + 551 + 552 + 553 + 554 + 555 + 556 + 557 + 558 + 559 + 560 + 561 + 562 + 563 + 564 + 565 + 566 + 567 + 568 + 569 + 570 + 571 + 572 + 573 + 574 + 575 + 576 + 577 + 578 + 579 + 580 + 581 + 582 + 583 + 584 + 585 + 586 + 587 + 588 + 589 + 590 + 591 + 592 + 593 + 594 + 595 + 596 + 597 + 598 + 599 + 600 + 601 + 602 + 603 + 604 + 605 + 606 + 607 + 608 + 609 + 610 + 611 + 612 + 613 + 614 + 615 + 616 + 617 + 618 + 619 + 620 + 621 + 622 + 623 + 624 + 625 + 626 + 627 + 628 + 629 + 630 + 631 + 632 + 633 + 634 + 635 + 636 + 637 + 638 + 639 + 640 + 641 + 642 + 643 + 644 + 645 + 646 + 647 + 648 + 649 + 650 + 651 + 652 + 653 + 654 + 655 + 656 + 657 + 658 + 659 + 660 + 661 + 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 + 673 + 674 + 675 + 676 + 677 + 678 + 679 + 680 + 681 + 682 + 683 + 684 + 685 + 686 + 687 + 688 + 689 + 690 + 691 + 692 + 693 + 694 + 695 + 696 + 697 + 698 + 699 + 700 + 701 + 702 + 703 + 704 + 705 + 706 + 707 + 708 + 709 + 710 + 711 + 712 + 713 + 714 + 715 + 716 + 717 + 718 + 719 + 720 + 721 + 722 + 723 + 724 + 725 + 726 + 727 + 728 + 729 + 730 + 731 + 732 + 733 + 734 + 735 + 736 + 737 + 738 + 739 + 740 + 741 + 742 + 743 + 744 + 745 + 746 + 747 + 748 + 749 + 750 + 751 + 752 + 753 + 754 + 755 + 756 + 757 + 758 + 759 + 760 + 761 + 762 + 763 + 764 + 765 + 766 + 767 + 768 + 769 + 770 + 771 + 772 + 773 + 774 + 775 + 776 + 777 + 778 + 779 + 780 + 781 + 782 + 783 + 784 + 785 + 786 + 787 + 788 + 789 + 790 + 791 + 792 + 793 + 794 + 795 + 796 + 797 + 798 + 799 + 800 + 801 + 802 + 803 + 804 + 805 + 806 + 807 + 808 + 809 + 810 + 811 + 812 + 813 + 814 + 815 + 816 + 817 + 818 + 819 + 820 + 821 + 822 + 823 + 824 + 825 + 826 + 827 + 828 + 829 + 830 + 831 + 832 + 833 + 834 + 835 + 836 + 837 + 838 + 839 + 840 + 841 + 842 + 843 + 844 + 845 + 846 + 847 + 848 + 849 + 850 + 851 + 852 + 853 + 854 + 855 + 856 + 857 + 858 + 859 + 860 + 861 + 862 + 863 + 864 + 865 + 866 + 867 + 868 + 869 + 870 + 871 + 872 + 873 + 874 + 875 + 876 + 877 + 878 + 879 + 880 + 881 + 882 + 883 + 884 + 885 + 886 + 887 + 888 + 889 + 890 + 891 + 892 + 893 + 894 + 895 + 896 + 897 + 898 + 899 + 900 + 901 + 902 + 903 + 904 + 905 + 906 + 907 + 908 + 909 + 910 + 911 + 912 + 913 + 914 + 915 + 916 + 917 + 918 + 919 + 920 + 921 + 922 + 923 + 924 + 925 + 926 + 927 + 928 + 929 + 930 + 931 + 932 + 933 + 934 + 935 + 936 + 937 + 938 + 939 + 940 + 941 + 942 + 943 + 944 + 945 + 946 + 947 + 948 + 949 + 950 + 951 + 952 + 953 + 954 + 955 + 956 + 957 + 958 + 959 + 960 + 961 + 962 + 963 + 964 + 965 + 966 + 967 + 968 + 969 + 970 + 971 + 972 + 973 + 974 + 975 + 976 + 977 + 978 + 979 + 980 + 981 + 982 + 983 + 984 + 985 + 986 + 987 + 988 + 989 + 990 + 991 + 992 + 993 + 994 + 995 + 996 + 997 + 998 + 999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 |
|
plot(chains: list[ChainName | Chain] | None = None, columns: list[ColumnName] | None = None, filename: list[str | Path] | str | Path | None = None, figsize: FigSize | float | int | tuple[float, float] = FigSize.GROW) -> Figure
+
Plot the chain!
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
chains |
+
+ list[ChainName | Chain] | None
+ |
+
+
+
+ Used to specify which chain to show if more than one chain is loaded in. +Can be an integer, specifying the +chain index, or a str, specifying the chain name. + |
+
+ None
+ |
+
columns |
+
+ list[ColumnName] | None
+ |
+
+
+
+ If set, only creates a plot for those specific parameters (if list). If an +integer is given, only plots the fist so many parameters. + |
+
+ None
+ |
+
filename |
+
+ list[str | Path] | str | Path | None
+ |
+
+
+
+ If set, saves the figure to this location + |
+
+ None
+ |
+
figsize |
+
+ FigSize | float | int | tuple[float, float]
+ |
+
+
+
+ The figure size to generate. Accepts a regular two tuple of size in inches,
+or one of several key words. The default value of |
+
+ GROW
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Figure
+ |
+
+
+
+ the matplotlib figure + |
+
src/chainconsumer/plotter.py
132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 |
|
Sets the plot config to the chosen PlotConfig
model.
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
config |
+
+ PlotConfig
+ |
+
+
+
+ The config to use + |
+ + required + | +
plot_walks(chains: list[ChainName | Chain] | None = None, columns: list[ColumnName] | None = None, filename: list[str | Path] | str | Path | None = None, figsize: float | tuple[float, float] | None = None, convolve: int | None = None, plot_weights: bool = True, plot_posterior: bool = True, log_weight: bool = False) -> Figure
+
Plots the chain walk; the parameter values as a function of step index.
+This plot is more for a sanity or consistency check than for use with final results.
+Plotting this before plotting with :func:plot
allows you to quickly see if the
+chains are well behaved, or if certain parameters are suspect
+or require a greater burn in period.
The desired outcome is to see an unchanging distribution along the x-axis of the plot. +If there are obvious tails or features in the parameters, you probably want +to investigate.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
chains |
+
+ list[ChainName | Chain] | None
+ |
+
+
+
+ Used to specify which chain to show if more than one chain is loaded in. +Can be an integer, specifying the +chain index, or a str, specifying the chain name. + |
+
+ None
+ |
+
columns |
+
+ list[ColumnName] | None
+ |
+
+
+
+ If set, only creates a plot for those specific parameters (if list). If an +integer is given, only plots the fist so many parameters. + |
+
+ None
+ |
+
filename |
+
+ list[str | Path] | str | Path | None
+ |
+
+
+
+ If set, saves the figure to this location + |
+
+ None
+ |
+
figsize |
+
+ float | tuple[float, float] | None
+ |
+
+
+
+ Scale horizontal and vertical figure size. + |
+
+ None
+ |
+
col_wrap |
+ + | +
+
+
+ How many columns to plot before wrapping. + |
+ + required + | +
convolve |
+
+ int | None
+ |
+
+
+
+ If set, overplots a smoothed version of the steps using |
+
+ None
+ |
+
plot_weights |
+
+ bool
+ |
+
+
+
+ If true, plots the weight if they are available + |
+
+ True
+ |
+
plot_posterior |
+
+ bool
+ |
+
+
+
+ If true, plots the log posterior if they are available + |
+
+ True
+ |
+
log_weight |
+
+ bool
+ |
+
+
+
+ Whether to display weights in log space or not. If None, the value is +inferred by the mean weights of the plotted chains. + |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Figure
+ |
+
+
+
+ the matplotlib figure created + |
+
src/chainconsumer/plotter.py
278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 |
|
plot_distributions(chains: list[ChainName | Chain] | None = None, columns: list[ColumnName] | None = None, filename: list[str | Path] | str | Path | None = None, col_wrap: int = 4, figsize: float | tuple[float, float] | None = None) -> Figure
+
Plots the 1D parameter distributions for verification purposes.
+This plot is more for a sanity or consistency check than for use with final results.
+Plotting this before plotting with :func:plot
allows you to quickly see if the
+chains give well behaved distributions, or if certain parameters are suspect
+or require a greater burn in period.
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
chains |
+
+ list[ChainName | Chain] | None
+ |
+
+
+
+ Used to specify which chain to show if more than one chain is loaded in. +Can be an integer, specifying the +chain index, or a str, specifying the chain name. + |
+
+ None
+ |
+
columns |
+
+ list[ColumnName] | None
+ |
+
+
+
+ If set, only creates a plot for those specific parameters (if list). If an +integer is given, only plots the fist so many parameters. + |
+
+ None
+ |
+
filename |
+
+ list[str | Path] | str | Path | None
+ |
+
+
+
+ If set, saves the figure to this location + |
+
+ None
+ |
+
figsize |
+
+ float | tuple[float, float] | None
+ |
+
+
+
+ Scale horizontal and vertical figure size. + |
+
+ None
+ |
+
col_wrap |
+
+ int
+ |
+
+
+
+ How many columns to plot before wrapping. + |
+
+ 4
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Figure
+ |
+
+
+
+ the matplotlib figure created + |
+
src/chainconsumer/plotter.py
417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 |
|
plot_summary(chains: list[ChainName | Chain] | None = None, columns: list[ColumnName] | None = None, filename: list[str | Path] | str | Path | None = None, figsize: float = 1.0, errorbar: bool = False, extra_parameter_spacing: float = 1.0, vertical_spacing_ratio: float = 1.0) -> Figure
+
Plots parameter summaries
+This plot is more for a sanity or consistency check than for use with final results.
+Plotting this before plotting with :func:plot
allows you to quickly see if the
+chains give well behaved distributions, or if certain parameters are suspect
+or require a greater burn in period.
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
chains |
+
+ list[ChainName | Chain] | None
+ |
+
+
+
+ Used to specify which chain to show if more than one chain is loaded in. +Can be an integer, specifying the +chain index, or a str, specifying the chain name. + |
+
+ None
+ |
+
columns |
+
+ list[ColumnName] | None
+ |
+
+
+
+ If set, only creates a plot for those specific parameters (if list). If an +integer is given, only plots the fist so many parameters. + |
+
+ None
+ |
+
filename |
+
+ list[str | Path] | str | Path | None
+ |
+
+
+
+ If set, saves the figure to this location + |
+
+ None
+ |
+
figsize |
+
+ float
+ |
+
+
+
+ Scale horizontal and vertical figure size. + |
+
+ 1.0
+ |
+
errorbar |
+
+ bool
+ |
+
+
+
+ Whether to onle plot an error bar, instead of the marginalised distribution. + |
+
+ False
+ |
+
include_truth_chain |
+ + | +
+
+
+ If you specify another chain as the truth chain, determine if it should still +be plotted. + |
+ + required + | +
extra_parameter_spacing |
+
+ float
+ |
+
+
+
+ Increase horizontal space for parameter values + |
+
+ 1.0
+ |
+
vertical_spacing_ratio |
+
+ float
+ |
+
+
+
+ Increase vertical space for each model + |
+
+ 1.0
+ |
+
Returns: + the matplotlib figure created
+ +src/chainconsumer/plotter.py
519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 |
|
+ Bases: BetterBase
src/chainconsumer/truth.py
class-attribute
+ instance-attribute
+
+
+¶location: dict[str, float] = Field(default=..., description='The truth value, either as dictionary or pandas series which will be converted to a dict)')
+
class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶class-attribute
+ instance-attribute
+
+
+¶