~scipystats/+junk/skipper-revjp

« back to all changes in this revision

Viewing changes to nipy/fixes/scipy/stats/models/rlm.py

  • Committer: joep
  • Date: 2009-08-17 03:43:53 UTC
  • mfrom: (1799.1.26 skipper-working)
  • Revision ID: josef.pktd@gmail.com-20090817034353-ktg588ju3qhmruvq
merge from Skipper, trying to clear up move, keeping history

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
"""
4
4
import numpy as np
5
5
 
6
 
from models import utils
 
6
from models import tools
7
7
from models.regression import WLS, GLS
8
8
from models.robust import norms, scale
9
9
from scipy.stats import norm as Gaussian # can get rid of once scale is sorted
31
31
        self.calc_params = np.linalg.pinv(self._exog)
32
32
        self.normalized_cov_params = np.dot(self.calc_params,
33
33
                                        np.transpose(self.calc_params))
34
 
        self.df_resid = np.float(self._exog.shape[0] - utils.rank(self._exog))
35
 
        self.df_model = np.float(utils.rank(self._exog)-1)
 
34
        self.df_resid = np.float(self._exog.shape[0] - tools.rank(self._exog))
 
35
        self.df_model = np.float(tools.rank(self._exog)-1)
36
36
        self.nobs = float(self._endog.shape[0])
37
37
 
38
38
    def score(self, params):
56
56
        self.history['params'].append(tmp_results.params)
57
57
        self.history['scale'].append(tmp_results.scale)
58
58
        self.history['sresid'].append(tmp_results.resid/tmp_results.scale)
59
 
        self.history['weights'].append(tmp_results._model.weights)
 
59
        self.history['weights'].append(tmp_results.model.weights)
60
60
 
61
61
    def estimate_scale(self, resid):
62
62
        """