kfs                  package:sspir                  R Documentation

(_I_t_e_r_a_t_e_d _e_x_t_e_n_d_e_d) _K_a_l_m_a_n _s_m_o_o_t_h_e_r

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

     Runs the Kalman smoother on an 'ssm' object if the
     family-attribute of the object is 'gaussian'. If not, the iterated
     extended Kalman smoother is used.

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

     kfs(ss, ...)

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

      ss: an object of class 'ssm'.

     ...: further arguments passed to the Kalman smoother.

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

     The function is a wrapper for 'kfilter' followed by 'smoother' in
     the Gaussian case. For other family types, 'extended' is called.

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

     The returned value from either 'smoother' (Gaussian case) or
     'extended'.

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

     Claus Dethlefsen and Sren Lundbye-Christensen.

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

     'kfilter', 'smoother', 'extended', 'ssm'.

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

     data(mumpsdat)
     time <- 1:nrow(mumpsdat)
     m3 <- ssm( mumps ~ -1 + tvar(polytime(time,1)) +
                       tvar(polytrig(time,12,1)),
                       family=poisson(link=log),time=time,data=mumpsdat) 
     m3$ss$phi["epsilon"] <- 0
     m3$ss$phi["polytime(time, 1)time0"] <- 0
     m3$ss$phi["polytime(time, 1)time1"] <- 0.0005
     m3$ss$phi["polytrig(time,12,1)"] <- 0.0001
     diag(m3$ss$C0) <- 1

     m3.fit <- kfs(m3)

