Thank you to Prof Brian Ripley and to Ken Knoblauch for your fast replies. I should explain a little bit more about the problem at hand: in principle, the matrix can have more rows than columns or the other way around. However, I always could include in an artificial way more equations, such that there are more equations than unknowns. So, in practical terms, the answer to the first question from Prof Brian Ripley is: more equations than unkowns.
I have checked in the "Modern Applied Statistics with S" 4th edition, and in page 62 it is shown the use of svd. It is written that svd gives, as result, u, v and d. If there is a space of solutions (as opposed to a unique solution) how is the solution given? how can I retrieve the whole space of solutions? Additionally, I have seen in several places that is suggested to use La.svd instead of the standard svd. Would the La.svd generate also the whole space of solutions? I have looked the documentation (http://cran.r-project.org/doc/packages/RScaLAPACK.pdf) but it is not explicitly written how to retrieve non-unique solutions. An additional question: in the Numerical Recipes for C++ it is written that the "small" numbers in the diagonal of d should be set manually to 0. Is this done (maybe as an option) in svd or in La.svd? could this resetting have a material effect in the solutions found? thank you J -----Original Message----- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 27 July 2004 10:13 To: Molins, Jordi Cc: '[EMAIL PROTECTED]' Subject: Re: [R] SVD with positivity constraints If A is not square, which dimension is larger? There will most likely be either no solution or an infinity of solutions. If the latter, I think you are using the Moore-Penrose inverse (depends exactly how you use the SVD), that is the shortest solution, but the SVD will give you the whole space of solutions and you could compute if that intersects the positive orthant. On Tue, 27 Jul 2004, Molins, Jordi wrote: > I have a matrix equation, Ax=b, that I need to solve for x. x should be a > vector of positive numbers (between 0 and 1). A is not a square matrix in > general. This lead me to using the SVD. However, using the SVD gives me > positive and negative numbers, as well. I have some constraints included in > the A matrix itself (i.e., that the sum of some xi should be equal to 1) but > I do not know how to include the constraint that each xi should be > non-negative. > > Is there in R (or somewhere else) an SVD that includes this kind of > constraint? or some other optimizer that can cope with solving non-square > matrix equations, including the positivity constraint? optim(method="L-BFGS-B") can cope with [0, 1] constraints. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 -------------------------------------------------------------------------------- The information contained herein is confidential and is inte...{{dropped}} ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
