idx
int64 1
56k
| question
stringlengths 15
155
| answer
stringlengths 2
29.2k
⌀ | question_cut
stringlengths 15
100
| answer_cut
stringlengths 2
200
⌀ | conversation
stringlengths 47
29.3k
| conversation_cut
stringlengths 47
301
|
|---|---|---|---|---|---|---|
6,601
|
Why is the mean function in Gaussian Process uninteresting?
|
I'll give you an explanation that probably wasn't meant by the speaker. In some applications means are always boring. For instance, let's say we're forecasting sales with autoregressive model $y_t=c+\gamma y_{t-1}+e_t$. The long run mean is obviously $E[y_t]\equiv\mu=\frac{c}{1-\gamma}$. Is it interesting?
It depends on your objective. If you're after the store valuation, then it tells you that you must increase $c$ or decrease $\gamma$ to increase the value of the store because the value is given by: $$V=\frac{\mu}{r}$$ where $r$ is the discount factor. So, the mean is clearly interesting.
If you're interested in the liquidity, i.e. you have enough cash to cover expenses in next couple of months, then the mean is almost irrelevant. You're looking at next month's cash forecast: $$y_1=c+\gamma y_0$$
So this month's sales $y_0$ are a factor now.
|
Why is the mean function in Gaussian Process uninteresting?
|
I'll give you an explanation that probably wasn't meant by the speaker. In some applications means are always boring. For instance, let's say we're forecasting sales with autoregressive model $y_t=c+\
|
Why is the mean function in Gaussian Process uninteresting?
I'll give you an explanation that probably wasn't meant by the speaker. In some applications means are always boring. For instance, let's say we're forecasting sales with autoregressive model $y_t=c+\gamma y_{t-1}+e_t$. The long run mean is obviously $E[y_t]\equiv\mu=\frac{c}{1-\gamma}$. Is it interesting?
It depends on your objective. If you're after the store valuation, then it tells you that you must increase $c$ or decrease $\gamma$ to increase the value of the store because the value is given by: $$V=\frac{\mu}{r}$$ where $r$ is the discount factor. So, the mean is clearly interesting.
If you're interested in the liquidity, i.e. you have enough cash to cover expenses in next couple of months, then the mean is almost irrelevant. You're looking at next month's cash forecast: $$y_1=c+\gamma y_0$$
So this month's sales $y_0$ are a factor now.
|
Why is the mean function in Gaussian Process uninteresting?
I'll give you an explanation that probably wasn't meant by the speaker. In some applications means are always boring. For instance, let's say we're forecasting sales with autoregressive model $y_t=c+\
|
6,602
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
I haven't seen RMSLE before, but I'm assuming it's $\sqrt{ \frac{1}{N} \sum_{i=1}^N (\log(x_i) - \log(y_i))^2 }$.
Thus exponentiating it won't give you RMSE, it'll give you
$e^\sqrt{ \frac{1}{N} \sum_{i=1}^N (\log(x_i) - \log(y_i))^2 } \ne \sqrt{\frac{1}{N} \sum_{i=1}^N (x_i - y_i)^2}$.
If we take the log of both sides, we get the RMSLE versus
$\frac{1}{2} \log \left( \frac{1}{N} \sum_{i=1}^N (x_i - y_i)^2 \right)$, which is clearly not the same thing.
Unfortunately, there isn't a good easy relationship in general (though someone smarter than me / thinking about it harder than me could probably use Jensen's inequality to figure out some relationship between the two).
It is, of course, the RMSE of the log-transformed variable, for what that's worth. If you want a rough sense of the spread of the distribution, you can instead get a rough sense of the spread of their logarithm, so that a RMSLE of 1.052 means that the "average" is $2.86$ times as big as the true value, or 1/2.86. Of course that's not quite what RMSE means....
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
I haven't seen RMSLE before, but I'm assuming it's $\sqrt{ \frac{1}{N} \sum_{i=1}^N (\log(x_i) - \log(y_i))^2 }$.
Thus exponentiating it won't give you RMSE, it'll give you
$e^\sqrt{ \frac{1}{N} \sum_
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
I haven't seen RMSLE before, but I'm assuming it's $\sqrt{ \frac{1}{N} \sum_{i=1}^N (\log(x_i) - \log(y_i))^2 }$.
Thus exponentiating it won't give you RMSE, it'll give you
$e^\sqrt{ \frac{1}{N} \sum_{i=1}^N (\log(x_i) - \log(y_i))^2 } \ne \sqrt{\frac{1}{N} \sum_{i=1}^N (x_i - y_i)^2}$.
If we take the log of both sides, we get the RMSLE versus
$\frac{1}{2} \log \left( \frac{1}{N} \sum_{i=1}^N (x_i - y_i)^2 \right)$, which is clearly not the same thing.
Unfortunately, there isn't a good easy relationship in general (though someone smarter than me / thinking about it harder than me could probably use Jensen's inequality to figure out some relationship between the two).
It is, of course, the RMSE of the log-transformed variable, for what that's worth. If you want a rough sense of the spread of the distribution, you can instead get a rough sense of the spread of their logarithm, so that a RMSLE of 1.052 means that the "average" is $2.86$ times as big as the true value, or 1/2.86. Of course that's not quite what RMSE means....
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
I haven't seen RMSLE before, but I'm assuming it's $\sqrt{ \frac{1}{N} \sum_{i=1}^N (\log(x_i) - \log(y_i))^2 }$.
Thus exponentiating it won't give you RMSE, it'll give you
$e^\sqrt{ \frac{1}{N} \sum_
|
6,603
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
I don't know if there is a straightforward generic interpretation, even analysing a particular case.
For example, you may be interested in evaluating what would be the error if you predict all the cases with the mean value and compare it to your approach.
Anyway, I believe RMSLE is usually used when you don't want to penalize huge differences in the predicted and true values when both predicted and true values are huge numbers. In these cases only the percentual differences matter since you can rewrite
$\log{P_i + 1} - \log{A_i +1} = \log{\frac{P_i + 1}{A_i +1}}$.
For example for P = 1000 and A = 500 would give you the roughly same error as when P = 100000 and A = 50000.
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
I don't know if there is a straightforward generic interpretation, even analysing a particular case.
For example, you may be interested in evaluating what would be the error if you predict all the cas
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
I don't know if there is a straightforward generic interpretation, even analysing a particular case.
For example, you may be interested in evaluating what would be the error if you predict all the cases with the mean value and compare it to your approach.
Anyway, I believe RMSLE is usually used when you don't want to penalize huge differences in the predicted and true values when both predicted and true values are huge numbers. In these cases only the percentual differences matter since you can rewrite
$\log{P_i + 1} - \log{A_i +1} = \log{\frac{P_i + 1}{A_i +1}}$.
For example for P = 1000 and A = 500 would give you the roughly same error as when P = 100000 and A = 50000.
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
I don't know if there is a straightforward generic interpretation, even analysing a particular case.
For example, you may be interested in evaluating what would be the error if you predict all the cas
|
6,604
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
There is an indirect way of measuring the performance of a loss function in terms of something more easily understandable, although it will not directly convert values as you have hoped.
Once the model has been trained and tested using RMSLE, simply take a new metric on it. Just because the model was trained on RMSLE, that doesn't mean you can't then take other more understandable loss functions as metrics.
In Keras, for example, you can specify extra loss functions in a metrics category in the model compiler. In the beneath the MSLE is used to train the model (Equivalent to the RMSLE), but the MAE and MSE are also recorded:
model.compile(loss='mean_squared_logarithmic_error', optimizer='adam', metrics=['mean_absolute_error','mean_squared_error'])
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
There is an indirect way of measuring the performance of a loss function in terms of something more easily understandable, although it will not directly convert values as you have hoped.
Once the mode
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
There is an indirect way of measuring the performance of a loss function in terms of something more easily understandable, although it will not directly convert values as you have hoped.
Once the model has been trained and tested using RMSLE, simply take a new metric on it. Just because the model was trained on RMSLE, that doesn't mean you can't then take other more understandable loss functions as metrics.
In Keras, for example, you can specify extra loss functions in a metrics category in the model compiler. In the beneath the MSLE is used to train the model (Equivalent to the RMSLE), but the MAE and MSE are also recorded:
model.compile(loss='mean_squared_logarithmic_error', optimizer='adam', metrics=['mean_absolute_error','mean_squared_error'])
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
There is an indirect way of measuring the performance of a loss function in terms of something more easily understandable, although it will not directly convert values as you have hoped.
Once the mode
|
6,605
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
My understanding is, when we do logarithm both on prediction and actual numbers, we'll get much smoother results than original one. And reduce the impact of larger x, while emphasize of smaller x for $\log{x+1}$.
Also you'll get a intuitive impression by drawing a simple graph of $y=\log{x+1}$.
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
|
My understanding is, when we do logarithm both on prediction and actual numbers, we'll get much smoother results than original one. And reduce the impact of larger x, while emphasize of smaller x for
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
My understanding is, when we do logarithm both on prediction and actual numbers, we'll get much smoother results than original one. And reduce the impact of larger x, while emphasize of smaller x for $\log{x+1}$.
Also you'll get a intuitive impression by drawing a simple graph of $y=\log{x+1}$.
|
How do you Interpret RMSLE (Root Mean Squared Logarithmic Error)?
My understanding is, when we do logarithm both on prediction and actual numbers, we'll get much smoother results than original one. And reduce the impact of larger x, while emphasize of smaller x for
|
6,606
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
|
Here are some general hints on solving this question:
You have a sequence of continuous IID random variables which means they are exchangeable. What does this imply about the probability of getting a particular order for the first $n$ values? Based on this, what is the probability of getting an increasing order for the first $n$ values? It is possible to figure this out without integrating over the distribution of the underlying random variables. If you do this well, you will be able to derive an answer without any assumption of a uniform distribution - i.e., you get an answer that applies for any exchangeable sequences of continuous random variables.
Here is the full solution (don't look if you are supposed to figure this out yourself):
Let $U_1, U_2, U_3, \cdots \sim \text{IID Continuous Dist}$ be your sequence of independent continuous random variables, and let $N \equiv \max \{ n \in \mathbb{N} | U_1 < U_2 < \cdots < U_n \}$ be the number of increasing elements at the start of the sequence. Because these are continuous exchangeable random variables, they are almost surely unequal to each other, and any ordering is equally likely, so we have: $$\mathbb{P}(N \geqslant n) = \mathbb{P}(U_1 < U_2 < \cdots < U_n) = \frac{1}{n!}.$$ (Note that this result holds for any IID sequence of continuous random variables; they don't have to have a uniform distribution.) So the random variable $N$ has probability mass function $$p_N(n) = \mathbb{P}(N=n) = \frac{1}{n!} - \frac{1}{(n+1)!} = \frac{n}{(n+1)!}.$$ You will notice that this result accords with the values you have calculated using integration over the underlying values. (This part isn't needed for the solution; it is included for completeness.) Using a well-known rule for the expected value of a non-negative random variable, we have: $$\mathbb{E}(N) = \sum_{n=1}^\infty \mathbb{P}(N \geqslant n) = \sum_{n=1}^\infty \frac{1}{n!} = e - 1 = 1.718282.$$ Note again that there is nothing in our working that used the underlying uniform distribution. Hence, this is a general result that applies to any exchangeable sequence of continuous random variables.
Some further insights:
From the above working we see that this distributional result and resulting expected value do not depend on the underlying distribution, so long as it is a continuous distribution. This is really not surprising once we consider the fact that every continuous scalar random variable can be obtained via a monotonic transformation of a uniform random variable (with the transformation being its quantile function). Since monotonic transformations preserve rank-order, looking at the probabilities of orderings of arbitrary IID continuous random variables is the same as looking at the probabilities of orderings of IID uniform random variables.
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when d
|
Here are some general hints on solving this question:
You have a sequence of continuous IID random variables which means they are exchangeable. What does this imply about the probability of getting a
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
Here are some general hints on solving this question:
You have a sequence of continuous IID random variables which means they are exchangeable. What does this imply about the probability of getting a particular order for the first $n$ values? Based on this, what is the probability of getting an increasing order for the first $n$ values? It is possible to figure this out without integrating over the distribution of the underlying random variables. If you do this well, you will be able to derive an answer without any assumption of a uniform distribution - i.e., you get an answer that applies for any exchangeable sequences of continuous random variables.
Here is the full solution (don't look if you are supposed to figure this out yourself):
Let $U_1, U_2, U_3, \cdots \sim \text{IID Continuous Dist}$ be your sequence of independent continuous random variables, and let $N \equiv \max \{ n \in \mathbb{N} | U_1 < U_2 < \cdots < U_n \}$ be the number of increasing elements at the start of the sequence. Because these are continuous exchangeable random variables, they are almost surely unequal to each other, and any ordering is equally likely, so we have: $$\mathbb{P}(N \geqslant n) = \mathbb{P}(U_1 < U_2 < \cdots < U_n) = \frac{1}{n!}.$$ (Note that this result holds for any IID sequence of continuous random variables; they don't have to have a uniform distribution.) So the random variable $N$ has probability mass function $$p_N(n) = \mathbb{P}(N=n) = \frac{1}{n!} - \frac{1}{(n+1)!} = \frac{n}{(n+1)!}.$$ You will notice that this result accords with the values you have calculated using integration over the underlying values. (This part isn't needed for the solution; it is included for completeness.) Using a well-known rule for the expected value of a non-negative random variable, we have: $$\mathbb{E}(N) = \sum_{n=1}^\infty \mathbb{P}(N \geqslant n) = \sum_{n=1}^\infty \frac{1}{n!} = e - 1 = 1.718282.$$ Note again that there is nothing in our working that used the underlying uniform distribution. Hence, this is a general result that applies to any exchangeable sequence of continuous random variables.
Some further insights:
From the above working we see that this distributional result and resulting expected value do not depend on the underlying distribution, so long as it is a continuous distribution. This is really not surprising once we consider the fact that every continuous scalar random variable can be obtained via a monotonic transformation of a uniform random variable (with the transformation being its quantile function). Since monotonic transformations preserve rank-order, looking at the probabilities of orderings of arbitrary IID continuous random variables is the same as looking at the probabilities of orderings of IID uniform random variables.
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when d
Here are some general hints on solving this question:
You have a sequence of continuous IID random variables which means they are exchangeable. What does this imply about the probability of getting a
|
6,607
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
|
Another solving method which gets you the solution for a more general case.
Suppose $F(x)$ is the expected length of a monotonic sequence $\{x_1, x_2, ...\}$, such that $x\leq x_1\leq x_2\leq\cdots$. The value we want to calculate is $F(0)$. And we know $F(1)=0$. Conditioning on the next value,
$$F(x) = \int_0^x \pi(y)\cdot 0 dy + \int_x^1\pi(y)(1+F(y))dy= \int_x^1 1+F(y) dy$$
where $\pi(y)=1$ is the U[0,1] density. So
$$F'(x)=-(1+F(x))$$
Solving with the boundary condition $F(1)=0$, we get $F(x) = e^{(1-x)}-1$. Hence $F(0)=e-1$.
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when d
|
Another solving method which gets you the solution for a more general case.
Suppose $F(x)$ is the expected length of a monotonic sequence $\{x_1, x_2, ...\}$, such that $x\leq x_1\leq x_2\leq\cdots$.
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
Another solving method which gets you the solution for a more general case.
Suppose $F(x)$ is the expected length of a monotonic sequence $\{x_1, x_2, ...\}$, such that $x\leq x_1\leq x_2\leq\cdots$. The value we want to calculate is $F(0)$. And we know $F(1)=0$. Conditioning on the next value,
$$F(x) = \int_0^x \pi(y)\cdot 0 dy + \int_x^1\pi(y)(1+F(y))dy= \int_x^1 1+F(y) dy$$
where $\pi(y)=1$ is the U[0,1] density. So
$$F'(x)=-(1+F(x))$$
Solving with the boundary condition $F(1)=0$, we get $F(x) = e^{(1-x)}-1$. Hence $F(0)=e-1$.
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when d
Another solving method which gets you the solution for a more general case.
Suppose $F(x)$ is the expected length of a monotonic sequence $\{x_1, x_2, ...\}$, such that $x\leq x_1\leq x_2\leq\cdots$.
|
6,608
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
|
Another solving method is to calculate the integral directly.
The probability of generating a sequence whose increasing part has length of $\geq n$ is $f^n(0)$, where $f^n(x) = \int_{x}^{1}\int_{x_1}^{1}\int_{x_2}^{1}...\int_{x_{n-2}}^{1}\int_{x_{n-1}}^{1}dx_ndx_{n-1}...dx_2dx_1$.
What we need to do is to calculate $f^n(0)$.
If you try to calculate the first several $f^n(x)$, maybe you will find that $f^n(x) = \sum_{t=0}^n \dfrac{(-x)^t}{t!(n-t)!}$
Base Case: when $n=1$, $f^1(x) = \sum_{t=0}^1 \dfrac{(-x)^t}{t!(n-t)!}=1-x=\int_{x}^{1}dx_1$
Inductive Hypothesis: when $n=k$, $f^n(x) = \sum_{t=0}^k \dfrac{(-x)^t}{t!(k-t)!}\text{ , for }k \geq 1$
Inductive Step: when $n = k+1$,
$\ \ \ \ \ f^{n}(x) = f^{k+1}(x) = \int_{x}^{1}f^{k}(x^*)dx^*$
$=\int_{x}^{1}\sum_{t=0}^{k} \dfrac{(-x^*)^t}{t!(k-t)!}dx^*$
$=\sum_{t=0}^{k} \dfrac{-(-x^*)^{t+1}}{t!(k-t)!\times(t+1)}\Biggr|_{x}^{1}\\=\sum_{t=0}^{k} \dfrac{-(-x^*)^{t+1}}{(t+1)!(k-t)!}\Biggr|_{x}^{1}$
$=\sum_{t=1}^{k+1} \dfrac{-(-x^*)^{t}}{t!(k-t+1)!}\Biggr|_{x}^{1}$
$=\sum_{t=1}^{k+1} \dfrac{(-1)^{t+1}}{t!(k-t+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\sum_{t=1}^{k+1} \dfrac{(-1)^{t+1}C_t^{k+1}}{(k+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\dfrac{1}{(k+1)!}+\sum_{t=0}^{k+1} \dfrac{(-1)^{t+1}C_t^{k+1}}{(k+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\dfrac{1}{(k+1)!}-\dfrac{(1-1)^{k+1}}{(k+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\sum_{t=0}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
By Mathematical Induction, the assumption holds.
Thus, we get that $f^n(0)=\dfrac{1}{n!}$
So, $E(length)=\sum_{n=1}^{\infty} Pr(length\geq n)=\sum_{n=1}^{\infty} \dfrac{1}{n!}=e-1$
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when d
|
Another solving method is to calculate the integral directly.
The probability of generating a sequence whose increasing part has length of $\geq n$ is $f^n(0)$, where $f^n(x) = \int_{x}^{1}\int_{x_1}^
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
Another solving method is to calculate the integral directly.
The probability of generating a sequence whose increasing part has length of $\geq n$ is $f^n(0)$, where $f^n(x) = \int_{x}^{1}\int_{x_1}^{1}\int_{x_2}^{1}...\int_{x_{n-2}}^{1}\int_{x_{n-1}}^{1}dx_ndx_{n-1}...dx_2dx_1$.
What we need to do is to calculate $f^n(0)$.
If you try to calculate the first several $f^n(x)$, maybe you will find that $f^n(x) = \sum_{t=0}^n \dfrac{(-x)^t}{t!(n-t)!}$
Base Case: when $n=1$, $f^1(x) = \sum_{t=0}^1 \dfrac{(-x)^t}{t!(n-t)!}=1-x=\int_{x}^{1}dx_1$
Inductive Hypothesis: when $n=k$, $f^n(x) = \sum_{t=0}^k \dfrac{(-x)^t}{t!(k-t)!}\text{ , for }k \geq 1$
Inductive Step: when $n = k+1$,
$\ \ \ \ \ f^{n}(x) = f^{k+1}(x) = \int_{x}^{1}f^{k}(x^*)dx^*$
$=\int_{x}^{1}\sum_{t=0}^{k} \dfrac{(-x^*)^t}{t!(k-t)!}dx^*$
$=\sum_{t=0}^{k} \dfrac{-(-x^*)^{t+1}}{t!(k-t)!\times(t+1)}\Biggr|_{x}^{1}\\=\sum_{t=0}^{k} \dfrac{-(-x^*)^{t+1}}{(t+1)!(k-t)!}\Biggr|_{x}^{1}$
$=\sum_{t=1}^{k+1} \dfrac{-(-x^*)^{t}}{t!(k-t+1)!}\Biggr|_{x}^{1}$
$=\sum_{t=1}^{k+1} \dfrac{(-1)^{t+1}}{t!(k-t+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\sum_{t=1}^{k+1} \dfrac{(-1)^{t+1}C_t^{k+1}}{(k+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\dfrac{1}{(k+1)!}+\sum_{t=0}^{k+1} \dfrac{(-1)^{t+1}C_t^{k+1}}{(k+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\dfrac{1}{(k+1)!}-\dfrac{(1-1)^{k+1}}{(k+1)!}+\sum_{t=1}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
$=\sum_{t=0}^{k+1} \dfrac{(-x)^{t}}{t!(k-t+1)!}$
By Mathematical Induction, the assumption holds.
Thus, we get that $f^n(0)=\dfrac{1}{n!}$
So, $E(length)=\sum_{n=1}^{\infty} Pr(length\geq n)=\sum_{n=1}^{\infty} \dfrac{1}{n!}=e-1$
|
Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when d
Another solving method is to calculate the integral directly.
The probability of generating a sequence whose increasing part has length of $\geq n$ is $f^n(0)$, where $f^n(x) = \int_{x}^{1}\int_{x_1}^
|
6,609
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
I don't think it matters very much, as long as the interpretation of the results is performed within the same framework as the analysis. The main problem with frequentist statistics is that there is a natural tendency to treat the p-value of a frequentist significance test as if it was a Bayesian a-posteriori probability that the null hypothesis is true (and hence 1-p is the probability that the alternative hypothesis is true), or treating a frequentist confidence interval as a Bayesian credible interval (and hence assuming there is a 95% probability that the true value lies within a 95% confidence interval for the particular sample of data we have). These sorts of interpretation are natural as it would be the direct answer to the question we would naturally want to ask. It is a trade-off between whether the subjective element of the Bayesian approach (which is itself debatable, see e.g. Jaynes book) is sufficiently abhorrent that it is worth making do with an indirect answer to the key question (and vice versa).
As long as the form of the answer is acceptable, and we can agree on the assumptions made, then there is no reason to prefer one over the other - it is a matter of horses for courses.
I'm still a Bayesian though ;o)
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
I don't think it matters very much, as long as the interpretation of the results is performed within the same framework as the analysis. The main problem with frequentist statistics is that there is
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
I don't think it matters very much, as long as the interpretation of the results is performed within the same framework as the analysis. The main problem with frequentist statistics is that there is a natural tendency to treat the p-value of a frequentist significance test as if it was a Bayesian a-posteriori probability that the null hypothesis is true (and hence 1-p is the probability that the alternative hypothesis is true), or treating a frequentist confidence interval as a Bayesian credible interval (and hence assuming there is a 95% probability that the true value lies within a 95% confidence interval for the particular sample of data we have). These sorts of interpretation are natural as it would be the direct answer to the question we would naturally want to ask. It is a trade-off between whether the subjective element of the Bayesian approach (which is itself debatable, see e.g. Jaynes book) is sufficiently abhorrent that it is worth making do with an indirect answer to the key question (and vice versa).
As long as the form of the answer is acceptable, and we can agree on the assumptions made, then there is no reason to prefer one over the other - it is a matter of horses for courses.
I'm still a Bayesian though ;o)
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
I don't think it matters very much, as long as the interpretation of the results is performed within the same framework as the analysis. The main problem with frequentist statistics is that there is
|
6,610
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
Adding to what Shane says, I think the continuum comprises:
Firm philosophical standing in the Bayes camp
Both considered valid, with one approach more or less preferable for a given problem
I'd use a Bayesian approach (at all or more often) but I don't have the time.
Firm philosophical standing in the frequentist camp
I do it like I learned in class. What's Bayes?
And yes, I know working statisticians and analysts at all of these points. Most of the time I'm living at #3, striving to spend more time at #2.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
Adding to what Shane says, I think the continuum comprises:
Firm philosophical standing in the Bayes camp
Both considered valid, with one approach more or less preferable for a given problem
I'd use
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
Adding to what Shane says, I think the continuum comprises:
Firm philosophical standing in the Bayes camp
Both considered valid, with one approach more or less preferable for a given problem
I'd use a Bayesian approach (at all or more often) but I don't have the time.
Firm philosophical standing in the frequentist camp
I do it like I learned in class. What's Bayes?
And yes, I know working statisticians and analysts at all of these points. Most of the time I'm living at #3, striving to spend more time at #2.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
Adding to what Shane says, I think the continuum comprises:
Firm philosophical standing in the Bayes camp
Both considered valid, with one approach more or less preferable for a given problem
I'd use
|
6,611
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
I think Bayesian statistics come into play in two different contexts.
On the one hand, some researchers/statisticians are definitely convinced of the "Bayesian spirit" and, acknowledging the limit of the classical frequentist hypothesis framework, have decided to concentrate on Bayesian thinking. Studies in experimental psychology highlighting small effect sizes or borderline statistical significance are now increasingly relying on the Bayesian framework. In this respect, I like to cite some of the extensive work of Bruno Lecoutre (1-4) who contributed to developing the use of fiducial risk and Bayesian (M)ANOVA. I think the fact we can readily interpret a confidence interval in terms of probabilities applied on the parameter of interest (i.e. depending on the prior distribution) is a radical turn in statistical thinking. I can also imagine that everybody is actually aware of the ever growing work of Andrew Gelman in this domain, as pointed by @Skrikant, or of the incentive given by the International Society for Bayesian Analysis to use bayesian models. Frank Harrell also provides interesting outlines of Bayesian Methods for Clinicians, as applied to RCTs.
On the other hand, the Bayesian approach has proved successful in diagnostic medicine (5), and is often used as an ultimate alternative where traditional statistics would fail, if applicable at all. I am thinking of a psychometrical paper (6) where authors were interested in assessing the agreement between radiologists about the severity of hip fractures from a very limited data set (12 doctors x 15 radiography) and use an item response model for polytomous items.
Finally, a recent 45-pages paper published in Statistics in Medicine provides an interesting overview of the "penetrance" of bayesian modeling in biostatistics:
Ashby, D (2006). Bayesian statistics
in medicine: a 25 year review.
Statistics in Medicine, 25(21), 3589-631.
References
Rouanet H., Lecoutre B. (1983). Specific inference in ANOVA: From significance tests to Bayesian procedures. British Journal of Mathematical and Statistical Psychology, 36, 252-268.
Lecoutre B., Lecoutre M.-P., Poitevineau J. (2001). Uses, abuses and misuses of significance tests in the scientific community: Won't the Bayesian choice be unavoidable? International Statistical Review, 69, 399-418.
Lecoutre B. (2006). Isn't everyone a Bayesian?. Indian Bayesian Society News Letter, III, 3-9.
Lecoutre B. (2006). And if you were a Bayesian without knowing it? In A. Mohammad-Djafari (Ed.): 26th Workshop on Bayesian Inference and Maximum Entropy Methods in Science and Engineering. Melville : AIP Conference Proceedings Vol. 872, 15-22.
Broemeling, L.D. (2007). Bayesian Biostatistics and Diagnostic Medicine. Chapman and Hall/CRC.
Baldwin, P., Bernstein, J., and Wainer, H. (2009). Hip psychometrics. Statistics in Medicine, 28(17), 2277-92.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
I think Bayesian statistics come into play in two different contexts.
On the one hand, some researchers/statisticians are definitely convinced of the "Bayesian spirit" and, acknowledging the limit of
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
I think Bayesian statistics come into play in two different contexts.
On the one hand, some researchers/statisticians are definitely convinced of the "Bayesian spirit" and, acknowledging the limit of the classical frequentist hypothesis framework, have decided to concentrate on Bayesian thinking. Studies in experimental psychology highlighting small effect sizes or borderline statistical significance are now increasingly relying on the Bayesian framework. In this respect, I like to cite some of the extensive work of Bruno Lecoutre (1-4) who contributed to developing the use of fiducial risk and Bayesian (M)ANOVA. I think the fact we can readily interpret a confidence interval in terms of probabilities applied on the parameter of interest (i.e. depending on the prior distribution) is a radical turn in statistical thinking. I can also imagine that everybody is actually aware of the ever growing work of Andrew Gelman in this domain, as pointed by @Skrikant, or of the incentive given by the International Society for Bayesian Analysis to use bayesian models. Frank Harrell also provides interesting outlines of Bayesian Methods for Clinicians, as applied to RCTs.
On the other hand, the Bayesian approach has proved successful in diagnostic medicine (5), and is often used as an ultimate alternative where traditional statistics would fail, if applicable at all. I am thinking of a psychometrical paper (6) where authors were interested in assessing the agreement between radiologists about the severity of hip fractures from a very limited data set (12 doctors x 15 radiography) and use an item response model for polytomous items.
Finally, a recent 45-pages paper published in Statistics in Medicine provides an interesting overview of the "penetrance" of bayesian modeling in biostatistics:
Ashby, D (2006). Bayesian statistics
in medicine: a 25 year review.
Statistics in Medicine, 25(21), 3589-631.
References
Rouanet H., Lecoutre B. (1983). Specific inference in ANOVA: From significance tests to Bayesian procedures. British Journal of Mathematical and Statistical Psychology, 36, 252-268.
Lecoutre B., Lecoutre M.-P., Poitevineau J. (2001). Uses, abuses and misuses of significance tests in the scientific community: Won't the Bayesian choice be unavoidable? International Statistical Review, 69, 399-418.
Lecoutre B. (2006). Isn't everyone a Bayesian?. Indian Bayesian Society News Letter, III, 3-9.
Lecoutre B. (2006). And if you were a Bayesian without knowing it? In A. Mohammad-Djafari (Ed.): 26th Workshop on Bayesian Inference and Maximum Entropy Methods in Science and Engineering. Melville : AIP Conference Proceedings Vol. 872, 15-22.
Broemeling, L.D. (2007). Bayesian Biostatistics and Diagnostic Medicine. Chapman and Hall/CRC.
Baldwin, P., Bernstein, J., and Wainer, H. (2009). Hip psychometrics. Statistics in Medicine, 28(17), 2277-92.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
I think Bayesian statistics come into play in two different contexts.
On the one hand, some researchers/statisticians are definitely convinced of the "Bayesian spirit" and, acknowledging the limit of
|
6,612
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
I would imagine that in applied fields the divide is not paid that much attention as researchers/practitioners tend to be pragmatic in applied works. You choose the tool that works given the context.
However, the debate is alive and well among those who care about the philosophical issues underlying these two approaches. See for example the following blog posts of Andrew Gelman:
Ya don't know Bayes, Jack
Philosophy and the practice of Bayesian statistics
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
I would imagine that in applied fields the divide is not paid that much attention as researchers/practitioners tend to be pragmatic in applied works. You choose the tool that works given the context.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
I would imagine that in applied fields the divide is not paid that much attention as researchers/practitioners tend to be pragmatic in applied works. You choose the tool that works given the context.
However, the debate is alive and well among those who care about the philosophical issues underlying these two approaches. See for example the following blog posts of Andrew Gelman:
Ya don't know Bayes, Jack
Philosophy and the practice of Bayesian statistics
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
I would imagine that in applied fields the divide is not paid that much attention as researchers/practitioners tend to be pragmatic in applied works. You choose the tool that works given the context.
|
6,613
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
While this is subjective, I would say:
It is called the Bayesian/frequentist "debate" for a reason. There is a clear philosophical difference between the two approaches.
But as with most things, it's a spectrum. Some people are very much in one camp or the other and completely reject the alternative. Most people probably fall somewhere in the middle. I myself would use either method depending on the circumstances.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
|
While this is subjective, I would say:
It is called the Bayesian/frequentist "debate" for a reason. There is a clear philosophical difference between the two approaches.
But as with most things, it
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
While this is subjective, I would say:
It is called the Bayesian/frequentist "debate" for a reason. There is a clear philosophical difference between the two approaches.
But as with most things, it's a spectrum. Some people are very much in one camp or the other and completely reject the alternative. Most people probably fall somewhere in the middle. I myself would use either method depending on the circumstances.
|
Do working statisticians care about the difference between frequentist and Bayesian inference?
While this is subjective, I would say:
It is called the Bayesian/frequentist "debate" for a reason. There is a clear philosophical difference between the two approaches.
But as with most things, it
|
6,614
|
Why use vector error correction model?
|
The foremost advantage of VECM is that it has nice interpretation with long term and short term equations.
In theory VECM is just a representation of cointegrated VAR. This representation is courtesy of Granger's representation theorem. So if you have cointegrated VAR it has VECM representation and vice versa.
In practice you need to determine the number of cointegrating relationships. When you fix that number you restrict certain coefficients of VAR model. So advantage of VECM over VAR (which you estimate ignoring VECM) is that the resulting VAR from VECM representation has more efficient coefficient estimates.
|
Why use vector error correction model?
|
The foremost advantage of VECM is that it has nice interpretation with long term and short term equations.
In theory VECM is just a representation of cointegrated VAR. This representation is courtesy
|
Why use vector error correction model?
The foremost advantage of VECM is that it has nice interpretation with long term and short term equations.
In theory VECM is just a representation of cointegrated VAR. This representation is courtesy of Granger's representation theorem. So if you have cointegrated VAR it has VECM representation and vice versa.
In practice you need to determine the number of cointegrating relationships. When you fix that number you restrict certain coefficients of VAR model. So advantage of VECM over VAR (which you estimate ignoring VECM) is that the resulting VAR from VECM representation has more efficient coefficient estimates.
|
Why use vector error correction model?
The foremost advantage of VECM is that it has nice interpretation with long term and short term equations.
In theory VECM is just a representation of cointegrated VAR. This representation is courtesy
|
6,615
|
Why use vector error correction model?
|
I agree with mpiktas that the greatest interest of a VECM lies in the interpretation of the result, by introducing concepts such as long-term relationship between variables, and the associated concept of error correction, whereas one studies how deviations from the long-run are "corrected". Besides of this, indeed, if your model is correctly specified, the VECM estimates will be more efficient (as a VECM has a restricted VAR representation, while estimating VAR directly would not take this into account).
However, if you are only interested in forecasting, as seems to be the case, you might not be interested in these aspects of the VECM. Furthermore, determining the appropriate cointegrating rank and estimating these values might induce small sample inaccuracies, so that, even if the true model was a VECM, using a VAR for forecasting might be better. Finally, there is the question of the horizon of the forecast you are interested in, which influences the choice of the model (regardless of which is the "true" model). If I remember well, there are kind of contradictory results from the literature, Hoffman and Rasche saying advantages of VECM appear at a long horizon only, but Christoffersen and Diebold claiming you are fine with a VAR for long term...
The literature (without a clear consensus) would start with:
Peter F. Christoffersen and Francis X. Diebold, Cointegration and Long-Horizon Forecasting, Journal of Business & Economic Statistics, Vol. 16, No. 4 (Oct., 1998), pp. 450-458
Engle, Yoo (1987) Forecasting And Testing In Co-Integrated Systems, Journal of Econometrics 35 (1987) 143-159
Hoffman, Rasche (1996) Assessing Forecast Performance In A Cointegrated System, Journal Of Applied Econometrics, VOL. 11,495-517 (1996)
Finally, there is thorough treatment (but not very clear in my opinion), discussion of your question in the Handbook of forecasting, chapter 11, Forecasting With Trending Data, Elliott.
|
Why use vector error correction model?
|
I agree with mpiktas that the greatest interest of a VECM lies in the interpretation of the result, by introducing concepts such as long-term relationship between variables, and the associated concept
|
Why use vector error correction model?
I agree with mpiktas that the greatest interest of a VECM lies in the interpretation of the result, by introducing concepts such as long-term relationship between variables, and the associated concept of error correction, whereas one studies how deviations from the long-run are "corrected". Besides of this, indeed, if your model is correctly specified, the VECM estimates will be more efficient (as a VECM has a restricted VAR representation, while estimating VAR directly would not take this into account).
However, if you are only interested in forecasting, as seems to be the case, you might not be interested in these aspects of the VECM. Furthermore, determining the appropriate cointegrating rank and estimating these values might induce small sample inaccuracies, so that, even if the true model was a VECM, using a VAR for forecasting might be better. Finally, there is the question of the horizon of the forecast you are interested in, which influences the choice of the model (regardless of which is the "true" model). If I remember well, there are kind of contradictory results from the literature, Hoffman and Rasche saying advantages of VECM appear at a long horizon only, but Christoffersen and Diebold claiming you are fine with a VAR for long term...
The literature (without a clear consensus) would start with:
Peter F. Christoffersen and Francis X. Diebold, Cointegration and Long-Horizon Forecasting, Journal of Business & Economic Statistics, Vol. 16, No. 4 (Oct., 1998), pp. 450-458
Engle, Yoo (1987) Forecasting And Testing In Co-Integrated Systems, Journal of Econometrics 35 (1987) 143-159
Hoffman, Rasche (1996) Assessing Forecast Performance In A Cointegrated System, Journal Of Applied Econometrics, VOL. 11,495-517 (1996)
Finally, there is thorough treatment (but not very clear in my opinion), discussion of your question in the Handbook of forecasting, chapter 11, Forecasting With Trending Data, Elliott.
|
Why use vector error correction model?
I agree with mpiktas that the greatest interest of a VECM lies in the interpretation of the result, by introducing concepts such as long-term relationship between variables, and the associated concept
|
6,616
|
Why use vector error correction model?
|
One description I've found (http://eco.uc3m.es/~jgonzalo/teaching/timeseriesMA/eviewsvar.pdf) says:
A vector error correction (VEC) model is a restricted VAR that has cointegration restrictions built into the specification, so that it is designed for use with nonstationary series that are known to be cointegrated. The VEC specification restricts the long-run behavior of the endogenous variables to converge to their cointegrating relationships while allowing a wide range of short-run dynamics. The cointegration term is known as the error correction term since the deviation from long-run equilibrium is corrected gradually through a series of partial short-run adjustments.
Which seems to imply that a VEC is more subtle/flexible than simply using a VAR on first-differenced data.
|
Why use vector error correction model?
|
One description I've found (http://eco.uc3m.es/~jgonzalo/teaching/timeseriesMA/eviewsvar.pdf) says:
A vector error correction (VEC) model is a restricted VAR that has cointegration restrictions built
|
Why use vector error correction model?
One description I've found (http://eco.uc3m.es/~jgonzalo/teaching/timeseriesMA/eviewsvar.pdf) says:
A vector error correction (VEC) model is a restricted VAR that has cointegration restrictions built into the specification, so that it is designed for use with nonstationary series that are known to be cointegrated. The VEC specification restricts the long-run behavior of the endogenous variables to converge to their cointegrating relationships while allowing a wide range of short-run dynamics. The cointegration term is known as the error correction term since the deviation from long-run equilibrium is corrected gradually through a series of partial short-run adjustments.
Which seems to imply that a VEC is more subtle/flexible than simply using a VAR on first-differenced data.
|
Why use vector error correction model?
One description I've found (http://eco.uc3m.es/~jgonzalo/teaching/timeseriesMA/eviewsvar.pdf) says:
A vector error correction (VEC) model is a restricted VAR that has cointegration restrictions built
|
6,617
|
Why use vector error correction model?
|
My understanding may be incorrect, but isn't the first step is just fitting a regression between time series using OLS - and it shows you if time series are really cointegrated (if residuals from this regression are stationary). But then cointegration is kind of a long-term relation between time-series and your residuals although stationary may still have some short-term autocorrelation structure that you may exploit to fit a better model and get better predictions and this "long-term + short term" model is VECM. So if you need only long-term relation, you may stop at the first step and use just cointegration relation.
|
Why use vector error correction model?
|
My understanding may be incorrect, but isn't the first step is just fitting a regression between time series using OLS - and it shows you if time series are really cointegrated (if residuals from this
|
Why use vector error correction model?
My understanding may be incorrect, but isn't the first step is just fitting a regression between time series using OLS - and it shows you if time series are really cointegrated (if residuals from this regression are stationary). But then cointegration is kind of a long-term relation between time-series and your residuals although stationary may still have some short-term autocorrelation structure that you may exploit to fit a better model and get better predictions and this "long-term + short term" model is VECM. So if you need only long-term relation, you may stop at the first step and use just cointegration relation.
|
Why use vector error correction model?
My understanding may be incorrect, but isn't the first step is just fitting a regression between time series using OLS - and it shows you if time series are really cointegrated (if residuals from this
|
6,618
|
Why use vector error correction model?
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
We can selection time series models based on whether the data are stationary.
|
Why use vector error correction model?
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
Why use vector error correction model?
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
We can selection time series models based on whether the data are stationary.
|
Why use vector error correction model?
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
6,619
|
Why use vector error correction model?
|
You can't use VAR if the dependent variables are not stationary (that would be spurious regression). To solve for these issues, we have to test if the variables are cointegrated. In this case if we have a variable I(1), or all dependent variables are cointegrated at the same level, you can do VECM.
|
Why use vector error correction model?
|
You can't use VAR if the dependent variables are not stationary (that would be spurious regression). To solve for these issues, we have to test if the variables are cointegrated. In this case if we
|
Why use vector error correction model?
You can't use VAR if the dependent variables are not stationary (that would be spurious regression). To solve for these issues, we have to test if the variables are cointegrated. In this case if we have a variable I(1), or all dependent variables are cointegrated at the same level, you can do VECM.
|
Why use vector error correction model?
You can't use VAR if the dependent variables are not stationary (that would be spurious regression). To solve for these issues, we have to test if the variables are cointegrated. In this case if we
|
6,620
|
Why use vector error correction model?
|
What I observed in VAR was that it is used to capture short-run relationship between the variables employed while VECM tests for the long-run relationship. For instance, in a topic where shock is being applied, I think the appropriate estimation technique should be VAR. Meanwhile, when testing through the process of unit root, co-integration, VAR and VECM, if the unit root confirmed that all the variables were I(1) in nature, you can proceed to co-integration and after tested for co-integration and the result confirmed that the variables are cointegrated meaning there is long-run relationship between the variables then you can proceed to VECM but if other wise you go for VAR.
|
Why use vector error correction model?
|
What I observed in VAR was that it is used to capture short-run relationship between the variables employed while VECM tests for the long-run relationship. For instance, in a topic where shock is bein
|
Why use vector error correction model?
What I observed in VAR was that it is used to capture short-run relationship between the variables employed while VECM tests for the long-run relationship. For instance, in a topic where shock is being applied, I think the appropriate estimation technique should be VAR. Meanwhile, when testing through the process of unit root, co-integration, VAR and VECM, if the unit root confirmed that all the variables were I(1) in nature, you can proceed to co-integration and after tested for co-integration and the result confirmed that the variables are cointegrated meaning there is long-run relationship between the variables then you can proceed to VECM but if other wise you go for VAR.
|
Why use vector error correction model?
What I observed in VAR was that it is used to capture short-run relationship between the variables employed while VECM tests for the long-run relationship. For instance, in a topic where shock is bein
|
6,621
|
Why use vector error correction model?
|
If someone pops up here with the same question, here is the answer why one needs VECM instead of VAR. If your data is non stationary (finance data + some macro variables) you cannot forecast with VAR because it assume stationarity thus MLE (or OLS in this case) will produce forecasts that mean revert to quickly. VECM can handle this problem. (differenced series would not help)
|
Why use vector error correction model?
|
If someone pops up here with the same question, here is the answer why one needs VECM instead of VAR. If your data is non stationary (finance data + some macro variables) you cannot forecast with VAR
|
Why use vector error correction model?
If someone pops up here with the same question, here is the answer why one needs VECM instead of VAR. If your data is non stationary (finance data + some macro variables) you cannot forecast with VAR because it assume stationarity thus MLE (or OLS in this case) will produce forecasts that mean revert to quickly. VECM can handle this problem. (differenced series would not help)
|
Why use vector error correction model?
If someone pops up here with the same question, here is the answer why one needs VECM instead of VAR. If your data is non stationary (finance data + some macro variables) you cannot forecast with VAR
|
6,622
|
Why use vector error correction model?
|
As has been rightly pointed out in the earlier posts , A VECM enables you to use non stationary data ( but cointegrated) for intepretation. This helps retain the relevant information in the data ( which would otherwise get missed on differencing of the same)
|
Why use vector error correction model?
|
As has been rightly pointed out in the earlier posts , A VECM enables you to use non stationary data ( but cointegrated) for intepretation. This helps retain the relevant information in the data ( wh
|
Why use vector error correction model?
As has been rightly pointed out in the earlier posts , A VECM enables you to use non stationary data ( but cointegrated) for intepretation. This helps retain the relevant information in the data ( which would otherwise get missed on differencing of the same)
|
Why use vector error correction model?
As has been rightly pointed out in the earlier posts , A VECM enables you to use non stationary data ( but cointegrated) for intepretation. This helps retain the relevant information in the data ( wh
|
6,623
|
Explanation of finite population correction factor?
|
The threshold is chosen such that it ensures convergence of the hypergeometric distribution ($\sqrt{\frac{N-n}{N-1}}$ is its SD), instead of a binomial distribution (for sampling with replacement), to a normal distribution (this is the Central Limit Theorem, see e.g., The Normal Curve, the Central Limit Theorem, and Markov's and Chebychev's Inequalities for Random Variables). In other words, when $n/N\leq 0.05$ (i.e., $n$ is not 'too large' compared to $N$), the FPC can safely be ignored; it is easy to see how the correction factor evolves with varying $n$ for a fixed $N$: with $N=10,000$, we have $\text{FPC}=.9995$ when $n=10$ while $\text{FPC}=.3162$ when $n=9,000$. When $N\to\infty$, the FPC approaches 1 and we are close to the situation of sampling with replacement (i.e., like with an infinite population).
To understand this results, a good starting point is to read some online tutorials on sampling theory where sampling is done without replacement (simple random sampling). This online tutorial on Nonparametric statistics has an illustration on computing the expectation and variance for a total.
You will notice that some authors use $N$ instead of $N-1$ in the denominator of the FPC; in fact, it depends on whether you work with the sample or population statistic: for the variance, it will be $N$ instead of $N-1$ if you are interested in $S^2$ rather than $\sigma^2$.
As for online references, I can suggest you
Estimation and statistical inference
A new look at inference for the Hypergeometric Distribution
Finite Population Sampling with Application to the Hypergeometric Distribution
Simple random sampling
|
Explanation of finite population correction factor?
|
The threshold is chosen such that it ensures convergence of the hypergeometric distribution ($\sqrt{\frac{N-n}{N-1}}$ is its SD), instead of a binomial distribution (for sampling with replacement), to
|
Explanation of finite population correction factor?
The threshold is chosen such that it ensures convergence of the hypergeometric distribution ($\sqrt{\frac{N-n}{N-1}}$ is its SD), instead of a binomial distribution (for sampling with replacement), to a normal distribution (this is the Central Limit Theorem, see e.g., The Normal Curve, the Central Limit Theorem, and Markov's and Chebychev's Inequalities for Random Variables). In other words, when $n/N\leq 0.05$ (i.e., $n$ is not 'too large' compared to $N$), the FPC can safely be ignored; it is easy to see how the correction factor evolves with varying $n$ for a fixed $N$: with $N=10,000$, we have $\text{FPC}=.9995$ when $n=10$ while $\text{FPC}=.3162$ when $n=9,000$. When $N\to\infty$, the FPC approaches 1 and we are close to the situation of sampling with replacement (i.e., like with an infinite population).
To understand this results, a good starting point is to read some online tutorials on sampling theory where sampling is done without replacement (simple random sampling). This online tutorial on Nonparametric statistics has an illustration on computing the expectation and variance for a total.
You will notice that some authors use $N$ instead of $N-1$ in the denominator of the FPC; in fact, it depends on whether you work with the sample or population statistic: for the variance, it will be $N$ instead of $N-1$ if you are interested in $S^2$ rather than $\sigma^2$.
As for online references, I can suggest you
Estimation and statistical inference
A new look at inference for the Hypergeometric Distribution
Finite Population Sampling with Application to the Hypergeometric Distribution
Simple random sampling
|
Explanation of finite population correction factor?
The threshold is chosen such that it ensures convergence of the hypergeometric distribution ($\sqrt{\frac{N-n}{N-1}}$ is its SD), instead of a binomial distribution (for sampling with replacement), to
|
6,624
|
Explanation of finite population correction factor?
|
As for the derivation, the setup goes as follows. Suppose we have a population of size $N$, with mean $\mu$ and variance $\sigma^2$, where each element can assume values $v_k$ for $k = 1, 2, \dots, m$. Let $n_k$ be the number of times that the value $v_k$ occurs in the population, such that the probability that we draw the value $v_k$ at random from the population is:
$$P(X=v_k) = \frac{n_k}{N}$$
We pick a sample of size $n$, without replacement, and we estimate the global mean $\mu$ with the estimator $\overline{X}=\frac{\sum_{i=1}^n X_i}{n}$.
We are going to find the formula of the finite population correction factor by looking at the variance of the estimator:
$$ \tag{1} \label{variance}
\mathrm{Var}(\overline{X}) = \mathrm{Var} \left( \frac{\sum_{i=1}^n X_i}{n} \right) = \frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \mathrm{Cov}(X_i, X_j)
$$
Notice that if we were doing sampling with replacement, the variables $X_i$ would be completely independent of each other, meaning that there would be no covariance between them:
$$ \mathrm{Cov}(X_i, X_j) = 0, \quad i \ne j $$
This would imply that we could discard all terms where $i \ne j$. Also, when $i$ and $j$ are equal the covariance is just the variance:
$$\mathrm{Cov}(X_i, X_i) = \mathrm{Var}(X_i) = \sigma^2$$
Which would mean we could work the variance like so:
\begin{align*}
\frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \mathrm{Cov}(X_i, X_j) &= \frac{1}{n^2} \sum_{i=1}^n \mathrm{Var}(X_i) \\
&= \frac{1}{n^2} \sum_{i=1}^n \sigma^2 \\
&= \frac{n \sigma^2}{n^2} \\
\mathrm{Var}(\overline{X}) &= \frac{\sigma^2}{n}
\end{align*}
This is the variance for sampling with replacement (or with an infinite population).
However, since we are doing sampling without replacement, the random variables $X_i$ aren't independent (considering we can't get a given element more than once, the probability that we get a certain value for a given $X_i$ depends on the values of the remaining ones). We treat the summation above by splitting the indices where $i=j$ and where $i\ne j$, similarly like we did the covariance for sampling with replacement:
\begin{align*}
\frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \mathrm{Cov}(X_i, X_j) &= \frac{1}{n^2} \left( \sum_{i=1}^n\sum_{j=i} \mathrm{Cov}(X_i, X_j) + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( \sum_{i=1}^n \mathrm{Var}(X_i) + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( \sum_{i=1}^n \sigma^2 + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( n \sigma^2 + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{\sigma^2}{n} + \frac{1}{n^2} \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \tag{2} \label{covariance}
\end{align*}
Straightaway we must find the covariance between $X_i$ and $X_j$ when $i \ne j$. Recall the definition of covariance:
$$ \mathrm{Cov} (X_i, X_j) = \mathrm{E}[X_i X_j] - \mathrm{E}[X_i]\mathrm{E}[X_j] $$
Since $\mathrm{E}[X_i] = \mathrm{E}[X_j] = \mu$, this yields:
$$\tag{3} \label{covariance expectation}
\mathrm{Cov} (X_i, X_j) = \mathrm{E}[X_i X_j] - \mu^2 $$
Immediately we proceed to calculate $\mathrm{E}[X_i X_j]$, which is defined as:
$$ \tag{4} \label{covariance expectation summation}
\mathrm{E}[X_i X_j] = \sum_{k=1}^m \sum_{l=1}^m v_k v_l \ P(X_i=v_k , X_j=v_l) $$
The tricky part is calculating the probability above, because this probability changes depending on whether $k=l$ or not. The whole thing becomes clearer using Bayes' theorem:
\begin{align*}
P(X_i=v_k, X_j=v_l) &= P(X_i = v_k)P(X_j=v_l | X_i=v_k)\end{align*}
Consider the case where $k=l$: this is equivalent to drawing the same value $v_k$ twice. The probability of drawing $v_k$ is $P(X_i=v_k)=\frac{n_k}{N}$, and doing so again (given that we already drew $v_k$) is:
$$P(X_j=v_k | X_i=v_k) = \frac{n_k-1}{N-1}$$
On the other hand, considering the case where $k \ne l$, if we draw $v_l$ given that we already drew $v_k$, we find that the number of occurences of $v_l$ in the population is unchanged ($n_l$). However, the total size of our population is now $N-1$. Hence:
$$P(X_j=v_l | X_i=v_k) = \frac{n_l}{N-1}, \quad k \ne l$$
Therefore, our probability is:
$$P(X_i=v_k, X_j=v_l) =
\begin{cases}
\dfrac{n_k (n_k - 1)}{N(N - 1)}, & \quad k=l\\
\dfrac{n_k n_l}{N(N-1)}, & \quad k \ne l
\end{cases}
$$
Because of this, we must split the summation at $\eqref{covariance expectation summation}$ on the indices where $k=l$ and $k \ne l$, as such:
\begin{align*}
\mathrm{E}[X_i X_j] &= \sum_{k=1}^m \sum_{l=1}^m v_k v_l \ P(X_i=v_k, X_j=v_l) \\
&= \sum_{k=1}^m \sum_{k=l} v_k^2 P(X_i=v_k, X_j=v_k) + \sum_{k=1}^m \sum_{k \ne l} v_k v_l P(X_i=v_k, X_j=v_l) \\
&= \sum_{k=1}^m v_k^2 \frac{n_k (n_k - 1)}{N(N-1)} + \sum_{k=1}^m \sum_{k \ne l} v_k v_l \frac{n_k n_l}{N(N-1)}
\end{align*}
Now we can pull the $N(N-1)$ factor out and do some manipulation on these sums:
\begin{align*}
\mathrm{E}[X_iX_j] &= \frac{1}{N(N-1)} \left( \sum_{k=1}^m v_k^2 n_k(n_k -1) + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l \right) \\
&= \frac{1}{N(N-1)} \left( \sum_{k=1}^m v_k^2 n_k^2 - \sum_{k=1}^m v_k^2 n_k + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l \right) \\
&= \frac{1}{N(N-1)} \left( \sum_{k=1}^m v_k^2 n_k^2 + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l - \sum_{k=1}^m v_k^2 n_k \right) \tag{5} \label{expanded summation}
\end{align*}
We must realize that there is a way to simplify this expression, by recalling that:
\begin{align*}
\left( \sum_i a_i \right)^2 &= \sum_i \sum_j a_i a_j \\
&= \sum_i a_i^2 + \sum_i \sum_{j \ne i} a_i a_j
\end{align*}
That is, if we square a sum, we can write the result splitting its indices. This means that the apparently intractable sum above is just:
$$ \sum_{k=1}^m v_k^2 n_k^2 + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l = \left( \sum_{k=1}^m v_k n_k \right)^2 $$
So we simplify $\eqref{expanded summation}$ to:
$$ \tag{6} \label{simplified expectation}
\mathrm{E}[X_iX_j] = \frac{1}{N(N-1)} \left( \left( \sum_{k=1}^m v_k n_k \right)^2 - \sum_{k=1}^m v_k^2 n_k \right) $$
We're almost done. Our task now is to represent the sums above in terms of known constants. Let us remember that, in the case where we have repeating values in our domain, the expected value $E[\cdot]$ can be written as:
$$ \mathrm{E}[X_i] = \frac{1}{N} \sum_{k=1}^m v_k n_k = \mu $$
The $n_k$ term accounts for the fact that we have more than one ocurrence of the value $v_k$. From this, it follows that:
\begin{gather*}
\sum_{k=1}^m v_k n_k = N \mu \\
\left( \sum_{k=1}^m v_k n_k \right)^2 = N^2 \mu^2 \tag{6.1} \label{square of sum}
\end{gather*}
Likewise, the expected value of the square of the variable can be written as:
$$ \mathrm{E}[X_i^2] = \frac{1}{N} \sum_{k=1}^m v_k^2 n_k $$
From the definition of variance this simplifies to another expression:
\begin{align*}
\mathrm{Var}(X_i) &= \mathrm{E}[X_i^2] - \mathrm{E}^2[X_i] \\
\sigma^2 &= \mathrm{E}[X_i^2] - \mu^2 \\
\mathrm{E}[X_i^2] &= \mu^2 + \sigma^2
\end{align*}
And it follows immediately that:
\begin{gather*} \sum_{k=1}^m v_k^2 n_k = N \ \mathrm{E}[X_i^2] \\
\sum_{k=1}^m v_k^2 n_k = N(\mu^2 + \sigma^2) \tag{6.2} \label{sum of squares}
\end{gather*}
Substituting $\eqref{square of sum}$ and $\eqref{sum of squares}$ back into $\eqref{simplified expectation}$, we get:
\begin{align*}
\mathrm{E}[X_iX_j] &= \frac{1}{N(N-1)} \left( \left( \sum_{k=1}^m v_k n_k \right)^2 - \sum_{k=1}^m v_k^2 n_k \right) \\
&= \frac{1}{N(N-1)} \left( N^2\mu^2 - N(\mu^2 + \sigma^2) \right) \\
&= \frac{N^2\mu^2 - N\mu^2 - N\sigma^2}{N(N-1)} \\
&= \frac{\mu^2N(N-1) - N\sigma^2}{N(N-1)} \\
&= \mu^2 - \frac{\sigma^2}{N-1}
\end{align*}
We substitute back yet again into $\eqref{covariance expectation}$ to find our covariance:
\begin{align*}
\mathrm{Cov}(X_i, X_j) &= \mathrm{E}[X_i X_j] - \mu^2 \\
&= \left( \mu^2 - \frac{\sigma^2}{N-1} \right) - \mu^2 \\
&= - \frac{\sigma^2}{N-1}
\end{align*}
At last:
$$ \tag{7} \label{covariance for i not j}
\boxed{\mathrm{Cov}(X_i, X_j) = - \dfrac{\sigma^2}{N-1}}$$
Lastly, we substitute $\eqref{covariance for i not j}$ into $\eqref{covariance}$ to find the variance of the estimator $\overline{X}$:
\begin{align*}
\mathrm{Var}(\overline{X}) &= \frac{1}{n^2} \left( n\sigma^2 + \sum_{i=1}^n \sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( n\sigma^2 - \sum_{i=1}^n \sum_{j \ne i} \frac{\sigma^2}{N-1} \right) \\
&= \frac{1}{n^2} \left( n\sigma^2 - \frac{n(n-1)\sigma^2}{N-1} \right) \\
&= \frac{\sigma^2}{n} - \frac{(n-1)\sigma^2}{(N-1)n}
\end{align*}
Wraping everything up, if we pull out the common $\frac{\sigma^2}{n}$ term, we find our desired correction factor for the variance:
$$ \boxed{\mathrm{Var}(\overline{X}) = \frac{\sigma^2}{n} \left( 1 - \frac{n-1}{N-1} \right)}$$
$$ \boxed{ \mathrm{FCF} = 1 - \frac{n-1}{N-1} } $$
So there it is. Also, $1 - \frac{n-1}{N-1} = \frac{N-n}{N-1}$, just in case anyone missed it.
|
Explanation of finite population correction factor?
|
As for the derivation, the setup goes as follows. Suppose we have a population of size $N$, with mean $\mu$ and variance $\sigma^2$, where each element can assume values $v_k$ for $k = 1, 2, \dots, m$
|
Explanation of finite population correction factor?
As for the derivation, the setup goes as follows. Suppose we have a population of size $N$, with mean $\mu$ and variance $\sigma^2$, where each element can assume values $v_k$ for $k = 1, 2, \dots, m$. Let $n_k$ be the number of times that the value $v_k$ occurs in the population, such that the probability that we draw the value $v_k$ at random from the population is:
$$P(X=v_k) = \frac{n_k}{N}$$
We pick a sample of size $n$, without replacement, and we estimate the global mean $\mu$ with the estimator $\overline{X}=\frac{\sum_{i=1}^n X_i}{n}$.
We are going to find the formula of the finite population correction factor by looking at the variance of the estimator:
$$ \tag{1} \label{variance}
\mathrm{Var}(\overline{X}) = \mathrm{Var} \left( \frac{\sum_{i=1}^n X_i}{n} \right) = \frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \mathrm{Cov}(X_i, X_j)
$$
Notice that if we were doing sampling with replacement, the variables $X_i$ would be completely independent of each other, meaning that there would be no covariance between them:
$$ \mathrm{Cov}(X_i, X_j) = 0, \quad i \ne j $$
This would imply that we could discard all terms where $i \ne j$. Also, when $i$ and $j$ are equal the covariance is just the variance:
$$\mathrm{Cov}(X_i, X_i) = \mathrm{Var}(X_i) = \sigma^2$$
Which would mean we could work the variance like so:
\begin{align*}
\frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \mathrm{Cov}(X_i, X_j) &= \frac{1}{n^2} \sum_{i=1}^n \mathrm{Var}(X_i) \\
&= \frac{1}{n^2} \sum_{i=1}^n \sigma^2 \\
&= \frac{n \sigma^2}{n^2} \\
\mathrm{Var}(\overline{X}) &= \frac{\sigma^2}{n}
\end{align*}
This is the variance for sampling with replacement (or with an infinite population).
However, since we are doing sampling without replacement, the random variables $X_i$ aren't independent (considering we can't get a given element more than once, the probability that we get a certain value for a given $X_i$ depends on the values of the remaining ones). We treat the summation above by splitting the indices where $i=j$ and where $i\ne j$, similarly like we did the covariance for sampling with replacement:
\begin{align*}
\frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \mathrm{Cov}(X_i, X_j) &= \frac{1}{n^2} \left( \sum_{i=1}^n\sum_{j=i} \mathrm{Cov}(X_i, X_j) + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( \sum_{i=1}^n \mathrm{Var}(X_i) + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( \sum_{i=1}^n \sigma^2 + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( n \sigma^2 + \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{\sigma^2}{n} + \frac{1}{n^2} \sum_{i=1}^n\sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \tag{2} \label{covariance}
\end{align*}
Straightaway we must find the covariance between $X_i$ and $X_j$ when $i \ne j$. Recall the definition of covariance:
$$ \mathrm{Cov} (X_i, X_j) = \mathrm{E}[X_i X_j] - \mathrm{E}[X_i]\mathrm{E}[X_j] $$
Since $\mathrm{E}[X_i] = \mathrm{E}[X_j] = \mu$, this yields:
$$\tag{3} \label{covariance expectation}
\mathrm{Cov} (X_i, X_j) = \mathrm{E}[X_i X_j] - \mu^2 $$
Immediately we proceed to calculate $\mathrm{E}[X_i X_j]$, which is defined as:
$$ \tag{4} \label{covariance expectation summation}
\mathrm{E}[X_i X_j] = \sum_{k=1}^m \sum_{l=1}^m v_k v_l \ P(X_i=v_k , X_j=v_l) $$
The tricky part is calculating the probability above, because this probability changes depending on whether $k=l$ or not. The whole thing becomes clearer using Bayes' theorem:
\begin{align*}
P(X_i=v_k, X_j=v_l) &= P(X_i = v_k)P(X_j=v_l | X_i=v_k)\end{align*}
Consider the case where $k=l$: this is equivalent to drawing the same value $v_k$ twice. The probability of drawing $v_k$ is $P(X_i=v_k)=\frac{n_k}{N}$, and doing so again (given that we already drew $v_k$) is:
$$P(X_j=v_k | X_i=v_k) = \frac{n_k-1}{N-1}$$
On the other hand, considering the case where $k \ne l$, if we draw $v_l$ given that we already drew $v_k$, we find that the number of occurences of $v_l$ in the population is unchanged ($n_l$). However, the total size of our population is now $N-1$. Hence:
$$P(X_j=v_l | X_i=v_k) = \frac{n_l}{N-1}, \quad k \ne l$$
Therefore, our probability is:
$$P(X_i=v_k, X_j=v_l) =
\begin{cases}
\dfrac{n_k (n_k - 1)}{N(N - 1)}, & \quad k=l\\
\dfrac{n_k n_l}{N(N-1)}, & \quad k \ne l
\end{cases}
$$
Because of this, we must split the summation at $\eqref{covariance expectation summation}$ on the indices where $k=l$ and $k \ne l$, as such:
\begin{align*}
\mathrm{E}[X_i X_j] &= \sum_{k=1}^m \sum_{l=1}^m v_k v_l \ P(X_i=v_k, X_j=v_l) \\
&= \sum_{k=1}^m \sum_{k=l} v_k^2 P(X_i=v_k, X_j=v_k) + \sum_{k=1}^m \sum_{k \ne l} v_k v_l P(X_i=v_k, X_j=v_l) \\
&= \sum_{k=1}^m v_k^2 \frac{n_k (n_k - 1)}{N(N-1)} + \sum_{k=1}^m \sum_{k \ne l} v_k v_l \frac{n_k n_l}{N(N-1)}
\end{align*}
Now we can pull the $N(N-1)$ factor out and do some manipulation on these sums:
\begin{align*}
\mathrm{E}[X_iX_j] &= \frac{1}{N(N-1)} \left( \sum_{k=1}^m v_k^2 n_k(n_k -1) + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l \right) \\
&= \frac{1}{N(N-1)} \left( \sum_{k=1}^m v_k^2 n_k^2 - \sum_{k=1}^m v_k^2 n_k + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l \right) \\
&= \frac{1}{N(N-1)} \left( \sum_{k=1}^m v_k^2 n_k^2 + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l - \sum_{k=1}^m v_k^2 n_k \right) \tag{5} \label{expanded summation}
\end{align*}
We must realize that there is a way to simplify this expression, by recalling that:
\begin{align*}
\left( \sum_i a_i \right)^2 &= \sum_i \sum_j a_i a_j \\
&= \sum_i a_i^2 + \sum_i \sum_{j \ne i} a_i a_j
\end{align*}
That is, if we square a sum, we can write the result splitting its indices. This means that the apparently intractable sum above is just:
$$ \sum_{k=1}^m v_k^2 n_k^2 + \sum_{k=1}^m \sum_{k \ne l} v_k n_k v_l n_l = \left( \sum_{k=1}^m v_k n_k \right)^2 $$
So we simplify $\eqref{expanded summation}$ to:
$$ \tag{6} \label{simplified expectation}
\mathrm{E}[X_iX_j] = \frac{1}{N(N-1)} \left( \left( \sum_{k=1}^m v_k n_k \right)^2 - \sum_{k=1}^m v_k^2 n_k \right) $$
We're almost done. Our task now is to represent the sums above in terms of known constants. Let us remember that, in the case where we have repeating values in our domain, the expected value $E[\cdot]$ can be written as:
$$ \mathrm{E}[X_i] = \frac{1}{N} \sum_{k=1}^m v_k n_k = \mu $$
The $n_k$ term accounts for the fact that we have more than one ocurrence of the value $v_k$. From this, it follows that:
\begin{gather*}
\sum_{k=1}^m v_k n_k = N \mu \\
\left( \sum_{k=1}^m v_k n_k \right)^2 = N^2 \mu^2 \tag{6.1} \label{square of sum}
\end{gather*}
Likewise, the expected value of the square of the variable can be written as:
$$ \mathrm{E}[X_i^2] = \frac{1}{N} \sum_{k=1}^m v_k^2 n_k $$
From the definition of variance this simplifies to another expression:
\begin{align*}
\mathrm{Var}(X_i) &= \mathrm{E}[X_i^2] - \mathrm{E}^2[X_i] \\
\sigma^2 &= \mathrm{E}[X_i^2] - \mu^2 \\
\mathrm{E}[X_i^2] &= \mu^2 + \sigma^2
\end{align*}
And it follows immediately that:
\begin{gather*} \sum_{k=1}^m v_k^2 n_k = N \ \mathrm{E}[X_i^2] \\
\sum_{k=1}^m v_k^2 n_k = N(\mu^2 + \sigma^2) \tag{6.2} \label{sum of squares}
\end{gather*}
Substituting $\eqref{square of sum}$ and $\eqref{sum of squares}$ back into $\eqref{simplified expectation}$, we get:
\begin{align*}
\mathrm{E}[X_iX_j] &= \frac{1}{N(N-1)} \left( \left( \sum_{k=1}^m v_k n_k \right)^2 - \sum_{k=1}^m v_k^2 n_k \right) \\
&= \frac{1}{N(N-1)} \left( N^2\mu^2 - N(\mu^2 + \sigma^2) \right) \\
&= \frac{N^2\mu^2 - N\mu^2 - N\sigma^2}{N(N-1)} \\
&= \frac{\mu^2N(N-1) - N\sigma^2}{N(N-1)} \\
&= \mu^2 - \frac{\sigma^2}{N-1}
\end{align*}
We substitute back yet again into $\eqref{covariance expectation}$ to find our covariance:
\begin{align*}
\mathrm{Cov}(X_i, X_j) &= \mathrm{E}[X_i X_j] - \mu^2 \\
&= \left( \mu^2 - \frac{\sigma^2}{N-1} \right) - \mu^2 \\
&= - \frac{\sigma^2}{N-1}
\end{align*}
At last:
$$ \tag{7} \label{covariance for i not j}
\boxed{\mathrm{Cov}(X_i, X_j) = - \dfrac{\sigma^2}{N-1}}$$
Lastly, we substitute $\eqref{covariance for i not j}$ into $\eqref{covariance}$ to find the variance of the estimator $\overline{X}$:
\begin{align*}
\mathrm{Var}(\overline{X}) &= \frac{1}{n^2} \left( n\sigma^2 + \sum_{i=1}^n \sum_{j \ne i} \mathrm{Cov}(X_i, X_j) \right) \\
&= \frac{1}{n^2} \left( n\sigma^2 - \sum_{i=1}^n \sum_{j \ne i} \frac{\sigma^2}{N-1} \right) \\
&= \frac{1}{n^2} \left( n\sigma^2 - \frac{n(n-1)\sigma^2}{N-1} \right) \\
&= \frac{\sigma^2}{n} - \frac{(n-1)\sigma^2}{(N-1)n}
\end{align*}
Wraping everything up, if we pull out the common $\frac{\sigma^2}{n}$ term, we find our desired correction factor for the variance:
$$ \boxed{\mathrm{Var}(\overline{X}) = \frac{\sigma^2}{n} \left( 1 - \frac{n-1}{N-1} \right)}$$
$$ \boxed{ \mathrm{FCF} = 1 - \frac{n-1}{N-1} } $$
So there it is. Also, $1 - \frac{n-1}{N-1} = \frac{N-n}{N-1}$, just in case anyone missed it.
|
Explanation of finite population correction factor?
As for the derivation, the setup goes as follows. Suppose we have a population of size $N$, with mean $\mu$ and variance $\sigma^2$, where each element can assume values $v_k$ for $k = 1, 2, \dots, m$
|
6,625
|
Explanation of finite population correction factor?
|
Here is an alternative setup within the framework of the superpopulation model of sampling theory. It differs in notation and conception to classical sampling theory, but I think it is quite simple and intuitive.
Let $X_1,X_2,X_3,...$ be an exchangeable "superpopulation" of values. Take the first $N$ values to be the finite population of interest and the first $n \leqslant N$ values as a sample from this population. (The exchangeability of the superpopulation means that the sample is a simple-random-sample from the population.) Now, consider the mean-difference $\bar{X}_n - \bar{X}_N$ measuring the difference between the sample mean and population mean. This quantity can be written in the form:
$$\begin{align}
\bar{X}_n - \bar{X}_N
&= \frac{1}{n} \sum_{i=1}^n X_i - \frac{1}{N} \sum_{i=1}^N X_i \\[6pt]
&= \Big( \frac{1}{n} - \frac{1}{N} \Big) \sum_{i=1}^n X_i - \frac{1}{N} \sum_{i=n+1}^N X_i \\[6pt]
&= \frac{N-n}{nN} \sum_{i=1}^n X_i - \frac{1}{N} \sum_{i=n+1}^N X_i \\[6pt]
&= \frac{1}{n} \Bigg[ \frac{N-n}{N} \sum_{i=1}^n X_i - \frac{n}{N} \sum_{i=n+1}^N X_i \Bigg]. \\[6pt]
\end{align}$$
We clearly have $\mathbb{E}(\bar{X}_n - \bar{X}_N) = 0$, so we can use the sample mean as an unbiased estimator for the population mean. If we denote the variance of the superpopulation by $\sigma^2$ then our quantity has variance:
$$\begin{align}
\mathbb{V}(\bar{X}_n - \bar{X}_N)
&= \frac{1}{n^2} \Bigg[ \Big( \frac{N-n}{N} \Big)^2 \sum_{i=1}^n \mathbb{V}(X_i) + \Big( \frac{n}{N} \Big)^2 \sum_{i=n+1}^N \mathbb{V}(X_i) \Bigg] \\[6pt]
&= \frac{1}{n^2} \Bigg[ \Big( \frac{N-n}{N} \Big)^2 n \sigma^2 + \Big( \frac{n}{N} \Big)^2 (N-n) \sigma^2 \Bigg] \\[6pt]
&= \frac{1}{n^2 N^2} \Bigg[ (N-n)^2 n \sigma^2 + n^2 (N-n) \sigma^2 \Bigg] \\[6pt]
&= \frac{1}{n^2 N^2} \cdot (N-n) N n \sigma^2 \\[6pt]
&= \frac{N-n}{N} \cdot \frac{\sigma^2}{n}. \\[6pt]
\end{align}$$
Suppose we let $S_N^2$ and $S_{N*}^2$ denote the variance values for the population, where the first uses Bessel's correction and the second does not (so we have $S_N^2 = \frac{N}{N-1} S_{N*}^2$). In classical sampling theory the latter quantity is considered to be "the variance" of the population. (Formally it is the variance of the empirical distribution of the population.) However, the first of these quantities is an unbiased estimator for the superpopulation variance, so we can estimate the variance of our mean-difference quantity by:
$$\begin{align}
\hat{\mathbb{V}}(\bar{X}_n - \bar{X}_N)
&= \frac{N-n}{N} \cdot \frac{S_N^2}{n}. \\[6pt]
\end{align}$$
Consequently, using the central limit theorem we can establish the following confidence interval for the population mean $\bar{X}_N$:
$$\text{CI}_N(1-\alpha) = \Bigg[ \bar{X}_n \pm \sqrt{\frac{N-n}{N}} \cdot \frac{t_{n-1, \alpha/2}}{\sqrt{n}} \cdot S_{N} \Bigg].$$
This is the form of the confidence interval that I find the most natural. However, with this form, you will notice that we use a finite population correction term that is different to your expression. The expression you are using occurs when we convert to the variance estimator $S_{N*}^2$ that does not use Bessel's correction (purportedly "the variance" of the population). In this case we have the equivalent expression:
$$\text{CI}_N(1-\alpha) = \Bigg[ \bar{X}_n \pm \sqrt{\frac{N-n}{N-1}} \cdot \frac{t_{n-1, \alpha/2}}{\sqrt{n}} \cdot S_{N*} \Bigg].$$
As you can see, framed in this latter form, the finite population correction term is the one in your question. You can see that the finite population correction term appears in the confidence interval formula in order to "correct" for the finite population. Taking $N \rightarrow \infty$ (so that the population of interest is the superpopulation) we get $FPC \rightarrow 1$, yielding the standard confidence interval for the mean parameter of a "large" population.
Now, as to the "5% rule", that is an arbitrary rule, and I don't recommend it. In my view it is best to always include the FPC when you have a finite population. If the sample proportion is small then the FPC is close to one, so it does not change the interval much, but I find it silly to remove it. Practitioners who offer these rules-of-thumb evidently think that with an FPC close to one they should remove the term, but I see no sense in that; it is an approximation for approximation's sake.
I hope this alternative presentation of the matter elucidates the correction term within the broader framework of the superpopulation model. I have always preferred this model of sampling theory, since it makes it simpler to distinguish between the finite population case and the infinite population case. As you can see, within this framework the correction term pops out fairly simply in the course of attempting to estimate the mean of the finite population.
|
Explanation of finite population correction factor?
|
Here is an alternative setup within the framework of the superpopulation model of sampling theory. It differs in notation and conception to classical sampling theory, but I think it is quite simple a
|
Explanation of finite population correction factor?
Here is an alternative setup within the framework of the superpopulation model of sampling theory. It differs in notation and conception to classical sampling theory, but I think it is quite simple and intuitive.
Let $X_1,X_2,X_3,...$ be an exchangeable "superpopulation" of values. Take the first $N$ values to be the finite population of interest and the first $n \leqslant N$ values as a sample from this population. (The exchangeability of the superpopulation means that the sample is a simple-random-sample from the population.) Now, consider the mean-difference $\bar{X}_n - \bar{X}_N$ measuring the difference between the sample mean and population mean. This quantity can be written in the form:
$$\begin{align}
\bar{X}_n - \bar{X}_N
&= \frac{1}{n} \sum_{i=1}^n X_i - \frac{1}{N} \sum_{i=1}^N X_i \\[6pt]
&= \Big( \frac{1}{n} - \frac{1}{N} \Big) \sum_{i=1}^n X_i - \frac{1}{N} \sum_{i=n+1}^N X_i \\[6pt]
&= \frac{N-n}{nN} \sum_{i=1}^n X_i - \frac{1}{N} \sum_{i=n+1}^N X_i \\[6pt]
&= \frac{1}{n} \Bigg[ \frac{N-n}{N} \sum_{i=1}^n X_i - \frac{n}{N} \sum_{i=n+1}^N X_i \Bigg]. \\[6pt]
\end{align}$$
We clearly have $\mathbb{E}(\bar{X}_n - \bar{X}_N) = 0$, so we can use the sample mean as an unbiased estimator for the population mean. If we denote the variance of the superpopulation by $\sigma^2$ then our quantity has variance:
$$\begin{align}
\mathbb{V}(\bar{X}_n - \bar{X}_N)
&= \frac{1}{n^2} \Bigg[ \Big( \frac{N-n}{N} \Big)^2 \sum_{i=1}^n \mathbb{V}(X_i) + \Big( \frac{n}{N} \Big)^2 \sum_{i=n+1}^N \mathbb{V}(X_i) \Bigg] \\[6pt]
&= \frac{1}{n^2} \Bigg[ \Big( \frac{N-n}{N} \Big)^2 n \sigma^2 + \Big( \frac{n}{N} \Big)^2 (N-n) \sigma^2 \Bigg] \\[6pt]
&= \frac{1}{n^2 N^2} \Bigg[ (N-n)^2 n \sigma^2 + n^2 (N-n) \sigma^2 \Bigg] \\[6pt]
&= \frac{1}{n^2 N^2} \cdot (N-n) N n \sigma^2 \\[6pt]
&= \frac{N-n}{N} \cdot \frac{\sigma^2}{n}. \\[6pt]
\end{align}$$
Suppose we let $S_N^2$ and $S_{N*}^2$ denote the variance values for the population, where the first uses Bessel's correction and the second does not (so we have $S_N^2 = \frac{N}{N-1} S_{N*}^2$). In classical sampling theory the latter quantity is considered to be "the variance" of the population. (Formally it is the variance of the empirical distribution of the population.) However, the first of these quantities is an unbiased estimator for the superpopulation variance, so we can estimate the variance of our mean-difference quantity by:
$$\begin{align}
\hat{\mathbb{V}}(\bar{X}_n - \bar{X}_N)
&= \frac{N-n}{N} \cdot \frac{S_N^2}{n}. \\[6pt]
\end{align}$$
Consequently, using the central limit theorem we can establish the following confidence interval for the population mean $\bar{X}_N$:
$$\text{CI}_N(1-\alpha) = \Bigg[ \bar{X}_n \pm \sqrt{\frac{N-n}{N}} \cdot \frac{t_{n-1, \alpha/2}}{\sqrt{n}} \cdot S_{N} \Bigg].$$
This is the form of the confidence interval that I find the most natural. However, with this form, you will notice that we use a finite population correction term that is different to your expression. The expression you are using occurs when we convert to the variance estimator $S_{N*}^2$ that does not use Bessel's correction (purportedly "the variance" of the population). In this case we have the equivalent expression:
$$\text{CI}_N(1-\alpha) = \Bigg[ \bar{X}_n \pm \sqrt{\frac{N-n}{N-1}} \cdot \frac{t_{n-1, \alpha/2}}{\sqrt{n}} \cdot S_{N*} \Bigg].$$
As you can see, framed in this latter form, the finite population correction term is the one in your question. You can see that the finite population correction term appears in the confidence interval formula in order to "correct" for the finite population. Taking $N \rightarrow \infty$ (so that the population of interest is the superpopulation) we get $FPC \rightarrow 1$, yielding the standard confidence interval for the mean parameter of a "large" population.
Now, as to the "5% rule", that is an arbitrary rule, and I don't recommend it. In my view it is best to always include the FPC when you have a finite population. If the sample proportion is small then the FPC is close to one, so it does not change the interval much, but I find it silly to remove it. Practitioners who offer these rules-of-thumb evidently think that with an FPC close to one they should remove the term, but I see no sense in that; it is an approximation for approximation's sake.
I hope this alternative presentation of the matter elucidates the correction term within the broader framework of the superpopulation model. I have always preferred this model of sampling theory, since it makes it simpler to distinguish between the finite population case and the infinite population case. As you can see, within this framework the correction term pops out fairly simply in the course of attempting to estimate the mean of the finite population.
|
Explanation of finite population correction factor?
Here is an alternative setup within the framework of the superpopulation model of sampling theory. It differs in notation and conception to classical sampling theory, but I think it is quite simple a
|
6,626
|
Meaning (and proof) of "RNN can approximate any algorithm"
|
Background
We first have to go over some concepts from the theory of computation. An algorithm is a procedure for calculating a function. Given the input, the algorithm must produce the correct output in a finite number of steps and then terminate. To say that a function is computable means that there exists an algorithm for calculating it. Among the infinite set of all functions, most are not computable. Turing machines are a mathematical model that formalizes the notion of computation. Other equivalent models exist, but Turing machines are the standard 'reference model'. According to the Church-Turing thesis, any algorithm can be implemented by a Turing machine, and all computable functions can be computed thusly. Any particular instance of a Turing machine only computes a particular function. But, there exist a special class of Turing machines called universal Turing machines that can simulate any other Turing machine for any input. They do this by taking a description of the machine to be simulated (and its input) as part of their own input. Any particular instance of a Universal Turing machine can therefore compute any computable function (i.e. can implement any algorithm). Any system that shares this ability is called Turing complete. One way to prove that a system is Turing complete is to show that it can simulate a universal Turing machine. Many systems have been shown to be Turing complete (e.g. most programming languages, certain cellular automata, and quantum mechanics).
Recurrent neural networks
The following paper shows that, for any computable function, there exists a finite recurrent neural network (RNN) that can compute it. Furthermore, there exist finite RNNs that are Turing complete, and can therefore implement any algorithm.
Siegelmann and Sontag (1992). On the computational power of neural nets
They use networks containing a finite number of recurrently connected units, which receive external inputs at each time point. The state of each unit is given by a weighted sum of its inputs (plus a bias), run through a nonlinear activation function. The activation function is a saturated linear function, which is a piecewise linear approximation of a sigmoid. The weights and biases are fixed, so no learning occurs.
The network performs a mapping from a binary input sequence to a binary output sequence. There are two external inputs to the network, which are fed to all units: a 'data line' and a 'validation line'. The data line contains the input sequence of zeros and ones, then zero after the input sequence is finished. The validation line lets the network know when the input sequence is happening. It contains one for the duration of the input sequence, then zero after it has finished. One unit is considered to be the 'output unit'. It outputs zeros for some arbitrary delay, then the output sequence of zeros and ones, then zero after the output sequence has finished. Another unit is considered to be the 'validation unit', which let's us know when the output sequence is happening. It outputs one while the output sequence is happening, and zero otherwise.
Although these RNNs map binary input sequences to binary output sequences, we might be interested in functions defined on various other mathematical objects (other types of numbers, vectors, images, graphs, etc.). But, for any computable function, these other types of objects can be encoded as binary sequences (e.g. see here for a description of encoding other objects using natural numbers, which can in turn be represented in binary).
Result
They show that, for every computable function, there exists a finite RNN (of the form described above) that can compute it. They do this by showing that it's possible to use a RNN to explicitly simulate a pushdown automaton with two stacks. This is another model that's computationally equivalent to a Turing machine. Any computable function can be computed by a Turing machine. Any Turing machine can be simulated by a pushdown automaton with two stacks. Any pushdown automaton with two stacks can be simulated by a RNN. Therefore, any computable function can be computed by a RNN. Furthermore, because some Turing machines are universal, the RNNs that simulate them are Turing complete, and can therefore implement any algorithm. In particular, they show that there exist Turing complete RNNs with 1058 or fewer units.
Other consequences
An interesting consequence of the simulation results is that certain questions about the behavior of RNNs are undecidable. This means that there exists no algorithm that can answer them for arbitrary RNNs (although they may be answerable in the case of particular RNNs). For example, the question of whether a given unit ever takes the value 0 is undecidable; if one could answer this question in general, it would be possible to solve the halting problem for Turing machines, which is undecidable.
Computational power
In the above paper, all network parameters and states are rational numbers. This is important because it constrains the power of the RNNs, and makes the resulting networks more realistic. The reason is that the rationals are computable numbers, which means that there exists an algorithm for calculating them to arbitrary precision. Most real numbers are uncomputable, and therefore inaccessible--even the most powerful Turing machine can't represent them, and many people doubt that they could even be represented in the physical world. When we deal with 'real numbers' on digital computers, we're accessing an even smaller subset (e.g. 64 bit floating point numbers). Representing arbitrary real numbers would require infinite information.
The paper says that giving the network access to real numbers would boost the computational power even further, beyond Turing machines. Siegelmann wrote a number of other papers exploring this 'super-Turing' capability. However, it's important to note that these are mathematical models, and the results don't mean that such a machine could actually exist in the physical world. There are good reasons to think that it couldn't, although it's an open question.
|
Meaning (and proof) of "RNN can approximate any algorithm"
|
Background
We first have to go over some concepts from the theory of computation. An algorithm is a procedure for calculating a function. Given the input, the algorithm must produce the correct output
|
Meaning (and proof) of "RNN can approximate any algorithm"
Background
We first have to go over some concepts from the theory of computation. An algorithm is a procedure for calculating a function. Given the input, the algorithm must produce the correct output in a finite number of steps and then terminate. To say that a function is computable means that there exists an algorithm for calculating it. Among the infinite set of all functions, most are not computable. Turing machines are a mathematical model that formalizes the notion of computation. Other equivalent models exist, but Turing machines are the standard 'reference model'. According to the Church-Turing thesis, any algorithm can be implemented by a Turing machine, and all computable functions can be computed thusly. Any particular instance of a Turing machine only computes a particular function. But, there exist a special class of Turing machines called universal Turing machines that can simulate any other Turing machine for any input. They do this by taking a description of the machine to be simulated (and its input) as part of their own input. Any particular instance of a Universal Turing machine can therefore compute any computable function (i.e. can implement any algorithm). Any system that shares this ability is called Turing complete. One way to prove that a system is Turing complete is to show that it can simulate a universal Turing machine. Many systems have been shown to be Turing complete (e.g. most programming languages, certain cellular automata, and quantum mechanics).
Recurrent neural networks
The following paper shows that, for any computable function, there exists a finite recurrent neural network (RNN) that can compute it. Furthermore, there exist finite RNNs that are Turing complete, and can therefore implement any algorithm.
Siegelmann and Sontag (1992). On the computational power of neural nets
They use networks containing a finite number of recurrently connected units, which receive external inputs at each time point. The state of each unit is given by a weighted sum of its inputs (plus a bias), run through a nonlinear activation function. The activation function is a saturated linear function, which is a piecewise linear approximation of a sigmoid. The weights and biases are fixed, so no learning occurs.
The network performs a mapping from a binary input sequence to a binary output sequence. There are two external inputs to the network, which are fed to all units: a 'data line' and a 'validation line'. The data line contains the input sequence of zeros and ones, then zero after the input sequence is finished. The validation line lets the network know when the input sequence is happening. It contains one for the duration of the input sequence, then zero after it has finished. One unit is considered to be the 'output unit'. It outputs zeros for some arbitrary delay, then the output sequence of zeros and ones, then zero after the output sequence has finished. Another unit is considered to be the 'validation unit', which let's us know when the output sequence is happening. It outputs one while the output sequence is happening, and zero otherwise.
Although these RNNs map binary input sequences to binary output sequences, we might be interested in functions defined on various other mathematical objects (other types of numbers, vectors, images, graphs, etc.). But, for any computable function, these other types of objects can be encoded as binary sequences (e.g. see here for a description of encoding other objects using natural numbers, which can in turn be represented in binary).
Result
They show that, for every computable function, there exists a finite RNN (of the form described above) that can compute it. They do this by showing that it's possible to use a RNN to explicitly simulate a pushdown automaton with two stacks. This is another model that's computationally equivalent to a Turing machine. Any computable function can be computed by a Turing machine. Any Turing machine can be simulated by a pushdown automaton with two stacks. Any pushdown automaton with two stacks can be simulated by a RNN. Therefore, any computable function can be computed by a RNN. Furthermore, because some Turing machines are universal, the RNNs that simulate them are Turing complete, and can therefore implement any algorithm. In particular, they show that there exist Turing complete RNNs with 1058 or fewer units.
Other consequences
An interesting consequence of the simulation results is that certain questions about the behavior of RNNs are undecidable. This means that there exists no algorithm that can answer them for arbitrary RNNs (although they may be answerable in the case of particular RNNs). For example, the question of whether a given unit ever takes the value 0 is undecidable; if one could answer this question in general, it would be possible to solve the halting problem for Turing machines, which is undecidable.
Computational power
In the above paper, all network parameters and states are rational numbers. This is important because it constrains the power of the RNNs, and makes the resulting networks more realistic. The reason is that the rationals are computable numbers, which means that there exists an algorithm for calculating them to arbitrary precision. Most real numbers are uncomputable, and therefore inaccessible--even the most powerful Turing machine can't represent them, and many people doubt that they could even be represented in the physical world. When we deal with 'real numbers' on digital computers, we're accessing an even smaller subset (e.g. 64 bit floating point numbers). Representing arbitrary real numbers would require infinite information.
The paper says that giving the network access to real numbers would boost the computational power even further, beyond Turing machines. Siegelmann wrote a number of other papers exploring this 'super-Turing' capability. However, it's important to note that these are mathematical models, and the results don't mean that such a machine could actually exist in the physical world. There are good reasons to think that it couldn't, although it's an open question.
|
Meaning (and proof) of "RNN can approximate any algorithm"
Background
We first have to go over some concepts from the theory of computation. An algorithm is a procedure for calculating a function. Given the input, the algorithm must produce the correct output
|
6,627
|
Meaning (and proof) of "RNN can approximate any algorithm"
|
I think this is what you're looking for. This guy proved that a multilayer, or even a single layer feedforward network could approximate any function, provided that the net has enough hidden units.
Hornik, K. (1991). Approximation capabilities of multilayer feedforward networks. Neural networks, 4(2), 251-257.
|
Meaning (and proof) of "RNN can approximate any algorithm"
|
I think this is what you're looking for. This guy proved that a multilayer, or even a single layer feedforward network could approximate any function, provided that the net has enough hidden units.
Ho
|
Meaning (and proof) of "RNN can approximate any algorithm"
I think this is what you're looking for. This guy proved that a multilayer, or even a single layer feedforward network could approximate any function, provided that the net has enough hidden units.
Hornik, K. (1991). Approximation capabilities of multilayer feedforward networks. Neural networks, 4(2), 251-257.
|
Meaning (and proof) of "RNN can approximate any algorithm"
I think this is what you're looking for. This guy proved that a multilayer, or even a single layer feedforward network could approximate any function, provided that the net has enough hidden units.
Ho
|
6,628
|
Meaning (and proof) of "RNN can approximate any algorithm"
|
RNN also means Random Neural Network. Its approximation capability was proved in two papers:
Erol Gelenbe, Zhi-Hong Mao, Yan-Da Li: Function approximation with spiked random networks. IEEE Trans. Neural Networks 10(1): 3-9 (1999)
Erol Gelenbe, Zhi-Hong Mao and Yan-Da Li: Function Approximation by Random Neural Networks with a Bounded Number of Layers, Advances in Computer Science and Engineering: Texts. Computer System Performance Modeling in Perspective, pp. 35-58 (2006) https://doi.org/10.1142/9781860948923_0005
|
Meaning (and proof) of "RNN can approximate any algorithm"
|
RNN also means Random Neural Network. Its approximation capability was proved in two papers:
Erol Gelenbe, Zhi-Hong Mao, Yan-Da Li: Function approximation with spiked random networks. IEEE Trans. Neur
|
Meaning (and proof) of "RNN can approximate any algorithm"
RNN also means Random Neural Network. Its approximation capability was proved in two papers:
Erol Gelenbe, Zhi-Hong Mao, Yan-Da Li: Function approximation with spiked random networks. IEEE Trans. Neural Networks 10(1): 3-9 (1999)
Erol Gelenbe, Zhi-Hong Mao and Yan-Da Li: Function Approximation by Random Neural Networks with a Bounded Number of Layers, Advances in Computer Science and Engineering: Texts. Computer System Performance Modeling in Perspective, pp. 35-58 (2006) https://doi.org/10.1142/9781860948923_0005
|
Meaning (and proof) of "RNN can approximate any algorithm"
RNN also means Random Neural Network. Its approximation capability was proved in two papers:
Erol Gelenbe, Zhi-Hong Mao, Yan-Da Li: Function approximation with spiked random networks. IEEE Trans. Neur
|
6,629
|
When do Poisson and negative binomial regressions fit the same coefficients?
|
You have discovered an intimate, but generic, property of GLMs fit by maximum likelihood. The result drops out once one considers the simplest case of all: Fitting a single parameter to a single observation!
One sentence answer: If all we care about is fitting separate means to disjoint subsets of our sample, then GLMs will always yield $\hat\mu_j = \bar y_j$ for each subset $j$, so the actual error structure and parametrization of the density both become irrelevant to the (point) estimation!
A bit more: Fitting orthogonal categorical factors by maximum likelihood is equivalent to fitting separate means to disjoint subsets of our sample, so this explains why Poisson and negative binomial GLMs yield the same parameter estimates. Indeed, the same happens whether we use Poisson, negbin, Gaussian, inverse Gaussian or Gamma regression (see below). In the Poisson and negbin case, the default link function is the $\log$ link, but that is a red herring; while this yields the same raw parameter estimates, we'll see below that this property really has nothing to do with the link function at all.
When we are interested in a parametrization with more structure, or that depends on continuous predictors, then the assumed error structure becomes relevant due to the mean-variance relationship of the distribution as it relates to the parameters and the nonlinear function used for modeling the conditional means.
GLMs and exponential dispersion families: Crash course
An exponential dispersion family in natural form is one such that the log density is of the form
$$
\log f(y;\,\theta,\nu) = \frac{\theta y - b(\theta)}{\nu} + a(y,\nu) \>.
$$
Here $\theta$ is the natural parameter and $\nu$ is the dispersion parameter. If $\nu$ were known, this would just be a standard one-parameter exponential family. All the GLMs considered below assume an error model from this family.
Consider a sample of a single observation from this family. If we fit $\theta$ by maximum likelihood, we get that $y = b'(\hat\theta)$, irrespective of the value of $\nu$. This readily extends to the case of an iid sample since the log likelihoods add, yielding $\bar y = b'(\hat\theta)$.
But, we also know, due to the nice regularity of the log density as a function of $\theta$, that
$$
\frac{\partial}{\partial \theta} \mathbb E \log f(Y;\theta,\nu) = \mathbb E \frac{\partial}{\partial \theta} \log f(Y;\theta,\nu) = 0 \>.
$$
So, in fact $b'(\theta) = \mathbb E Y = \mu$.
Since maximum likelihood estimates are invariant under transformations, this means that
$
\bar y = \hat\mu
$
for this family of densities.
Now, in a GLM, we model $\mu_i$ as $\mu_i = g^{-1}(\mathbf x_i^T \beta)$ where $g$ is the link function. But if $\mathbf x_i$ is a vector of all zeros except for a single 1 in position $j$, then $\mu_i = g(\beta_j)$. The likelihood of the GLM then factorizes according to the $\beta_j$'s and we proceed as above. This is precisely the case of orthogonal factors.
What's so different about continuous predictors?
When the predictors are continuous or they are categorical, but cannot be reduced to an orthogonal form, then the likelihood no longer factors into individual terms with a separate mean depending on a separate parameter. At this point, the error structure and link function do come into play.
If one cranks through the (tedious) algebra, the likelihood equations become
$$
\sum_{i=1}^n \frac{(y_i - \mu_i)x_{ij}}{\sigma_i^2}\frac{\partial \mu_i}{\partial \lambda_i} = 0\>,
$$
for all $j = 1,\ldots,p$ where $\lambda_i = \mathbf x_i^T \beta$. Here, the $\beta$ and $\nu$ parameters enter implicitly through the link relationship $\mu_i = g(\lambda_i) = g(\mathbf x_i^T \beta)$ and variance $\sigma_i^2$.
In this way, the link function and assumed error model become relevant to the estimation.
Example: The error model (almost) doesn't matter
In the example below, we generate negative binomial random data depending on three categorical factors. Each observation comes from a single category and the same dispersion parameter ($k = 6$) is used.
We then fit to these data using five different GLMs, each with a $\log$ link: (a) negative binomial, (b) Poisson, (c) Gaussian, (d) Inverse Gaussian and (e) Gamma GLMs. All of these are examples of exponential dispersion families.
From the table, we can see that the parameter estimates are identical, even though some of these GLMs are for discrete data and others are for continuous,and some are for nonnegative data while others are not.
negbin poisson gaussian invgauss gamma
XX1 4.234107 4.234107 4.234107 4.234107 4.234107
XX2 4.790820 4.790820 4.790820 4.790820 4.790820
XX3 4.841033 4.841033 4.841033 4.841033 4.841033
The caveat in the heading comes from the fact that the fitting procedure will fail if the observations don't fall within the domain of the particular density. For example, if we had $0$ counts randomly generated in the data above, then the Gamma GLM would fail to converge since Gamma GLMs require strictly positive data.
Example: The link function (almost) doesn't matter
Using the same data, we repeat the procedure fitting the data with a Poisson GLM with three different link functions: (a) $\log$ link, (b) identity link and (c) square-root link. The table below shows the coefficient estimates after converting back to the log parameterization. (So, the second column showns $\log(\hat \beta)$ and the third shows $\log(\hat \beta^2)$ using the raw $\hat\beta$ from each of the fits). Again, the estimates are identical.
> coefs.po
log id sqrt
XX1 4.234107 4.234107 4.234107
XX2 4.790820 4.790820 4.790820
XX3 4.841033 4.841033 4.841033
The caveat in the heading simply refers to the fact that the raw estimates will vary with the link function, but the implied mean-parameter estimates will not.
R code
# Warning! This code is a bit simplified for compactness.
library(MASS)
n <- 5
m <- 3
set.seed(17)
b <- exp(5+rnorm(m))
k <- 6
# Random negbin data; orthogonal factors
y <- rnbinom(m*n, size=k, mu=rep(b,each=n))
X <- factor(paste("X",rep(1:m,each=n),sep=""))
# Fit a bunch of GLMs with a log link
con <- glm.control(maxit=100)
mnb <- glm(y~X+0, family=negative.binomial(theta=2))
mpo <- glm(y~X+0, family="poisson")
mga <- glm(y~X+0, family=gaussian(link=log), start=rep(1,m), control=con)
miv <- glm(y~X+0, family=inverse.gaussian(link=log), start=rep(2,m), control=con)
mgm <- glm(y~X+0, family=Gamma(link=log), start=rep(1,m), control=con)
coefs <- cbind(negbin=mnb$coef, poisson=mpo$coef, gaussian=mga$coef
invgauss=miv$coef, gamma=mgm$coef)
# Fit a bunch of Poisson GLMs with different links.
mpo.log <- glm(y~X+0, family=poisson(link="log"))
mpo.id <- glm(y~X+0, family=poisson(link="identity"))
mpo.sqrt <- glm(y~X+0, family=poisson(link="sqrt"))
coefs.po <- cbind(log=mpo$coef, id=log(mpo.id$coef), sqrt=log(mpo.sqrt$coef^2))
|
When do Poisson and negative binomial regressions fit the same coefficients?
|
You have discovered an intimate, but generic, property of GLMs fit by maximum likelihood. The result drops out once one considers the simplest case of all: Fitting a single parameter to a single obser
|
When do Poisson and negative binomial regressions fit the same coefficients?
You have discovered an intimate, but generic, property of GLMs fit by maximum likelihood. The result drops out once one considers the simplest case of all: Fitting a single parameter to a single observation!
One sentence answer: If all we care about is fitting separate means to disjoint subsets of our sample, then GLMs will always yield $\hat\mu_j = \bar y_j$ for each subset $j$, so the actual error structure and parametrization of the density both become irrelevant to the (point) estimation!
A bit more: Fitting orthogonal categorical factors by maximum likelihood is equivalent to fitting separate means to disjoint subsets of our sample, so this explains why Poisson and negative binomial GLMs yield the same parameter estimates. Indeed, the same happens whether we use Poisson, negbin, Gaussian, inverse Gaussian or Gamma regression (see below). In the Poisson and negbin case, the default link function is the $\log$ link, but that is a red herring; while this yields the same raw parameter estimates, we'll see below that this property really has nothing to do with the link function at all.
When we are interested in a parametrization with more structure, or that depends on continuous predictors, then the assumed error structure becomes relevant due to the mean-variance relationship of the distribution as it relates to the parameters and the nonlinear function used for modeling the conditional means.
GLMs and exponential dispersion families: Crash course
An exponential dispersion family in natural form is one such that the log density is of the form
$$
\log f(y;\,\theta,\nu) = \frac{\theta y - b(\theta)}{\nu} + a(y,\nu) \>.
$$
Here $\theta$ is the natural parameter and $\nu$ is the dispersion parameter. If $\nu$ were known, this would just be a standard one-parameter exponential family. All the GLMs considered below assume an error model from this family.
Consider a sample of a single observation from this family. If we fit $\theta$ by maximum likelihood, we get that $y = b'(\hat\theta)$, irrespective of the value of $\nu$. This readily extends to the case of an iid sample since the log likelihoods add, yielding $\bar y = b'(\hat\theta)$.
But, we also know, due to the nice regularity of the log density as a function of $\theta$, that
$$
\frac{\partial}{\partial \theta} \mathbb E \log f(Y;\theta,\nu) = \mathbb E \frac{\partial}{\partial \theta} \log f(Y;\theta,\nu) = 0 \>.
$$
So, in fact $b'(\theta) = \mathbb E Y = \mu$.
Since maximum likelihood estimates are invariant under transformations, this means that
$
\bar y = \hat\mu
$
for this family of densities.
Now, in a GLM, we model $\mu_i$ as $\mu_i = g^{-1}(\mathbf x_i^T \beta)$ where $g$ is the link function. But if $\mathbf x_i$ is a vector of all zeros except for a single 1 in position $j$, then $\mu_i = g(\beta_j)$. The likelihood of the GLM then factorizes according to the $\beta_j$'s and we proceed as above. This is precisely the case of orthogonal factors.
What's so different about continuous predictors?
When the predictors are continuous or they are categorical, but cannot be reduced to an orthogonal form, then the likelihood no longer factors into individual terms with a separate mean depending on a separate parameter. At this point, the error structure and link function do come into play.
If one cranks through the (tedious) algebra, the likelihood equations become
$$
\sum_{i=1}^n \frac{(y_i - \mu_i)x_{ij}}{\sigma_i^2}\frac{\partial \mu_i}{\partial \lambda_i} = 0\>,
$$
for all $j = 1,\ldots,p$ where $\lambda_i = \mathbf x_i^T \beta$. Here, the $\beta$ and $\nu$ parameters enter implicitly through the link relationship $\mu_i = g(\lambda_i) = g(\mathbf x_i^T \beta)$ and variance $\sigma_i^2$.
In this way, the link function and assumed error model become relevant to the estimation.
Example: The error model (almost) doesn't matter
In the example below, we generate negative binomial random data depending on three categorical factors. Each observation comes from a single category and the same dispersion parameter ($k = 6$) is used.
We then fit to these data using five different GLMs, each with a $\log$ link: (a) negative binomial, (b) Poisson, (c) Gaussian, (d) Inverse Gaussian and (e) Gamma GLMs. All of these are examples of exponential dispersion families.
From the table, we can see that the parameter estimates are identical, even though some of these GLMs are for discrete data and others are for continuous,and some are for nonnegative data while others are not.
negbin poisson gaussian invgauss gamma
XX1 4.234107 4.234107 4.234107 4.234107 4.234107
XX2 4.790820 4.790820 4.790820 4.790820 4.790820
XX3 4.841033 4.841033 4.841033 4.841033 4.841033
The caveat in the heading comes from the fact that the fitting procedure will fail if the observations don't fall within the domain of the particular density. For example, if we had $0$ counts randomly generated in the data above, then the Gamma GLM would fail to converge since Gamma GLMs require strictly positive data.
Example: The link function (almost) doesn't matter
Using the same data, we repeat the procedure fitting the data with a Poisson GLM with three different link functions: (a) $\log$ link, (b) identity link and (c) square-root link. The table below shows the coefficient estimates after converting back to the log parameterization. (So, the second column showns $\log(\hat \beta)$ and the third shows $\log(\hat \beta^2)$ using the raw $\hat\beta$ from each of the fits). Again, the estimates are identical.
> coefs.po
log id sqrt
XX1 4.234107 4.234107 4.234107
XX2 4.790820 4.790820 4.790820
XX3 4.841033 4.841033 4.841033
The caveat in the heading simply refers to the fact that the raw estimates will vary with the link function, but the implied mean-parameter estimates will not.
R code
# Warning! This code is a bit simplified for compactness.
library(MASS)
n <- 5
m <- 3
set.seed(17)
b <- exp(5+rnorm(m))
k <- 6
# Random negbin data; orthogonal factors
y <- rnbinom(m*n, size=k, mu=rep(b,each=n))
X <- factor(paste("X",rep(1:m,each=n),sep=""))
# Fit a bunch of GLMs with a log link
con <- glm.control(maxit=100)
mnb <- glm(y~X+0, family=negative.binomial(theta=2))
mpo <- glm(y~X+0, family="poisson")
mga <- glm(y~X+0, family=gaussian(link=log), start=rep(1,m), control=con)
miv <- glm(y~X+0, family=inverse.gaussian(link=log), start=rep(2,m), control=con)
mgm <- glm(y~X+0, family=Gamma(link=log), start=rep(1,m), control=con)
coefs <- cbind(negbin=mnb$coef, poisson=mpo$coef, gaussian=mga$coef
invgauss=miv$coef, gamma=mgm$coef)
# Fit a bunch of Poisson GLMs with different links.
mpo.log <- glm(y~X+0, family=poisson(link="log"))
mpo.id <- glm(y~X+0, family=poisson(link="identity"))
mpo.sqrt <- glm(y~X+0, family=poisson(link="sqrt"))
coefs.po <- cbind(log=mpo$coef, id=log(mpo.id$coef), sqrt=log(mpo.sqrt$coef^2))
|
When do Poisson and negative binomial regressions fit the same coefficients?
You have discovered an intimate, but generic, property of GLMs fit by maximum likelihood. The result drops out once one considers the simplest case of all: Fitting a single parameter to a single obser
|
6,630
|
When do Poisson and negative binomial regressions fit the same coefficients?
|
In order to see what is going on here, it is useful first to do the regression without the intercept, since an intercept in a categorical regression with just one predictor is meaningless:
> rs1 = glm(breaks ~ tension-1, data=warpbreaks, family="poisson")
> rs2 = glm.nb(breaks ~ tension-1, data=warpbreaks)
Since Poisson and negative binomial regressions specify the log of the mean parameter, then for categorical regression, exponentiating the coefficients will give you the actual mean parameter for each category:
> exp(cbind("Poisson"=coef(rs1), "NB"=coef(rs2)))
Poisson NB
tensionL 36.38889 36.38889
tensionM 26.38889 26.38889
tensionH 21.66667 21.66667
These parameters correspond to the actual means over the different category values:
> with(warpbreaks,tapply(breaks,tension,mean))
L M H
36.38889 26.38889 21.66667
So what is happening is that the mean parameter $\lambda$ in each case that maximizes likelihood is equal to the sample mean for each category.
For Poisson distribution it is clear why this occurs. There is only one parameter to fit, and thus maximizing the overall likelihood of a model with a single categorical predictor is equivalent to independently finding a $\lambda$ which maximizes likelihood for the observations in each particular category. The maximum likelihood estimator for the Poisson distribution is simply the sample mean, which is why the regression coefficients are precisely the (logs of the) sample means for each category.
For negative binomial it is not quite as simple, because there are two parameters to fit: $\lambda$ and the shape parameter $\theta$. Moreover, the regression fits a single $\theta$ that covers the whole dataset, so in this situation a categorical regression is not simply equivalent to fitting a completely separate model for each category. However, by examining the likelihood function, we can see that for any given theta, the likelihood function is again be maximized by setting $\lambda$ to the sample mean:
\begin{align}
L(X,\lambda,\theta) &= \prod \left(\frac{\theta}{\lambda+\theta}\right)^\theta
\frac{\Gamma(\theta + x_i)}{x_i!\Gamma(\theta)}\left(\frac{\lambda}{\lambda+\theta}\right)^{x_i}\\
\log L(X,\lambda,\theta) &=
\sum\theta\left(\text{log}\theta-\text{log}(\lambda+\theta)\right)
+x_i\left(\text{log}\lambda-\text{log}(\lambda+\theta)\right)
+\log\left(\frac{\Gamma(\theta + x_i)}{x_i!\Gamma(\theta)}\right)\\
\frac{d}{d\lambda}\log L(X,\lambda,\theta) &=
\sum \frac{x_i}{\lambda}-\frac{\theta+x_i}{\lambda+\theta}
=n\left(\frac{\bar{x}}{\lambda}-\frac{\bar{x}+\theta}{\lambda+\theta}\right),
\end{align}
so the maximum is attained when $\lambda=\bar{x}$.
The reason that you don't get the same coefficients for continuous data is because in a continuous regression, $\text{log}(\lambda)$ is no longer going to be a piecewise constant function of the predictor variables, but a linear one. Maximizing the likelihood function in this case will not reduce to independently fitting a value $\lambda$ for disjoint subsets of the data, but will rather be a nontrivial problem that is solved numerically, and is likely to produce different results for different likelihood functions.
Similarly, if you have multiple categorical predictors, despite the fact that the fitted model will ultimately specify $\lambda$ as a piecewise constant function, in general there will not be enough degrees of freedom to allow $\lambda$ to be determined independently for each constant segment. For example, suppose that you have $2$ predictors with $5$ categories each. In this case, your model has $10$ degrees of freedom, whereas there are $5*5=25$ unique different combinations of the categories, each of which will have its own fitted value of $\lambda$. So, assuming that the intersections of these categories are non-empty (or at least that $11$ of them are nonempty), the likelihood maximization problem again becomes nontrivial and will generally produce different outcomes for Poisson versus negative binomial or any other distribution.
|
When do Poisson and negative binomial regressions fit the same coefficients?
|
In order to see what is going on here, it is useful first to do the regression without the intercept, since an intercept in a categorical regression with just one predictor is meaningless:
> rs1 = glm
|
When do Poisson and negative binomial regressions fit the same coefficients?
In order to see what is going on here, it is useful first to do the regression without the intercept, since an intercept in a categorical regression with just one predictor is meaningless:
> rs1 = glm(breaks ~ tension-1, data=warpbreaks, family="poisson")
> rs2 = glm.nb(breaks ~ tension-1, data=warpbreaks)
Since Poisson and negative binomial regressions specify the log of the mean parameter, then for categorical regression, exponentiating the coefficients will give you the actual mean parameter for each category:
> exp(cbind("Poisson"=coef(rs1), "NB"=coef(rs2)))
Poisson NB
tensionL 36.38889 36.38889
tensionM 26.38889 26.38889
tensionH 21.66667 21.66667
These parameters correspond to the actual means over the different category values:
> with(warpbreaks,tapply(breaks,tension,mean))
L M H
36.38889 26.38889 21.66667
So what is happening is that the mean parameter $\lambda$ in each case that maximizes likelihood is equal to the sample mean for each category.
For Poisson distribution it is clear why this occurs. There is only one parameter to fit, and thus maximizing the overall likelihood of a model with a single categorical predictor is equivalent to independently finding a $\lambda$ which maximizes likelihood for the observations in each particular category. The maximum likelihood estimator for the Poisson distribution is simply the sample mean, which is why the regression coefficients are precisely the (logs of the) sample means for each category.
For negative binomial it is not quite as simple, because there are two parameters to fit: $\lambda$ and the shape parameter $\theta$. Moreover, the regression fits a single $\theta$ that covers the whole dataset, so in this situation a categorical regression is not simply equivalent to fitting a completely separate model for each category. However, by examining the likelihood function, we can see that for any given theta, the likelihood function is again be maximized by setting $\lambda$ to the sample mean:
\begin{align}
L(X,\lambda,\theta) &= \prod \left(\frac{\theta}{\lambda+\theta}\right)^\theta
\frac{\Gamma(\theta + x_i)}{x_i!\Gamma(\theta)}\left(\frac{\lambda}{\lambda+\theta}\right)^{x_i}\\
\log L(X,\lambda,\theta) &=
\sum\theta\left(\text{log}\theta-\text{log}(\lambda+\theta)\right)
+x_i\left(\text{log}\lambda-\text{log}(\lambda+\theta)\right)
+\log\left(\frac{\Gamma(\theta + x_i)}{x_i!\Gamma(\theta)}\right)\\
\frac{d}{d\lambda}\log L(X,\lambda,\theta) &=
\sum \frac{x_i}{\lambda}-\frac{\theta+x_i}{\lambda+\theta}
=n\left(\frac{\bar{x}}{\lambda}-\frac{\bar{x}+\theta}{\lambda+\theta}\right),
\end{align}
so the maximum is attained when $\lambda=\bar{x}$.
The reason that you don't get the same coefficients for continuous data is because in a continuous regression, $\text{log}(\lambda)$ is no longer going to be a piecewise constant function of the predictor variables, but a linear one. Maximizing the likelihood function in this case will not reduce to independently fitting a value $\lambda$ for disjoint subsets of the data, but will rather be a nontrivial problem that is solved numerically, and is likely to produce different results for different likelihood functions.
Similarly, if you have multiple categorical predictors, despite the fact that the fitted model will ultimately specify $\lambda$ as a piecewise constant function, in general there will not be enough degrees of freedom to allow $\lambda$ to be determined independently for each constant segment. For example, suppose that you have $2$ predictors with $5$ categories each. In this case, your model has $10$ degrees of freedom, whereas there are $5*5=25$ unique different combinations of the categories, each of which will have its own fitted value of $\lambda$. So, assuming that the intersections of these categories are non-empty (or at least that $11$ of them are nonempty), the likelihood maximization problem again becomes nontrivial and will generally produce different outcomes for Poisson versus negative binomial or any other distribution.
|
When do Poisson and negative binomial regressions fit the same coefficients?
In order to see what is going on here, it is useful first to do the regression without the intercept, since an intercept in a categorical regression with just one predictor is meaningless:
> rs1 = glm
|
6,631
|
Theory behind partial least squares regression
|
Section 3.5.2 in The Elements of Statistical Learning is useful because it puts PLS regression in the right context (of other regularization methods), but is indeed very brief, and leaves some important statements as exercises. In addition, it only considers a case of a univariate dependent variable $\mathbf y$.
The literature on PLS is vast, but can be quite confusing because there are many different "flavours" of PLS: univariate versions with a single DV $\mathbf y$ (PLS1) and multivariate versions with several DVs $\mathbf Y$ (PLS2), symmetric versions treating $\mathbf X$ and $\mathbf Y$ equally and asymmetric versions ("PLS regression") treating $\mathbf X$ as independent and $\mathbf Y$ as dependent variables, versions that allow a global solution via SVD and versions that require iterative deflations to produce every next pair of PLS directions, etc. etc.
All of this has been developed in the field of chemometrics and stays somewhat disconnected from the "mainstream" statistical or machine learning literature.
The overview paper that I find most useful (and that contains many further references) is:
Rosipal & Krämer, 2006, Overview and Recent Advances in Partial
Least Squares
For a more theoretical discussion I can further recommend:
Frank & Friedman, 1993, A Statistical View of Some Chemometrics Regression Tools
A short primer on PLS regression with univariate $y$ (aka PLS1, aka SIMPLS)
The goal of regression is to estimate $\beta$ in a linear model $y=X\beta + \epsilon$. The OLS solution $\beta=(\mathbf X^\top \mathbf X)^{-1}\mathbf X^\top \mathbf y$ enjoys many optimality properties but can suffer from overfitting. Indeed, OLS looks for $\beta$ that yields the highest possible correlation of $\mathbf X \beta$ with $\mathbf y$. If there is a lot of predictors, then it is always possible to find some linear combination that happens to have a high correlation with $\mathbf y$. This will be a spurious correlation, and such $\beta$ will usually point in a direction explaining very little variance in $\mathbf X$. Directions explaining very little variance are often very "noisy" directions. If so, then even though on training data OLS solution performs great, on testing data it will perform much worse.
In order to prevent overfitting, one uses regularization methods that essentially force $\beta$ to point into directions of high variance in $\mathbf X$ (this is also called "shrinkage" of $\beta$; see Why does shrinkage work?). One such method is principal component regression (PCR) that simply discards all low-variance directions. Another (better) method is ridge regression that smoothly penalizes low-variance directions. Yet another method is PLS1.
PLS1 replaces the OLS goal of finding $\beta$ that maximizes correlation $\operatorname{corr}(\mathbf X \beta, \mathbf y)$ with an alternative goal of finding $\beta$ with length $\|\beta\|=1$ maximizing covariance $$\operatorname{cov}(\mathbf X \beta, \mathbf y)\sim\operatorname{corr}(\mathbf X \beta, \mathbf y)\cdot\sqrt{\operatorname{var}(\mathbf X \beta)},$$ which again effectively penalizes directions of low variance.
Finding such $\beta$ (let's call it $\beta_1$) yields the first PLS component $\mathbf z_1 = \mathbf X \beta_1$. One can further look for the second (and then third, etc.) PLS component that has the highest possible covariance with $\mathbf y$ under the constraint of being uncorrelated with all the previous components. This has to be solved iteratively, as there is no closed-form solution for all components (the direction of the first component $\beta_1$ is simply given by $\mathbf X^\top \mathbf y$ normalized to unit length). When the desired number of components is extracted, PLS regression discards the original predictors and uses PLS components as new predictors; this yields some linear combination of them $\beta_z$ that can be combined with all $\beta_i$ to form the final $\beta_\mathrm{PLS}$.
Note that:
If all PLS1 components are used, then PLS will be equivalent to OLS. So the number of components serves as a regularization parameter: the lower the number, the stronger the regularization.
If the predictors $\mathbf X$ are uncorrelated and all have the same variance (i.e. $\mathbf X$ has been whitened), then there is only one PLS1 component and it is equivalent to OLS.
Weight vectors $\beta_i$ and $\beta_j$ for $i\ne j$ are not going to be orthogonal, but will yield uncorrelated components $\mathbf z_i=\mathbf X \beta_i$ and $\mathbf z_j=\mathbf X \beta_j$.
All that being said, I am not aware of any practical advantages of PLS1 regression over ridge regression (while the latter does have lots of advantages: it is continuous and not discrete, has analytical solution, is much more standard, allows kernel extensions and analytical formulas for leave-one-out cross-validation errors, etc. etc.).
Quoting from Frank & Friedman:
RR, PCR, and PLS are seen in Section 3 to operate in a similar fashion. Their principal goal is to shrink the solution coefficient vector away from the OLS solution toward directions in the predictor-variable space of
larger sample spread. PCR and PLS are seen to shrink more heavily away
from the low spread directions than RR, which provides the optimal shrinkage (among linear estimators) for an equidirection prior. Thus
PCR and PLS make the assumption that the truth is likely to have particular preferential alignments with the high spread directions of the
predictor-variable (sample) distribution. A somewhat surprising result
is that PLS (in addition) places increased probability mass on the true
coefficient vector aligning with the $K$th principal component direction,
where $K$ is the number of PLS components used, in fact expanding the
OLS solution in that direction.
They also conduct an extensive simulation study and conclude (emphasis mine):
For the situations covered by this simulation study, one can conclude
that all of the biased methods (RR, PCR, PLS, and VSS) provide
substantial improvement over OLS. [...] In all situations, RR dominated
all of the other methods studied. PLS usually did almost as well as RR
and usually outperformed PCR, but not by very much.
Update: In the comments @cbeleites (who works in chemometrics) suggests two possible advantages of PLS over RR:
An analyst can have an a priori guess as to how many latent components should be present in the data; this will effectively allow to set a regularization strength without doing cross-validation (and there might not be enough data to do a reliable CV). Such an a priori choice of $\lambda$ might be more problematic in RR.
RR yields one single linear combination $\beta_\mathrm{RR}$ as an optimal solution. In contrast PLS with e.g. five components yields five linear combinations $\beta_i$ that are then combined to predict $y$. Original variables that are strongly inter-correlated are likely to be combined into a single PLS component (because combining them together will increase the explained variance term). So it might be possible to interpret the individual PLS components as some real latent factors driving $y$. The claim is that it is easier to interpret $\beta_1, \beta_2,$ etc., as opposed to the joint $\beta_\mathrm{PLS}$. Compare this with PCR where one can also see as an advantage that individual principal components can potentially be interpreted and assigned some qualitative meaning.
|
Theory behind partial least squares regression
|
Section 3.5.2 in The Elements of Statistical Learning is useful because it puts PLS regression in the right context (of other regularization methods), but is indeed very brief, and leaves some importa
|
Theory behind partial least squares regression
Section 3.5.2 in The Elements of Statistical Learning is useful because it puts PLS regression in the right context (of other regularization methods), but is indeed very brief, and leaves some important statements as exercises. In addition, it only considers a case of a univariate dependent variable $\mathbf y$.
The literature on PLS is vast, but can be quite confusing because there are many different "flavours" of PLS: univariate versions with a single DV $\mathbf y$ (PLS1) and multivariate versions with several DVs $\mathbf Y$ (PLS2), symmetric versions treating $\mathbf X$ and $\mathbf Y$ equally and asymmetric versions ("PLS regression") treating $\mathbf X$ as independent and $\mathbf Y$ as dependent variables, versions that allow a global solution via SVD and versions that require iterative deflations to produce every next pair of PLS directions, etc. etc.
All of this has been developed in the field of chemometrics and stays somewhat disconnected from the "mainstream" statistical or machine learning literature.
The overview paper that I find most useful (and that contains many further references) is:
Rosipal & Krämer, 2006, Overview and Recent Advances in Partial
Least Squares
For a more theoretical discussion I can further recommend:
Frank & Friedman, 1993, A Statistical View of Some Chemometrics Regression Tools
A short primer on PLS regression with univariate $y$ (aka PLS1, aka SIMPLS)
The goal of regression is to estimate $\beta$ in a linear model $y=X\beta + \epsilon$. The OLS solution $\beta=(\mathbf X^\top \mathbf X)^{-1}\mathbf X^\top \mathbf y$ enjoys many optimality properties but can suffer from overfitting. Indeed, OLS looks for $\beta$ that yields the highest possible correlation of $\mathbf X \beta$ with $\mathbf y$. If there is a lot of predictors, then it is always possible to find some linear combination that happens to have a high correlation with $\mathbf y$. This will be a spurious correlation, and such $\beta$ will usually point in a direction explaining very little variance in $\mathbf X$. Directions explaining very little variance are often very "noisy" directions. If so, then even though on training data OLS solution performs great, on testing data it will perform much worse.
In order to prevent overfitting, one uses regularization methods that essentially force $\beta$ to point into directions of high variance in $\mathbf X$ (this is also called "shrinkage" of $\beta$; see Why does shrinkage work?). One such method is principal component regression (PCR) that simply discards all low-variance directions. Another (better) method is ridge regression that smoothly penalizes low-variance directions. Yet another method is PLS1.
PLS1 replaces the OLS goal of finding $\beta$ that maximizes correlation $\operatorname{corr}(\mathbf X \beta, \mathbf y)$ with an alternative goal of finding $\beta$ with length $\|\beta\|=1$ maximizing covariance $$\operatorname{cov}(\mathbf X \beta, \mathbf y)\sim\operatorname{corr}(\mathbf X \beta, \mathbf y)\cdot\sqrt{\operatorname{var}(\mathbf X \beta)},$$ which again effectively penalizes directions of low variance.
Finding such $\beta$ (let's call it $\beta_1$) yields the first PLS component $\mathbf z_1 = \mathbf X \beta_1$. One can further look for the second (and then third, etc.) PLS component that has the highest possible covariance with $\mathbf y$ under the constraint of being uncorrelated with all the previous components. This has to be solved iteratively, as there is no closed-form solution for all components (the direction of the first component $\beta_1$ is simply given by $\mathbf X^\top \mathbf y$ normalized to unit length). When the desired number of components is extracted, PLS regression discards the original predictors and uses PLS components as new predictors; this yields some linear combination of them $\beta_z$ that can be combined with all $\beta_i$ to form the final $\beta_\mathrm{PLS}$.
Note that:
If all PLS1 components are used, then PLS will be equivalent to OLS. So the number of components serves as a regularization parameter: the lower the number, the stronger the regularization.
If the predictors $\mathbf X$ are uncorrelated and all have the same variance (i.e. $\mathbf X$ has been whitened), then there is only one PLS1 component and it is equivalent to OLS.
Weight vectors $\beta_i$ and $\beta_j$ for $i\ne j$ are not going to be orthogonal, but will yield uncorrelated components $\mathbf z_i=\mathbf X \beta_i$ and $\mathbf z_j=\mathbf X \beta_j$.
All that being said, I am not aware of any practical advantages of PLS1 regression over ridge regression (while the latter does have lots of advantages: it is continuous and not discrete, has analytical solution, is much more standard, allows kernel extensions and analytical formulas for leave-one-out cross-validation errors, etc. etc.).
Quoting from Frank & Friedman:
RR, PCR, and PLS are seen in Section 3 to operate in a similar fashion. Their principal goal is to shrink the solution coefficient vector away from the OLS solution toward directions in the predictor-variable space of
larger sample spread. PCR and PLS are seen to shrink more heavily away
from the low spread directions than RR, which provides the optimal shrinkage (among linear estimators) for an equidirection prior. Thus
PCR and PLS make the assumption that the truth is likely to have particular preferential alignments with the high spread directions of the
predictor-variable (sample) distribution. A somewhat surprising result
is that PLS (in addition) places increased probability mass on the true
coefficient vector aligning with the $K$th principal component direction,
where $K$ is the number of PLS components used, in fact expanding the
OLS solution in that direction.
They also conduct an extensive simulation study and conclude (emphasis mine):
For the situations covered by this simulation study, one can conclude
that all of the biased methods (RR, PCR, PLS, and VSS) provide
substantial improvement over OLS. [...] In all situations, RR dominated
all of the other methods studied. PLS usually did almost as well as RR
and usually outperformed PCR, but not by very much.
Update: In the comments @cbeleites (who works in chemometrics) suggests two possible advantages of PLS over RR:
An analyst can have an a priori guess as to how many latent components should be present in the data; this will effectively allow to set a regularization strength without doing cross-validation (and there might not be enough data to do a reliable CV). Such an a priori choice of $\lambda$ might be more problematic in RR.
RR yields one single linear combination $\beta_\mathrm{RR}$ as an optimal solution. In contrast PLS with e.g. five components yields five linear combinations $\beta_i$ that are then combined to predict $y$. Original variables that are strongly inter-correlated are likely to be combined into a single PLS component (because combining them together will increase the explained variance term). So it might be possible to interpret the individual PLS components as some real latent factors driving $y$. The claim is that it is easier to interpret $\beta_1, \beta_2,$ etc., as opposed to the joint $\beta_\mathrm{PLS}$. Compare this with PCR where one can also see as an advantage that individual principal components can potentially be interpreted and assigned some qualitative meaning.
|
Theory behind partial least squares regression
Section 3.5.2 in The Elements of Statistical Learning is useful because it puts PLS regression in the right context (of other regularization methods), but is indeed very brief, and leaves some importa
|
6,632
|
Theory behind partial least squares regression
|
Yes. Herman Wold's book Theoretical Empiricism: A general rationale for scientific model-building is the single best exposition of PLS that I'm aware of, especially given that Wold is an originator of the approach. Not to mention that it's simply an interesting book to read and know about. In addition based on a search on Amazon, the number of references to books on PLS written in German is astonishing but it may be that the subtitle of Wold's book is part of the reason for that.
|
Theory behind partial least squares regression
|
Yes. Herman Wold's book Theoretical Empiricism: A general rationale for scientific model-building is the single best exposition of PLS that I'm aware of, especially given that Wold is an originator of
|
Theory behind partial least squares regression
Yes. Herman Wold's book Theoretical Empiricism: A general rationale for scientific model-building is the single best exposition of PLS that I'm aware of, especially given that Wold is an originator of the approach. Not to mention that it's simply an interesting book to read and know about. In addition based on a search on Amazon, the number of references to books on PLS written in German is astonishing but it may be that the subtitle of Wold's book is part of the reason for that.
|
Theory behind partial least squares regression
Yes. Herman Wold's book Theoretical Empiricism: A general rationale for scientific model-building is the single best exposition of PLS that I'm aware of, especially given that Wold is an originator of
|
6,633
|
Theory behind partial least squares regression
|
I recommend this lecture: https://www.youtube.com/watch?v=Px2otK2nZ1c by Prof Asada who explains that PLS consists of the follwoing three steps which are iterated for k times (when k components are used):
finding the directions v,w which maximize the correlation E[(xv)(yw)]
finding the parameter beta of the linear model $\hat{y} = \beta z$ (with z =xv) wich minimizes the squared residuals
deflation (removing information used in the previous two steps by updating x and y)
|
Theory behind partial least squares regression
|
I recommend this lecture: https://www.youtube.com/watch?v=Px2otK2nZ1c by Prof Asada who explains that PLS consists of the follwoing three steps which are iterated for k times (when k components are us
|
Theory behind partial least squares regression
I recommend this lecture: https://www.youtube.com/watch?v=Px2otK2nZ1c by Prof Asada who explains that PLS consists of the follwoing three steps which are iterated for k times (when k components are used):
finding the directions v,w which maximize the correlation E[(xv)(yw)]
finding the parameter beta of the linear model $\hat{y} = \beta z$ (with z =xv) wich minimizes the squared residuals
deflation (removing information used in the previous two steps by updating x and y)
|
Theory behind partial least squares regression
I recommend this lecture: https://www.youtube.com/watch?v=Px2otK2nZ1c by Prof Asada who explains that PLS consists of the follwoing three steps which are iterated for k times (when k components are us
|
6,634
|
Inclusion of lagged dependent variable in regression
|
The decision to include a lagged dependent variable in your model is really a theoretical question. It makes sense to include a lagged DV if you expect that the current level of the DV is heavily determined by its past level. In that case, not including the lagged DV will lead to omitted variable bias and your results might be unreliable. In such a scenario, including the lagged DV, will take out a lot of your variance and is likely to make your other DV's effects less significant (which means both make the $\beta$s smaller and the standard errors bigger). However, what it will allow you to do is say that those IVs that still influence your outcome have an effect controlling for past value of the DV.
An alternative approach to this is to use the difference between your outcome variable at period $t$ and $t-1$ as your DV for period $t$.
However, doing any of these imply answering an important question: what is the right lag structure for your DV? You can get some information about this by observing the correlation between your outcome variable with itself for different lag values (e.g. correlation between Y and Y$t-1$, Y and Y$t-2$, etc.).
|
Inclusion of lagged dependent variable in regression
|
The decision to include a lagged dependent variable in your model is really a theoretical question. It makes sense to include a lagged DV if you expect that the current level of the DV is heavily dete
|
Inclusion of lagged dependent variable in regression
The decision to include a lagged dependent variable in your model is really a theoretical question. It makes sense to include a lagged DV if you expect that the current level of the DV is heavily determined by its past level. In that case, not including the lagged DV will lead to omitted variable bias and your results might be unreliable. In such a scenario, including the lagged DV, will take out a lot of your variance and is likely to make your other DV's effects less significant (which means both make the $\beta$s smaller and the standard errors bigger). However, what it will allow you to do is say that those IVs that still influence your outcome have an effect controlling for past value of the DV.
An alternative approach to this is to use the difference between your outcome variable at period $t$ and $t-1$ as your DV for period $t$.
However, doing any of these imply answering an important question: what is the right lag structure for your DV? You can get some information about this by observing the correlation between your outcome variable with itself for different lag values (e.g. correlation between Y and Y$t-1$, Y and Y$t-2$, etc.).
|
Inclusion of lagged dependent variable in regression
The decision to include a lagged dependent variable in your model is really a theoretical question. It makes sense to include a lagged DV if you expect that the current level of the DV is heavily dete
|
6,635
|
Inclusion of lagged dependent variable in regression
|
I recommend two articles:
Achen C. H. (2001) Why lagged dependent variables can suppress the explanatory power of other independent variables (link)
Keele, L. and Kelly N. J. (2005) Dynamic models for dynamic theories: the ins and outs of lagged dependent variables (link).
The upshot is that including a lagged dependent variable can have a large influence on the coefficients of the remaining variables. Sometimes this is appropriate (for the Dynamic models of Keele and Kelly) and sometimes not. As others have said, it's important to think about the process being modeled.
|
Inclusion of lagged dependent variable in regression
|
I recommend two articles:
Achen C. H. (2001) Why lagged dependent variables can suppress the explanatory power of other independent variables (link)
Keele, L. and Kelly N. J. (2005) Dynamic models fo
|
Inclusion of lagged dependent variable in regression
I recommend two articles:
Achen C. H. (2001) Why lagged dependent variables can suppress the explanatory power of other independent variables (link)
Keele, L. and Kelly N. J. (2005) Dynamic models for dynamic theories: the ins and outs of lagged dependent variables (link).
The upshot is that including a lagged dependent variable can have a large influence on the coefficients of the remaining variables. Sometimes this is appropriate (for the Dynamic models of Keele and Kelly) and sometimes not. As others have said, it's important to think about the process being modeled.
|
Inclusion of lagged dependent variable in regression
I recommend two articles:
Achen C. H. (2001) Why lagged dependent variables can suppress the explanatory power of other independent variables (link)
Keele, L. and Kelly N. J. (2005) Dynamic models fo
|
6,636
|
Inclusion of lagged dependent variable in regression
|
Including lagged dependent variables can reduce the occurrence of autocorrelation arising from model misspecification. Thus accounting for lagged dependent variables helps you to defend the existence of autocorrelation in the model. The past value affects the present in the model, requires theoretical foundation, and best fit up the model as per required.
|
Inclusion of lagged dependent variable in regression
|
Including lagged dependent variables can reduce the occurrence of autocorrelation arising from model misspecification. Thus accounting for lagged dependent variables helps you to defend the existence
|
Inclusion of lagged dependent variable in regression
Including lagged dependent variables can reduce the occurrence of autocorrelation arising from model misspecification. Thus accounting for lagged dependent variables helps you to defend the existence of autocorrelation in the model. The past value affects the present in the model, requires theoretical foundation, and best fit up the model as per required.
|
Inclusion of lagged dependent variable in regression
Including lagged dependent variables can reduce the occurrence of autocorrelation arising from model misspecification. Thus accounting for lagged dependent variables helps you to defend the existence
|
6,637
|
Inclusion of lagged dependent variable in regression
|
Some say that the inclusion of LDV will biase downward the coefficient of other IVs.
To be more specific, using OLS with the inclusion of a LDV can bias your coefficient downwards. Consider the model $Y_t=\alpha + \lambda Y_{t-1} + U_t$ for $t=1,...,T$ with $-1<\lambda<1$ and the $U_t$s are identically distributed normal random variables with mean zero. Under this model, the bias of the OLS estimator of $\lambda$ is given by $-(1+3\lambda)/T$ (Kendall, 1954). This is clearly a problem and one should not apply OLS directly when incorporating LDVs as without considering this.
The crux of the issue is that including an LDV breaks a core assumption of OLS: observations are independent. I highly recommend reading Maeshiro (1996) as he asks (and answers to some extent by providing options for what to do instead) the same question as you've presented here.
References:
Kendall, Maurice G. "Note on bias in the estimation of autocorrelation." Biometrika 41.3-4 (1954): 403-404. (link)
Maeshiro, Asatoshi. "Teaching regressions with a lagged dependent variable and autocorrelated disturbances." The Journal of Economic Education 27.1 (1996): 72-84. (link)
|
Inclusion of lagged dependent variable in regression
|
Some say that the inclusion of LDV will biase downward the coefficient of other IVs.
To be more specific, using OLS with the inclusion of a LDV can bias your coefficient downwards. Consider the model
|
Inclusion of lagged dependent variable in regression
Some say that the inclusion of LDV will biase downward the coefficient of other IVs.
To be more specific, using OLS with the inclusion of a LDV can bias your coefficient downwards. Consider the model $Y_t=\alpha + \lambda Y_{t-1} + U_t$ for $t=1,...,T$ with $-1<\lambda<1$ and the $U_t$s are identically distributed normal random variables with mean zero. Under this model, the bias of the OLS estimator of $\lambda$ is given by $-(1+3\lambda)/T$ (Kendall, 1954). This is clearly a problem and one should not apply OLS directly when incorporating LDVs as without considering this.
The crux of the issue is that including an LDV breaks a core assumption of OLS: observations are independent. I highly recommend reading Maeshiro (1996) as he asks (and answers to some extent by providing options for what to do instead) the same question as you've presented here.
References:
Kendall, Maurice G. "Note on bias in the estimation of autocorrelation." Biometrika 41.3-4 (1954): 403-404. (link)
Maeshiro, Asatoshi. "Teaching regressions with a lagged dependent variable and autocorrelated disturbances." The Journal of Economic Education 27.1 (1996): 72-84. (link)
|
Inclusion of lagged dependent variable in regression
Some say that the inclusion of LDV will biase downward the coefficient of other IVs.
To be more specific, using OLS with the inclusion of a LDV can bias your coefficient downwards. Consider the model
|
6,638
|
Inclusion of lagged dependent variable in regression
|
Yes, you should be wary of Nickell bias in a small T large N situation (Nickell, S. (1981). Biases in dynamic models with fixed effects. Econometrica: Journal of the Econometric Society, 1417-1426.)
You might wish to look at Dynamic Panel Data models like Arellano-Bond or Blundell-Bond estimators.
|
Inclusion of lagged dependent variable in regression
|
Yes, you should be wary of Nickell bias in a small T large N situation (Nickell, S. (1981). Biases in dynamic models with fixed effects. Econometrica: Journal of the Econometric Society, 1417-1426.)
Y
|
Inclusion of lagged dependent variable in regression
Yes, you should be wary of Nickell bias in a small T large N situation (Nickell, S. (1981). Biases in dynamic models with fixed effects. Econometrica: Journal of the Econometric Society, 1417-1426.)
You might wish to look at Dynamic Panel Data models like Arellano-Bond or Blundell-Bond estimators.
|
Inclusion of lagged dependent variable in regression
Yes, you should be wary of Nickell bias in a small T large N situation (Nickell, S. (1981). Biases in dynamic models with fixed effects. Econometrica: Journal of the Econometric Society, 1417-1426.)
Y
|
6,639
|
Inclusion of lagged dependent variable in regression
|
What makes me intrigued about this question is not knowing more about the specification of the model or the estimation technique for it. I mention that because although using a lagged DV among the IVs may be theoretically important and methodologically necessary, it may also introduce a risky amount of endongeneity in the model, depending on the substantial relation between variables and time units and, also, on the AR order that may exist in the model. Unless you (and us) have more details on the variables and on the estimation, I would not feel confortable to recomend lagging the DV unless you are thinking of some instrumental variable technique or something like Arellano-Bond estimation.
Please, give us more details so we may know better on what kind of model we are talking about.
|
Inclusion of lagged dependent variable in regression
|
What makes me intrigued about this question is not knowing more about the specification of the model or the estimation technique for it. I mention that because although using a lagged DV among the IVs
|
Inclusion of lagged dependent variable in regression
What makes me intrigued about this question is not knowing more about the specification of the model or the estimation technique for it. I mention that because although using a lagged DV among the IVs may be theoretically important and methodologically necessary, it may also introduce a risky amount of endongeneity in the model, depending on the substantial relation between variables and time units and, also, on the AR order that may exist in the model. Unless you (and us) have more details on the variables and on the estimation, I would not feel confortable to recomend lagging the DV unless you are thinking of some instrumental variable technique or something like Arellano-Bond estimation.
Please, give us more details so we may know better on what kind of model we are talking about.
|
Inclusion of lagged dependent variable in regression
What makes me intrigued about this question is not knowing more about the specification of the model or the estimation technique for it. I mention that because although using a lagged DV among the IVs
|
6,640
|
Measures of similarity or distance between two covariance matrices
|
You can use any of the norms $\| A-B \|_p $ (see Wikipedia on a variety of norms; note that the square-root of the sum of squared distances, $\sqrt{\sum_{i,j} (a_{ij}-b_{ij})^2}$, is called Frobenius norm, and is different from $L_2$ norm, which is the square root of the largest eigenvalue of $(A-B)^2$, although of course they would generate the same topology). The K-L distance between the two normal distributions with the same means (say zero) and the two specific covariance matrices is also available in Wikipedia as $\frac12 [ \mbox{tr} (A^{-1}B) - \mbox{ln}( |B|/|A| ) ]$.
Edit: if one of the matrices is a model-implied matrix, and the other is the sample covariance matrix, then of course you can form a likelihood ratio test between the two. My personal favorite collection of such tests for simple structures is given in Rencher (2002) Methods of Multivariate Analysis. More advanced cases are covered in covariance structure modeling, on which a reasonable starting point is Bollen (1989) Structural Equations with Latent Variables.
|
Measures of similarity or distance between two covariance matrices
|
You can use any of the norms $\| A-B \|_p $ (see Wikipedia on a variety of norms; note that the square-root of the sum of squared distances, $\sqrt{\sum_{i,j} (a_{ij}-b_{ij})^2}$, is called Frobenius
|
Measures of similarity or distance between two covariance matrices
You can use any of the norms $\| A-B \|_p $ (see Wikipedia on a variety of norms; note that the square-root of the sum of squared distances, $\sqrt{\sum_{i,j} (a_{ij}-b_{ij})^2}$, is called Frobenius norm, and is different from $L_2$ norm, which is the square root of the largest eigenvalue of $(A-B)^2$, although of course they would generate the same topology). The K-L distance between the two normal distributions with the same means (say zero) and the two specific covariance matrices is also available in Wikipedia as $\frac12 [ \mbox{tr} (A^{-1}B) - \mbox{ln}( |B|/|A| ) ]$.
Edit: if one of the matrices is a model-implied matrix, and the other is the sample covariance matrix, then of course you can form a likelihood ratio test between the two. My personal favorite collection of such tests for simple structures is given in Rencher (2002) Methods of Multivariate Analysis. More advanced cases are covered in covariance structure modeling, on which a reasonable starting point is Bollen (1989) Structural Equations with Latent Variables.
|
Measures of similarity or distance between two covariance matrices
You can use any of the norms $\| A-B \|_p $ (see Wikipedia on a variety of norms; note that the square-root of the sum of squared distances, $\sqrt{\sum_{i,j} (a_{ij}-b_{ij})^2}$, is called Frobenius
|
6,641
|
Measures of similarity or distance between two covariance matrices
|
A measure introduced by Herdin (2005) Correlation Matrix Distance, a Meaningful Measure
for Evaluation of Non-Stationary MIMO Channels is
$$d = 1 - \frac{\text{tr}(R_1 \cdot R_2)}{\|R_1\| \cdot \|R_2\|},$$
where the norm is the Frobenius norm.
|
Measures of similarity or distance between two covariance matrices
|
A measure introduced by Herdin (2005) Correlation Matrix Distance, a Meaningful Measure
for Evaluation of Non-Stationary MIMO Channels is
$$d = 1 - \frac{\text{tr}(R_1 \cdot R_2)}{\|R_1\| \cdot \|R_2\
|
Measures of similarity or distance between two covariance matrices
A measure introduced by Herdin (2005) Correlation Matrix Distance, a Meaningful Measure
for Evaluation of Non-Stationary MIMO Channels is
$$d = 1 - \frac{\text{tr}(R_1 \cdot R_2)}{\|R_1\| \cdot \|R_2\|},$$
where the norm is the Frobenius norm.
|
Measures of similarity or distance between two covariance matrices
A measure introduced by Herdin (2005) Correlation Matrix Distance, a Meaningful Measure
for Evaluation of Non-Stationary MIMO Channels is
$$d = 1 - \frac{\text{tr}(R_1 \cdot R_2)}{\|R_1\| \cdot \|R_2\
|
6,642
|
Measures of similarity or distance between two covariance matrices
|
Denote $\varSigma_1$ and $\varSigma_2$ your matrices both of dimension $p$.
Cond number:
$\log(\lambda_1)-\log(\lambda_p)$ where $\lambda_1$ ($\lambda_p$) is the largest
(smallest) eigenvalue of $\varSigma^*$, where $\varSigma^*$ is defined as:
$\varSigma^*:=\varSigma_1^{-1/2}\varSigma_2\varSigma_1^{-1/2}$
Edit: I edited out the second of the two proposals. I think I had misunderstood the question. The proposal based on condition numbers is used in robust statistics a lot to assess quality of fit. An old source I could find for it is:
Yohai, V.J. and Maronna, R.A. (1990). The Maximum Bias of Robust
Covariances. Communications in Statistics–Theory and Methods, 19,
3925–2933.
I had originally included the Det ratio measure:
Det ratio: $\log(\det(\varSigma^{**})/\sqrt{\det(\varSigma_2)*\det(\varSigma_1)})$
where $\varSigma^{**}=(\varSigma_1+\varSigma_2)/2$.
which would be the Bhattacharyya distance between two Gaussian distributions having the same location vector. I must have originally read the question as pertaining to a setting where the two covariances were coming from samples from populations assumed to have equal means.
|
Measures of similarity or distance between two covariance matrices
|
Denote $\varSigma_1$ and $\varSigma_2$ your matrices both of dimension $p$.
Cond number:
$\log(\lambda_1)-\log(\lambda_p)$ where $\lambda_1$ ($\lambda_p$) is the largest
(smallest) eigenvalue of $\
|
Measures of similarity or distance between two covariance matrices
Denote $\varSigma_1$ and $\varSigma_2$ your matrices both of dimension $p$.
Cond number:
$\log(\lambda_1)-\log(\lambda_p)$ where $\lambda_1$ ($\lambda_p$) is the largest
(smallest) eigenvalue of $\varSigma^*$, where $\varSigma^*$ is defined as:
$\varSigma^*:=\varSigma_1^{-1/2}\varSigma_2\varSigma_1^{-1/2}$
Edit: I edited out the second of the two proposals. I think I had misunderstood the question. The proposal based on condition numbers is used in robust statistics a lot to assess quality of fit. An old source I could find for it is:
Yohai, V.J. and Maronna, R.A. (1990). The Maximum Bias of Robust
Covariances. Communications in Statistics–Theory and Methods, 19,
3925–2933.
I had originally included the Det ratio measure:
Det ratio: $\log(\det(\varSigma^{**})/\sqrt{\det(\varSigma_2)*\det(\varSigma_1)})$
where $\varSigma^{**}=(\varSigma_1+\varSigma_2)/2$.
which would be the Bhattacharyya distance between two Gaussian distributions having the same location vector. I must have originally read the question as pertaining to a setting where the two covariances were coming from samples from populations assumed to have equal means.
|
Measures of similarity or distance between two covariance matrices
Denote $\varSigma_1$ and $\varSigma_2$ your matrices both of dimension $p$.
Cond number:
$\log(\lambda_1)-\log(\lambda_p)$ where $\lambda_1$ ($\lambda_p$) is the largest
(smallest) eigenvalue of $\
|
6,643
|
Measures of similarity or distance between two covariance matrices
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
The covariance matrix distance is used for tracking objects in Computer Vision.
The currently used metric is described in the article: "A metric for covariance matrices", by Förstner and Moonen.
|
Measures of similarity or distance between two covariance matrices
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
Measures of similarity or distance between two covariance matrices
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
The covariance matrix distance is used for tracking objects in Computer Vision.
The currently used metric is described in the article: "A metric for covariance matrices", by Förstner and Moonen.
|
Measures of similarity or distance between two covariance matrices
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
6,644
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
|
Separating the log-likelihood
It is correct that most hurdle models can be estimated separately (I would say, instead of sequentially). The reason is that the log-likelihood can be decomposed into two parts that can be maximized separately. This is because $\hat \pi$ is a just a scaling factor in (5.34) that becomes an additive term in the log-likelihood.
In the notation of Smithson & Merkle:
$$ \begin{eqnarray*} \ell(\beta, \gamma; y, x, z) & = &
\ell_1(\gamma; y, z) + \ell_2(\beta; y, x) \\
& = &
\sum_{i: y_i = 0} \log\left\{1 - \mathrm{logit}^{-1}(z_i^\top \gamma)\right\} + \sum_{i: y_i > 0} \log\left\{\mathrm{logit}^{-1}(z_i^\top \gamma)\right\} + \\
& &
\sum_{i: y_i > 0} \left[ \log \left\{f(y_i; \exp(x_i^\top \beta)\right\} - \log\left\{ 1 - f(0; \exp(x_i^\top \beta)\right\}\right]
\end{eqnarray*} $$
where $f(y; \lambda) = \exp(-\lambda) \lambda^y/y!$ is the density of the (untruncated) Poisson distribution and $1 - f(0; \lambda) = 1 - \exp(-\lambda)$ is the factor from the zero truncation.
Then it becomes obvious that $\ell_1(\gamma)$ (binary logit model) and $\ell_2(\beta)$ (zero-truncated Poisson model) can be maximized separately, leading to the same parameter estimates, covariances, etc. as in the case where they are maximized jointly.
The same logic also works if the zero hurdle probability $\pi$ is not parametrized through a logit model but any other binary regression model, e.g., a count distribution right-censored at 1. And, of course, $f(\cdot)$ could also be another count distribution, e.g., negative binomial. The whole separation only breaks down if there are shared parameters between the zero hurdle and the truncated count part.
A prominent example would be if negative binomial distributions with separate $\mu$ but common $\theta$ parameters are employed in the two components of the model. (This is available in hurdle(..., separate = FALSE, dist = "negbin", zero.dist = "negbin") in the countreg package from R-Forge, the successor to the pscl implementation.)
Concrete questions
(a) Throwing away perfectly good data: In your case yes, in general no. You have data from a single Poisson model without excess zeros (albeit many zeros). Hence, it is not necessary to estimate separate models for the zeros and non-zeros. However, if the two parts are really driven by different parameters then it is necessary to account for this.
(b) Could lead to power issues since much of the data are zeros: Not necessarily. Here, you have a third of the observations that are "successes" (hurdle crossings). This wouldn't be considered very extreme in a binary regression model. (Of course, if it is unnecessary to estimate separate models you would gain power.)
(c) Basically not a 'model' in and of itself, but just sequentially running two different models: This is more philosophical and I won't try to give "one" answer. Instead, I will point out pragmatic points of view. For model estimation, it can be convenient to emphasize that the models are separate because - as you show - you might not need a dedicated function for the estimation. For model application, e.g., for predictions or residuals etc., it can be more convenient to see this as a single model.
(d) Would it be safe to call both of these situations 'hurdle' models: In principle yes. However, jargon may vary across communities. For example, the zero-hurdle beta regression is more commonly (and very confusingly) called zero-inflated beta regression. Personally, I find the latter very misleading because the beta distribution has no zeros that could be inflated - but it's the standard term in the literature anyway. Moreover, the tobit model is a censored model and hence not a hurdle model. It could be extended, though, by a probit (or logit) model plus a truncated normal model. In the econometrics literature this is known as the Cragg two-part model.
Software comments
The countreg package on R-Forge at https://R-Forge.R-project.org/R/?group_id=522 is the successor implementation to hurdle()/zeroinfl() from pscl. The main reason that it is (still) not on CRAN is that we want to revise the predict() interface, possibly in a way that is not fully backward compatible. Otherwise the implementation is pretty stable. Compared to pscl it comes with a few nice features, e.g.:
A zerotrunc() function that uses exactly the same code as hurdle() for the zero-truncated part of the model. Thus, it offers an alternative to VGAM.
Moreover, it as d/p/q/r functions for the zero-truncated, hurdle, and zero-inflated count distributions. This facilitates looking at these as "one" model rather than separate models.
For assessing the goodness of fit, graphical displays like rootograms and randomized quantile residual plots are available. (See Kleiber & Zeileis, 2016, The American Statistician, 70(3), 296–303. doi:10.1080/00031305.2016.1173590.)
Simulated data
Your simulated data comes from a single Poisson process. If e is treated as a known regressor then it would be a standard Poisson GLM. If e is an unknown noise component, then there is some unobserved heterogeneity causing a little bit of overdispersion which could be captured by a negative binomial model or some other kind of continuous mixture or random effect etc. However, as the effect of e is rather small here, none of this makes a big difference. Below, I'm treating e as a regressor (i.e., with true coefficient of 1) but you could also omit this and use negative binomial or Poisson models. Qualitatively, all of these lead to similar insights.
## Poisson GLM
p <- glm(y ~ x + e, family = poisson)
## Hurdle Poisson (zero-truncated Poisson + right-censored Poisson)
library("countreg")
hp <- hurdle(y ~ x + e, dist = "poisson", zero.dist = "poisson")
## all coefficients very similar and close to true -1.5, 1, 1
cbind(coef(p), coef(hp, model = "zero"), coef(hp, model = "count"))
## [,1] [,2] [,3]
## (Intercept) -1.3371364 -1.2691271 -1.741320
## x 0.9118365 0.9791725 1.020992
## e 0.9598940 1.0192031 1.100175
This reflects that all three models can consistently estimate the true parameters. Looking at the corresponding standard errors shows that in this scenario (without the need for a hurdle part) the Poisson GLM is more efficient:
serr <- function(object, ...) sqrt(diag(vcov(object, ...)))
cbind(serr(p), serr(hp, model = "zero"), serr(hp, model = "count"))
## [,1] [,2] [,3]
## (Intercept) 0.2226027 0.2487211 0.5702826
## x 0.1594961 0.2340700 0.2853921
## e 0.1640422 0.2698122 0.2852902
Standard information criteria would select the true Poisson GLM as the best model:
AIC(p, hp)
## df AIC
## p 3 141.0473
## hp 6 145.9287
And a Wald test would correctly detect that the two components of the hurdle model are not significantly different:
hurdletest(hp)
## Wald test for hurdle models
##
## Restrictions:
## count_((Intercept) - zero_(Intercept) = 0
## count_x - zero_x = 0
## count_e - zero_e = 0
##
## Model 1: restricted model
## Model 2: y ~ x + e
##
## Res.Df Df Chisq Pr(>Chisq)
## 1 97
## 2 94 3 1.0562 0.7877
Finally both rootogram(p) and qqrplot(p) show that the Poisson GLM fits the data very well and that there are no excess zeros or hints on further misspecifications.
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
|
Separating the log-likelihood
It is correct that most hurdle models can be estimated separately (I would say, instead of sequentially). The reason is that the log-likelihood can be decomposed into two
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
Separating the log-likelihood
It is correct that most hurdle models can be estimated separately (I would say, instead of sequentially). The reason is that the log-likelihood can be decomposed into two parts that can be maximized separately. This is because $\hat \pi$ is a just a scaling factor in (5.34) that becomes an additive term in the log-likelihood.
In the notation of Smithson & Merkle:
$$ \begin{eqnarray*} \ell(\beta, \gamma; y, x, z) & = &
\ell_1(\gamma; y, z) + \ell_2(\beta; y, x) \\
& = &
\sum_{i: y_i = 0} \log\left\{1 - \mathrm{logit}^{-1}(z_i^\top \gamma)\right\} + \sum_{i: y_i > 0} \log\left\{\mathrm{logit}^{-1}(z_i^\top \gamma)\right\} + \\
& &
\sum_{i: y_i > 0} \left[ \log \left\{f(y_i; \exp(x_i^\top \beta)\right\} - \log\left\{ 1 - f(0; \exp(x_i^\top \beta)\right\}\right]
\end{eqnarray*} $$
where $f(y; \lambda) = \exp(-\lambda) \lambda^y/y!$ is the density of the (untruncated) Poisson distribution and $1 - f(0; \lambda) = 1 - \exp(-\lambda)$ is the factor from the zero truncation.
Then it becomes obvious that $\ell_1(\gamma)$ (binary logit model) and $\ell_2(\beta)$ (zero-truncated Poisson model) can be maximized separately, leading to the same parameter estimates, covariances, etc. as in the case where they are maximized jointly.
The same logic also works if the zero hurdle probability $\pi$ is not parametrized through a logit model but any other binary regression model, e.g., a count distribution right-censored at 1. And, of course, $f(\cdot)$ could also be another count distribution, e.g., negative binomial. The whole separation only breaks down if there are shared parameters between the zero hurdle and the truncated count part.
A prominent example would be if negative binomial distributions with separate $\mu$ but common $\theta$ parameters are employed in the two components of the model. (This is available in hurdle(..., separate = FALSE, dist = "negbin", zero.dist = "negbin") in the countreg package from R-Forge, the successor to the pscl implementation.)
Concrete questions
(a) Throwing away perfectly good data: In your case yes, in general no. You have data from a single Poisson model without excess zeros (albeit many zeros). Hence, it is not necessary to estimate separate models for the zeros and non-zeros. However, if the two parts are really driven by different parameters then it is necessary to account for this.
(b) Could lead to power issues since much of the data are zeros: Not necessarily. Here, you have a third of the observations that are "successes" (hurdle crossings). This wouldn't be considered very extreme in a binary regression model. (Of course, if it is unnecessary to estimate separate models you would gain power.)
(c) Basically not a 'model' in and of itself, but just sequentially running two different models: This is more philosophical and I won't try to give "one" answer. Instead, I will point out pragmatic points of view. For model estimation, it can be convenient to emphasize that the models are separate because - as you show - you might not need a dedicated function for the estimation. For model application, e.g., for predictions or residuals etc., it can be more convenient to see this as a single model.
(d) Would it be safe to call both of these situations 'hurdle' models: In principle yes. However, jargon may vary across communities. For example, the zero-hurdle beta regression is more commonly (and very confusingly) called zero-inflated beta regression. Personally, I find the latter very misleading because the beta distribution has no zeros that could be inflated - but it's the standard term in the literature anyway. Moreover, the tobit model is a censored model and hence not a hurdle model. It could be extended, though, by a probit (or logit) model plus a truncated normal model. In the econometrics literature this is known as the Cragg two-part model.
Software comments
The countreg package on R-Forge at https://R-Forge.R-project.org/R/?group_id=522 is the successor implementation to hurdle()/zeroinfl() from pscl. The main reason that it is (still) not on CRAN is that we want to revise the predict() interface, possibly in a way that is not fully backward compatible. Otherwise the implementation is pretty stable. Compared to pscl it comes with a few nice features, e.g.:
A zerotrunc() function that uses exactly the same code as hurdle() for the zero-truncated part of the model. Thus, it offers an alternative to VGAM.
Moreover, it as d/p/q/r functions for the zero-truncated, hurdle, and zero-inflated count distributions. This facilitates looking at these as "one" model rather than separate models.
For assessing the goodness of fit, graphical displays like rootograms and randomized quantile residual plots are available. (See Kleiber & Zeileis, 2016, The American Statistician, 70(3), 296–303. doi:10.1080/00031305.2016.1173590.)
Simulated data
Your simulated data comes from a single Poisson process. If e is treated as a known regressor then it would be a standard Poisson GLM. If e is an unknown noise component, then there is some unobserved heterogeneity causing a little bit of overdispersion which could be captured by a negative binomial model or some other kind of continuous mixture or random effect etc. However, as the effect of e is rather small here, none of this makes a big difference. Below, I'm treating e as a regressor (i.e., with true coefficient of 1) but you could also omit this and use negative binomial or Poisson models. Qualitatively, all of these lead to similar insights.
## Poisson GLM
p <- glm(y ~ x + e, family = poisson)
## Hurdle Poisson (zero-truncated Poisson + right-censored Poisson)
library("countreg")
hp <- hurdle(y ~ x + e, dist = "poisson", zero.dist = "poisson")
## all coefficients very similar and close to true -1.5, 1, 1
cbind(coef(p), coef(hp, model = "zero"), coef(hp, model = "count"))
## [,1] [,2] [,3]
## (Intercept) -1.3371364 -1.2691271 -1.741320
## x 0.9118365 0.9791725 1.020992
## e 0.9598940 1.0192031 1.100175
This reflects that all three models can consistently estimate the true parameters. Looking at the corresponding standard errors shows that in this scenario (without the need for a hurdle part) the Poisson GLM is more efficient:
serr <- function(object, ...) sqrt(diag(vcov(object, ...)))
cbind(serr(p), serr(hp, model = "zero"), serr(hp, model = "count"))
## [,1] [,2] [,3]
## (Intercept) 0.2226027 0.2487211 0.5702826
## x 0.1594961 0.2340700 0.2853921
## e 0.1640422 0.2698122 0.2852902
Standard information criteria would select the true Poisson GLM as the best model:
AIC(p, hp)
## df AIC
## p 3 141.0473
## hp 6 145.9287
And a Wald test would correctly detect that the two components of the hurdle model are not significantly different:
hurdletest(hp)
## Wald test for hurdle models
##
## Restrictions:
## count_((Intercept) - zero_(Intercept) = 0
## count_x - zero_x = 0
## count_e - zero_e = 0
##
## Model 1: restricted model
## Model 2: y ~ x + e
##
## Res.Df Df Chisq Pr(>Chisq)
## 1 97
## 2 94 3 1.0562 0.7877
Finally both rootogram(p) and qqrplot(p) show that the Poisson GLM fits the data very well and that there are no excess zeros or hints on further misspecifications.
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
Separating the log-likelihood
It is correct that most hurdle models can be estimated separately (I would say, instead of sequentially). The reason is that the log-likelihood can be decomposed into two
|
6,645
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
|
I agree the difference between zero-inflated and hurdle models is hard to understand. Both are a kind of mixture model. From what I can tell, the important difference is, in a zero-inflated model, you mix a mass at zero with a distribution \textit{that can also take the value zero}. For a hurdle model, you mix a mass at zero with a distribution that only takes values greater than 0. Thus, in the zero-inflated model you can distinguish between 'structural zeros' (corresponding to the mass at zero) and 'sampling zeros' corresponding to the chance occurrence of 0 from the model you are mixing in. Of course, this identification depends strongly on making the right choice of distribution! But, if you have a zero-inflated Poisson, for example, you can distinguish between zeros that come from the Poisson component (sampling zeros) and zeros that come from the mass at zero (structural zeros). If you have a zero-inflated model and the distribution you are mixing in has no mass at zero, it could be interpreted as a hurdle model.
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
|
I agree the difference between zero-inflated and hurdle models is hard to understand. Both are a kind of mixture model. From what I can tell, the important difference is, in a zero-inflated model, y
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
I agree the difference between zero-inflated and hurdle models is hard to understand. Both are a kind of mixture model. From what I can tell, the important difference is, in a zero-inflated model, you mix a mass at zero with a distribution \textit{that can also take the value zero}. For a hurdle model, you mix a mass at zero with a distribution that only takes values greater than 0. Thus, in the zero-inflated model you can distinguish between 'structural zeros' (corresponding to the mass at zero) and 'sampling zeros' corresponding to the chance occurrence of 0 from the model you are mixing in. Of course, this identification depends strongly on making the right choice of distribution! But, if you have a zero-inflated Poisson, for example, you can distinguish between zeros that come from the Poisson component (sampling zeros) and zeros that come from the mass at zero (structural zeros). If you have a zero-inflated model and the distribution you are mixing in has no mass at zero, it could be interpreted as a hurdle model.
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
I agree the difference between zero-inflated and hurdle models is hard to understand. Both are a kind of mixture model. From what I can tell, the important difference is, in a zero-inflated model, y
|
6,646
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
|
Regarding the philosophical aspect, "when should we consider something a single model and when two separate models", it may be interesting to note that the sample estimates of the model-parameters are correlated.
In the plot below with a simulation you mostly see the correlation between the slope and the intercept of the counts part. But there is also some slight relation between the counts part and the hurdle part. If you change the parameters, e.g. make the lambda in the Poisson distribution smaller or the sample size smaller, then the correlation becomes stronger.
So I would say that you should not consider it as two separate models. Or at least there is some relation even when in practice you can compute the two estimates independent from each other.
set.seed(1839)
Nrep <- 3000
Ns <- 100
pars <- matrix(rep(0,3*Nrep),Nrep)
colnames(pars) <- c("count_intercept","count_slope","hurdle_intercept")
# simulation-loop
# Note that a truncated poisson is used to generate data
# this will make the parameters from the hurdle function easier to interpret and compare
for (i in 1:Nrep) {
x <- rnorm(Ns,0,1)
e <- rbinom(Ns,1,exp(-0.7))
y <- e*truncdist::rtrunc(n=Ns,spec='pois',a=0,b=Inf,lambda=exp(-1.5 + x))
mod <- pscl::hurdle(y ~ 1+x|1, link="log")
pars[i,1]<-mod$coefficients$count[1]
pars[i,2]<-mod$coefficients$count[2]
pars[i,3]<-mod$coefficients$zero[1]
}
# viewing data
plotpars <- pars[pars[,1]>-7,] #clipping
pairs(plotpars,cex=0.7,pch=21,
col= rgb(0,0,0,0.03),
bg = rgb(0,0,0,0.03))
# demonstrating linear relation / significant correlation
summary(lm(pars[,1] ~ pars[,3]))
It doesn't make much sense that there is a correlation between the two parts. But it might probably be due to discrete levels of the estimates for the parameters in the Poisson model, and how these relate to the number of zero's.
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
|
Regarding the philosophical aspect, "when should we consider something a single model and when two separate models", it may be interesting to note that the sample estimates of the model-parameters are
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
Regarding the philosophical aspect, "when should we consider something a single model and when two separate models", it may be interesting to note that the sample estimates of the model-parameters are correlated.
In the plot below with a simulation you mostly see the correlation between the slope and the intercept of the counts part. But there is also some slight relation between the counts part and the hurdle part. If you change the parameters, e.g. make the lambda in the Poisson distribution smaller or the sample size smaller, then the correlation becomes stronger.
So I would say that you should not consider it as two separate models. Or at least there is some relation even when in practice you can compute the two estimates independent from each other.
set.seed(1839)
Nrep <- 3000
Ns <- 100
pars <- matrix(rep(0,3*Nrep),Nrep)
colnames(pars) <- c("count_intercept","count_slope","hurdle_intercept")
# simulation-loop
# Note that a truncated poisson is used to generate data
# this will make the parameters from the hurdle function easier to interpret and compare
for (i in 1:Nrep) {
x <- rnorm(Ns,0,1)
e <- rbinom(Ns,1,exp(-0.7))
y <- e*truncdist::rtrunc(n=Ns,spec='pois',a=0,b=Inf,lambda=exp(-1.5 + x))
mod <- pscl::hurdle(y ~ 1+x|1, link="log")
pars[i,1]<-mod$coefficients$count[1]
pars[i,2]<-mod$coefficients$count[2]
pars[i,3]<-mod$coefficients$zero[1]
}
# viewing data
plotpars <- pars[pars[,1]>-7,] #clipping
pairs(plotpars,cex=0.7,pch=21,
col= rgb(0,0,0,0.03),
bg = rgb(0,0,0,0.03))
# demonstrating linear relation / significant correlation
summary(lm(pars[,1] ~ pars[,3]))
It doesn't make much sense that there is a correlation between the two parts. But it might probably be due to discrete levels of the estimates for the parameters in the Poisson model, and how these relate to the number of zero's.
|
Is a "hurdle model" really one model? Or just two separate, sequential models?
Regarding the philosophical aspect, "when should we consider something a single model and when two separate models", it may be interesting to note that the sample estimates of the model-parameters are
|
6,647
|
Do we need gradient descent to find the coefficients of a linear regression model?
|
Linear Least squares can be solved by
0) Using high quality linear least squares solver, based on either SVD or QR, as described below, for unconstrained linear least squares, or based on a version of Quadratic Programming or Conic Optimization for bound or linearly constrained least squares, as described below. Such a solver is pre-canned, heavily tested, and ready to go - use it.
1) SVD, which is the most reliable and numerically accurate method, but also takes more computing than alternatives. In MATLAB, the SVD solution of the unconstrained linear least squares problem A*X = b is pinv(A) * b, which is very accurate and reliable.
2) QR, which is fairly reliable and numerically accurate, but not as much as SVD, and is faster than SVD. In MATLAB, the QR solution of the unconstrained linear least squares problem A*X = b is A\b, which is fairly accurate and reliable, except when A is ill-conditioned, i.e., has large condition number. A\b is faster to compute than pinv(A) * b, but not as reliable or accurate.
3) Forming the Normal equations (TERRIBLE from reliability and numerical accuracy standpoint, because it squares the condition number, which is a very bad thing to do) and
3a) solving by Cholesky Factorization (not good)
3b) explicitly inverting matrix (HORRIBLE)
4) Solving as a Quadratic Programming problem or Second Order Cone problem
4a) Solve using high quality Quadratic Programming software. This is reliable and numerically accurate, but takes longer than SVD or QR. However, it is easy to add bound or general linear constraints, or linear or quadratic (two norm) penalty or regularization terms to the objective function, and still solve the problem using Quadratic Programming software.
4b) Solve as a Second Order Cone problem using high quality Conic Optimization software. Remarks are the same as for Quadratic Programming software, but you can also add bound or general linear constraints and other conic constraints or objective function terms, such as penalty or regularization terms in various norms.
5) Solve using high quality general purpose nonlinear optimization software. This may still work well, but will in general be slower than Quadratic Programming or Conic Optimization software, and maybe not quite as reliable. However, it may be possible to include not only bound and general linear constraints, but also nonlinear constraints into the least squares optimization. Also, can be used for nonlinear least squares, and if other nonlinear terms are added to the objective function.
6) Solve using lousy general purpose nonlinear optimization algorithms --> DON'T EVER DO THIS.
7) Solve using THE WORST POSSIBLE general purpose nonlinear optimization algorithm there is, i.e., gradient descent. Use this only if you want to see how bad and unreliable a solution method can be If someone tells you to use gradient descent to solve linear least squares problems
7 i) Learn about statistical computing from someone who knows something about it
7 ii) Learn optimization from someone who knows something about it.
|
Do we need gradient descent to find the coefficients of a linear regression model?
|
Linear Least squares can be solved by
0) Using high quality linear least squares solver, based on either SVD or QR, as described below, for unconstrained linear least squares, or based on a version of
|
Do we need gradient descent to find the coefficients of a linear regression model?
Linear Least squares can be solved by
0) Using high quality linear least squares solver, based on either SVD or QR, as described below, for unconstrained linear least squares, or based on a version of Quadratic Programming or Conic Optimization for bound or linearly constrained least squares, as described below. Such a solver is pre-canned, heavily tested, and ready to go - use it.
1) SVD, which is the most reliable and numerically accurate method, but also takes more computing than alternatives. In MATLAB, the SVD solution of the unconstrained linear least squares problem A*X = b is pinv(A) * b, which is very accurate and reliable.
2) QR, which is fairly reliable and numerically accurate, but not as much as SVD, and is faster than SVD. In MATLAB, the QR solution of the unconstrained linear least squares problem A*X = b is A\b, which is fairly accurate and reliable, except when A is ill-conditioned, i.e., has large condition number. A\b is faster to compute than pinv(A) * b, but not as reliable or accurate.
3) Forming the Normal equations (TERRIBLE from reliability and numerical accuracy standpoint, because it squares the condition number, which is a very bad thing to do) and
3a) solving by Cholesky Factorization (not good)
3b) explicitly inverting matrix (HORRIBLE)
4) Solving as a Quadratic Programming problem or Second Order Cone problem
4a) Solve using high quality Quadratic Programming software. This is reliable and numerically accurate, but takes longer than SVD or QR. However, it is easy to add bound or general linear constraints, or linear or quadratic (two norm) penalty or regularization terms to the objective function, and still solve the problem using Quadratic Programming software.
4b) Solve as a Second Order Cone problem using high quality Conic Optimization software. Remarks are the same as for Quadratic Programming software, but you can also add bound or general linear constraints and other conic constraints or objective function terms, such as penalty or regularization terms in various norms.
5) Solve using high quality general purpose nonlinear optimization software. This may still work well, but will in general be slower than Quadratic Programming or Conic Optimization software, and maybe not quite as reliable. However, it may be possible to include not only bound and general linear constraints, but also nonlinear constraints into the least squares optimization. Also, can be used for nonlinear least squares, and if other nonlinear terms are added to the objective function.
6) Solve using lousy general purpose nonlinear optimization algorithms --> DON'T EVER DO THIS.
7) Solve using THE WORST POSSIBLE general purpose nonlinear optimization algorithm there is, i.e., gradient descent. Use this only if you want to see how bad and unreliable a solution method can be If someone tells you to use gradient descent to solve linear least squares problems
7 i) Learn about statistical computing from someone who knows something about it
7 ii) Learn optimization from someone who knows something about it.
|
Do we need gradient descent to find the coefficients of a linear regression model?
Linear Least squares can be solved by
0) Using high quality linear least squares solver, based on either SVD or QR, as described below, for unconstrained linear least squares, or based on a version of
|
6,648
|
Do we need gradient descent to find the coefficients of a linear regression model?
|
Finding coefficients of a linear model is technically the process of finding solutions to a set of Linear Equations.
For computing such solutions, a lot of optimization techniques have been developed and Gradient Descent is one of them.
Thus, Gradient Descent is not the only way to do that.
Andrew Ng uses it in the course is because it is simple to understand, without dealing with advanced Linear Algebra and Numerical Computing.
|
Do we need gradient descent to find the coefficients of a linear regression model?
|
Finding coefficients of a linear model is technically the process of finding solutions to a set of Linear Equations.
For computing such solutions, a lot of optimization techniques have been developed
|
Do we need gradient descent to find the coefficients of a linear regression model?
Finding coefficients of a linear model is technically the process of finding solutions to a set of Linear Equations.
For computing such solutions, a lot of optimization techniques have been developed and Gradient Descent is one of them.
Thus, Gradient Descent is not the only way to do that.
Andrew Ng uses it in the course is because it is simple to understand, without dealing with advanced Linear Algebra and Numerical Computing.
|
Do we need gradient descent to find the coefficients of a linear regression model?
Finding coefficients of a linear model is technically the process of finding solutions to a set of Linear Equations.
For computing such solutions, a lot of optimization techniques have been developed
|
6,649
|
Do we need gradient descent to find the coefficients of a linear regression model?
|
Yes you can.
To solve the Ax=B problem you can use the QR or other matrix decomposition based least squares solvers. However, I tried to do it by Gradient Descent with L2 norm regularization. And I think GD is better.
The first picture is the result of numpy.nnls, orange line is ground truth, blue line is numpy.nnls result.
The second picture is the result of my gradient descent with l2 norm result.
The second result is better.
|
Do we need gradient descent to find the coefficients of a linear regression model?
|
Yes you can.
To solve the Ax=B problem you can use the QR or other matrix decomposition based least squares solvers. However, I tried to do it by Gradient Descent with L2 norm regularization. And I th
|
Do we need gradient descent to find the coefficients of a linear regression model?
Yes you can.
To solve the Ax=B problem you can use the QR or other matrix decomposition based least squares solvers. However, I tried to do it by Gradient Descent with L2 norm regularization. And I think GD is better.
The first picture is the result of numpy.nnls, orange line is ground truth, blue line is numpy.nnls result.
The second picture is the result of my gradient descent with l2 norm result.
The second result is better.
|
Do we need gradient descent to find the coefficients of a linear regression model?
Yes you can.
To solve the Ax=B problem you can use the QR or other matrix decomposition based least squares solvers. However, I tried to do it by Gradient Descent with L2 norm regularization. And I th
|
6,650
|
Variance of a function of one random variable
|
Update
I've underestimated Taylor expansions. They actually work. I assumed that integral of the remainder term can be unbounded, but with a little work it can be shown that this is not the case.
The Taylor expansion works for functions in bounded closed interval. For random variables with finite variance Chebyshev inequality gives
$$P(|X-EX|>c)\le \frac{\operatorname{Var}(X)}{c}$$
So for any $\varepsilon>0$ we can find large enough $c$ so that
$$P(X\in [EX-c,EX+c])=P(|X-EX|\le c)<1-\varepsilon$$
First let us estimate $Ef(X)$. We have
\begin{align}
Ef(X)=\int_{|x-EX|\le c}f(x)dF(x)+\int_{|x-EX|>c}f(x)dF(x)
\end{align}
where $F(x)$ is the distribution function for $X$.
Since the domain of the first integral is interval $[EX-c,EX+c]$ which is bounded closed interval we can apply Taylor expansion:
\begin{align}
f(x)=f(EX)+f'(EX)(x-EX)+\frac{f''(EX)}{2}(x-EX)^2+\frac{f'''(\alpha)}{3!}(x-EX)^3
\end{align}
where $\alpha\in [EX-c,EX+c]$, and the equality holds for all $x\in[EX-c,EX+c]$. I took only $4$ terms in the Taylor expansion, but in general we can take as many as we like, as long as function $f$ is smooth enough.
Substituting this formula to the previous one we get
\begin{align}
Ef(X)&=\int_{|x-EX|\le c}f(EX)+f'(EX)(x-EX)+\frac{f''(EX)}{2}(x-EX)^2dF(x)\\\\
&+\int_{|x-EX|\le c}\frac{f'''(\alpha)}{3!}(x-EX)^3dF(x)
+\int_{|x-EX|>c}f(x)dF(x)
\end{align}
Now we can increase the domain of the integration to get the following formula
\begin{align}
Ef(X)&=f(EX)+\frac{f''(EX)}{2}E(X-EX)^2+R_3\\\\
\end{align}
where
\begin{align}
R_3&=\frac{f'''(\alpha)}{3!}E(X-EX)^3+\\\\
&+\int_{|x-EX|>c}\left(f(EX)+f'(EX)(x-EX)+\frac{f''(EX)}{2}(x-EX)^2+f(X)\right)dF(x)
\end{align}
Now under some moment conditions we can show that the second term of this remainder term is as large as $P(|X-EX|>c)$ which is small. Unfortunately the first term remains and so the quality of the approximation depends on $E(X-EX)^3$ and the behaviour of third derivative of $f$ in bounded intervals. Such approximation should work best for random variables with $E(X-EX)^3=0$.
Now for the variance we can use Taylor approximation for $f(x)$, subtract the formula for $Ef(x)$ and square the difference. Then
$E(f(x)-Ef(x))^2=(f'(EX))^2\operatorname{Var}(X)+T_3$
where $T_3$ involves moments $E(X-EX)^k$ for $k=4,5,6$. We can arrive at this formula also by using only first-order Taylor expansion, i.e. using only the first and second derivatives. The error term would be similar.
Other way is to expand $f^2(x)$:
\begin{align}
f^2(x)&=f^2(EX)+2f(EX)f'(EX)(x-EX)\\\\
&+[(f'(EX))^2+f(EX)f''(EX)](X-EX)^2+\frac{(f^2(\beta))'''}{3!}(X-EX)^3
\end{align}
Similarly we get then
\begin{align*}
Ef^2(x)=f^2(EX)+[(f'(EX))^2+f(EX)f''(EX)]\operatorname{Var}(X)+\tilde{R}_3
\end{align*}
where $\tilde{R}_3$ is similar to $R_3$.
The formula for variance then becomes
\begin{align}
\operatorname{Var}(f(X))=[f'(EX)]^2\operatorname{Var}(X)-\frac{[f''(EX)]^2}{4}\operatorname{Var}^2(X)+\tilde{T}_3
\end{align}
where $\tilde{T}_3$ have only third moments and above.
|
Variance of a function of one random variable
|
Update
I've underestimated Taylor expansions. They actually work. I assumed that integral of the remainder term can be unbounded, but with a little work it can be shown that this is not the case.
The
|
Variance of a function of one random variable
Update
I've underestimated Taylor expansions. They actually work. I assumed that integral of the remainder term can be unbounded, but with a little work it can be shown that this is not the case.
The Taylor expansion works for functions in bounded closed interval. For random variables with finite variance Chebyshev inequality gives
$$P(|X-EX|>c)\le \frac{\operatorname{Var}(X)}{c}$$
So for any $\varepsilon>0$ we can find large enough $c$ so that
$$P(X\in [EX-c,EX+c])=P(|X-EX|\le c)<1-\varepsilon$$
First let us estimate $Ef(X)$. We have
\begin{align}
Ef(X)=\int_{|x-EX|\le c}f(x)dF(x)+\int_{|x-EX|>c}f(x)dF(x)
\end{align}
where $F(x)$ is the distribution function for $X$.
Since the domain of the first integral is interval $[EX-c,EX+c]$ which is bounded closed interval we can apply Taylor expansion:
\begin{align}
f(x)=f(EX)+f'(EX)(x-EX)+\frac{f''(EX)}{2}(x-EX)^2+\frac{f'''(\alpha)}{3!}(x-EX)^3
\end{align}
where $\alpha\in [EX-c,EX+c]$, and the equality holds for all $x\in[EX-c,EX+c]$. I took only $4$ terms in the Taylor expansion, but in general we can take as many as we like, as long as function $f$ is smooth enough.
Substituting this formula to the previous one we get
\begin{align}
Ef(X)&=\int_{|x-EX|\le c}f(EX)+f'(EX)(x-EX)+\frac{f''(EX)}{2}(x-EX)^2dF(x)\\\\
&+\int_{|x-EX|\le c}\frac{f'''(\alpha)}{3!}(x-EX)^3dF(x)
+\int_{|x-EX|>c}f(x)dF(x)
\end{align}
Now we can increase the domain of the integration to get the following formula
\begin{align}
Ef(X)&=f(EX)+\frac{f''(EX)}{2}E(X-EX)^2+R_3\\\\
\end{align}
where
\begin{align}
R_3&=\frac{f'''(\alpha)}{3!}E(X-EX)^3+\\\\
&+\int_{|x-EX|>c}\left(f(EX)+f'(EX)(x-EX)+\frac{f''(EX)}{2}(x-EX)^2+f(X)\right)dF(x)
\end{align}
Now under some moment conditions we can show that the second term of this remainder term is as large as $P(|X-EX|>c)$ which is small. Unfortunately the first term remains and so the quality of the approximation depends on $E(X-EX)^3$ and the behaviour of third derivative of $f$ in bounded intervals. Such approximation should work best for random variables with $E(X-EX)^3=0$.
Now for the variance we can use Taylor approximation for $f(x)$, subtract the formula for $Ef(x)$ and square the difference. Then
$E(f(x)-Ef(x))^2=(f'(EX))^2\operatorname{Var}(X)+T_3$
where $T_3$ involves moments $E(X-EX)^k$ for $k=4,5,6$. We can arrive at this formula also by using only first-order Taylor expansion, i.e. using only the first and second derivatives. The error term would be similar.
Other way is to expand $f^2(x)$:
\begin{align}
f^2(x)&=f^2(EX)+2f(EX)f'(EX)(x-EX)\\\\
&+[(f'(EX))^2+f(EX)f''(EX)](X-EX)^2+\frac{(f^2(\beta))'''}{3!}(X-EX)^3
\end{align}
Similarly we get then
\begin{align*}
Ef^2(x)=f^2(EX)+[(f'(EX))^2+f(EX)f''(EX)]\operatorname{Var}(X)+\tilde{R}_3
\end{align*}
where $\tilde{R}_3$ is similar to $R_3$.
The formula for variance then becomes
\begin{align}
\operatorname{Var}(f(X))=[f'(EX)]^2\operatorname{Var}(X)-\frac{[f''(EX)]^2}{4}\operatorname{Var}^2(X)+\tilde{T}_3
\end{align}
where $\tilde{T}_3$ have only third moments and above.
|
Variance of a function of one random variable
Update
I've underestimated Taylor expansions. They actually work. I assumed that integral of the remainder term can be unbounded, but with a little work it can be shown that this is not the case.
The
|
6,651
|
Variance of a function of one random variable
|
To know the first two moments of X (mean and variance) is not enough, if the function f(x) is arbitrary (non linear). Not only for computing the variance of the transformed variable Y, but also for its mean.
To see this -and perhaps to attack your problem- you can assume that your transformation function has a Taylor expansion around the mean of X and work from there.
|
Variance of a function of one random variable
|
To know the first two moments of X (mean and variance) is not enough, if the function f(x) is arbitrary (non linear). Not only for computing the variance of the transformed variable Y, but also for it
|
Variance of a function of one random variable
To know the first two moments of X (mean and variance) is not enough, if the function f(x) is arbitrary (non linear). Not only for computing the variance of the transformed variable Y, but also for its mean.
To see this -and perhaps to attack your problem- you can assume that your transformation function has a Taylor expansion around the mean of X and work from there.
|
Variance of a function of one random variable
To know the first two moments of X (mean and variance) is not enough, if the function f(x) is arbitrary (non linear). Not only for computing the variance of the transformed variable Y, but also for it
|
6,652
|
Justification of one-tailed hypothesis testing
|
That's a thoughtful question. Many texts (perhaps for pedagogical reasons) paper over this issue. What's really going on is that $H_0$ is a composite "hypothesis" in your one-sided situation: it's actually a set of hypotheses, not a single one. It is necessary that for every possible hypothesis in $H_0$, the chance of the test statistic falling in the critical region must be less than or equal to the test size. Moreover, if the test is actually to achieve its nominal size (which is a good thing for achieving high power), then the supremum of these chances (taken over all the null hypotheses) should equal the nominal size. In practice, for simple one-parameter tests of location involving certain "nice" families of distributions, this supremum is attained for the hypothesis with parameter $\theta_0$. Thus, as a practical matter, all computation focuses on this one distribution. But we mustn't forget about the rest of the set $H_0$: that is a crucial distinction between two-sided and one-sided tests (and between "simple" and "composite" tests in general).
This subtly influences the interpretation of results of one-sided tests. When the null is rejected, we can say the evidence points against the true state of nature being any of the distributions in $H_0$. When the null is not rejected, we can only say there exists a distribution in $H_0$ which is "consistent" with the observed data. We are not saying that all distributions in $H_0$ are consistent with the data: far from it! Many of them may yield extremely low likelihoods.
|
Justification of one-tailed hypothesis testing
|
That's a thoughtful question. Many texts (perhaps for pedagogical reasons) paper over this issue. What's really going on is that $H_0$ is a composite "hypothesis" in your one-sided situation: it's a
|
Justification of one-tailed hypothesis testing
That's a thoughtful question. Many texts (perhaps for pedagogical reasons) paper over this issue. What's really going on is that $H_0$ is a composite "hypothesis" in your one-sided situation: it's actually a set of hypotheses, not a single one. It is necessary that for every possible hypothesis in $H_0$, the chance of the test statistic falling in the critical region must be less than or equal to the test size. Moreover, if the test is actually to achieve its nominal size (which is a good thing for achieving high power), then the supremum of these chances (taken over all the null hypotheses) should equal the nominal size. In practice, for simple one-parameter tests of location involving certain "nice" families of distributions, this supremum is attained for the hypothesis with parameter $\theta_0$. Thus, as a practical matter, all computation focuses on this one distribution. But we mustn't forget about the rest of the set $H_0$: that is a crucial distinction between two-sided and one-sided tests (and between "simple" and "composite" tests in general).
This subtly influences the interpretation of results of one-sided tests. When the null is rejected, we can say the evidence points against the true state of nature being any of the distributions in $H_0$. When the null is not rejected, we can only say there exists a distribution in $H_0$ which is "consistent" with the observed data. We are not saying that all distributions in $H_0$ are consistent with the data: far from it! Many of them may yield extremely low likelihoods.
|
Justification of one-tailed hypothesis testing
That's a thoughtful question. Many texts (perhaps for pedagogical reasons) paper over this issue. What's really going on is that $H_0$ is a composite "hypothesis" in your one-sided situation: it's a
|
6,653
|
Justification of one-tailed hypothesis testing
|
I see the $p$-value as the maximum probability of a type I error. If $\theta \ll \theta_0$, the probability of a type I error rate may be effectively zero, but so be it. When looking at the test from a minimax perspective, an adversary would never draw from deep in the 'interior' of the null hypothesis anyway, and the power should not be affected. For simple situations (the $t$-test, for example) it is possible to construct a test with a guaranteed maximum type I rate, allowing such one sided null hypotheses.
|
Justification of one-tailed hypothesis testing
|
I see the $p$-value as the maximum probability of a type I error. If $\theta \ll \theta_0$, the probability of a type I error rate may be effectively zero, but so be it. When looking at the test from
|
Justification of one-tailed hypothesis testing
I see the $p$-value as the maximum probability of a type I error. If $\theta \ll \theta_0$, the probability of a type I error rate may be effectively zero, but so be it. When looking at the test from a minimax perspective, an adversary would never draw from deep in the 'interior' of the null hypothesis anyway, and the power should not be affected. For simple situations (the $t$-test, for example) it is possible to construct a test with a guaranteed maximum type I rate, allowing such one sided null hypotheses.
|
Justification of one-tailed hypothesis testing
I see the $p$-value as the maximum probability of a type I error. If $\theta \ll \theta_0$, the probability of a type I error rate may be effectively zero, but so be it. When looking at the test from
|
6,654
|
Justification of one-tailed hypothesis testing
|
You would use a one-sided hypothesis test if only results in one direction are supportive of the conclusion you are trying to reach.
Think of this in terms of the question you are asking. Suppose, for example, you want to see whether obesity leads to increased risk of heart attack. You gather your data, which might consist of 10 obese people and 10 non-obese people. Now let's say that, due to unrecorded confounding factors, poor experimental design, or just plain bad luck, you observe that only 2 of the 10 obese people have heart attacks, compared to 8 of the non-obese people.
Now if you were to conduct a 2-sided hypothesis test on this data, you would conclude that there was a statistically significant association (p ~ 0.02)between obesity and heart attack risk. However, the association would be in the opposite direction to that which you were actually expecting to see, hence the test result would be misleading.
(In real life, an experiment that produced such a counterintuitive result could lead to further questions that are interesting in themselves: for example, the data collection process might need to be improved, or there might be previously-unknown risk factors at work, or maybe conventional wisdom is simply mistaken. But these issues aren't really related to the narrow question of what sort of hypothesis test to use.)
|
Justification of one-tailed hypothesis testing
|
You would use a one-sided hypothesis test if only results in one direction are supportive of the conclusion you are trying to reach.
Think of this in terms of the question you are asking. Suppose, for
|
Justification of one-tailed hypothesis testing
You would use a one-sided hypothesis test if only results in one direction are supportive of the conclusion you are trying to reach.
Think of this in terms of the question you are asking. Suppose, for example, you want to see whether obesity leads to increased risk of heart attack. You gather your data, which might consist of 10 obese people and 10 non-obese people. Now let's say that, due to unrecorded confounding factors, poor experimental design, or just plain bad luck, you observe that only 2 of the 10 obese people have heart attacks, compared to 8 of the non-obese people.
Now if you were to conduct a 2-sided hypothesis test on this data, you would conclude that there was a statistically significant association (p ~ 0.02)between obesity and heart attack risk. However, the association would be in the opposite direction to that which you were actually expecting to see, hence the test result would be misleading.
(In real life, an experiment that produced such a counterintuitive result could lead to further questions that are interesting in themselves: for example, the data collection process might need to be improved, or there might be previously-unknown risk factors at work, or maybe conventional wisdom is simply mistaken. But these issues aren't really related to the narrow question of what sort of hypothesis test to use.)
|
Justification of one-tailed hypothesis testing
You would use a one-sided hypothesis test if only results in one direction are supportive of the conclusion you are trying to reach.
Think of this in terms of the question you are asking. Suppose, for
|
6,655
|
Justification of one-tailed hypothesis testing
|
The $p$-value is the probability of the respective event under the condition that $H_0$ is true. The simplest possible toy example are two coin tosses. The 2-sided $H_0$ would be that you consider the coin fair, i.e. you throw one head and one tail. The probability for that is $0.5$. $H_1$ in this case is that you consider it biased to one side or the other, i.e. you either throw two heads or two tails. The probability again is $0.5$
For one 1-sided $H_0$ think of a game where you set your money on heads. You are ok with the coin being fair but of course also comfortable with it being biased towards heads. This is your $H_0$ where you have the possibilities of one head and one tail or two heads: $0.75$ probability. $H_1$ is just the remaining case of two tails where you would call foul: $0.25$ probability. Please note that because you consider the whole region from fair to being biased towards heads as your default two tails is to be considered much more improbable and even more suggestive that something is not in order.
Now when the events of our $H_1$'s happen nevertheless their probabilities are the p-values under the condition that the respective $H_0$'s are true - as noted above. So depending on your confidence level you can or cannot reject your $H_0$'s.
You can experiment with this toy example in R yourself, you should also try different absolute numbers and combinations of heads and tails:
> binom.test(2,2,alternative="two.sided")
Exact binomial test
data: 2 and 2
number of successes = 2, number of trials = 2, p-value = 0.5
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
0.1581139 1.0000000
sample estimates:
probability of success
1
> binom.test(2,2,alternative="greater")
Exact binomial test
data: 2 and 2
number of successes = 2, number of trials = 2, p-value = 0.25
alternative hypothesis: true probability of success is greater than 0.5
95 percent confidence interval:
0.2236068 1.0000000
sample estimates:
probability of success
1
|
Justification of one-tailed hypothesis testing
|
The $p$-value is the probability of the respective event under the condition that $H_0$ is true. The simplest possible toy example are two coin tosses. The 2-sided $H_0$ would be that you consider the
|
Justification of one-tailed hypothesis testing
The $p$-value is the probability of the respective event under the condition that $H_0$ is true. The simplest possible toy example are two coin tosses. The 2-sided $H_0$ would be that you consider the coin fair, i.e. you throw one head and one tail. The probability for that is $0.5$. $H_1$ in this case is that you consider it biased to one side or the other, i.e. you either throw two heads or two tails. The probability again is $0.5$
For one 1-sided $H_0$ think of a game where you set your money on heads. You are ok with the coin being fair but of course also comfortable with it being biased towards heads. This is your $H_0$ where you have the possibilities of one head and one tail or two heads: $0.75$ probability. $H_1$ is just the remaining case of two tails where you would call foul: $0.25$ probability. Please note that because you consider the whole region from fair to being biased towards heads as your default two tails is to be considered much more improbable and even more suggestive that something is not in order.
Now when the events of our $H_1$'s happen nevertheless their probabilities are the p-values under the condition that the respective $H_0$'s are true - as noted above. So depending on your confidence level you can or cannot reject your $H_0$'s.
You can experiment with this toy example in R yourself, you should also try different absolute numbers and combinations of heads and tails:
> binom.test(2,2,alternative="two.sided")
Exact binomial test
data: 2 and 2
number of successes = 2, number of trials = 2, p-value = 0.5
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
0.1581139 1.0000000
sample estimates:
probability of success
1
> binom.test(2,2,alternative="greater")
Exact binomial test
data: 2 and 2
number of successes = 2, number of trials = 2, p-value = 0.25
alternative hypothesis: true probability of success is greater than 0.5
95 percent confidence interval:
0.2236068 1.0000000
sample estimates:
probability of success
1
|
Justification of one-tailed hypothesis testing
The $p$-value is the probability of the respective event under the condition that $H_0$ is true. The simplest possible toy example are two coin tosses. The 2-sided $H_0$ would be that you consider the
|
6,656
|
Why are Decision Trees not computationally expensive?
|
Decision trees algorithms do not compute all possible trees when they fit a tree. If they did they would be solving an NP-hard problem. Decision tree fitting algorithms typically make greedy decisions in the fitting process—at each stage they optimize the sub-problem for finding an optimal split with the data in the given node and the keep moving forward in the fitting process. Also, as you move deeper into the decision tree you have a smaller set of data that has made it to the given node so that you will be optimizing the splitting rule over a smaller subset of data. All of these choices are linear scans of the data in the given node. This is not complicated to do but can become somewhat expensive computationally if you have a large number of observations or a large number of covariates to split on. However, a lot of the work can be split up and sent off to different machines to work on so there are ways to build out your computational architecture to scale up. In general though, the method works fairly quickly on lots of the datasets you see in coursework and in many real world scenarios as well.
|
Why are Decision Trees not computationally expensive?
|
Decision trees algorithms do not compute all possible trees when they fit a tree. If they did they would be solving an NP-hard problem. Decision tree fitting algorithms typically make greedy decisions
|
Why are Decision Trees not computationally expensive?
Decision trees algorithms do not compute all possible trees when they fit a tree. If they did they would be solving an NP-hard problem. Decision tree fitting algorithms typically make greedy decisions in the fitting process—at each stage they optimize the sub-problem for finding an optimal split with the data in the given node and the keep moving forward in the fitting process. Also, as you move deeper into the decision tree you have a smaller set of data that has made it to the given node so that you will be optimizing the splitting rule over a smaller subset of data. All of these choices are linear scans of the data in the given node. This is not complicated to do but can become somewhat expensive computationally if you have a large number of observations or a large number of covariates to split on. However, a lot of the work can be split up and sent off to different machines to work on so there are ways to build out your computational architecture to scale up. In general though, the method works fairly quickly on lots of the datasets you see in coursework and in many real world scenarios as well.
|
Why are Decision Trees not computationally expensive?
Decision trees algorithms do not compute all possible trees when they fit a tree. If they did they would be solving an NP-hard problem. Decision tree fitting algorithms typically make greedy decisions
|
6,657
|
Why are Decision Trees not computationally expensive?
|
There are some differences between the CART and C4.5 algorithms for building decision trees. For instance, CART uses Gini Impurity to pick features while C.4.5 uses Shannon Entropy. I don't think the differences are relevant for the answer, so I will not differentiate between those.
What makes decision trees faster than you would think is:
As others have said, these algorithms are 1-lookahead algorithms. They perform local optimizations. At every branch, they choose the rule which maximizes/minimizes whatever metric they use (Gini or Entropy). This means they might miss rules where using a logical operator such as and would result in a better tree. This means you should be very careful/clever when doing feature engineering. For example, say you are trying to predict how much people drink, you might want to feature engineer things like new_feature = hour > 22 & hour < 4 & (friday_night | saturday_night). Decision trees might miss such rules, or give them less importance than they should.
More importantly, the metrics used by decision trees can be computed incrementally. Say that you have a feature $X_1 = \{3,1.5,2.5,2,1\}$. The decision tree does not need to compute the metric for X <= 1, then compute the metric again for X <= 1.5, then again for X <= 2, etc. Gini and Entropy were chosen because they can be computed incrementally. First of all, each feature is sorted, so that you have $X_1 = \{1,1.5,2,2.5,3\}$. Secondly, when you compute X <= 1, you can use the result to easily compute X <= 1.5. It's like doing an average. If you have an average of a sample, $\bar x$, and I give you another value $v$, you can cheaply update your average doing, $\bar x \leftarrow \frac{n\bar x+v}{n+1}$. Gini coefficient is calculated as a fraction of sums, which can be easily incrementally computed for the sample.
Decision trees can be parallelized. Each node is composed of two branches which are independent. Therefore, at each branch, you have the opportunity to parallelize the tree creation. Furthermore, the feature selection itself can also be parallelized. This is what makes packages like xgboost so fast. Gradient boosting is sequential and cannot be parallelized, but the trees themselves can.
|
Why are Decision Trees not computationally expensive?
|
There are some differences between the CART and C4.5 algorithms for building decision trees. For instance, CART uses Gini Impurity to pick features while C.4.5 uses Shannon Entropy. I don't think the
|
Why are Decision Trees not computationally expensive?
There are some differences between the CART and C4.5 algorithms for building decision trees. For instance, CART uses Gini Impurity to pick features while C.4.5 uses Shannon Entropy. I don't think the differences are relevant for the answer, so I will not differentiate between those.
What makes decision trees faster than you would think is:
As others have said, these algorithms are 1-lookahead algorithms. They perform local optimizations. At every branch, they choose the rule which maximizes/minimizes whatever metric they use (Gini or Entropy). This means they might miss rules where using a logical operator such as and would result in a better tree. This means you should be very careful/clever when doing feature engineering. For example, say you are trying to predict how much people drink, you might want to feature engineer things like new_feature = hour > 22 & hour < 4 & (friday_night | saturday_night). Decision trees might miss such rules, or give them less importance than they should.
More importantly, the metrics used by decision trees can be computed incrementally. Say that you have a feature $X_1 = \{3,1.5,2.5,2,1\}$. The decision tree does not need to compute the metric for X <= 1, then compute the metric again for X <= 1.5, then again for X <= 2, etc. Gini and Entropy were chosen because they can be computed incrementally. First of all, each feature is sorted, so that you have $X_1 = \{1,1.5,2,2.5,3\}$. Secondly, when you compute X <= 1, you can use the result to easily compute X <= 1.5. It's like doing an average. If you have an average of a sample, $\bar x$, and I give you another value $v$, you can cheaply update your average doing, $\bar x \leftarrow \frac{n\bar x+v}{n+1}$. Gini coefficient is calculated as a fraction of sums, which can be easily incrementally computed for the sample.
Decision trees can be parallelized. Each node is composed of two branches which are independent. Therefore, at each branch, you have the opportunity to parallelize the tree creation. Furthermore, the feature selection itself can also be parallelized. This is what makes packages like xgboost so fast. Gradient boosting is sequential and cannot be parallelized, but the trees themselves can.
|
Why are Decision Trees not computationally expensive?
There are some differences between the CART and C4.5 algorithms for building decision trees. For instance, CART uses Gini Impurity to pick features while C.4.5 uses Shannon Entropy. I don't think the
|
6,658
|
Why are Decision Trees not computationally expensive?
|
Just to enrich the answers,
Hierarchic axis-parallel decision-trees are fast (CART, C4.5) but there are other alternatives such as non-hierarchic decision trees or those that perform oblique partitions that are not, although they can be more accurate. Check the following references if you are interested (They are not an exahustive selection).
Non-hierarchic:
Grubinger, T., Zeileis, A. and Pfeiffer, K.-., 2014. Evtree: Evolutionary learning of globally optimal classification and regression trees in R. J.Stat.Software 61 (1), 1-29.
Oblique splits:
Murthy, S.K., Kasif, S. and Salzberg, S., 1994. A system for induction of oblique decision trees. J. Artif. Intell. Res. 2 (1), 1-32. http://dx.doi.org/doi:10.1613/jair.63.
Cantú-Paz, E. and Kamath, C., 2003. Inducing oblique decision trees with evolutionary algorithms. IEEE Trans. Evol. Comput. 7 (1), 54-68. http://dx.doi.org/10.1109/TEVC.2002.806857.
Heath, D., Kasif, S. and Salzberg, S., 1993. Induction of oblique decision trees. J. Artif. Intell. Res. 2 (2), 1002-1007.
Good luck!
|
Why are Decision Trees not computationally expensive?
|
Just to enrich the answers,
Hierarchic axis-parallel decision-trees are fast (CART, C4.5) but there are other alternatives such as non-hierarchic decision trees or those that perform oblique partitio
|
Why are Decision Trees not computationally expensive?
Just to enrich the answers,
Hierarchic axis-parallel decision-trees are fast (CART, C4.5) but there are other alternatives such as non-hierarchic decision trees or those that perform oblique partitions that are not, although they can be more accurate. Check the following references if you are interested (They are not an exahustive selection).
Non-hierarchic:
Grubinger, T., Zeileis, A. and Pfeiffer, K.-., 2014. Evtree: Evolutionary learning of globally optimal classification and regression trees in R. J.Stat.Software 61 (1), 1-29.
Oblique splits:
Murthy, S.K., Kasif, S. and Salzberg, S., 1994. A system for induction of oblique decision trees. J. Artif. Intell. Res. 2 (1), 1-32. http://dx.doi.org/doi:10.1613/jair.63.
Cantú-Paz, E. and Kamath, C., 2003. Inducing oblique decision trees with evolutionary algorithms. IEEE Trans. Evol. Comput. 7 (1), 54-68. http://dx.doi.org/10.1109/TEVC.2002.806857.
Heath, D., Kasif, S. and Salzberg, S., 1993. Induction of oblique decision trees. J. Artif. Intell. Res. 2 (2), 1002-1007.
Good luck!
|
Why are Decision Trees not computationally expensive?
Just to enrich the answers,
Hierarchic axis-parallel decision-trees are fast (CART, C4.5) but there are other alternatives such as non-hierarchic decision trees or those that perform oblique partitio
|
6,659
|
What's the difference between logistic regression and perceptron?
|
In short, logistic regression has probabilistic connotations that go beyond the classifier use in ML. I have some notes on logistic regression here.
The hypothesis in logistic regression provides a measure of uncertainty in the occurrence of a binary outcome based on a linear model. The output is bounded asymptotically between $0$ and $1$, and depends on a linear model, such that when the underlying regression line has value $0$, the logistic equation is $0.5 = \frac{e^0}{1+e^0}$, providing a natural cutoff point for classification purposes. However, it is at the cost of throwing out the probability information in the actual result of $h(\Theta^T\bf x) =\frac{e^{\Theta^T \bf x}}{1 +e^{\Theta^T\bf x}}$, which often is interesting (e.g. probability of loan default given income, credit score, age, etc.).
The perceptron classification algorithm is a more basic procedure, based on dot products between examples and weights. Whenever an example is misclassified the sign of the dot product is at odds with the classification value ($-1$ and $1$) in the training set. To correct this, the example vector will be iteratively added or subtracted from the vector of weights or coefficients, progressively updating its elements:
Vectorially, the $d$ features or attributes of an example are $\bf x$, and the idea is to "pass" the example if:
$\displaystyle \sum_{1}^d \theta_i x_i > \text{theshold}$ or...
$h(x) = \text{sign}\big(\displaystyle \sum_{1}^d \theta_i x_i - \text{theshold}\big)$. The sign function results in $1$ or $-1$, as opposed to $0$ and $1$ in logistic regression.
The threshold will be absorbed into the bias coefficient, $+ \theta_0$. The formula is now:
$h(x) = \text{sign}\big(\displaystyle \sum_0^d \theta_i x_i\big)$, or vectorized: $h(x) = \text{sign}(\theta^T\bf x)$.
Misclassified points will have $\text{sign}(\theta^T\bf x) \neq y_n$, meaning that the dot product of $\Theta$ and $\bf x_n$ will be positive (vectors in the same direction), when $y_n$ is negative, or the dot product will be negative (vectors in opposite directions), while $y_n$ is positive.
I have been working on the differences between these two methods in a dataset from the same course, in which the test results in two separate exams are related to the final acceptance to college:
The decision boundary can be easily found with logistic regression, but was interesting to see that although the coefficients obtained with perceptron were vastly different than in logistic regression, the simple application of the $\text{sign}(\cdot)$ function to the results yielded just as good a classifying algorithm. In fact the maximum accuracy (the limit set by linear inseparability of some examples) was reached by the second iteration. Here is the sequence of boundary division lines as $10$ iterations approximated the weights, starting from a random vector of coefficients:
The accuracy in the classification as a function of the number of iterations increases rapidly and plateaus at $90\%$, consistent how fast a near-optimal decision boundary is reached in the videoclip above. Here is the plot of the learning curve:
The code used is here.
|
What's the difference between logistic regression and perceptron?
|
In short, logistic regression has probabilistic connotations that go beyond the classifier use in ML. I have some notes on logistic regression here.
The hypothesis in logistic regression provides a me
|
What's the difference between logistic regression and perceptron?
In short, logistic regression has probabilistic connotations that go beyond the classifier use in ML. I have some notes on logistic regression here.
The hypothesis in logistic regression provides a measure of uncertainty in the occurrence of a binary outcome based on a linear model. The output is bounded asymptotically between $0$ and $1$, and depends on a linear model, such that when the underlying regression line has value $0$, the logistic equation is $0.5 = \frac{e^0}{1+e^0}$, providing a natural cutoff point for classification purposes. However, it is at the cost of throwing out the probability information in the actual result of $h(\Theta^T\bf x) =\frac{e^{\Theta^T \bf x}}{1 +e^{\Theta^T\bf x}}$, which often is interesting (e.g. probability of loan default given income, credit score, age, etc.).
The perceptron classification algorithm is a more basic procedure, based on dot products between examples and weights. Whenever an example is misclassified the sign of the dot product is at odds with the classification value ($-1$ and $1$) in the training set. To correct this, the example vector will be iteratively added or subtracted from the vector of weights or coefficients, progressively updating its elements:
Vectorially, the $d$ features or attributes of an example are $\bf x$, and the idea is to "pass" the example if:
$\displaystyle \sum_{1}^d \theta_i x_i > \text{theshold}$ or...
$h(x) = \text{sign}\big(\displaystyle \sum_{1}^d \theta_i x_i - \text{theshold}\big)$. The sign function results in $1$ or $-1$, as opposed to $0$ and $1$ in logistic regression.
The threshold will be absorbed into the bias coefficient, $+ \theta_0$. The formula is now:
$h(x) = \text{sign}\big(\displaystyle \sum_0^d \theta_i x_i\big)$, or vectorized: $h(x) = \text{sign}(\theta^T\bf x)$.
Misclassified points will have $\text{sign}(\theta^T\bf x) \neq y_n$, meaning that the dot product of $\Theta$ and $\bf x_n$ will be positive (vectors in the same direction), when $y_n$ is negative, or the dot product will be negative (vectors in opposite directions), while $y_n$ is positive.
I have been working on the differences between these two methods in a dataset from the same course, in which the test results in two separate exams are related to the final acceptance to college:
The decision boundary can be easily found with logistic regression, but was interesting to see that although the coefficients obtained with perceptron were vastly different than in logistic regression, the simple application of the $\text{sign}(\cdot)$ function to the results yielded just as good a classifying algorithm. In fact the maximum accuracy (the limit set by linear inseparability of some examples) was reached by the second iteration. Here is the sequence of boundary division lines as $10$ iterations approximated the weights, starting from a random vector of coefficients:
The accuracy in the classification as a function of the number of iterations increases rapidly and plateaus at $90\%$, consistent how fast a near-optimal decision boundary is reached in the videoclip above. Here is the plot of the learning curve:
The code used is here.
|
What's the difference between logistic regression and perceptron?
In short, logistic regression has probabilistic connotations that go beyond the classifier use in ML. I have some notes on logistic regression here.
The hypothesis in logistic regression provides a me
|
6,660
|
What's the difference between logistic regression and perceptron?
|
There is some confusion that may arise here. Originally a perceptron was only referring to neural networks with a step function as the transfer function. In that case of course the difference is that the logistic regression uses a logistic function and the perceptron uses a step function. In general both algorithm should yield the same decision boundary (at least for a single neuron perceptron). However:
The parameter vector for the perceptron may be arbitrarily scaled compared to the one derived by logistic regression. Any scaling of the parameter vector will define the same boundary, but the probabilities calculated by logistic regression depend on the exact scaling.
The output from a step function can of course not be interpreted as any kind of probability.
Since a step function is not differentiable, it is not possible to train a perceptron using the same algorithms that are used for logistic regression.
In some cases, the term perceptron is also used to refer to neural networks which use a logistic function as a transfer function (however, this is not in accordance with the original terminology). In that case, a logistic regression and a "perceptron" are exactly the same. Of course, with a perceptron it is possible to use multiple neurons all using a logistic transfer function, which becomes somewhat relatable to stacking of logistic regression (not the same, but similar).
|
What's the difference between logistic regression and perceptron?
|
There is some confusion that may arise here. Originally a perceptron was only referring to neural networks with a step function as the transfer function. In that case of course the difference is that
|
What's the difference between logistic regression and perceptron?
There is some confusion that may arise here. Originally a perceptron was only referring to neural networks with a step function as the transfer function. In that case of course the difference is that the logistic regression uses a logistic function and the perceptron uses a step function. In general both algorithm should yield the same decision boundary (at least for a single neuron perceptron). However:
The parameter vector for the perceptron may be arbitrarily scaled compared to the one derived by logistic regression. Any scaling of the parameter vector will define the same boundary, but the probabilities calculated by logistic regression depend on the exact scaling.
The output from a step function can of course not be interpreted as any kind of probability.
Since a step function is not differentiable, it is not possible to train a perceptron using the same algorithms that are used for logistic regression.
In some cases, the term perceptron is also used to refer to neural networks which use a logistic function as a transfer function (however, this is not in accordance with the original terminology). In that case, a logistic regression and a "perceptron" are exactly the same. Of course, with a perceptron it is possible to use multiple neurons all using a logistic transfer function, which becomes somewhat relatable to stacking of logistic regression (not the same, but similar).
|
What's the difference between logistic regression and perceptron?
There is some confusion that may arise here. Originally a perceptron was only referring to neural networks with a step function as the transfer function. In that case of course the difference is that
|
6,661
|
What's the difference between logistic regression and perceptron?
|
You can use logistic regression to build a perceptron. The logistic regression uses logistic function to build the output from a given inputs. Logistic function produces a smooth output between 0 and 1, so you need one more thing to make it a classifier, which is a threshold. Perceptrons can be built with other functional forms, of course, not just logistic.
The logistic regression produces you the model that looks like this:
$$y(x_1,x_2|b)=\frac{e^{b_0+b_1x_1+b_2x_2}}{1+e^{b_0+b_1x_1+b_2x_2}}$$
The regression part is how to estimate the coefficients $b_1,b_2,b_3$, the logistic part is the function form $\frac{e^x}{1+e^x}$
Once you calculate $y(x|b)$ given inputs $x$ and parameters $b$, you need to decide whether this is 0 or 1 because the output $y$ is any number between 0 and 1. So, you need a threshold $Y$, such that you $\tilde y=0$ for $y(x|b)<Y$, and $\tilde y=1$ for $y(x|b)\ge Y$.
|
What's the difference between logistic regression and perceptron?
|
You can use logistic regression to build a perceptron. The logistic regression uses logistic function to build the output from a given inputs. Logistic function produces a smooth output between 0 and
|
What's the difference between logistic regression and perceptron?
You can use logistic regression to build a perceptron. The logistic regression uses logistic function to build the output from a given inputs. Logistic function produces a smooth output between 0 and 1, so you need one more thing to make it a classifier, which is a threshold. Perceptrons can be built with other functional forms, of course, not just logistic.
The logistic regression produces you the model that looks like this:
$$y(x_1,x_2|b)=\frac{e^{b_0+b_1x_1+b_2x_2}}{1+e^{b_0+b_1x_1+b_2x_2}}$$
The regression part is how to estimate the coefficients $b_1,b_2,b_3$, the logistic part is the function form $\frac{e^x}{1+e^x}$
Once you calculate $y(x|b)$ given inputs $x$ and parameters $b$, you need to decide whether this is 0 or 1 because the output $y$ is any number between 0 and 1. So, you need a threshold $Y$, such that you $\tilde y=0$ for $y(x|b)<Y$, and $\tilde y=1$ for $y(x|b)\ge Y$.
|
What's the difference between logistic regression and perceptron?
You can use logistic regression to build a perceptron. The logistic regression uses logistic function to build the output from a given inputs. Logistic function produces a smooth output between 0 and
|
6,662
|
What's the difference between logistic regression and perceptron?
|
Suppose that our training observations are the feature vectors $x_1,\ldots, x_N \in \mathbb R^n$, and the corresponding labels are $y_1,\ldots,y_N \in \{-1, 1 \}$. For notational simplicity, let's append a $1$ to the end of each vector $x_i$.
The perceptron algorithm can be interpreted as using stochastic subgradient descent to solve the optimization problem
\begin{align}
\tag{1}\text{minimize} & \quad \frac{1}{N}\sum_{i=1}^N \max(-y_i\beta^T x_i,0).
\end{align}
The optimization variable is $\beta \in \mathbb R^{n+1}$. From this perspective, the difference between the perceptron algorithm and logistic regression is that the perceptron algorithm minimizes a different objective function. (The derivation of logistic regression via maximum likelihood estimation is well known; in this post I'm focusing on the interpretation of the perceptron algorithm.)
The objective function in problem (1) can be written as $\frac{1}{N}\sum_i \ell_i(\beta)$, where
$$
\ell_i(\beta) = \max(-y_i \beta^T x_i,0).
$$
A subgradient of $\ell_i$ at $\beta$ is the vector
$$
g = \begin{cases}
0 & \quad \text{if } -y_i \beta^T x_i \leq 0 \qquad \text{(so $y_i$ and $\beta^T x_i$ have the same sign)}\\
- y_i x_i & \quad \text{otherwise.}
\end{cases}
$$
Each epoch of stochastic subgradient descent (with step size $t > 0)$) sweeps through the training observations and, for the $i$th observation, performs the update
$$
\beta \leftarrow \beta - t g = \begin{cases} \beta & \quad \text{if $y_i$ and $\beta^T x_i$ have the same sign} \\
\beta + t y_i x_i & \quad \text{otherwise.}
\end{cases}
$$
We recognize that this is the iteration for the perceptron algorithm (with learning rate $t$).
|
What's the difference between logistic regression and perceptron?
|
Suppose that our training observations are the feature vectors $x_1,\ldots, x_N \in \mathbb R^n$, and the corresponding labels are $y_1,\ldots,y_N \in \{-1, 1 \}$. For notational simplicity, let's app
|
What's the difference between logistic regression and perceptron?
Suppose that our training observations are the feature vectors $x_1,\ldots, x_N \in \mathbb R^n$, and the corresponding labels are $y_1,\ldots,y_N \in \{-1, 1 \}$. For notational simplicity, let's append a $1$ to the end of each vector $x_i$.
The perceptron algorithm can be interpreted as using stochastic subgradient descent to solve the optimization problem
\begin{align}
\tag{1}\text{minimize} & \quad \frac{1}{N}\sum_{i=1}^N \max(-y_i\beta^T x_i,0).
\end{align}
The optimization variable is $\beta \in \mathbb R^{n+1}$. From this perspective, the difference between the perceptron algorithm and logistic regression is that the perceptron algorithm minimizes a different objective function. (The derivation of logistic regression via maximum likelihood estimation is well known; in this post I'm focusing on the interpretation of the perceptron algorithm.)
The objective function in problem (1) can be written as $\frac{1}{N}\sum_i \ell_i(\beta)$, where
$$
\ell_i(\beta) = \max(-y_i \beta^T x_i,0).
$$
A subgradient of $\ell_i$ at $\beta$ is the vector
$$
g = \begin{cases}
0 & \quad \text{if } -y_i \beta^T x_i \leq 0 \qquad \text{(so $y_i$ and $\beta^T x_i$ have the same sign)}\\
- y_i x_i & \quad \text{otherwise.}
\end{cases}
$$
Each epoch of stochastic subgradient descent (with step size $t > 0)$) sweeps through the training observations and, for the $i$th observation, performs the update
$$
\beta \leftarrow \beta - t g = \begin{cases} \beta & \quad \text{if $y_i$ and $\beta^T x_i$ have the same sign} \\
\beta + t y_i x_i & \quad \text{otherwise.}
\end{cases}
$$
We recognize that this is the iteration for the perceptron algorithm (with learning rate $t$).
|
What's the difference between logistic regression and perceptron?
Suppose that our training observations are the feature vectors $x_1,\ldots, x_N \in \mathbb R^n$, and the corresponding labels are $y_1,\ldots,y_N \in \{-1, 1 \}$. For notational simplicity, let's app
|
6,663
|
What's the difference between logistic regression and perceptron?
|
They're both applying regression by estimating the parameters of the same logistic-transformed model. According to the properties of convex functions, the values of the parameters will be the same any way you choose to estimate them. To quote myself from a previous answer:
Logistic regression models a function of the mean of a Bernoulli distribution as a linear equation (the mean being equal to the probability p of a Bernoulli event). By using the logit link as a function of the mean (p), the logarithm of the odds (log-odds) can be derived analytically and used as the response of a so-called generalised linear model. On top of prediction, this allows you to interpret the model in causal inference. This is something that you cannot achieve with a linear Perceptron.
The Perceptron, takes the inverse logit (logistic) function of wx, and doesn't use probabilistic assumptions for neither the model nor its parameter. Online training will give you exactly the same estimates for the model weights/parameters, but you won't be able to interpret them in causal inference due to the lack of p-values, confidence intervals, and well, an underlying probability model.
|
What's the difference between logistic regression and perceptron?
|
They're both applying regression by estimating the parameters of the same logistic-transformed model. According to the properties of convex functions, the values of the parameters will be the same any
|
What's the difference between logistic regression and perceptron?
They're both applying regression by estimating the parameters of the same logistic-transformed model. According to the properties of convex functions, the values of the parameters will be the same any way you choose to estimate them. To quote myself from a previous answer:
Logistic regression models a function of the mean of a Bernoulli distribution as a linear equation (the mean being equal to the probability p of a Bernoulli event). By using the logit link as a function of the mean (p), the logarithm of the odds (log-odds) can be derived analytically and used as the response of a so-called generalised linear model. On top of prediction, this allows you to interpret the model in causal inference. This is something that you cannot achieve with a linear Perceptron.
The Perceptron, takes the inverse logit (logistic) function of wx, and doesn't use probabilistic assumptions for neither the model nor its parameter. Online training will give you exactly the same estimates for the model weights/parameters, but you won't be able to interpret them in causal inference due to the lack of p-values, confidence intervals, and well, an underlying probability model.
|
What's the difference between logistic regression and perceptron?
They're both applying regression by estimating the parameters of the same logistic-transformed model. According to the properties of convex functions, the values of the parameters will be the same any
|
6,664
|
What's the difference between logistic regression and perceptron?
|
Andrew Ng used the term "logistic regression" as a model for solving the binary classification problem.
As you may saw in the paper he actually never draw the model itself.
Let me add few details to the bucket so you may find the reasoning on how I think he constructed the lectures.
The model used for the "logistic regression" is a single level perception with with custom number of inputs and one output ranging from 0 to 1.
Back in 90's the most appreciated activation function was the sigmoidal activation function, and there is a great mathematical theory as a backup.
This is exactly the model Andrew Ng is using since that function ranges from 0 to 1.
Also the derivative s'(x) = s(x)(1−s(x)), where s(x) is sigmoidal activation function.
For the error function he uses L2, although in some papers he may use some other function for that.
So to recap, when considering "logistic regression" just consider the single level perception with sigmoidal activation function, custom number of inputs and single output.
Just a few notes: There is nothing wrong with the sigmoidal activation function, although for the floating point arithmetic, ReLU dominates hidden layers nowadays, but in the near future posits (or some other arithmetical units) may put sigmoidal activation function back to the table.
Personalty, I would use simpler model with the ReLU function to explain the SLP (single level perceptron) since it is more used today.
|
What's the difference between logistic regression and perceptron?
|
Andrew Ng used the term "logistic regression" as a model for solving the binary classification problem.
As you may saw in the paper he actually never draw the model itself.
Let me add few details to
|
What's the difference between logistic regression and perceptron?
Andrew Ng used the term "logistic regression" as a model for solving the binary classification problem.
As you may saw in the paper he actually never draw the model itself.
Let me add few details to the bucket so you may find the reasoning on how I think he constructed the lectures.
The model used for the "logistic regression" is a single level perception with with custom number of inputs and one output ranging from 0 to 1.
Back in 90's the most appreciated activation function was the sigmoidal activation function, and there is a great mathematical theory as a backup.
This is exactly the model Andrew Ng is using since that function ranges from 0 to 1.
Also the derivative s'(x) = s(x)(1−s(x)), where s(x) is sigmoidal activation function.
For the error function he uses L2, although in some papers he may use some other function for that.
So to recap, when considering "logistic regression" just consider the single level perception with sigmoidal activation function, custom number of inputs and single output.
Just a few notes: There is nothing wrong with the sigmoidal activation function, although for the floating point arithmetic, ReLU dominates hidden layers nowadays, but in the near future posits (or some other arithmetical units) may put sigmoidal activation function back to the table.
Personalty, I would use simpler model with the ReLU function to explain the SLP (single level perceptron) since it is more used today.
|
What's the difference between logistic regression and perceptron?
Andrew Ng used the term "logistic regression" as a model for solving the binary classification problem.
As you may saw in the paper he actually never draw the model itself.
Let me add few details to
|
6,665
|
MSE decomposition to Variance and Bias Squared
|
The trick is that $\mathbb{E}(\hat{\theta}) - \theta$ is a constant.
|
MSE decomposition to Variance and Bias Squared
|
The trick is that $\mathbb{E}(\hat{\theta}) - \theta$ is a constant.
|
MSE decomposition to Variance and Bias Squared
The trick is that $\mathbb{E}(\hat{\theta}) - \theta$ is a constant.
|
MSE decomposition to Variance and Bias Squared
The trick is that $\mathbb{E}(\hat{\theta}) - \theta$ is a constant.
|
6,666
|
MSE decomposition to Variance and Bias Squared
|
There has been some confusion about the question which was ambiguous being about the highlight and the step from line three to line four.
There are two terms that look a lot like each other.
$$\mathbb{E}\left[\hat{\theta}\right] - \theta \quad \text{vs} \quad \mathbb{E}\left[\hat{\theta}\right] - \hat\theta$$
The question, about the step from 3rd to 4th line, relates to the first term:
$\mathbb{E}[\hat{\theta}] - \theta$ this is the bias for the estimator $\hat\theta$
The bias is the same (constant) value every time you take a sample, and because of that you can take it out of the expectation operator (so that is how the step from the 3rd to 4th line, taking the constant out, is done).
Note that you should not interpret this as a Bayesian analysis where $\theta$ is variable. It is a frequentist analysis which conditions on the parameters $\theta$. So we are computing more specifically $\mathbb{E}[(\hat{\theta} - \theta)^2 \vert \theta]$, the expectation value of the squared error conditional on $\theta$, instead of $\mathbb{E}[(\hat{\theta} - \theta)^2]$. This conditioning is often implied implicitly in a frequentist analysis.
The question about the highlighted expression is about the second term
$\mathbb{E}[\hat{\theta}] - \hat{\theta}$ this is the deviation from the mean for the estimator $\hat{\theta}$.
It's expectation value is also called the 1st central moment which is always zero (so that is how the highlighted step, putting the expectation equal to zero, is done).
|
MSE decomposition to Variance and Bias Squared
|
There has been some confusion about the question which was ambiguous being about the highlight and the step from line three to line four.
There are two terms that look a lot like each other.
$$\mathb
|
MSE decomposition to Variance and Bias Squared
There has been some confusion about the question which was ambiguous being about the highlight and the step from line three to line four.
There are two terms that look a lot like each other.
$$\mathbb{E}\left[\hat{\theta}\right] - \theta \quad \text{vs} \quad \mathbb{E}\left[\hat{\theta}\right] - \hat\theta$$
The question, about the step from 3rd to 4th line, relates to the first term:
$\mathbb{E}[\hat{\theta}] - \theta$ this is the bias for the estimator $\hat\theta$
The bias is the same (constant) value every time you take a sample, and because of that you can take it out of the expectation operator (so that is how the step from the 3rd to 4th line, taking the constant out, is done).
Note that you should not interpret this as a Bayesian analysis where $\theta$ is variable. It is a frequentist analysis which conditions on the parameters $\theta$. So we are computing more specifically $\mathbb{E}[(\hat{\theta} - \theta)^2 \vert \theta]$, the expectation value of the squared error conditional on $\theta$, instead of $\mathbb{E}[(\hat{\theta} - \theta)^2]$. This conditioning is often implied implicitly in a frequentist analysis.
The question about the highlighted expression is about the second term
$\mathbb{E}[\hat{\theta}] - \hat{\theta}$ this is the deviation from the mean for the estimator $\hat{\theta}$.
It's expectation value is also called the 1st central moment which is always zero (so that is how the highlighted step, putting the expectation equal to zero, is done).
|
MSE decomposition to Variance and Bias Squared
There has been some confusion about the question which was ambiguous being about the highlight and the step from line three to line four.
There are two terms that look a lot like each other.
$$\mathb
|
6,667
|
MSE decomposition to Variance and Bias Squared
|
$E(\hat{\theta}) - \theta$ is not a constant.
The comment of @user1158559 is actually the correct one:
$$
E[\hat{\theta} - E(\hat{\theta})] = E(\hat{\theta}) - E[E(\hat{\theta})]
= E(\hat{\theta}) - E(\hat{\theta}) = 0
$$
|
MSE decomposition to Variance and Bias Squared
|
$E(\hat{\theta}) - \theta$ is not a constant.
The comment of @user1158559 is actually the correct one:
$$
E[\hat{\theta} - E(\hat{\theta})] = E(\hat{\theta}) - E[E(\hat{\theta})]
= E(\hat{\theta}) -
|
MSE decomposition to Variance and Bias Squared
$E(\hat{\theta}) - \theta$ is not a constant.
The comment of @user1158559 is actually the correct one:
$$
E[\hat{\theta} - E(\hat{\theta})] = E(\hat{\theta}) - E[E(\hat{\theta})]
= E(\hat{\theta}) - E(\hat{\theta}) = 0
$$
|
MSE decomposition to Variance and Bias Squared
$E(\hat{\theta}) - \theta$ is not a constant.
The comment of @user1158559 is actually the correct one:
$$
E[\hat{\theta} - E(\hat{\theta})] = E(\hat{\theta}) - E[E(\hat{\theta})]
= E(\hat{\theta}) -
|
6,668
|
How does one measure the non-uniformity of a distribution?
|
If you have not only the frequencies but the actual counts, you can use a $\chi^2$ goodness-of-fit test for each data series. In particular, you wish to use the test for a discrete uniform distribution. This gives you a good test, which allows you to find out which data series are likely not to have been generated by a uniform distribution, but does not provide a measure of uniformity.
There are other possible approaches, such as computing the entropy of each series - the uniform distribution maximizes the entropy, so if the entropy is suspiciously low you would conclude that you probably don't have a uniform distribution. That works as a measure of uniformity in some sense.
Another suggestion would be to use a measure like the Kullback-Leibler divergence, which measures the similarity of two distributions.
|
How does one measure the non-uniformity of a distribution?
|
If you have not only the frequencies but the actual counts, you can use a $\chi^2$ goodness-of-fit test for each data series. In particular, you wish to use the test for a discrete uniform distributio
|
How does one measure the non-uniformity of a distribution?
If you have not only the frequencies but the actual counts, you can use a $\chi^2$ goodness-of-fit test for each data series. In particular, you wish to use the test for a discrete uniform distribution. This gives you a good test, which allows you to find out which data series are likely not to have been generated by a uniform distribution, but does not provide a measure of uniformity.
There are other possible approaches, such as computing the entropy of each series - the uniform distribution maximizes the entropy, so if the entropy is suspiciously low you would conclude that you probably don't have a uniform distribution. That works as a measure of uniformity in some sense.
Another suggestion would be to use a measure like the Kullback-Leibler divergence, which measures the similarity of two distributions.
|
How does one measure the non-uniformity of a distribution?
If you have not only the frequencies but the actual counts, you can use a $\chi^2$ goodness-of-fit test for each data series. In particular, you wish to use the test for a discrete uniform distributio
|
6,669
|
How does one measure the non-uniformity of a distribution?
|
In addition to @MansT 's good ideas, you could come up with other measures, but it depends on what you mean by "non-uniformity". To keep it simple, let's look at 4 levels. Perfect uniformity is easy to define:
25 25 25 25
but which of the following is more non-uniform?
20 20 30 30
or
20 20 25 35
or are they equally non-uniform?
if you think they are equally non-uniform, you could use a measure based on the sum of the absolute values of the deviations from normal, scaled by the maximum possible. Then the first is 5 + 5 + 5 + 5 = 20 and the second is 5 + 5 + 0 + 10 = 20. But if you think the second is more nonuniform, you could use something based on the squared deviations in which case the first gets 25 + 25 + 25 + 25 = 100 and the second gets 25 + 25 + 0 + 100 = 150.
|
How does one measure the non-uniformity of a distribution?
|
In addition to @MansT 's good ideas, you could come up with other measures, but it depends on what you mean by "non-uniformity". To keep it simple, let's look at 4 levels. Perfect uniformity is easy t
|
How does one measure the non-uniformity of a distribution?
In addition to @MansT 's good ideas, you could come up with other measures, but it depends on what you mean by "non-uniformity". To keep it simple, let's look at 4 levels. Perfect uniformity is easy to define:
25 25 25 25
but which of the following is more non-uniform?
20 20 30 30
or
20 20 25 35
or are they equally non-uniform?
if you think they are equally non-uniform, you could use a measure based on the sum of the absolute values of the deviations from normal, scaled by the maximum possible. Then the first is 5 + 5 + 5 + 5 = 20 and the second is 5 + 5 + 0 + 10 = 20. But if you think the second is more nonuniform, you could use something based on the squared deviations in which case the first gets 25 + 25 + 25 + 25 = 100 and the second gets 25 + 25 + 0 + 100 = 150.
|
How does one measure the non-uniformity of a distribution?
In addition to @MansT 's good ideas, you could come up with other measures, but it depends on what you mean by "non-uniformity". To keep it simple, let's look at 4 levels. Perfect uniformity is easy t
|
6,670
|
How does one measure the non-uniformity of a distribution?
|
Here is a simple heuristic: if you assume elements in any vector sum to $1$ (or simply normalize each element with the sum to achieve this), then uniformity can be represented by L2 norm, which ranges from $\frac{1}{\sqrt d}$ to $1$, with $d$ being the dimension of vectors.
The lower bound $\frac{1}{\sqrt d}$ corresponds to uniformity and upper bound to the $1$-hot vector.
To scale this to a score between $0$ and $1$, you can use $\frac{n*\sqrt d - 1}{\sqrt d - 1}$, where $n$ is the L2 norm.
An example modified from yours with elements summing to $1$ and all vectors with the same dimension for simplicity:
0.10 0.11 0.10 0.09 0.09 0.11 0.10 0.10 0.12 0.08
0.10 0.10 0.10 0.08 0.12 0.12 0.09 0.09 0.12 0.08
0.03 0.02 0.61 0.02 0.03 0.07 0.06 0.05 0.06 0.05
The following will yield $0.0028$, $0.0051$, and $0.4529$ for the rows:
d=size(m,2);
for i=1:size(m);
disp( (norm(m(i,:))*sqrt(d)-1) / (sqrt(d)-1) );
end
|
How does one measure the non-uniformity of a distribution?
|
Here is a simple heuristic: if you assume elements in any vector sum to $1$ (or simply normalize each element with the sum to achieve this), then uniformity can be represented by L2 norm, which ranges
|
How does one measure the non-uniformity of a distribution?
Here is a simple heuristic: if you assume elements in any vector sum to $1$ (or simply normalize each element with the sum to achieve this), then uniformity can be represented by L2 norm, which ranges from $\frac{1}{\sqrt d}$ to $1$, with $d$ being the dimension of vectors.
The lower bound $\frac{1}{\sqrt d}$ corresponds to uniformity and upper bound to the $1$-hot vector.
To scale this to a score between $0$ and $1$, you can use $\frac{n*\sqrt d - 1}{\sqrt d - 1}$, where $n$ is the L2 norm.
An example modified from yours with elements summing to $1$ and all vectors with the same dimension for simplicity:
0.10 0.11 0.10 0.09 0.09 0.11 0.10 0.10 0.12 0.08
0.10 0.10 0.10 0.08 0.12 0.12 0.09 0.09 0.12 0.08
0.03 0.02 0.61 0.02 0.03 0.07 0.06 0.05 0.06 0.05
The following will yield $0.0028$, $0.0051$, and $0.4529$ for the rows:
d=size(m,2);
for i=1:size(m);
disp( (norm(m(i,:))*sqrt(d)-1) / (sqrt(d)-1) );
end
|
How does one measure the non-uniformity of a distribution?
Here is a simple heuristic: if you assume elements in any vector sum to $1$ (or simply normalize each element with the sum to achieve this), then uniformity can be represented by L2 norm, which ranges
|
6,671
|
How does one measure the non-uniformity of a distribution?
|
Stumbled upon this recently, and to add to the answer from @user495285, as far as I understand it:
When the values are normalized and sum to one, then the uniform distribution is the unit sphere in $\mathbb{R}^n$, and what is being calculated by using an $L_p$ norm is the deviation from the unit sphere using a distance measure of a given $p$, i.e. deviation from the uniform distribution in $\mathbb{R}^n$ with geometric distance measure $p$.
The $L_2$ norm places higher weight on large deviations from the unit sphere in any given dimension, whereas smaller values of $p$ place less weight on large deviations.
When the underlying distribution is the unit sphere, the numerator equals zero in the following equation:
$$\frac{n\sqrt{d} - 1}{\sqrt{d} - 1}$$
where $n$ is the $L_2$ norm and $d$ is the vector length.
I believe that the usefulness of geometric measures applies when each position (dimension) of the space described is assumed to be measured on equivalent scales, e.g. all counts of potentially equal distribution. The same assumptions underlying change of bases like PCA/SVD probably are similar here. But then again I'm no mathematician, so I'll leave that open to the more informed.
|
How does one measure the non-uniformity of a distribution?
|
Stumbled upon this recently, and to add to the answer from @user495285, as far as I understand it:
When the values are normalized and sum to one, then the uniform distribution is the unit sphere in $\
|
How does one measure the non-uniformity of a distribution?
Stumbled upon this recently, and to add to the answer from @user495285, as far as I understand it:
When the values are normalized and sum to one, then the uniform distribution is the unit sphere in $\mathbb{R}^n$, and what is being calculated by using an $L_p$ norm is the deviation from the unit sphere using a distance measure of a given $p$, i.e. deviation from the uniform distribution in $\mathbb{R}^n$ with geometric distance measure $p$.
The $L_2$ norm places higher weight on large deviations from the unit sphere in any given dimension, whereas smaller values of $p$ place less weight on large deviations.
When the underlying distribution is the unit sphere, the numerator equals zero in the following equation:
$$\frac{n\sqrt{d} - 1}{\sqrt{d} - 1}$$
where $n$ is the $L_2$ norm and $d$ is the vector length.
I believe that the usefulness of geometric measures applies when each position (dimension) of the space described is assumed to be measured on equivalent scales, e.g. all counts of potentially equal distribution. The same assumptions underlying change of bases like PCA/SVD probably are similar here. But then again I'm no mathematician, so I'll leave that open to the more informed.
|
How does one measure the non-uniformity of a distribution?
Stumbled upon this recently, and to add to the answer from @user495285, as far as I understand it:
When the values are normalized and sum to one, then the uniform distribution is the unit sphere in $\
|
6,672
|
Interpreting residual diagnostic plots for glm models?
|
I think this is one of the most challenging parts when doing regression analysis. I also struggle with most of the interpretations (in particular binomial diagnostics are crazy!).
I just stumbled on this post
http://www.r-bloggers.com/model-validation-interpreting-residual-plots/
who also linked
https://web.archive.org/web/20100202230711/http://statmaster.sdu.dk/courses/st111/module04/module.pdf
what helps me the most is to plot the residuals versus every predictive parameter included AND not included into the model. This means also the ones who were dropped beforehand for to multicolinearity reasons. For this boxplots, conditional scatterplots and normal scatterplots are great. this helps to spot possible errors
In "Forest Analytics with R" (UseR Series) are some good explanations how to interpret residuals for mixed effects models (and glms as well). Good read! https://www.springer.com/gp/book/9781441977618
Someday ago I thought about a website that could collect residual patterns which users can vote to be "ok" and to be "not ok". but I never found that website ;)
|
Interpreting residual diagnostic plots for glm models?
|
I think this is one of the most challenging parts when doing regression analysis. I also struggle with most of the interpretations (in particular binomial diagnostics are crazy!).
I just stumbled on t
|
Interpreting residual diagnostic plots for glm models?
I think this is one of the most challenging parts when doing regression analysis. I also struggle with most of the interpretations (in particular binomial diagnostics are crazy!).
I just stumbled on this post
http://www.r-bloggers.com/model-validation-interpreting-residual-plots/
who also linked
https://web.archive.org/web/20100202230711/http://statmaster.sdu.dk/courses/st111/module04/module.pdf
what helps me the most is to plot the residuals versus every predictive parameter included AND not included into the model. This means also the ones who were dropped beforehand for to multicolinearity reasons. For this boxplots, conditional scatterplots and normal scatterplots are great. this helps to spot possible errors
In "Forest Analytics with R" (UseR Series) are some good explanations how to interpret residuals for mixed effects models (and glms as well). Good read! https://www.springer.com/gp/book/9781441977618
Someday ago I thought about a website that could collect residual patterns which users can vote to be "ok" and to be "not ok". but I never found that website ;)
|
Interpreting residual diagnostic plots for glm models?
I think this is one of the most challenging parts when doing regression analysis. I also struggle with most of the interpretations (in particular binomial diagnostics are crazy!).
I just stumbled on t
|
6,673
|
Interpreting residual diagnostic plots for glm models?
|
I would suggest the methods described in:
Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne,
D.F and Wickham, H. (2009) Statistical Inference for exploratory
data analysis and model diagnostics Phil. Trans. R. Soc. A 2009
367, 4361-4383 doi: 10.1098/rsta.2009.0120
There are a few different ideas, but they mostly come down to simulating data where you know what the true relationship is and that relationship is based on your analysis of the real data. Then you compare the diagnostics from your real data to the diagnostics of the simulated data sets. The vis.test function in the TeachingDemos package for R implements a variation of 1 of the suggestions in the paper. Read the whole paper (not just my very short summarization) for a better understanding.
|
Interpreting residual diagnostic plots for glm models?
|
I would suggest the methods described in:
Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne,
D.F and Wickham, H. (2009) Statistical Inference for exploratory
data analysis and model
|
Interpreting residual diagnostic plots for glm models?
I would suggest the methods described in:
Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne,
D.F and Wickham, H. (2009) Statistical Inference for exploratory
data analysis and model diagnostics Phil. Trans. R. Soc. A 2009
367, 4361-4383 doi: 10.1098/rsta.2009.0120
There are a few different ideas, but they mostly come down to simulating data where you know what the true relationship is and that relationship is based on your analysis of the real data. Then you compare the diagnostics from your real data to the diagnostics of the simulated data sets. The vis.test function in the TeachingDemos package for R implements a variation of 1 of the suggestions in the paper. Read the whole paper (not just my very short summarization) for a better understanding.
|
Interpreting residual diagnostic plots for glm models?
I would suggest the methods described in:
Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne,
D.F and Wickham, H. (2009) Statistical Inference for exploratory
data analysis and model
|
6,674
|
Interpreting residual diagnostic plots for glm models?
|
This question is quite old, but I thought it would be useful to add that, since recently, you can use the DHARMa R package to transform the residuals of any GL(M)M into a standardized space. Once this is done, you can visually assess / test residual problems such as deviations from the distribution, residual dependency on a predictor, heteroskedasticity or autocorrelation in the normal way. See the package vignette for worked-through examples, also other questions on CV here and here.
|
Interpreting residual diagnostic plots for glm models?
|
This question is quite old, but I thought it would be useful to add that, since recently, you can use the DHARMa R package to transform the residuals of any GL(M)M into a standardized space. Once this
|
Interpreting residual diagnostic plots for glm models?
This question is quite old, but I thought it would be useful to add that, since recently, you can use the DHARMa R package to transform the residuals of any GL(M)M into a standardized space. Once this is done, you can visually assess / test residual problems such as deviations from the distribution, residual dependency on a predictor, heteroskedasticity or autocorrelation in the normal way. See the package vignette for worked-through examples, also other questions on CV here and here.
|
Interpreting residual diagnostic plots for glm models?
This question is quite old, but I thought it would be useful to add that, since recently, you can use the DHARMa R package to transform the residuals of any GL(M)M into a standardized space. Once this
|
6,675
|
Cross-validating time-series analysis
|
The "classical" k-times cross-validation technique is based on the fact that each sample in the available data set is used (k-1)-times to train a model and 1 time to test it. Since it is very important to validate time series models on "future" data, this approach will not contribute to the stability of the model.
One important property of many (most?) time series is the correlation between the adjacent values. As pointed out by IrishStat, if you use previous readings as the independent variables of your model candidate, this correlation (or lack of independence) plays a significant role and is another reason why k-times cross validation isn't a good idea.
One way to overcome over this problem is to "oversample" the data and decorrelate it. If the decorrelation process is successful, then using cross validation on time series becomes less problematic. It will not, however, solve the issue of validating the model using future data
Clarifications
by validating model on future data I mean constructing the model, waiting for new data that wasn't available during model construction, testing, fine-tuning etc and validating it on that new data.
by oversampling the data I mean collecting time series data at frequency much higher than practically needed. For example: sampling stock prices every 5 seconds, when you are really interested in hourly alterations. Here, when I say "sampling" I don't mean "interpolating", "estimating" etc. If the data cannot be measured at higher frequency, this technique is meaningless
|
Cross-validating time-series analysis
|
The "classical" k-times cross-validation technique is based on the fact that each sample in the available data set is used (k-1)-times to train a model and 1 time to test it. Since it is very importan
|
Cross-validating time-series analysis
The "classical" k-times cross-validation technique is based on the fact that each sample in the available data set is used (k-1)-times to train a model and 1 time to test it. Since it is very important to validate time series models on "future" data, this approach will not contribute to the stability of the model.
One important property of many (most?) time series is the correlation between the adjacent values. As pointed out by IrishStat, if you use previous readings as the independent variables of your model candidate, this correlation (or lack of independence) plays a significant role and is another reason why k-times cross validation isn't a good idea.
One way to overcome over this problem is to "oversample" the data and decorrelate it. If the decorrelation process is successful, then using cross validation on time series becomes less problematic. It will not, however, solve the issue of validating the model using future data
Clarifications
by validating model on future data I mean constructing the model, waiting for new data that wasn't available during model construction, testing, fine-tuning etc and validating it on that new data.
by oversampling the data I mean collecting time series data at frequency much higher than practically needed. For example: sampling stock prices every 5 seconds, when you are really interested in hourly alterations. Here, when I say "sampling" I don't mean "interpolating", "estimating" etc. If the data cannot be measured at higher frequency, this technique is meaningless
|
Cross-validating time-series analysis
The "classical" k-times cross-validation technique is based on the fact that each sample in the available data set is used (k-1)-times to train a model and 1 time to test it. Since it is very importan
|
6,676
|
Cross-validating time-series analysis
|
http://robjhyndman.com/researchtips/crossvalidation/ contains a quick tip for cross validation of time series. Regarding using random forest for time series data....not sure although it seems like an odd choice given that the model is fitted using bootstrap samples. There are classic time series methods of course (e.g. ARIMA) that can be used, as can ML techniques like Neural Nets (example example pdf). Perhaps some of the time series experts can comment on how well ML techniques work compared to time series specific algorithms.
|
Cross-validating time-series analysis
|
http://robjhyndman.com/researchtips/crossvalidation/ contains a quick tip for cross validation of time series. Regarding using random forest for time series data....not sure although it seems like an
|
Cross-validating time-series analysis
http://robjhyndman.com/researchtips/crossvalidation/ contains a quick tip for cross validation of time series. Regarding using random forest for time series data....not sure although it seems like an odd choice given that the model is fitted using bootstrap samples. There are classic time series methods of course (e.g. ARIMA) that can be used, as can ML techniques like Neural Nets (example example pdf). Perhaps some of the time series experts can comment on how well ML techniques work compared to time series specific algorithms.
|
Cross-validating time-series analysis
http://robjhyndman.com/researchtips/crossvalidation/ contains a quick tip for cross validation of time series. Regarding using random forest for time series data....not sure although it seems like an
|
6,677
|
Cross-validating time-series analysis
|
Here is some example code for cross-validating time series models. I expanded on this code in my blog, incorporating the foreach package to speed things up and allowing for a possible xreg term in the cross-validation.
Here's a copy of the code from Rob Hyndman's blog:
library(fpp) # To load the data set a10
plot(a10, ylab="$ million", xlab="Year", main="Antidiabetic drug sales")
plot(log(a10), ylab="", xlab="Year", main="Log Antidiabetic drug sales")
k <- 60 # minimum data length for fitting a model
n <- length(a10)
mae1 <- mae2 <- mae3 <- matrix(NA,n-k,12)
st <- tsp(a10)[1]+(k-2)/12
for(i in 1:(n-k))
{
xshort <- window(a10, end=st + i/12)
xnext <- window(a10, start=st + (i+1)/12, end=st + (i+12)/12)
fit1 <- tslm(xshort ~ trend + season, lambda=0)
fcast1 <- forecast(fit1, h=12)
fit2 <- Arima(xshort, order=c(3,0,1), seasonal=list(order=c(0,1,1), period=12),
include.drift=TRUE, lambda=0, method="ML")
fcast2 <- forecast(fit2, h=12)
fit3 <- ets(xshort,model="MMM",damped=TRUE)
fcast3 <- forecast(fit3, h=12)
mae1[i,1:length(xnext)] <- abs(fcast1[['mean']]-xnext)
mae2[i,1:length(xnext)] <- abs(fcast2[['mean']]-xnext)
mae3[i,1:length(xnext)] <- abs(fcast3[['mean']]-xnext)
}
plot(1:12, colMeans(mae1,na.rm=TRUE), type="l", col=2, xlab="horizon", ylab="MAE",
ylim=c(0.65,1.05))
lines(1:12, colMeans(mae2,na.rm=TRUE), type="l",col=3)
lines(1:12, colMeans(mae3,na.rm=TRUE), type="l",col=4)
legend("topleft",legend=c("LM","ARIMA","ETS"),col=2:4,lty=1)
|
Cross-validating time-series analysis
|
Here is some example code for cross-validating time series models. I expanded on this code in my blog, incorporating the foreach package to speed things up and allowing for a possible xreg term in th
|
Cross-validating time-series analysis
Here is some example code for cross-validating time series models. I expanded on this code in my blog, incorporating the foreach package to speed things up and allowing for a possible xreg term in the cross-validation.
Here's a copy of the code from Rob Hyndman's blog:
library(fpp) # To load the data set a10
plot(a10, ylab="$ million", xlab="Year", main="Antidiabetic drug sales")
plot(log(a10), ylab="", xlab="Year", main="Log Antidiabetic drug sales")
k <- 60 # minimum data length for fitting a model
n <- length(a10)
mae1 <- mae2 <- mae3 <- matrix(NA,n-k,12)
st <- tsp(a10)[1]+(k-2)/12
for(i in 1:(n-k))
{
xshort <- window(a10, end=st + i/12)
xnext <- window(a10, start=st + (i+1)/12, end=st + (i+12)/12)
fit1 <- tslm(xshort ~ trend + season, lambda=0)
fcast1 <- forecast(fit1, h=12)
fit2 <- Arima(xshort, order=c(3,0,1), seasonal=list(order=c(0,1,1), period=12),
include.drift=TRUE, lambda=0, method="ML")
fcast2 <- forecast(fit2, h=12)
fit3 <- ets(xshort,model="MMM",damped=TRUE)
fcast3 <- forecast(fit3, h=12)
mae1[i,1:length(xnext)] <- abs(fcast1[['mean']]-xnext)
mae2[i,1:length(xnext)] <- abs(fcast2[['mean']]-xnext)
mae3[i,1:length(xnext)] <- abs(fcast3[['mean']]-xnext)
}
plot(1:12, colMeans(mae1,na.rm=TRUE), type="l", col=2, xlab="horizon", ylab="MAE",
ylim=c(0.65,1.05))
lines(1:12, colMeans(mae2,na.rm=TRUE), type="l",col=3)
lines(1:12, colMeans(mae3,na.rm=TRUE), type="l",col=4)
legend("topleft",legend=c("LM","ARIMA","ETS"),col=2:4,lty=1)
|
Cross-validating time-series analysis
Here is some example code for cross-validating time series models. I expanded on this code in my blog, incorporating the foreach package to speed things up and allowing for a possible xreg term in th
|
6,678
|
Cross-validating time-series analysis
|
If you have time series data then you might have a "degrees of freedom problem" . For example if you have 4 observations taken at hourly intervals and then decide to use 241 observations at 1minute intervals, you have 241 observations but they are not necessarily independent. When you submit these 241 values/measurements to an analytical package, the package might expect that these are 241 independent values as it proceeds to perform it's particular magic. If you have time series data you might have to upgrade your analytics. I don't know the program you refer to but it is a reasonable guess on my part ( I could be wrong ! ) that it's tests ( F tests / T tests ...etc ) probably don't apply to your problem set.
|
Cross-validating time-series analysis
|
If you have time series data then you might have a "degrees of freedom problem" . For example if you have 4 observations taken at hourly intervals and then decide to use 241 observations at 1minute in
|
Cross-validating time-series analysis
If you have time series data then you might have a "degrees of freedom problem" . For example if you have 4 observations taken at hourly intervals and then decide to use 241 observations at 1minute intervals, you have 241 observations but they are not necessarily independent. When you submit these 241 values/measurements to an analytical package, the package might expect that these are 241 independent values as it proceeds to perform it's particular magic. If you have time series data you might have to upgrade your analytics. I don't know the program you refer to but it is a reasonable guess on my part ( I could be wrong ! ) that it's tests ( F tests / T tests ...etc ) probably don't apply to your problem set.
|
Cross-validating time-series analysis
If you have time series data then you might have a "degrees of freedom problem" . For example if you have 4 observations taken at hourly intervals and then decide to use 241 observations at 1minute in
|
6,679
|
Cross-validating time-series analysis
|
I can recomend you 2 interesting papers to read that are online
1.Streamed Learning: One-Pass SVMs, by Piyush Rai, Hal Daum´e III, Suresh Venkatasubramanian
2.Streaming k-means approximation, by Nir Ailon
Hope it clarifies you a little your ideas
|
Cross-validating time-series analysis
|
I can recomend you 2 interesting papers to read that are online
1.Streamed Learning: One-Pass SVMs, by Piyush Rai, Hal Daum´e III, Suresh Venkatasubramanian
2.Streaming k-means approximation, by Nir A
|
Cross-validating time-series analysis
I can recomend you 2 interesting papers to read that are online
1.Streamed Learning: One-Pass SVMs, by Piyush Rai, Hal Daum´e III, Suresh Venkatasubramanian
2.Streaming k-means approximation, by Nir Ailon
Hope it clarifies you a little your ideas
|
Cross-validating time-series analysis
I can recomend you 2 interesting papers to read that are online
1.Streamed Learning: One-Pass SVMs, by Piyush Rai, Hal Daum´e III, Suresh Venkatasubramanian
2.Streaming k-means approximation, by Nir A
|
6,680
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
|
I am somewhat pessimistic about a such non-parametric method, at least without the introduction of some sort of constraints on the underlying distribution.
My reasoning for this is that there will always be a distribution that breaks the true coverage probability for any finite $n$ (although as $n \rightarrow \infty$, this distribution will become more and more pathological), or the confidence interval will have to be arbitrarily large.
To illustrate, you could imagine a distribution that looks like a normal up to some value $\alpha$, but after $\alpha$ becomes extremely right skewed. This can have unbounded influence on the distribution's mean and as you push $\alpha$ out as far as possible, this can have arbitrarily small probability of making it into your sample. So you can imagine that for any $n$, you could pick an $\alpha$ to be so large that all points in your sample have extremely high probability of looking like it comes from a normal distribution with mean = 0, sd = 1, but you can also have any true mean.
So if you're looking for proper asymptotic coverage, of course this can be achieved by the CLT. However, your question implies that you are (quite reasonably) interested in the finite coverage. As my example shows, there will always be a pathological case that ruins any finite length CI.
Now, you still could have a non-parametric CI that achieves good finite coverage by adding constraints to your distribution. For example, the log-concave constraint is a non-parametric constraint. However, it seems inadequate for your problem, as log-normal is not log-concave.
Perhaps to help illustrate how difficult your problem could be, I've done unpublished work on a different constraint: inverse convex (if you click on my profile, I have a link to a personal page that has a preprint). This constraint includes most, but not all log-normals. You can also see that for this constraint, the tails can be "arbitrarily heavy", i.e. for any inverse convex distribution up to some $\alpha$, you can have heavy enough tails that the mean will be as large as you like.
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
|
I am somewhat pessimistic about a such non-parametric method, at least without the introduction of some sort of constraints on the underlying distribution.
My reasoning for this is that there will al
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
I am somewhat pessimistic about a such non-parametric method, at least without the introduction of some sort of constraints on the underlying distribution.
My reasoning for this is that there will always be a distribution that breaks the true coverage probability for any finite $n$ (although as $n \rightarrow \infty$, this distribution will become more and more pathological), or the confidence interval will have to be arbitrarily large.
To illustrate, you could imagine a distribution that looks like a normal up to some value $\alpha$, but after $\alpha$ becomes extremely right skewed. This can have unbounded influence on the distribution's mean and as you push $\alpha$ out as far as possible, this can have arbitrarily small probability of making it into your sample. So you can imagine that for any $n$, you could pick an $\alpha$ to be so large that all points in your sample have extremely high probability of looking like it comes from a normal distribution with mean = 0, sd = 1, but you can also have any true mean.
So if you're looking for proper asymptotic coverage, of course this can be achieved by the CLT. However, your question implies that you are (quite reasonably) interested in the finite coverage. As my example shows, there will always be a pathological case that ruins any finite length CI.
Now, you still could have a non-parametric CI that achieves good finite coverage by adding constraints to your distribution. For example, the log-concave constraint is a non-parametric constraint. However, it seems inadequate for your problem, as log-normal is not log-concave.
Perhaps to help illustrate how difficult your problem could be, I've done unpublished work on a different constraint: inverse convex (if you click on my profile, I have a link to a personal page that has a preprint). This constraint includes most, but not all log-normals. You can also see that for this constraint, the tails can be "arbitrarily heavy", i.e. for any inverse convex distribution up to some $\alpha$, you can have heavy enough tails that the mean will be as large as you like.
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
I am somewhat pessimistic about a such non-parametric method, at least without the introduction of some sort of constraints on the underlying distribution.
My reasoning for this is that there will al
|
6,681
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
|
One of the underlying assumptions of any sample is representativeness. The longer the tails of a distribution the less likely any small sample is going to be representative enough for any method to reliably solve for the CI because the sample won't be able to represent the distribution.
For example, running a simple perc CI on an exponential distribution with a sample size of 250 yields pretty ok results. They are much better than a with a sample of 25, although still not ideal.
I agree with Cliff AB that there won't be a general solution but you don't have to hypothesize extreme distributions. There won't be anything that works broadly with small samples. And in some cases the samples might have to be very large (but it would be nice to be wrong).
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
|
One of the underlying assumptions of any sample is representativeness. The longer the tails of a distribution the less likely any small sample is going to be representative enough for any method to re
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
One of the underlying assumptions of any sample is representativeness. The longer the tails of a distribution the less likely any small sample is going to be representative enough for any method to reliably solve for the CI because the sample won't be able to represent the distribution.
For example, running a simple perc CI on an exponential distribution with a sample size of 250 yields pretty ok results. They are much better than a with a sample of 25, although still not ideal.
I agree with Cliff AB that there won't be a general solution but you don't have to hypothesize extreme distributions. There won't be anything that works broadly with small samples. And in some cases the samples might have to be very large (but it would be nice to be wrong).
|
Is there a reliable nonparametric confidence interval for the mean of a skewed distribution?
One of the underlying assumptions of any sample is representativeness. The longer the tails of a distribution the less likely any small sample is going to be representative enough for any method to re
|
6,682
|
What are easy to interpret, goodness of fit measures for linear mixed effects models?
|
There is nothing such as an easy to interpret goodness of fit measure for linear mixed models :)
Random effect fit (mod1) can be measured by ICC and ICC2 (the ratio between variance accounted by random effects and the residual variance). psychometric R package includes a function to extract them form a lme object.
It is possible to use R2 to assess fixed effect (mod2, mod3), but this can be tricky: When two models show a similar R2 it can be the case that one is more "accurate", but that is masked by its fixed factor "subtracting" a greater variance component to the random effect. On the other hand it is easy to interpret a greater R2 of the highest order model (eg mod3). In Baayen's chapter on mixed models there is a nice discussion about this. Also, it's tutorial is very clear.
A possible solution is to consider each variance component independently, and then use them to compare the models.
|
What are easy to interpret, goodness of fit measures for linear mixed effects models?
|
There is nothing such as an easy to interpret goodness of fit measure for linear mixed models :)
Random effect fit (mod1) can be measured by ICC and ICC2 (the ratio between variance accounted by rando
|
What are easy to interpret, goodness of fit measures for linear mixed effects models?
There is nothing such as an easy to interpret goodness of fit measure for linear mixed models :)
Random effect fit (mod1) can be measured by ICC and ICC2 (the ratio between variance accounted by random effects and the residual variance). psychometric R package includes a function to extract them form a lme object.
It is possible to use R2 to assess fixed effect (mod2, mod3), but this can be tricky: When two models show a similar R2 it can be the case that one is more "accurate", but that is masked by its fixed factor "subtracting" a greater variance component to the random effect. On the other hand it is easy to interpret a greater R2 of the highest order model (eg mod3). In Baayen's chapter on mixed models there is a nice discussion about this. Also, it's tutorial is very clear.
A possible solution is to consider each variance component independently, and then use them to compare the models.
|
What are easy to interpret, goodness of fit measures for linear mixed effects models?
There is nothing such as an easy to interpret goodness of fit measure for linear mixed models :)
Random effect fit (mod1) can be measured by ICC and ICC2 (the ratio between variance accounted by rando
|
6,683
|
Is overfitting "better" than underfitting?
|
Overfitting is likely to be worse than underfitting. The reason is that there is no real upper limit to the degradation of generalisation performance that can result from over-fitting, whereas there is for underfitting.
Consider a non-linear regression model, such as a neural network or polynomial model. Assume we have standardised the response variable. A maximally underfitted solution might completely ignore the training set and have a constant output regardless of the input variables. In this case the expected mean squared error on test data will be approximately the variance of the response variable in the training set.
Now consider an over-fitted model that exactly interpolates the training data. To do so, this may require large excursions from the true conditional mean of the data generating process between points in the training set, for example the spurious peak at about x = -5. If the first three training points were closer together on the x-axis, the peak would be likely to be even higher. As a result, the test error for such points can be arbitrarily large, and hence the expected MSE on test data can similarly be arbitrarily large.
Source: https://en.wikipedia.org/wiki/Overfitting (it is actually a polynomial model in this case, but see below for an MLP example)
Edit: As @Accumulation suggests, here is an example where the extent of overfitting is much greater (10 randomly selected data points from a linear model with Gaussian noise, fitted by a 10th order polynomial fitted to the utmost degree). Happily the random number generator gave some points that were not very well spaced out first time!
It is worth making a distinction between "overfitting" and "overparameterisation". Overparameterisation means you have used a model class that is more flexible than necessary to represent the underlying structure of the data, which normally implies a larger number of parameters. "Overfitting" means that you have optimised the parameters of a model in a way that gives a better "fit" to the training sample (i.e. a better value of the training criterion), but to the detriment of generalisation performance. You can have an over-parameterised model that does not overfit the data. Unfortunately the two terms are often used interchangeably, perhaps because in earlier times the only real control of overfitting was achieved by limiting the number of parameters in the model (e.g. feature selection for linear regression models). However regularisation (c.f. ridge regression) decouples overparameterisation from overfitting, but our use of the terminology has not reliably adapted to that change (even though ridge regression is almost as old as I am!).
Here is an example that was actually generated using an (overparameterised) MLP
|
Is overfitting "better" than underfitting?
|
Overfitting is likely to be worse than underfitting. The reason is that there is no real upper limit to the degradation of generalisation performance that can result from over-fitting, whereas there
|
Is overfitting "better" than underfitting?
Overfitting is likely to be worse than underfitting. The reason is that there is no real upper limit to the degradation of generalisation performance that can result from over-fitting, whereas there is for underfitting.
Consider a non-linear regression model, such as a neural network or polynomial model. Assume we have standardised the response variable. A maximally underfitted solution might completely ignore the training set and have a constant output regardless of the input variables. In this case the expected mean squared error on test data will be approximately the variance of the response variable in the training set.
Now consider an over-fitted model that exactly interpolates the training data. To do so, this may require large excursions from the true conditional mean of the data generating process between points in the training set, for example the spurious peak at about x = -5. If the first three training points were closer together on the x-axis, the peak would be likely to be even higher. As a result, the test error for such points can be arbitrarily large, and hence the expected MSE on test data can similarly be arbitrarily large.
Source: https://en.wikipedia.org/wiki/Overfitting (it is actually a polynomial model in this case, but see below for an MLP example)
Edit: As @Accumulation suggests, here is an example where the extent of overfitting is much greater (10 randomly selected data points from a linear model with Gaussian noise, fitted by a 10th order polynomial fitted to the utmost degree). Happily the random number generator gave some points that were not very well spaced out first time!
It is worth making a distinction between "overfitting" and "overparameterisation". Overparameterisation means you have used a model class that is more flexible than necessary to represent the underlying structure of the data, which normally implies a larger number of parameters. "Overfitting" means that you have optimised the parameters of a model in a way that gives a better "fit" to the training sample (i.e. a better value of the training criterion), but to the detriment of generalisation performance. You can have an over-parameterised model that does not overfit the data. Unfortunately the two terms are often used interchangeably, perhaps because in earlier times the only real control of overfitting was achieved by limiting the number of parameters in the model (e.g. feature selection for linear regression models). However regularisation (c.f. ridge regression) decouples overparameterisation from overfitting, but our use of the terminology has not reliably adapted to that change (even though ridge regression is almost as old as I am!).
Here is an example that was actually generated using an (overparameterised) MLP
|
Is overfitting "better" than underfitting?
Overfitting is likely to be worse than underfitting. The reason is that there is no real upper limit to the degradation of generalisation performance that can result from over-fitting, whereas there
|
6,684
|
Is overfitting "better" than underfitting?
|
Roughly, overfitting is fitting the model to noise, while underfitting is not fitting a model to the signal. In your prediction with overfitting you'll reproduce the noise, the underfitting will show the mean, at best. It's like choosing between diarrhea and constipation. I'd probably choose the latter, so I'd go with underfitting, i.e. the mean.
|
Is overfitting "better" than underfitting?
|
Roughly, overfitting is fitting the model to noise, while underfitting is not fitting a model to the signal. In your prediction with overfitting you'll reproduce the noise, the underfitting will show
|
Is overfitting "better" than underfitting?
Roughly, overfitting is fitting the model to noise, while underfitting is not fitting a model to the signal. In your prediction with overfitting you'll reproduce the noise, the underfitting will show the mean, at best. It's like choosing between diarrhea and constipation. I'd probably choose the latter, so I'd go with underfitting, i.e. the mean.
|
Is overfitting "better" than underfitting?
Roughly, overfitting is fitting the model to noise, while underfitting is not fitting a model to the signal. In your prediction with overfitting you'll reproduce the noise, the underfitting will show
|
6,685
|
Is overfitting "better" than underfitting?
|
The question of what is good and what is bad depends on the problem, the question and the circumstances.
Some thoughts: The most impressive proof of how underfitting is not generally rejected so much is the universal use of simple linear regression. Problems in social sciences, life sciences, psychology etc. are almost never linear and if they are curved, they are almost never curved following a quadratic term. Nevertheless, some excellent research in these fields depends heavily on the idea, that one could draw a straight line as the representation of any relation.
A straight line is not prone to overfitting, very prone to underfitting. But that can give it credibility. "There is a connection because I can draw a reasonable straight line" is far more convincing then "There is a connection because I can draw splines" - because you can almost always overfit with splines.
People even judge the outcome of a linear regression by in-sample-R² without any form of Cross validation - would you believe a neural net of arbitrary size without cross validation or testing set anywhere near an OLS regression with small p and large R²?
|
Is overfitting "better" than underfitting?
|
The question of what is good and what is bad depends on the problem, the question and the circumstances.
Some thoughts: The most impressive proof of how underfitting is not generally rejected so much
|
Is overfitting "better" than underfitting?
The question of what is good and what is bad depends on the problem, the question and the circumstances.
Some thoughts: The most impressive proof of how underfitting is not generally rejected so much is the universal use of simple linear regression. Problems in social sciences, life sciences, psychology etc. are almost never linear and if they are curved, they are almost never curved following a quadratic term. Nevertheless, some excellent research in these fields depends heavily on the idea, that one could draw a straight line as the representation of any relation.
A straight line is not prone to overfitting, very prone to underfitting. But that can give it credibility. "There is a connection because I can draw a reasonable straight line" is far more convincing then "There is a connection because I can draw splines" - because you can almost always overfit with splines.
People even judge the outcome of a linear regression by in-sample-R² without any form of Cross validation - would you believe a neural net of arbitrary size without cross validation or testing set anywhere near an OLS regression with small p and large R²?
|
Is overfitting "better" than underfitting?
The question of what is good and what is bad depends on the problem, the question and the circumstances.
Some thoughts: The most impressive proof of how underfitting is not generally rejected so much
|
6,686
|
Is overfitting "better" than underfitting?
|
The "better" one is the one that performs better on the test set.
When you're running it in production, that's (ideally) going to be similar to the test set. It's not going to be data you've seen before, so the training set performance doesn't matter so much.
Although if they're roughly equal, underfitting is generally better.
Underfitting means you learnt simple approximations of patterns that actually exists in both the training and test data (and production data, hopefully). But overfitting means you learnt some patterns that only exists in the training data and not in the test data (and presumably not in the production data either). That could make your model behave in less consistent ways.
Underfitting should be the simpler model, and if you have 2 models that perform the same, you pick the simpler one. You don't want unnecessary complexity, which increases the likelihood of unexpected behaviour and can also be more resource intensive.
A simpler model can also be more interpretable, which can help to show that the way the model works makes sense and to understand the data better to guide business decisions in a broader context. Although interpretability is about a lot more than just over- or underfitting. If that's important to you, it would affect which type of model you use and various parts of how you train it.
|
Is overfitting "better" than underfitting?
|
The "better" one is the one that performs better on the test set.
When you're running it in production, that's (ideally) going to be similar to the test set. It's not going to be data you've seen befo
|
Is overfitting "better" than underfitting?
The "better" one is the one that performs better on the test set.
When you're running it in production, that's (ideally) going to be similar to the test set. It's not going to be data you've seen before, so the training set performance doesn't matter so much.
Although if they're roughly equal, underfitting is generally better.
Underfitting means you learnt simple approximations of patterns that actually exists in both the training and test data (and production data, hopefully). But overfitting means you learnt some patterns that only exists in the training data and not in the test data (and presumably not in the production data either). That could make your model behave in less consistent ways.
Underfitting should be the simpler model, and if you have 2 models that perform the same, you pick the simpler one. You don't want unnecessary complexity, which increases the likelihood of unexpected behaviour and can also be more resource intensive.
A simpler model can also be more interpretable, which can help to show that the way the model works makes sense and to understand the data better to guide business decisions in a broader context. Although interpretability is about a lot more than just over- or underfitting. If that's important to you, it would affect which type of model you use and various parts of how you train it.
|
Is overfitting "better" than underfitting?
The "better" one is the one that performs better on the test set.
When you're running it in production, that's (ideally) going to be similar to the test set. It's not going to be data you've seen befo
|
6,687
|
Is overfitting "better" than underfitting?
|
I liked the question and the key concept to answer it is Bias–variance tradeoff. Both underfitted model and overfitted model have some valid use case.
For example my answer here
Is an overfitted model necessarily useless?
|
Is overfitting "better" than underfitting?
|
I liked the question and the key concept to answer it is Bias–variance tradeoff. Both underfitted model and overfitted model have some valid use case.
For example my answer here
Is an overfitted model
|
Is overfitting "better" than underfitting?
I liked the question and the key concept to answer it is Bias–variance tradeoff. Both underfitted model and overfitted model have some valid use case.
For example my answer here
Is an overfitted model necessarily useless?
|
Is overfitting "better" than underfitting?
I liked the question and the key concept to answer it is Bias–variance tradeoff. Both underfitted model and overfitted model have some valid use case.
For example my answer here
Is an overfitted model
|
6,688
|
Is overfitting "better" than underfitting?
|
The answers so far are reasonable in the context of linear regression. But in a deep-learning context we usually train to the point of overfitting (if we have the resources to); then we go back and use the model saved most recently before that. I.e. underfitting just means "not there yet, carry on".
You also have to consider that the metric being used to measure the over- vs. under-fitting may not be the ideal one. As one example I've trained finance-trading algorithms with MSE, because it is quick to evaluate. But the real measure of how good the model is would be a backtest on the data, under trading conditions. Sometimes the under-fitted or over-fitted model does better than the one that minimized MSE.
In recent NLG (natural language generation) models, we've also been deliberately erring on the side of over-fitting, after blind-testing found users said they were better. This is the metric thing again, but I think it also ties in with the memorizing aspect that Haitao Du mentioned in his linked answer. So high bias, low variance ("underfitted") can mean it spouts nonsense, while low bias, high variance can mean it sounds just like the training data. Just like a human would.
To sum up, it depends.
|
Is overfitting "better" than underfitting?
|
The answers so far are reasonable in the context of linear regression. But in a deep-learning context we usually train to the point of overfitting (if we have the resources to); then we go back and us
|
Is overfitting "better" than underfitting?
The answers so far are reasonable in the context of linear regression. But in a deep-learning context we usually train to the point of overfitting (if we have the resources to); then we go back and use the model saved most recently before that. I.e. underfitting just means "not there yet, carry on".
You also have to consider that the metric being used to measure the over- vs. under-fitting may not be the ideal one. As one example I've trained finance-trading algorithms with MSE, because it is quick to evaluate. But the real measure of how good the model is would be a backtest on the data, under trading conditions. Sometimes the under-fitted or over-fitted model does better than the one that minimized MSE.
In recent NLG (natural language generation) models, we've also been deliberately erring on the side of over-fitting, after blind-testing found users said they were better. This is the metric thing again, but I think it also ties in with the memorizing aspect that Haitao Du mentioned in his linked answer. So high bias, low variance ("underfitted") can mean it spouts nonsense, while low bias, high variance can mean it sounds just like the training data. Just like a human would.
To sum up, it depends.
|
Is overfitting "better" than underfitting?
The answers so far are reasonable in the context of linear regression. But in a deep-learning context we usually train to the point of overfitting (if we have the resources to); then we go back and us
|
6,689
|
Is overfitting "better" than underfitting?
|
Parsimony usually a desirable feature in a machine learning model - this relates to the idea of Occam's Razor, that among models that produce equally good (or bad) results, you should generally prefer the simpler one. This is explicitly performed in certain model selection approaches such as the Minimum Description Length, which describes the "cost" of a model as related both to how well the model fits the data, and the complexity of the model. For two models that both perform poorly on a dataset, the simpler model is preferred. Overfit models typically require extra parameters that add "cost" to a model with no discernable benefit, so you're usually better off with an underfit model that yields similar error.
In a way, an overfit model is like a student who memorizes the sequence of answers on a multiple choice practice test, applies that same sequence to the real test, and fails. The underfit model, on the other hand, is the student who simply picks "C" for every answer, and does as poorly on the real test as they did on the practice. The overfit student is "surprised" by their poor performance, and did a lot of work for absolutely no benefit. The underfit student knows their strategy won't work well, but can implement that strategy very easily. Both students fail the test, but at least one knew ahead of time and didn't waste a lot of effort for nothing.
|
Is overfitting "better" than underfitting?
|
Parsimony usually a desirable feature in a machine learning model - this relates to the idea of Occam's Razor, that among models that produce equally good (or bad) results, you should generally prefer
|
Is overfitting "better" than underfitting?
Parsimony usually a desirable feature in a machine learning model - this relates to the idea of Occam's Razor, that among models that produce equally good (or bad) results, you should generally prefer the simpler one. This is explicitly performed in certain model selection approaches such as the Minimum Description Length, which describes the "cost" of a model as related both to how well the model fits the data, and the complexity of the model. For two models that both perform poorly on a dataset, the simpler model is preferred. Overfit models typically require extra parameters that add "cost" to a model with no discernable benefit, so you're usually better off with an underfit model that yields similar error.
In a way, an overfit model is like a student who memorizes the sequence of answers on a multiple choice practice test, applies that same sequence to the real test, and fails. The underfit model, on the other hand, is the student who simply picks "C" for every answer, and does as poorly on the real test as they did on the practice. The overfit student is "surprised" by their poor performance, and did a lot of work for absolutely no benefit. The underfit student knows their strategy won't work well, but can implement that strategy very easily. Both students fail the test, but at least one knew ahead of time and didn't waste a lot of effort for nothing.
|
Is overfitting "better" than underfitting?
Parsimony usually a desirable feature in a machine learning model - this relates to the idea of Occam's Razor, that among models that produce equally good (or bad) results, you should generally prefer
|
6,690
|
Is overfitting "better" than underfitting?
|
Imagine you're an ML algorithm that is supposed to do well on a test. You know the syllabus and hence, you have a set of example problems (with solutions) which you can practice from. Now, you have three options:
Overfit: Memorize solutions of practice problems without actually understanding how you arrived at the solution. This will lead to failure on the test.
Underfit: Solve the simplest problem with few transferable skills. You would solve some problems on test but won't be enough to cross the passing threshold score. However, there is room for improvement.
Somewhere between Overfit and Underfit: You practice problems which appeared on previous years' test. Since such problems are more representative of the problems you will be seeing in your test tomorrow, there's a higher probability that you will do well. Which is what you want! Which is exactly the performance a machine aims for!
|
Is overfitting "better" than underfitting?
|
Imagine you're an ML algorithm that is supposed to do well on a test. You know the syllabus and hence, you have a set of example problems (with solutions) which you can practice from. Now, you have th
|
Is overfitting "better" than underfitting?
Imagine you're an ML algorithm that is supposed to do well on a test. You know the syllabus and hence, you have a set of example problems (with solutions) which you can practice from. Now, you have three options:
Overfit: Memorize solutions of practice problems without actually understanding how you arrived at the solution. This will lead to failure on the test.
Underfit: Solve the simplest problem with few transferable skills. You would solve some problems on test but won't be enough to cross the passing threshold score. However, there is room for improvement.
Somewhere between Overfit and Underfit: You practice problems which appeared on previous years' test. Since such problems are more representative of the problems you will be seeing in your test tomorrow, there's a higher probability that you will do well. Which is what you want! Which is exactly the performance a machine aims for!
|
Is overfitting "better" than underfitting?
Imagine you're an ML algorithm that is supposed to do well on a test. You know the syllabus and hence, you have a set of example problems (with solutions) which you can practice from. Now, you have th
|
6,691
|
Is overfitting "better" than underfitting?
|
Probably not your situation, but you can use machine learning as a memory. Suppose you have some inputs where you can train on the entire domain of inputs. That is, there is no possible input that wasn't previously known and used for training. That way, you can always generate the correct output. If the concept you wish to train on can be expressed in this way, then over training is memorising, and in limited situations, can be useful.
Otherwise, as the other comments have stated, overfitting means you are biased to the training data and will do poorly on anything not in the training set. The goal is for generalisation, for the model to understand the concept, not memorise. The syllabus answer above explains it well.
|
Is overfitting "better" than underfitting?
|
Probably not your situation, but you can use machine learning as a memory. Suppose you have some inputs where you can train on the entire domain of inputs. That is, there is no possible input that was
|
Is overfitting "better" than underfitting?
Probably not your situation, but you can use machine learning as a memory. Suppose you have some inputs where you can train on the entire domain of inputs. That is, there is no possible input that wasn't previously known and used for training. That way, you can always generate the correct output. If the concept you wish to train on can be expressed in this way, then over training is memorising, and in limited situations, can be useful.
Otherwise, as the other comments have stated, overfitting means you are biased to the training data and will do poorly on anything not in the training set. The goal is for generalisation, for the model to understand the concept, not memorise. The syllabus answer above explains it well.
|
Is overfitting "better" than underfitting?
Probably not your situation, but you can use machine learning as a memory. Suppose you have some inputs where you can train on the entire domain of inputs. That is, there is no possible input that was
|
6,692
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
My favourite example is a chessboard: if you pick a point uniformly then the row, column, and colour are pairwise independent.
Suppose A is colour, B is row, and C is column. Then P(A="white"|B)=0.5 and P(A="white"|C)=0.5 for any value of B, but P(A="white"|B,C) is either 0 or 1 for any values of B and C.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
My favourite example is a chessboard: if you pick a point uniformly then the row, column, and colour are pairwise independent.
Suppose A is colour, B is row, and C is column. Then P(A="white"|B)=0.5 a
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
My favourite example is a chessboard: if you pick a point uniformly then the row, column, and colour are pairwise independent.
Suppose A is colour, B is row, and C is column. Then P(A="white"|B)=0.5 and P(A="white"|C)=0.5 for any value of B, but P(A="white"|B,C) is either 0 or 1 for any values of B and C.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
My favourite example is a chessboard: if you pick a point uniformly then the row, column, and colour are pairwise independent.
Suppose A is colour, B is row, and C is column. Then P(A="white"|B)=0.5 a
|
6,693
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
Imagine $A$ and $B$ are independent Bernoulli random variables with success probability 1/2, and let $C = AB + (1 - A)(1 - B)$ (if you like, $A$ is the event that a coin lands heads, $B$ is the event that another coin lands heads, and $C$ is the event that both coins land the same side up). Then $P(A = 1 \mid C = 1) = 1/2$ but $P(A = 1 \mid B = 1, C = 1) = 1$.
A bit more generally, a common situation where this is not true is when $(A, B, C)$ form a v-structure, i.e., where $A \rightarrow C \leftarrow B$, where $A$ and $B$ are marginally independent but where $B$ can provide information about $A$ if both cause $C$.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
Imagine $A$ and $B$ are independent Bernoulli random variables with success probability 1/2, and let $C = AB + (1 - A)(1 - B)$ (if you like, $A$ is the event that a coin lands heads, $B$ is the event
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
Imagine $A$ and $B$ are independent Bernoulli random variables with success probability 1/2, and let $C = AB + (1 - A)(1 - B)$ (if you like, $A$ is the event that a coin lands heads, $B$ is the event that another coin lands heads, and $C$ is the event that both coins land the same side up). Then $P(A = 1 \mid C = 1) = 1/2$ but $P(A = 1 \mid B = 1, C = 1) = 1$.
A bit more generally, a common situation where this is not true is when $(A, B, C)$ form a v-structure, i.e., where $A \rightarrow C \leftarrow B$, where $A$ and $B$ are marginally independent but where $B$ can provide information about $A$ if both cause $C$.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
Imagine $A$ and $B$ are independent Bernoulli random variables with success probability 1/2, and let $C = AB + (1 - A)(1 - B)$ (if you like, $A$ is the event that a coin lands heads, $B$ is the event
|
6,694
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
Let's continue your example with two decks of cards, supposing that one card is chosen randomly from each deck.
You have proposed that $A$ is the event that the ace of spades is chosen from the first deck and that $B$ is the event that the ace of spades is chosen from the second deck.
Now let $C$ be the event that the two cards from the two decks are of different colors. Then
$$P(A|C) = P(A) = 1/52$$
but
$$P(A|B,C) = 0$$
because $A$, $B$ and $C$ cannot simultaneously be true.
Note that any two of $A$, $B$ and $C$ are independent but the three events are dependent when taken together.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
Let's continue your example with two decks of cards, supposing that one card is chosen randomly from each deck.
You have proposed that $A$ is the event that the ace of spades is chosen from the first
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
Let's continue your example with two decks of cards, supposing that one card is chosen randomly from each deck.
You have proposed that $A$ is the event that the ace of spades is chosen from the first deck and that $B$ is the event that the ace of spades is chosen from the second deck.
Now let $C$ be the event that the two cards from the two decks are of different colors. Then
$$P(A|C) = P(A) = 1/52$$
but
$$P(A|B,C) = 0$$
because $A$, $B$ and $C$ cannot simultaneously be true.
Note that any two of $A$, $B$ and $C$ are independent but the three events are dependent when taken together.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
Let's continue your example with two decks of cards, supposing that one card is chosen randomly from each deck.
You have proposed that $A$ is the event that the ace of spades is chosen from the first
|
6,695
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
There are two situations how this can happen.
Collider bias
A common way how the situation can occur is collider bias.
An example is in the image below. In this example, intelligence and appearance are statistically unrelated (there's not even an effect in this case as with the coin example below). But conditional on the sum of intelligence and appearance the two become correlated.
Invariant effect
With collider bias both A and B have an effect on C. In some special cases, the situation may also appear when B has a causal effect on A, but it does not appear as a statistical dependency.
The underlying reason why this counterintuitive situation can happen is because: When we speak about statistical independence between A and B then it doesn't necessarily mean that A and B have no functional/causal relationship.
Let's say that we flip two fair coins $B$ and $C$, and assign values $-1$ and $1$ to the sides of the coins. Let's define $A := B \times C$.
B C A := B*C
1 1 1
1 -1 -1
-1 1 -1
-1 -1 1
Now $B$ does influence the outcome $A$ but $A$ is not statistically dependent on $B$ alone. Namely we have that $P(A = 1) = P(A = -1) = 0.5$ independent of the value of $B$.
Variants of this case occur when $B$ is a variable that influences $A$ while leaving the distribution of $A$ unchanged. So this case happens when $B$ has an effect on $A$ that leaves the distribution of $A$ invariant. E.g. it happens when $B$ switches labels of a fair coin or dice.
This seems like a contrived case, but it is also a bit about a particular interpretation of probability. When we flip a coin, does it matter whether we start with heads up or tails up? Statistically speaking there might not be a relationship. But in the underlying physical process the starting position of the coin has (according to theory) an influence on the position of the coin after the flip. The situation may, after all, be considered deterministic; but we describe it as probabilistic because we have no complete knowledge about the begin state of the entire system and all the parameters that are involved in the outcome.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
There are two situations how this can happen.
Collider bias
A common way how the situation can occur is collider bias.
An example is in the image below. In this example, intelligence and appearance ar
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
There are two situations how this can happen.
Collider bias
A common way how the situation can occur is collider bias.
An example is in the image below. In this example, intelligence and appearance are statistically unrelated (there's not even an effect in this case as with the coin example below). But conditional on the sum of intelligence and appearance the two become correlated.
Invariant effect
With collider bias both A and B have an effect on C. In some special cases, the situation may also appear when B has a causal effect on A, but it does not appear as a statistical dependency.
The underlying reason why this counterintuitive situation can happen is because: When we speak about statistical independence between A and B then it doesn't necessarily mean that A and B have no functional/causal relationship.
Let's say that we flip two fair coins $B$ and $C$, and assign values $-1$ and $1$ to the sides of the coins. Let's define $A := B \times C$.
B C A := B*C
1 1 1
1 -1 -1
-1 1 -1
-1 -1 1
Now $B$ does influence the outcome $A$ but $A$ is not statistically dependent on $B$ alone. Namely we have that $P(A = 1) = P(A = -1) = 0.5$ independent of the value of $B$.
Variants of this case occur when $B$ is a variable that influences $A$ while leaving the distribution of $A$ unchanged. So this case happens when $B$ has an effect on $A$ that leaves the distribution of $A$ invariant. E.g. it happens when $B$ switches labels of a fair coin or dice.
This seems like a contrived case, but it is also a bit about a particular interpretation of probability. When we flip a coin, does it matter whether we start with heads up or tails up? Statistically speaking there might not be a relationship. But in the underlying physical process the starting position of the coin has (according to theory) an influence on the position of the coin after the flip. The situation may, after all, be considered deterministic; but we describe it as probabilistic because we have no complete knowledge about the begin state of the entire system and all the parameters that are involved in the outcome.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
There are two situations how this can happen.
Collider bias
A common way how the situation can occur is collider bias.
An example is in the image below. In this example, intelligence and appearance ar
|
6,696
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
I quote Joseph Blitzstein's Introduction to Probability (2019 2 edn), p. 65.
Example 2.5.11 (Independence doesn't imply conditional independence).
My
friends Alice and Bob are the only two people who ever call me on the phone. Each
day, they decide independently whether to call me that day. Let A be the event
that Alice calls me next Friday and B be the event that Bob calls me next Friday.
Assume A and B are unconditionally independent with P(A) > 0 and P(B) > 0.
However, given that I receive exactly one call next Friday, A and B are no longer
independent: the call is from Alice if and only if it is not from Bob. In other words,
letting C be the event that I receive exactly one call next Friday, $P(B|C) > 0$ while
$P(B|A,C) = 0$, so A and B are not conditionally independent given C.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
I quote Joseph Blitzstein's Introduction to Probability (2019 2 edn), p. 65.
Example 2.5.11 (Independence doesn't imply conditional independence).
My
friends Alice and Bob are the only two people who
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
I quote Joseph Blitzstein's Introduction to Probability (2019 2 edn), p. 65.
Example 2.5.11 (Independence doesn't imply conditional independence).
My
friends Alice and Bob are the only two people who ever call me on the phone. Each
day, they decide independently whether to call me that day. Let A be the event
that Alice calls me next Friday and B be the event that Bob calls me next Friday.
Assume A and B are unconditionally independent with P(A) > 0 and P(B) > 0.
However, given that I receive exactly one call next Friday, A and B are no longer
independent: the call is from Alice if and only if it is not from Bob. In other words,
letting C be the event that I receive exactly one call next Friday, $P(B|C) > 0$ while
$P(B|A,C) = 0$, so A and B are not conditionally independent given C.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
I quote Joseph Blitzstein's Introduction to Probability (2019 2 edn), p. 65.
Example 2.5.11 (Independence doesn't imply conditional independence).
My
friends Alice and Bob are the only two people who
|
6,697
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
As @Sextus Empiricus (the ancient skeptic!) said, collider bias phenomenon in epidemiology is a great exemplar of why marginal independence of two random variables does not necessarily imply their conditional independence, given a third random variable.
Sackett (1978)'s example is a classic for the collider bias. In his paper, $A =$ having locomotor disease, and $B = $ having respiratory disease. Let $C$ denote the event that a person is hospitalized (for whatever reason). He observed that among hospitalized patients, there was a strong association between $A$ and $B$, whereas there was no association between $A$ and $B$ in the overall population (mix of both $C$ and $\bar C$). If $C$ denotes hospitalization, then we see that $P(A|B,C) \ne P(A|C)$ and $P(B|A,C) \ne P(B|C)$, even though $P(A|B) = P(B)$, this is because both $A$ and $B$ increase the probability of $C$. Hospitalization, $C$, is the collider, being a common effect of $A$ and $B$.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
|
As @Sextus Empiricus (the ancient skeptic!) said, collider bias phenomenon in epidemiology is a great exemplar of why marginal independence of two random variables does not necessarily imply their con
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
As @Sextus Empiricus (the ancient skeptic!) said, collider bias phenomenon in epidemiology is a great exemplar of why marginal independence of two random variables does not necessarily imply their conditional independence, given a third random variable.
Sackett (1978)'s example is a classic for the collider bias. In his paper, $A =$ having locomotor disease, and $B = $ having respiratory disease. Let $C$ denote the event that a person is hospitalized (for whatever reason). He observed that among hospitalized patients, there was a strong association between $A$ and $B$, whereas there was no association between $A$ and $B$ in the overall population (mix of both $C$ and $\bar C$). If $C$ denotes hospitalization, then we see that $P(A|B,C) \ne P(A|C)$ and $P(B|A,C) \ne P(B|C)$, even though $P(A|B) = P(B)$, this is because both $A$ and $B$ increase the probability of $C$. Hospitalization, $C$, is the collider, being a common effect of $A$ and $B$.
|
If we know A is independent of B, why isn't P(A|B,C) = P(A|C) necessarily true?
As @Sextus Empiricus (the ancient skeptic!) said, collider bias phenomenon in epidemiology is a great exemplar of why marginal independence of two random variables does not necessarily imply their con
|
6,698
|
What is the relationship between $Y$ and $X$ in this plot?
|
The question deals with several concepts: how to evaluate data given only in the form of a scatterplot, how to summarize a scatterplot, and whether (and to what degree) a relationship looks linear. Let's take them in order.
Evaluating graphical data
Use principles of exploratory data analysis (EDA). These (at least originally, when they were developed for pencil-and-paper use) emphasize simple, easy-to-compute, robust summaries of data. One of the very simplest kinds of summaries is based on positions within a set of numbers, such as the middle value, which describes a "typical" value. Middles are easy to estimate reliably from graphics.
Scatterplots exhibit pairs of numbers. The first of each pair (as plotted on the horizontal axis) gives a set of single numbers, which we could summarize separately.
In this particular scatterplot, the y-values appear to lie within two almost completely separate groups: the values above $60$ at the top and those equal to or less than $60$ at the bottom. (This impression is confirmed by drawing a histogram of the y-values, which is sharply bimodal, but that would be a lot of work at this stage.) I invite sceptics to squint at the scatterplot. When I do--using a large-radius, gamma-corrected Gaussian blur (that is, a standard rapid image processing result) of the dots in the scatterplot I see this:
The two groups--upper and lower--are pretty apparent. (The upper group is much lighter than the lower because it contains many fewer dots.)
Accordingly, let's summarize the groups of y-values separately. I will do that by drawing horizontal lines at the medians of the two groups. In order to emphasize the impression of the data and to show we're not doing any kind of computation, I have (a) removed all decorations like axes and gridlines and (b) blurred the points. Little information about the patterns in the data is lost by thus "squinting" at the graphic:
Similarly, I have attempted to mark the medians of the x-values with vertical line segments. In the upper group (red lines) you can check--by counting the blobs--that these lines do actually separate the group into two equal halves, both horizontally and vertically. In the lower group (blue lines) I have only visually estimated the positions without actually doing any counting.
Assessing Relationships: Regression
The points of intersection are the centers of the two groups. One excellent summary of the relationship among the x and y values would be to report these central positions. One would then want to supplement this summary by a description of how much the data are spread in each group--to the left and right, above and below--around their centers. For brevity, I won't do that here, but note that (roughly) the lengths of the line segments I have drawn reflect the overall spreads of each group.
Finally, I drew a (dashed) line connecting the two centers. This is a reasonable regression line. Is it a good description of the data? Certainly not: look how spread out the data are around this line. Is it even evidence of linearity? That's scarcely relevant because the linear description is so poor. Nevertheless, because that is the question before us, let's address it.
Evaluating Linearity
A relationship is linear in a statistical sense when either the y values vary in a balanced random fashion around a line or the x values are seen to vary in a balanced random fashion around a line (or both).
The former does not appear to be the case here: because the y values seem to fall into two groups, their variation is never going to look balanced in the sense of being roughly symmetrically distributed above or below the line. (That immediately rules out the possibility of dumping the data into a linear regression package and performing a least squares fit of y against x: the answers would not be relevant.)
What about variation in x? That is more plausible: at each height on the plot, the horizontal scatter of points around the dotted line is pretty balanced. The spread in this scatter seems to be a little bit greater at lower heights (low y values), but maybe that's because there are many more points there. (The more random data you have, the wider apart their extreme values will tend to be.)
Moreover, as we scan from top to bottom, there are no places where the horizontal scatter around the regression line is strongly unbalanced: that would be evidence of non-linearity. (Well, maybe around y=50 or so there may be too many large x values. This subtle effect could be taken as further evidence for breaking the data into two groups around the y=60 value.)
Conclusions
We have seen that
It makes sense to view x as a linear function of y plus some "nice" random variation.
It does not make sense to view y as a linear function of x plus random variation.
A regression line can be estimated by separating the data into a group of high y values and a group of low y values, finding the centers of both groups by using medians, and connecting those centers.
The resulting line has a downward slope, indicating a negative linear relationship.
There are no strong departures from linearity.
Nevertheless, because the spreads of the x-values around the line are still large (compared to the overall spread of the x-values to begin with), we would have to characterize this negative linear relationship as "very weak."
It might be more useful to describe the data as forming two oval-shaped clouds (one for y above 60 and another for lower values of y). Within each cloud there is little detectable relationship between x and y. The centers of the clouds are near (0.29, 90) and (0.38, 30). The clouds have comparable spreads, but the upper cloud has far fewer data than the lower one (maybe 20% as much).
Two of these conclusions confirm those made in the question itself that there is a weak negative relationship. The others supplement and support those conclusions.
One conclusion drawn in the question that does not seem to hold up is the assertion that there are "outliers." A more careful examination (as sketched below) will fail to turn up any individual points, or even small groups of points, that validly could be considered outlying. After sufficiently long analysis, one's attention might be drawn to the two points near the middle right or the one point at the lower left corner, but even these are not going to change one's assessment of the data very much, whether or not they are considered outlying.
Further Directions
Much more could be said. The next steps would be to assess the spreads of those clouds. The relationships between x and y within each of the two clouds could be evaluated separately, using the same techniques shown here. The slight asymmetry of the lower cloud (more data seem to appear at the smallest y values) could be evaluated and even adjusted by re-expressing the y values (a square root might work well). At this stage it would make sense to look for outlying data, because at this point the description would include information about typical data values as well as their spreads; outliers (by definition) would be too far from the middle to be explained in terms of the observed amount of spreading.
None of this work--which is quite quantitative--requires much more than finding middles of groups of data and doing some simple computations with them, and therefore can be done quickly and accurately even when the data are available only in graphical form. Every result reported here--including the quantitative values--could easily be found within a few seconds using a display system (such as hardcopy and a pencil :-)) which permits one to make light marks on top of the graphic.
|
What is the relationship between $Y$ and $X$ in this plot?
|
The question deals with several concepts: how to evaluate data given only in the form of a scatterplot, how to summarize a scatterplot, and whether (and to what degree) a relationship looks linear.
|
What is the relationship between $Y$ and $X$ in this plot?
The question deals with several concepts: how to evaluate data given only in the form of a scatterplot, how to summarize a scatterplot, and whether (and to what degree) a relationship looks linear. Let's take them in order.
Evaluating graphical data
Use principles of exploratory data analysis (EDA). These (at least originally, when they were developed for pencil-and-paper use) emphasize simple, easy-to-compute, robust summaries of data. One of the very simplest kinds of summaries is based on positions within a set of numbers, such as the middle value, which describes a "typical" value. Middles are easy to estimate reliably from graphics.
Scatterplots exhibit pairs of numbers. The first of each pair (as plotted on the horizontal axis) gives a set of single numbers, which we could summarize separately.
In this particular scatterplot, the y-values appear to lie within two almost completely separate groups: the values above $60$ at the top and those equal to or less than $60$ at the bottom. (This impression is confirmed by drawing a histogram of the y-values, which is sharply bimodal, but that would be a lot of work at this stage.) I invite sceptics to squint at the scatterplot. When I do--using a large-radius, gamma-corrected Gaussian blur (that is, a standard rapid image processing result) of the dots in the scatterplot I see this:
The two groups--upper and lower--are pretty apparent. (The upper group is much lighter than the lower because it contains many fewer dots.)
Accordingly, let's summarize the groups of y-values separately. I will do that by drawing horizontal lines at the medians of the two groups. In order to emphasize the impression of the data and to show we're not doing any kind of computation, I have (a) removed all decorations like axes and gridlines and (b) blurred the points. Little information about the patterns in the data is lost by thus "squinting" at the graphic:
Similarly, I have attempted to mark the medians of the x-values with vertical line segments. In the upper group (red lines) you can check--by counting the blobs--that these lines do actually separate the group into two equal halves, both horizontally and vertically. In the lower group (blue lines) I have only visually estimated the positions without actually doing any counting.
Assessing Relationships: Regression
The points of intersection are the centers of the two groups. One excellent summary of the relationship among the x and y values would be to report these central positions. One would then want to supplement this summary by a description of how much the data are spread in each group--to the left and right, above and below--around their centers. For brevity, I won't do that here, but note that (roughly) the lengths of the line segments I have drawn reflect the overall spreads of each group.
Finally, I drew a (dashed) line connecting the two centers. This is a reasonable regression line. Is it a good description of the data? Certainly not: look how spread out the data are around this line. Is it even evidence of linearity? That's scarcely relevant because the linear description is so poor. Nevertheless, because that is the question before us, let's address it.
Evaluating Linearity
A relationship is linear in a statistical sense when either the y values vary in a balanced random fashion around a line or the x values are seen to vary in a balanced random fashion around a line (or both).
The former does not appear to be the case here: because the y values seem to fall into two groups, their variation is never going to look balanced in the sense of being roughly symmetrically distributed above or below the line. (That immediately rules out the possibility of dumping the data into a linear regression package and performing a least squares fit of y against x: the answers would not be relevant.)
What about variation in x? That is more plausible: at each height on the plot, the horizontal scatter of points around the dotted line is pretty balanced. The spread in this scatter seems to be a little bit greater at lower heights (low y values), but maybe that's because there are many more points there. (The more random data you have, the wider apart their extreme values will tend to be.)
Moreover, as we scan from top to bottom, there are no places where the horizontal scatter around the regression line is strongly unbalanced: that would be evidence of non-linearity. (Well, maybe around y=50 or so there may be too many large x values. This subtle effect could be taken as further evidence for breaking the data into two groups around the y=60 value.)
Conclusions
We have seen that
It makes sense to view x as a linear function of y plus some "nice" random variation.
It does not make sense to view y as a linear function of x plus random variation.
A regression line can be estimated by separating the data into a group of high y values and a group of low y values, finding the centers of both groups by using medians, and connecting those centers.
The resulting line has a downward slope, indicating a negative linear relationship.
There are no strong departures from linearity.
Nevertheless, because the spreads of the x-values around the line are still large (compared to the overall spread of the x-values to begin with), we would have to characterize this negative linear relationship as "very weak."
It might be more useful to describe the data as forming two oval-shaped clouds (one for y above 60 and another for lower values of y). Within each cloud there is little detectable relationship between x and y. The centers of the clouds are near (0.29, 90) and (0.38, 30). The clouds have comparable spreads, but the upper cloud has far fewer data than the lower one (maybe 20% as much).
Two of these conclusions confirm those made in the question itself that there is a weak negative relationship. The others supplement and support those conclusions.
One conclusion drawn in the question that does not seem to hold up is the assertion that there are "outliers." A more careful examination (as sketched below) will fail to turn up any individual points, or even small groups of points, that validly could be considered outlying. After sufficiently long analysis, one's attention might be drawn to the two points near the middle right or the one point at the lower left corner, but even these are not going to change one's assessment of the data very much, whether or not they are considered outlying.
Further Directions
Much more could be said. The next steps would be to assess the spreads of those clouds. The relationships between x and y within each of the two clouds could be evaluated separately, using the same techniques shown here. The slight asymmetry of the lower cloud (more data seem to appear at the smallest y values) could be evaluated and even adjusted by re-expressing the y values (a square root might work well). At this stage it would make sense to look for outlying data, because at this point the description would include information about typical data values as well as their spreads; outliers (by definition) would be too far from the middle to be explained in terms of the observed amount of spreading.
None of this work--which is quite quantitative--requires much more than finding middles of groups of data and doing some simple computations with them, and therefore can be done quickly and accurately even when the data are available only in graphical form. Every result reported here--including the quantitative values--could easily be found within a few seconds using a display system (such as hardcopy and a pencil :-)) which permits one to make light marks on top of the graphic.
|
What is the relationship between $Y$ and $X$ in this plot?
The question deals with several concepts: how to evaluate data given only in the form of a scatterplot, how to summarize a scatterplot, and whether (and to what degree) a relationship looks linear.
|
6,699
|
What is the relationship between $Y$ and $X$ in this plot?
|
Let's have some fun!
First of all, I scraped the data off your graph.
Then I used a running line smoother to produce the black regression line below with the dashed 95% CI bands in gray. The graph below shows a span in the smooth of one half the data, although tighter spans revealed more or less precisely the same relationship. The slight change in slope around $X=0.4$ suggested a relationship that could be approximated using a linear model and adding linear hinge function of the slope of $X$ in a a nonlinear least squares regression (red line):
$$Y = \beta_{0} + \beta_{X}X + \beta_{\text{c}}\max\left(X-\theta,0\right) + \varepsilon$$
The coefficient estimates were:
$$Y = 50.9 -37.7X -26.74436\max\left(X-0.46,0\right)$$
I would note that while the redoubtable whuber asserts that there are no strong linear relationships, the deviation from the line $Y = 50.9 - 37.7X$ implied by the hinge term is on the same order as the slope of $X$ (i.e. 37.7), so I would respectfully disagree that we see no strong nonlinear relationship (i.e. Yes there are no strong relationships, but the nonlinear term is about as strong as the linear one).
Interpretation
(I have proceeded assuming that you are only interested in $Y$ as the dependent variable.) Values of $Y$ are very weakly predicted by $X$ (with an Adjusted-$R^{2}$=0.03). The association is approximately linear, with a slight decrease in slope at about 0.46. The residuals are somewhat skewed to the right, probably because the is a sharp lower bound on values of $Y$. Given the sample size $N=170$, I am inclined to tolerate violations of normality. More observations for values of $X>0.5$ would help nail down whether the change in slope is real, or is an artifact of decreased variance of $Y$ in that range.
Updating with the $\ln(Y)$ graph:
(The red line is simply a linear regression of ln(Y) on X.)
In comments Russ Lenth wrote: "I just wonder if this holds up if you smooth $\log Y$ vs. $X$. The distribution of $Y$ is skewed right." This is quite a good suggestion, as the $\log Y$ transform versus $X$ also gives a slightly better fit that a line between $Y$ and $X$ with residuals that are more symmetrically distributed. However, both his suggested $\log(Y)$ and my linear hinge of $X$ share a preference for a relationship between (untransformed) $Y$ and $X$ that is not described by a straight line.
|
What is the relationship between $Y$ and $X$ in this plot?
|
Let's have some fun!
First of all, I scraped the data off your graph.
Then I used a running line smoother to produce the black regression line below with the dashed 95% CI bands in gray. The graph bel
|
What is the relationship between $Y$ and $X$ in this plot?
Let's have some fun!
First of all, I scraped the data off your graph.
Then I used a running line smoother to produce the black regression line below with the dashed 95% CI bands in gray. The graph below shows a span in the smooth of one half the data, although tighter spans revealed more or less precisely the same relationship. The slight change in slope around $X=0.4$ suggested a relationship that could be approximated using a linear model and adding linear hinge function of the slope of $X$ in a a nonlinear least squares regression (red line):
$$Y = \beta_{0} + \beta_{X}X + \beta_{\text{c}}\max\left(X-\theta,0\right) + \varepsilon$$
The coefficient estimates were:
$$Y = 50.9 -37.7X -26.74436\max\left(X-0.46,0\right)$$
I would note that while the redoubtable whuber asserts that there are no strong linear relationships, the deviation from the line $Y = 50.9 - 37.7X$ implied by the hinge term is on the same order as the slope of $X$ (i.e. 37.7), so I would respectfully disagree that we see no strong nonlinear relationship (i.e. Yes there are no strong relationships, but the nonlinear term is about as strong as the linear one).
Interpretation
(I have proceeded assuming that you are only interested in $Y$ as the dependent variable.) Values of $Y$ are very weakly predicted by $X$ (with an Adjusted-$R^{2}$=0.03). The association is approximately linear, with a slight decrease in slope at about 0.46. The residuals are somewhat skewed to the right, probably because the is a sharp lower bound on values of $Y$. Given the sample size $N=170$, I am inclined to tolerate violations of normality. More observations for values of $X>0.5$ would help nail down whether the change in slope is real, or is an artifact of decreased variance of $Y$ in that range.
Updating with the $\ln(Y)$ graph:
(The red line is simply a linear regression of ln(Y) on X.)
In comments Russ Lenth wrote: "I just wonder if this holds up if you smooth $\log Y$ vs. $X$. The distribution of $Y$ is skewed right." This is quite a good suggestion, as the $\log Y$ transform versus $X$ also gives a slightly better fit that a line between $Y$ and $X$ with residuals that are more symmetrically distributed. However, both his suggested $\log(Y)$ and my linear hinge of $X$ share a preference for a relationship between (untransformed) $Y$ and $X$ that is not described by a straight line.
|
What is the relationship between $Y$ and $X$ in this plot?
Let's have some fun!
First of all, I scraped the data off your graph.
Then I used a running line smoother to produce the black regression line below with the dashed 95% CI bands in gray. The graph bel
|
6,700
|
What is the relationship between $Y$ and $X$ in this plot?
|
Here's my 2¢ 1.5¢. To me the most prominent feature is that the data abruptly stop and 'bunch up' at the bottom of the range of Y. I do see the two (potential) 'clusters' and the general negative association, but the most salient features are the (potential) floor effect and the fact that the top, low-density cluster only extends across part of the range of X.
Because the 'clusters' are vaguely bivariate normal, a parametric normal mixture model may be interesting to try. Using @Alexis' data, I find that three clusters optimize the BIC. The high-density 'floor effect' is picked out as a third cluster. The code follows:
library(mclust)
dframe = read.table(url("http://doyenne.com/personal/files/data.csv"), header=T, sep=",")
mc = Mclust(dframe)
summary(mc)
# ----------------------------------------------------
# Gaussian finite mixture model fitted by EM algorithm
# ----------------------------------------------------
#
# Mclust VVI (diagonal, varying volume and shape) model with 3 components:
#
# log.likelihood n df BIC ICL
# -614.4713 170 14 -1300.844 -1338.715
#
# Clustering table:
# 1 2 3
# 72 72 26
Now, what shall we infer from this? I do not think that Mclust is merely human pattern recognition gone awry. (Whereas my read of the scatterplot may well be.) On the other hand, there is no question that this is post-hoc. I saw what I thought might be an interesting pattern and so decided to check it. The algorithm does find something, but then I only checked for what I thought might be there so my thumb is definitely on the scale. Sometimes it is possible devise a strategy to mitigate against this (see @whuber's excellent answer here), but I have no idea how to go about such a process in cases like this. As a result, I take these results with a lot of salt (I've done this sort of thing sufficiently often that someone is missing a whole shaker). It does give me some material to think about and discuss with my client when next we meet. What are these data? Does it make any sense that there could be a floor effect? Would it make sense that there could be different groups? How meaningful / surprising / interesting / important would it be if these were real? Do independent data exist / could we get them conveniently to perform an honest test of these possibilities? Etc.
|
What is the relationship between $Y$ and $X$ in this plot?
|
Here's my 2¢ 1.5¢. To me the most prominent feature is that the data abruptly stop and 'bunch up' at the bottom of the range of Y. I do see the two (potential) 'clusters' and the general negative as
|
What is the relationship between $Y$ and $X$ in this plot?
Here's my 2¢ 1.5¢. To me the most prominent feature is that the data abruptly stop and 'bunch up' at the bottom of the range of Y. I do see the two (potential) 'clusters' and the general negative association, but the most salient features are the (potential) floor effect and the fact that the top, low-density cluster only extends across part of the range of X.
Because the 'clusters' are vaguely bivariate normal, a parametric normal mixture model may be interesting to try. Using @Alexis' data, I find that three clusters optimize the BIC. The high-density 'floor effect' is picked out as a third cluster. The code follows:
library(mclust)
dframe = read.table(url("http://doyenne.com/personal/files/data.csv"), header=T, sep=",")
mc = Mclust(dframe)
summary(mc)
# ----------------------------------------------------
# Gaussian finite mixture model fitted by EM algorithm
# ----------------------------------------------------
#
# Mclust VVI (diagonal, varying volume and shape) model with 3 components:
#
# log.likelihood n df BIC ICL
# -614.4713 170 14 -1300.844 -1338.715
#
# Clustering table:
# 1 2 3
# 72 72 26
Now, what shall we infer from this? I do not think that Mclust is merely human pattern recognition gone awry. (Whereas my read of the scatterplot may well be.) On the other hand, there is no question that this is post-hoc. I saw what I thought might be an interesting pattern and so decided to check it. The algorithm does find something, but then I only checked for what I thought might be there so my thumb is definitely on the scale. Sometimes it is possible devise a strategy to mitigate against this (see @whuber's excellent answer here), but I have no idea how to go about such a process in cases like this. As a result, I take these results with a lot of salt (I've done this sort of thing sufficiently often that someone is missing a whole shaker). It does give me some material to think about and discuss with my client when next we meet. What are these data? Does it make any sense that there could be a floor effect? Would it make sense that there could be different groups? How meaningful / surprising / interesting / important would it be if these were real? Do independent data exist / could we get them conveniently to perform an honest test of these possibilities? Etc.
|
What is the relationship between $Y$ and $X$ in this plot?
Here's my 2¢ 1.5¢. To me the most prominent feature is that the data abruptly stop and 'bunch up' at the bottom of the range of Y. I do see the two (potential) 'clusters' and the general negative as
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.