comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » faster minimization needed - maybe mpfit?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: faster minimization needed - maybe mpfit? [message #79727 is a reply to message #79653] Tue, 27 March 2012 05:28 Go to previous messageGo to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
Hi Craig,
sorry I made several typos. I would also be satisfied with a least
squares solution as you can see if you compare function test2 with the
previous posts. The function I want to minimize is test2. It doesnt
matter for me at this stage whether total(abs(resid)) or
total(resid^2) is minimized.

function test2,p,xval=x,errval=err
resid=convol(x-rebin(p[*],size(x,/dim)),[-1.,0.,1.])
return,total(resid^2)
end

ENVI> help,im
IM INT = Array[512, 7237]
ENVI> sz=size(im,/dim)
ENVI> im2=im+fix(1000.*rebin((((add=randomn(seed,sz[0])))-mean(add ))/
stddev(add),sz))
ENVI> help,im2
IM2 INT = Array[512, 7237]
ENVI> p0=((p0=total(im2,2)/float(sz[1])))-smooth(p0,3,/edge_trunc)
ENVI> help,p0
P0 FLOAT = Array[512]
ENVI> st={x:im2,errval:sqrt(p0)}
&res=mpfit('test2',p0,functargs=st,maxiter=100,status=st atus,errmsg=errmsg)
&print,status,string(10b),errmsg
0
ERROR: number of parameters must not exceed data


THANKS in advance

CR
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Cellular automata
Next Topic: IDL and PV wave language free

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 06:12:51 PDT 2025

Total time taken to generate the page: 0.08578 seconds