I am having trouble understanding probability density functions. What exactly is a probability density function? Does it give you the probability of a value occurring?  See my MATLAB code below:  x = randn(1000,1); % generates 1000 numbers from the standard normal distribution y = normpdf(x,0,1);   So what y tells me is basically what is the probability of an element in X occurring right? No, it is basically the f(x) value for x, for the Gaussian Density function right?  In this  (wikipedia), it says:     In probability theory, a probability density function (PDF), or   density of a continuous random variable, is a function that describes   the relative likelihood for this random variable to take on a given   value. The probability of the random variable falling within a   particular range of values is given by the integral of this variable’s   density over that range—that is, it is given by the area under the   density function but above the horizontal axis and between the lowest   and greatest values of the range.   So what is the difference of the relative likelihood vs probability?   Also if somebody wants to accurately calculate the probability of a random variable, then he can just take a really small integral area right (close to zero)?
470
On the , there is this line:      $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.)    How can a value $&gt;1$ be OK? I thought all probability values were expressed in the range $0 \leq p \leq 1$. Furthermore, given that it is possible to have such a value, how is that value obtained in the example shown on the page?
70398
Let $X$ be a continuous random variable defined on the interval $[0,1]$ with density function $f_X(u)=c(1−u^2)$ for some suitable constant $c$.   Find: (a) the value of $c$, (b) (i) the expectation and (ii) the variance of $X$. Also find (c) the density function of the random variable $Y = X^{2}$.   Now I've already attempted (a) by integrating $(1-u^{2})$ between $0$ and $1$ (like $\pi$ in the Cauchy density function) and got $c=\frac{2}{3}$ and also for (b) (i) I integrated $uc(1-u^{2})$ between $0$ and $1$ which came out to be $c/4 = 1/6$.  Have I done these first $2$ parts correctly? If so how do I go about doing the rest and if not same question but also where did I go wrong?
16940
Suppose that the continuous random variable $X$ has probability density function  $f_X(x)=\begin{cases}\frac{1}{2}x &amp; \text{if } 0&lt;x&lt;2\\0&amp;\text{otherwise}\end{cases}$  Let $Y=X(2-X)$. Calculate $P(Y&gt;y)$ and hence find the probability density function of $Y$.  So far I have tried expressing $P(Y&gt;y)$ as $P(X(2-X)&gt;y)$ but the quadratic inside has me stuck. Sorry - I am revising for an exam and it has been a long time since I have answered questions like this.
61164
The p.d.f. of the random variable $X$ is given by $f(x) =  \begin{cases}   e^{x-2} &amp; \mbox{for $0 \leq x \leq 2$}, \\  e^{-x} &amp; \mbox{for $x &gt; 2$}, \\  0 &amp; \mbox{otherwise,}  \end{cases}$ I need to find $F^{-1}(y)$ to construct a generator for $X$. So I start with calculating the cdf by taking the integral of $f(x)$: $$ F(X)= \begin{cases} \frac{e^x-1}{e^2} &amp; 0 \leq x \leq 2 \\ -e^{-x}+e^{-2} &amp; x \geq 2 \\ 0 &amp; o.w \end{cases} $$ Next, I need to find the inverse of this function: $$y = \frac{e^x-1}{e^2} \implies x= \ln(e^2y+1) \text{ for } y \in [0, 1-e^{-2}]$$ $$y=-e^{-x}+e^{-2} \implies x = -\ln(e^{-2}-y) \text{ for }y \in (0, e^{-2})$$ Now at this point I am confused since the intervals for $F^{-1}(y)$ overlap. How do I break this up into cases? Did I screw up a calculation along the way( I retraced my steps and it seems fine...)?
27509
There is a pattern excercise:  First pattern: We have $X$ and the probability density function is usually:  $$ f(x) = \begin{cases}   {ax+bx^2} &amp;  {0\lt x \lt 1} \\   0 &amp; \text{else}   \end{cases} $$  Then we are given $E|X| = 0.6$   And usually asks to find:  a) $P\{X&gt;0.5\}$  b) $Var(X)$    Second pattern:  $$ f(x) = \begin{cases}   {cx^4} &amp;  {0\lt x \lt 2} \\   0 &amp; \text{else}   \end{cases} $$  Where c is a constant. Find:  a) Mean value of $X$  b) Variance of $X$     Third pattern (it's more like a reverse problem):  We are given $Y= \sqrt{X}$, find it's cumulative distribution function (CDF) and  it's probability density function (pdf).    Update:  The third one is transferred to a .  This is not homework. I'm self-studying and in need of some help. Thank you.
113419
Let $(X, Y)$ be a random point chosen according to the uniform distribution in the disk of radius 1 centered at the origin. Compute the densities of $X$ and of $Y$.   I know that the joint density of $X$ and $Y$ is $\frac{1}{\pi}$ since when we integrate $\frac{1}{\pi}$ over the unit circle, we get $1$.   So if I wanted to find the density of $X$, I was thinking of finding the cumulative distribution of $X$ and the differentiate it to get its density. In order to get its cumulative distribution function, I was going to use the fact that $P(X&lt;x)=P(X&lt;x, -\infty &lt; Y &lt; \infty)$, but this integral doesn't seem nice to work with. Am I on the right track or is there a better way?
4387
I tried finding the following density function:     Let $X$ and $Y$ be independent random variables, each having the exponential distribution with parameter $\lambda$. Find the joint density function of $X$ and $Z=X+Y$.   $\begin{aligned}f_{X,X+Y}=&amp;\frac{\partial}{\partial x\partial z}\mathbb P (X\leq x,Y\leq z-x)\\=&amp;\int_{-\infty}^x\int_{-\infty}^{z-x}f(u,v)\,\mathrm dv=\frac{\partial}{\partial z}\left[\frac{\partial}{\partial x}\int_0^x\int_0^{z-x}\lambda^2e^{-\lambda u-\lambda v}\,\mathrm dv\,\mathrm d u\right]\\ =&amp;\frac{\partial}{\partial z}\int_0^{z-x}\lambda^2e^{-\lambda x-\lambda v}\,\mathrm dv=\frac{\partial}{\partial z}\int_x^{z}\lambda^2e^{-\lambda x-\lambda(v-x)}\,\mathrm dv\\ =&amp;\lambda^2e^{-\lambda x-\lambda(z-x)}=\lambda^2e^{-\lambda z} \end{aligned}$  But I don't think this is correct, because $\mathbb P(X\leq x,X+Y\leq z)$ isn't equal to $\mathbb P(X\leq x,Y\leq z-x)$. But I can't think of anything else.  Could someone help me a little bit with this exercise?  I'm going to try the following:  $\mathbb P(X\leq x,Z\leq z)=\int_{-\infty}^x\int_{-\infty}^zf_X(u)f_Z(v)\,\mathrm du\,\mathrm dv$,  where I use the convolution formula. If I made no mistake, this gives  $f_{X+Y}(z)=z\lambda^2e^{-\lambda z}$, if $z&gt;0$.  Then calculating the joint density function:  $\begin{aligned}f_{X,X+Y}(x,z)=\frac{\partial}{\partial z}\left[\int_{-\infty}^z\lambda^3ve^{-\lambda x-\lambda v}\,\mathrm dv\right]. \end{aligned}$  Oh wait, this is also incorrect, because $X$ and $X+Y$ are dependent.  I really don't know how to proceed; could someone help?  I've also looked at this , but they mention the Jacobian, and my teacher has chosen to skip the paragraph about the Jacobian, so it wouldn't make sense if I had to use that.
123179
I'm looking for some correct notation. Consider the random variable $V$ with support $\mathcal{V}$ and probability distribution $P_V$. Consider a function $u:\mathcal{V}\rightarrow \mathbb{R}$.   Let $\mathcal{V}$ be finite and suppose I want to  compute the expected value of $u(V)$. This is   $$ \sum_{v\in \mathcal{V}} u(v)\times  P_{V}(v) $$  Suppose now instead that $P_V$ is continuous. What is the correct notation to indicate the formula of the expected value of $u(V)$ without passing through the definition of density? I though about using $$ \int_{\mathcal{V}} u(v)\text{ } dP_{V}(v) $$  Is this correct?
33721
Supppse $X$ and $Y$ are standard uniformly distributed in $[0, 1]$, and they are independent, what is the PDF of $Z = Y / X$?   The answer from some probability theory textbook is  $$ f_Z(z) =  \begin{cases} 1/2, &amp; \text{if } 0 \le z \le 1 \\ 1/(2z^2), &amp; \text{if } z &gt; 1 \\  0, &amp; \text{otherwise}. \end{cases} $$  I am wondering, by symmetry, shouldn't $f_Z(1/2) = f_Z(2)$? This is not the case according to the PDF above.
32525
I've read a number of different explanations trying to understand the likelihood function, and I understand the purpose of it, but some statements sound contradictory.  Consider observed data X, model parameters M, likelihood function L(M|X), and probability P(X|M).  I keep seeing it written that L(M|X) = P(X|M). At the same time, they say that the likelihood is not the same thing as the probability and L is not a probability density function (pdf).   What does it mean to say they are not the same thing but equal?  How could L be equal to a pdf, but not be a pdf?  Reference to one of the places I've read this:
30033
I have a simple question regarding "conditional probability" and "Likelihood". (I have already surveyed this question  but to no avail.)  It starts from the Wikipedia . They say this:     The likelihood of a set of parameter values, $\theta$, given   outcomes $x$, is equal to the probability of those observed outcomes   given those parameter values, that is      $$\mathcal{L}(\theta \mid x) = P(x \mid \theta)$$   Great! So in English, I read this as: "The likelihood of parameters equaling theta, given data X = x, (the left-hand-side), is equal to the probability of the data X being equal to x, given that the parameters are equal to theta". (Bold is mine for emphasis).  However, no less than 3 lines later on the same page, the Wikipedia entry then goes on to say:     Let $X$ be a random variable with a discrete probability distribution   $p$ depending on a parameter $\theta$. Then the function      $$\mathcal{L}(\theta \mid x) = p_\theta (x) = P_\theta (X=x), \, $$      considered as a function of $\theta$, is called the likelihood   function (of $\theta$, given the outcome $x$ of the random variable   $X$). Sometimes the probability of the value $x$ of $X$ for the   parameter value $\theta$ is written as $P(X=x\mid\theta)$; often   written as $P(X=x;\theta)$ to emphasize that this differs from   $\mathcal{L}(\theta \mid x) $ which is not a conditional probability,   because $\theta$ is a parameter and not a random variable.   (Bold is mine for emphasis). So, in the first quote, we are literally told about a conditional probability of $P(x\mid\theta)$, but immediately afterwards, we are told that this is actually NOT a conditional probability, and should be in fact written as $P(X = x; \theta)$?   So, which one is is? Does the likelihood actually connote a conditional probability ala the first quote? Or does it connote a simple probability ala the second quote?  EDIT:  Based on all the helpful and insightful answers I have received thus far, I have summarized my question - and my understanding thus far as so:    In English, we say that: "The likelihood is a function of parameters, GIVEN the observed data." In math, we write it as: $L(\mathbf{\Theta}= \theta \mid \mathbf{X}=x)$. The likelihood is not a probability.  The likelihood is not a probability distribution.  The likelihood is not a probability mass. The likelihood is however, in English: "A product of probability distributions, (continuous case), or a product of probability masses, (discrete case), at where $\mathbf{X} = x$, and parameterized by $\mathbf{\Theta}= \theta$." In math, we then write it as such: $L(\mathbf{\Theta}= \theta \mid \mathbf{X}=x) = f(\mathbf{X}=x ; \mathbf{\Theta}= \theta) $ (continuous case, where $f$ is a PDF), and as $L(\mathbf{\Theta}= \theta \mid \mathbf{X}=x) = P(\mathbf{X}=x ; \mathbf{\Theta}= \theta) $ (discrete case, where $P$ is a probability mass). The takeaway here is that at no point here whatsoever is a conditional probability coming into play at all.  In Bayes theorem, we have: $P(\mathbf{\Theta}= \theta \mid \mathbf{X}=x) = \frac{P(\mathbf{X}=x \mid \mathbf{\Theta}= \theta) \ P(\mathbf{\Theta}= \theta)}{P(\mathbf{X}=x)}$. Colloquially, we are told that "$P(\mathbf{X}=x \mid  \mathbf{\Theta}= \theta)$ is a likelihood", however, this is not true, since $\mathbf{\Theta}$ might be an actual random variable. Therefore, what we can correctly say however, is that this term $P(\mathbf{X}=x \mid \mathbf{\Theta}= \theta)$ is simply "similar" to a likelihood. (?) [On this I am not sure.]   EDIT II:  Based on @amoebas answer, I have drawn his last comment. I think it's quite elucidating, and I think it clears up the main contention I was having. (Comments on the image).    EDIT III:   I extended @amoebas comments to the Bayesian case just now as well:
51008
I'm building a mixture model with the two normal distributions $\mathcal{N}(\mu_1,\sigma_{1}^{2})$ and $\mathcal{N}(\mu_2,\sigma_{2}^{2})$.  So, the density function is $$ f(x) = p_1 N(x; \mu_1, \sigma_1^2) + p_2 N(x; \mu_2, \sigma_2^2), $$ where $p_1+p_2=1$, and $$ N(x;\mu,\sigma) = \frac{1}{\sqrt{2\pi \sigma^2}}\exp\left\{-\frac{(x-\mu)^2}{2\sigma^2}\right\}. $$.  Suppose I have all the sampling data, is there some numerical solution or formula that could derive $p_1$, $\mu_1$, $\sigma_1$ and $p_2$, $\mu_2$, $\sigma_2$?
29436
I am new to probability course and find concepts very confusing. I am learning maximum likelihood estimation and as a starting point for that do we find the density or the distribution?   In general, do we find the distribution from density or is it vice versa and how does one find it? For example, for Gaussian distribution do we find the density of a variable or the distribution so as to estimate unknown parameter A in the case x[n] = A + w[n] where w[n] are uncorrelated gaussian noise. This may sound too trivial but I am really confused. In many contexts I have come across where pdf = prob. density function and in some areas I find pdf = prob distribution function !!
77131
I have a question. Let's suppose that the two random variables $X1$ and $X2$ follow two Uniform distributions that are independent but have different parameters:  $X1 \sim Uniform(l1, u1)$  $X2 \sim Uniform(l2,u2)$  If we define X3 as the maximum of X1, and X2, i.e., $X3 = max(X1, X2)$, what kind of distribution would it be? It is certainly not a uniform and I can calculate the cumulative probability, i.e., $p(X3 &lt;= a)$, because $p(X3 &lt;= a) = p(X1 &lt;= a) p(X2 &lt;= a)$. But, I wonder if there exists any density function that can model X3.
8719
$$f(x,y) = \begin{cases} 2 &amp; 0&lt; x&lt; y&lt;1  \\     0 &amp;\text{otherwise} \end{cases} $$  I need to find   the density function of $y$ and conditional pdf of $X$ given $Y$.   My answer is coming out to be   $2y$ $\frac1y$
12694
I know very little of Probability and Statistics, and am wishing to learn.  I see the word "distribution" used all over the place in different contexts.  For example, a discrete random variable has a "probability distribution."  I know what this is. A continuous random variable has a probability density function, then for $x\in\mathbb{R}$, the integral from $-\infty$ to $x$ of the probability density function is the cumulative distribution function evaluated at $x$.   And apparently just "distribution function" is synonymous with "cumulative distribution function," at least when talking about continuous random variables (question: are they always synonyms?).  Then there are many famous distributions.  $\Gamma$ distribution $\chi^2$ distribution, etc.  But what exactly is a $\Gamma$ distribution?  Is it the cumulative distribution function of a $\Gamma$ random variable?  Or the probability density function of a $\Gamma$ random variable?  But then a frequency distribution of a finite data set appears to be a histogram.  Long story short: in Probability and Statistics, what is the definition of the word "distribution"?    I know the definition of distribution in Mathematics (an element of the dual space of the collection of test functions equipped with the inductive limit topology), but not Probability and Statistics.
67962
I have a pdf modelled as a piecewise linear function that I can represent as the sequence of pairs of real numbers standing for the points in the of the piecewise line: $\{(x_{1}, y_{1}), \dots, (x_{n}, y_{n})\}$ such that  each $x_{i}, x_{i+1}, i=1\dots n-1$ is a bin; the first two points are on the x axis, i.e. $y_{1}=y_{n}=0$, and the (trapezoid) area defined by the line is equal to 1 (it is a proper probability distribution function).  How can I procedurally sample from such a distribution? I feel like I can first determine one bin, e.g. $x_{s}, x_{s+1}$, by randomly selecting one with probability proportional to the trapezoid mass inside the bin, then how can I sample from the line defined by the two points $(x_{s}, y_{s}), ( x_{s+1}, y_{s+1})$?  Or shall I go through the cumulative distribution function? How can I derive it from the piecewise density representation of a sequence of points?