VLBILikelihoods
Documentation for VLBILikelihoods.
VLBILikelihoods.AbstractVLBIDistributions
VLBILikelihoods.AmplitudeLikelihood
VLBILikelihoods.ClosurePhaseLikelihood
VLBILikelihoods.CoherencyLikelihood
VLBILikelihoods.ComplexVisLikelihood
VLBILikelihoods.RiceAmplitudeLikelihood
VLBILikelihoods.lognorm
VLBILikelihoods.AbstractVLBIDistributions
— Typeabstract type AbstractVLBIDistributions <: Distributions.Distribution{Distributions.Multivariate, Distributions.Continuous}
Abstract type that detail that the distribution is the likelihood for some VLBI dataproduct. One key difference between an AbstractVLBIDistribution
and a regular Distributions.jl
one is that by default we expect on the fields of the struct
defining the distribution to be lognorm
which gives the log-normalization constant for the distribution.
This prevents the model from constantly having to compute the log-normalization constant everytime the density is evaluated, which is often the most expensive part of the computation.
To implement a AbstractVLBIDistributions
a user then just needs to define
unormed_logdensity(d::AbstractVLBIDistribution, x)
which takes in the new distribution type d
and the point you wish to evaluate the density at. Internally VLBILikelihood
adds in the normalization constant.
If the user wishes to change the default lognorm behavior they can also overload the lognorm
function to opt-out of storing the normalization constant in the struct
. For example
struct MyNormal <: AbstractVLBIDistributions end
unnormed_logdensity(d::MyNormal, x) = -x^2/2 lognorm(d::MyNormal) = -log(2π)/2
VLBILikelihoods.AmplitudeLikelihood
— MethodAmplitudeLikelihood(μ, Σ::Union{AbstractVector, AbstractMatrix})
Forms the likelihood for amplitudes from the mean vector μ
and the covariance matrix Σ
. If Σ is vector or a diagonal matrix then we assume that the argument is the diagonal covariance matrix. If Σ is a full matrix then we assume that a dense covariance was passed
We do no processing to the data, i.e. the mean μ is not-debiased anywhere. This likelihood will be significantly biased from the true Rice distribution for data points with SNR = μ/Σ < 2. For low SNR data use RiceAmplitudeLikelihood
VLBILikelihoods.ClosurePhaseLikelihood
— TypeClosurePhaseLikelihood(μ, Σ)
Construct the Gaussian approximate closure phase likelihood distribution. The distribution used here is not the exact distribution for closure phases since this becomes quite complicated (especially for correlated covariances). For our approximation we take the Gaussian around the complex exponential of the phase, that is the unormalized likelihood is given by
\[ \log\mathcal{L} = -\frac{1}{2}(e^{i\theta} - e^{i\mu})^T\Sigma^{-1}(e^{i\theta} - e^{i\mu})\]
If Σ is diagonal then this reduces to a bunch of independent Von Mises distributions, and if Σ is dense, this becomes a complicated multi-variate extension of the Von Mises distribution[1].
Parameters
μ
: The mean closure phase, which is usually computed from some VLBI modelΣ
: The measurement covariance matrix, which is usually computed directly from the data. Note thatΣ
can either be a matrix or a vector. IfΣ
is a vector then we interpretΣ
to represent the diagonal of the covariance matrix.
Note that for the dense Σ, the likelihood is not normalized properly since the normalization is not analytically tractable. This is not a problem for sampling since the normalizing constant does not depend on μ
so it does not usually impact parameter estimation. However, if you are including terms that modify the covariance Σ
then this likelihood is wrong and could give biased results. If you want to fit noise terms in Σ please either use the diagonal approximation to the likelihood, or better yet fit complex visibilities directly.
VLBILikelihoods.CoherencyLikelihood
— TypeComplexVisLikelihood(μ::AbstractVector{<:StaticMatrix{2,2}}, Σ::AbstractVector{<:StaticMatrix{2,2, <:Real}})
Creates the coherency matrix likelihood distribution which is a Gaussian over the space of 2×2 complex visibilities.
Paramters
μ
: The mean coherency matrix stored as a vector of 2x2 static matrices, which is usually computed from some VLBI modelΣ
: The measurement covariance matrix, which is usually computed directly from the data. Note thatΣ
must vector of 2x2 real static matrices.
You will get the best performance is all the vectors are given as StructVectors{<:StaticMatrices{2,2}}.
VLBILikelihoods.ComplexVisLikelihood
— TypeComplexVisLikelihood(μ::AbstractVector{<:Complex}, Σ::AbstractVector{<:Real})
Creates the complex visibility likelihood distribution which is a diagonal complex Gaussian with strictly real covariance matrix.
Paramters
μ
: The mean complex visibility, which is usually computed from some VLBI modelΣ
: The measurement covariance matrix, which is usually computed directly from the data. Note thatΣ
must be a real element vector and is interpreted at the diagonal of the covariance matrix.
VLBILikelihoods.RiceAmplitudeLikelihood
— MethodRiceAmplitudeLikelihood(μ, Σ::Union{AbstractVector, Diagonal})
Forms the likelihood for amplitudes from the mean vector μ
and the diagonal covariance matrix Σ
. Σ
can either be a Diagonal matrix or a vector whose entries are the variance for each data point.
This is the correct likelihood distribution for visibility amplitudes, but it is slower than the Gaussian approximation AmplitudeLikelihood
. However for low SNR data it is required to get unbiased results.
VLBILikelihoods.lognorm
— Methodlognorm(d::AbstractVLBIDistributions)
Compute the log-normalizatoin constant of the distribution d
.
- 1This distribution is defined on the n torus where n is the number of closure phases.