Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5928 > unrolled thread

Re: Overdetermined Matrix Equation Subject to Constraints

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-10-27 10:32 +0000
Last post2011-10-27 10:32 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Overdetermined Matrix Equation Subject to Constraints DrMajorBob <btreat1@austin.rr.com> - 2011-10-27 10:32 +0000

#5928 — Re: Overdetermined Matrix Equation Subject to Constraints

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-10-27 10:32 +0000
SubjectRe: Overdetermined Matrix Equation Subject to Constraints
Message-ID<j8bc0m$8mr$1@smc.vnet.net>
Minimize[{referenceData.{x, y} - testData // Norm,
     x >= 0 && y >= 0}, {x, y}]

{0.402716, {x -> 0.499807, y -> 5.8375*10^-10}}

Bobby

On Wed, 26 Oct 2011 16:38:36 -0500, Meaghan <freecaptive6914@gmail.com>
wrote:

> Hi all,
>
> I have an overdetermined matrix equation that I have been solving with
> LeastSquares[].  However, LeastSquares[] gives me solutions that don't
> fit my constraints (that all components of x >= 0).
> I know that Minimize[] and NMinimize[] minimize equations subject to
> constraints, but I cannot determine if they will minimize a *matrix*
> equation.
> Any ideas?
>
> Here is some sample code:
>
> referenceData = {{1.022299535`, 1.01884186`}, {0.15627907`,
>     0.716793488`}, {0.014162791`, 0.087627628`}};
> testData = {0.546942055`, -0.126062557`, -0.338173002`};
> Print["LeastSquares soln: ", LeastSquares[referenceData, testData]];
>
> unknown = {x, y};
> Print["Minimize soln: ",
>   Minimize[{referenceData.unknown - testData,
>     unknown[[1]] >= 0 && unknown[[2]] >= 0}, unknown]];
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web