summarise_by_samples()

summarise_by_samples()#

liesel_gam.summarise_by_samples(key, a, name='value', n=100)[source]#

Summarizes an array of posterior samples via subsamples.

Parameters:
  • key (Array) – Jax key-array (created by jax.random.key) for drawing subsamples.

  • a (Array | ndarray | bool | number | bool | int | float | complex) – The array to be summarized, assumed to have shape (C, S, N), where C is the number of MCMC chains, S is the number of samples, and N is the dimension of the quantity to summarize. Arrays of shape (C, S) are currently not supported by this function.

  • name (str, default: 'value') – Column name for the value column in the returned dataframe.

  • n (int, default: 100) – Number of subsamples to draw from a.

Return type:

DataFrame

Returns:

A dataframe with the following columns:

  • value: sample value

  • index: index of the flattened array

  • sample: sample number

  • obs: observation number (enumerates quantity dimension, N)

  • chain: chain number