Linker
- class ssapy.linker.Linker(iods, num_orbits=None, a_orbit=0.01)[source][source]
Bases:
object
Monte Carlo linking of uncorrelated orbit tracks
- Parameters:
iods (list) – List of Particles class instances summarizing initial orbit determinations (iods)
num_orbits (int, optional) – Number of orbit models to fit. If not specified, set num_orbits = num_tracks
a_orbit (float, optional) – Clustering hyperparameter in the Dirichlet prior on P_orbit (Default: 0.01)
- iods[source]
List of Particles class instances summarizing initial orbit determinations (iods)
- Type:
- num_orbits[source]
Number of orbit models to fit. If not specified, set num_orbits = num_tracks
- Type:
int, optional
- sample_Porbit_conditional_dist(track_ndx)[source][source]
Sample from the conditional distribution for p_orbit at track_index
- sample_orbit_selectors_from_data_conditional(track_ndx)[source][source]
Sample from the conditional distribution for orbit_selector at track_index
- update_orbit_parameters()[source][source]
Find the groups of linked tracks and update all particles across linked groups
- update_params_using_carlin_chib()[source][source]
Perform MCMC step using algorithm of Carlin & Chib (1995).
Methods Summary
sample
([nStep, outfile_head])Run the top-level MCMC to link tracks and refine orbit parameters
sample_Porbit_conditional_dist
(track_ndx)Sample from the conditional distribution for p_orbit at track_index
Sample from the conditional distribution for orbit_selector at track_index ignoring the dependence orbit selector dependence of the conditional priors for the orbital elements.
save_step
(outfile_head)Save MCMC step to file
Find the groups of linked tracks and update all particles across linked groups
update_params_using_carlin_chib
([verbose])Perform MCMC step using algorithm of Carlin & Chib (1995).
Methods Documentation
- sample(nStep=100, outfile_head='linker')[source][source]
Run the top-level MCMC to link tracks and refine orbit parameters
- sample_Porbit_conditional_dist(track_ndx)[source][source]
Sample from the conditional distribution for p_orbit at track_index
- Parameters:
track_index (int) – The observation list index
- Returns:
p_orbit – Draw from the conditional distribution for the p.orbit parameters
- Return type:
array_like
- sample_orbit_selectors_from_data_conditional(track_ndx, verbose=True)[source][source]
Sample from the conditional distribution for orbit_selector at track_index ignoring the dependence orbit selector dependence of the conditional priors for the orbital elements.
Draw from :math:P(y | k, theta_k) P(k | P_orbit):
- Parameters:
track_index (int) – The observation list index
- Returns:
orbit_selectors – Draw from the conditional distribution for the orbit_selectors parameters
- Return type:
array_like
- save_step(outfile_head)[source][source]
Save MCMC step to file
- Parameters:
outfile_head (str) – Head (i.e., first part) of the output file name for chain steps
- update_orbit_parameters()[source][source]
Find the groups of linked tracks and update all particles across linked groups
- update_params_using_carlin_chib(verbose=True)[source][source]
Perform MCMC step using algorithm of Carlin & Chib (1995).
Sample the “active” orbit parameters from their conditional distribution (in a Gibbs update), the “inactive” orbit parameters from the pseudo-prior, and Gibbs updates for the orbit selectors and their prior parameters. This method is distinct from the Reversible Jump MCMC (RJMCMC) updates that have no need of the pseudo-prior at the expense of finding a suitable proposal distribution for the model updates.
The Gibbs updates for each class of parameters in turn defines a blocking procedure that can, in principle, give more efficient sampling than the joint updates in RJMCMC if a good proposal distribution for the orbit selectors is not known (see Godsill 2001).
Here the pseudo-prior for the “inactive” orbit parameters is not conjugate to the orbit selector prior, so there is no direct method to perform Gibbs samples of the orbit selectors. Instead, this function performs an MH update of orbit selectors with a proposal from the distribution determined by the product of the orbit likelihoods and the orbit selector prior (which would be the orbit selector conditional distribution if the orbit priors were independent of the orbit selectors).
- Returns:
lnP – Current log-posterior value
- Return type:
References
Carlin, B., Chib, S., 1995. Bayesian model choice via Markov chain Monte Carlo methods. Journal of the Royal Statistical Society. Series B (Method- ological) 57 (3), 473?484.
Godsill, S., 2001. On the relationship between Markov chain Monte Carlo methods for model uncertainty. Journal of Computational and Graphical Statistics 10 (2), 230?248.