[SciPy-user] Re: optimize.leastsq -> fjac and the covariance redux

Brendan Simons brendansimons at yahoo.ca
Mon Mar 14 14:32:39 CST 2005


Aha!  Great job.

I do want to learn CVS at some point, but it's
probably not worth the effort to get me developer
access, especially as my implementation would probably
not the most efficient. 

If you're willing to implement the Covariance output
yourself, please send me a note when it's committed.

Thanks again for your help.
  -Brendan

--- Travis Oliphant <oliphant at ee.byu.edu> wrote:
> Brendan Simons wrote:
> 
> Thanks for the example script.
> 
> I think I've got it worked out.
> 
> The only problem with the script is that fjac is in
> "column-order"  i.e. 
> Fortran order.  So, really what we have provided is
> r.T  
> 
> Note that there are several q-r factorizations for a
> given matrix, so 
> comparing r is not useful. 
> 
> If you change this line:
> 
> r = mat(MLab.triu(fjac[:,:n]))
> 
> to this:
> 
> r = mat(MLab.triu(transpose(fjac)[:n,:]))
> 
> the results match up !!!
> 
> With the change, I get
> 
> C
> Matrix([[ 0.821428641610194, -0.589285827415852, 
> 0.089285739190248],
>        [-0.589285827415852,  0.726785855320911,
> -0.133928600229779],
>        [ 0.089285739190248, -0.133928600229779, 
> 0.026785719996822]])
> 
> C_true
> [[ 0.821428571428571 -0.589285714285714 
> 0.089285714285714]
>  [-0.589285714285714  0.726785714285714
> -0.133928571428571]
>  [ 0.089285714285714 -0.133928571428571 
> 0.026785714285714]]
> 
> C_true2
> [[ 0.82142857142857  -0.589285714285713 
> 0.089285714285714]
>  [-0.589285714285714  0.726785714285714
> -0.133928571428571]
>  [ 0.089285714285714 -0.133928571428571 
> 0.026785714285714]]
> 
> 
> This is great.  I'll see if I can't put in a new
> optional output for 
> leastsq that makes use of this.
> 
> If you'd like to do it, then that would be great
> too.    It is easy to 
> commit to CVS once you have developer access.  If
> you are interested 
> then I could get you set up.
> 
> You would need to check out a "logged-in" version of
> the CVS tree and 
> then committing is as easy as
> 
> cvs commit -m "Some comments"
> 
> 
> Thanks for your help.
> 
> -Travis
> 
> 

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca



More information about the SciPy-user mailing list