gnmControl                package:gnm                R Documentation

_S_e_t _C_o_n_t_r_o_l _P_a_r_a_m_e_t_e_r_s _f_o_r _M_o_d_e_l _F_i_t_t_i_n_g

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

     Set parameters to control the 'gnm' fitting algorithm.

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

     gnmControl(tolerance = 1e-04, iterStart = 2, iterMax = 500, trace = FALSE)

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

tolerance: a positive numeric value specifying the tolerance level for
          convergence.

iterStart: a positive integer specifying the number of start-up
          iterations to perform.

 iterMax: a positive integer specifying the maximum number of main
          iterations to perform.

   trace: a logical value indicating whether the deviance should be
          printed after each iteration.

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

     The 'gnm' fitting algorithm consists of two stages.  In the
     start-up iterations, any nonlinear parameters that are not
     specified by either the 'start' argument of 'gnm' or a plug-in
     function are updated one parameter at a time, then the linear
     parameters are jointly updated before the next iteration. In the
     main iterations, all the parameters are jointly updated, until
     convergence is reached or the number or iterations reaches
     'iterMax'.

     Convergence is judged by comparing the squared components of the
     score vector with corresponding elements of the diagonal of the
     Fisher information matrix. If, for all components of the score
     vector, the ratio is less than 'tolerance^2', or the corresponding
     diagonal element of the Fisher information matrix is less than
     1e-20, iterations cease.

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

     A list with the arguments as components.

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

     Heather Turner

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

     'gnm'

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

     ## A variation on example(gnm)...
     data(cautres)
     set.seed(1)

     ##  Fit a "double UNIDIFF" model with the religion-vote and class-vote
     ##  interactions both modulated by nonnegative election-specific
     ##  multipliers.

     system.time(doubleUnidiff <-
                 gnm(Freq ~ election:vote + election:class:religion
                     + Mult(Exp(election - 1), religion:vote - 1) +
                     Mult(Exp(election - 1), class:vote - 1),
                     family = poisson, data = cautres, trace = TRUE))

     ## repeat with 10 start-up iterations
     system.time(doubleUnidiff <-
                 gnm(Freq ~ election:vote + election:class:religion
                     + Mult(Exp(election - 1), religion:vote - 1) +
                     Mult(Exp(election - 1), class:vote - 1),
                     family = poisson, data = cautres, trace = TRUE,
                     iterStart = 10))
     ## ...at convergence by first main iteration, but much slower!

