Thread Subject:
How to generate a finite state, finite length random sequence based on user input Probability mass function.

Subject: How to generate a finite state, finite length random sequence based on user input Probability mass function.

From: DEVANAND

Date: 1 May, 2013 12:44:09

Message: 1 of 3

Hello friends,
                  I want to generate a finite state, finite length random sequence based on user input Probability mass function. ie the the user decides what PMF the sequence must follow. The PMF for a 4 state sequence will be a vector like [.7 .2 .05 .05]. Can any one help me please?

:)

Subject: How to generate a finite state, finite length random sequence based on user input Probability mass function.

From: Bruno Luong

Date: 1 May, 2013 12:54:09

Message: 2 of 3

"DEVANAND " <devanandiamin7@gmail.com> wrote in message <klr2mp$s6s$1@newscl01ah.mathworks.com>...
> Hello friends,
> I want to generate a finite state, finite length random sequence based on user input Probability mass function. ie the the user decides what PMF the sequence must follow. The PMF for a 4 state sequence will be a vector like [.7 .2 .05 .05]. Can any one help me please?
>
> :)

P = [.7 .2 .05 .05];
c = [0 cumsum(P)]
[~, state] = histc(rand(1,1000), c);

% Bruno

Subject: How to generate a finite state, finite length random sequence based on user input Probability mass function.

From: DEVANAND

Date: 1 May, 2013 14:01:09

Message: 3 of 3

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <klr39g$10s$1@newscl01ah.mathworks.com>...
> "DEVANAND " <devanandiamin7@gmail.com> wrote in message <klr2mp$s6s$1@newscl01ah.mathworks.com>...
> > Hello friends,
> > I want to generate a finite state, finite length random sequence based on user input Probability mass function. ie the the user decides what PMF the sequence must follow. The PMF for a 4 state sequence will be a vector like [.7 .2 .05 .05]. Can any one help me please?
> >
> > :)
>
> P = [.7 .2 .05 .05];
> c = [0 cumsum(P)]
> [~, state] = histc(rand(1,1000), c);
>
> % Bruno

Thank you Sir again.... :) Although I have the code now to do what I asked let me go through its working.

With the PMF constrains in effect I wanted to generate a markov chain series with N states. How can I realize that without going into HMM using MATLB.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
pmf DEVANAND 1 May, 2013 12:44:12
random sequence ge... DEVANAND 1 May, 2013 12:44:12
finite DEVANAND 1 May, 2013 12:44:12
rssFeed for this Thread

Contact us