Learn R Programming

VGAM (version 0.9-1)

normal1: Univariate Normal Distribution

Description

Maximum likelihood estimation of the two parameters of a univariate normal distribution.

Usage

normal1(lmean = "identity", lsd = "loge", lvar = "loge",
        var.arg = FALSE, imethod = 1, isd = NULL, parallel = FALSE,
        apply.parint = FALSE, smallno = 1e-05, zero = -2)

Arguments

lmean, lsd, lvar
Link functions applied to the mean and standard deviation/variance. See Links for more choices. Being positive quantities, a log link is the default for the standard deviation and variance (see va
var.arg
Logical. If TRUE then the second parameter is the variance and lsd and esd are ignored, else the standard deviation is used and lvar and evar are ignored.
smallno
Numeric, positive but close to 0. Used specifically for quasi-variances; if the link for the mean is explink then any non-positive value of eta is replaced by this quantity (hopefully,
imethod, parallel, isd, apply.parint, zero
See CommonVGAMffArguments for more information. If lmean = loge then try imethod = 2. Argument apply.parint refers to whether the parallelism const

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Details

This fits a linear model (LM) as the first linear/additive predictor. So, by default, this is just the mean. By default, the log of the standard deviation is the second linear/additive predictor. The Fisher information matrix is diagonal. This VGAM family function can handle multiple responses.

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

gaussianff, posnormal1, mix2normal1, Qvar, tobit, cennormal1, fnormal1, skewnormal1, dcennormal1, SUR, huber2, studentt, binormal, dnorm.

Examples

Run this code
ndata <- data.frame(x2 = rnorm(nn <- 200))
ndata <- transform(ndata,
                   y1 = rnorm(nn, mean = 1-3*x2, sd = exp(1+0.2*x2)),
                   y2 = rnorm(nn, mean = 1+2*x2, sd = exp(1+  2*x2)^0.5),
                   y3 = rnorm(nn, mean = 1+2*x2, sd = exp(1+  2*x2)^0.5))
fit1 <- vglm(y1 ~ x2, normal1(zero = NULL), ndata, trace = TRUE)
coef(fit1, matrix = TRUE)
fit2 <- vglm(cbind(y2, y3) ~ x2, data = ndata, trace = TRUE,
             normal1(var = TRUE, parallel = TRUE,
                     apply.parint = TRUE, zero = NULL))
coef(fit2, matrix = TRUE)

# Generate data from N(mu = theta = 10, sigma = theta) and estimate theta.
theta <- 10
ndata <- data.frame(y = rnorm(100, m = theta, sd = theta))
fit3 <- vglm(y ~ 1, normal1(lsd = "identity"), ndata,
             constraints = list("(Intercept)" = rbind(1, 1)))
fit4 <- vglm(y ~ 1, normal1(lsd = "identity", parallel = TRUE,
                            apply.parint = TRUE, zero = NULL), ndata)
coef(fit3, matrix = TRUE)
coef(fit4, matrix = TRUE) # Same as fit3

Run the code above in your browser using DataLab