Digamma(link = "log")
unitdeviance.digamma(y, mu)
cumulant.digamma(theta)
meanval.digamma(theta)
d2cumulant.digamma(theta)
varfun.digamma(mu)
canonic.digamma(mu)
quasi
for specification of this argument.Digamma
produces a glm family object, which is a list of functions and expressions used by glm
in its iteratively reweighted least-squares algorithm. See family
for details.The other functions take vector arguments and produce vector values of the same length and called by Digamma
.
unitdeviance.digamma
gives the unit deviances of the family, equal to the squared deviance residuals.
cumulant.digamma
is the cumulant function. If the dispersion is unity, then successive derivatives of the cumulant function give successive cumulants of the Digamma distribution. meanvalue.digamma
gives the first derivative, which is the expected value.
d2cumulant.digamma
gives the second derivative, which is the variance.
canonic.digamma
is the inverse of meanvalue.digamma
and gives the canonical parameter as a function of the mean parameter.
varfun.digamma
is the variance function of the Digamma family, the variance as a function of the mean.
digamma function
appears in its mean function.Suppose that $y$ follows a gamma distribution with mean $\mu$ and dispersion parameter $\phi$, so the variance of $y$ is $\phi \mu^2$.
Write $d(y,\mu)$ for the gamma distribution unit deviance.
Then meanval.digamma(-1/phi)
gives the mean of $d(y,\mu)$ and 2*d2cumulant.digamma(-1/phi)
gives the variance.
quasi
, make.link
# Test for log-linear dispersion trend in gamma regression
y <- rchisq(20,df=1)
x <- 1:20
out.gam <- glm(y~x,family=Gamma(link="log"))
d <- residuals(out.gam)^2
out.dig <- glm(d~x,family=Digamma(link="log"))
summary(out.dig,dispersion=2)
Run the code above in your browser using DataLab