logLik             package:HiddenMarkov             R Documentation

_L_o_g _L_i_k_e_l_i_h_o_o_d _o_f _H_i_d_d_e_n _M_a_r_k_o_v _M_o_d_e_l

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

     Provides methods for the generic function 'logLik'.

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

     ## S3 method for class 'dthmm':
     logLik(object, ...)
     ## S3 method for class 'mmglm':
     logLik(object, ...)
     ## S3 method for class 'mmpp':
     logLik(object, ...)

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

  object: an object with class '"dthmm"', '"mmglm"' or '"mmpp"'.

     ...: other arguments.

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

     The methods provided here will always recalculate the
     log-likelihood even if it is already contained within the
     'object'. This enables the user to change parameter or data values
     within the 'object' and recalculate the log-likelihood for the
     revised configuration.

     The code for the methods '"dthmm"', '"mmglm"' and '"mmpp"' can be
     viewed by typing 'logLik.dthmm', 'logLik.mmglm' or 'logLik.mmpp',
     respectively, on the R command line.

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

     Returns the value of the log-likelihood.

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

     Pi <- matrix(c(1/2, 1/2,   0,
                    1/3, 1/3, 1/3,
                      0, 1/2, 1/2),
                  byrow=TRUE, nrow=3)

     x <- dthmm(NULL, Pi, c(0,1,0), "norm",
                list(mean=c(1, 6, 3), sd=c(1, 0.5, 1)))

     x <- simulate(x, nsim=100)

     print(logLik(x))

