On Thu, Mar 6, 2014 at 12:21 AM, Laurens Van Houtven <_...@lvh.cc> wrote:

>
> Yep. A big part of the issue is that the *real* function that maps grant
> fraction to probability of coming is of course unknowable. A linear
> approximation is an excellent start. Once I have some test data I'll be
> able to tell for sure, but I imagine a closer approximation might look more
> like x**2 than x over [0, 1] (e.g. when I give someone 50% of their grant,
> the odds they'll come are closer to 25% than to 50%). Are Choco/Loco
> limited to linear programming?
>

No, it doesn't have to be linear.

Let's say the probability p = (allocated/requested)^2 for a given person.
So we're trying to maximize the sum of score*p.

Let's reorganize score*p to isolate the variable we're solving for from the
known quantities:

score*p = score*(allocated/requested)^2 = allocated * allocated *
(score/(requested^2))

The score and the requested amount are known in advance for a given person,
so in the sample code I provided, the precomputed "grant-value" would no
longer be based on score/requested, but score/(requested^2).

Then when solving for the allocations, you instead maximize:

 (apply $+ (map $* (map $* allocation-vars allocation-vars) grant-values))

Those are the only changes you need to make for it to be based on quadratic
versus linear.

Here is the revised code, also incorporating the dynamic scaling suggestion
I put in the comments of the other gist:
https://gist.github.com/Engelberg/9385992

It definitely makes a difference for the toy example given in the problem.

In both versions, it allocates $120 to Alex (guaranteeing the highest
scored person).
In the linear version, it gives the $80 to David (choosing the 4/5
probability of getting a 4 [an expected value of 16/5], over a certainty of
getting a 3, since 16/5>3)
In the non-linear version, it gives the $80 to Mark (guaranteeing a person
worth 3, rather than a 16/25 probability of getting a 4).

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to