text_combined: baptiste auguie ba208exeteracuk comments maybe problem clear looked specific ill add bare bones example simulate discussion x seq110length1000 setseed11 get randomness jittersinxa 02 values dataframex x findzero function guess neighbors values smooth smoothsplinevaluesx valuesy obj functionx predictsmooth xy 2 minimum whichminabsvaluesx guess optimizeobj interval cvaluesxminimum neighbors valuesxminimum neighbors uniroot could used instead suppose test findzeroguess 6 neigh 50 values values plotxy ablineh0 ablinevtestminimum colred would like find n3 roots without priori knowledge location interval considered several approaches 1 find numerical values initial data close zero given threshold group values n sets using cut hist maybe could never get work factors given cut confuse couldnt extract value apply function given guess given center mass different groups zeros 2 apply findzero store result add something big 1e10 neighboring points look zero repeat procedure n found work assume perturb minimization problem way want 3 zero found look zeros sides etc quickly makes complicated decision tree number zeros grows could find clean way implement thoughts welcome feel like ive overlooked obvious trick many thanks baptiste 7 aug 2008 1149 baptiste auguie wrote dear list ive problem im looking general robust technique ive able imagine need find n typically n 3 5 zeros function polynomial specified interval code illustrates creating noisy curve three peaks different position magnitude width asymmetry x seq1 10 length500 examplefunction functionx create data peaks different scaling widths noise fano function p x y0 p1 a1 absp2 w1 absp3 x01 p4 q p5 b1 2 a1pi q w1 x x0124 x x012 w12 y0 b1 p1 c01 1 1 5 1 p2 c05 07 02 4 1 p3 c0 05 3 12 1 fanop1 x fanop2 x fanop3 x jittery a0005maxy examplefunctionx sampledf dataframex x withsampledf plotx tl three peaks located around x2 4 5 yspl smoothsplinex smooth noise linesyspl colred wish obtain zeros first second derivatives smoothed spline yspl use uniroot optim find one root find reliable way iterate find desired number solutions 3 peaks 2 inflexion points side ive used locator guesstimate disjoints intervals look solutions would like get rid unnecessary user input robust way finding predefined number solutions total interval something along lines findzeros function f numberofzeros 3 exclusioninterval c01 02 01 number solutions found less numberofzeros search root f union intervals excluding neighborhood solutions already found exclusioninterval could apply procedure first second derivatives yspl could also useful function many thanks remark suggestion baptiste _____________________________ baptiste auguié school physics university exeter stocker road exeter devon ex4 4ql uk phone 44 1392 264187 httpnewtonexacukresearchemag ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code fri 08 aug 2008 144929 0100 r recursive root finding