View source: R/mt_variance_function.R
mt_variance_function | R Documentation |
Compute the variance function and its derivatives with respect to regression, dispersion and power parameters.
mt_variance_function(mu, power, Ntrial, variance,
derivative_power, derivative_mu)
mt_tweedie(mu, power, Ntrial, derivative_power, derivative_mu)
mt_binomialP(mu, power, Ntrial,
derivative_power, derivative_mu)
mt_binomialPQ(mu, power, Ntrial,
derivative_power, derivative_mu)
mt_constant(mu, power, Ntrial, derivative_power, derivative_mu)
mu |
a numeric vector. In general the output from
|
power |
a numeric value ( |
Ntrial |
number of trials, useful only when dealing with binomial response variables. |
variance |
a string specifying the name ( |
derivative_power |
logical if compute (TRUE) or not (FALSE) the derivatives with respect to the power parameter. |
derivative_mu |
logical if compute (TRUE) or not (FALSE) the derivative with respect to the mu parameter. |
The function mt_variance_function
computes three
features related with the variance function. Depending on the
logical arguments, the function returns V^{1/2}
and its
derivatives with respect to the parameters power and mu,
respectivelly. The output is a named list, completely
informative about what the function has been computed. For
example, if derivative_power = TRUE
and derivative_mu = TRUE
.
The output will be a list, with three elements: V_sqrt, D_V_sqrt_power and
D_V_sqrt_mu.
A list with from one to four elements depending on the arguments.
Wagner Hugo Bonat, wbonat@ufpr.br
Bonat, W. H. and Jorgensen, B. (2016) Multivariate covariance generalized linear models. Journal of Royal Statistical Society - Series C 65:649–675.
mt_link_function
.
x1 <- seq(-1, 1, l = 5)
X <- model.matrix(~x1)
mu <- mt_link_function(beta = c(1, 0.5), X = X, offset = NULL,
link = "logit")
mt_variance_function(mu = mu$mu, power = c(2, 1), Ntrial = 1,
variance = "binomialPQ",
derivative_power = TRUE, derivative_mu = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.