-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial comments on Example 2.1.2 #1
Comments
I'm not going to have time to look at this until I get back from a funeral
later this week. However, I think I can explain some things:
On Fri, Jun 29, 2018 at 9:01 PM, jkmacc-LANL ***@***.***> wrote:
The Example 2.1.2 directory
<https://github.com/jkmacc-LANL/peip-python/blob/master/Examples/chap2/ex_2_1_2>
contains a .mat data file, and a Jupyter notebook that follows the
Example 2.1.1 matlab script. Jupyter was chosen because it supports
narrative code + output far better than commented Python code, and is
widely available and easy to install. It also fully renders in GitHub
repositories, making them useful to view on their own without
installing/running Jupyter.
So you're recommending the Anaconda distribution too? Or, is there some
other way to get Python and friends working with a Jupyter notebook?
@brianborchers <https://github.com/brianborchers> I'm seeking any
feedback on the minor differences in outputs (compared to Octave). I notice
small (third decimal place-ish) differences in values. For example, in cell
17, for the singular vectors of the covariance matrix. In this cell, the
singular vectors have small differences in value and are of opposite sign.
Sign changes in the singular vectors should not be a problem. If you think
about the formula, you can see that flipping the sign of $U_{i}$ and the
sign of $V_{i}$ cancels out in the sum(sigma(i)*U(:,i)*V(:,i)') to give you
the same answer. There's no way to ensure that two different SVD
computations will find singular vectors with the same signs. Except
possibly for some places where we plotted singular vectors in the book,
nothing that we do in calculations should break if the signs of the
singular vectors change in a way that is consistent with the SVD.
Also note that when there are repeated singular values (or multiple
singular values that are effectively 0) there can be infinitely many
SVD's! Any set of orthogonal vectors that spans the appropriate space will
work. For example, if you take A=I, then the singular values are all 1's.
You can let U be any orthogonal matrix, let Sigma=I, and let V=U, and
you'll have an SVD of the identity matrix. What gets computed by the svd
function in Octave or MATLAB in these cases is really pretty arbitrary as
long as it is a correct SVD.
… —
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AS1gkhj-nZWjyVWzAjkk0wKBcUj89Kxoks5uBunwgaJpZM4U90Ql>
.
--
Brian Borchers borchers@nmt.edu
Department of Mathematics http://www.nmt.edu/~borchers/
New Mexico Tech Phone: (575) 322-2592
Socorro, NM 87801 FAX: (575) 835-5366
|
Thanks for having a look. To the best of my knowledge, Jupyter will install just fine with pip. I personally use and recommend Anaconda/Miniconda, but others should be fine. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Example 2.1.2 directory contains a
.mat
data file, and a Jupyter notebook that follows the Example 2.1.1 matlab script. Jupyter was chosen because it supports narrative code + output far better than commented Python code, and is widely available and easy to install. It also fully renders in GitHub repositories, making them useful to view on their own without installing/running Jupyter.@brianborchers I'm seeking any feedback on the minor differences in outputs (compared to Octave). I notice small (third decimal place-ish) differences in values. For example, in cell 17, for the singular vectors of the covariance matrix. In this cell, the singular vectors have small differences in value and are of opposite sign.
The text was updated successfully, but these errors were encountered: