vec                package:fUtilities                R Documentation

_S_t_a_c_k_i_n_g _V_e_c_t_o_r_s _a_n_d _M_a_t_r_i_x_e_s

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

     Stacks either a lower triangle matrix or a matrix.

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

     vec(x)
     vech(x)

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

       x: a numeric matrix. 

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

     The function 'vec' implements the operator that stacks a matrix as
     a column vector, to be more precise in a matrix with one column.
     vec(X) = (X11, X21, ..., XN1, X12, X22, ..., XNN).

     The function 'vech' implements the operator that stacks the lower 
     triangle of a NxN matrix as an N(N+1)/2x1 vector: vech(X) =(X11,
     X21, X22, X31, ..., XNN), to be more precise in a  matrix with one
     row.

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

     ## Create Pascal Matrix:
        P = pascal(3)
        
     ## Stack a matrix
        vec(P) 
        
     ## Stack the lower triangle
        vech(P)                                        

