Although I have my own interpretation about representing a random sample using random variables, I am not really sure about it, and I would like to learn others' opinion about this. The question is this: in many books on statistical inference, data or observed sample is represented as $X_1, X_2, \cdots, X_n$ which are $n$ IID random variables. However, it is clear that in real-world, data are numbers with fixed value, not random variables. For example, if I measure heights of $n$ people, then I get $n$ real numbers $h_1, h_2,\cdots, h_n$, not $n$ random variables. Why don't we simply say that these numbers have come from some particular distribution, instead of representing them using random variables? On the same note, how can we talk about things like $\mathbb{V}(X_i) = \sigma$ when clearly a single number has zero variance? Most book seem to ignore these naive questions which students ask, and only define procedures to handle a &quot;sample&quot; given in the form of $n$ random variables.
8431
What do they mean when they say "random variable"?
119150
I do not understand the relation of a normal variable "x", which is to me just a placeholder for an element of a set, and a random variable, which is a mapping from the set of all possible events to $\mathbb{R}$.  To make the question more concrete, some parts I am struggling with:   Normal functions with variables can be evaluated, e.g. $f(x)=2x$ will plot to a line, can I do this with a function of a random variable? Furthermore the randomness part seems to be missing, why is it not neccessary to define how the random variable obtains its random value?     Edit: now that I feel I understood the definition, I cannot say what exacly what was missing for understanding. Nevertheless reading the following links, the comments and answer here, did the trick.
1348
I am trying to prove the statement:  If $X\sim\mathcal{N}(0,\sigma_1^2)$ and $Y\sim\mathcal{N}(0,\sigma_2^2)$ are independent random variables, then $\frac{XY}{\sqrt{X^2+Y^2}}$ is also a Normal random variable.  For the special case $\sigma_1=\sigma_2=\sigma$ (say), we have the well-known result that $\frac{XY}{\sqrt{X^2+Y^2}}\sim\mathcal{N}\left(0,\frac{\sigma^2}{4}\right)$ whenever $X$ and $Y$ are independent $\mathcal{N}(0,\sigma^2)$ variables. In fact, it is more generally known that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}}$ are independent $\mathcal{N}\left(0,\frac{\sigma^2}{4}\right)$ variables. A proof of the last result follows by using the transformation $(X,Y)\to(R,\Theta)\to(U,V)$ where $x=r\cos\theta,y=r\sin\theta$ and $u=\frac{r}{2}\sin(2\theta),v=\frac{r}{2}\cos(2\theta)$. Indeed, here $U=\frac{XY}{\sqrt{X^2+Y^2}}$ and $V=\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}}$. I tried to imitate this proof for the problem at hand but it appears to get messy. If I haven't made any error, then for $(u,v)\in\mathbb{R}^2$ I end up with the joint density of $(U,V)$ as $$f_{U,V}(u,v)=\frac{2}{\sigma_1\sigma_2\pi}\exp\left[-\sqrt{u^2+v^2}\left(\frac{\sqrt{u^2+v^2}+v}{\sigma_1^2}+\frac{\sqrt{u^2+v^2}-v}{\sigma_2^2}\right)\right]$$ I have the multiplier $2$ above as the transformation is not one-to-one. So density of $U$ would be given by $\displaystyle \int_{\mathbb{R}}f_{U,V}(u,v)\,\mathrm{d}v$, which isn't readily evaluated. Now I am interested to know if there is a proof where I can only work with $U$ and don't have to consider some $V$ to show that $U$ is Normal. Finding the CDF of $U$ doesn't look so promising to me at the moment. I would also like to do the same for the case $\sigma_1=\sigma_2=\sigma$. That is, if $X$ and $Y$ are independent $\mathcal{N}(0,\sigma^2)$ variables then I wish to show that $Z=\frac{2XY}{\sqrt{X^2+Y^2}}\sim\mathcal{N}(0,\sigma^2)$ without using a change of variables. If somehow I can argue that $Z\stackrel{d}{=}X$, then I'm done. So two questions here, the general case and then the particular case. Related posts on Math.S.E: . . Edit. This problem is in fact due to L. Shepp as I found out in the exercises of An Introduction to Probability Theory and Its Applications (Vol. II) by Feller, alongwith a possible hint:  Surely, $U=\frac{XY}{\sqrt{X^2+Y^2}}=\frac{1}{\sqrt{\frac{1}{X^2}+\frac{1}{Y^2}}}$ and I have the density of $\frac{1}{X^2}$ at hand. Let's see what I could do now. Apart from this, a little help with the integral above is also welcome.
118620
Let $Y_0, Y_1, ...$ be independent and identically distributed random variables with  $P(Y_n = 1) = P(Y_n = -1) = 1/2$ for n = 0, 1, 2 ...  Define random variables $X_n = Y_0Y_1Y_2...Y_n = \prod_{i=0}^{n} Y_i$ for n = 0, 1, 2 ...  It can be shown that .  Define the $\sigma$-algebras:  $\mathscr{Y} \doteq \sigma(Y_1, Y_2, ...)$  $\mathscr{T_n} \doteq \sigma(X_r | r &gt; n) = \sigma(X_{n+1}, X_{n+2}, ...)$  $\mathscr{R} \doteq \sigma(\mathscr{Y}, \bigcap_n \mathscr{T_n})$  Prove $Y_0$ and $\mathscr{R}$ are independent.
79868
Suppose, we have $n$ samples $x_i$ of a random variable: $$x \sim \mathcal N(\mu,\sigma^2) $$ Based on the samples, we want to estimate the probability that $x$ is negative: $$P(x\le0)$$ Intuitively, I would first estimate: $$\hat \mu=\frac 1 n \sum x_i$$ $$\hat \sigma^2={\frac 1 {n-1} \sum (x_i-\hat \mu)^2}$$ and then calculate: $$P(x\le0)=\frac1{\sqrt{2\pi\hat\sigma^2}} \int_{-\infty}^0 e^\frac{x-\hat\mu}{\hat \sigma} dx$$ However $\hat \mu$ and $\hat \sigma$ have variance! If I use this method, I suspect I am ignoring that variance and making an incorrect estimation. Is this reasoning right? If so, how can I estimate $P(x\le0)$ more correctly, taking $\text {VAR}[\hat \mu]$ and $\text {VAR}[\hat \sigma]$ into account?
81879
As statisticians, we come across many distributions under the banners "discrete" or "continuous", and "univariate" or "multivariate". But can anyone provide a good reason behind the existence and motivation for so many distributions? How do we get them? And what can a layman understand from it?  What is the logic behind the existence of distributions?
3091
This is a follow-on from my  about samples from a distribution.  Suppose $X_1 \ldots X_{n-1}, X_n$ are random variables all following some fixed distribution $D$. How do I prove that $P(X_n &gt; X_1 \wedge \ldots \wedge X_n &gt; X_{n-1}) = \frac{1}{n}$ (this is true intuitively and experimentally).
100706
I have four random variables, A, B, C, D, with known mean and variance. As well:   Cov(A,B) is known and non-zero  Cov(C,D) is known and non-zero  A and C are independent   A and D are independent  B and C are independent   B and D are independent   I then create two new random variables:   X = A*C Y = B*D   Is there any way to determine Cov(X,Y) or Var(X+Y)?   If not exactly, is there any way to estimate it? What if I could determine the distributions of A and B and C and D?
102059
How is the notation $X\sim N(\mu,\sigma^2)$ read? Is it $X$ follows a normal distribution? Or $X$ is a normal distribution? Or perhaps $X$ is approximately normal..  What if there are several variables that follow (or whatever the words is) the same distribution? How is it written?
97425
I have a question:      Does  $$N(0, x)$$ mean a normal distribution with mean $0$ and variance $x$? Or standard deviation $x$?   The notation seems ambiguous sometimes.
119537
I used to work with Monte-Carlo simulations for a while. In my case, I generated random data for a variety of input parameters according to uniform distributions (with non-negative support), say for example two variables $a$ and $b$ where data is generated: $a_1, \dots, a_n \leftarrow U(1,2)$ and $b_1, \dots, b_n \leftarrow U(4,5)$.   Eventually, I evaluated a deterministic model $M$ for all generated pairs $(a_i,b_i)$ and calculate some statistics, like sample average of $\frac{M(a_1,b_1) + \dots + M(a_n,b_n)}{n}$.  Here is my question: What is the purpose of drawing random samples from the uniform distribution, rather than deterministically select $n$ equally distributed point from the interval $[1,2]$ and $[4,5]$ respectively and simply evaluate $M$ with those points? So, what would be the purpose of doing this stochastically rather than deterministically?
96192
I am modeling a random variable ($Y$) which is the sum of some ~15-40k independent Bernoulli random variables ($X_i$), each with a different success probability ($p_i$). Formally, $Y=\sum X_i$ where $\Pr(X_i=1)=p_i$ and $\Pr(X_i=0)=1-p_i$.  I am interested in quickly answering queries such as $\Pr(Y&lt;=k)$ (where $k$ is given).  Currently, I use random simulations to answer such queries. I randomly draw each $X_i$ according to its $p_i$, then sum all $X_i$ values to get $Y&#39;$. I repeat this process a few thousand times and return the fraction of times $\Pr(Y&#39;\leq k)$.  Obviously, this is not totally accurate (although accuracy greatly increases as the number of simulations increases). Also, it seems I have enough data about the distribution to avoid the use simulations. Can you think of a reasonable way to get the exact probability $\Pr(Y\leq k)$?  p.s.  I use Perl &amp; R.  EDIT  Following the responses I thought some clarifications might be needed. I will shortly describe the setting of my problem. Given is a circular genome with  circumference c and a set of n ranges mapped to it. For example, c=3*10^9 and ranges={[100,200],[50,1000],[3*10^9-1,1000],...}. Note all ranges are closed (both ends are inclusive). Also note that we only deal with integers (whole units).  I am looking for regions on the circle that are undercovered by the given n mapped ranges. So to test whether a given a range of length x on the circle is undercovered, I test the hypothesis that the n ranges are mapped randomly. The probability a mapped range of length q&gt;x will fully cover the given range of length x is (q-x)/c. This probability becomes quite small when c is large and/or q is small. What I'm interested is the number of ranges (out of n) which cover x. This is how Y is formed.   I test my null hypothesis vs. one sided alternative (undercoverage). Also note I am testing multiple hypothesis (different x lengths), and sure to correct for this.
50755
When calculating a sample variance a factor of $N-1$ appears instead of $N$ (see this  ).  Does anybody have an intuitive way of explaining this to students who need to use this fact but maybe haven't taken a statistics course?
121480
I just had an (intellectual) panic attack.     A continuous random variable that follows a uniform in a closed interval $U(a,b)$: a comfortably familiar statistical concept.   A continuous uniform r.v. having support over the extended reals (half or whole): not an r.v. proper, but a basic Bayesian concept for an improper prior, useful and applicable. A discrete uniform taking a finite number of values: let's throw a geodesic dome, no big deal.     But what about a function that has as its domain all the rationals that are included in a closed interval with integer bounds (start with the $[0,1]$ if you wish)? And we want to use it in a probabilistic framework, requiring that each possible value has equal probability with all the others?   The number of possible values are countably infinite (which characterizes a lot of discrete distributions), but how to express the probability of a single value given that we want probabilities equal?  Can we say-show-prove that such an entity is (is not) a random variable?    If not, is this another incarnation (perhaps already well-known) of an "improper prior"?  Is it possible that this entity is in some well-defined sense, however special,  "equivalent" to a continuous uniform r.v.? Or I just committed a cardinal(ity) sin?  It appears that the fact that the domain is a closed interval does not let me let go. Bounded things are usually manageable.  The questions are many in order to be indicative of the internal maelstrom- I am not asking to get answers to each one of them.    At any time that I may come up with any insights, I will update.    UPDATE: the present question just acquired a constructivist sequel
31013
Let $\mathcal{G} = \{A_1, \ldots, A_n\}$ be a partition of a set $\Omega$, $\mathcal{F} = \sigma(\mathcal{G})$. Prove that $X : \Omega\to\mathbb{R}$ is a random variable if and only if it is constant on each of the partition elements $A_j$.  I have attempted both directions but faced some difficulties to continue writing the proof. I have also consulted some sources that have a not so clear proof.  Here is the proof: We know that $$\sigma(\mathcal{G}) = \left\{\sum_{i\in I}A_i : I \subset \{1,\ldots,n\}\right\}.$$ ($\Leftarrow$) Let $B\in \mathcal{B}(\mathbb{R})$. In this case $X(\omega) = a_i$, $\forall\omega\in A_i$ for some constants $a_i$, (then I am not sure how to proceed to show that it is a random variable), the proof says that $X = \sum_{i\in I}^n a_i \mathcal{{1_A}_i}$ and $\{X \in B\} = \sum_{i : a_i\in \mathcal{B}}A_i\in \mathcal{F}$, so $X$ is a random variable.  My question is why are we concluding or defining $X = \sum_{i\in I}^n a_i \mathcal{{1_A}_i}$ (what is the purpose), in other words I don't understand it's flow of reasoning.  ($\Rightarrow$) We use proof by contradiction: If $X$ is not constant on $A_i$, then $\exists i_0$ such that for some $\omega_1, \omega_2 \in A_{i_0}$ one has $a:= X(\omega_1) \not= X(\omega_2)$. Then I am not sure how to proceed from here.  Many thanks in advance.
99785
I'm fairly new to Machine Learning/Modelling and I'd like some background to this problem. I have a dataset where the number of observations is $n&lt;200$ however the number of variables is $p\sim 8000$. Firstly does it even make sense to consider building a model on a dataset like this or should one consider a variable selection technique to start with such as ridge regression or Lasso? I've read that this situation can lead to over-fitting. Is that the case for all ML techniques or do some techniques handle this better than others? Without too much maths a simple explanation on why the maths start to breakdown for $p&gt;n$ would be appreciated.
37331
I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is that it gives a wider range of testing, since it will test a lot of different values, whereas a normal test only uses a single static value.  I've given him a number of different reasons against this, the main ones being:   random values means the test isn't truly repeatable (which also means that if the test can randomly fail, it can do so on the build server and break the build) if it's a random value and the test fails, we need to a) fix the object and b) force ourselves to test for that value every time, so we know it works, but since it's random we don't know what the value was   Another coworker added:   If I am testing an exception, random values will not ensure that the test ends up in the expected state random data is used for flushing out a system and load testing, not for unit tests   Can anyone else add additional reasons I can give him to get him to stop doing this?  (Or alternately, is this an acceptable method of writing unit tests, and I and my other coworker are wrong?)