LocScalePTM.setup_default_mcmc_kernels()

LocScalePTM.setup_default_mcmc_kernels()#

LocScalePTM.setup_default_mcmc_kernels(strategy='iwls_fixed', use_fallback_finfos=True, locscale_kernel_kwargs=None, trafo_kernel_kwargs_nuts=None, trafo_kernel_kwargs_iwls=None, override_existing_inference_on_locscale=False, override_existing_inference_on_trafo=False, jitter_dist=None)[source]#

Configure default MCMC kernels for model parts.

Parameters:
  • strategy (Literal['iwls_fixed', 'iwls_fixed-nuts', 'nuts', 'iwls-nuts', 'iwls-iwls_fixed']) –

    Kernel selection strategy for loc/scale/trafo parts. The strategies are:

    • ”iwls_fixed”: Metropolis-Hastings with proposals generated according to

      the iteratively re-weighted least squares kernel. The Fisher information matrices used here are fixed to the observed Fisher information matrices at initial estimates of the posterior modes.

    • ”iwls_fixed-nuts”: Uses “iwls_fixed” in the location and scale model parts

      and a No-U-turn sampler (NUTS) for the parameters of the transformation function.

    • ”nuts”: Uses NUTS for location, scale, and transformation. Does not

      scale well with increasing sample size.

    • ”iwls-nuts”: Like “iwls_fixed-nuts”, but uses expected Fisher information

      matrices derived under a Gaussian assumption for the response as an approximation to generate proposals.

    None of the strategies set up MCMC kernels for hyperparameters like smoothing parameters in the location and scale model parts, these should be specified manually.

    If the random walk variance of the transformation function is transformed to the real line with a bijector, the default scheme will always set up a NUTS kernel for this parameter. (default: 'iwls_fixed')

  • use_fallback_finfos (bool) – If True, fall back to Gaussian Fisher information matrices in location and scale model parts when needed. (default: True)

  • locscale_kernel_kwargs (dict[str, Any] | None) – Optional keyword arguments forwarded to kernel constructors. (default: None)

  • trafo_kernel_kwargs – Optional keyword arguments forwarded to kernel constructors.

  • override_existing_inference_on_locscale (bool) – If True, existing inference specifications are overridden. (default: False)

  • override_existing_inference_on_trafo (bool) – If True, existing inference specifications are overridden. (default: False)

Return type:

LocScalePTM

Returns:

The model with inference specs set up.