posnormal1               package:VGAM               R Documentation

_P_o_s_i_t_i_v_e _N_o_r_m_a_l _D_i_s_t_r_i_b_u_t_i_o_n _F_a_m_i_l_y _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Fits a positive (univariate) normal distribution.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

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.

    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.

_D_e_t_a_i_l_s:

     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)].

_V_a_l_u_e:

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

_W_a_r_n_i_n_g:

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

_N_o_t_e:

     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.

_A_u_t_h_o_r(_s):

     Thomas W. Yee

_R_e_f_e_r_e_n_c_e_s:

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

_S_e_e _A_l_s_o:

     'normal1'.

_E_x_a_m_p_l_e_s:

     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")

