pint.residuals.WidebandTOAResiduals
- class pint.residuals.WidebandTOAResiduals(toas, model, toa_resid_args={}, dm_resid_args={})[source]
Bases:
CombinedResiduals
A class for handling the wideband toa residuals.
Wideband TOAs have independent measurement of DM values. The residuals for wideband TOAs have two parts, the TOA residuals and DM residuals. Both residuals will be used for fitting one timing model. Currently, the DM values are stored at the TOA object.
The TOA and DM residuals are probably best accessed using the
.toa
and.dm
properties.This class inherits the
.chi2
property frompint.residuals.CombinedResiduals
.- Parameters:
toas (
pint.toa.TOAs
, optional) – The input TOAs object. Default: Nonemodel (
pint.models.timing_model.TimingModel
, optional) – The input timing model. Default: Nonetoa_resid_args (dict, optional) – The additional arguments(not including toas and model) for TOA residuals. Default: {}
dm_resid_args (dict, optional) – The additional arguments(not including toas and model) for DM residuals. Default: {}
Methods
calc_chi2
([full_cov])Return the weighted chi-squared for the model and toas.
Compute weighted RMS of the residuals in time.
Attributes
Compute chi-squared as needed and cache the result.
data_error
WidebandDMResiduals object containing the DM residuals.
The number of degrees of freedom for the wideband residuals.
The model used to construct the residuals.
Return the weighted reduced chi-squared.
Residuals object containing the TOA residuals.
unit
- rms_weighted()
Compute weighted RMS of the residuals in time.
- property toa
Residuals object containing the TOA residuals.
- property dm
WidebandDMResiduals object containing the DM residuals.
- property chi2
Compute chi-squared as needed and cache the result.
- calc_chi2(full_cov=False)[source]
Return the weighted chi-squared for the model and toas.
If the errors on the TOAs are independent this is a straightforward calculation, but if the noise model introduces correlated errors then obtaining a meaningful chi-squared value requires a Cholesky decomposition. This is carried out, here, by constructing a GLSFitter and asking it to do the chi-squared computation but not a fit.
The return value here is available as self.chi2, which will not redo the computation unless necessary.
The chi-squared value calculated here is suitable for use in downhill minimization algorithms and Bayesian approaches.
Handling of problematic results - degenerate conditions explored by a minimizer for example - may need to be checked to confirm that they correctly return infinity.
- property model
The model used to construct the residuals.
Modifying this model, even changing its parameters, may have confusing effects. It is probably best to use
copy.deepcopy()
to duplicate it before making any changes.
- property dof
The number of degrees of freedom for the wideband residuals.
- property reduced_chi2
Return the weighted reduced chi-squared.