# Log(Likelihood)

orbitize.lnlike.chi2_lnlike(data, errors, corrs, model, jitter, seppa_indices, chi2_type='standard')[source]

Compute Log of the chi2 Likelihood

Args:
data (np.array): Nobsx2 array of data, where data[:,0] = sep/RA/RV

for every epoch, and data[:,1] = corresponding pa/DEC/np.nan.

errors (np.array): Nobsx2 array of errors for each data point. Same

format as data.

corrs (np.array): Nobs array of Pearson correlation coeffs

between the two quantities. If there is none, can be None.

model (np.array): Nobsx2xM array of model predictions, where M is the number of orbits being compared against the data. If M is 1, model can be 2 dimensional. jitter (np.array): Nobsx2xM array of jitter values to add to errors.

Elements of array should be 0 for for all data other than stellar rvs.

seppa_indices (list): list of epoch numbers whose observations are

given in sep/PA. This list is located in System.seppa.

chi2_type (string): the format of chi2 to use is either ‘standard’ or ‘log’

Returns:

np.array: Nobsx2xM array of chi-squared values.

Note

(1) Example: We have 8 epochs of data for a system. OFTI returns an array of 10,000 sets of orbital parameters. The model input for this function should be an array of dimension 8 x 2 x 10,000.

1. Chi2_log: redefining chi-sqaured in log scale may give a more stable optimization. This works on separation and position angle data (seppa) not right ascension and declination (radec) data, but it is possible to convert between the two within Orbitize! using the function ‘orbitize.system’radec2seppa’ (see docuemntation). This implementation defines sep chi-squared in log scale, and defines pa chi-sq using complex phase representation. log sep chisq = (log sep - log sep_true)^2 / (sep_sigma / sep_true)^2 pa chisq = 2 * (1 - cos(pa-pa_true))/pa_sigma^2

i

orbitize.lnlike.chi2_norm_term(errors, corrs)[source]

Return only the normalization term of the Gaussian likelihood:

$-log(\sqrt(2\pi*error^2))$

or

$-0.5 * (log(det(C)) + N * log(2\pi))$
Parameters
• errors (np.array) – Nobsx2 array of errors for each data point. Same format as data.

• corrs (np.array) – Nobs array of Pearson correlation coeffs between the two quantities. If there is none, can be None.

Returns

sum of the normalization terms

Return type

float