Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Topic: Generate data based on specified distribution
Replies: 0

 Merciadri Luca Posts: 76 Registered: 8/29/09
Generate data based on specified distribution
Posted: Sep 9, 2013 2:27 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I've seen the page http://www.mathworks.nl/help/stats/random.html which
tells you briefly how to generate random numbers based on a
distribution.

The problem is that my distribution is not a predefined
distribution. I've got a discrete distribution of probabilities and I
want MATLAB to generate data based on this distribution.

Let's be more specific. I've got a 4-dimensional matrix beta. For
example, its (i,t,j,g) element is defined as (i,t,j,g), where i is in I,
t in T, j in J and g in G. I want to generate, through MATLAB, I*T
matrices of dimension J*G. Values in these matrices are between 0 and,
say, 5. I've got a probability table B, of dimensions T*6.

Each element of the matrices (they are, as said before, of dimension
J*G) should be determined according to B. For each t in T, B's t'th line
contains, at column k (0 <= k <= 5), the probability of drawing k being
given time period t.

Thus, values should not be totally random, but should be found based on
this probability table. That is, there are e.g. more chances to get a 5
when t=1 than when t=0.

Being given an `infinite' number of samples drawn, say, at t=2, the
probability of getting e.g. k=1 should converge to 0.4.

How can I implement this?

Thanks.
- --
- --

Don't try to teach a pig to sing. It doesn't work, and you'll annoy
the pig.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAlIuExAACgkQM0LLzLt8MhyzGgCfTODmW3Ue1MnQiClaZX6SDpEk
384AnjRhSZvf9UMVf/yy0IqkzQs5QAAy
=u0NE
-----END PGP SIGNATURE-----