Reversing SVD back to the original variables I have a data matrix $M$ that has $n$ samples (rows) described by $m$ variables (columns) $X_1,X_2,\ldots X_m$. I do a SVD to reduce the $m$ dimensions to just 3 dimensions. I understand that the $x,y,z$ coordinates (i.e., the SVD values) are calculated from the eigenvectors of $MM^T$.  My question is, if I pick an arbitrary point in the SVD space (i.e. a value for SVD1, SVD2, SVD3, not necessarily in the data), is there a convenient way to translate that back to a set of the original variables (i.e., $X_1, X_2, \ldots X_m$)?
How to reverse PCA and reconstruct original variables from several principal components? Principal component analysis (PCA) can be used for dimensionality reduction. After such dimensionality reduction is performed, how can one approximately reconstruct the original variables/features from a small number of principal components?  Alternatively, how can one remove or discard several principal components from the data?  In other words, how to reverse PCA?    Given that PCA is closely related to singular value decomposition (SVD), the same question can be asked as follows: how to reverse SVD?
How does the integral $\int_{D_C} e^{ia z}P(z)/Q(z)\,\mathrm{d}z$ blow up. In my book I have a theorem that goes something like the following     Let $P(x)$ be $Q(x)$ polynomials such that $\deg(Q) \geq \deg(P) + 2$.   Then \begin{align*}  \int_{-\infty}^{\infty} \frac{P(x)}{Q(x)}  e^{iax} \,\mathrm{d}x  = 2 \pi i \frac{a}{|a|} \sum_{k=1}^{m} \mathrm{Res}\left[  \frac{P(x)}{Q(x)} , z_k \right] \end{align*} where $a$ is a real   constant and $z_1,\,\ldots\,,z_m$ are the singularities to $P(x)/Q(x)$ in   the upper halfplane if $a&gt;0$ and the lower halfplane if $a&lt;0$.   I am having a bit of problems understanding this. I know the reason why we have to switch contour is that $e^{iz}$ blows up. But I really can not see why or how it blows up.   Take the canonical example for why this theorem is useful  $$   J = \int_{-\infty}^\infty \frac{e^{iz}}{z^2+1} $$    Now the clue here is to show that the integral along the curve tends to zero, and then use the residue theorem. To show that the integral tends to zero I did this \begin{align*}  \left| \int_{C_1} \frac{e^{iz}}{1+z^2} \,\mathrm{d}z\right|  \leq \int_{C_1} \left| \frac{e^{iz}}{1+z^2} \right| \,\mathrm{d}z   \leq \sup_{z = R e^{i \theta}} \left( \frac{1}{\left|1+z^2\right|} \right)       \int_{C_1} |e^{iz}| \,\mathrm{d}z \end{align*} where the $ML$-inequality was used in the last inequality  On the circle with radius $R$ we have $|e^{iz}|=R$, and we can use the inequality $|a+b|\leq|a|-|b|$ to simplify further \begin{align*}  \left|\int_{D_R} \frac{e^{iz}}{1+z^2}\,\mathrm{d}z \right|  \leq \sup_{z = R e^{i \theta}} \left( \frac{1}{|z|^2-1}\right)  \int_{D_R} R \,\mathrm{d}z  \leq \pi \frac{R}{R^2-1} \end{align*} which tends to zero as $R \to \infty$ as wanted. but if one instead had $e^{-iz}$ then the theorem states that one has to use the lower half plane. But I do not see where my calculations err if one persists in using the contour in the upper half plane? What goes wrong, and why does it go wrong? $|e^{-iz}|$ should still be $R$ on the semi-circle.   How can one formally show that the integral diverges when picking the contour as a semi circle in the lower half plane? During this travel ban (COVID) can my wife come visit me in the USA? I know I can visit there but not sure about her coming here I would like to typeset the top part of Pascal's triangle. To get the triangle with the names of the binomial coefficients, i.e., {n \choose k}, I used the following code  \begin{tikzpicture} \foreach \n in {0,...,4} {   \foreach \k in {0,...,\n} {     \node at (\k-\n/2,-\n) {${\n \choose \k}$};   } } \end{tikzpicture}   The result is this   Now I want to be equally lazy and do something like this for the values of the binomial coefficients, i.e., replace {\n \choose \k} in the node label with \CalculateBinomialCoefficient{\n}{\k} where \CalculateBinomialCoefficient is a hypothetical macro that calculates the binomial coefficient. Has anyone done something like that?  The result should look like this: I'm trying to solve    So far I've done the first part, evaluating the summation ;  where a is just n. I'm not sure where to go from here or what it even means deduce the second summation. I understand that the summation of simply $$\sum\limits_{k=0}^n\cos(kx)$$ is derived from looking at the real part of  $$\sum_{k=0}^n{\rm e}^{ikx} $$I'm guessing they want me to see how the second summation in the question is defined by 'playing around' with the original? Bad Character code (256)/ \select@language{greek} How can I wrap text around a bottom-right div? I'm writing up my dissertation and I'm really confused where to use "the". Examples:     In this experiment, (the?) heat transfer coefficient was calculated, allowing to estimate (the?)frost thickness.    And:     Firstly, (the?) air properties are defined.   And:     As (the?) crystals grow in radius, the amount of air in (the?) ice is reduced, due to (the?) ice becoming more packed.   None of the nouns mentioned above have been used for the first time, so I rule out the use of "a".   Would appreciate any help. What is $P(X > 0 \mid X + Y > 0)$ given that $X, Y$ are i.i.d standard normal? Find the volume of the tetrahedron with the vertices $P(1,1,1)$, $Q(1, 2, 3)$, $R(3, 1, 2)$, and $S(2, 3, 1)$. Is it possible to run some code when an assembly is loaded, without doing anything specific in the loading code? What I am looking for is like a static constructor on a type.  Eg:  Assembly A does not know about Assembly B, but B does know about A. Assembly A needs to know certain things about B if B is loaded. When Assembly B is loaded by the runtime (referenced, or explicit), I want a piece of code (static method or attribute) to be executed that calls a method in Assembly A.  The root cause of this problem is unknown types being encountered when serializing a type in A that contains types from B not known at compile time as interfaces are used. Let $\mathbb{R^{ n×n}}$ be the space of n × n real matrices. Show that if $ A(t) \in \mathbb{R ^{n×n}}$ is a differentiable function of $t$ then $\frac{d(det A(t))}{dt}$ is the sum of the determinants of $n$ matrices, in which the $i$th matrix is $A(t)$ except that the $i$th row is differentiated. Use this result to prove that the directional derivative of the determinant function at the matrix $A \in \mathbb{R ^{n×n}}$ along the direction $B \in \mathbb{R^{ n×n}}$ is given by $$(det)^{'} (A; B) = tr(Adj(A)B) = \langle Adj(A)^{T} , B \rangle $$ where $Adj(A)$ is the adjoint of $A$, and where the inner product on $\mathbb{R^{n×n}}$ is the trace inner product given by $\langle X, Y \rangle = tr(X^{T} Y )$ Conclude that $$D(det)(A) = Adj(A) ^T $$. I will try to be as explanatory as possible with my question. Please also note that I have done my share of googling and I am looking for simple language preferable with some example so that I can get some insight in this subject.  My question is what is so special about $c$? Why only $c$. Its like chicken and egg puzzle for me. Does Einstein reached to $c$ observing light or does he got to light using some number which turned out equal to $c$.   Why is $c$ not relative. If something has zero rest mass like a photon why they only travel at $c$ in vacuum and not with $c+1$ or $c-1$? In many countries an application for a PhD position includes a written research proposal, so my questions is what are some advises/strategies to come up with a good topic/idea for a PhD research proposal and how can one assess the quality/fruitfulness of an idea? As an undergraduate student one just doesn't have the experience to foresee which ideas might have promising research results and which probably won't have. (And I doubt that potential supervisors have the time to comment on every idea of every potential applicant in cases where it is possible to establish some kind of contact before the actual application.) What does: Error Broken count >0 mean? I had posted a  last week about customizing a ToolValidator class and got some very good answers.  In working with the proposed solutions, I have created a custom module that performs queries on a db, and will be called by both the ToolValidator class (to provide values for the drop-down lists) and later in the geoprocessing script (to get other parameters based on items selected in drop-down lists).  However, I can't seem to actually call the custom module in the ToolValidator class.  I have been trying to append to path with no luck.  When I try to apply these changes to the script, I get a runtime error:  [Errno 9] Bad file descriptor.  If I comment out import line, no errors.  sys.path.append('my_custom_module_directory') import my_custom_module   Many of you may be asking why don't I just implement a custom tool with ArcObjects.  The reason is that my end users don't have the privleges necessary to register ANY dlls on their computer.  UPDATE:  This was happening to me in ArcGIS 10.  Interestingly enough, I was initially appending to the path inside of the initialiazeParameters function of the ToolValidator class.  If I do the append outside (i.e., on top of) of the ToolValidator class, everything works as expected.  sys.path.append('C:/Working/SomeFolder') import somescript --------&gt;THIS WORKS  class ToolValidator:   """Class for validating a tool's parameter values and controlling   the behavior of the tool's dialog."""    def __init__(self):     """Setup arcpy and the list of tool parameters."""     import arcpy     sys.path.append('C:/Working/SomeFolder')     import somescript -------&gt; THIS DOESNT WORK     self.params = arcpy.GetParameterInfo()   UPDATE 2:  I think I found the true cause of my problem.  In the code snippets in this post, I have been appending what appear to be real paths (ex C:/Working/SomeFolder) to the sys.path.  In my actual ToolValidator class, I was constructing a relative path using os.path.dirname(__file__) +"\my_special_folder...".  I was anticipating that os.path.dirname(__file__) would return the path of the toolbox, since that contains the ToolValidator class.  I have come to find this is not the case.  As far as I can tell, the ToolValidator class is never actually written to a .py file, and I speculate the the this code is passed to the python interpreter in memory, so __file__ is useless, or some temp script is persisted and then execfile(path_to_script) is called, again rendering __file__ useless.  I'm sure there are other reasons I am missing as well.    Long story short, if I use a hardcoded path, the sys.append works anywhere, relative paths don't work so well in the ToolValidator class. Flash/SWF Editor For Ubuntu 12.10 primes whose difference is a multiple of $n$ Hello everyone this is my first question here so if there are any suggested edits  feel free to participate! Is it true that for every $n$ there two prime numbers $p$ and $q$ with $n\mid p-q$? I have verified this empirically but  am not sure if there is a proof for this example of not surjective isometry on a bounded not closed set. Is there an example of a bounded not closed set $A\subset \mathbb R^n$ for some $n\in \mathbb N$ and an isometry $f:A\rightarrow A$ ($\forall x,y\in A\space;\space d(x,y)=d(f(x),f(y))$ where $d$ is the euclidean metric) such that $f$ isn't surjective? How do you reset the sa password? How do I copy Word tables into Excel without splitting cells into multiple rows? I have data in a Word table that includes line and paragraph breaks. When I copy the data into Excel, it splits each line and paragraph I want into multiple cells. How do I copy the data to Excel and keep the breaks?