tr                  package:lasso2                  R Documentation

_T_r_a_c_e _o_f _a _M_a_t_r_i_x

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

     Calculates the trace of a matrix

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

     tr(mat)

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

     mat: a square matrix.

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

     The trace of the matrix, i.e. the sum of its diagonal elements, is
     returned.

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

     tr(cbind(1,1:3,4:2)) # 5

