Prev Next statistic

@(@\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 .
Some Statistical Function Definitions

Notation
     y
     z
     mu
     delta
     eta
     nu
     d
Weighted Residual Function, R
     Value
     Difference
Log-Density Function, D
     Uniform
     Gaussian
     Censored Gaussian
     Log-Gaussian
     Censored Log-Gaussian
     Laplace
     Censored Laplace
     Log-Laplace
     Censored Log-Laplace
     Student's-t
     Log-Student's-t

Notation

y
If @(@ z @)@ is not present, we are computing residual and statistical density for @(@ y @)@ or @(@ \log( y + \eta ) @)@.

z
If @(@ z @)@ is present, we are computing the residual and statistical density for @(@ z - y @)@ or @(@ \log( z + \eta ) - \log ( y + \eta ) @)@. This is used for smoothing difference of model_variables with respect to age and time.

mu
In the linear case, @(@ \mu @)@ denotes the expected value for @(@ y @)@ or the difference between @(@ y @)@ and @(@ z @)@. In the log case, it denotes the expected value for @(@ \log( y + \eta ) @)@ or the difference between @(@ \log( y + \eta ) @)@ and @(@ \log( z + \eta ) @)@.

delta
If the density is linear , this is the standard deviation for @(@ y @)@ or @(@ z - y @)@, If the density is log scaled , this is the standard deviation for @(@ \log( y + \eta ) @)@ or @(@ \log( z + \eta ) - \log ( y + \eta ) @)@. Note that @(@ \delta @)@ has a different definition for different cases:
  1. For data cases, @(@ \delta @)@ is the adjusted standard deviation @(@ \delta_i( \theta ) @)@.
  2. For priors cases, @(@ \delta @)@ is the transformed standard deviation; e.g., sigma_j , sigma_j , sigma_ij , sigma_ij .


eta
We use @(@ \eta @)@ to denote the offset in log transform for the corresponding entry in the data or prior table.

nu
We use @(@ \nu @)@ to denote the degrees of freedom in Student's-t for the corresponding entry in the data or prior table.

d
We use @(@ d @)@ to denote the density_id for the corresponding entry in the data or prior table. In an abuse of notation, we write @(@ \eta[d] @)@, @(@ \nu[d] @)@ for the offset and degrees corresponding to the same entry in the data or prior table.

Weighted Residual Function, R

Value
If the density is uniform , the weighted residual function for values is @[@ R(y, \mu, \delta, d) = 0 @]@ If the density is linear , the weighted residual function for values is @[@ R(y, \mu, \delta, d) = \frac{y - \mu}{\delta} @]@ If the density is log scaled , the weighted residual function for values is @[@ R(y, \mu, \delta, d) = \frac{ \log( y + \eta[d] ) - \log( \mu + \eta[d] ) }{ \delta } @]@ Note that, for both the linear and log case, @(@ \mu @)@ has the same units as @(@ y @)@.

Difference
If the density is uniform, the weighted residual function for differences is @[@ R(z, y, \mu, \delta, d) = 0 @]@ If the density is linear , the weighted residual function for differences is @[@ R(z, y, \mu, \delta, d) = \frac{z - y - \mu}{\delta} @]@ Note that, in the linear case, all the arguments (except @(@ d @)@) have the same units. If the density is log scaled , the weighted residual function for differences is @[@ R(z, y, \mu, \delta, d) = \frac{ \log(z + \eta[d] ) - \log( y + \eta[d] ) - \mu }{ \delta } @]@ Note that in the log case, @(@ z, y @)@ and @(@ \eta @)@ have the same units while @(@ \mu @)@ and @(@ \delta @)@ are in log space.

Log-Density Function, D
In the discussion below, log scaling refers to scaling the argument to the density function and log-density refers to taking the log of the result of the density function.

Uniform
If the density is uniform, the log-density function for values @(@ D(y, \mu, \delta, d) @)@, and for differences @(@ D(z, y, \mu, \delta, d) @)@, are both defined by @(@ D = 0 @)@.

Gaussian
If the density name is gaussian, the log-density functions for values @(@ D(y, \mu, \delta, d) @)@, and for differences @(@ D(z, y, \mu, \delta, d) @)@, are defined by @[@ D = - \log \left( \delta \sqrt{2 \pi} \right) - \frac{1}{2} R^2 @]@ where @(@ D @)@ and @(@ R @)@ have the same arguments; see Weighted Residual Function, R .

Censored Gaussian
If the density name is cen_gaussian, the log-density function is not defined for differences. The log-density function for values @(@ y > 0 @)@ is the same as for the gaussian case. The log-density function for the values @(@ y \leq 0 @)@, is defined by @[@ D(y, \mu, \delta, d) = \log ( \R{erfc}[ \mu / ( \delta \sqrt{2} ) ] ) - \log(2) @]@ where @(@ \R{erfc} @)@ is the complementary error function; see the Gaussian case for the censored density where the censoring value is @(@ c = 0 @)@.

Log-Gaussian
If the density name is log_gaussian, the log-density function for values is @[@ D(y, \mu, \delta, d) = - \log \left[ \delta \sqrt{2 \pi} \right] - \frac{1}{2} R(y, \mu, \delta, d)^2 @]@ The log-density function for differences is @[@ D(z, y, \mu, \delta, d) = - \log \left( \delta \sqrt{2 \pi} \right) - \frac{1}{2} R(z, y, \mu, \delta, d)^2 @]@

Censored Log-Gaussian
If the density name is cen_log_gaussian, the log-density function is not defined for differences. The log-density function for values @(@ y > 0 @)@ is the same as for the log_gaussian case. The log-density function for the values @(@ y \leq 0 @)@, is defined by @[@ D(y, \mu, \delta, d) = \log ( \R{erfc}[ ( \mu - \eta ) / ( \delta \sqrt{2} ) ] ) - \log(2) @]@ where we the arguments to @(@ \delta @)@ are the same as in the log Gaussian case and @(@ \R{erfc} @)@ is the complementary error function; see the Gaussian case for the censored density where the censoring value is @(@ c = \eta @)@.

Laplace
If the density name is laplace, the log-density functions for values @(@ D(y, \mu, \delta, d) @)@, and for differences @(@ D(z, y, \mu, \delta, d) @)@, are defined by @[@ D = - \log \left( \delta \sqrt{2} \right) - \sqrt{2} | R | @]@ where @(@ D @)@ and @(@ R @)@ have the same arguments.

Censored Laplace
If the density name is cen_laplace, the log-density function is not defined for differences. The log-density function for values @(@ y > 0 @)@ is the same as for the laplace case. The log-density function for the values @(@ y \leq 0 @)@, is defined by @[@ D(y, \mu, \delta, d) = - \mu \sqrt{2} / \delta - \log(2) @]@ where @(@ \R{erfc} @)@ is the complementary error function; see the Gaussian case for the censored density where the censoring value is @(@ c = 0 @)@.

Log-Laplace
If the density name is log_laplace, the log-density function for values is @[@ D(y, \mu, \delta, d) = - \log \left[ \delta \sqrt{2} \right] - \sqrt{2} \left| R(y, \mu, \delta, d) \right| @]@ The log-density function for differences is @[@ D(z, y, \mu, \delta, d) = - \log \left( \delta \sqrt{2} \right) - \sqrt{2} \left| R(z, y, \mu, \delta, d) \right| @]@

Censored Log-Laplace
If the density name is cen_log_laplace, the log-density function is not defined for differences. The log-density function for values @(@ y > 0 @)@ is the same as for the log_laplace case. The log-density function for the values @(@ y \leq 0 @)@, is defined by @[@ D(y, \mu, \delta, d) = - ( \mu - \eta ) \sqrt{2} / \delta - \log(2) @]@ where we the arguments to @(@ \delta @)@ are the same as in the log Laplace case. See the Laplace case for the censored density where the censoring value is @(@ c = \eta @)@.

Student's-t
If the density name is students, the log-density functions for values @(@ D(y, \mu, \delta, d) @)@, and for differences @(@ D(z, y, \mu, \delta, d) @)@, are defined by @[@ D = \log \left( \frac{ \Gamma( ( \nu + 1 ) / 2 ) }{ \sqrt{ \nu \pi } \Gamma( \nu / 2 ) } \right) - \frac{\nu + 1}{2} \log \left( 1 + R^2 / ( \nu - 2 ) \right) @]@ where @(@ D @)@ and @(@ R @)@ have the same arguments and we have abbreviated @(@ \nu[d] @)@ using just @(@ \nu @)@.

Log-Student's-t
If the density name is log_students, the log-density functions for values @(@ D(y, \mu, \delta, d) @)@, and for differences @(@ D(z, y, \mu, \delta, d) @)@, are defined by @[@ D = \log \left( \frac{ \Gamma( ( \nu + 1 ) / 2 ) }{ \sqrt{ \nu \pi } \Gamma( \nu / 2 ) } \right) - \frac{\nu + 1}{2} \log \left( 1 + R^2 / ( \nu - 2 ) \right) @]@ where @(@ D @)@ and @(@ R @)@ have the same arguments.
Input File: omh/model/statistic.omh