Skip to contents

This class represents a Gaussian Commensurate Power Prior model.

Super classes

Model -> MCMCModel -> GaussianCommensuratePowerPrior

Public fields

method

Method name

heterogeneity_prior_family

Heterogeneity prior family (half_normal, inverse_gamma)

borrows_power_parameter

Whether the model samples a power parameter

stan_model_prefix

Prefix of the compiled Stan model's name

summary_variables

Variables to summarise from the posterior draws

Methods

Inherited methods


GaussianCommensuratePowerPrior$new()

Initialize the GaussianCommensuratePowerPrior object

Usage

GaussianCommensuratePowerPrior$new(prior, mcmc_config)

Arguments

prior

The prior object

mcmc_config

The MCMC configuration parameters


GaussianCommensuratePowerPrior$prepare_data()

Prepare the data to be used by CmdStanR

Usage

GaussianCommensuratePowerPrior$prepare_data(target_data)

Arguments

target_data

Target study data


GaussianCommensuratePowerPrior$vectorised_replicate_inference()

Run all simulation replicates through a quadrature mixture instead of launching one Stan fit per replicate. The Stan implementation remains available through inference() for reference and single-data-set analyses.

Usage

GaussianCommensuratePowerPrior$vectorised_replicate_inference(
  target_data,
  samples,
  to_return,
  critical_value,
  theta_0,
  confidence_level,
  null_space
)

Arguments

target_data

Target study data

samples

Generated target-study replicates

to_return

Requested simulation outputs

critical_value

Critical posterior probability

theta_0

Null treatment effect

confidence_level

Credible interval level

null_space

Side of the null hypothesis


GaussianCommensuratePowerPrior$compute_posterior_parameters()

Compute posterior parameters

Usage

GaussianCommensuratePowerPrior$compute_posterior_parameters()


GaussianCommensuratePowerPrior$tau_posterior_moments()

Posterior mean and standard deviation of tau from the Stan draws, reported as Inf where the moment does not exist, exactly as the quadrature path reports them. A sample mean of such a moment would be finite and run-dependent, or Inf and NaN once a draw overflows.

Usage

GaussianCommensuratePowerPrior$tau_posterior_moments()


GaussianCommensuratePowerPrior$sample_prior()

Draw samples from the prior distribution. Based on equation (8) in Hobbs et al (2011); the plain commensurate prior shares it, with the power parameter at one.

Usage

GaussianCommensuratePowerPrior$sample_prior(n_samples)

Arguments

n_samples

Number of samples


GaussianCommensuratePowerPrior$joint_prior_pdf()

Joint prior p.d.f. Based on equation (8) in Hobbs et al (2011).

Usage

GaussianCommensuratePowerPrior$joint_prior_pdf(treatment_effect, gamma, tau)

Arguments

treatment_effect

Treatment effect

gamma

Power parameter

tau

Heterogeneity parameter


GaussianCommensuratePowerPrior$prior_pdf()

Prior p.d.f. of the treatment effect: the quadrature mixture the simulations use, which covers the whole prior. Integrating tau numerically over a finite window instead would drop most of the heavy-tailed priors: \([0.001, 100]\) keeps 0.9% of inverse_gamma(1/1000, 1) and 12% of a Cauchy(0, 30) on log(tau).

Usage

GaussianCommensuratePowerPrior$prior_pdf(treatment_effect)

Arguments

treatment_effect

Treatment effect


GaussianCommensuratePowerPrior$prior_cdf()

Prior c.d.f. of the treatment effect, from the same mixture as prior_pdf(). Without it the MCMC parent would take the empirical c.d.f. of prior draws.

Usage

GaussianCommensuratePowerPrior$prior_cdf(treatment_effect, ...)

Arguments

treatment_effect

Treatment effect

...

Unused; accepted for compatibility with the parent's sample-size argument.


GaussianCommensuratePowerPrior$clone()

The objects of this class are cloneable with this method.

Usage

GaussianCommensuratePowerPrior$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.