pgrochola Posted August 9, 2015 Share Posted August 9, 2015 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 ect.. 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 ect.. 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 ect.. 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.. Thx! mathProb.hiplc Quote Link to comment Share on other sites More sharing options...
anim Posted August 9, 2015 Share Posted August 9, 2015 (edited) 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 mathProb_fix.hiplc Edited August 9, 2015 by anim Quote Link to comment Share on other sites More sharing options...
pgrochola Posted August 10, 2015 Author Share Posted August 10, 2015 thx Anim! Hadn't thought to do that and it helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.