ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 21 Oct 2013 13:03:37 -0500How quickly minimizing $M*x-v$ (numerically) ?http://ask.sagemath.org/question/10643/how-quickly-minimizing-mx-v-numerically/Let $v$ in $R^m$ and let $M$ be a matrix from $R^n$ to $R^m$, with $m>n$ big numbers.
I want to compute a vector $x$ in $R^n$ such that the norm of $M*x-v$ is minimal.
One way is to compute the projection $w$ of $v$ on the image of $M$.
For so, we can compute the projection $p$ on the image of $M$, as follows :
MTGS=M.transpose().gram_schmidt()[0] # it's orthogonalization, not orthonormalization
l=MTGS.rank()
U=[]
for i in range(l):
v=MTGS[i]
u=v/(v.norm())
L=list(u)
U.append(L)
N=matrix(m,l,U)
p=N.transpose()*N
Then:
w=p*v
x=M.solve_right(w)
This vector $x$ minimizes the norm of $M*x-v$, but this method is very expensive in time, because it computes $p$ and $w$, while I just need $x$.
> Is there another method, less expensive in time, for computing $x$ ?
**Remark** : I'm ok with numerical methods.
Sébastien PalcouxMon, 21 Oct 2013 13:03:37 -0500http://ask.sagemath.org/question/10643/Viewing Stereographic Projection of an Imagehttp://ask.sagemath.org/question/8824/viewing-stereographic-projection-of-an-image/I'm trying to write a program that takes an image and projects it onto a sphere that I can then view using 3dplot. I'm using pylab to read the image, numpy to put it into an array and then a stereographic projection to actually project it onto a sphere. I'm fairly certain the program is working correctly.
The problem I have is that 3dplot is not letting me view an image. The plot doesn't load. I tried the tachyon viewer, and I could get an image of my picture on a sphere, but I would prefer if I had the ability to rotate the sphere that 3dplot provides. Is there a better way to accomplish what I'm trying other than using pylab? I don't know much about other python imaging systems.
SeikishiSat, 24 Mar 2012 12:15:43 -0500http://ask.sagemath.org/question/8824/