Update simulation.R

add function switchCoef