Last chance! 50% off unlimited learning
Sale ends in
Fits a positive (univariate) normal distribution.
posnormal(lmean = "identitylink", lsd = "loge",
eq.mean = FALSE, eq.sd = FALSE,
gmean = exp((-5:5)/2), gsd = exp((-1:5)/2),
imean = NULL, isd = NULL, probs.y = 0.10, imethod = 1,
nsimEIM = NULL, zero = "sd")
Link functions for the mean and standard
deviation parameters of the usual univariate normal distribution.
They are Links
for more choices.
See CommonVGAMffArguments
for more information.
gmean
and gsd
currently operate on a multiplicative scale, on the sample mean
and the sample standard deviation, respectively.
Optional initial values for NULL
means a value is computed internally.
See CommonVGAMffArguments
for more information.
See CommonVGAMffArguments
for more information.
The fact that these arguments are supported results in
default constraint matrices being a permutation of the
identity matrix (effectively trivial constraints).
See CommonVGAMffArguments
for information.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
It is recommended that trace = TRUE
be used to monitor convergence;
sometimes the estimated mean is -Inf
and the
estimated mean standard deviation is Inf
, especially
when the sample size is small.
Under- or over-flow may occur if the data is ill-conditioned.
The positive normal distribution is the ordinary normal distribution
but with the probability of zero or less being zero.
The rest of the probability density function is scaled up. Hence
the probability density function can be written
pnorm
).
Equivalently, this is
dnorm
).
The mean of
# NOT RUN {
pdata <- data.frame(Mean = 1.0, SD = exp(1.0))
pdata <- transform(pdata, y = rposnorm(n <- 1000, m = Mean, sd = SD))
# }
# NOT RUN {
with(pdata, hist(y, prob = TRUE, border = "blue",
main = paste("posnorm(m =", Mean[1], ", sd =", round(SD[1], 2),")")))
# }
# NOT RUN {
fit <- vglm(y ~ 1, posnormal, data = pdata, trace = TRUE)
coef(fit, matrix = TRUE)
(Cfit <- Coef(fit))
mygrid <- with(pdata, seq(min(y), max(y), len = 200)) # Add the fit to the histogram
# }
# NOT RUN {
lines(mygrid, dposnorm(mygrid, Cfit[1], Cfit[2]), col = "orange")
# }
Run the code above in your browser using DataLab