def randomize(self, rand_gen=None, *args, **kwargs):
if rand_gen is None:<EOL><INDENT>rand_gen = np.random.normal<EOL><DEDENT>x = rand_gen(size=self._size_transformed(), *args, **kwargs)<EOL>updates = self.update_model()<EOL>self.update_model(False) <EOL>self.optimizer_array = x  <EOL>x = self.param_array.copy()<EOL>[np.put(x, ind, p.rvs(ind.size)) for p, ind in self.priors.items() if not p is None]<EOL>unfixlist = np.ones((self.size,),dtype=np.bool)<EOL>from paramz.transformations import __fixed__<EOL>unfixlist[self.constraints[__fixed__]] = False<EOL>self.param_array.flat[unfixlist] = x.view(np.ndarray).ravel()[unfixlist]<EOL>self.update_model(updates)<EOL>
Randomize the model.
Make this draw from the prior if one exists, else draw from given random generator

:param rand_gen: np random number generator which takes args and kwargs
:param flaot loc: loc parameter for random number generator
:param float scale: scale parameter for random number generator
:param args, kwargs: will be passed through to random number generator