To better understand SVD, I'm trying to recreate the values for U, S, and V using straight numpy, but I can't get the same results.  According to numpy's  for its implementation of SVD, it returns values for U, S, and V such that you can recreate your original dataset in the following way:  (U*S) @ V = original_data   My understanding is that the values for U are derived from the eigenvectors of $ XX^T $, V from the eigenvectors of $X^TX$, and they share the same eigenvalues, and their square root comprise the values for S.    So, to recreate these on my own I'm doing the following:  from sklearn.datasets import load_boston boston = load_boston() X = boston.data u_vals, u_vecs = np.linalg.eig(X.dot(X.T)) v_vals, v_vecs = np.linalg.eig(X.T.dot(X))   My thinking is that u_vecs[:, :13] @ np.diag(v_vals**.5) @ v_vecs.T ought to do the trick.    However, this gives very different results.    Even more, I've checked further, and the only difference between the values I have from numpy's eigensolver and the ones returned from its svd method are the signs involved in the eigenvectors used.    However, my (perhaps naive) understanding is that this shouldn't make a difference.  However, I'm clearly mistaken in something.  Is it simply a case of using a different eigensolver, or is there a deeper misunderstanding that I'm not seeing?
I am trying to do SVD by hand:  m&lt;-matrix(c(1,0,1,2,1,1,1,0,0),byrow=TRUE,nrow=3)  U=eigen(m%*%t(m))$vector V=eigen(t(m)%*%m)$vector D=sqrt(diag(eigen(m%*%t(m))$values))  U1=svd(m)$u V1=svd(m)$v D1=diag(svd(m)$d)  U1%*%D1%*%t(V1) U%*%D%*%t(V)   But the last line does not return m back. Why? It seems to has something to do with signs of these eigenvectors... Or did I misunderstand the procedure?
I've been building my own emacs because I want to fix some issues in it and get the bug fixes upstream. However, Ubuntu keeps automatically removing my own built emacs and I have to keep rebuilding and reinstalling it.  Here's my output of apt-cache policy emacs when I went to bed last night:  ~/emacs$ sudo apt-cache policy emacs emacs:   Installed: 26.0.50.aaron-1   Candidate: 46.1   Version table:      46.1 500         500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages  *** 26.0.50.aaron-1 100         100 /var/lib/dpkg/status   Here it is when I wake up:  ~/emacs$ sudo apt-cache policy emacs [sudo] password for excelsiora: emacs:   Installed: 46.1   Candidate: 46.1   Version table:  *** 46.1 500         500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages         100 /var/lib/dpkg/status   Why is this package being versioned at 46 instead of 24 or 25? 26 is the currently the highest major emacs version you can get.   I can see that this is a meta-package:   Why is Ubuntu updating software without asking?  Main Question: What am I supposed to do - assign my package version a number higher than 46 just to make it stick?   That seems like a horrible hack, or maybe that's how it's supposed to work? How to find the joint PDF? Why not use "which"? What to use then? When looking for the path to an executable or checking what would happen if you enter a command name in a Unix shell, there's a plethora of different utilities (which, type, command, whence, where, whereis, whatis, hash, etc).  We often hear that which should be avoided. Why? What should we use instead? proof that every finite matrix has an annihilating polynomial Why does my minecraft server disconnect the internet when it crashes? I've downloaded the daily Ubuntu 12.04 iso.  I currently have windows 7 x64 operating system installed.  How can I make a bootable usb from the Ubuntu iso? How did the ending happen from Neil's perspective? I am trying to figure out the scene near the finale of Tenet where Neil unlocks the door and gets shot in the face. I can't really see the flow where he opens and holds the door and the protagonist walks in and fights the bad guy. Can you tell the series of events as Neil sees them happen till he gets shot? UPDATE If I am not wrong, I see it like this: Neil was running down towards the door, both the protagonist and his mate are inside with the door locked fighting the bad guy, then, he unlocks the door and walks in and stands behind the door. The protagonist's mate comes out of the room, then the protagonist, then he closes the room, then he look back to get shot in the face. But this doesn't make sense, if he wanted to unlock the door when he was running down, they were already in fighting the bad guy!!!!! I am running k-fold cross validation on my training data, and then choosing the best set of hyper parameters, re-training on the training data and testing on a new (unseen) testing data. I am getting the following testing results (results on the unseen data):  R^2: 1.000 Adj R^2: 1.000 RMSE: 0.081 MSE: 0.007 MAE: 0.045 MAPE: 0.058   Can $R^2$ have a value of 1.00 but RMSE have a  value of 0.081? Doesn't an $R^2$ of value 1 indicate no errors at all? Query Activity for ORDER BY xxx DESC LIMIT So we have something like:  \documentclass{article} \setcounter{secnumdepth}{2} \setcounter{tocdepth}{2} \usepackage{amsmath}  \begin{document}  \tableofcontents  \section{Brushless Motor Fundamentals} \subsection{Brushless Motor Operation} \subsubsection{DC Motor Operation} Torque is generated in DC motors from the magnetic force, also known as the Lorentz force, which is produced when an electric current is passed through a coil in a magnetic field. This force is given by $F=q[E+(v\times B)]$, where $F$ is the force perpendicular to the coil, $E$ is the electric field in the coil, $B$ is the magnetic field, and $v$ is the velocity of the charged particles in the coil. From mechanics, torque is $\tau=F\times r$.  \section{Brushless Motor Fundamentals 2} \subsection{Brushless Motor Operation} \subsubsection{DC Motor Operation 2} If the electrical force is ignored and the remaining magnetic force is used, with the assumption that $v$ is perpendicular to $B$, we find that $\tau=qvBrsin\theta$.  \end{document}   How to show subsubsections and paragraphs in TOC? Bounded sequence with divergent Cesaro means Is there a bounded real-valued sequence with divergent Cesaro means (i.e. not Cesaro summable)?  More specifically, is there a bounded sequence $\{w_k\}\in l^\infty$ such that $$\lim_{M\rightarrow\infty} \frac{\sum_{k=1}^M w_k}{M}$$ does not exist?  I encountered this problem while studying the limit of average payoffs criterion for ranking payoff sequences in infinitely repeated games. A question about the arctangent addition formula. In the arctangent formula, we have that:  $$\arctan{u}+\arctan{v}=\arctan\left(\frac{u+v}{1-uv}\right)$$  however, only for $uv&lt;1$. My question is: where does this condition come from? The situation is obvious for $uv=1$, but why the inequality?  One of the possibilities I considered was as following: the arctangent addition formula is derived from the formula:  $$\tan\left(\alpha+\beta\right)=\frac{\tan{\alpha}+\tan{\beta}}{1-\tan{\alpha}\tan{\beta}}.$$  Hence, if we put $u=\tan{\alpha}$ and $v=\tan{\beta}$ (which we do in order to obtain the arctangent addition formula from the one above), the condition that $uv&lt;1$ would mean $\tan\alpha\tan\beta&lt;1$, which, in turn, would imply (thought I am NOT sure about this), that $-\pi/2&lt;\alpha+\beta&lt;\pi/2$, i.e. that we have to stay in the same period of tangent.  However, even if the above were true, I still do not see why we have to stay in the same period of tangent for the formula for $\tan(\alpha+\beta)$ to hold. I would be thankful for a thorough explanation. Expected value of sums Suppose we draw cards out of a deck without replacement. How many cards do we expect to draw out before we get an ace? Why the galaxies form 2D planes (or spiral-like) instead of 3D balls (or spherical-like)? Question: As we know, (1) the macroscopic spatial dimension of our universe is 3 dimension, and (2) gravity attracts massive objects together and the gravitational force is isotropic without directional preferences. Why do we have the spiral 2D plane-like Galaxy(galaxies), instead of spherical or elliptic-like galaxies?   Input: Gravity is (at least, seems to be) isotropic from its force law (Newtonian gravity). It should show no directional preferences from the form of force vector $\vec{F}=\frac{GM(r_1)m(r_2)}{(\vec{r_1}-\vec{r_2})^2} \hat{r_{12}}$. The Einstein gravity also does not show directional dependence at least microscopically.  If the gravity attracts massive objects together isotropically, and the macroscopic space dimension is 3-dimensional, it seems to be natural to have a spherical shape of massive objects gather together. Such as the globular clusters, or GC, are roughly spherical groupings , as shown in the Wiki picture:     However, my impression is that, even if we have observed some more spherical or more-ball-like , it is more common to find more-planar  such as our ? (Is this statement correct? Let me know if I am wrong.)  Also, such have a look at this more-planar Spiral "galaxy" as this NGC 4414 galaxy:    Is there some physics or math theory explains why the  turns out to be planar-like (or spiral-like) instead of spherical-like?  See also a   p.s. Other than the classical stability of a 2D plane perpendicular to a classical angular momentum, is there an interpretation in terms of the quantum theory of vortices in a macroscopic manner (just my personal speculation)?  Thank you for your comments/answers! How many outlets can you have on one 15 amp circuit? In my rebuilding project I have counted 18 outlets and lights on one bedroom circuit that travels through 3 rooms. Is that ok? My furnace pilot light keeps going out so I changed the thermocouple. Now the furnace will come on and heat up to the degree set on my thermostat, then the pilot light will go out and the furnace will not come back on.    Could the thermostat be bad and cause the pilot light to go out? Are there any   editors for ? Perhaps something similar to    but for PGF/TikZ?   If there is no WYSIWYG editor for this tandem, is there one perhaps that allows the user to easily generate PGF/TikZ templates?  Alternatively, how can I most easily generate PFG/TikZ code from a visual conception? Do people mostly code their PGF/TikZ graphics from scratch? This is the third time I've tried to install Ubuntu Server 14.04.03 64-bit on the same laptop, and each time it caused different problems.  Each time I wrote the same iso image to a USB flash drive by using a different application and OS.   Universal USB Installer (pendrivelinux.com) from Windows WinImage writer from Windows built-in image writer from Linux Mint 17.2    The iso image is the same in all three cases, the USB flash drive is the same, and the laptop is the same. However each time the installation of Ubuntu gave me different installation options. For example, the last time I installed Ubuntu, it didn't show all the packages to choose while installing (Basic Ubuntu server, etc.). Can I use Mage Hand to fly by Polymorphing myself and picking myself up with the hand? Could I first cast Mage Hand, then Polymorph into a Tiny creature less than 10 pounds then use the Mage Hand to pick myself up and fly at 30 Ft per turn?  Polymorph says:     The new form can be any beast ... The target's game statistics,   including mental ability scores, are replaced by the statistics of the   chosen beast. It retains its alignment and personality ... The   creature is limited in the actions it can perform by the nature of its   new form and it can't speak, cast spells, or take any other action   that requires hands or speech.   This keeps me from casting spells, which keeps me from just casting Mage Hand to fly as long as I want to over and over. But for that initial duration of the Mage Hand cantrip, could I use the Mage Hand to fly as a Tiny polymorphed creature until the spell runs out? How do you empty the buffers and cache on a Linux system?