array-simulate function

Simulate data from array.