hypersecant.RdEstimation of the parameter of the hyperbolic secant distribution.
hypersecant(link.theta = "extlogitlink(min = -pi/2, max = pi/2)",
init.theta = NULL)
hypersecant01(link.theta = "extlogitlink(min = -pi/2, max = pi/2)",
init.theta = NULL)Parameter link function applied to the
parameter \(\theta\).
See Links for more choices.
Optional initial value for \(\theta\). If failure to converge occurs, try some other value. The default means an initial value is determined internally.
The probability density function of the hyperbolic secant distribution is given by $$f(y;\theta) = \exp(\theta y + \log(\cos(\theta ))) / (2 \cosh(\pi y/2)),$$ for parameter \(-\pi/2 < \theta < \pi/2\) and all real \(y\). The mean of \(Y\) is \(\tan(\theta)\) (returned as the fitted values). Morris (1982) calls this model NEF-HS (Natural Exponential Family-Hyperbolic Secant). It is used to generate NEFs, giving rise to the class of NEF-GHS (G for Generalized).
Another parameterization is used for hypersecant01():
let \(Y = (logit U) / \pi\).
Then this uses
$$f(u;\theta)=(\cos(\theta)/\pi) \times
u^{-0.5+\theta/\pi} \times
(1-u)^{-0.5-\theta/\pi},$$
for
parameter \(-\pi/2 < \theta < \pi/2\)
and \(0 < u < 1\).
Then the mean of \(U\)
is \(0.5 + \theta/\pi\)
(returned as the fitted values) and the variance is
\((\pi^2 - 4 \theta^2) / (8\pi^2)\).
For both parameterizations Newton-Raphson is same as Fisher scoring.
An object of class "vglmff"
(see vglmff-class).
The object is used by modelling functions
such as vglm,
and vgam.
Jorgensen, B. (1997). The Theory of Dispersion Models. London: Chapman & Hall.
Morris, C. N. (1982). Natural exponential families with quadratic variance functions. The Annals of Statistics, 10(1), 65–80.
hdata <- data.frame(x2 = rnorm(nn <- 200))
hdata <- transform(hdata, y = rnorm(nn)) # Not very good data!
fit1 <- vglm(y ~ x2, hypersecant, hdata, trace = TRUE, crit = "c")
#> Iteration 1: coefficients = -0.114019836, -0.037647484
#> Iteration 2: coefficients = -0.11373775, -0.03834265
#> Iteration 3: coefficients = -0.113740444, -0.038351822
#> Iteration 4: coefficients = -0.113740481, -0.038351962
#> Iteration 5: coefficients = -0.113740481, -0.038351964
coef(fit1, matrix = TRUE)
#> extlogitlink(theta, min = -1.5707963267949, max = 1.5707963267949)
#> (Intercept) -0.11374048
#> x2 -0.03835196
fit1@misc$earg
#> $theta
#> $theta$theta
#>
#>
#> $theta$min
#> -pi/2
#>
#> $theta$max
#> pi/2
#>
#> $theta$bminvalue
#> NULL
#>
#> $theta$bmaxvalue
#> NULL
#>
#> $theta$inverse
#> [1] FALSE
#>
#> $theta$deriv
#> [1] 0
#>
#> $theta$short
#> [1] TRUE
#>
#> $theta$tag
#> [1] FALSE
#>
#> attr(,"function.name")
#> [1] "extlogitlink"
#>
# Not recommended:
fit2 <- vglm(y ~ x2, hypersecant(link = "identitylink"), hdata)
coef(fit2, matrix = TRUE)
#> theta
#> (Intercept) -0.08913193
#> x2 -0.02966554
fit2@misc$earg
#> $theta
#> $theta$theta
#>
#>
#> $theta$inverse
#> [1] FALSE
#>
#> $theta$deriv
#> [1] 0
#>
#> $theta$short
#> [1] TRUE
#>
#> $theta$tag
#> [1] FALSE
#>
#> attr(,"function.name")
#> [1] "identitylink"
#>