# Gamma distribution as a member of exponential family

In my lecture notes I have that the distribution of a random variable $$Y$$ is said to be in the exponential family if it can be written as $$f(y;\theta)=exp(a(y)b(\theta)+c(\theta)+d(y))$$, where $$a,b,c$$ and $$d$$ are fixed functions. If we have (in the exponential family form) that $$a(y)=y$$, then the distribution is said to be in canonical form and then $$b(\theta)$$ is the called the natural parameter and $$b$$ is called the natural link function. Then we have shown that for a random variable $$Y$$ in exponential family form we have $$\mathbb{E}(a(Y))=\frac{-c'(\theta)}{b'(\theta)}$$ and $$var(a(Y))=\frac{b''(\theta)c'(\theta)-c''(\theta)b'(\theta)}{[b'(\theta)]^{3}}$$.

I am now working on the following problem: the gamma pdf of r.v. $$Y$$ is given by

$$$$f(y) = (s^{a}\Gamma (a))^{-1}y^{a-1}e^{y/s}$$$$,

where $$y \geq 0$$, $$s$$ is the scale parameter, $$a$$ the shape parameter. The first question asks me to reparameterise this pdf by setting $$a=1/\phi$$ and $$s=\mu\phi$$, and hence show that it is a member of the exponential family. So after introducing $$a=1/\phi$$ and $$s=\mu\phi$$ into the pdf and rearranging I get

$$f(y) = exp((\frac{1}{\phi}-1)log(y)-\frac{y}{\mu\phi}-\frac{1}{\phi}log(\mu\phi)-log(\Gamma(1/\phi))=exp(a(y)b(\theta)+c(\theta)+d(y))$$,

where $$a(y)=y$$,$$b(\mu)=-\frac{1}{\mu\phi}$$,$$c(\mu)=-\frac{1}{\phi}log(\mu\phi)$$ and $$d(y)=(\frac{1}{\phi}-1)log(y) - log(\Gamma(\frac{1}{\phi}))$$, where we treat the (dispersion) parameter $$\phi$$ as a nuisance parameter. Is that correct?

The next question says: deduce that the canonical link for the gamma is $$\theta=\frac{1}{\mu}=\eta=\textbf{X}\beta$$. So I'm thinking since $$f$$ is in a canonical form, the canonical parameter is $$b(\mu)=-\frac{1}{\mu\phi}$$ and so ignoring all the constants of proportionality we have that the canonical link, in its simplest form, is $$\frac{1}{\mu}$$, as required. Does that make sense? I still don't have a good enough understanding of link/canonical link functions, I'm afraid.

Then the next question asks me to deduce further that the variance function is $$b''(\theta)=-1/\theta^{2}=-\mu^{2}$$. I don't really know how to do this. Why is this the variance function? What is $$\theta$$ here? A canonical link? That clearly doesn't make sense. Or is just the dummy variable for our parameter of interest ( $$\mu$$ in our case )? I've tried to differentiate $$b(\mu)$$ w.r.t. to $$\mu$$ but it doesn't work. I'd really appreciate some help.