×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

random variable with varying mean

random variable with varying mean

random variable with varying mean

(OP)
Hi,
I am just wondering if there is any quick way in Matlab to generate a random variable with a varying mean?
Thanks,
S

RE: random variable with varying mean

This makes no sense.  A single number has a mean equal to itself.  What is the distribution you are trying to fulfill?

RE: random variable with varying mean

(OP)
Sorry, I meant a sequence of number.  For instance, if I were to build a random sequence in matlab using the function "randn(1,N)", I would get an array of "N" number with mean=0.  What I am after is the way to generate a sequence of number that don't have a fixed mean. Hopefully, this clarify the confusions result from my previous posting.

RE: random variable with varying mean

If the numbers are truly random, they're going to have a zero mean.  You could take random numbers from a set, such as anything between -50 and 2,000, and the mean would be non-zero, but you can't randomize the mean.  Trying to randomize the mean would ring you right back to a mean of zero (mean of a mean, if you will).

RE: random variable with varying mean

Just make a normal variable and set the mean to be yet another gaussian random variable.  The speed that the mean changes is critical -- you want to filter the gaussian that represents the mean by doing a moving average or something.  Change it at about 1/100 or so.  You want to model a real process so the density you want is important.

RE: random variable with varying mean

When you say " to generate a sequence of number that don't have a fixed mean", do you have any particular function you want the mean to follow?

e.g.s :
increase linearly by some average value F(t) = a * t

oscillate around zero in a sinusoidal pattern F(t) = b * sin(at)

Once you determine how you want your mean to 'vary' it will be a lot easier to find a way to di it.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources