Filter löschen
Filter löschen

How can I generate controlled sequences in matlab?

1 Ansicht (letzte 30 Tage)
chaturika Jayawardane
chaturika Jayawardane am 13 Mär. 2016
Bearbeitet: John D'Errico am 13 Mär. 2016
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 Kommentare
Ced
Ced am 13 Mär. 2016
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 am 13 Mär. 2016
Bearbeitet: John D'Errico am 13 Mär. 2016
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by