How to allocate unequal probability?

Archive of Gamsworld Google Group
Post Reply
Lucas
User
User
Posts: 23
Joined: 4 years ago

How to allocate unequal probability?

Post by Lucas »

Hi all,

I want to allocate the probability of 1000 scenarios. (|S|=1000). And I don't want all these possibilities to be considered equal. (not to be; P(s)=0.001 for all s).
How can I allocate an unequal probability? I mean we have:
sum(s,p(s))=1 and for all s,s': s<>s' ; we don't have p(s)=p(s').

Do we have a specific command for this?

Thanks a lot
User avatar
dirkse
Moderator
Moderator
Posts: 214
Joined: 7 years ago
Location: Fairfax, VA

Re: How to allocate unequal probability?

Post by dirkse »

Lucas,

There are two ways to view your question:

1. You want a guarantee that s <> t implies p(s) <> p(t).
2. You want to avoid the constant distribution, i.e. p(S) = 1 / card(S).

If you mean the first, I can't really help. If you sample a continuous GAMS distribution like uniform(0,1) I would be surprised if you get duplicates very quickly or very often but I don't have a guarantee at hand.

If you mean the second, do this (untested):

set s / 1 * 1000 /;
scalar tot;
parameter p(s);
execseed = 1 + gmillisec(jnow);
p(s) = uniform(0,1);
tot = sum{s, p(s)};
p(s) = p(s) / tot;

-Steve
Lucas
User
User
Posts: 23
Joined: 4 years ago

Re: How to allocate unequal probability?

Post by Lucas »

Dear Steve :D

Thanks a lot!
Post Reply