help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finding approximate 'least common factor'


From: Thomas Shores
Subject: Re: finding approximate 'least common factor'
Date: Wed, 25 May 2011 11:46:30 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

On 05/24/2011 10:41 AM, Przemek Klosowski wrote:
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

It might help to have a little more information about the data, the nature of the error distribution, and what you intend to find. For example, is the basic quantum an integer? If so, this is a discrete problem which may not lend itself easily to continuous methods or models (e.g., classical linear programming vs integer programming). Also, if you believe ~650 to be an approximate quantum, this means that there is nearly 50% error in your last two data points, which is pretty extreme. Could error in other points be comparable? And finally, I think you may mean an approximate "greatest common divisor" since, after all, glancing at the data gives a perfectly accurate quantum of 50.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]