I have numbers which are approximately (but not exactly) an integer
number of some basic quantity. How would you estimate that basic
quantum? For instance, if the data is:
a= [5500 3800 3300 3800 4000 5500 2600 3800 5500 2500 4000 6000 4000
450 1550 1000 3800 5300 5300 1800 3800 1550 2500 3300 1300 2500 3300
2500 1550 5500 2200 3500 3300 2200 1300 800 2200 1000 2500 5300 3000
2200 2200 2200 4000 2400 2200 5500 4000 800 2200 2600 450 450 ]
All I could come up with is to look at all the candidates (s) and plot
the sum of squares (d) of the integer quotient residuals (c) against
the value of the candidates:
s=50:50:2400; for i=1:length(s); c=a./s(i); d(i)=sumsq(c-round(c)); end
plot(s,d)
the minima on this plot show values that fit in mostly integer
multiples into the numbers in a(), so I am eyeballing the underlying
quantum to be 650---but this is very qualitative.
Can anyone think of a more precise numerical algorithm?
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave