| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168733Image: ubuntu2004
File: /home/pete/bin/sage-5.0/local/lib/python2.7/site-packages/scipy/optimize/nnls.py
Type: <type ‘function’>
Definition: nnls(A, b)
Docstring:
Solve argmin_x || Ax - b ||_2 for x>=0.
- A : ndarray
- Matrix A as shown above.
- b : ndarray
- Right-hand side vector.
- x : ndarray
- Solution vector.
- rnorm : float
- The residual, || Ax-b ||_2.
This is a wrapper for NNLS.F.
Plot up our Endmembers
Now to Unmix
Make a sumulated pixel refelctance
[-0.1 0.3 0.9]
(array([ 0. , 0.32751853, 0.85135712]), 5.2579330023415265)
[-0.1 0.3 0.6]
[ 0. 0.32751853 0.55135712]
[ 0.3 0.3 0.6]
[ 0.3 0.3 0.6]
Weighting Example
[[ 15.16388709 66.81481205 85.84328969]
[ 8.11539187 75.71889195 117.31059236]
[ 78.72301204 68.19003156 120.38751132]
[ 41.42404339 94.27057946 124.4524361 ]
[ 12.39576191 33.45513443 82.59387353]
[ 35. 35. 35. ]]
[ 0.25303764 0.21470612 0.66662582]
[ 0.25303764 0.21470612 0.66662582]
[[ 15.16388709 66.81481205 85.84328969]
[ 8.11539187 75.71889195 117.31059236]
[ 78.72301204 68.19003156 120.38751132]
[ 41.42404339 94.27057946 124.4524361 ]
[ 12.39576191 33.45513443 82.59387353]
[ 35. 35. 35. ]]
[-0.12348118 0.25735306 0.93331291]
[ 0. 0.24807895 0.89941565]