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: Przemek Klosowski
Subject: Re: finding approximate 'least common factor'
Date: Thu, 26 May 2011 17:52:29 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10

On 05/26/2011 05:26 PM, Jordi Gutiérrez Hermoso wrote:
On 24 May 2011 10:41, Przemek Klosowski<address@hidden>  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 ]
[snip]
Can anyone think of a more precise numerical algorithm?

The subject of this thread should be about greatest, not least common
factor, right?

Right, sorry.

So it's a problem about finding the relative mininum of the following
objective functions:

      f = @(x) norm(fmod(bsxfun(@rdivide, a(:), x(:)'),1),"columns");

i.e. looking at the x that minimises the norm of the fractional part
of the vector a divided by a proposed quantum x.

Yes, but this looks separately at each multiple---i.e. dips at 600 give a tiny minimum, and dips at 1200 also give a tiny mininum, but together they signify a better agreement that each of them separately would indicate. My original method kind-of took that into account, actually.

      gcd(num2cell(a){:})

let's not forget  0, and 1.  :)


reply via email to

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