data_like#

View page source

Data Likelihood and Weighted Residuals#

Notation#

i#

We use \(i\) to denote the data_id for a row in the data table.

a_i#

We use \(a_i\) to denote the corresponding age_lower value.

b_i#

We use \(b_i\) to denote the corresponding age_upper value.

d_i#

We use \(d_i\) to denote the density_id and eta value corresponding to \(i\).

I_i#

We use \(I_i\) to denote the corresponding integrand_id value.

s_i#

We use \(s_i\) to denote the corresponding time_lower value.

t_i#

We use \(t_i\) to denote the corresponding time_upper value.

w_i#

We use \(w_i (a, t)\) for the weighting as a function of age and time that corresponds to the weight_id for this data_id .

\[\bar{w}_i = \int_{a(i)}^{b(i)} \int_{s(i)}^{t(i)} w_i (a,t) \; \B{d} t \; \B{d} a\]

x_ij#

We use \(x_{i,j}\) to denote the corresponding covariate values where \(j\) denotes the covariate_id . Note that the covariate reference has already been subtracted from these values.

y_i#

We use \(y_i\) to denote the corresponding meas_value value.

Minimum CV Standard Deviation, Delta_i#

Let minimum_meas_cv be the integrand table minimum_meas_cv corresponding to this integrand \(I_i\). Let meas_std and meas_value correspond to this data table data_id . The minimum cv standard deviation is defined by \(\Delta_i =\)

max ( meas_std , minimum_meas_cv * | meas_value | )

Fixed Effects, theta#

We use \(\theta\) to denote the vector of fixed effects .

Random Effects, u#

We use \(u\) to denote the vector of random effects . There is a different random effects vector \(u\) for each child. The node_id for each data point determines the random effects for Child Data . Note that there are no random effects for Parent Data . This corresponds to \(u = 0\).

Average Integrand, A_i(u, theta)#

Let \(A_i ( u , \theta )\) denote the average integrand for this data_id .

Measurement Noise Covariates#

K_i#

There is a set of rows in the mulcov table such that integrand_id is equal to \(I_i\) and mulcov_type is equal to meas_noise . We use \(K_i\) to denote the corresponding set of covariate_id values for which this is the case.

gamma_j (a, t)#

For each covariate index \(j \in K_i\) , we use \(\gamma_j (a, t)\) to denote the piecewise linear function corresponding to the group covariate multiplier variables for the corresponding mulcov_id . Note that these are only meas_noise covariate multipliers.

Average Noise Effect, E_i(theta)#

We define the average noise effect by

\[E_i ( \theta ) = \frac{1}{\bar{w}_i} \int_{a(i)}^{b(i)} \int_{s(i)}^{t(i)} \left( \sum_{j \in K_i} x_{i,j} \gamma_j (a, t) \right) w_i (a,t) \; \B{d} t \; \B{d} a\]

Adjusted Standard Deviation, sigma_i(theta)#

For \(j \in K_i\) it should hold that \(0 \leq x_{i,j}\), and \(0 \leq \gamma_j (a, t)\) so that \(\Delta_i\) is less than or equal \(\sigma_i ( \theta )\) defined below. It is important to realize that \(\sigma_i ( \theta )\) has the same units as the data.

Scaling#

For some cases below, \(E_i ( \theta )\) multiplies the Delta_i instead of multiplying \(y_i\). This avoids have no effect when \(y_i\) is zero. It is also possible to scale \(E_i ( \theta )\) by any factor one chooses by changing the value of the covariates \(x_{ij}\); see the definition of \(E_i ( \theta )\) above.

Add Variance or Standard Deviation#

Adding standard deviations requires fewer floating point operations (for every data point) but this is not expected to be significant. In addition, if the covariate value is one, the covariate multipliers have the same units as the data. On the other hand, an initial value of zero does not work well in this case because the derivative of the object with respect to the multiplier is zero. Adding variances does not have this problem, but when the covariate value is one, the covariate multipliers have data squared units.

add_std_scale_none#

If meas_noise_effect is add_std_scale_none (add standard deviations and no scaling) the adjusted standard deviation is

\[\sigma_i ( \theta ) = \Delta_i + E_i (\theta)\]

add_std_scale_all#

If meas_noise_effect is add_std_scale_all (add standard deviations and scale all cases) the adjusted standard deviation is

\[\sigma_i ( \theta ) = \Delta_i [ 1 + E_i (\theta) ]\]

add_var_scale_none#

If meas_noise_effect is add_var_scale_none (add variances and no scaling) the adjusted standard deviation is

\[\sigma_i ( \theta ) = \sqrt{ \Delta_i^2 + E_i (\theta) }\]

add_var_scale_all#

If meas_noise_effect is add_var_scale_all (add variances and scale all cases) the adjusted standard deviation is

\[\sigma_i ( \theta ) = \Delta_i \sqrt{ 1 + E_i (\theta) }\]

Transformed Standard Deviation, delta_i(theta)#

The transformed standard deviation is

\[\begin{split}\delta_i = \left\{ \begin{array}{ll} \log[ y_i + \eta_i + \sigma_i ] - \log( y_i + \eta_i ) & \R{if \; log \; density} \\ \sigma_i & \R{otherwise} \end{array} \right.\end{split}\]

Weighted Residual and Likelihood#

The weighted residual is a function of the random effects \(u\) and the fixed effects \(\theta\),

\[ R [ y_i \W{,} A_i ( u, \theta ) \W{,} \delta_i ( \theta ) \W{,} d_i ]\]

The likelihood is

\[\B{p}( y_i | u , \theta ) = \exp \left( D [ y_i \W{,} A_i ( u, \theta ) \W{,} \delta_i ( \theta ) \W{,} d_i ] \right)\]

see the log-density function D .