smooth1d               package:OCplus               R Documentation

_S_m_o_o_t_h_i_n_g _a _v_e_c_t_o_r _o_f _c_o_u_n_t_s

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

     This function takes a vector of counts and uses a mixed model
     approach to smooth it. A common use of this is smoothing binned
     counts of an observed quantity prior to estimating its density
     nonparametrically through the relative frequencies.

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

     smooth1d(y, sv2 = 0.1, err = 0.01, verb = TRUE)

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

       y: the vector of counts

     sv2: the user-specified starting value for the variance of the
          random effects, see Details.

     err: Tolerance for convergence, see Details

    verb: logical value indicating whether to print diagnostics.

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

     The smoothing assumes that the counts are Poisson from a
     generalized linear mixed model, where the second differences are
     normally distributed. Using the extended likelihood approach
     described in Pawitan (2001) and the initial estimate 'sv2' for the
     variance of the random effects, the routine iteratetively
     optimizes the fixed and random contributions to the extended
     likelihood, until the estimate for the variance convergences with
     tolerance 'err'. The result is quite stable within a reasonable
     range of starting values and tolerances, and the function can be
     used for fairly automatic smoothing ((i.e. withou fixing a
     bandwidth parameter).

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

     A list with three components: 

     fit: the smoothed counts

      df: the degrees of freedom used for smoothing at convergence

     sv2: the estimated variance at convergence, equivalent to 'df'.

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

     Y. Pawitan and A. Ploner

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

     Pawitan Y.(2001) _In All Likelihood_, Oxford University Press, ch.
     18.11

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

     'fdr1d'

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

     # Stupid dummies, obviously
     smooth1d(1:10)
     smooth1d(1:10, sv2=1)

