How can I generate controlled sequences in matlab?

1 次查看(过去 30 天)
For example I have numbers 1 to 8.
The 4 occurres more frequently after a 3. However this can be consecutive 3 4 or non consecutive 3 1 5 6 4. I have few more constraints concerning order as the example above. How can I generate sequences taking them to account.
Thanks
  2 个评论
Ced
Ced 2016-3-13
I don't think there is a general answer.
First, in the most general form, if your samples are not iid, i.e. if the distribution changes depending on what has been sampled before, you have to sample the elements sequentially.
Then, the next steps really depend on what you mean by "more frequently".
Let's assume you want a total of N samples. If you have two distributions A and B, i.e. one "before a 3 was sampled" and one "after a 3 was sampled", you could either:
a) Extract N samples from distribution A, look for the first "3", then resample all the following entries using distribution B.
b) Sample them sequentially, starting with distribution A, and after the first "3" has been extracted, change to using distribution B.
This can become arbitrarily complex depending on what the "occurs more frequently" really means, i.e. on how/when your distribution changes.
You might want to have a look at Markov Decision Processes.
John D'Errico
John D'Errico 2016-3-13
编辑:John D'Errico 2016-3-13
You have not specified a clear description of the rules. Merely saying that some event happens more often than other events is not mathematics. It is just a rough suggestion. Then you say you have a few more constraints. Of course, what they are remains only in your mind.
You need to turn your rough guidelines into mathematical goals, or at least provide clear explanations that are sufficient.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by