get_family | R Documentation |
Return causl_fam function from integer index
get_family(val)
gaussian_causl_fam(link)
t_causl_fam(link)
Gamma_causl_fam(link)
binomial_causl_fam(link)
beta_causl_fam(link)
categorical_causl_fam(link)
ordinal_causl_fam(link)
val |
integer corresponding to distributional family |
link |
link function |
The functions gaussian_causl_fam()
etc. represent the functions that are
returned by get_family()
.
A few function of this form can be defined by the user, and it should return the following:
name
: the name of the relevant family;
ddist
: a function returning the density of the distributions;
qdist
: a function returning the quantiles from probabilities;
rdist
: a function to sample values from the distribution;
pdist
: a cumulative distribution function;
pars
: a list of the names of the parameters used;
default
: a function that returns a list of the default values for an
observation and each of the parameters;
link
: the specified link function.
The function should also give the output the class "causl_family"
, so that
it is interpreted appropriately. Note that ddist
should have a log
argument, to allow the log-likelihood to be evaluated.
The only parameterization of the categorical family currently implemented
is the multivariate logistic parameterization. For a random variable X
with K
states, dependence on a vector \boldsymbol{Z}
uses:
\log \dfrac{P(X=k)}{P(X=1)} = \beta_{k}^T \boldsymbol{Z},
and the \beta_k
vectors are stored as (\beta_2,\dots,\beta_K)
.
The ordinal family is parameterized using a variation of the ordinal
logistic regression model. This takes the logits of entries in the cumulative
distribution function and treats the covariates variables linearly on that
scale. Suppose \boldsymbol{Z}
is the vector of covariates and there are
K
levels, then
\log \dfrac{P(X \leq k)}{P(X > k)} = \beta_k^T \boldsymbol{Z}.
As in the categorical case, the vectors \beta_k
are stored as
(\beta_1,\ldots,\beta_{K-1})
.
gaussian_causl_fam()
: Gaussian distribution family
t_causl_fam()
: Student's t distribution family
Gamma_causl_fam()
: Gamma distribution family
binomial_causl_fam()
: binomial distribution family
beta_causl_fam()
: beta distribution family
categorical_causl_fam()
: multinomial/categorical distribution family
ordinal_causl_fam()
: ordinal categorical distribution family
family_vals
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.