~ubuntu-branches/ubuntu/trusty/r-cran-vgam/trusty

« back to all changes in this revision

Viewing changes to man/explink.Rd

  • Committer: Package Import Robot
  • Author(s): Chris Lawrence
  • Date: 2011-11-04 13:13:06 UTC
  • mfrom: (1.2.9)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20111104131306-w9fd83i51rw60gxf
Tags: upstream-0.8-4
ImportĀ upstreamĀ versionĀ 0.8-4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\name{explink}
 
2
\alias{explink}
 
3
%- Also NEED an '\alias' for EACH other topic documented here.
 
4
\title{ Exponential Link Function }
 
5
\description{
 
6
  Computes the exponential transformation, including its inverse and the
 
7
  first two derivatives.
 
8
 
 
9
}
 
10
\usage{
 
11
explink(theta, earg = list(), inverse = FALSE, deriv = 0, short = TRUE, tag = FALSE)
 
12
}
 
13
%- maybe also 'usage' for other objects documented here.
 
14
\arguments{
 
15
  \item{theta}{
 
16
  Numeric or character.
 
17
  See below for further details.
 
18
 
 
19
  }
 
20
  \item{earg}{
 
21
  Optional list.
 
22
  See \code{\link{Links}} for general information about \code{earg}.
 
23
 
 
24
  }
 
25
  \item{inverse}{
 
26
  Logical. If \code{TRUE} the inverse function is computed.
 
27
  The inverse function is the \code{\link{loge}} function.
 
28
 
 
29
  }
 
30
  \item{deriv}{
 
31
  Order of the derivative. Integer with value 0, 1 or 2.
 
32
 
 
33
  }
 
34
  \item{short}{
 
35
  Used for labelling the \code{blurb} slot of a
 
36
  \code{\link{vglmff-class}} object.
 
37
 
 
38
  }
 
39
  \item{tag}{
 
40
  Used for labelling the linear/additive predictor in the
 
41
  \code{initialize} slot of a \code{\link{vglmff-class}} object.
 
42
  Contains a little more information if \code{TRUE}.
 
43
 
 
44
  }
 
45
}
 
46
\details{
 
47
 
 
48
  The exponential link function is potentially suitable for parameters that
 
49
  are positive.
 
50
  Numerical values of \code{theta} close to negative or positive infinity
 
51
  may result in
 
52
  \code{0}, \code{Inf}, \code{-Inf}, \code{NA} or \code{NaN}.
 
53
 
 
54
 
 
55
  The arguments \code{short} and \code{tag} are used only if
 
56
  \code{theta} is character.
 
57
 
 
58
 
 
59
 
 
60
 
 
61
}
 
62
\value{
 
63
  For \code{explink} with \code{deriv = 0}, the exponential of \code{theta}, i.e.,
 
64
  \code{exp(theta)} when \code{inverse = FALSE}.
 
65
  And if \code{inverse = TRUE} then
 
66
  \code{log(theta)};
 
67
  if \code{theta} is not positive then it will return \code{NaN}.
 
68
 
 
69
 
 
70
  For \code{deriv = 1}, then the function returns
 
71
  \emph{d} \code{theta} / \emph{d} \code{eta} as a function of \code{theta}
 
72
  if \code{inverse = FALSE},
 
73
  else if \code{inverse = TRUE} then it returns the reciprocal.
 
74
 
 
75
 
 
76
  Here, all logarithms are natural logarithms, i.e., to base \emph{e}.
 
77
 
 
78
 
 
79
}
 
80
%\references{
 
81
%  McCullagh, P. and Nelder, J. A. (1989)
 
82
%  \emph{Generalized Linear Models}, 2nd ed. London: Chapman & Hall.
 
83
%
 
84
%}
 
85
\author{ Thomas W. Yee }
 
86
 
 
87
\note{
 
88
  This function has particular use for computing quasi-variances when
 
89
  used with \code{\link{rcam}} and \code{\link{normal1}}.
 
90
 
 
91
 
 
92
  Numerical instability may occur when \code{theta} is
 
93
  close to negative or positive infinity.
 
94
  One way of overcoming this (one day) is to use \code{earg}.
 
95
 
 
96
 
 
97
}
 
98
 
 
99
\seealso{ 
 
100
    \code{\link{Links}},
 
101
    \code{\link{loge}},
 
102
    \code{\link{rcam}},
 
103
    \code{\link{Qvar}},
 
104
    \code{\link{normal1}}.
 
105
 
 
106
}
 
107
\examples{
 
108
theta = rnorm(30)
 
109
explink(theta)
 
110
max(abs(explink(explink(theta), inverse = TRUE) - theta)) # Should be 0
 
111
}
 
112
\keyword{math}
 
113
\keyword{models}
 
114
\keyword{regression}
 
115