Jump to content
Sign in to follow this  

weighted normalized distribution (math challenge)

Recommended Posts

Hey smart people,


Im not sure if the topic title describes my problem very well but,...


I have a math problem that's been holding me up.

Maybe someone out there can help.


Say I have a bunch of points with normalized values

sorted by highest to lowest like...


@ptnum      @value

0                 .9

1                 .4

2                 .3

3                 .01



How do I now remap "value" for each point so that the total adds up to one?

BUT this new distributed remapped value is weighted by the original value.



The obvious thing to do would be: (@value/sum of @value) but the result is:



@ptnum      @value             @simple normalized

0                  .9                      .55

1                  .4                      .24

2                  .3                      .186

3                  .01                    .00621



This kind of remapping is not ideal because  point 0 is has a very high value which gets lost.

In the case above I could keep point 0 at .9 the distribute the remaining .1 across the rest of the points.

Which I know how to do but what happens when you have a case like:



@ptnum      @value           

0                  .6                      

1                  .58                    

2                  .52                   

3                  .1    

4                  .1             



In this case I would need to average the first three points then distribute the remainder across the rest of the points.

Is there a really smart solution out there that doesnt involve setting up test conditions then adapting the code?


I've attached a hip file that demonstrated the problem..






Share this post

Link to post
Share on other sites

if you are not happy with linear weight normalization, you can always power the original values to high exponent to pronounce differences and normalize afterwards


Edited by anim

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this