def fit_loc_scale(self, data, *args):
mu, mu2 = self.stats(*args, **{'<STR_LIT>': '<STR_LIT>'})<EOL>tmp = asarray(data)<EOL>muhat = tmp.mean()<EOL>mu2hat = tmp.var()<EOL>Shat = sqrt(mu2hat / mu2)<EOL>Lhat = muhat - Shat*mu<EOL>if not np.isfinite(Lhat):<EOL><INDENT>Lhat = <NUM_LIT:0><EOL><DEDENT>if not (np.isfinite(Shat) and (<NUM_LIT:0> < Shat)):<EOL><INDENT>Shat = <NUM_LIT:1><EOL><DEDENT>return Lhat, Shat<EOL>
Estimate loc and scale parameters from data using 1st and 2nd moments.

Parameters
----------
data : array_like
    Data to fit.
arg1, arg2, arg3,... : array_like
    The shape parameter(s) for the distribution (see docstring of the
    instance object for more information).

Returns
-------
Lhat : float
    Estimated location parameter for the data.
Shat : float
    Estimated scale parameter for the data.