Skip to contents

Base class of the binomial models whose prior, integrated over every source parameter and hyperparameter, is a fixed prior on the target control rate and the risk difference, tabulated on the lattice of binomial_npp_prior_kernels(). The posterior of a dataset is that prior times the target likelihood, so it costs one weighted sum; the prior, the prior given a control rate and the prior ELIR follow from the same table.

A subclass implements kernels(), returning a list with n_lattice, rates, differences, the prior kernel and, optionally, the moment kernels read by binomial_npp_posterior(); kernel_key(), identifying the prior for the ELIR cache; and compute_posterior_parameters().

Super classes

Model -> MCMCModel -> BinomialLatticePrior

Public fields

n_lattice

Number of lattice points on the response rates.

quadrature_available

The posterior is computed by quadrature.

Methods

Inherited methods


BinomialLatticePrior$new()

Initialize a binomial lattice model.

Usage

BinomialLatticePrior$new(prior, mcmc_config)

Arguments

prior

The prior object.

mcmc_config

The MCMC configuration. Only its engine is read, and only "quadrature" is supported: these models have no Stan program.


BinomialLatticePrior$kernels()

The prior kernels. Subclasses must implement it.

Usage

BinomialLatticePrior$kernels()


BinomialLatticePrior$kernel_key()

What identifies the prior, for the ELIR cache. Subclasses must implement it.

Usage

BinomialLatticePrior$kernel_key()


BinomialLatticePrior$source_counts()

The source counts of the prior.

Usage

BinomialLatticePrior$source_counts()

Returns

A list with the four source counts.


BinomialLatticePrior$quadrature_posterior()

The posterior on a grid

Usage

BinomialLatticePrior$quadrature_posterior(target_data)

Arguments

target_data

The target study data.

Returns

A grid_posterior() list.


BinomialLatticePrior$quadrature_prior()

The prior of the treatment effect on a grid.

Usage

BinomialLatticePrior$quadrature_prior()

Returns

A grid_posterior() list.


BinomialLatticePrior$prior_given_control_rate()

The prior of the treatment effect given the target control rate

The kernel's row for the lattice cell that contains control_rate, which confines the treatment effect to the differences that keep the target treatment rate in \([0, 1]\).

Usage

BinomialLatticePrior$prior_given_control_rate(control_rate)

Arguments

control_rate

The target control rate.

Returns

A list of three functions of the treatment effect: cdf, pdf, and sample, which takes the number of draws.


BinomialLatticePrior$prior_elir_ess()

ELIR effective sample size of the prior

The prior does not depend on the target data, so its unit-scale ELIR is computed once per worker, as the mean over several mixture fits under a fixed seed (see grid_prior_unit_elir()), and rescaled by the target's sampling standard deviation.

Usage

BinomialLatticePrior$prior_elir_ess(target_data, simulation_config)

Arguments

target_data

Target study data.

simulation_config

Simulation configuration, for n_samples_mixture_approx.

Returns

The ELIR effective sample size.


BinomialLatticePrior$clone()

The objects of this class are cloneable with this method.

Usage

BinomialLatticePrior$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.