Learn R Programming

VGAM (version 0.8-2)

normal1: Univariate normal distribution

Description

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

Usage

normal1(lmean = "identity", lsd = "loge",
        emean = list(), esd = list(), method.init = 1, zero = -2)

Arguments

lmean, lsd
Link functions applied to the mean and standard deviation. See Links for more choices. Being a positive quantity, a log link is the default for the standard deviation.
emean, esd
List. Extra argument for the links. See earg in Links for general information.
method.init, zero
See CommonVGAMffArguments for more information.

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, tobit, cnormal1, fnormal1, skewnormal1, dcnormal1, huber, studentt, dnorm.

Examples

Run this code
ndata <- data.frame(x2 = rnorm(nn <- 200))
ndata <- transform(ndata, y = rnorm(nn, mean = 1-3*x2, sd = exp(1+0.2*x2)))
fit <- vglm(y ~ x2, normal1(zero = NULL), ndata, trace = TRUE)
coef(fit, 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))
fit <- vglm(y ~ 1, normal1(lsd = "identity"), ndata,
            constraints = list("(Intercept)" = rbind(1, 1)))
coef(fit, matrix = TRUE)

Run the code above in your browser using DataLab