\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\W}[1]{ \; #1 \; }\)
statistic#
View page sourceSome Statistical Function Definitions#
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:
For data cases, other than binomial, \(\delta\) is define by the transformed standard deviation delta \(\delta_i( \theta )\).
For value prior cases, \(\delta\) is defined by the transformed standard deviation delta_j , delta_j ,
For difference prior cases, \(\delta\) is the same as the prior table standard deviation 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
If the density is Linear , the weighted residual function for values is
If the density is Log Scaled , the weighted residual function for values is
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
If the density is Linear , the weighted residual function for differences is
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
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\).
Binomial#
The binomial density can only used for the likelihood of data values (not for variable priors). The corresponding log-density function \(D(y, \mu, \delta, d)\) is defined by
Here \(n\) is the sample size for this data value \(y\) , \(k = n y\) is the success count, and \(\mu\) is the average integrand corresponding to \(y\) .
The standard deviation for \(k\) is \(\sqrt{n \mu (1 - \mu)}\) . Dividing by \(n\) and dropping the \((1 - \mu)\) term, the weight residuals for this distribution are computed using \(\delta = \sqrt{\mu / n}\) .
If the average integrand for binomial data is zero, you will get a message saying that the corresponding standard deviation is not greater than zero.
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
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
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
The log-density function for differences is
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
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
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
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
The log-density function for differences is
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
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
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
where \(D\) and \(R\) have the same arguments.