Prev Next data_like

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\W}[1]{ \; #1 \; }@)@ This is dismod_at-20221105 documentation: Here is a link to its current documentation .
Data Likelihood and Weighted Residuals

Notation
     i
     a_i
     b_i
     d_i
     I_i
     s_i
     t_i
     w_i
     x_ij
     y_i
     Minimum CV Standard Deviation, Delta_i
     Transformed Standard Deviation, sigma_i
     Fixed Effects, theta
     Random Effects, u
     Average Integrand, A_i(u, theta)
Measurement Noise Covariates
     K_i
     gamma_j (a, t)
     Average Noise Effect, E_i(theta)
Adjusted Standard Deviation, delta_i(theta)
     Scaling
     Add Variance or Standard Deviation
     add_std_scale_none
     add_std_scale_log
     add_std_scale_all
     add_var_scale_none
     add_var_scale_log
     add_var_scale_all
Weighted Residual and Likelihood

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 .

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_stdminimum_meas_cv * |meas_value| )

Transformed Standard Deviation, sigma_i
The transformed standard deviation is @[@ \sigma_i = \left\{ \begin{array}{ll} \log[ y_i + \eta_i + \Delta_i ] - \log( y_i + \eta_i ) & \R{if \; log \; density} \\ \Delta_i & \R{otherwise} \end{array} \right. @]@

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, delta_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 @(@ \sigma_i @)@ is less than or equal @(@ \delta_i ( \theta ) @)@ defined below. It is important to realize that for linear densities, @(@ \delta_i ( \theta ) @)@ has the same units as the data, and for log scaled densities @(@ \delta_i ( \theta) @)@ is in log of the data space. The mess_delta column of the data.csv file displays the data units value corresponding to @(@ \delta_i ( \theta ) @)@.

Scaling
For some cases below, @(@ E_i ( \theta ) @)@ multiplies the sigma_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 @[@ \delta_i ( \theta ) = \sigma_i + E_i (\theta) @]@

add_std_scale_log
If meas_noise_effect is add_std_scale_log (add standard deviations and only scale log density cases) the adjusted standard deviation is @[@ \delta_i ( \theta ) = \left\{ \begin{array}{ll} \sigma_i [ 1 + E_i (\theta) ] & \R{if \; log \; density} \\ \sigma_i + E_i (\theta) & \R{otherwise} \end{array} \right. @]@

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 @[@ \delta_i ( \theta ) = \sigma_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 @[@ \delta_i ( \theta ) = \sqrt{ \sigma_i^2 + E_i (\theta) } @]@

add_var_scale_log
If meas_noise_effect is add_var_scale_log (add variances and only scale log density cases) the adjusted standard deviation is @[@ \delta_i ( \theta ) = \left\{ \begin{array}{ll} \sigma_i \sqrt{ 1 + E_i (\theta) } & \R{if \; log \; density} \\ \sqrt{ \sigma_i^2 + E_i (\theta) } & \R{otherwise} \end{array} \right. @]@

add_var_scale_all
If meas_noise_effect is add_var_scale_all (add variances and scale all cases) the adjusted standard deviation is @[@ \delta_i ( \theta ) = \sigma_i \sqrt{ 1 + E_i (\theta) } @]@

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 .
Input File: omh/model/data_like.omh