4

A simple way is using the total expectation formula: $$\mu=E[X]=E[X|a<X<b]P(a<X<b)+E[X|X<a\cup X>b](1-P(a<X<b))$$ The expected value, $E[X|a<X<b]$, is given in your post. And, the probability $P(a<X<b)$ can be written in terms of the standard normal CDF quite easily (which is $Z$).


3

As is often the case, precisely formulating the question helped me work out the answer. My approach makes use of the marginal expectation of the bivariate normal: $$E_X(y) = E(X|Y=y) = \mu_x + \rho\frac{\sigma_x}{\sigma_y}(y-\mu_y)$$ Returning to my notation from the question above, this gives us: $$\begin{split}E(X_1Y_2) & = \int_{-\infty}^\infty \...


2

Suppose you have $n = 100$ observations taken at random from a normal population with unknown $\mu$ and $\sigma.$ You want to get a 95% confidence interval (CI) for $\mu:$ You know that $T = \frac{\bar X - \mu}{S/\sqrt{100}}$ has $P(-1.984 \le T \le 1.984) = 0.95).$ qt(.975, 99) [1] 1.984217 In the continued equation below, the event in parentheses is ...


2

Yes that’s the correct expression for a normal density You in effect computed $\frac16 \int_{-3}^3 p(x) dx\approx \frac16$ for the mean. You should have computed $\int p(x) x dx$ which you may do numerically by np.dot(x, y) / y.sum() The quantity z = (y -np.mean(y))/np.std(y) has mean 0 and variance 1 by definition. Just try to compute it. But the fact ...


1

The formula for the normal distribution PDF is correct. But, np.mean(y) takes the mean of the PDF's y-axis values. From the plot, you can see that these values are all non-negative (as it should be because these are PDF values) and between 0 and $0.4$. Same logic applies to deviation. For example: let a RV be either $5$ or $6$ with probabilities $1/2$. If ...


1

Many of the parametric techniques in statistics assumes that the data you have is normally distributed. Since normality is an assumption then, we need to know whether the data is normal so that the assumption holds. This is where the central limit theorem come in as well. By looking at a histogram, one can often say whether the data is approximately ...


1

This code doesn't generate random observations. For each $x\in\{-10,-9,...,10,11\}$, it calculates the following probability: $$P(x-0.5\leq X\leq x+0.5)=F_X(x+0.5)-F_X(x-0.5)$$


1

If the KL-divergence between the posterior $p(z|x)$ and the prior $p(z)$ is close to 0, then $z$ is almost independent of the data point $x$. Since $x$ depends minimally on $z$, changes in $z$ lead to small changes in $x$.


1

Let $X$ be lognormally distributed. Denote $\mu$ and $\sigma$ as the mean and standard deviation of $\log(X)$. The mean and standard deviation of $X$ are given by: \begin{align} \mathrm{E}(X)&=e^{\mu + \frac{1}{2}\sigma^{2}} \\ \mathrm{SD}(X) &= e^{\mu + \frac{1}{2}\sigma^{2}}\sqrt{e^{\sigma^{2}}-1} \end{align} In your case, that means: \begin{align}...


1

I think you are doing it right... "I am not sure how to express the covariance matrix": but you specify variance to be 1, right? This is what you want? You just need to draw each time conditionally on drawing $X's$ in the right order: first draw first 10 $X's$, then the other five conditional on first five $X's$, and lastly draw $Y's$ condtional on 1, 5, 7,...


Only top voted, non community-wiki answers of a minimum length are eligible