def sample(self, num_samples=<NUM_LIT:1000>, hmc_iters=<NUM_LIT:20>):
params = np.empty((num_samples,self.p.size))<EOL>for i in range(num_samples):<EOL><INDENT>self.p[:] = np.random.multivariate_normal(np.zeros(self.p.size),self.M)<EOL>H_old = self._computeH()<EOL>theta_old = self.model.optimizer_array.copy()<EOL>params[i] = self.model.unfixed_param_array<EOL>self._update(hmc_iters)<EOL>H_new = self._computeH()<EOL>if H_old>H_new:<EOL><INDENT>k = <NUM_LIT:1.><EOL><DEDENT>else:<EOL><INDENT>k = np.exp(H_old-H_new)<EOL><DEDENT>if np.random.rand()<k:<EOL><INDENT>params[i] = self.model.unfixed_param_array<EOL><DEDENT>else:<EOL><INDENT>self.model.optimizer_array = theta_old<EOL><DEDENT><DEDENT>return params<EOL>
Sample the (unfixed) model parameters.

:param num_samples: the number of samples to draw (1000 by default)
:type num_samples: int
:param hmc_iters: the number of leap-frog iterations (20 by default)
:type hmc_iters: int
:return: the list of parameters samples with the size N x P (N - the number of samples, P - the number of parameters to sample) 
:rtype: numpy.ndarray