posnormal1 {VGAM} | R Documentation

## Positive Normal Distribution Family Function

### Description

Fits a positive (univariate) normal distribution.

### Usage

    posnormal1(lmean="identity", lsd="loge",
               emean=list(), esd=list(),
               imean=NULL, isd=NULL, nsimEIM = 100, zero=NULL)

### Arguments

`lmean, lsd` | Link functions for the mean and standard deviation parameters of the usual univariate normal distribution. They are mu and sigma respectively. See `Links` for more choices.
`emean, esd` | List. Extra argument for each of the links. See `earg` in `Links` for general information.
`imean, isd` | Optional initial values for mu and sigma. A `NULL` means a value is computed internally.
`nsimEIM` | See `CommonVGAMffArguments` for more information.
`zero` | An integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. The values must be from the set {1,2} corresponding respectively to mu, sigma. If `zero=NULL` then all linear/additive predictors are modelled as a linear combination of the explanatory variables. For many data sets having `zero=2` is a good idea.

### Details

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

f(y) = (1/(sqrt(2*pi)*sigma)) * exp( -0.5 * (y-mu)^2/ sigma^2) / [1-Phi(-mu/ sigma)]

where Phi is the cumulative distribution function of a standard normal (`pnorm`). Equivalently, this is

f(y) = (1/sigma) * dnorm((y-mu)/sigma) / [1-pnorm(-mu/ sigma)].

where dnorm() is the probability density function of a standard normal distribution (`dnorm`).

The mean of Y is

E(Y) = mu + sigma * dnorm((y-mu)/sigma) / [1-pnorm(-mu/ sigma)].

### Value

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

### Warning

Under- or over-flow may occur if the data is ill-conditioned.

### Note

The response variable for this family function is the same as `normal1` except positive values are required. Reasonably good initial values are needed. Fisher scoring is implemented.

The distribution of the reciprocal of a positive normal random variable is known as an alpha distribution.

### Author(s)

Thomas W. Yee

### References

Documentation accompanying the VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.

### See Also

`normal1`.

### Examples

    m =  1.0; SD = exp(1.0)
    y = rposnorm(n <- 1000, m=m, sd=SD)
    ## Not run: hist(y, prob=TRUE, main=paste("posnorm(m=",m,", sd=",round(SD,2),")"))
    fit = vglm(y ~ 1, fam=posnormal1, trace=TRUE)
    coef(fit, mat=TRUE)
    (Cfit = Coef(fit))
    mygrid = seq(min(y), max(y), len=200) # Add the fit to the histogram
    ## Not run: lines(mygrid, dposnorm(mygrid, Cfit[1], Cfit[2]), col="red")

[Package VGAM version 0.7-9 Index]