3
$\begingroup$

The glm function in R can estimate models from a number of families, including the quasi family. The quasi family takes a variance parameter.

What is the variance function for?

$\endgroup$
3
  • 1
    $\begingroup$ I am convinced this is a question requiring some statistical expertise; I have reopened; please note that programming questions are usually off topic. You will be better off making your questions more general. $\endgroup$
    – Glen_b
    Nov 15, 2017 at 3:57
  • 1
    $\begingroup$ I'm really more interested in the variance parameter to the quasi family, which can be "constant", "mu(1-mu)", "mu", "mu^2" and "mu^3" . . . what are those for/what do they do? $\endgroup$
    – GuyMatz
    Nov 16, 2017 at 14:47
  • 2
    $\begingroup$ So your question is more "what's the role of the Variance function in a glm?" It's to specify how the variance is related to the mean. I've modified my answer a little. $\endgroup$
    – Glen_b
    Nov 16, 2017 at 22:39

1 Answer 1

3
$\begingroup$

In a generalized linear model (GLM), the distributional family entails a specific variance function $V(\mu)$, and in some cases also the dispersion parameter, $\phi$ (e.g. for the Poisson and binomial, which have $\phi=1$).

The link and variance functions are really what drives the fitting of a GLM.

In particular, the variance function $V(\mu)$ specifies how the conditional variance is related to the conditional mean, $\mu$. Let $\mu(x)=E(Y|x)$; then $\text{Var}(Y|x)=\phi V(\mu)$ for some function $V$. If you specify a distribution family that determines $V$ and sometimes $\phi$. If you specify the quasi family you choose $V$ yourself.

In that case, rather than specify a specific distributional family, you could specify a quasi model, which allows you to specify a link and a variance function of your preference (for example, you might perhaps do this if your preferred combination is not available in one of the families). It also has $\phi$ free rather than setting it to any specific value. You can pair link and variance functions that wouldn't normally go together.

You can even write your own variance function, should none of the built-in options suit you.

What you get is a model within the exponential family that has the specified variance function and link function. This offers a great deal of flexibility (though with such flexibility it's possible to pair things that may sometimes be difficult to achieve convergence with, or may make little sense).

$\endgroup$
4
  • $\begingroup$ +1 but here you gloss over the fact that there might not be such a distribution at all (which is probably why it's called "quasi"?). I remember another answer of yours about quasi-binomial model where you explain how a distribution corresponding to the scaled binomial variance function isn't actually defined on integers and so "does not exist" as a count distribution. $\endgroup$
    – amoeba
    Nov 16, 2017 at 22:51
  • 1
    $\begingroup$ @amoeba Indeed that's possible in some cases, but not necessarily of great consequence -- if we're already in the realm of quasi models we're probably more focused on getting the mean and variance descriptions approximately right than identifying some specific distributional form. Certainly with count data it's sometimes easy to specify a distribution that can't actually be an exponential-family count distribution. Sometimes that will be an issue and sometimes less so. (If you want to use it to simulate counts from the fitted distribution, it would definitely be a problem; for example) $\endgroup$
    – Glen_b
    Nov 16, 2017 at 23:36
  • $\begingroup$ Right. But if we are dealing with continuous (instead of count) models, then every variance function $\phi V(\mu)$ will correspond to a particular exponential dispersion family, correct? So this "glm without a distribution" phenomenon occurs only with count data? What confuses me is that Wikipedia says that "quasi-likelihood function is not the log-likelihood corresponding to any actual probability distribution" (en.wikipedia.org/wiki/Quasi-likelihood); would this mean that the term "quasi" should be reserved only for these count situations without a corresponding distribution? $\endgroup$
    – amoeba
    Nov 17, 2017 at 8:09
  • 1
    $\begingroup$ @amoeba I think "[For] continuous models .. every variance function ϕV(μ) will correspond to a particular exponential dispersion family, correct?" would be a great question to ask (right now, I don't know -- I have some notion it that I think would hold up, but it's not a question I've really considered in depth for the continuous case). The final question is really one of terminology, which often doesn't go as I expect, but I wouldn't go so far; I'd rather not put too much weight on what Wikipedia says in general. I'd have rather said that the quasi likelihood doesn't have to correspond. $\endgroup$
    – Glen_b
    Nov 17, 2017 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.