Defines a likelihood that non-linearly optimizes over gain corrections with a Gaussian prior.
More...
|
| likelihood_optimal_gain_correction_visibility_amplitude (data_visibility_amplitude &data, model_visibility_amplitude &model, std::vector< std::string > station_codes, std::vector< double > sigma_g) |
| Construct to do scan-by-scan correction by default.
|
|
| likelihood_optimal_gain_correction_visibility_amplitude (data_visibility_amplitude &data, model_visibility_amplitude &model, std::vector< std::string > station_codes, std::vector< double > sigma_g, std::vector< double > t_ge) |
| Specify the times of the gain-correction epochs by hand.
|
|
| likelihood_optimal_gain_correction_visibility_amplitude (data_visibility_amplitude &data, model_visibility_amplitude &model, std::vector< std::string > station_codes, std::vector< double > sigma_g, std::vector< double > t_ge, std::vector< double > max_g) |
| Specify the times of the gain-correction epochs by hand.
|
|
virtual double | operator() (std::vector< double > &x) |
| Returns the log-likelihood of a vector of parameters \( \mathbf{x} \).
|
|
virtual double | chi_squared (std::vector< double > &x) |
| Returns the \( \chi^2 \) of a vector of parameters \( \mathbf{x} \).
|
|
std::vector< double > | get_gain_correction_times () |
| Returns the start time of each gain-correction epoch.
|
|
std::vector< std::vector< double > > | get_gain_corrections () |
| Returns the set of gain corrections for each epoch.
|
|
void | output_gain_corrections (std::ostream &out) |
| Outputs the set of gain corrections in a structure fashion to an output stream.
|
|
void | output_gain_corrections (std::string outname) |
| Outputs the set of gain corrections in a structure fashion to a file.
|
|
virtual void | set_mpi_communicator (MPI_Comm comm) |
| Defines a set of processors provided to the model for parallel computation via an MPI communicator. Only facilates code parallelization if the model computation is parallelized via MPI.
|
|
size_t | number_of_independent_gains () |
| Returns the number of independent gains, which is generally less than product of the number of stations and number of epochs.
|
|
void | read_gain_file (std::string gain_file_name) |
| Reads gain file.
|
|
void | solve_for_gains () |
| Turns on gain solver (default is on)
|
|
void | fix_gains () |
| Fixes the gains to last value.
|
|
void | assume_smoothly_varying_gains () |
| Assume that the gain corrections are correlated, yielding an approximate solution for subsequent times (default).
|
|
void | assume_independently_varying_gains () |
| Assume that the gain corrections are not correlated.
|
|
virtual std::vector< double > | gradient (std::vector< double > &x, prior &Pr) |
|
void | output_model_data_comparison (std::ostream &out) |
|
void | output_model_data_comparison (std::string filename) |
|
|
void | check_station_codes () |
|
void | allocate_memory () |
|
void | organize_data_lists () |
|
double | optimal_gain_corrections (std::vector< double > &y, std::vector< double > &yb, std::vector< size_t > &is1, std::vector< size_t > &is2, std::vector< double > &gest) |
|
double | matrix_determinant (double **a) |
|
void | ludcmp (double **a, int n, int *indx, double &d) |
|
void | gain_optimization_likelihood (size_t i, const double g[], double *y, double dydg[]) const |
|
void | covsrt (double **covar, int ma, int mfit) |
|
void | gaussj (double **a, int n, double **b, int m) |
|
void | mrqcof (double y[], int ndata, double a[], int ma, double **alpha, double beta[], double *chisq) |
|
void | mrqmin (double y[], int ndata, double a[], int ma, double **covar, double **alpha, double *chisq, double *alamda) |
|
This class takes a visibility amplitude data object and a visibility amplitude model object, and then returns the log likelihood after minimalization of the log-likelihood within the gain-correction sub-space. That is, it sets the model to \( V_{AB}(g_A,g_B;p) = (1+g_A)(1+g_B) \bar{V}_{AB}(p) \), and numerically maximizes the likelihood independently for each observation epoch, assuming Gaussian priors on the \(g_A\) and Gaussian errors. An approximation of the marginalized likelihood is generated using the covariance of the likelihood, though this makes little difference in practice. Gain-reconstruction epochs may be specified explicitly; by default the corrections will be performed by scan.
- Warning
- Note that this fails if low-SNR points are included in the analysis, which drives erroneous gain reconstructions. Typically, a minimum SNR or 2 is sufficient, which is required for the visibility amplitude error distribution to be well approximated by a Gaussian.