def resample(self, size=None):
if size is None:<EOL><INDENT>size = self.n<EOL><DEDENT>norm = transpose(multivariate_normal(zeros((self.d,), float),<EOL>self.covariance, size=size))<EOL>indices = randint(<NUM_LIT:0>, self.n, size=size)<EOL>means = self.dataset[:, indices]<EOL>return means + norm<EOL>
Randomly sample a dataset from the estimated pdf.

Parameters
----------
size : int, optional
    The number of samples to draw.  If not provided, then the size is
    the same as the underlying dataset.

Returns
-------
resample : (self.d, `size`) ndarray
    The sampled dataset.