View source: R/SpecModel-generators.R
TFixed | R Documentation |
Specify a model of the form
y_i = t(location[i], scale[i], df)
or
y_i = t(exposure[i] * location[i], scale[i], df)
.
TFixed(location, scale, df = 7, useExpose = TRUE)
location |
An object of class |
scale |
Parameter governing dispersion. Can be an object
of class |
df |
A positive number. Defaults to 7. |
useExpose |
Whether the model includes an
exposure term. Defaults to |
The model is useful as a data model where a few cells
have much larger errors than the rest. Smaller values for df
lead to thicker tails (ie larger probabilities of extreme values.)
Subscript i
denotes a cell within a classification
defined by variables such as age, sex, and time.
For instance cell i
might be 30-34 year old females
in 2020.
An object of class SpecLikelihoodTFixed
.
TFixed
is typically used as
part of a call to function Model
.
Similar data models that do not allow for the possibility of occasional
large errors can be specified using Normal
(though
setting df
to a value greater than 30 in TFixed
will
have much the same effect.)
Flexible normal models can be specified using
Normal
.
location <- Values(array(c(0.95, 0.96, 0.95, 0.94),
dim = c(2, 2),
dimnames = list(age = c("0-39", "40+"),
sex = c("Female", "Male"))))
scale <- Values(array(c(0.05, 0.08, 0.05, 0.04),
dim = c(2, 2),
dimnames = list(age = c("0-39", "40+"),
sex = c("Female", "Male"))))
TFixed(location = location, scale = scale)
TFixed(location = location, scale = 0.1, df = 1)
TFixed(location = location, scale = 0.1, useExpose = FALSE)
## indistinguishable from normal distribution:
TFixed(location = location, scale = scale, df = 30)
## Cauchy distribution (very heavy tails):
TFixed(location = location, scale = scale, df = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.