1\name{inv.gaussianff} 2\alias{inv.gaussianff} 3%- Also NEED an '\alias' for EACH other topic documented here. 4\title{ Inverse Gaussian Distribution Family Function } 5\description{ 6 Estimates the two parameters of the inverse Gaussian distribution 7 by maximum likelihood estimation. 8 9 10} 11\usage{ 12inv.gaussianff(lmu = "loglink", llambda = "loglink", 13 imethod = 1, ilambda = NULL, 14 parallel = FALSE, ishrinkage = 0.99, zero = NULL) 15} 16%- maybe also 'usage' for other objects documented here. 17%apply.parint = FALSE, 18\arguments{ 19 \item{lmu, llambda}{ 20 Parameter link functions for the \eqn{\mu}{mu} and 21 \eqn{\lambda}{lambda} parameters. 22 See \code{\link{Links}} for more choices. 23 24 25 } 26 \item{ilambda, parallel}{ 27 See \code{\link{CommonVGAMffArguments}} for more information. 28 If \code{parallel = TRUE} then the constraint is not applied to the 29 intercept. 30 31 32 } 33 \item{imethod, ishrinkage, zero}{ 34 See \code{\link{CommonVGAMffArguments}} for information. 35 36 37 } 38} 39\details{ 40 The standard (``canonical'') form of the 41 inverse Gaussian distribution has a density 42 that can be written as 43 \deqn{f(y;\mu,\lambda) = \sqrt{\lambda/(2\pi y^3)} 44 \exp\left(-\lambda (y-\mu)^2/(2 y \mu^2)\right)}{% 45 f(y;mu,lambda) = sqrt(lambda/(2*pi*y^3)) * 46 exp(-lambda*(y-mu)^2/(2*y*mu^2)) 47 } 48 where \eqn{y>0}, 49 \eqn{\mu>0}{mu>0}, and 50 \eqn{\lambda>0}{lambda>0}. 51 The mean of \eqn{Y} is \eqn{\mu}{mu} and its variance is 52 \eqn{\mu^3/\lambda}{mu^3/lambda}. 53 By default, \eqn{\eta_1=\log(\mu)}{eta1=log(mu)} and 54 \eqn{\eta_2=\log(\lambda)}{eta2=log(lambda)}. 55 The mean is returned as the fitted values. 56 This \pkg{VGAM} family function can handle multiple 57 responses (inputted as a matrix). 58 59 60 61} 62\value{ 63 An object of class \code{"vglmff"} (see \code{\link{vglmff-class}}). 64 The object is used by modelling functions such as \code{\link{vglm}}, 65 \code{\link{rrvglm}} 66 and \code{\link{vgam}}. 67 68 69} 70\references{ 71 72Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1994). 73\emph{Continuous Univariate Distributions}, 742nd edition, Volume 1, New York: Wiley. 75 76 77Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). 78\emph{Statistical Distributions}, 79Hoboken, NJ, USA: John Wiley and Sons, Fourth edition. 80 81 82} 83\author{ T. W. Yee } 84\note{ 85 The inverse Gaussian distribution can be fitted (to a certain extent) 86 using the usual GLM framework involving a scale parameter. This family 87 function is different from that approach in that it estimates both 88 parameters by full maximum likelihood estimation. 89 90 91} 92 93\seealso{ 94 \code{\link{Inv.gaussian}}, 95 \code{\link{waldff}}, 96 \code{\link{bisa}}. 97 98 99 The \R{} package \pkg{SuppDists} has several functions for evaluating 100 the density, distribution function, quantile function and generating 101 random numbers from the inverse Gaussian distribution. 102 103 104} 105\examples{ 106idata <- data.frame(x2 = runif(nn <- 1000)) 107idata <- transform(idata, mymu = exp(2 + 1 * x2), 108 Lambda = exp(2 + 1 * x2)) 109idata <- transform(idata, y = rinv.gaussian(nn, mu = mymu, lambda = Lambda)) 110fit1 <- vglm(y ~ x2, inv.gaussianff, data = idata, trace = TRUE) 111rrig <- rrvglm(y ~ x2, inv.gaussianff, data = idata, trace = TRUE) 112coef(fit1, matrix = TRUE) 113coef(rrig, matrix = TRUE) 114Coef(rrig) 115summary(fit1) 116} 117\keyword{models} 118\keyword{regression} 119 120