## How to allocate unequal probability?

Lucas
User Posts: 23
Joined: 1 year ago

### How to allocate unequal probability?

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

dirkse
Moderator Posts: 126
Joined: 3 years ago
Location: Fairfax, VA

### Re: How to allocate unequal probability?

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 Posts: 23
Joined: 1 year ago

### Re: How to allocate unequal probability?

Dear Steve Thanks a lot!