MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: PDF

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17707] Re: [mg17669] Re: PDF
  • From: BobHanlon at aol.com
  • Date: Sun, 23 May 1999 02:25:26 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 5/22/99 4:27:11 AM, handel at hrzpub.tu-darmstadt.de writes:

>>i have a signal, for exampel a Sinus (or a list a values). Now I want
>>to make a PDF of it. I can't figure out, how to do it. Any hints?
>
>sorry, for not expressing clearly, i do not mean a portable document
>file (Adobe-PDF)
>

Christoph,

For the continuous case:

Clear[f, F, t];

Because a probability density function (PDF) must be nonnegative, the domain 
of the PDF based on a Sin must be restricted.  In this case, restrict the 
domain to {xmin, xmax} such that 0 <= xmin < xmax <= Pi.

Further, since the total area of the PDF must be unity, the Sin must be 
normalized.

xmin = Pi/4; xmax = 3Pi/4;

f[x_ /; Evaluate[xmin <= x <= xmax]] := 
	Evaluate[Sin[x]/
			Integrate[Sin[x], {x, xmin, xmax}]];

f[x_?NumericQ] = 0; (* zero outside defined range *)

As required

Integrate[f[x], {x, xmin, xmax}]//N

1.

The corresponding CDF is then

F[x_ /; Evaluate[x <= xmin]] = 0;

F[x_ /; Evaluate[x >= xmax]] = 1;

F[x_] := Evaluate[Integrate[f[t], {t, xmin, x}]];

?F

"Global`F"

F[x_ /; x <= Pi/4] = 0
 
F[x_ /; x >= (3*Pi)/4] = 1
 
F[x_] := Integrate[f[t], {t, Pi/4, x}]

Note that the integral was not evaluated.  Force the integration by  telling 
Mathematica that t satisfies the condition xmin <= t <= xmax

t /: (xmin  <= t <= xmax) = True;

F[x_] := Evaluate[
		Integrate[f[t], {t, xmin, x}]];

?F

"Global`F"

F[x_ /; x <= Pi/4] = 0
 
F[x_ /; x >= (3*Pi)/4] = 1
 
F[x_] := 1/2 - Cos[x]/Sqrt[2]

Since t has been declared to be in the required domain

D[F[t], t] == f[t]

True


Bob Hanlon


  • Prev by Date: Re: Draw straight line, but display zigzag line!
  • Next by Date: Number Formatting
  • Previous by thread: Re: PDF
  • Next by thread: A simple quetion