'Computes the Vandermonde matrix.
Parameters
x : ndarray
input
y : ndarray
input
params : throw away parameter
parameter list returned by non-linear fitters
Returns
result : ndarray
The Vandermonde matrix'

def fit_deriv(self, x, y, *params):

    if (x.ndim == 2):
        x = x.flatten()
    if (y.ndim == 2):
        y = y.flatten()
    if (x.size != y.size):
        raise ValueError(u'Expected    x    and    y    to    be    of    equal    size')
    designx = (x[:, None] ** np.arange((self.degree + 1)))
    designy = (y[:, None] ** np.arange(1, (self.degree + 1)))
    designmixed = []
    for i in range(1, self.degree):
        for j in range(1, self.degree):
            if ((i + j) <= self.degree):
                designmixed.append(((x ** i) * (y ** j)))
    designmixed = np.array(designmixed).T
    if designmixed.any():
        v = np.hstack([designx, designy, designmixed])
    else:
        v = np.hstack([designx, designy])
    return v
