# Variance of negative binomial given an offset

Given observations $$Y_1, \ldots, Y_n$$ from the negative binomial distribution, $$NB(\mu, \theta)$$, and assume that we model the mean with a GAM:

$$\log E(Y_i) = \log \mu_i = \log t_i + f(x_i),$$

where $$\log t_i$$ is the offset (lets say the exposure given in years). In mgcv the negative binomial distribution is parameterized such that $$Var(Y_i) = \mu_i + \mu_i^2/\theta$$.

Given an observation $$Y_i$$ with exposure of two years i.e. $$t_i = 2$$. How should we calculate the variance of this variable? Should $$\theta$$ also be scaled with the offset $$t_i$$? If we don't scale it with the offset we get

$$Var(Y_i | t_i = 2) = 2 \exp(f(x_i)) + \frac{4 \exp(2f(x_i))}{\theta} = 2\bigg (\exp(f(x_i)) + \frac{2 \exp(2f(x_i))}{\theta}\bigg )> 2 Var(Y_i | t_i = 1),$$

meaning that the variance does not scale linearly. If we want the variance to scale linearly, as is the case for the Poisson model, we have to multiply $$\theta$$ by $$t_i$$ and we get:

$$Var(Y_i | t_i = 2) = 2 Var(Y_i | t_i = 1)$$

mgcv does not scale $$\theta$$ with $$t_i$$, but doesn't it make sense that the variance should scale linearly in the offset?