Index
Octopodes.BinnedIndepRunsOctopodes.BinnedSampleOctopodes.BinningOctopodes.BinningOctopodes.IndepRunsOctopodes.IndepRunsOctopodes.binOctopodes.binOctopodes.binarizeOctopodes.binarizeOctopodes.generate_binary_indep_runsOctopodes.interval_indexOctopodes.intervals_from_bin_indexOctopodes.is_binaryOctopodes.n_intervalsOctopodes.numericalOctopodes.relative_sensitivitiesOctopodes.run_imhOctopodes.sensitivityOctopodes.vector_to_array
Types and functions
Octopodes.BinnedIndepRuns Type
Binned version of independent MCMC runs.
binningsamples: Dims: (system index, MCMC iteration).tilde_psimax_n_companionsstar_names
Octopodes.BinnedSample Type
n_companionsbin_memberships: Contains inactive ones (for type stability) - the inactive ones are set to zero.
Octopodes.Binning Type
Discretization of the (log_P_yr, log_q) into regular grids.
Each grid is specified using StepRangeLen, see interval_index.
Octopodes.Binning Method
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.
sourceOctopodes.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 aNamedTupleassumed to have the following fields:n_planets::Vector{Int64},log_P_yr::Matrix{Float64},log_q::Matrix{Float64},n_samples::Int64,name::String
mvlog_P_yr_priorlog_q_priorn_companions_prior
Octopodes.IndepRuns Method
IndepRuns(d)Load the IndepRuns data from an informal exchange format defined in Dict.
Octopodes.bin Method
bin(b, values)Given a Binning and an iterable over two reals, provide the index of the corresponding bin.
Octopodes.bin Method
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.
sourceOctopodes.binarize Method
binarize(binned, k)Produce a coarser binning based on the indicator function of whether there is at least one planet in bin index k.
Octopodes.binarize Method
binarize(binned)Produce a coarser binning based on the indicator function of whether there is at least one planet (irrespective of its position).
sourceOctopodes.generate_binary_indep_runs Method
generate_binary_indep_runs(
;
psi_some_companion_truth,
n_systems,
tilde_psi_some_companion,
mcmc_lazy_pr,
n_systems_iters,
rng,
shuffle_rng
)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.
sourceOctopodes.intervals_from_bin_index Method
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.
Octopodes.is_binary Method
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).
Octopodes.n_intervals Method
The number of intervals (blocks) is one less than the number of grid (boundaries).
sourceOctopodes.numerical Function
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.
sourceOctopodes.relative_sensitivities Method
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.
sourceOctopodes.sensitivity Method
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).
Octopodes.vector_to_array Method
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).