QPmat                 package:popbio                 R Documentation

_B_u_i_l_d _a _p_r_o_j_e_c_t_i_o_n _m_a_t_r_i_x _f_r_o_m _a _t_i_m_e _s_e_r_i_e_s _o_f _i_n_d_i_v_i_d_u_a_l_s (_o_r _d_e_n_s_i_t_i_e_s) _p_e_r _s_t_a_g_e.

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

     This function builds one projection matrix from a time series of
     number (or densities) of individuals per stage (size classes or
     life stages) using Wood's quadratic programming method. The matrix
     model also requires a constraint matrix C, vector b, and vector
     listing nonzero elements of desired projection matrix.

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

     QPmat(nout, C, b, nonzero)

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

    nout: A time series of population vectors

       C: C constraint matrix

       b: b vector 

 nonzero: indices of the non-zero elements of the transition matrix
          (counting by column)

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

     A projection matrix.

_N_o_t_e:

     This function uses package 'quadprog', which should be  installed
     and loaded on the user's system.

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

     Original Matlab code in Caswell (2001: 148). Adapted to R by
     Patrick Nantel

_S_o_u_r_c_e:

     converted Matlab code from Example 6.3 in Caswell (2001)

_R_e_f_e_r_e_n_c_e_s:

     Caswell, H. 2001. Matrix population models. Construction, Analysis
     and interpretation. 2nd ed. Sinauer, Sunderland, Massachusetts.

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

     data(nematode)
     ## list nonzero elements
     nonzero<- c( 1, 2, 5, 6, 7, 9)
     ## create C matrix
     C<- rbind(diag(-1,6), c(1,1,0,0,0,0), c(0,0,1,1,0,0), c(0,0,0,0,0,1))
     ## calculate b (transpose is not necessary - either way works)
     b<-apply(C, 1, max)
     QPmat(nematode, C,b,nonzero)

