back to list

Re: [harmonic_entropy] Digest Number 51

🔗Robert Walker <robert_walker@...>

1/31/2001 7:24:17 AM

Hi Paul,

> That's where my knowledge falls short. I program in Matlab, and I don't have
> the Matlab compiler (costs a thousand or two).
>
> Great idea, though! Actually, if you want to volunteer, I can step you
> through the details of the calculation, verify that you get the same results
> as me for some simple case, and then we're off!

Depends how complex the calc. is - if it is one I can program quickly, then fine.
The shell to run it is a matter of moments to do.

Or else, I could give it a go some time later if I have time.

Why not give a short overview of it, and I'll see what i think
about how easy it will be to do. May also see some computational
shortcuts too, you never know - I quite enjoy optimising computations.

Then again, if I don't have time to do it, and anyone else wants to have
a go at writing it in c, I can easily provide the shell.

It would run in a separate thread, and it just needs to check for a
global variable , bAction (say) frequently, like a fraction of a second between
checks.

If it ever changes to 1, save data to disk and return (shell is about to exit).

Also save every few minutes. (Or if you prefer, if it changes to 2, save and reset to 0,
and shell can set it to 2 every minute.)

Use a global szProgLocPath for location of file to save the data
to / read from at start up.

That's about it.

Robert

🔗Paul H. Erlich <PERLICH@...>

1/31/2001 1:18:39 PM

Robert Walker wrote,

>Why not give a short overview of it, and I'll see what i think
>about how easy it will be to do. May also see some computational
>shortcuts too, you never know - I quite enjoy optimising computations.

OK. For the dyadic case, first you calculate all the ratios such that the
product does not exceed a certain limit. Then either:

(a) calculate the mediants between the adjacent ratios, and assign each of
the original ratios a "width" according to the distance between the mediants

(b) assign a "width" to each ratio based on an approximate formula (this
approach will have to be used for the triadic case since no one has figured
out how to generalize mediants to 2-d).

Now, for the interval in question (often, every cents value from 0 to 2400),
construct a bell curve centered around that interval and with the particular
standard deviation you've assumed. Assign a probability to each of the
original set of ratios: the probability is proportional to the product of
the ratio's "width" times the height of the bell curve at that ratio.
Finally, calculate the following sum over all the probabilities p:

entropy = -sum(p*log(p))

Does this make sense? If so, I'll proceed to explain the triadic case (which
is virtually identical in concept).

🔗genewardsmith@...

9/6/2001 4:02:47 PM

--- In harmonic_entropy@y..., "Paul H. Erlich" <PERLICH@A...> wrote:

> (b) assign a "width" to each ratio based on an approximate formula
(this
> approach will have to be used for the triadic case since no one has
figured
> out how to generalize mediants to 2-d).

The usual generalization of the mediant gives the mediant of p1/q1,
p2/q2, and p3/q3 as (p1+p2+p3)/(q1+q2+q3). So for 1/1, 5/4, 3/2 we
would get 9/7, for 1/1, 6/5, 3/2 we have 5/4 and 1/1, 4/3, 5/3 gives
us 10/7, and so forth. Does this help?

> Now, for the interval in question (often, every cents value from 0
to 2400),
> construct a bell curve centered around that interval and with the
particular
> standard deviation you've assumed.

Why a bell curve? It seems to me something compactly supported (ie
with nonzero values only inside a certain range) would make more
sense.

🔗Paul H. Erlich <PERLICH@...>

9/7/2001 11:18:59 AM

>The usual generalization of the mediant gives the mediant of p1/q1,
>p2/q2, and p3/q3 as (p1+p2+p3)/(q1+q2+q3). So for 1/1, 5/4, 3/2 we
>would get 9/7, for 1/1, 6/5, 3/2 we have 5/4 and 1/1, 4/3, 5/3 gives
>us 10/7, and so forth. Does this help?

No. We need to divide the 2-D plane into mutually exclusive, exhaustive set
of sub-regions. See the link in the "Eureka" post for more. But I think this
will be unnecessary anyway, since approach (b) should work.

>> Now, for the interval in question (often, every cents value from 0
to 2400),
>> construct a bell curve centered around that interval and with the
particular
>> standard deviation you've assumed.

>Why a bell curve? It seems to me something compactly supported (ie
>with nonzero values only inside a certain range) would make more
>sense.

Why? I don't mind assuming a 1% probability that a 3-standard deviation
error will be made. I see the bell curve as the distribution that makes the
fewest assumptions (just the standard deviation needs to be specified). Of
course we're free to calculate variants using other curves.