# How to find a probability density function (psd)?

1. Mar 12, 2012

### felipe_ap

This might not be in the right place but here it goes:

1. The problem statement, all variables and given/known data
A given periodic function in time is given u(t). I must compute the probability density function that describes u.

u(t) = A sin (2π / T t + ψ)

A and ψ are constants.

T is the period.

t is time.

2. Relevant equations

3. The attempt at a solution

I know that the psd f(u) should yield 1 when integrated from -∞ to +∞ but I can't seem to find a way to compute it

I figure that the psd should be independent of time and be symmetric about u = 0, but I0m stuck with this...

2. Mar 13, 2012

### rude man

Are you sure your u(t) isn't u(t) = A sin (2πt/T + ψ) instead? The latter would be a sine wave with period of T sec and phase angle ψ.

3. Mar 13, 2012

### felipe_ap

Yes that's what I meant sorry :)

4. Mar 13, 2012

### rude man

I thought so, just pulling your leg a bit - will try to help in soon as I can.

5. Mar 16, 2012

### rude man

Stay tuned ...

6. Mar 16, 2012

### felipe_ap

I am :D

7. Mar 16, 2012

### LCKurtz

I'm not an engineer so please tell me: What does it mean to say a probability density function "describes" u(t)?

8. Mar 17, 2012

### felipe_ap

well I suppose that we want a function which integrated between a and b will yield the probability of having u between a and b.

9. Mar 17, 2012

### rude man

For the time being, two things for you to contemplate:

1. you have a sine wave with period T and phase angle ψ. Is the phase angle significant in what you're trying to come up with?

2. Can the wave be divided up into sections profitably?

Then you need to see that you have a random variable, time, and you have a function of that random variable. You should be able to figure out the probability density function for the former, then the biggie is getting the pdf for the latter.

The part of your textbook that deals with this topic should be labeled something like "Finding the probabilty distribution of a function of random variables". There are four commonly used approaches to this end. I suggest looking at what my book (Scheaffer and Mendenhall) call the "method of transformations".

BTW you are of course right: "well I suppose that we want a function which integrated between a and b will yield the probability of having u between a and b."

Last edited: Mar 17, 2012
10. Mar 17, 2012

### LCKurtz

If t is a random variable on the real line, don't you need to be given its probability density function to proceed?

11. Mar 17, 2012

### rude man

Yes, you do. But think about it - it's a random variable, right? Your sought-after psd says, "I pick any spot on the x axis and the corresponding y value is the psd. So what do you think the psd of a random variable looks like?

But of course time t goes on forever, and so you need to put a limit on time. If we let
x = 2πt/T, considering this is aperiodic function, what would be a reasonable intervalfor x?

And also you first need to answer the question of how ψ fits into the picture.

PS do you have Excel?

Last edited: Mar 17, 2012
12. Mar 17, 2012

### LCKurtz

Are you replying to me or the OP? Your first lines look like they are directed at me and the last at the OP. It would be good to quote what you are replying to.

I'm trying to understand what the original problem actually is. The OP didn't say t was a random variable, but you say it is. OK. So you have a function of a random variable. Then you need to know its distribution or density function. The OP didn't say t only has values in a finite interval, but you say to pick a "reasonable" interval. Even if you pick, for example, one period of the sine function, you still need to know its distribution function. I'm not a mind reader here and I would like to see a clear and complete statement of the problem.

Last, but not least, I have never seen the abbreviation psd for a probability density function. Is that what this thread is about or is it something else entirely?

Last edited: Mar 17, 2012
13. Mar 17, 2012

### rude man

You're right, I should name my respondee. And I shouldn't use psd, meaning "power spectral density" which is not at all relevant here.

When one asks for the probability density function (pdf) of a sine wave of determinate or indeterminate length, the answer is the same (has to be an integer no. of cycles if it's of finite duration, however). One asks, "if I select randomly a time t, what is the probability that the sine wave is between sin(t) and sin(t + dt)". The answer is pdf(t)*dt.

We are trying to find the pdf of the sine wave. To answer your question and the OP's too, yes, one period would be a very reasonable section of the wave to confine one's attention to, since all the rest is a re-run ... and then one may, if one wishes, exploit the symmetries of the wave to further simplify the problem...

Last edited: Mar 17, 2012
14. Mar 17, 2012

### rude man

EDITS:
You're right, I should name my respondee. And I shouldn't use psd, meaning "power spectral density" which is not at all relevant here.

The pdf of sin(ωt) is a grasph running between -1 and +1 on the x axis and the pdf function on the y axis.

The area between any two x values is the probability that a random sampling of sin(ωt) lies between the two x values. The total area from -1 to +1 is of course unity.

Thus, imagine looking at an oscilloscope display of a 1 Hz sine voltage, pk=pk = 2V. You divide the possible voltages (-1V to +1V) into n bins. You have a switch & every time you randomly hit it you get a voltage between -1V and +1V. You add "1" to the bin corresponding to the lower & upper limits encompassing your voltage reading. You do this for say 1 hour (theoretically, for infinite time). You then graph the number of hits for all the bins on the y axis with -1V to 1V running on the x axis, then normalize the y readings so that the area from x = -1V to +1V is unity. The result is the pdf of sin(ωt).

Disregard anyting I wrote today (3/17). I had to review this stuff & I was being hasty in responding. Sorry to confuse you.

Last edited: Mar 17, 2012
15. Mar 17, 2012

### LCKurtz

However, note the OP used "psd" in the solution attempt, making me wonder if the OP understood the problem being stated or was just being careless.
That description sounds to me like you are assuming the random variable t is uniformly distributed over one period. Like I said in the first place, you can't determine the distribution of a function of a random variable without knowing the distribution of the random variable in the first place. The OP did not specify uniform distribution for t even though it may be. The OP did not specify a finite interval for t. The OP hasn't replied to my original post. As far as I can tell the OP has abandoned this thread so I don't see much point in continuing.

16. Mar 18, 2012

### felipe_ap

hey! considering what I put in bold, what I did was find an expression like:

dt = ... du

Then, anything in the ... place should be the pdf (I wrote psd on the topic title by mistake I'm sorry!)

However I don't really understand why this works...

17. Mar 18, 2012

### rude man

felipe - are you sure you didn't mean power spectral density, which is what psd usually stands for? 'Cause if you did, the answer is really simple.

OK, if you really meant pdf, did you attempt to look up the transform method I talked about before? That's where you're given a pdf of one variable, say y, and a function of y, in this case sin(y), then you let u = sin(y) and you find the pdf of u.

Look at part of this link starting with "To find the probability function in a set of transformed variables, find the Jacobian. For example ... "

http://mathworld.wolfram.com/ProbabilityFunction.html

It's very incomplete but maybe it'll steer you in the right direction in your own textbook.

In our case the pdf of y is a straight line over the range 0 to 2pi since conceptually we are taking samples of the sine wave which can occur anywhere within that range with equal probability. We take those samples and build up our pdf of the wave by recording the value of each sample, determinig which "bin" it belongs in (there are n bins covering the range -1 <= sin(y) <= +1, n large), adding "1" to the number in that bin, and doing this for an arbitrarily long time for very many samples. It should be obvious that that method builds up the pdf of the wave, whether moving or stationary (one period).

It seems from your last post that you started thinking along the right track, but you need textbook help. Like I did!

18. Mar 18, 2012

### LCKurtz

Felipe, I would suggest you first try to work this simpler problem: If $T$ is uniformly distributed on $(0,2\pi)$ find the density function of $Y = sin(T)$. Once you understand how to do it, you will see how to do your question. Start by answering this: If $-1\le a \le 0$, what is the probability $P(Y\le a)$? Note that is the same question as $P(\sin T \le a)$. Draw a graph of $y = \sin t$ on $(0,\pi)$, mark $a$ on the negative y axis and figure out the probability that $t$ is such that $\sin t \le a$. Can you do that?