On Mon, Feb 10, 2014 at 7:00 PM, alex <argri...@ncsu.edu> wrote:

> On Mon, Feb 10, 2014 at 11:27 AM,  <josef.p...@gmail.com> wrote:
> > How do we calculate the diagonal of the hat matrix without using N by N
> > matrices?
>
> Not sure if this was a rhetorical question or what, but this seems to work
> leverages = np.square(scipy.linalg.qr(X, mode='economic')[0]).sum(axis=1)
> http://www4.ncsu.edu/~ipsen/ps/slides_CSE2013.pdf

Rhetorical or not, but FWIW I'll prefer to take singular value
decomposition (u, s, vt= svd(x)) and then based on the singular values
sI'll estimate a "numerically feasible rank"
r. Thus the diagonal of such hat matrix would be (u[:, :r]** 2).sum(1).


Regards,
-eat

>
> Sorry for off-topic...
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to