@(@\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
.
Purpose
This example uses a laplace
prior distribution on two covariate multipliers
to detect which covariate is present in the data.
It then refits the data with a uniform on the multiplier that is present
and the other multiplier constrained to be zero.
Problem Parameters
The following values are used to simulate the data and set the priors
for fitting the data:
alpha_income = 1.0 # income covariate multiplier during simulation
iota_reference = 0.05 # iota corresponding to reference for covariates
n_data = 301 # number of simulated data points
laplace_std = 0.1/17.34 # 0.1 / sqrt(n_data)
random_seed = 0 # if zero, seed off the clock
Age and Time Values
The age and time values do not matter for this problem
because all the functions are constant in age and time.
This can be seen by the fact that all of the smoothings have one age
and one time point.
Variables
The are three model variables in this example:
iota_reference
iota
corresponding to reference value of covariates
Covariate Table
There are two covariates
,
income and sex, in this example.
Income is a linear function of data_id
.
It starts with 0.0 and ends with 1.0.
To be specific,
income = data_id / (n_data - 1)
Sex cycles between the values -0.5, 0.0, +0.5
as a function of
data_id
.
Note that income and sex have range 1.0.
This makes the scaling of the covariate multipliers simpler.
The reference value for each covariate has been set to the midpoint
of its range.
We use
x_income
(
x_sex
) to denote the difference
of income (sex) minus its reference value.
Mulcov Table
The covariate multiplier table
has two rows,
one for each covariate multiplier.
Both multipliers affects the value of
iota
,
but one multiplies income and the other sex.
We use
alpha_income
(
alpha_sex
) to denote the
covariate multiplier corresponding to income (sex).
The model for the value of
iota
is
iota_reference * exp( alpha_income*x_income + alpha_sex*x_sex )
Rate Table
The rate_table
only specifies that
iota
for the parent
is the only nonzero rate for this example.
In addition, it specifies the smoothing for that rate which has only
one grid point. Hence there is only one model variable corresponding to
the rates.
Data Table
For this example, all the data is
Sincidence
,
with a Gaussian density, with mean value
iota_reference * exp( alpha_income * x_income )
and with standard deviation equal 10% of the mean.
iota
The prior for fitting the reference value of
iota
is uniform with lower limit 0.001, and upper limit 1.
Its mean value 0.1 is only used as a starting and scaling point for the
fitting process; see start_var_table
and scale_var_table
.
alpha
There is a separate prior for
alpha_income
and
alpha_sex
.
For the first fit, they are both a Laplace density with
mean zero and standard deviation
laplace_std
.
The first fit is used to decide that
alpha_income
is nonzero
and
alpha_sex
is zero.
The prior for
alpha_income
is changed to a uniform
and the prior for
alpha_sex
is change to have upper and lower
limit zero.
A second fit is done to recover the value of
alpha_income
without shrinkage due to the Laplace prior.