model_matrix function

Construct a design matrix