tweedie(var.power=0, link.power=1-var.power)
link.power=0
produces a log-link. Defaults to the canonical link, which is 1-var.power
.family
and glm
in the R base help for details.glm
function.
Let $\mu_i = E(y_i)$ be the expectation of the $i$th response. We assume that
$$\mu_i^q = x_i^Tb, var(y_i) = \phi \mu_i^p$$
where $x_i$ is a vector of covariates and b is a vector of regression cofficients, for some $\phi$, $p$ and $q$. This family is specified by var.power = p
and link.power = q
. A value of zero for $q$ is interpreted as $\log(\mu_i) = x_i^Tb$.
The variance power $p$ characterizes the distribution of the responses $y$. The following are some special cases:
glm
, family
, dtweedie
y <- rgamma(20,shape=5)
x <- 1:20
# Fit a poisson generalized linear model with identity link
glm(y~x,family=tweedie(var.power=1,link.power=1))
# Fit an inverse-Gaussion glm with log-link
glm(y~x,family=tweedie(var.power=3,link.power=0))
Run the code above in your browser using DataLab