Update simulation.R

add function crtcoef2: generate coef for random case