This has been answered on the R help list by Adelchi Azzalini: the important point is that the dispersion parameter (which is what distinguishes an exponential distribution from the more general Gamma distribution) does not affect the parameter estimates in a generalized linear model, only the standard errors of the parameters/confidence intervals/p-values etc.; in R an estimate of the dispersion parameter is automatically reported, but as Azzalini comments, summary.glm
allows the user to specify the dispersion parameter. So, as stated by Azzalini,
The Gamma family is parametrised in glm() by two parameters:
mean and dispersion; the "dispersion" regulates the shape.
So [one] must fit a GLM with the Gamma family, and then produce a "summary"
with dispersion parameter set equal to 1, since this value
corresponds to the exponential distribution in the Gamma family.
In practice:
fit <- glm(formula =..., family = Gamma(link="log"))
summary(fit,dispersion=1)
[Azzalini had family=Gamma
, i.e. using the default inverse link; I changed it to specify the log link as in your question.]
bbmle::mle2
will do this. You could try to derive and solve the score equations but I don't know how far you'd get ... $\endgroup$bbmle::mle2(y~dexp(exp(lograte)), parameters=list(lograte~x), start=list(logmu=0), data=...)
should do it, I think ... $\endgroup$