R Code for Simulation of GLMDM