medists                 package:msm                 R Documentation

_M_e_a_s_u_r_e_m_e_n_t _e_r_r_o_r _d_i_s_t_r_i_b_u_t_i_o_n_s

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

     Truncated Normal and Uniform distributions, where the response is
     also subject to a Normally distributed measurement error.

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

          dmenorm(x, mean=0, sd=1, lower=-Inf, upper=Inf, sderr=0, meanerr=0, log = FALSE)
          pmenorm(q, mean=0, sd=1, lower=-Inf, upper=Inf, sderr=0, meanerr=0,
                  lower.tail = TRUE, log.p = FALSE)
          qmenorm(p, mean=0, sd=1, lower=-Inf, upper=Inf, sderr=0, meanerr=0,
                  lower.tail = TRUE, log.p = FALSE)
          rmenorm(n, mean=0, sd=1, lower=-Inf, upper=Inf, sderr=0, meanerr=0)
          dmeunif(x, lower=0, upper=1, sderr=0, meanerr=0, log = FALSE)
          pmeunif(q, lower=0, upper=1, sderr=0, meanerr=0, lower.tail = TRUE, log.p = FALSE)
          qmeunif(p, lower=0, upper=1, sderr=0, meanerr=0, lower.tail = TRUE, log.p = FALSE)
          rmeunif(n, lower=0, upper=1, sderr=0, meanerr=0)

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

     x,q: vector of quantiles.

       p: vector of probabilities.

       n: number of observations. If 'length(n) > 1', the length is
          taken to be the number required.

    mean: vector of means.

      sd: vector of standard deviations.

   lower: lower truncation point.

   upper: upper truncation point.

   sderr: Standard deviation of measurement error distribution.

 meanerr: Optional shift for the measurement error distribution.

log, log.p: logical; if TRUE, probabilities p are given as log(p).

lower.tail: logical; if TRUE (default), probabilities are P[X <= x],
          otherwise, P[X > x].

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

     The normal distribution with measurement error has density


 (Phi(upper, mu2, sigma3) - Phi(lower, mu2, sigma3)) / (Phi(upper, mean, sd) - Phi(lower, mean, sd)) * phi(x, mean + meanerr, sigma2)

     where 

                 sigma2*sigma2 = sd*sd + sderr*sderr,


                     sigma3 = sd*sderr / sigma2,


            mu2 = (x - meanerr)*sd*sd + mean*sderr*sderr,


     mean is the mean of the original Normal distribution before
     truncation, 
      sd is the corresponding standard deviation, 
      u  is the upper truncation point, 
      l is the lower truncation point, 
      sderr is the standard deviation of the additional measurement
     error, 
      meanerr is the mean of the measurement error (usually 0). 
      phi(x) is the density of the corresponding normal distribution,
     and 
      Phi(x) is the distribution function of the corresponding normal
     distribution.

     The uniform distribution with measurement error has density


 (Phi(x, meanerr+l, sderr) - Phi(x, meanerr+u, sderr)) / (upper - lower)


     These are calculated from the original truncated Normal or Uniform
     density functions f(. | mu, sd) as


      integral f(y | mu, sd, l, u) phi(x, y + meanerr, sderr) dy


     If 'sderr' and 'meanerr' are not specified they assume the default
     values of 0, representing no measurement error variance, and no
     constant shift in the measurement error, respectively. 

     Therefore, for example with no other arguments, 'dmenorm(x)', is
     simply equivalent to 'dtnorm(x)', which in turn is equivalent to
     'dnorm(x)'.

     These distributions were used by Satten and Longini (1996) for CD4
     cell counts conditionally on hidden Markov states of HIV
     infection, and later by Jackson and Sharples (2002) for FEV1
     measurements conditionally on states of chronic lung transplant
     rejection.

     These distribution functions are just provided for convenience,
     and are not optimised  for numerical accuracy.  To fit a hidden
     Markov model with these response distributions, use a 'hmmMETNorm'
     or 'hmmMEUnif' constructor. See the 'hmm-dists' help page for
     further details.

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

     'dmenorm', 'dmeunif' give the density, 'pmenorm', 'pmeunif' give
     the distribution function, 'qmenorm', 'qmeunif' give the quantile
     function, and 'rmenorm', 'rmeunif' generate random deviates, for
     the Normal and Uniform versions respectively.

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

     C. H. Jackson chris.jackson@imperial.ac.uk

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

     Satten, G.A. and Longini, I.M.  Markov chains with measurement
     error: estimating the 'true' course of a marker of the progression
     of human immunodeficiency virus disease (with discussion) _Applied
     Statistics_ 45(3): 275-309 (1996)

     Jackson, C.H. and Sharples, L.D. Hidden Markov models for the
     onset and progression of bronchiolitis obliterans syndrome in lung
     transplant recipients _Statistics in Medicine_, 21(1): 113-128
     (2002).

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

     'dnorm', 'dunif', 'dtnorm'

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

     ## what does the distribution look like?
     x <- seq(50, 90, by=1)
     plot(x, dnorm(x, 70, 10), type="l", ylim=c(0,0.06)) ## standard Normal
     lines(x, dtnorm(x, 70, 10, 60, 80), type="l")       ## truncated Normal
     ## truncated Normal with small measurement error
     lines(x, dmenorm(x, 70, 10, 60, 80, sderr=3), type="l")

