28 votes

var() is not equal to sd()^2 in R

Please, check 0.4^2 == 0.16 0.4 == 0.16^0.5 It's not a statistical issue. It's a rounding issue in floating point arithmetics in the language. The same applies to ...
  • 714
20 votes

var() is not equal to sd()^2 in R

Recommended read for you is Goldberg, D. (1991). What every computer scientist should know about floating-point arithmetic. ACM computing surveys (CSUR), 23(1), 5-48. TL;DR you should never use <...
  • 121k
11 votes

Aren't ALL Parameters Eventually "Nuisance Parameters"?

The concept of nuisance parameters is somewhat controversial, and some argue it should not be used (I do not understand that argument). It might be better to focus on the opposite concept of interest ...
9 votes

var() is not equal to sd()^2 in R

Correct to 14 decimal points, it's a floating point number issue: options(digits = 20) > var(data) [1] 27.476190476190474499 sd(data)^2 [1] 27.476190476190470946 ...
  • 14.6k
5 votes

var() is not equal to sd()^2 in R

Check the differences between those quantities. They are likely to be small. Computers are funky about how they store long decimals.
  • 35.8k
4 votes
Accepted

Show that the variance of the longitudinal estimate is $ \dfrac{2 \sigma^2(1-\rho)} { n} $ rather than $\dfrac{\sigma^2(\rho)}{n}$

If $Var(X)=\sigma_X^2$ and $Var(Y)=\sigma_Y^2$ and $Cor(X,Y)=\rho$, and assuming without loss of generality $E[X]=E[Y]=0$, so $E[X^2]=E[Y^2]=\sigma^2$, then $Cov(X,Y)=E[XY]=\rho \sigma_X^{\,} \sigma_Y^...
  • 32.4k
3 votes
Accepted

Why does the estimation of the variance of the outputs in linear regression include the fitted values?

$\DeclareMathOperator{\X}{\mathbf X^\mathsf T\mathbf X}\DeclareMathOperator{\ep}{\boldsymbol\varepsilon}$ Let $\mathbf M := \mathbf I-\mathbf X(\X)^{-1}\mathbf X^\mathsf T$ be the residual maker. Then ...
  • 1,219
2 votes

What is the probability density function of a parallelogram

I have seen many examples of PDFs for trapezoid, and triangular distribution A PDF is a function that is a single line/function and not a geometrical figure. When you interpret PDFs as a geometrical ...
2 votes

Show that the variance of the longitudinal estimate is $ \dfrac{2 \sigma^2(1-\rho)} { n} $ rather than $\dfrac{\sigma^2(\rho)}{n}$

The variance of the longitudinal estimator of the treatment effect should be $$ \begin{align} &\mathbb{V}\left(\frac{1}{n}\sum_{i=1}^n\left(X_{A,t_2,i}-X_{A,t_1,i}\right)-\frac{1}{n}\sum_{j=1}^n\...
  • 2,510
1 vote

Measuring dispersion in circular data

Given the finite support of the domain, and the fact that the most dispersed distribution in this case is certainly the uniform distribution $U$ (with $u(x) = 1/2\pi$), you could measure the ...
  • 3,839
1 vote
Accepted

How to calculate variance of AR(1) process

The first step is to write the difference in terms of the original model: $$ \Delta Z_t = Z_{t} - Z_{t-1} = (\alpha-1)Z_{t-1} + \nu_t $$ Since $Z_{t-1}$ and $\nu_t$ are uncorrelated by the white noise ...
1 vote
Accepted

Bootstrapped difference test with smaller subsamples

Boostrap is used for assessing the uncertainty of the statistic. We know that the uncertainty changes with increasing sample size (approximately by $\sqrt n$), so if you use bootstrap samples that are ...
  • 121k
1 vote
Accepted

What is the intuition behind the $N$ in the denominator in the definition of variance?

As said in the comments, variance is defined as $$ \mathbb E[X-\mathbb EX]^2 $$ Expected value of a random value can be estimated from the sample by using the arithmetic average. Variance is just an ...
  • 121k
1 vote
Accepted

How do I calculate the weighted variance, $\sigma^2$, of a set of $N$ random variables considering their correlation $\rho$?

From the fact that your question stems from a finance textbook, I assume that you are dealing with Markowitz's portfolio theory. In most books, the author just focuses on the 2-asset case, but this ...
  • 1,288
1 vote

How do I calculate the weighted variance, $\sigma^2$, of a set of $N$ random variables considering their correlation $\rho$?

It's nothing but the application of variance of linear combination of random variables: $$\operatorname{Var}\left(\sum_{i=1}^n a_iX_i\right) =\sum_{i=1}^n a_i^2\operatorname{Var}(X_i)+ 2\mathop{\sum_{...
  • 1,219
1 vote
Accepted

Meaning of "average correlation" in Var$(\bar X)$

The general formula is $$\text{Var}\left(\sum_{k=1}^n a_k X_k\right) = \sum_{k=1}^n a_k^2 \text{Var}\left(X_k\right) + \sum_{k=1,l=1 \\k\neq l}^n a_k a_l \text{Cov}\left(X_k,X_l\right) $$ And when ...
1 vote
Accepted

Why does the finite population variance requires the (N-1) factor in the literature?

It is better to define the "population variance" with Bessel's correction (i.e., using $N-1$ in the denominator) You will find that many of the texts in sampling theory give results ...
  • 102k
1 vote

Why does the finite population variance requires the (N-1) factor in the literature?

When we are sampling with replacement then the population size is irrelevant. Simple counterexample: Imagine an urn model with $k$ red balls, and $k$ blue balls. The probability to draw a red/blue ...
1 vote

Confidence Intervals for Odd's Ratio?

Here is the derivation using the delta method. Let's look at the familiar $2\times2$-Table below. Suppose that $\theta = f(p_{11},p_{12},p_{21},p_{22})$ where $p_{ij}$ is defined as in the table ...
  • 26.4k
1 vote

Confidence Intervals for Odd's Ratio?

There is actually a section on this in the book Practical Guide to Logistic Regression by Joseph Hilbe on Pages 25-26. They derive a function here that is also in the ...
1 vote

Is it possible for long-run variance to be negative or 0?

Remember that long-run variance is a limit, so it is a little bit different than what one regularly thinks of as variance. For simplicity lets assume $\mu=0$ $$\lim_{T\to\infty}\{\text{Var}[\sqrt{T}\...
  • 1,041

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