Distribution fitting I'd like to fit a distribution (any you like) based on these requirements:


*

*Produces integer values (preferable but not required)

*Mean =100

*Std=114

*Quantiles( 25%, 50%, 75%)=(6,39,200)

*Min=0; Max=~300 (but $\infty$ is acceptable);


Poisson fits criteria 1,2 and nearly 3, but not 4 by far. Lognormal... maybe
EXTRA info: value 0 is produced 8% of the time and 300 is produced 18%.
Is it possible to do something like this?  Or do we need more information?
 A: Here's a function to get you started.
function y = weirdrand()

r = rand;
if r < 0.08
    y = 0;
elseif r < 0.25
    y = randsample(1:6, 1);
elseif r < 0.5
    y = randsample(7:39, 1);
elseif r < 0.75
    y = randsample(40:200, 1);
elseif r < 0.82
    y = randsample(201:299, 1);
else
    y = 300;
end

end

This obeys rules 1, 4, 5 and the extra info.  randsample (from the Stats toolbox) returns one its inputs with equal probability.
Vectorisation is left as an exercise for the reader.  In the meantime, 
y = arrayfun(@(x) weirdrand(), 1:1e4)
mean(y) %typically around 107
std(y)  %typically around 115

A: (this is actually the same as Xi'an's comment, but I responded independently of him on math.stackexchange.com)
It's certainly possible, but you have more unknowns (301) than constraints (9), which means that you'll have a lot of freedom. One way of restricting that freedom is to use the maximum entropy principle. It will give you the most likely distribution under the constraints.
What you do is maximize $-\sum_i p_i \ln p_i$ under the constraints you have given and where the $p_i$ are the probabilities of all discrete events $i=0,\ldots,300$. You'd best do this numerically.
