Skip to content

Index

Types and functions

Octopodes.BinnedIndepRuns Type

Binned version of independent MCMC runs.

  • binning

  • samples: Dims: (system index, MCMC iteration).

  • tilde_psi

  • max_n_companions

  • star_names

source
Octopodes.BinnedSample Type
  • n_companions

  • bin_memberships: Contains inactive ones (for type stability) - the inactive ones are set to zero.

source
Octopodes.Binning Type

Discretization of the (log_P_yr, log_q) into regular grids.

Each grid is specified using StepRangeLen, see interval_index.

source
Octopodes.Binning Method
julia
Binning(runs; n_log_P_yr_intervals, n_log_q_intervals)

Use the prior bounds from the independent MCMC runs and a requested number of intervals in each axis to build a binning.

source
Octopodes.IndepRuns Type

Information needed about the independent MCMC runs for each system in order to run joint inference.

  • traces: A vector of traces, one for each system. Each trace is a NamedTuple assumed to have the following fields:

    • n_planets::Vector{Int64},

    • log_P_yr::Matrix{Float64},

    • log_q::Matrix{Float64},

    • n_samples::Int64,

    • name::String

  • mv

  • log_P_yr_prior

  • log_q_prior

  • n_companions_prior

source
Octopodes.IndepRuns Method
julia
IndepRuns(d)

Load the IndepRuns data from an informal exchange format defined in Dict.

source
Octopodes.bin Method
julia
bin(b, values)

Given a Binning and an iterable over two reals, provide the index of the corresponding bin.

source
Octopodes.bin Method
julia
bin(b, runs; star_selector, shuffle_rng)

Perform binning on all the samples. Returns an Array of BinnedSample. Rows are systems, columns are MCMC iterations.

By default, this also shuffle each system independently. Set shuffle_rng with the AbstractRNG object to change the seed, set to nothing to skip shuffling.

Assume that all traces have the same number of iterations.

source
Octopodes.binarize Method
julia
binarize(binned, k)

Produce a coarser binning based on the indicator function of whether there is at least one planet in bin index k.

source
Octopodes.binarize Method
julia
binarize(binned)

Produce a coarser binning based on the indicator function of whether there is at least one planet (irrespective of its position).

source
Octopodes.generate_binary_indep_runs Method
julia
generate_binary_indep_runs(
;
    psi_some_companion_truth,
    n_systems,
    tilde_psi_some_companion,
    mcmc_lazy_pr,
    n_systems_iters,
    rng,
    shuffle_rng
)
source
Octopodes.interval_index Method

Return the index of the intervals in the provided StepRangeLen the given point falls in, or throw BoundsError if the point falls in none of the intervals.

All the intervals are viewed as closed on the left and open to the right, except the last one which is closed on both sides.

source
Octopodes.intervals_from_bin_index Method
julia
intervals_from_bin_index(b, k)

Given a bin index, return the interval of period and mass corresponding to it. Encode it as a new Binning object.

source
Octopodes.is_binary Method
julia
is_binary(binned)

A BinnedIndepRuns is binary if the maximum number of companions is one and the number of bins is one.

See also binarize for two methods to get a binary binning from a non binary one (either by just looking at overall presence of at least on companion, or by focusing single bin).

source
Octopodes.n_intervals Method

The number of intervals (blocks) is one less than the number of grid (boundaries).

source
Octopodes.numerical Function
julia
numerical(binned)
numerical(binned, eps)

Assume that the provided binned is binary (see is_binary) and use numerical integration to obtain a discretized posterior.

Use a uniform prior over the fraction of stars with at least one companion.

source
Octopodes.relative_sensitivities Method
julia
relative_sensitivities(binned, eps)

For each bin, binarize with respect to that bin using binarize, and compute sensitivity for that bin. Return a vector of relative sensivities, one for each bin.

Relative absolute relative_sensitivities are obtained by dividing by the primal value and taking abs values.

source
Octopodes.run_imh Function
julia
run_imh(rng, binned)
run_imh(rng, binned, processor)
source
Octopodes.sensitivity Method
julia
sensitivity(binned, eps)

Assume that the provided binned is binary (see is_binary).

Compute the mean of the distribution obtain in numerical. Embed the prior assumed there in Beta(2mu, 2(1-mu)) family prior (i.e., considering perturbations of the prior mean). Use ForwardDiff to compute the derivative of the posterior mean with respect to mu at 1/2 (i.e., in the neighbourhood of the uniform prior).

source
Octopodes.vector_to_array Method
julia
vector_to_array(b, vector)

Given a Binning and a vector of reals, reshape it into a matrix where the rows correspond to blocks in the log_P_yr partition, and the columns, to blocks in the log_q partition.

To perform the inverse operation, simply use vec(matrix).

source