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 |
|---|---|---|---|---|---|---|
33,901 | How can the F-test reject the null hypothesis while the KS test does not? | The F-test specifically examines for differences in variance and does not need to be sensitive to other differences such as mean. KS has to be sensitive to every kind of distributional difference, whether that difference is mean, variance, or multimodality.
Think of the F-test as a specialist that will be great at finding differences in variance at the expense of perhaps missing other differences. If all you want is to check for variance differences, use the test that specializes in variance differences. If your question is more broad, if there is any difference between the populations, then KS would be the more appropriate test. A drawback to KS is that it won’t tell you what that difference is, while an F test would signal a difference in variances (as a t-test would signal a difference in means).
You are correct that if your populations have different variances and F finds that while KS misses it, that is a type II error by KS. | How can the F-test reject the null hypothesis while the KS test does not? | The F-test specifically examines for differences in variance and does not need to be sensitive to other differences such as mean. KS has to be sensitive to every kind of distributional difference, whe | How can the F-test reject the null hypothesis while the KS test does not?
The F-test specifically examines for differences in variance and does not need to be sensitive to other differences such as mean. KS has to be sensitive to every kind of distributional difference, whether that difference is mean, variance, or multimodality.
Think of the F-test as a specialist that will be great at finding differences in variance at the expense of perhaps missing other differences. If all you want is to check for variance differences, use the test that specializes in variance differences. If your question is more broad, if there is any difference between the populations, then KS would be the more appropriate test. A drawback to KS is that it won’t tell you what that difference is, while an F test would signal a difference in variances (as a t-test would signal a difference in means).
You are correct that if your populations have different variances and F finds that while KS misses it, that is a type II error by KS. | How can the F-test reject the null hypothesis while the KS test does not?
The F-test specifically examines for differences in variance and does not need to be sensitive to other differences such as mean. KS has to be sensitive to every kind of distributional difference, whe |
33,902 | What makes linear regression with polynomial features curvy? | This is a piece of a plane in 3D.
Here is the same plane with coordinates shown and a set of points selected along its $x$ axis.
The third coordinate is used to plot the squares of these $x$ values, producing points along a parabola at the base of the coordinate box.
A vertical "curtain" through the parabola intersects the plane at all the points directly above the parabola. This intersection is a curve.
A polynomial model supposes the response $y$ (graphed in the vertical direction) differs from the height of this plane by random amounts. The values of $y$ corresponding to these $x$ coordinates are shown as red dots.
Consequently, the $(x,y)$ points lie along a curve--this projection--rather than a line, even though the model of the response is based on the plane originally shown.
Moral
When the explanatory variables clearly lie on a curve, the responses will appear to lie on a curve, too. | What makes linear regression with polynomial features curvy? | This is a piece of a plane in 3D.
Here is the same plane with coordinates shown and a set of points selected along its $x$ axis.
The third coordinate is used to plot the squares of these $x$ values, | What makes linear regression with polynomial features curvy?
This is a piece of a plane in 3D.
Here is the same plane with coordinates shown and a set of points selected along its $x$ axis.
The third coordinate is used to plot the squares of these $x$ values, producing points along a parabola at the base of the coordinate box.
A vertical "curtain" through the parabola intersects the plane at all the points directly above the parabola. This intersection is a curve.
A polynomial model supposes the response $y$ (graphed in the vertical direction) differs from the height of this plane by random amounts. The values of $y$ corresponding to these $x$ coordinates are shown as red dots.
Consequently, the $(x,y)$ points lie along a curve--this projection--rather than a line, even though the model of the response is based on the plane originally shown.
Moral
When the explanatory variables clearly lie on a curve, the responses will appear to lie on a curve, too. | What makes linear regression with polynomial features curvy?
This is a piece of a plane in 3D.
Here is the same plane with coordinates shown and a set of points selected along its $x$ axis.
The third coordinate is used to plot the squares of these $x$ values, |
33,903 | What makes linear regression with polynomial features curvy? | If you have a single independent variable x and a single dependent variable y, then "y = f(x)" is usually considered as two dimensional even if the relationship between these two variables is complicated. As a hypothetical example, if an experimental model is "pressure = a * temperature + b * log(temperature) - c * sine(temperature)" there are only two variables, temperature and pressure. For this reason, such a relationship could be plotted as a curved line on a flat plane.
If the model had two independent variables, such as "pressure = a * log(temperature) - b * exp(altitude)", this has the form of "z = f(x,y)" and could be plotted as a 3D surface. | What makes linear regression with polynomial features curvy? | If you have a single independent variable x and a single dependent variable y, then "y = f(x)" is usually considered as two dimensional even if the relationship between these two variables is complica | What makes linear regression with polynomial features curvy?
If you have a single independent variable x and a single dependent variable y, then "y = f(x)" is usually considered as two dimensional even if the relationship between these two variables is complicated. As a hypothetical example, if an experimental model is "pressure = a * temperature + b * log(temperature) - c * sine(temperature)" there are only two variables, temperature and pressure. For this reason, such a relationship could be plotted as a curved line on a flat plane.
If the model had two independent variables, such as "pressure = a * log(temperature) - b * exp(altitude)", this has the form of "z = f(x,y)" and could be plotted as a 3D surface. | What makes linear regression with polynomial features curvy?
If you have a single independent variable x and a single dependent variable y, then "y = f(x)" is usually considered as two dimensional even if the relationship between these two variables is complica |
33,904 | T-test, ANOVA or Regression, what's the difference? | ANOVA vs $t$-tests
With ANOVA, you generally first perform an omnibus test. This is a test against the null-hypothesis that all group means are equal ($\mu_1=\mu_2=\mu_3$).
Only if there is sufficient evidence against this hypothesis, a post-hoc analysis can be run which is very similar to using 3 pairwise $t$-tests to check for individual differences. The most commonly used is called Tukey's Honest Significant Difference (or Tukey's HSD) and it has two important differences with a series of $t$-tests:
It uses the studentized range distribution instead of the $t$-distribution for $p$-values / confidence intervals;
It corrects for multiple testing by default.
The latter is the important part: Since you are testing three hypotheses, you have an inflated chance of at least one false positive. Multiple testing correction can also be applied to three $t$-tests, but with the ANOVA + Tukey's HSD, this is done by default.
A third difference with separate $t$-tests is that you use all your data, not group per group. This can be advantageous, as it allows for easier diagnostics of the residuals. However, it also means you may have to resort to alternatives to the standard ANOVA in case variances are not approximately equal among groups, or another assumption is violated.
ANOVA vs Linear Regression
ANOVA is a linear regression with only additions to the intercept, no 'slopes' in the colloquial sense of the word. However, when you use linear regression with dummy variables for each of your three categories, you will achieve identical results in terms of parameter estimates.
The difference is in the hypotheses you would usually test with a linear regression. Remember, in ANOVA, the tests are: omnibus, then pairwise comparisons. In linear regression you usually test whether:
$\beta_0 = 0$, testing whether the intercept is significantly non-zero;
$\beta_j = 0$, where $j$ is each of your variables.
In case you only have one variable (group), one of its categories will become the intercept (i.e., the reference group). In that case, the tests performed by most statistical software will be:
Is the estimate for the reference group significantly non-zero?
Is the estimate for $(\text{group 1}) - (\text{reference group})$ significantly non-zero?
Is the estimate for $(\text{group 2}) - (\text{reference group})$ significantly non-zero?
This is nice if you have a clear reference group, because you can then simply ignore the (usually meaningless) intercept $p$-value and only correct the other two for multiple testing. This saves you some power, because you only correct for two tests instead of three.
So to summarize, if the group you call comparison is actually a control group, you might want to use linear regression instead of ANOVA. However, the three tests you say you want to do in your question resemble that of an ANOVA post-hoc or three pairwise $t$-tests. | T-test, ANOVA or Regression, what's the difference? | ANOVA vs $t$-tests
With ANOVA, you generally first perform an omnibus test. This is a test against the null-hypothesis that all group means are equal ($\mu_1=\mu_2=\mu_3$).
Only if there is sufficien | T-test, ANOVA or Regression, what's the difference?
ANOVA vs $t$-tests
With ANOVA, you generally first perform an omnibus test. This is a test against the null-hypothesis that all group means are equal ($\mu_1=\mu_2=\mu_3$).
Only if there is sufficient evidence against this hypothesis, a post-hoc analysis can be run which is very similar to using 3 pairwise $t$-tests to check for individual differences. The most commonly used is called Tukey's Honest Significant Difference (or Tukey's HSD) and it has two important differences with a series of $t$-tests:
It uses the studentized range distribution instead of the $t$-distribution for $p$-values / confidence intervals;
It corrects for multiple testing by default.
The latter is the important part: Since you are testing three hypotheses, you have an inflated chance of at least one false positive. Multiple testing correction can also be applied to three $t$-tests, but with the ANOVA + Tukey's HSD, this is done by default.
A third difference with separate $t$-tests is that you use all your data, not group per group. This can be advantageous, as it allows for easier diagnostics of the residuals. However, it also means you may have to resort to alternatives to the standard ANOVA in case variances are not approximately equal among groups, or another assumption is violated.
ANOVA vs Linear Regression
ANOVA is a linear regression with only additions to the intercept, no 'slopes' in the colloquial sense of the word. However, when you use linear regression with dummy variables for each of your three categories, you will achieve identical results in terms of parameter estimates.
The difference is in the hypotheses you would usually test with a linear regression. Remember, in ANOVA, the tests are: omnibus, then pairwise comparisons. In linear regression you usually test whether:
$\beta_0 = 0$, testing whether the intercept is significantly non-zero;
$\beta_j = 0$, where $j$ is each of your variables.
In case you only have one variable (group), one of its categories will become the intercept (i.e., the reference group). In that case, the tests performed by most statistical software will be:
Is the estimate for the reference group significantly non-zero?
Is the estimate for $(\text{group 1}) - (\text{reference group})$ significantly non-zero?
Is the estimate for $(\text{group 2}) - (\text{reference group})$ significantly non-zero?
This is nice if you have a clear reference group, because you can then simply ignore the (usually meaningless) intercept $p$-value and only correct the other two for multiple testing. This saves you some power, because you only correct for two tests instead of three.
So to summarize, if the group you call comparison is actually a control group, you might want to use linear regression instead of ANOVA. However, the three tests you say you want to do in your question resemble that of an ANOVA post-hoc or three pairwise $t$-tests. | T-test, ANOVA or Regression, what's the difference?
ANOVA vs $t$-tests
With ANOVA, you generally first perform an omnibus test. This is a test against the null-hypothesis that all group means are equal ($\mu_1=\mu_2=\mu_3$).
Only if there is sufficien |
33,905 | T-test, ANOVA or Regression, what's the difference? | paired t-test is only used when you have two groups. The name already says about the context in which it should be used. You should use ANOVA in this particular situation when you have more than two groups in the grouping variable. | T-test, ANOVA or Regression, what's the difference? | paired t-test is only used when you have two groups. The name already says about the context in which it should be used. You should use ANOVA in this particular situation when you have more than two g | T-test, ANOVA or Regression, what's the difference?
paired t-test is only used when you have two groups. The name already says about the context in which it should be used. You should use ANOVA in this particular situation when you have more than two groups in the grouping variable. | T-test, ANOVA or Regression, what's the difference?
paired t-test is only used when you have two groups. The name already says about the context in which it should be used. You should use ANOVA in this particular situation when you have more than two g |
33,906 | T-test, ANOVA or Regression, what's the difference? | I think another way of looking at the differences is that the regression model allows you to factor in other confounding factors while evaluating the treatment effect and testing for statistical significance while the t-test/ANOVA is simply evaluating the statistical significance assuming that there are no confounding factors (i.e. if we look at the distribution of the confounders between treatment vs. control vs other groups, the distributions are exactly the same). In general, I think the regression approach is the best but more complex to interpret and communicate to people.
ANOVA vs. t-test is just the difference between testing between two groups (e.g. control vs. treatment ) vs. more than two groups (control vs. treatment 1 vs. treatment 2...) ANOVA just tests the variance between groups vs. within the group and tests the hypothesis that there is one group that is statistically significantly different than other groups. | T-test, ANOVA or Regression, what's the difference? | I think another way of looking at the differences is that the regression model allows you to factor in other confounding factors while evaluating the treatment effect and testing for statistical signi | T-test, ANOVA or Regression, what's the difference?
I think another way of looking at the differences is that the regression model allows you to factor in other confounding factors while evaluating the treatment effect and testing for statistical significance while the t-test/ANOVA is simply evaluating the statistical significance assuming that there are no confounding factors (i.e. if we look at the distribution of the confounders between treatment vs. control vs other groups, the distributions are exactly the same). In general, I think the regression approach is the best but more complex to interpret and communicate to people.
ANOVA vs. t-test is just the difference between testing between two groups (e.g. control vs. treatment ) vs. more than two groups (control vs. treatment 1 vs. treatment 2...) ANOVA just tests the variance between groups vs. within the group and tests the hypothesis that there is one group that is statistically significantly different than other groups. | T-test, ANOVA or Regression, what's the difference?
I think another way of looking at the differences is that the regression model allows you to factor in other confounding factors while evaluating the treatment effect and testing for statistical signi |
33,907 | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally | Quite simple, just see:
$$V\left[(X - \mu)^2\right] = \sigma^4 V\left[\left(\frac{X - \mu}{\sigma}\right)^2\right]$$
$$=\sigma^4 V(Z^2)$$
where, $ Z \sim N(0, 1)$
So, $Z^2 \sim \chi^2_1$, $V(Z^2) = 2$ (Variance of chi-square is 2$v$, where $v$ is degree of freedom. ).
It complete our proof,
$$V\left[(X - \mu)^2\right] = 2 \sigma^4$$ | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally | Quite simple, just see:
$$V\left[(X - \mu)^2\right] = \sigma^4 V\left[\left(\frac{X - \mu}{\sigma}\right)^2\right]$$
$$=\sigma^4 V(Z^2)$$
where, $ Z \sim N(0, 1)$
So, $Z^2 \sim \chi^2_1$, $V(Z^2) = 2 | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally
Quite simple, just see:
$$V\left[(X - \mu)^2\right] = \sigma^4 V\left[\left(\frac{X - \mu}{\sigma}\right)^2\right]$$
$$=\sigma^4 V(Z^2)$$
where, $ Z \sim N(0, 1)$
So, $Z^2 \sim \chi^2_1$, $V(Z^2) = 2$ (Variance of chi-square is 2$v$, where $v$ is degree of freedom. ).
It complete our proof,
$$V\left[(X - \mu)^2\right] = 2 \sigma^4$$ | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally
Quite simple, just see:
$$V\left[(X - \mu)^2\right] = \sigma^4 V\left[\left(\frac{X - \mu}{\sigma}\right)^2\right]$$
$$=\sigma^4 V(Z^2)$$
where, $ Z \sim N(0, 1)$
So, $Z^2 \sim \chi^2_1$, $V(Z^2) = 2 |
33,908 | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally | The question is how to prove $\operatorname{var}\left( \left( \dfrac{X-\mu} \sigma \right)^2 \right) = 2$ when $X\sim\operatorname N(\mu,\sigma^2).$
We have $Z=\dfrac{X-\mu}\sigma \sim \operatorname N(0,1),$ so the problem is how to prove $\operatorname{var}(Z^2) = 2$ when $Z\sim\operatorname N(0,1).$
First note that
$$
\operatorname E(Z^2) = \operatorname E((Z-0)^2) = \operatorname E((Z-\operatorname E(Z))^2) = \operatorname{var}(Z) = 1.
$$
Then recall that
$$
\operatorname{var}(Z^2) = \operatorname E \Big( \big( Z^2\big)^2 \Big) - \left( \operatorname E(Z^2) \right)^2.
$$
Therefore
$$
\operatorname{var}(Z^2) = \operatorname E\left( Z^4\right) - 1.
$$
The problem then is to show that $\operatorname E(Z^4) = 3.$
\begin{align}
\operatorname E(Z^4) = {} & \int_{-\infty}^{+\infty} z^4 \varphi(z)\, dz \\
& \text{where $\varphi$ is the standard normal density} \\[10pt]
= {} & 2\int_0^{+\infty} z^4\varphi(z)\,dz \\[10pt]
= {} & 2\int_0^{+\infty} z^4 \cdot \frac 1 {\sqrt{2\pi}} e^{-z^2/2} \, dz \\[10pt]
= {} & \sqrt{\frac 2 \pi} \int_0^{+\infty} z^3 e^{-z^2/2} (z\,dz) \\[10pt]
= {} & \sqrt{\frac 2 \pi} \int_0^{+\infty} (\sqrt{2u\,\,}\,)^3 e^{-u} \, du \\[10pt]
= {} & \frac 4 {\sqrt\pi} \int_0^{+\infty} u^{3/2} e^{-u}\, du \\[10pt]
= {} & \frac 4 {\sqrt\pi} \Gamma\left( \frac 5 2\right) = \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot \frac 1 2 \cdot \Gamma\left( \frac 1 2 \right) \tag 1 \\[10pt]
= {} & \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot\frac 1 2 \cdot \sqrt\pi \tag 2 \\[10pt]
= {} & 3.
\end{align}
The work done on the line labeled $(1)$ can be justified by integrating by parts. What is done on line $(2)$ can be justified by an argument involving polar coordinates. Maybe I'll wait to see if there's popular demand before addressing those. | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally | The question is how to prove $\operatorname{var}\left( \left( \dfrac{X-\mu} \sigma \right)^2 \right) = 2$ when $X\sim\operatorname N(\mu,\sigma^2).$
We have $Z=\dfrac{X-\mu}\sigma \sim \operatorname N | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally
The question is how to prove $\operatorname{var}\left( \left( \dfrac{X-\mu} \sigma \right)^2 \right) = 2$ when $X\sim\operatorname N(\mu,\sigma^2).$
We have $Z=\dfrac{X-\mu}\sigma \sim \operatorname N(0,1),$ so the problem is how to prove $\operatorname{var}(Z^2) = 2$ when $Z\sim\operatorname N(0,1).$
First note that
$$
\operatorname E(Z^2) = \operatorname E((Z-0)^2) = \operatorname E((Z-\operatorname E(Z))^2) = \operatorname{var}(Z) = 1.
$$
Then recall that
$$
\operatorname{var}(Z^2) = \operatorname E \Big( \big( Z^2\big)^2 \Big) - \left( \operatorname E(Z^2) \right)^2.
$$
Therefore
$$
\operatorname{var}(Z^2) = \operatorname E\left( Z^4\right) - 1.
$$
The problem then is to show that $\operatorname E(Z^4) = 3.$
\begin{align}
\operatorname E(Z^4) = {} & \int_{-\infty}^{+\infty} z^4 \varphi(z)\, dz \\
& \text{where $\varphi$ is the standard normal density} \\[10pt]
= {} & 2\int_0^{+\infty} z^4\varphi(z)\,dz \\[10pt]
= {} & 2\int_0^{+\infty} z^4 \cdot \frac 1 {\sqrt{2\pi}} e^{-z^2/2} \, dz \\[10pt]
= {} & \sqrt{\frac 2 \pi} \int_0^{+\infty} z^3 e^{-z^2/2} (z\,dz) \\[10pt]
= {} & \sqrt{\frac 2 \pi} \int_0^{+\infty} (\sqrt{2u\,\,}\,)^3 e^{-u} \, du \\[10pt]
= {} & \frac 4 {\sqrt\pi} \int_0^{+\infty} u^{3/2} e^{-u}\, du \\[10pt]
= {} & \frac 4 {\sqrt\pi} \Gamma\left( \frac 5 2\right) = \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot \frac 1 2 \cdot \Gamma\left( \frac 1 2 \right) \tag 1 \\[10pt]
= {} & \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot\frac 1 2 \cdot \sqrt\pi \tag 2 \\[10pt]
= {} & 3.
\end{align}
The work done on the line labeled $(1)$ can be justified by integrating by parts. What is done on line $(2)$ can be justified by an argument involving polar coordinates. Maybe I'll wait to see if there's popular demand before addressing those. | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally
The question is how to prove $\operatorname{var}\left( \left( \dfrac{X-\mu} \sigma \right)^2 \right) = 2$ when $X\sim\operatorname N(\mu,\sigma^2).$
We have $Z=\dfrac{X-\mu}\sigma \sim \operatorname N |
33,909 | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally | Guide:
Some possible ingredients to solve the problem.
\begin{align}
\operatorname{Var}(Z) &= \operatorname E(Z^2)-E(Z)^2\\
\operatorname E((X_i-\mu)^p) &= \begin{cases} 0 & ,p\text{ is odd} \\
\sigma^p(p-1)!! & ,p\text{ is even}\end{cases}
\end{align}
where $n!!$ denotes the double factorial, that is, the product of all numbers
$n$ to $1$ that have the same parity as $n$. The moment formula is obtained from the wikipedia page. | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally | Guide:
Some possible ingredients to solve the problem.
\begin{align}
\operatorname{Var}(Z) &= \operatorname E(Z^2)-E(Z)^2\\
\operatorname E((X_i-\mu)^p) &= \begin{cases} 0 & ,p\text{ is odd} \\
\sigma | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally
Guide:
Some possible ingredients to solve the problem.
\begin{align}
\operatorname{Var}(Z) &= \operatorname E(Z^2)-E(Z)^2\\
\operatorname E((X_i-\mu)^p) &= \begin{cases} 0 & ,p\text{ is odd} \\
\sigma^p(p-1)!! & ,p\text{ is even}\end{cases}
\end{align}
where $n!!$ denotes the double factorial, that is, the product of all numbers
$n$ to $1$ that have the same parity as $n$. The moment formula is obtained from the wikipedia page. | How to derive $\operatorname{var}[(X_i−\mu)^2]=2\sigma^4$ where $X$ is distributed normally
Guide:
Some possible ingredients to solve the problem.
\begin{align}
\operatorname{Var}(Z) &= \operatorname E(Z^2)-E(Z)^2\\
\operatorname E((X_i-\mu)^p) &= \begin{cases} 0 & ,p\text{ is odd} \\
\sigma |
33,910 | Likelihood Function is Minimal Sufficient | Consider an observable data vector $\mathbf{x} = (x_1,...,x_n) \in \mathscr{X}$ with a joint-distribution that is indexed by the parameter $\theta \in \Theta$. It is possible to establish that "the likelihood function is minimal sufficient" in a sense described more specifically below.
Your misgivings here occur because you say that the likelihood is a function that depends on the parameter, and so we cannot calculate its value without the parameter. (This presumably means that it is not even a statistic, let alone a minimal sufficient statistic!) What you point out is true, but it misses the point, because the result asserted in your question is not that the value of the likelihood function at a particular point is minimal sufficient, but that the function is minimal sufficient. We will see below that when we talk about minimal sufficiency of "the likelihood function" we are really referring to the latter in its broadest sense, as a function of the data vector and the parameter.
The mapping from the support of the data to the likelihood function is a sufficient statistic: For a particular observed instance of the data vector $\mathbf{x}$, the likelihood function is the mapping $L_\mathbf{x}: \Theta \rightarrow [0, \infty)$. It is a mapping that maps each value of $\theta$ to a real output, but the function itself is fixed by the specified value of $\mathbf{x}$ and the domain $\Theta$. (This is just an instance where we have to be careful to distinguish a function from its value at a specific argument value.) Now, let $\mathscr{T} \equiv [0, \infty)^\Theta$ be the space of all mappings from the parameter space $\Theta$ to the non-negative real numbers. For each data vector $\mathbf{x} \in \mathscr{X}$ there is a corresponding likelihood function $L_\mathbf{x} \in \mathscr{T}$, and so we may consider that there is a mapping $T: \mathscr{X} \rightarrow \mathscr{T}$ that maps each possible observable data vector onto its corresponding likelihood function (i.e., we have $T(\mathbf{x}) = L_\mathbf{x}$). This mapping is "the likelihood function" in its broadest sense, where we have not yet specified the observed data vector.
You can see that this function $T$ is a mapping from the domain of possible data vectors to a fixed codomain, so it is a statistic. This is the sense in which we can consider the "likelihood function" to be a statistic. That is, the "likelihood function" can be considered as a statistic, if we have not yet specified the observed data vector (so that it is a function of this data vector), and we are looking at the object as a function of the parameter, rather than looking at an outcome value that accrues from a particular parameter value. With this elaboration, we now understand that the function $T$ is "the likelihood function" in this broadest sense.
Theorem 1: The function $T$ is sufficient for $\theta$.
Proof: For all $\theta \in \Theta$ we define the function $g_\theta : \mathscr{T} \rightarrow \mathbb{R}$ by $g_\theta(f) = f(\theta)$. Using the fact that the likelihood function is proportional to the sampling density, we can write the sampling density as:
$$\begin{equation} \begin{aligned}
f_\theta(\mathbf{x})
&= h(\mathbf{x}) L_\mathbf{x}(\theta) \\[6pt]
&= h(\mathbf{x}) g_\theta(L_\mathbf{x}) \\[6pt]
&= h(\mathbf{x}) g_\theta(T(\mathbf{x})). \\[6pt]
\end{aligned} \end{equation}$$
This establishes the Fisher-Neyman factorisation, which establishes the theorem. $\blacksquare$
Demonstrating minimal sufficiency: The above mapping $T$ is a sufficient statistic, but it is not generally minimal sufficient for $\theta$. To ensure minimal sufficiency, we need to narrow things down further than this, since the likelihood function is defined non-arbitrarily only up to proportionality. For this reason, if we want to get minimal sufficiency, we will need to consider two proportionate likelihood functions $L_\mathbf{x}$ and $L_{\mathbf{x}'}$ to be "the same" function. In the linked lecture notes, you will see that this is done by defining an equivalence relation $\sim$ as follows:
$$\mathbf{x} \sim \mathbf{x}'
\quad \quad \quad \quad\iff \quad \quad \quad \quad
L_\mathbf{x} \propto L_{\mathbf{x}'}.$$
This equivalence relation says that two likelihood functions $L_\mathbf{x}$ and $L_{\mathbf{x}'}$ are "the same" when proportionate. It induces a corresponding partition on $\mathscr{X}$ that separates the observable data vectors into sets that yield "the same" likelihood function (in the sense of proportionality).
Theorem 2: The partition $\sim$ is the minimal sufficient partition for $\theta$.
This theorem is left as an exercise in the linked lecture notes. Proof can be done by first establishing the sufficiency of the partition (which is assured by Theorem 1 above), and then showing that if you coarsen the partition, sufficiency is lost. Since this is set as an exercise in the notes for the current question, I will not prove the result here. Hopefully the above information gets you started, and more clearly establishes the statistic that you are dealing with.
The fact that the likelihood function (conceived as a statistic) is minimal sufficient, really should not be surprising. Indeed, it is practically a tautology, since sufficiency can be framed as a condition in terms of the likelihood function. Sufficiency means that the statistic captures all the required information about the indexing parameter. Since the likelihood is proportional to the sampling density, it is hardly surprising that it does this. Minimal sufficiency means that it does so without additional information, which is easily achieved by partitioning down to a level where the statistic/partition of interest is set by proportionality to the likelihood function.
The reason for the importance of minimal sufficiency is that every minimal sufficient statistic induces the same partition induced by the equivalence relation on the likelihood function. This means that every minimal sufficient statistic is a stand-in for the equivalence relation induced by proportionality of the likelihood function. | Likelihood Function is Minimal Sufficient | Consider an observable data vector $\mathbf{x} = (x_1,...,x_n) \in \mathscr{X}$ with a joint-distribution that is indexed by the parameter $\theta \in \Theta$. It is possible to establish that "the l | Likelihood Function is Minimal Sufficient
Consider an observable data vector $\mathbf{x} = (x_1,...,x_n) \in \mathscr{X}$ with a joint-distribution that is indexed by the parameter $\theta \in \Theta$. It is possible to establish that "the likelihood function is minimal sufficient" in a sense described more specifically below.
Your misgivings here occur because you say that the likelihood is a function that depends on the parameter, and so we cannot calculate its value without the parameter. (This presumably means that it is not even a statistic, let alone a minimal sufficient statistic!) What you point out is true, but it misses the point, because the result asserted in your question is not that the value of the likelihood function at a particular point is minimal sufficient, but that the function is minimal sufficient. We will see below that when we talk about minimal sufficiency of "the likelihood function" we are really referring to the latter in its broadest sense, as a function of the data vector and the parameter.
The mapping from the support of the data to the likelihood function is a sufficient statistic: For a particular observed instance of the data vector $\mathbf{x}$, the likelihood function is the mapping $L_\mathbf{x}: \Theta \rightarrow [0, \infty)$. It is a mapping that maps each value of $\theta$ to a real output, but the function itself is fixed by the specified value of $\mathbf{x}$ and the domain $\Theta$. (This is just an instance where we have to be careful to distinguish a function from its value at a specific argument value.) Now, let $\mathscr{T} \equiv [0, \infty)^\Theta$ be the space of all mappings from the parameter space $\Theta$ to the non-negative real numbers. For each data vector $\mathbf{x} \in \mathscr{X}$ there is a corresponding likelihood function $L_\mathbf{x} \in \mathscr{T}$, and so we may consider that there is a mapping $T: \mathscr{X} \rightarrow \mathscr{T}$ that maps each possible observable data vector onto its corresponding likelihood function (i.e., we have $T(\mathbf{x}) = L_\mathbf{x}$). This mapping is "the likelihood function" in its broadest sense, where we have not yet specified the observed data vector.
You can see that this function $T$ is a mapping from the domain of possible data vectors to a fixed codomain, so it is a statistic. This is the sense in which we can consider the "likelihood function" to be a statistic. That is, the "likelihood function" can be considered as a statistic, if we have not yet specified the observed data vector (so that it is a function of this data vector), and we are looking at the object as a function of the parameter, rather than looking at an outcome value that accrues from a particular parameter value. With this elaboration, we now understand that the function $T$ is "the likelihood function" in this broadest sense.
Theorem 1: The function $T$ is sufficient for $\theta$.
Proof: For all $\theta \in \Theta$ we define the function $g_\theta : \mathscr{T} \rightarrow \mathbb{R}$ by $g_\theta(f) = f(\theta)$. Using the fact that the likelihood function is proportional to the sampling density, we can write the sampling density as:
$$\begin{equation} \begin{aligned}
f_\theta(\mathbf{x})
&= h(\mathbf{x}) L_\mathbf{x}(\theta) \\[6pt]
&= h(\mathbf{x}) g_\theta(L_\mathbf{x}) \\[6pt]
&= h(\mathbf{x}) g_\theta(T(\mathbf{x})). \\[6pt]
\end{aligned} \end{equation}$$
This establishes the Fisher-Neyman factorisation, which establishes the theorem. $\blacksquare$
Demonstrating minimal sufficiency: The above mapping $T$ is a sufficient statistic, but it is not generally minimal sufficient for $\theta$. To ensure minimal sufficiency, we need to narrow things down further than this, since the likelihood function is defined non-arbitrarily only up to proportionality. For this reason, if we want to get minimal sufficiency, we will need to consider two proportionate likelihood functions $L_\mathbf{x}$ and $L_{\mathbf{x}'}$ to be "the same" function. In the linked lecture notes, you will see that this is done by defining an equivalence relation $\sim$ as follows:
$$\mathbf{x} \sim \mathbf{x}'
\quad \quad \quad \quad\iff \quad \quad \quad \quad
L_\mathbf{x} \propto L_{\mathbf{x}'}.$$
This equivalence relation says that two likelihood functions $L_\mathbf{x}$ and $L_{\mathbf{x}'}$ are "the same" when proportionate. It induces a corresponding partition on $\mathscr{X}$ that separates the observable data vectors into sets that yield "the same" likelihood function (in the sense of proportionality).
Theorem 2: The partition $\sim$ is the minimal sufficient partition for $\theta$.
This theorem is left as an exercise in the linked lecture notes. Proof can be done by first establishing the sufficiency of the partition (which is assured by Theorem 1 above), and then showing that if you coarsen the partition, sufficiency is lost. Since this is set as an exercise in the notes for the current question, I will not prove the result here. Hopefully the above information gets you started, and more clearly establishes the statistic that you are dealing with.
The fact that the likelihood function (conceived as a statistic) is minimal sufficient, really should not be surprising. Indeed, it is practically a tautology, since sufficiency can be framed as a condition in terms of the likelihood function. Sufficiency means that the statistic captures all the required information about the indexing parameter. Since the likelihood is proportional to the sampling density, it is hardly surprising that it does this. Minimal sufficiency means that it does so without additional information, which is easily achieved by partitioning down to a level where the statistic/partition of interest is set by proportionality to the likelihood function.
The reason for the importance of minimal sufficiency is that every minimal sufficient statistic induces the same partition induced by the equivalence relation on the likelihood function. This means that every minimal sufficient statistic is a stand-in for the equivalence relation induced by proportionality of the likelihood function. | Likelihood Function is Minimal Sufficient
Consider an observable data vector $\mathbf{x} = (x_1,...,x_n) \in \mathscr{X}$ with a joint-distribution that is indexed by the parameter $\theta \in \Theta$. It is possible to establish that "the l |
33,911 | Likelihood Function is Minimal Sufficient | There's an unobservable parameter, or a tuple of such parameters. Call it $\theta.$ The value of the likelihood function $L$ at $\theta$ is $L(\theta)$ and is similarly unobservable. It is not a statistic, let alone a sufficient statistic.
When it is said that the likelihood function $L$ is a minimal sufficient statistic, what is meant is not that the unobservable value $L(\theta)$ of the likelihood function at some unobservable value $\theta$ of the parameter is a minimal sufficient statistic, but rather that the function $L$ as a whole is a minimial sufficient statistic. The function $L$ is observable, in that you know which function it is, after computing it based on the data.
That it is a sufficient statistic means that for any two values $U,$ $V$ of the data, if the likelihood function given observations $U$ is the same as that given $V,$ then the conditional distribution of the data given which function $L$ is, is the same if the observed data are $V$ as if they are $U.$ | Likelihood Function is Minimal Sufficient | There's an unobservable parameter, or a tuple of such parameters. Call it $\theta.$ The value of the likelihood function $L$ at $\theta$ is $L(\theta)$ and is similarly unobservable. It is not a stati | Likelihood Function is Minimal Sufficient
There's an unobservable parameter, or a tuple of such parameters. Call it $\theta.$ The value of the likelihood function $L$ at $\theta$ is $L(\theta)$ and is similarly unobservable. It is not a statistic, let alone a sufficient statistic.
When it is said that the likelihood function $L$ is a minimal sufficient statistic, what is meant is not that the unobservable value $L(\theta)$ of the likelihood function at some unobservable value $\theta$ of the parameter is a minimal sufficient statistic, but rather that the function $L$ as a whole is a minimial sufficient statistic. The function $L$ is observable, in that you know which function it is, after computing it based on the data.
That it is a sufficient statistic means that for any two values $U,$ $V$ of the data, if the likelihood function given observations $U$ is the same as that given $V,$ then the conditional distribution of the data given which function $L$ is, is the same if the observed data are $V$ as if they are $U.$ | Likelihood Function is Minimal Sufficient
There's an unobservable parameter, or a tuple of such parameters. Call it $\theta.$ The value of the likelihood function $L$ at $\theta$ is $L(\theta)$ and is similarly unobservable. It is not a stati |
33,912 | Is it possible to combine predictions to improve overall prediction quality? | Short answer: Yes.
Long answer: This is one of many examples of a technique known as "stacking". While you can, of course, decide on some manual way to combine both predictions, it is even better if you train a third model on the output of the first two models (or even more). This will further improve the accuracy. To avoid re-using the data, often a different part of the data set is used for training the first levels, and training the model that combines the data.
See e.g. here for an example. | Is it possible to combine predictions to improve overall prediction quality? | Short answer: Yes.
Long answer: This is one of many examples of a technique known as "stacking". While you can, of course, decide on some manual way to combine both predictions, it is even better if y | Is it possible to combine predictions to improve overall prediction quality?
Short answer: Yes.
Long answer: This is one of many examples of a technique known as "stacking". While you can, of course, decide on some manual way to combine both predictions, it is even better if you train a third model on the output of the first two models (or even more). This will further improve the accuracy. To avoid re-using the data, often a different part of the data set is used for training the first levels, and training the model that combines the data.
See e.g. here for an example. | Is it possible to combine predictions to improve overall prediction quality?
Short answer: Yes.
Long answer: This is one of many examples of a technique known as "stacking". While you can, of course, decide on some manual way to combine both predictions, it is even better if y |
33,913 | Is it possible to combine predictions to improve overall prediction quality? | Yes.
The method you are talking about is called Stacking. It is a type of ensembling method. In this method, in the first stage multiple models are trained and the predictions are stored as features which will be used to train the second stage model. A lot of Kagglers use this method. Generally, you should use more than 2 models for the first stage while stacking (I generally use at least 4-5 models). There are also many methods in which stacking can be performed like simple averaging, majority voting etc. Here is a link to a kaggle kernel which implements stacking on the famous Titanic Dataset which is also a binary classification problem.
Kaggle Kernel Intro to Stacking using Titanic Dataset | Is it possible to combine predictions to improve overall prediction quality? | Yes.
The method you are talking about is called Stacking. It is a type of ensembling method. In this method, in the first stage multiple models are trained and the predictions are stored as features | Is it possible to combine predictions to improve overall prediction quality?
Yes.
The method you are talking about is called Stacking. It is a type of ensembling method. In this method, in the first stage multiple models are trained and the predictions are stored as features which will be used to train the second stage model. A lot of Kagglers use this method. Generally, you should use more than 2 models for the first stage while stacking (I generally use at least 4-5 models). There are also many methods in which stacking can be performed like simple averaging, majority voting etc. Here is a link to a kaggle kernel which implements stacking on the famous Titanic Dataset which is also a binary classification problem.
Kaggle Kernel Intro to Stacking using Titanic Dataset | Is it possible to combine predictions to improve overall prediction quality?
Yes.
The method you are talking about is called Stacking. It is a type of ensembling method. In this method, in the first stage multiple models are trained and the predictions are stored as features |
33,914 | Multivariate vs Multiple time series | Multiple time series is just that: Multiple series instead of a single series.
Multivariate time series is usually contrasted with univariate time series, where each observation at a time $t$ is a vector of values instead of a single value. Typically for such series, the variables in the vector are closely interrelated, which is why we consider them to be single observation in vector form instead of distinct observations from separate time series.
To better explain the difference consider the following examples:
We want to monitor weight for a group of patients: This would be multiple time series, i.e. the daily weight values for each patient is a separate time series.
We want to monitor the health of a single patient, so we keep track of the patient's daily weight, daily body temperature, daily blood pressure, daily cholesterol levels, etc...: This would be a multivariate time series. | Multivariate vs Multiple time series | Multiple time series is just that: Multiple series instead of a single series.
Multivariate time series is usually contrasted with univariate time series, where each observation at a time $t$ is a ve | Multivariate vs Multiple time series
Multiple time series is just that: Multiple series instead of a single series.
Multivariate time series is usually contrasted with univariate time series, where each observation at a time $t$ is a vector of values instead of a single value. Typically for such series, the variables in the vector are closely interrelated, which is why we consider them to be single observation in vector form instead of distinct observations from separate time series.
To better explain the difference consider the following examples:
We want to monitor weight for a group of patients: This would be multiple time series, i.e. the daily weight values for each patient is a separate time series.
We want to monitor the health of a single patient, so we keep track of the patient's daily weight, daily body temperature, daily blood pressure, daily cholesterol levels, etc...: This would be a multivariate time series. | Multivariate vs Multiple time series
Multiple time series is just that: Multiple series instead of a single series.
Multivariate time series is usually contrasted with univariate time series, where each observation at a time $t$ is a ve |
33,915 | Multivariate vs Multiple time series | Multivariate regression models: Pertaining to multiple dependent variables.
Multiple regression models: Pertaining to multiple independent variables.
Time series: Pertaining to repeated measurements of the same variables over time (typically with many repetitions).
These can be combined, for example multiple multivariate regression models of time series data. | Multivariate vs Multiple time series | Multivariate regression models: Pertaining to multiple dependent variables.
Multiple regression models: Pertaining to multiple independent variables.
Time series: Pertaining to repeated measurements o | Multivariate vs Multiple time series
Multivariate regression models: Pertaining to multiple dependent variables.
Multiple regression models: Pertaining to multiple independent variables.
Time series: Pertaining to repeated measurements of the same variables over time (typically with many repetitions).
These can be combined, for example multiple multivariate regression models of time series data. | Multivariate vs Multiple time series
Multivariate regression models: Pertaining to multiple dependent variables.
Multiple regression models: Pertaining to multiple independent variables.
Time series: Pertaining to repeated measurements o |
33,916 | In R, test whether coefficients in lm are different each to a given value (other than zero) | Rather than using anova() to carry out the F test, you can also use summary() to get the marginal Wald tests for each coefficient. So it is easy to simply include the entire offset of all terms and then use summary(). Here, I use some artificial data with coefficients as suggested in your post:
set.seed(1)
d <- data.frame(
x1 = runif(100, -1, 1),
x2 = runif(100, -1, 1),
x3 = runif(100, -1, 1)
)
d$y <- 3 + 10 * d$x1 + 9 * d$x2 + 4 * d$x3 + rnorm(100)
m <- lm(y ~ x1 + x2 + x3, data = d,
offset = 3 + 10 * x1 + 9 * x2 + 4 * x3)
summary(m)
## Call:
## lm(formula = y ~ x1 + x2 + x3, data = d, offset = 3 + 10 * x1 +
## 9 * x2 + 4 * x3)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.00507 -0.67884 -0.08825 0.68643 2.55013
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.03520 0.10947 0.322 0.748
## x1 -0.09123 0.20091 -0.454 0.651
## x2 -0.19222 0.19572 -0.982 0.329
## x3 0.01885 0.19285 0.098 0.922
##
## Residual standard error: 1.058 on 96 degrees of freedom
## Multiple R-squared: 0.9824, Adjusted R-squared: 0.9818
## F-statistic: 1784 on 3 and 96 DF, p-value: < 2.2e-16
Another convenient option to conduct these tests of linear hypotheses is the linearHypothesis() function from the car package. This can replicate both the marginal Wald tests:
library("car")
m2 <- lm(y ~ x1 + x2 + x3, data = d)
linearHypothesis(m2, "(Intercept) = 3")
## Linear hypothesis test
##
## Hypothesis:
## (Intercept) = 3
##
## Model 1: restricted model
## Model 2: y ~ x1 + x2 + x3
##
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 97 107.67
## 2 96 107.55 1 0.11586 0.1034 0.7485
...
linearHypothesis(m2, "x3 = 4")
## Linear hypothesis test
##
## Hypothesis:
## x3 = 4
##
## Model 1: restricted model
## Model 2: y ~ x1 + x2 + x3
##
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 97 107.56
## 2 96 107.55 1 0.0107 0.0096 0.9224
And it can also conduct the F test of all coefficients:
linearHypothesis(m2,
c("(Intercept) = 3", "x1 = 10", "x2 = 9", "x3 = 4"))
## Linear hypothesis test
##
## Hypothesis:
## (Intercept) = 3
## x1 = 10
## x2 = 9
## x3 = 4
##
## Model 1: restricted model
## Model 2: y ~ x1 + x2 + x3
##
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 100 108.93
## 2 96 107.55 4 1.3802 0.308 0.872 | In R, test whether coefficients in lm are different each to a given value (other than zero) | Rather than using anova() to carry out the F test, you can also use summary() to get the marginal Wald tests for each coefficient. So it is easy to simply include the entire offset of all terms and th | In R, test whether coefficients in lm are different each to a given value (other than zero)
Rather than using anova() to carry out the F test, you can also use summary() to get the marginal Wald tests for each coefficient. So it is easy to simply include the entire offset of all terms and then use summary(). Here, I use some artificial data with coefficients as suggested in your post:
set.seed(1)
d <- data.frame(
x1 = runif(100, -1, 1),
x2 = runif(100, -1, 1),
x3 = runif(100, -1, 1)
)
d$y <- 3 + 10 * d$x1 + 9 * d$x2 + 4 * d$x3 + rnorm(100)
m <- lm(y ~ x1 + x2 + x3, data = d,
offset = 3 + 10 * x1 + 9 * x2 + 4 * x3)
summary(m)
## Call:
## lm(formula = y ~ x1 + x2 + x3, data = d, offset = 3 + 10 * x1 +
## 9 * x2 + 4 * x3)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.00507 -0.67884 -0.08825 0.68643 2.55013
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.03520 0.10947 0.322 0.748
## x1 -0.09123 0.20091 -0.454 0.651
## x2 -0.19222 0.19572 -0.982 0.329
## x3 0.01885 0.19285 0.098 0.922
##
## Residual standard error: 1.058 on 96 degrees of freedom
## Multiple R-squared: 0.9824, Adjusted R-squared: 0.9818
## F-statistic: 1784 on 3 and 96 DF, p-value: < 2.2e-16
Another convenient option to conduct these tests of linear hypotheses is the linearHypothesis() function from the car package. This can replicate both the marginal Wald tests:
library("car")
m2 <- lm(y ~ x1 + x2 + x3, data = d)
linearHypothesis(m2, "(Intercept) = 3")
## Linear hypothesis test
##
## Hypothesis:
## (Intercept) = 3
##
## Model 1: restricted model
## Model 2: y ~ x1 + x2 + x3
##
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 97 107.67
## 2 96 107.55 1 0.11586 0.1034 0.7485
...
linearHypothesis(m2, "x3 = 4")
## Linear hypothesis test
##
## Hypothesis:
## x3 = 4
##
## Model 1: restricted model
## Model 2: y ~ x1 + x2 + x3
##
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 97 107.56
## 2 96 107.55 1 0.0107 0.0096 0.9224
And it can also conduct the F test of all coefficients:
linearHypothesis(m2,
c("(Intercept) = 3", "x1 = 10", "x2 = 9", "x3 = 4"))
## Linear hypothesis test
##
## Hypothesis:
## (Intercept) = 3
## x1 = 10
## x2 = 9
## x3 = 4
##
## Model 1: restricted model
## Model 2: y ~ x1 + x2 + x3
##
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 100 108.93
## 2 96 107.55 4 1.3802 0.308 0.872 | In R, test whether coefficients in lm are different each to a given value (other than zero)
Rather than using anova() to carry out the F test, you can also use summary() to get the marginal Wald tests for each coefficient. So it is easy to simply include the entire offset of all terms and th |
33,917 | In R, test whether coefficients in lm are different each to a given value (other than zero) | It's not clear what your confusion is... but the model
$$Y = X \beta + Z \gamma + \varepsilon$$
Can be equivalently expressed as
$$\left( Y - X\beta^0 \right) = X \left( \beta - \beta^0 \right) + Z\gamma + \varepsilon$$
If we're trying to directly test that $\beta = \beta^0$. | In R, test whether coefficients in lm are different each to a given value (other than zero) | It's not clear what your confusion is... but the model
$$Y = X \beta + Z \gamma + \varepsilon$$
Can be equivalently expressed as
$$\left( Y - X\beta^0 \right) = X \left( \beta - \beta^0 \right) + Z\g | In R, test whether coefficients in lm are different each to a given value (other than zero)
It's not clear what your confusion is... but the model
$$Y = X \beta + Z \gamma + \varepsilon$$
Can be equivalently expressed as
$$\left( Y - X\beta^0 \right) = X \left( \beta - \beta^0 \right) + Z\gamma + \varepsilon$$
If we're trying to directly test that $\beta = \beta^0$. | In R, test whether coefficients in lm are different each to a given value (other than zero)
It's not clear what your confusion is... but the model
$$Y = X \beta + Z \gamma + \varepsilon$$
Can be equivalently expressed as
$$\left( Y - X\beta^0 \right) = X \left( \beta - \beta^0 \right) + Z\g |
33,918 | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I think this FT version of similar data serves as a decent answer about how to present the data fairly.
Rather than absolutes on a 0 - 100 scale, it zooms in to focus on the change. The lines help verify the pattern which is hard to assess on the points alone because of all the overstriking. (How many of the 1070 wards can you make out in the original?) | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I think this FT version of similar data serves as a decent answer about how to present the data fairly.
Rather than absolutes on a 0 - 100 scale, it zooms in to focus on the change. The lines help ve | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I think this FT version of similar data serves as a decent answer about how to present the data fairly.
Rather than absolutes on a 0 - 100 scale, it zooms in to focus on the change. The lines help verify the pattern which is hard to assess on the points alone because of all the overstriking. (How many of the 1070 wards can you make out in the original?) | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I think this FT version of similar data serves as a decent answer about how to present the data fairly.
Rather than absolutes on a 0 - 100 scale, it zooms in to focus on the change. The lines help ve |
33,919 | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I agree that coloring the quadrants pink is largely cosmetic, but overall I view this as a clear informative plot. The message is immediately apparent and is not misleading. The BBC has plotted the actual data points. They have not manipulated the x or y axes. The annotation on the plot is correct and not over-stated. They have not added spurious trend lines or any other unnecessary interpretation. Compared to most data figures presented in the media, this plot is excellent -- it is quite a good example of letting the data speak for itself. In short, I think you're over-thinking it. I don't doubt that you can find some ways to improve the plot, but simple is usually best. | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I agree that coloring the quadrants pink is largely cosmetic, but overall I view this as a clear informative plot. The message is immediately apparent and is not misleading. The BBC has plotted the ac | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I agree that coloring the quadrants pink is largely cosmetic, but overall I view this as a clear informative plot. The message is immediately apparent and is not misleading. The BBC has plotted the actual data points. They have not manipulated the x or y axes. The annotation on the plot is correct and not over-stated. They have not added spurious trend lines or any other unnecessary interpretation. Compared to most data figures presented in the media, this plot is excellent -- it is quite a good example of letting the data speak for itself. In short, I think you're over-thinking it. I don't doubt that you can find some ways to improve the plot, but simple is usually best. | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I agree that coloring the quadrants pink is largely cosmetic, but overall I view this as a clear informative plot. The message is immediately apparent and is not misleading. The BBC has plotted the ac |
33,920 | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I agree that the graph is misleading in a sense that it purports to show that there are no data points in the quadrant categorically described as high leave vote %, high % of graduates. What is high and low becomes relative to the axis limits, not the actual data. While theoretically possible to have a ward with population that is 100% college educated, such ward doesn't exist. You don't need to invent data points to produce a misleading graph: a broken axis showing exaggerated change is an example that not too dissimilar to this one.
A more objective way to visualise this data would be to set the scatter plot axis limits at the max / min of the data and then divide the chart into quadrants of an equal area.
The reason I would go for the equal area of quadrants is so that the quadrants show an equivalent linear relationship between variables. The categorical descriptions of the quadrants, "high" and "low" are treated as equivalent so the areas should be as well.
If instead we want to use quadrants as another way to quantitatively describe data, we could set the quadrant borders at the average of each variable as shown in Data Visualisation with R: 100 examples (available to preview on Google Books, p283,286).
To add another analytical layer to a scatter plot visualisation, we can use colour and size of the dots. For example, colour can used to separate university towns from the rest, show voter turnout in a gradient or highlight General Election results for those wards. I'm not sure if size will be effective with so many data points, but you can potentially investigate different population bands, such as 65+, and how they are represented in the data.
To my mind there are also two important caveats worth bearing in mind when looking at this graph: first, that it counts all graduates, regardless of whether they voted in the referendum or not, and secondly, that it includes resident graduates with EU passports who couldn't vote in the referendum (assuming the source data is Census-based). | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I agree that the graph is misleading in a sense that it purports to show that there are no data points in the quadrant categorically described as high leave vote %, high % of graduates. What is high a | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I agree that the graph is misleading in a sense that it purports to show that there are no data points in the quadrant categorically described as high leave vote %, high % of graduates. What is high and low becomes relative to the axis limits, not the actual data. While theoretically possible to have a ward with population that is 100% college educated, such ward doesn't exist. You don't need to invent data points to produce a misleading graph: a broken axis showing exaggerated change is an example that not too dissimilar to this one.
A more objective way to visualise this data would be to set the scatter plot axis limits at the max / min of the data and then divide the chart into quadrants of an equal area.
The reason I would go for the equal area of quadrants is so that the quadrants show an equivalent linear relationship between variables. The categorical descriptions of the quadrants, "high" and "low" are treated as equivalent so the areas should be as well.
If instead we want to use quadrants as another way to quantitatively describe data, we could set the quadrant borders at the average of each variable as shown in Data Visualisation with R: 100 examples (available to preview on Google Books, p283,286).
To add another analytical layer to a scatter plot visualisation, we can use colour and size of the dots. For example, colour can used to separate university towns from the rest, show voter turnout in a gradient or highlight General Election results for those wards. I'm not sure if size will be effective with so many data points, but you can potentially investigate different population bands, such as 65+, and how they are represented in the data.
To my mind there are also two important caveats worth bearing in mind when looking at this graph: first, that it counts all graduates, regardless of whether they voted in the referendum or not, and secondly, that it includes resident graduates with EU passports who couldn't vote in the referendum (assuming the source data is Census-based). | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I agree that the graph is misleading in a sense that it purports to show that there are no data points in the quadrant categorically described as high leave vote %, high % of graduates. What is high a |
33,921 | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I agree, very misleading. I'd eliminate the colored background all together.
If you insist on coloring it, perhaps a gradient corresponding to population density? This is, the background color gets darker as more wards fall in the "educated vs leave" category
There is definitely a trend, I don't think anyone would argue against that- maybe the author should stick with a trendline of some sort? | How should this BBC chart (Brexit correlation between education and results) have been drawn? | I agree, very misleading. I'd eliminate the colored background all together.
If you insist on coloring it, perhaps a gradient corresponding to population density? This is, the background color gets | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I agree, very misleading. I'd eliminate the colored background all together.
If you insist on coloring it, perhaps a gradient corresponding to population density? This is, the background color gets darker as more wards fall in the "educated vs leave" category
There is definitely a trend, I don't think anyone would argue against that- maybe the author should stick with a trendline of some sort? | How should this BBC chart (Brexit correlation between education and results) have been drawn?
I agree, very misleading. I'd eliminate the colored background all together.
If you insist on coloring it, perhaps a gradient corresponding to population density? This is, the background color gets |
33,922 | Book about statistics lighter than academic ones | Dicing with Death by Stephen Senn focuses on medical statistics and is a lot more mathematical than The Signal and the Noise. I liked it but it does contain quite a lot of typos.
The Lady Tasting Tea covers a lot more ground than I expected and is one of the most open-minded statistics books that I have read. Although it is not at all mathematical, it does introduce a lot of interesting topics.
Symbols, Signals and Noise by Pierce is very cheap, easy to read and contains a lot of equations. It sounds like a great fit but is quite old (it's published as a Dover reprint.)
If your friend is interested in history, Games, Gods and Gambling by Florence Nightingale David is an account of the early history of statistics that is very heavy on the mathematics. I much prefer her writing to Stigler, but it's not really pop-sci, so maybe not suitable for your friend. | Book about statistics lighter than academic ones | Dicing with Death by Stephen Senn focuses on medical statistics and is a lot more mathematical than The Signal and the Noise. I liked it but it does contain quite a lot of typos.
The Lady Tasting Tea | Book about statistics lighter than academic ones
Dicing with Death by Stephen Senn focuses on medical statistics and is a lot more mathematical than The Signal and the Noise. I liked it but it does contain quite a lot of typos.
The Lady Tasting Tea covers a lot more ground than I expected and is one of the most open-minded statistics books that I have read. Although it is not at all mathematical, it does introduce a lot of interesting topics.
Symbols, Signals and Noise by Pierce is very cheap, easy to read and contains a lot of equations. It sounds like a great fit but is quite old (it's published as a Dover reprint.)
If your friend is interested in history, Games, Gods and Gambling by Florence Nightingale David is an account of the early history of statistics that is very heavy on the mathematics. I much prefer her writing to Stigler, but it's not really pop-sci, so maybe not suitable for your friend. | Book about statistics lighter than academic ones
Dicing with Death by Stephen Senn focuses on medical statistics and is a lot more mathematical than The Signal and the Noise. I liked it but it does contain quite a lot of typos.
The Lady Tasting Tea |
33,923 | Book about statistics lighter than academic ones | On the lighter side of things?
Statistics Done Wrong: The Woefully Complete Guide Is a fun title on, well, the title is self explanatory.
In the same vain, a classic is How to Lie With Statistics. Similar-ish but with a slight Freakonomics vibe is Naked Statistics: Stripping the Dread from the Data | Book about statistics lighter than academic ones | On the lighter side of things?
Statistics Done Wrong: The Woefully Complete Guide Is a fun title on, well, the title is self explanatory.
In the same vain, a classic is How to Lie With Statistics. Sim | Book about statistics lighter than academic ones
On the lighter side of things?
Statistics Done Wrong: The Woefully Complete Guide Is a fun title on, well, the title is self explanatory.
In the same vain, a classic is How to Lie With Statistics. Similar-ish but with a slight Freakonomics vibe is Naked Statistics: Stripping the Dread from the Data | Book about statistics lighter than academic ones
On the lighter side of things?
Statistics Done Wrong: The Woefully Complete Guide Is a fun title on, well, the title is self explanatory.
In the same vain, a classic is How to Lie With Statistics. Sim |
33,924 | Book about statistics lighter than academic ones | Not at all mathematical, but certainly has some statistical elements:
Kahneman, D. (2011) Thinking, Fast and Slow
It's 5 years old so the person might just have read it but if they have not they might find it valuable. | Book about statistics lighter than academic ones | Not at all mathematical, but certainly has some statistical elements:
Kahneman, D. (2011) Thinking, Fast and Slow
It's 5 years old so the person might just have read it but if they have not they might | Book about statistics lighter than academic ones
Not at all mathematical, but certainly has some statistical elements:
Kahneman, D. (2011) Thinking, Fast and Slow
It's 5 years old so the person might just have read it but if they have not they might find it valuable. | Book about statistics lighter than academic ones
Not at all mathematical, but certainly has some statistical elements:
Kahneman, D. (2011) Thinking, Fast and Slow
It's 5 years old so the person might just have read it but if they have not they might |
33,925 | Book about statistics lighter than academic ones | THE ACCIDENTAL STATISTICIAN an autobiography of G.E.P Box makes great (light) reading. It is not as heavy as the Ellenburg book which I just loved but enjoyable none the less as it describes the paths taken by all when trying to make sense out of numbers. | Book about statistics lighter than academic ones | THE ACCIDENTAL STATISTICIAN an autobiography of G.E.P Box makes great (light) reading. It is not as heavy as the Ellenburg book which I just loved but enjoyable none the less as it describes the paths | Book about statistics lighter than academic ones
THE ACCIDENTAL STATISTICIAN an autobiography of G.E.P Box makes great (light) reading. It is not as heavy as the Ellenburg book which I just loved but enjoyable none the less as it describes the paths taken by all when trying to make sense out of numbers. | Book about statistics lighter than academic ones
THE ACCIDENTAL STATISTICIAN an autobiography of G.E.P Box makes great (light) reading. It is not as heavy as the Ellenburg book which I just loved but enjoyable none the less as it describes the paths |
33,926 | Book about statistics lighter than academic ones | The History of Statistics: The Measurement of Uncertainty before 1900 by Stephen M. Stigler
I never read it back-to-back, just used it few times as a reference, but it's a nice book that could be interesting for a wide variety of readers. | Book about statistics lighter than academic ones | The History of Statistics: The Measurement of Uncertainty before 1900 by Stephen M. Stigler
I never read it back-to-back, just used it few times as a reference, but it's a nice book that could be inte | Book about statistics lighter than academic ones
The History of Statistics: The Measurement of Uncertainty before 1900 by Stephen M. Stigler
I never read it back-to-back, just used it few times as a reference, but it's a nice book that could be interesting for a wide variety of readers. | Book about statistics lighter than academic ones
The History of Statistics: The Measurement of Uncertainty before 1900 by Stephen M. Stigler
I never read it back-to-back, just used it few times as a reference, but it's a nice book that could be inte |
33,927 | Book about statistics lighter than academic ones | For a physics flavor, Anomaly!, by Tommaso Dorigo is about the "discovery" of anomalous signals at several particle physics colliers in the 1990s, and the study of whether these were discoveries of new physics or statistical/methodological flukes. It is a bit pricey, however. | Book about statistics lighter than academic ones | For a physics flavor, Anomaly!, by Tommaso Dorigo is about the "discovery" of anomalous signals at several particle physics colliers in the 1990s, and the study of whether these were discoveries of ne | Book about statistics lighter than academic ones
For a physics flavor, Anomaly!, by Tommaso Dorigo is about the "discovery" of anomalous signals at several particle physics colliers in the 1990s, and the study of whether these were discoveries of new physics or statistical/methodological flukes. It is a bit pricey, however. | Book about statistics lighter than academic ones
For a physics flavor, Anomaly!, by Tommaso Dorigo is about the "discovery" of anomalous signals at several particle physics colliers in the 1990s, and the study of whether these were discoveries of ne |
33,928 | Book about statistics lighter than academic ones | Sharon Bertsch McGrayne, The Theory That Would Not Die: How Bayes' Rule Cracked the Enigma Code, Hunted Down Russian Submarines, and Emerged Triumphant from Two Centuries of Controversy
Bayes' rule appears to be a straightforward, one-line theorem: by updating our initial beliefs with objective new information, we get a new and improved belief. To its adherents, it is an elegant statement about learning from experience. To its opponents, it is subjectivity run amok.
In the first-ever account of Bayes' rule for general readers, Sharon Bertsch McGrayne explores this controversial theorem and the human obsessions surrounding it. She traces its discovery by an amateur mathematician in the 1740s through its development into roughly its modern form by French scientist Pierre Simon Laplace. She reveals why respected statisticians rendered it professionally taboo for 150 years—at the same time that practitioners relied on it to solve crises involving great uncertainty and scanty information (Alan Turing's role in breaking Germany's Enigma code during World War II), and explains how the advent of off-the-shelf computer technology in the 1980s proved to be a game-changer. Today, Bayes' rule is used everywhere from DNA de-coding to Homeland Security.
Drawing on primary source material and interviews with statisticians and other scientists, The Theory That Would Not Die is the riveting account of how a seemingly simple theorem ignited one of the greatest controversies of all time. | Book about statistics lighter than academic ones | Sharon Bertsch McGrayne, The Theory That Would Not Die: How Bayes' Rule Cracked the Enigma Code, Hunted Down Russian Submarines, and Emerged Triumphant from Two Centuries of Controversy
Bayes' rule a | Book about statistics lighter than academic ones
Sharon Bertsch McGrayne, The Theory That Would Not Die: How Bayes' Rule Cracked the Enigma Code, Hunted Down Russian Submarines, and Emerged Triumphant from Two Centuries of Controversy
Bayes' rule appears to be a straightforward, one-line theorem: by updating our initial beliefs with objective new information, we get a new and improved belief. To its adherents, it is an elegant statement about learning from experience. To its opponents, it is subjectivity run amok.
In the first-ever account of Bayes' rule for general readers, Sharon Bertsch McGrayne explores this controversial theorem and the human obsessions surrounding it. She traces its discovery by an amateur mathematician in the 1740s through its development into roughly its modern form by French scientist Pierre Simon Laplace. She reveals why respected statisticians rendered it professionally taboo for 150 years—at the same time that practitioners relied on it to solve crises involving great uncertainty and scanty information (Alan Turing's role in breaking Germany's Enigma code during World War II), and explains how the advent of off-the-shelf computer technology in the 1980s proved to be a game-changer. Today, Bayes' rule is used everywhere from DNA de-coding to Homeland Security.
Drawing on primary source material and interviews with statisticians and other scientists, The Theory That Would Not Die is the riveting account of how a seemingly simple theorem ignited one of the greatest controversies of all time. | Book about statistics lighter than academic ones
Sharon Bertsch McGrayne, The Theory That Would Not Die: How Bayes' Rule Cracked the Enigma Code, Hunted Down Russian Submarines, and Emerged Triumphant from Two Centuries of Controversy
Bayes' rule a |
33,929 | Pattern detection in scatter plot | Just to elaborate on my comment, here's an example of how your apparent pattern could be an artifact caused by the distribution of data along the x-axis. I generated 100,000 data points. They're normally distributed in the x-axis ($\mu = 2500, \sigma =600$) and exponentially distributed in the y-axis ($\lambda = 1$).
Following the "visual envelope" of the scatter plot, there's a clear, although illusory, pattern: y looks maximal in the range 1000< x<4000. However, this apparent pattern, very convincing visually, is just an artifact caused by the distribution of x values. That is, there's just more data in the range 1000< x<4000. You can see this in the x-histogram on the bottom.
To prove it, I calculated the average y value in bins of x (black line). This is approximately constant for all x. If the data was distributed according to our intuition from the scatter plot, the average in the 1000< x<4000 range should be higher than the rest - but it's not. So there really is no pattern.
I'm not saying this is the whole story with your data. But I would bet it's a partial explanation.
Addendum with actual Donors Choose data.
Original scatterplot with overstriking markers:
Same scatterplot with reduced opacity:
Different patterns appear, but with 800K data points, there is still a lot of detail lost to overstriking.
Zoom, reduce opacity again and add smoother: | Pattern detection in scatter plot | Just to elaborate on my comment, here's an example of how your apparent pattern could be an artifact caused by the distribution of data along the x-axis. I generated 100,000 data points. They're norma | Pattern detection in scatter plot
Just to elaborate on my comment, here's an example of how your apparent pattern could be an artifact caused by the distribution of data along the x-axis. I generated 100,000 data points. They're normally distributed in the x-axis ($\mu = 2500, \sigma =600$) and exponentially distributed in the y-axis ($\lambda = 1$).
Following the "visual envelope" of the scatter plot, there's a clear, although illusory, pattern: y looks maximal in the range 1000< x<4000. However, this apparent pattern, very convincing visually, is just an artifact caused by the distribution of x values. That is, there's just more data in the range 1000< x<4000. You can see this in the x-histogram on the bottom.
To prove it, I calculated the average y value in bins of x (black line). This is approximately constant for all x. If the data was distributed according to our intuition from the scatter plot, the average in the 1000< x<4000 range should be higher than the rest - but it's not. So there really is no pattern.
I'm not saying this is the whole story with your data. But I would bet it's a partial explanation.
Addendum with actual Donors Choose data.
Original scatterplot with overstriking markers:
Same scatterplot with reduced opacity:
Different patterns appear, but with 800K data points, there is still a lot of detail lost to overstriking.
Zoom, reduce opacity again and add smoother: | Pattern detection in scatter plot
Just to elaborate on my comment, here's an example of how your apparent pattern could be an artifact caused by the distribution of data along the x-axis. I generated 100,000 data points. They're norma |
33,930 | Pattern detection in scatter plot | I would guess your variable on Y axis is exponentially distributed ($p(y) = \lambda e^{-\lambda y}$), but it seems that the rate parameter $\lambda$ is varying accordingly to the normal density probability of your variable on X axis.
I've generated random data with MatLab using normal distribution for X and exponential distribution for Y, with $\lambda = p(x)$ and I got a similar result with your data:
You could try machine learning to fit the parameters, changing your cost function to compare the probability density and the rate parameter for each bin on your 'histogram'. If so, don't forget to run the random generator a few times on each iteration to minimize the cost.
Here is the code I used for the plot:
% Normal distribution generation.
x = randn(10000,1);
x = x - min(x); % Shifting curve so every x is > 0.
% Histogram informations
k = 100; % Number of bins.
binSize = (max(x) - min(x)) / k; % Width of bins.
y = 0:(k);
y = y .* binSize + min(x); % Array with Intervals.
p = zeros(k,1);
data = [];
% For every bin...
for i = 1:k
a = x(x >= y(i) & x < y(i + 1)); % All X values within condition.
p(i) = size(a,1); % Number of occurences (or
% Normal Density Probability).
if ~isempty(a)
for j = 1:p(i)
% lambda = Rate parameter of exponential distribution
% Rate parameter is varying with normal density probability.
lambda = p(i);
% Every X in normal distribution will have a Y
% which was generated randomly by the exponential
% distribution function EXPRND.
data = [data; a(j), exprnd(lambda)];
end
end
end
% Plotting normal distribution VS modified exponential distribution
scatter(data(:,1),data(:,2)) | Pattern detection in scatter plot | I would guess your variable on Y axis is exponentially distributed ($p(y) = \lambda e^{-\lambda y}$), but it seems that the rate parameter $\lambda$ is varying accordingly to the normal density probab | Pattern detection in scatter plot
I would guess your variable on Y axis is exponentially distributed ($p(y) = \lambda e^{-\lambda y}$), but it seems that the rate parameter $\lambda$ is varying accordingly to the normal density probability of your variable on X axis.
I've generated random data with MatLab using normal distribution for X and exponential distribution for Y, with $\lambda = p(x)$ and I got a similar result with your data:
You could try machine learning to fit the parameters, changing your cost function to compare the probability density and the rate parameter for each bin on your 'histogram'. If so, don't forget to run the random generator a few times on each iteration to minimize the cost.
Here is the code I used for the plot:
% Normal distribution generation.
x = randn(10000,1);
x = x - min(x); % Shifting curve so every x is > 0.
% Histogram informations
k = 100; % Number of bins.
binSize = (max(x) - min(x)) / k; % Width of bins.
y = 0:(k);
y = y .* binSize + min(x); % Array with Intervals.
p = zeros(k,1);
data = [];
% For every bin...
for i = 1:k
a = x(x >= y(i) & x < y(i + 1)); % All X values within condition.
p(i) = size(a,1); % Number of occurences (or
% Normal Density Probability).
if ~isempty(a)
for j = 1:p(i)
% lambda = Rate parameter of exponential distribution
% Rate parameter is varying with normal density probability.
lambda = p(i);
% Every X in normal distribution will have a Y
% which was generated randomly by the exponential
% distribution function EXPRND.
data = [data; a(j), exprnd(lambda)];
end
end
end
% Plotting normal distribution VS modified exponential distribution
scatter(data(:,1),data(:,2)) | Pattern detection in scatter plot
I would guess your variable on Y axis is exponentially distributed ($p(y) = \lambda e^{-\lambda y}$), but it seems that the rate parameter $\lambda$ is varying accordingly to the normal density probab |
33,931 | Pattern detection in scatter plot | The question mentions regression, which typically addresses conditional expectation:
$$
E[y|x] = \int y\,p(y|x)\,dy,
$$
where $y$ is the average donation and $x$ is the number of words. Linear regression may be too restrictive and so one could apply a local regression approach such as Nadaraya-Watson kernel regression. The results could be sensitive to the choice of bandwidth: A wide bandwidth could mask interesting local variation.
More generally, the question of independence between $x$ and $y$ is interesting. If $x$ and $y$ are independent then $p(y|x) = p(y)$ and of course the conditional expectation is independent as well. But $y$ might depend on $x$ in intersting ways even if the conditional expectation is independent of $x$.
With so much data I would look at histograms of $y$ that all have the nearly the same value of $x$ and see how the histogram changes as the chosen value of $x$ changes. Only after such an investigation would I think about how to proceed more formally. | Pattern detection in scatter plot | The question mentions regression, which typically addresses conditional expectation:
$$
E[y|x] = \int y\,p(y|x)\,dy,
$$
where $y$ is the average donation and $x$ is the number of words. Linear regress | Pattern detection in scatter plot
The question mentions regression, which typically addresses conditional expectation:
$$
E[y|x] = \int y\,p(y|x)\,dy,
$$
where $y$ is the average donation and $x$ is the number of words. Linear regression may be too restrictive and so one could apply a local regression approach such as Nadaraya-Watson kernel regression. The results could be sensitive to the choice of bandwidth: A wide bandwidth could mask interesting local variation.
More generally, the question of independence between $x$ and $y$ is interesting. If $x$ and $y$ are independent then $p(y|x) = p(y)$ and of course the conditional expectation is independent as well. But $y$ might depend on $x$ in intersting ways even if the conditional expectation is independent of $x$.
With so much data I would look at histograms of $y$ that all have the nearly the same value of $x$ and see how the histogram changes as the chosen value of $x$ changes. Only after such an investigation would I think about how to proceed more formally. | Pattern detection in scatter plot
The question mentions regression, which typically addresses conditional expectation:
$$
E[y|x] = \int y\,p(y|x)\,dy,
$$
where $y$ is the average donation and $x$ is the number of words. Linear regress |
33,932 | Can someone explain the chi squared distribution in layman's terms | Let's say you have random numbers $x_i$. When you estimate the variance of the series, you have to calculate sums like $\sum_i x_i^2$. If your numbers are from normal distribution, then the sum is from $\chi^2$ distribution. If you need to know the confidence intervals of your variance estimate, then you can use $\chi^2$ distribution to get them.
Often your numbers are not from normal distribution. However, due to central limit theorem (CLT) the sums of non-normal random variables are still normal in some cases. So, if you look at the mean of the sample, it's from normal distribution $\bar x=\frac{1}{n}\sum_i x_i$. Hence, if you want to know the variance of the sample mean, you'll get to calculate the sums like $\sum_k \mu_k^2$, where $k$ is a sample. Again, you can use $\chi^2$ to get confidence intervals of the variance of the sample mean. | Can someone explain the chi squared distribution in layman's terms | Let's say you have random numbers $x_i$. When you estimate the variance of the series, you have to calculate sums like $\sum_i x_i^2$. If your numbers are from normal distribution, then the sum is fro | Can someone explain the chi squared distribution in layman's terms
Let's say you have random numbers $x_i$. When you estimate the variance of the series, you have to calculate sums like $\sum_i x_i^2$. If your numbers are from normal distribution, then the sum is from $\chi^2$ distribution. If you need to know the confidence intervals of your variance estimate, then you can use $\chi^2$ distribution to get them.
Often your numbers are not from normal distribution. However, due to central limit theorem (CLT) the sums of non-normal random variables are still normal in some cases. So, if you look at the mean of the sample, it's from normal distribution $\bar x=\frac{1}{n}\sum_i x_i$. Hence, if you want to know the variance of the sample mean, you'll get to calculate the sums like $\sum_k \mu_k^2$, where $k$ is a sample. Again, you can use $\chi^2$ to get confidence intervals of the variance of the sample mean. | Can someone explain the chi squared distribution in layman's terms
Let's say you have random numbers $x_i$. When you estimate the variance of the series, you have to calculate sums like $\sum_i x_i^2$. If your numbers are from normal distribution, then the sum is fro |
33,933 | Can someone explain the chi squared distribution in layman's terms | Your understanding is slightly flawed. A $\chi^2$ distribution with $k$ degrees of freedom arises as the sum of squares of $k$ independent standard normal deviates.
This is useful for hypothesis tests when the data (are assumed to) follow a normal distribution. For example, in the case of Pearson's test $\chi^2$ test of independence, the test statistic is constructed as the sum-of-squared deviations from expected values. | Can someone explain the chi squared distribution in layman's terms | Your understanding is slightly flawed. A $\chi^2$ distribution with $k$ degrees of freedom arises as the sum of squares of $k$ independent standard normal deviates.
This is useful for hypothesis tests | Can someone explain the chi squared distribution in layman's terms
Your understanding is slightly flawed. A $\chi^2$ distribution with $k$ degrees of freedom arises as the sum of squares of $k$ independent standard normal deviates.
This is useful for hypothesis tests when the data (are assumed to) follow a normal distribution. For example, in the case of Pearson's test $\chi^2$ test of independence, the test statistic is constructed as the sum-of-squared deviations from expected values. | Can someone explain the chi squared distribution in layman's terms
Your understanding is slightly flawed. A $\chi^2$ distribution with $k$ degrees of freedom arises as the sum of squares of $k$ independent standard normal deviates.
This is useful for hypothesis tests |
33,934 | Can someone explain the chi squared distribution in layman's terms | As others have mentioned, a $\chi_{n}^2$ distribution is the distribution of the sum of $n$ (independent identically distributed) variables with Normal distributions (each of mean 0 and variance 1). But when students first encounter this concept, they're given tables to look up probabilities. How are those derived?
Let's start with $n=1$ so, for any $x \geq 0$, our variable $\leq x$ iff the underlying normal variable is $\in \left[-\sqrt{x},\,\sqrt{x}\right]$, which has probability $2\Phi\left(\sqrt{x}\right)-1$ where $\Phi\left( x \right)=\int_{-\infty}^x \frac{1}{\sqrt{2\pi}}\text{e}^{-t^2/2}dt$. Differentiating, the pdf is $x^{-1/2}\Phi'\left( \sqrt{x}\right)=\frac{1}{\sqrt{2\pi x}}\text{e}^{-x/2}$ for $x\geq 0$. Integrating that to check it's normalised is equivalent to computing $\Gamma\left( \frac{1}{2} \right)$, so the characteristic function turns out to be $\left( 1-2it \right)^{-1/2}$.
Now we can generalise to arbitrary $n$ . The characteristic function becomes $\left( 1-2it \right)^{-n/2}$ . By the inversion formula, the pdf on $\left[0, \,\infty\right]$ is proportional to $x^{n/2-1}\text{e}^{-x/2}$ (for the simple reason that such a pdf would obtain the right characteristic function). Now we just need the proportionality constant, viz. $\frac{x^{n/2-1}\text{e}^{-x/2}}{2^{n/2}\Gamma\left(\frac{n}{2} \right)}$. For even $n$ , an elementary expression for the cdf can be obtained by integration; for odd $n$ , we get a result in terms of $\Phi$, such as the one obtained above for the $n=1$ case. The $n=2$ case is especially simple; the pdf is $\frac{1}{2}\text{e}^{-x/2}$, which is an exponential distribution with $\lambda=\frac{1}{2}$. | Can someone explain the chi squared distribution in layman's terms | As others have mentioned, a $\chi_{n}^2$ distribution is the distribution of the sum of $n$ (independent identically distributed) variables with Normal distributions (each of mean 0 and variance 1). B | Can someone explain the chi squared distribution in layman's terms
As others have mentioned, a $\chi_{n}^2$ distribution is the distribution of the sum of $n$ (independent identically distributed) variables with Normal distributions (each of mean 0 and variance 1). But when students first encounter this concept, they're given tables to look up probabilities. How are those derived?
Let's start with $n=1$ so, for any $x \geq 0$, our variable $\leq x$ iff the underlying normal variable is $\in \left[-\sqrt{x},\,\sqrt{x}\right]$, which has probability $2\Phi\left(\sqrt{x}\right)-1$ where $\Phi\left( x \right)=\int_{-\infty}^x \frac{1}{\sqrt{2\pi}}\text{e}^{-t^2/2}dt$. Differentiating, the pdf is $x^{-1/2}\Phi'\left( \sqrt{x}\right)=\frac{1}{\sqrt{2\pi x}}\text{e}^{-x/2}$ for $x\geq 0$. Integrating that to check it's normalised is equivalent to computing $\Gamma\left( \frac{1}{2} \right)$, so the characteristic function turns out to be $\left( 1-2it \right)^{-1/2}$.
Now we can generalise to arbitrary $n$ . The characteristic function becomes $\left( 1-2it \right)^{-n/2}$ . By the inversion formula, the pdf on $\left[0, \,\infty\right]$ is proportional to $x^{n/2-1}\text{e}^{-x/2}$ (for the simple reason that such a pdf would obtain the right characteristic function). Now we just need the proportionality constant, viz. $\frac{x^{n/2-1}\text{e}^{-x/2}}{2^{n/2}\Gamma\left(\frac{n}{2} \right)}$. For even $n$ , an elementary expression for the cdf can be obtained by integration; for odd $n$ , we get a result in terms of $\Phi$, such as the one obtained above for the $n=1$ case. The $n=2$ case is especially simple; the pdf is $\frac{1}{2}\text{e}^{-x/2}$, which is an exponential distribution with $\lambda=\frac{1}{2}$. | Can someone explain the chi squared distribution in layman's terms
As others have mentioned, a $\chi_{n}^2$ distribution is the distribution of the sum of $n$ (independent identically distributed) variables with Normal distributions (each of mean 0 and variance 1). B |
33,935 | How to calculate the impulse response function of a VAR(1)? (With example) | For a VAR(1), we write the model as
$$
y_t=\Pi y_{t-1}+\epsilon_t
$$
where $y$ and $\epsilon$ are $p\times 1$ vectors. If you have more lags, the idea of extension is the same (and it is particularly straight-forward using the companion form).
The impulse response is the derivative with respect to the shocks. So the impulse response at horizon $h$ of the variables to an exogenous shock to variable $j$ is
$$
\frac{\partial y_{t+h}}{\partial \epsilon_{j, t}}=\frac{\partial }{\partial \epsilon_{j, t}}\left(\Pi y_{t+h-1}+\epsilon_{t+h-1}\right)=\cdots=\frac{\partial }{\partial \epsilon_{j, t}}\left(\Pi^{h+1} y_{t}+\sum_{i=0}^h\Pi^i\epsilon_{t+h-i}\right).
$$
This derivative will eliminate all terms but one, namely the term in the sum which is $\Pi^h\epsilon_t$, for which we get
$$
\frac{\partial y_{t+h}}{\partial \epsilon_{j, t}}=\frac{\partial }{\partial \epsilon_{j, t}}\left(\Pi^{h+1} y_{t}+\sum_{i=0}^h\Pi^i\epsilon_{t+h-i}\right)=\frac{\partial }{\partial \epsilon_{j, t}}\Pi^h\epsilon_{t}=\Pi^he_j
$$
where $e_j$ is the $j$th row of the $p\times p$ identity matrix. That is, the response of all $p$ variables at horizon $h$ to a shock to variable $j$ is the $j$th column of $\Pi^h$. If you take the derivative with respect to the matrix $\epsilon_t$ instead, the result will be a matrix which is just $\Pi^h$, since the selection vectors all taken together will give you the identity matrix.
That is the non-orthogonalized case without identification, which I believe is not so common in the literature. What people usually use is either some sophisticated identification scheme, or more often a Cholesky decomposition. To study this, it is more convenient to work with the vector moving average form of the model (which exists if it is stationary)
$$
y_t=\sum_{s=0}^\infty\Psi_s\epsilon_{t-s}.
$$
The problem for interpretation is when the error terms are correlated, because then an exogenous shock to variable $j$ is simultaneously correlated with a shock to variable $k$, for example. To eliminate this, you can use a Cholesky decomposition which orthogonalizes the innovations. Let's suppose that the covariance matrix of the errors is $\Omega$. We decompose it as $\Omega=PP'$ and introduce $v_t=P^{-1}\epsilon_t$ which are error terms with the identity matrix as covariance matrix. Do some manipulation:
$$
y_t=\sum_{s=0}^\infty\Psi_s\epsilon_{t-s}=\sum_{s=0}^\infty\Psi_sPP^{-1}\epsilon_{t-s}=\sum_{s=0}^\infty\Psi_s^*v_{t-s}.
$$
where $\Psi_s^*=\Psi_sP$.
Consider now the response to an orthogonalized shock:
$$
\frac{\partial y_{t+h}}{\partial v_{j, t}}=\frac{\partial }{\partial v_{j, t}}\left(\sum_{s=0}^\infty\Psi_s^*v_{t+h-s}\right)=\Psi_h^*e_j.
$$
To calculate this in practice, you will need to find the moving average matrices $\Psi$. This you do recursively. If you have $K$ lags:
$$
\Psi_s=0, \quad (s=-K+1, -K+2, \dots, -1)\\
\Psi_0=I\\
\Psi_s=\sum_{i=1}^K\Pi_i\Psi_{s-i}, \quad (s=1, 2, \dots).
$$
With estimates, you just put hats on the $\Pi$ matrices and proceed. $P$ we find from using a Cholesky decomposition of the estimated error covariance matrix, $\hat\Omega$.
Edit: In univariate time series analysis, one standard result is that every AR process can be written as an MA($\infty$) process. You have the same result for multivariate time series, meaning that we can always rewrite a stationary VAR($p$) as a VMA($\infty$). This is central to impulse response analysis. The case with only one lag is the easiest. In this case, we may write
$$
y_t=\Pi y_{t-1}+\epsilon_t=\Pi(\Pi y_{t-2}+\epsilon_{t-1})+\epsilon_t=\cdots=\sum_{s=0}^\infty \Pi^i\epsilon_{t-s}.
$$
The implied steps in the $\cdots$ part might not be obvious, but there is just a repeated substitution going on using the recursive nature of the model. So for the VAR(1), the moving average coefficients $\Psi_s$ are just $\Psi_s=\Pi^s$. For more lags, it gets a little more complicated, but above you will find the recursive relations.
In impulse response analysis, the moving average form of the model is particularly convenient. The reason is that if you want to find the response of $y_{t+h}$ to a shock to $\epsilon_{j, t}$, then if you start with the usual VAR(1) form
$$
y_{t+h}=\Pi y_{t+h-1}+\epsilon_{t+h},
$$
then there is no $\epsilon_t$ in your model as it stands, but you will have to do recursive substitution until you get to it (as I did in the beginning). But, if you have the moving average form of the model, you have it immediately on the right hand side. So for the VAR(1), you will find that
$$
\frac{\partial y_{t+h}}{\partial \epsilon_{j, t}}=\frac{\partial}{\partial \epsilon_{j, t}}\left(\sum_{s=0}^\infty\Psi_s\epsilon_{t+h-s}\right)=\Psi_he_j=\Pi^he_j,
$$
where $e_j$ again is the $j$th column of the $p\times p$ identity matrix. As you see, this is the same result as we found in the beginning, but here we used the moving average form of the model to do it. But the two representations are just two sides of the same coin. | How to calculate the impulse response function of a VAR(1)? (With example) | For a VAR(1), we write the model as
$$
y_t=\Pi y_{t-1}+\epsilon_t
$$
where $y$ and $\epsilon$ are $p\times 1$ vectors. If you have more lags, the idea of extension is the same (and it is particularly | How to calculate the impulse response function of a VAR(1)? (With example)
For a VAR(1), we write the model as
$$
y_t=\Pi y_{t-1}+\epsilon_t
$$
where $y$ and $\epsilon$ are $p\times 1$ vectors. If you have more lags, the idea of extension is the same (and it is particularly straight-forward using the companion form).
The impulse response is the derivative with respect to the shocks. So the impulse response at horizon $h$ of the variables to an exogenous shock to variable $j$ is
$$
\frac{\partial y_{t+h}}{\partial \epsilon_{j, t}}=\frac{\partial }{\partial \epsilon_{j, t}}\left(\Pi y_{t+h-1}+\epsilon_{t+h-1}\right)=\cdots=\frac{\partial }{\partial \epsilon_{j, t}}\left(\Pi^{h+1} y_{t}+\sum_{i=0}^h\Pi^i\epsilon_{t+h-i}\right).
$$
This derivative will eliminate all terms but one, namely the term in the sum which is $\Pi^h\epsilon_t$, for which we get
$$
\frac{\partial y_{t+h}}{\partial \epsilon_{j, t}}=\frac{\partial }{\partial \epsilon_{j, t}}\left(\Pi^{h+1} y_{t}+\sum_{i=0}^h\Pi^i\epsilon_{t+h-i}\right)=\frac{\partial }{\partial \epsilon_{j, t}}\Pi^h\epsilon_{t}=\Pi^he_j
$$
where $e_j$ is the $j$th row of the $p\times p$ identity matrix. That is, the response of all $p$ variables at horizon $h$ to a shock to variable $j$ is the $j$th column of $\Pi^h$. If you take the derivative with respect to the matrix $\epsilon_t$ instead, the result will be a matrix which is just $\Pi^h$, since the selection vectors all taken together will give you the identity matrix.
That is the non-orthogonalized case without identification, which I believe is not so common in the literature. What people usually use is either some sophisticated identification scheme, or more often a Cholesky decomposition. To study this, it is more convenient to work with the vector moving average form of the model (which exists if it is stationary)
$$
y_t=\sum_{s=0}^\infty\Psi_s\epsilon_{t-s}.
$$
The problem for interpretation is when the error terms are correlated, because then an exogenous shock to variable $j$ is simultaneously correlated with a shock to variable $k$, for example. To eliminate this, you can use a Cholesky decomposition which orthogonalizes the innovations. Let's suppose that the covariance matrix of the errors is $\Omega$. We decompose it as $\Omega=PP'$ and introduce $v_t=P^{-1}\epsilon_t$ which are error terms with the identity matrix as covariance matrix. Do some manipulation:
$$
y_t=\sum_{s=0}^\infty\Psi_s\epsilon_{t-s}=\sum_{s=0}^\infty\Psi_sPP^{-1}\epsilon_{t-s}=\sum_{s=0}^\infty\Psi_s^*v_{t-s}.
$$
where $\Psi_s^*=\Psi_sP$.
Consider now the response to an orthogonalized shock:
$$
\frac{\partial y_{t+h}}{\partial v_{j, t}}=\frac{\partial }{\partial v_{j, t}}\left(\sum_{s=0}^\infty\Psi_s^*v_{t+h-s}\right)=\Psi_h^*e_j.
$$
To calculate this in practice, you will need to find the moving average matrices $\Psi$. This you do recursively. If you have $K$ lags:
$$
\Psi_s=0, \quad (s=-K+1, -K+2, \dots, -1)\\
\Psi_0=I\\
\Psi_s=\sum_{i=1}^K\Pi_i\Psi_{s-i}, \quad (s=1, 2, \dots).
$$
With estimates, you just put hats on the $\Pi$ matrices and proceed. $P$ we find from using a Cholesky decomposition of the estimated error covariance matrix, $\hat\Omega$.
Edit: In univariate time series analysis, one standard result is that every AR process can be written as an MA($\infty$) process. You have the same result for multivariate time series, meaning that we can always rewrite a stationary VAR($p$) as a VMA($\infty$). This is central to impulse response analysis. The case with only one lag is the easiest. In this case, we may write
$$
y_t=\Pi y_{t-1}+\epsilon_t=\Pi(\Pi y_{t-2}+\epsilon_{t-1})+\epsilon_t=\cdots=\sum_{s=0}^\infty \Pi^i\epsilon_{t-s}.
$$
The implied steps in the $\cdots$ part might not be obvious, but there is just a repeated substitution going on using the recursive nature of the model. So for the VAR(1), the moving average coefficients $\Psi_s$ are just $\Psi_s=\Pi^s$. For more lags, it gets a little more complicated, but above you will find the recursive relations.
In impulse response analysis, the moving average form of the model is particularly convenient. The reason is that if you want to find the response of $y_{t+h}$ to a shock to $\epsilon_{j, t}$, then if you start with the usual VAR(1) form
$$
y_{t+h}=\Pi y_{t+h-1}+\epsilon_{t+h},
$$
then there is no $\epsilon_t$ in your model as it stands, but you will have to do recursive substitution until you get to it (as I did in the beginning). But, if you have the moving average form of the model, you have it immediately on the right hand side. So for the VAR(1), you will find that
$$
\frac{\partial y_{t+h}}{\partial \epsilon_{j, t}}=\frac{\partial}{\partial \epsilon_{j, t}}\left(\sum_{s=0}^\infty\Psi_s\epsilon_{t+h-s}\right)=\Psi_he_j=\Pi^he_j,
$$
where $e_j$ again is the $j$th column of the $p\times p$ identity matrix. As you see, this is the same result as we found in the beginning, but here we used the moving average form of the model to do it. But the two representations are just two sides of the same coin. | How to calculate the impulse response function of a VAR(1)? (With example)
For a VAR(1), we write the model as
$$
y_t=\Pi y_{t-1}+\epsilon_t
$$
where $y$ and $\epsilon$ are $p\times 1$ vectors. If you have more lags, the idea of extension is the same (and it is particularly |
33,936 | How to calculate the impulse response function of a VAR(1)? (With example) | Here is how to calculate the simple IRF.
The idea is to compare a base case where the innovations are
$$(\varepsilon_{1,t+1},\varepsilon_{1,t+2},...)=(0,0,...)$$
$$(\varepsilon_{2,t+1},\varepsilon_{2,t+2},...)=(0,0,...)$$
to an alternative case where the innovations are
$$(\varepsilon_{1,t+1},\varepsilon_{1,t+2},...)=(1,0,...)$$
$$(\varepsilon_{2,t+1},\varepsilon_{2,t+2},...)=(0,0,...)$$
for example (corresponding to a one-time shock of size 1 to $y_1$).
In a VAR(1) system, the $y_1$'s corresponding to the base case will be
$y_{1,t+1} = a_{11} y_{1,t} + a_{12} y_{2,t} + 0$
$y_{1,t+2} = a_{11} y_{1,t+1} + a_{12} y_{2,t+1} + 0 = a_{11} (a_{11} y_{1,t} + a_{12} y_{2,t} + 0) + a_{12} (a_{21} y_{1,t} + a_{22} y_{2,t} + 0) + 0$
$y_{1,t+3} = ...$
The $y_1$'s corresponding to the alternative case will be
$y_{1,t+1} = a_{11} y_{1,t} + a_{12} y_{2,t} + 1$
$y_{1,t+2} = a_{11} y_{1,t+1} + a_{12} y_{2,t+1} + 0 = a_{11} (a_{11} y_{1,t} + a_{12} y_{2,t} + 1) + a_{12} (a_{21} y_{1,t} + a_{22} y_{2,t} + 0) + 0$
$y_{1,t+3} = ...$
The impulse-responses for $y_1$ will be the difference between the alternative case and the base case, that is,
$ir_{1,t+1} = 1$
$ir_{1,t+2} = a_{11}$
$ir_{1,t+3} = ...$
Analogously, you could obtain the impulse responses of a one-time shock of size 1 to $y_1$ on $y_2$. They would be
$ir_{2,t+1} = 0$
$ir_{2,t+2} = a_{21}$
$ir_{2,t+3} = ...$
There must be a more compact way of writing it out, but I wanted to be clear and show it step by step.
Extending this to different kinds of shocks (e.g. unit shock to both $y_1$ and $y_2$ at time $t+1$ followed by zero shocks afterwards) should be straightforward.
Note: it might be more common to consider a shock at time $t$ rather than $t+1$, but that does not change the essence. | How to calculate the impulse response function of a VAR(1)? (With example) | Here is how to calculate the simple IRF.
The idea is to compare a base case where the innovations are
$$(\varepsilon_{1,t+1},\varepsilon_{1,t+2},...)=(0,0,...)$$
$$(\varepsilon_{2,t+1},\varepsilon_{2 | How to calculate the impulse response function of a VAR(1)? (With example)
Here is how to calculate the simple IRF.
The idea is to compare a base case where the innovations are
$$(\varepsilon_{1,t+1},\varepsilon_{1,t+2},...)=(0,0,...)$$
$$(\varepsilon_{2,t+1},\varepsilon_{2,t+2},...)=(0,0,...)$$
to an alternative case where the innovations are
$$(\varepsilon_{1,t+1},\varepsilon_{1,t+2},...)=(1,0,...)$$
$$(\varepsilon_{2,t+1},\varepsilon_{2,t+2},...)=(0,0,...)$$
for example (corresponding to a one-time shock of size 1 to $y_1$).
In a VAR(1) system, the $y_1$'s corresponding to the base case will be
$y_{1,t+1} = a_{11} y_{1,t} + a_{12} y_{2,t} + 0$
$y_{1,t+2} = a_{11} y_{1,t+1} + a_{12} y_{2,t+1} + 0 = a_{11} (a_{11} y_{1,t} + a_{12} y_{2,t} + 0) + a_{12} (a_{21} y_{1,t} + a_{22} y_{2,t} + 0) + 0$
$y_{1,t+3} = ...$
The $y_1$'s corresponding to the alternative case will be
$y_{1,t+1} = a_{11} y_{1,t} + a_{12} y_{2,t} + 1$
$y_{1,t+2} = a_{11} y_{1,t+1} + a_{12} y_{2,t+1} + 0 = a_{11} (a_{11} y_{1,t} + a_{12} y_{2,t} + 1) + a_{12} (a_{21} y_{1,t} + a_{22} y_{2,t} + 0) + 0$
$y_{1,t+3} = ...$
The impulse-responses for $y_1$ will be the difference between the alternative case and the base case, that is,
$ir_{1,t+1} = 1$
$ir_{1,t+2} = a_{11}$
$ir_{1,t+3} = ...$
Analogously, you could obtain the impulse responses of a one-time shock of size 1 to $y_1$ on $y_2$. They would be
$ir_{2,t+1} = 0$
$ir_{2,t+2} = a_{21}$
$ir_{2,t+3} = ...$
There must be a more compact way of writing it out, but I wanted to be clear and show it step by step.
Extending this to different kinds of shocks (e.g. unit shock to both $y_1$ and $y_2$ at time $t+1$ followed by zero shocks afterwards) should be straightforward.
Note: it might be more common to consider a shock at time $t$ rather than $t+1$, but that does not change the essence. | How to calculate the impulse response function of a VAR(1)? (With example)
Here is how to calculate the simple IRF.
The idea is to compare a base case where the innovations are
$$(\varepsilon_{1,t+1},\varepsilon_{1,t+2},...)=(0,0,...)$$
$$(\varepsilon_{2,t+1},\varepsilon_{2 |
33,937 | what is the difference between collinearity and interaction? | An interaction may arise when considering the relationship among three or more variables, and describes a situation in which the simultaneous influence of two variables on a third is not additive. Most commonly, interactions are considered in the context of regression analyses.
The presence of interactions can have important implications for the interpretation of statistical models. If two variables of interest interact, the relationship between each of the interacting variables and a third "dependent variable" depends on the value of the other interacting variable. In practice, this makes it more difficult to predict the consequences of changing the value of a variable, particularly if the variables it interacts with are hard to measure or difficult to control.
Collinearity is a statistical phenomenon in which two or more predictor variables in a multiple regression model are highly correlated, meaning that one can be linearly predicted from the others with a non-trivial degree of accuracy. In this situation the coefficient estimates of the multiple regression may change erratically in response to small changes in the model or the data. Collinearity does not reduce the predictive power or reliability of the model as a whole, at least within the sample data themselves; it only affects calculations regarding individual predictors. That is, a multiple regression model with correlated predictors can indicate how well the entire bundle of predictors predicts the outcome variable, but it may not give valid results about any individual predictor, or about which predictors are redundant with respect to others.
Bottom line: Interactions don't imply collinearity and collinearity does not imply there are interactions. | what is the difference between collinearity and interaction? | An interaction may arise when considering the relationship among three or more variables, and describes a situation in which the simultaneous influence of two variables on a third is not additive. Mos | what is the difference between collinearity and interaction?
An interaction may arise when considering the relationship among three or more variables, and describes a situation in which the simultaneous influence of two variables on a third is not additive. Most commonly, interactions are considered in the context of regression analyses.
The presence of interactions can have important implications for the interpretation of statistical models. If two variables of interest interact, the relationship between each of the interacting variables and a third "dependent variable" depends on the value of the other interacting variable. In practice, this makes it more difficult to predict the consequences of changing the value of a variable, particularly if the variables it interacts with are hard to measure or difficult to control.
Collinearity is a statistical phenomenon in which two or more predictor variables in a multiple regression model are highly correlated, meaning that one can be linearly predicted from the others with a non-trivial degree of accuracy. In this situation the coefficient estimates of the multiple regression may change erratically in response to small changes in the model or the data. Collinearity does not reduce the predictive power or reliability of the model as a whole, at least within the sample data themselves; it only affects calculations regarding individual predictors. That is, a multiple regression model with correlated predictors can indicate how well the entire bundle of predictors predicts the outcome variable, but it may not give valid results about any individual predictor, or about which predictors are redundant with respect to others.
Bottom line: Interactions don't imply collinearity and collinearity does not imply there are interactions. | what is the difference between collinearity and interaction?
An interaction may arise when considering the relationship among three or more variables, and describes a situation in which the simultaneous influence of two variables on a third is not additive. Mos |
33,938 | what is the difference between collinearity and interaction? | Interaction terms can be introduced to your model to account for different effects when two independent variables combine in some interesting way.
They are commonly used when categorical factors are present, e.g. to allow different rates of response of $Y$ (income) to a second factor $X_{2}$ (years of education) according to the categorical $X_{1}$ (gender, 0=male, 1= female). If we simply regress $Y = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2}$, the model only accounts for females earning a fixed amount more or less than males, with a separate term accounting for educational difference regardless of gender.
If we add a third interaction variable $X_{1}X_{2}$, so $Y = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2} + \beta_{3}(X_{1}X_{2})$, this third factor will be zero for males, but non-zero for females, thus representing the specific variable female years of education, and allowing the model to separately account for the effects this on income ($\beta_{2}$ becomes the gradient for rate of change of male income, and $\beta_{3}$ is an adjustment to the slope of income change for females).
This is an interaction, but it is not collinear, because it does not respond the same way as years of education across the full data set (it is zero for all points that are male). Thus, interaction is not the same as collinearity, and interaction can in fact be a useful element of a regression model.
More generally, the multiplication of two variables (both non-constant) is by definition non-linear, so while an interaction term created in this way may be related to the two component variables, it is not related linearly so collinearity is impossible. | what is the difference between collinearity and interaction? | Interaction terms can be introduced to your model to account for different effects when two independent variables combine in some interesting way.
They are commonly used when categorical factors are p | what is the difference between collinearity and interaction?
Interaction terms can be introduced to your model to account for different effects when two independent variables combine in some interesting way.
They are commonly used when categorical factors are present, e.g. to allow different rates of response of $Y$ (income) to a second factor $X_{2}$ (years of education) according to the categorical $X_{1}$ (gender, 0=male, 1= female). If we simply regress $Y = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2}$, the model only accounts for females earning a fixed amount more or less than males, with a separate term accounting for educational difference regardless of gender.
If we add a third interaction variable $X_{1}X_{2}$, so $Y = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2} + \beta_{3}(X_{1}X_{2})$, this third factor will be zero for males, but non-zero for females, thus representing the specific variable female years of education, and allowing the model to separately account for the effects this on income ($\beta_{2}$ becomes the gradient for rate of change of male income, and $\beta_{3}$ is an adjustment to the slope of income change for females).
This is an interaction, but it is not collinear, because it does not respond the same way as years of education across the full data set (it is zero for all points that are male). Thus, interaction is not the same as collinearity, and interaction can in fact be a useful element of a regression model.
More generally, the multiplication of two variables (both non-constant) is by definition non-linear, so while an interaction term created in this way may be related to the two component variables, it is not related linearly so collinearity is impossible. | what is the difference between collinearity and interaction?
Interaction terms can be introduced to your model to account for different effects when two independent variables combine in some interesting way.
They are commonly used when categorical factors are p |
33,939 | what is the difference between collinearity and interaction? | To me, 'interaction' is a term to describe how the responder(Y) reacts to different levels or level combinations of predictors (Xs). Eg., whether Y is influenced by X1 and X2 in a 1+1>2 manner. It does not describe or indicate the dependencies between the predictors. While multicollinearity is a term that describes such relationships/dependencies between the predictors. | what is the difference between collinearity and interaction? | To me, 'interaction' is a term to describe how the responder(Y) reacts to different levels or level combinations of predictors (Xs). Eg., whether Y is influenced by X1 and X2 in a 1+1>2 manner. It doe | what is the difference between collinearity and interaction?
To me, 'interaction' is a term to describe how the responder(Y) reacts to different levels or level combinations of predictors (Xs). Eg., whether Y is influenced by X1 and X2 in a 1+1>2 manner. It does not describe or indicate the dependencies between the predictors. While multicollinearity is a term that describes such relationships/dependencies between the predictors. | what is the difference between collinearity and interaction?
To me, 'interaction' is a term to describe how the responder(Y) reacts to different levels or level combinations of predictors (Xs). Eg., whether Y is influenced by X1 and X2 in a 1+1>2 manner. It doe |
33,940 | what is the difference between collinearity and interaction? | INTERACTION mostly applied in Two way Anova and tells the impact of two or more independent variable on a given variable i,e.each of the independent variables have the same impact on a given dependent variable.where as col-linearity indicates the correlation between two or more independent variable without including the dependent variable. | what is the difference between collinearity and interaction? | INTERACTION mostly applied in Two way Anova and tells the impact of two or more independent variable on a given variable i,e.each of the independent variables have the same impact on a given dependent | what is the difference between collinearity and interaction?
INTERACTION mostly applied in Two way Anova and tells the impact of two or more independent variable on a given variable i,e.each of the independent variables have the same impact on a given dependent variable.where as col-linearity indicates the correlation between two or more independent variable without including the dependent variable. | what is the difference between collinearity and interaction?
INTERACTION mostly applied in Two way Anova and tells the impact of two or more independent variable on a given variable i,e.each of the independent variables have the same impact on a given dependent |
33,941 | What are the most popular artificial neural network algorithms for recognising the content of images? | According to Wikipedia, there are 4 main types of artificial neural network learning algorithms: supervised, unsupervised, reinforcement and deep learning.
Unsupervised learning algorithms:
Perceptron,
Self-organizing map,
Radial basis function network
Supervised learning algorithms:
Backpropagation,
Autoencoders,
Hopfield networks,
Boltzmann machines,
Restricted Boltzmann Machines,
Spiking neural networks
Reinforcement learning algorithms:
Temporal difference learning,
Q-learning,
Learning Automata,
Monte Carlo Method,
SARSA
Deep learning algorithms:
Deep belief networks,
Deep Boltzmann machines,
Deep Convolutional neural networks,
Deep Recurrent neural networks,
Hierarchical temporal memory
And other (e.g. Data Pre-processing).
So basically you need a good algorithm for pattern recognition for your computer vision analysis.
Object recognition methods in computer vision
Object recognition is a process for identifying a specific object in a
digital image or video. Object recognition algorithms rely on matching
or learning algorithms using appearance-based or feature-based
techniques. Common techniques include edges, gradients, Histogram of
Oriented Gradients (HOG), Haar wavelets, and linear binary patterns.
Object recognition is useful in applications such as video
stabilization, automated vehicle parking systems, and cell counting in
bioimaging.
You can recognize objects using a variety of models, including:
Extracted features and boosted learning algorithms,
Bag-of-words models with features such as SURF and MSER,
Gradient-based and derivative-based matching approaches,
Viola-Jones algorithm,
Template matching,
Image segmentation and blob analysis,
Fuzzy Membership Rules,
etc.
So there are plenty of different approaches and it's difficult to choose the most efficient or popular, because it really depends on the needs. And the list is increasing every year.
There are also independent algorithms in computer vision, in example:
In Chinese University of Hong Kong the guys developed a face recognition algorithm called GaussianFace that outperforms humans for the first time. Read more: The Face Recognition Algorithm That Finally Outperforms Humans,
The BYU image algorithm is highly accurate system learns to decipher images on its own. Read more: BYU's smart object recognition algorithm doesn't need humans, A smart-object recognition algorithm that doesn’t need humans (research paper),
Google’s New Street View Image Recognition Algorithm Can Beat Most CAPTCHAs or can find and read street numbers in Street View, and correlates those numbers with existing addresses to pinpoint their exact location on Google Maps. Read more: Street View and reCAPTCHA technology just got smarter (research paper),
In 2012 Google built high-level features using large scale unsupervised learning and the system achieved 81.7 percent accuracy in detecting human faces, 76.7 percent accuracy when identifying human body parts and 74.8 percent accuracy when identifying cats. Read more: Google brain simulator identifies cats on YouTube (research paper),
DARPA Visual Media Reasoning program have developed vision system development tools for the automated evaluation of vision algorithm performance and for combining computer graphics and machine vision technology (Read more: "Software aims to characterize algorithm performance," Vision Systems Design, December 2013)
etc.
Read more:
Developers look to open sources for vision algorithms (Article)
Popular open source computer vision software:
OpenCV (Open Source Computer Vision Library),
Open source computer vision and machine learning software library. It
has C++, C, Python and Java interfaces and supports Windows, Linux,
Android and Mac OS.
OpenCV is released under a BSD license, it is free for both academic
and commercial use. It has C++, C, Python and soon Java interfaces
running on Windows, Linux, Android and Mac. The library has >2500
optimized algorithms (see figure below). It is used around the world,
has >2.5M downloads and >40K people in the user group.
New algorithms continue to be added to the Open CV library.
SimpleCV
SimpleCV is a Python interface to several powerful open source
computer vision libraries in a single convenient package.
It allow access to the high-level feature detection, filtering, and
pattern recognition algorithms found in Open CV without the need to
understanding of bit depth, file format, or buffer management
techniques.
Accord.NET Framework
The Accord.NET framework provides machine learning, mathematics,
statistics, computer vision, computer audition, and several scientific
computing related methods and techniques to .NET. This project extends
the popular AForge.NET Framework providing a more complete scientific
computing environment.
MATLAB from MathWorks
An open-source platform-independent
C++ framework for machine learning and computer vision research
framework. Working with Open CV, the framework contains MATLAB
wrappers for core components of the library and an experimental
graphical user interface for developing and visualizing machine
learning data flows.
Using MATLAB, you can analyze data, develop algorithms, and create models and applications.
ROVIS Machine Vision System
An open source software application under development by the ROVIS Research Group.
Open Vision Control
A software package for object motion detection.
Such open source frameworks are also available for the Android operating system. These include Cuckoo, an Android framework.
Conclusion
So everything is about the needs, requirements, scalability, time and money involved. Therefore I would start to experiment with OpenCV library (which has over 2500 optimized algorithms) and learning algorithms written in Matlab, Octave or Python.
On-line courses:
Neural Networks for Machine Learning at coursera
University of Washington: Machine Learning at coursera
Stanford University: Machine Learning at coursera
Other: Computer Science: Artificial Intelligence courses at coursera
Links:
Neural Networks and Deep Learning (free online book)
OpenCV Computer Vision with Python by Joseph Howse | What are the most popular artificial neural network algorithms for recognising the content of images | According to Wikipedia, there are 4 main types of artificial neural network learning algorithms: supervised, unsupervised, reinforcement and deep learning.
Unsupervised learning algorithms:
Perceptro | What are the most popular artificial neural network algorithms for recognising the content of images?
According to Wikipedia, there are 4 main types of artificial neural network learning algorithms: supervised, unsupervised, reinforcement and deep learning.
Unsupervised learning algorithms:
Perceptron,
Self-organizing map,
Radial basis function network
Supervised learning algorithms:
Backpropagation,
Autoencoders,
Hopfield networks,
Boltzmann machines,
Restricted Boltzmann Machines,
Spiking neural networks
Reinforcement learning algorithms:
Temporal difference learning,
Q-learning,
Learning Automata,
Monte Carlo Method,
SARSA
Deep learning algorithms:
Deep belief networks,
Deep Boltzmann machines,
Deep Convolutional neural networks,
Deep Recurrent neural networks,
Hierarchical temporal memory
And other (e.g. Data Pre-processing).
So basically you need a good algorithm for pattern recognition for your computer vision analysis.
Object recognition methods in computer vision
Object recognition is a process for identifying a specific object in a
digital image or video. Object recognition algorithms rely on matching
or learning algorithms using appearance-based or feature-based
techniques. Common techniques include edges, gradients, Histogram of
Oriented Gradients (HOG), Haar wavelets, and linear binary patterns.
Object recognition is useful in applications such as video
stabilization, automated vehicle parking systems, and cell counting in
bioimaging.
You can recognize objects using a variety of models, including:
Extracted features and boosted learning algorithms,
Bag-of-words models with features such as SURF and MSER,
Gradient-based and derivative-based matching approaches,
Viola-Jones algorithm,
Template matching,
Image segmentation and blob analysis,
Fuzzy Membership Rules,
etc.
So there are plenty of different approaches and it's difficult to choose the most efficient or popular, because it really depends on the needs. And the list is increasing every year.
There are also independent algorithms in computer vision, in example:
In Chinese University of Hong Kong the guys developed a face recognition algorithm called GaussianFace that outperforms humans for the first time. Read more: The Face Recognition Algorithm That Finally Outperforms Humans,
The BYU image algorithm is highly accurate system learns to decipher images on its own. Read more: BYU's smart object recognition algorithm doesn't need humans, A smart-object recognition algorithm that doesn’t need humans (research paper),
Google’s New Street View Image Recognition Algorithm Can Beat Most CAPTCHAs or can find and read street numbers in Street View, and correlates those numbers with existing addresses to pinpoint their exact location on Google Maps. Read more: Street View and reCAPTCHA technology just got smarter (research paper),
In 2012 Google built high-level features using large scale unsupervised learning and the system achieved 81.7 percent accuracy in detecting human faces, 76.7 percent accuracy when identifying human body parts and 74.8 percent accuracy when identifying cats. Read more: Google brain simulator identifies cats on YouTube (research paper),
DARPA Visual Media Reasoning program have developed vision system development tools for the automated evaluation of vision algorithm performance and for combining computer graphics and machine vision technology (Read more: "Software aims to characterize algorithm performance," Vision Systems Design, December 2013)
etc.
Read more:
Developers look to open sources for vision algorithms (Article)
Popular open source computer vision software:
OpenCV (Open Source Computer Vision Library),
Open source computer vision and machine learning software library. It
has C++, C, Python and Java interfaces and supports Windows, Linux,
Android and Mac OS.
OpenCV is released under a BSD license, it is free for both academic
and commercial use. It has C++, C, Python and soon Java interfaces
running on Windows, Linux, Android and Mac. The library has >2500
optimized algorithms (see figure below). It is used around the world,
has >2.5M downloads and >40K people in the user group.
New algorithms continue to be added to the Open CV library.
SimpleCV
SimpleCV is a Python interface to several powerful open source
computer vision libraries in a single convenient package.
It allow access to the high-level feature detection, filtering, and
pattern recognition algorithms found in Open CV without the need to
understanding of bit depth, file format, or buffer management
techniques.
Accord.NET Framework
The Accord.NET framework provides machine learning, mathematics,
statistics, computer vision, computer audition, and several scientific
computing related methods and techniques to .NET. This project extends
the popular AForge.NET Framework providing a more complete scientific
computing environment.
MATLAB from MathWorks
An open-source platform-independent
C++ framework for machine learning and computer vision research
framework. Working with Open CV, the framework contains MATLAB
wrappers for core components of the library and an experimental
graphical user interface for developing and visualizing machine
learning data flows.
Using MATLAB, you can analyze data, develop algorithms, and create models and applications.
ROVIS Machine Vision System
An open source software application under development by the ROVIS Research Group.
Open Vision Control
A software package for object motion detection.
Such open source frameworks are also available for the Android operating system. These include Cuckoo, an Android framework.
Conclusion
So everything is about the needs, requirements, scalability, time and money involved. Therefore I would start to experiment with OpenCV library (which has over 2500 optimized algorithms) and learning algorithms written in Matlab, Octave or Python.
On-line courses:
Neural Networks for Machine Learning at coursera
University of Washington: Machine Learning at coursera
Stanford University: Machine Learning at coursera
Other: Computer Science: Artificial Intelligence courses at coursera
Links:
Neural Networks and Deep Learning (free online book)
OpenCV Computer Vision with Python by Joseph Howse | What are the most popular artificial neural network algorithms for recognising the content of images
According to Wikipedia, there are 4 main types of artificial neural network learning algorithms: supervised, unsupervised, reinforcement and deep learning.
Unsupervised learning algorithms:
Perceptro |
33,942 | What are the most popular artificial neural network algorithms for recognising the content of images? | This field is evolving rapidly. Just a few days ago, the results of the imagenet 2014 challenge have been published. It will take some time until all the papers are available.
If you want to solve these kinds of problems, the take away message is that most, if not all classical solutions to the problem are obsolete.
The way to go (and it probably won't change too soon!) are convolutional networks with dropout. This approach has been pushed by Geoffrey Hinton's Phd Alex Krizhevski (both at Google now) and is known as "AlexNet". The relevant publication can be found here.
Several $\epsilon$ improvements have been made. Some names to google are Jonathan Masci, Matthew Zeiler, Dan Ciresan.
There are numerous open source implementations, e.g. cuda-convnet2, Decaf, OverFeat.
The guys of clarifai have a nice demo of the capabilities of this method. | What are the most popular artificial neural network algorithms for recognising the content of images | This field is evolving rapidly. Just a few days ago, the results of the imagenet 2014 challenge have been published. It will take some time until all the papers are available.
If you want to solve the | What are the most popular artificial neural network algorithms for recognising the content of images?
This field is evolving rapidly. Just a few days ago, the results of the imagenet 2014 challenge have been published. It will take some time until all the papers are available.
If you want to solve these kinds of problems, the take away message is that most, if not all classical solutions to the problem are obsolete.
The way to go (and it probably won't change too soon!) are convolutional networks with dropout. This approach has been pushed by Geoffrey Hinton's Phd Alex Krizhevski (both at Google now) and is known as "AlexNet". The relevant publication can be found here.
Several $\epsilon$ improvements have been made. Some names to google are Jonathan Masci, Matthew Zeiler, Dan Ciresan.
There are numerous open source implementations, e.g. cuda-convnet2, Decaf, OverFeat.
The guys of clarifai have a nice demo of the capabilities of this method. | What are the most popular artificial neural network algorithms for recognising the content of images
This field is evolving rapidly. Just a few days ago, the results of the imagenet 2014 challenge have been published. It will take some time until all the papers are available.
If you want to solve the |
33,943 | What are the most popular artificial neural network algorithms for recognising the content of images? | Depends on what you mean by efficient. If you want state-of-the-art predictive performance, you should dig into deep learning, convolutional networks and the like.
Those techniques are very computationally intensive, though. So if by efficient you mean low training complexity, you want to be looking at the opposite end of the spectrum. | What are the most popular artificial neural network algorithms for recognising the content of images | Depends on what you mean by efficient. If you want state-of-the-art predictive performance, you should dig into deep learning, convolutional networks and the like.
Those techniques are very computati | What are the most popular artificial neural network algorithms for recognising the content of images?
Depends on what you mean by efficient. If you want state-of-the-art predictive performance, you should dig into deep learning, convolutional networks and the like.
Those techniques are very computationally intensive, though. So if by efficient you mean low training complexity, you want to be looking at the opposite end of the spectrum. | What are the most popular artificial neural network algorithms for recognising the content of images
Depends on what you mean by efficient. If you want state-of-the-art predictive performance, you should dig into deep learning, convolutional networks and the like.
Those techniques are very computati |
33,944 | Time trend or time dummies in a panel | I've also asked myself this question, and this is the way I look at it:
Suppose your regression models are
Time dummies
$y_t =\alpha + X_t\beta +\sum_{j=1}^{T-1}\tau_jT_{j} +e_{it}$
where $\tau_j$ is the coefficent on dummy $T_{j}$, the latter equal to one year $j$, zero elsewhere. For any given year, you can evaluate the function by setting $T_j=1$ for $j=$ the year you evaluate, and zero elsewhere. This gives you:
$y_{t=j}=\alpha + X_j\beta+\tau_j$
Thus, you have a year-specific effect of size $\tau_j$ that affects all your units. I view this approach most appropriate if you suspect that there are specific effects to that year, and wish to model them. E.g. the quality of students in a class for a given year, might exhibit year-specific changes.
Time trend
$y_t =\alpha + X_t\beta +\lambda t +e_{it}$
where $\lambda$ is the coefficient on the time trend $t$ increasing with equal steps, e.g. years. To obtain an intepretable expression, you can take the derivate:
$\frac{\partial y_t}{\partial t}= \lambda$
So moving from one year to another, i.e. increasing $t$ by one unit, yields an effect of $\lambda$ on your outcome variable. Thus, you have a linear trend which can be intepreted as the overall direction your outcomes moves across time. You assume that the effect you estimate is not specific to any given year, but the process which generates the changes extends across years - that's at least how I think about it.
The way I see it, it's more question of what you want to estimate. Year-specific changes or trends (or you might want to compare which of these models is the most appropriate). | Time trend or time dummies in a panel | I've also asked myself this question, and this is the way I look at it:
Suppose your regression models are
Time dummies
$y_t =\alpha + X_t\beta +\sum_{j=1}^{T-1}\tau_jT_{j} +e_{it}$
where $\tau_j$ is | Time trend or time dummies in a panel
I've also asked myself this question, and this is the way I look at it:
Suppose your regression models are
Time dummies
$y_t =\alpha + X_t\beta +\sum_{j=1}^{T-1}\tau_jT_{j} +e_{it}$
where $\tau_j$ is the coefficent on dummy $T_{j}$, the latter equal to one year $j$, zero elsewhere. For any given year, you can evaluate the function by setting $T_j=1$ for $j=$ the year you evaluate, and zero elsewhere. This gives you:
$y_{t=j}=\alpha + X_j\beta+\tau_j$
Thus, you have a year-specific effect of size $\tau_j$ that affects all your units. I view this approach most appropriate if you suspect that there are specific effects to that year, and wish to model them. E.g. the quality of students in a class for a given year, might exhibit year-specific changes.
Time trend
$y_t =\alpha + X_t\beta +\lambda t +e_{it}$
where $\lambda$ is the coefficient on the time trend $t$ increasing with equal steps, e.g. years. To obtain an intepretable expression, you can take the derivate:
$\frac{\partial y_t}{\partial t}= \lambda$
So moving from one year to another, i.e. increasing $t$ by one unit, yields an effect of $\lambda$ on your outcome variable. Thus, you have a linear trend which can be intepreted as the overall direction your outcomes moves across time. You assume that the effect you estimate is not specific to any given year, but the process which generates the changes extends across years - that's at least how I think about it.
The way I see it, it's more question of what you want to estimate. Year-specific changes or trends (or you might want to compare which of these models is the most appropriate). | Time trend or time dummies in a panel
I've also asked myself this question, and this is the way I look at it:
Suppose your regression models are
Time dummies
$y_t =\alpha + X_t\beta +\sum_{j=1}^{T-1}\tau_jT_{j} +e_{it}$
where $\tau_j$ is |
33,945 | Time trend or time dummies in a panel | Preface: I assume here that modeling time is of secondary concern (i.e., you want to control out the effects of time in order to more accurately capture the primary effects)
It's a matter of parsimony.
If your time trend can be well approximated by a linear trend term or linear plus quadratic trend terms (or possibly something more complicated), you should opt for those in place of time dummies. Assuming many time periods, the simpler linear or quadratic time trend terms will result in more parsimony of the model. But if you have no reason to believe the trend over time is so simple, then dummies are frankly a safer bet if you can afford the complexity of the additional parameters. | Time trend or time dummies in a panel | Preface: I assume here that modeling time is of secondary concern (i.e., you want to control out the effects of time in order to more accurately capture the primary effects)
It's a matter of parsimony | Time trend or time dummies in a panel
Preface: I assume here that modeling time is of secondary concern (i.e., you want to control out the effects of time in order to more accurately capture the primary effects)
It's a matter of parsimony.
If your time trend can be well approximated by a linear trend term or linear plus quadratic trend terms (or possibly something more complicated), you should opt for those in place of time dummies. Assuming many time periods, the simpler linear or quadratic time trend terms will result in more parsimony of the model. But if you have no reason to believe the trend over time is so simple, then dummies are frankly a safer bet if you can afford the complexity of the additional parameters. | Time trend or time dummies in a panel
Preface: I assume here that modeling time is of secondary concern (i.e., you want to control out the effects of time in order to more accurately capture the primary effects)
It's a matter of parsimony |
33,946 | Time trend or time dummies in a panel | One advantage of using a time trend is that you forecast panel-dependent variables for the future by projecting the time trend (linear or non-linear). This will be a problem with time dummies, e.g. to predict your dependent variable in 2024, what time adjustment is to use to forecast your dependent variable. This is especially interesting for the machine learning community who are more interested in prediction. | Time trend or time dummies in a panel | One advantage of using a time trend is that you forecast panel-dependent variables for the future by projecting the time trend (linear or non-linear). This will be a problem with time dummies, e.g. to | Time trend or time dummies in a panel
One advantage of using a time trend is that you forecast panel-dependent variables for the future by projecting the time trend (linear or non-linear). This will be a problem with time dummies, e.g. to predict your dependent variable in 2024, what time adjustment is to use to forecast your dependent variable. This is especially interesting for the machine learning community who are more interested in prediction. | Time trend or time dummies in a panel
One advantage of using a time trend is that you forecast panel-dependent variables for the future by projecting the time trend (linear or non-linear). This will be a problem with time dummies, e.g. to |
33,947 | Time trend or time dummies in a panel | When 2 time series are purely driven by time only (increasing or decreasing), their correlation or regression is spurious. The reason is this: Both series are increasing or decreasing merely due to time but they may not necessarily co-move i.e. the patterns of movement may not be congruent. This time movement can be captured by time trend variable itself and we don't need any variable to explain the variation in dependent variable apart from time trend. This means the dependent variable is highly correlated with time only than any other variable. In contrast, if the dependent variable movement is more correlated with independent variable movement than the time, there exists a non-spurious and real correlation between2 variables. This comparison of comovement between variables and time can be easily judged by correlations between them. Generally, if correlation between dep var and indep var is higher than that between dep var & time, indep variable is really correlated with dep var without any doubt of spurious relation. If not, then it is time that can take care of movement of dependent variable and independent variable remians useless or insignificant in regression model.
Thus, by ingesting a time trend variable, we control for time effect in the model to get the true and non-spurious relationship between dep and indep variables. | Time trend or time dummies in a panel | When 2 time series are purely driven by time only (increasing or decreasing), their correlation or regression is spurious. The reason is this: Both series are increasing or decreasing merely due to ti | Time trend or time dummies in a panel
When 2 time series are purely driven by time only (increasing or decreasing), their correlation or regression is spurious. The reason is this: Both series are increasing or decreasing merely due to time but they may not necessarily co-move i.e. the patterns of movement may not be congruent. This time movement can be captured by time trend variable itself and we don't need any variable to explain the variation in dependent variable apart from time trend. This means the dependent variable is highly correlated with time only than any other variable. In contrast, if the dependent variable movement is more correlated with independent variable movement than the time, there exists a non-spurious and real correlation between2 variables. This comparison of comovement between variables and time can be easily judged by correlations between them. Generally, if correlation between dep var and indep var is higher than that between dep var & time, indep variable is really correlated with dep var without any doubt of spurious relation. If not, then it is time that can take care of movement of dependent variable and independent variable remians useless or insignificant in regression model.
Thus, by ingesting a time trend variable, we control for time effect in the model to get the true and non-spurious relationship between dep and indep variables. | Time trend or time dummies in a panel
When 2 time series are purely driven by time only (increasing or decreasing), their correlation or regression is spurious. The reason is this: Both series are increasing or decreasing merely due to ti |
33,948 | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$ | Define the sets $A_n=\{x\in \mathbb{R}:x>n\}$, for $n=0,1,2\dots$.
For any fixed $\omega$, let $n_0$ be the smallest integer such that $X(\omega)\leq n_0$. Since $X(\omega)\geq 0$, we have
$$
X(\omega)\leq n_0 = \sum_{n=0}^{n_0} I_{A_n} (X(\omega)) = \sum_{n=0}^\infty I_{A_n} (X(\omega)) \, ,
$$
yielding
$$
\mathrm{E}[X]\leq \sum_{n=0}^\infty \mathrm{E}[I_{A_n} (X)]=\sum_{n=0}^\infty P(X>n) \, .
$$ | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$ | Define the sets $A_n=\{x\in \mathbb{R}:x>n\}$, for $n=0,1,2\dots$.
For any fixed $\omega$, let $n_0$ be the smallest integer such that $X(\omega)\leq n_0$. Since $X(\omega)\geq 0$, we have
$$
X(\om | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$
Define the sets $A_n=\{x\in \mathbb{R}:x>n\}$, for $n=0,1,2\dots$.
For any fixed $\omega$, let $n_0$ be the smallest integer such that $X(\omega)\leq n_0$. Since $X(\omega)\geq 0$, we have
$$
X(\omega)\leq n_0 = \sum_{n=0}^{n_0} I_{A_n} (X(\omega)) = \sum_{n=0}^\infty I_{A_n} (X(\omega)) \, ,
$$
yielding
$$
\mathrm{E}[X]\leq \sum_{n=0}^\infty \mathrm{E}[I_{A_n} (X)]=\sum_{n=0}^\infty P(X>n) \, .
$$ | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$
Define the sets $A_n=\{x\in \mathbb{R}:x>n\}$, for $n=0,1,2\dots$.
For any fixed $\omega$, let $n_0$ be the smallest integer such that $X(\omega)\leq n_0$. Since $X(\omega)\geq 0$, we have
$$
X(\om |
33,949 | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$ | You have
$$EX=\int_0^{\infty}xdF(x)$$
Notice that $dF(x)=-d(1-F(x))$ and that $P(X>t)=1-F(t)$ and use integration by parts.
Now show that for monotone decreasing positive function
$$\sum_{n=0}^\infty f(n)\ge\int_0^{\infty} f(t) dt$$
Combine these two results and you get your desired result. Hint for the second, recall Riemman sums. | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$ | You have
$$EX=\int_0^{\infty}xdF(x)$$
Notice that $dF(x)=-d(1-F(x))$ and that $P(X>t)=1-F(t)$ and use integration by parts.
Now show that for monotone decreasing positive function
$$\sum_{n=0}^\inft | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$
You have
$$EX=\int_0^{\infty}xdF(x)$$
Notice that $dF(x)=-d(1-F(x))$ and that $P(X>t)=1-F(t)$ and use integration by parts.
Now show that for monotone decreasing positive function
$$\sum_{n=0}^\infty f(n)\ge\int_0^{\infty} f(t) dt$$
Combine these two results and you get your desired result. Hint for the second, recall Riemman sums. | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$
You have
$$EX=\int_0^{\infty}xdF(x)$$
Notice that $dF(x)=-d(1-F(x))$ and that $P(X>t)=1-F(t)$ and use integration by parts.
Now show that for monotone decreasing positive function
$$\sum_{n=0}^\inft |
33,950 | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$ | You don't specify anything about $X$. Is it the general case/what is its support?
If it is for discrete r.v.s, can you say something about the relationship between
$\sum_{n = 0}^{\infty} n P(X = n)$ and $\sum_{n = 0}^{\infty} P(X > n)$?
Consider:
\begin{eqnarray}
&0 P(0)& +\, 1& P(1)& +\, 2 &P(2)& +\, 3 &P(3)& +& ...&\\
& &\\
&= & [ &P(1)& +&P(2)& +&P(3)& +& ...&]\\
& & [ & & +&P(2)& +&P(3)& + &...&]\\
& & [ & & & & +&P(3)& + &...&]\\
& & [& & & & & & &...&]
\end{eqnarray}
Can you see a way to do it now? (Though I believe this approach establishes a stronger result than you have)
To consider it more generally than the discrete case, see here, and then adapt the above idea.
That is, can you see how establish a relationship between $∑^∞_{n=0}P(X>n)$ and a similar-looking integral that would the give the required inequality? | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$ | You don't specify anything about $X$. Is it the general case/what is its support?
If it is for discrete r.v.s, can you say something about the relationship between
$\sum_{n = 0}^{\infty} n P(X = n)$ | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$
You don't specify anything about $X$. Is it the general case/what is its support?
If it is for discrete r.v.s, can you say something about the relationship between
$\sum_{n = 0}^{\infty} n P(X = n)$ and $\sum_{n = 0}^{\infty} P(X > n)$?
Consider:
\begin{eqnarray}
&0 P(0)& +\, 1& P(1)& +\, 2 &P(2)& +\, 3 &P(3)& +& ...&\\
& &\\
&= & [ &P(1)& +&P(2)& +&P(3)& +& ...&]\\
& & [ & & +&P(2)& +&P(3)& + &...&]\\
& & [ & & & & +&P(3)& + &...&]\\
& & [& & & & & & &...&]
\end{eqnarray}
Can you see a way to do it now? (Though I believe this approach establishes a stronger result than you have)
To consider it more generally than the discrete case, see here, and then adapt the above idea.
That is, can you see how establish a relationship between $∑^∞_{n=0}P(X>n)$ and a similar-looking integral that would the give the required inequality? | Show that if $X\ge 0$ , $E(X)\le \sum_{n=0}^{\infty}P(X>n)$
You don't specify anything about $X$. Is it the general case/what is its support?
If it is for discrete r.v.s, can you say something about the relationship between
$\sum_{n = 0}^{\infty} n P(X = n)$ |
33,951 | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression? | Building hierarchical models is all about comparing groups. The power of the model is that you can treat the information about a particular group as evidence relating how that group compares to the aggregate behavior for a particular level, so if you don't have a lot of information about a single group, that group gets pushed towards the mean for the level. Here's an example:
Let's say we wanted to build a linear model describing student literacy (perhaps as a function of grade-level and socioeconomic status) for a region. What's the best way to go about this? One naive way would be to just treat all the students in the region as one big group and calculate an OLS model for literacy rates at each grade level. There's nothing exactly wrong with this, but let's say that for a particular student, we know that they attend an especially good school out in the burbs. Is it really fair to apply the county-wide average literacy for their grade to this student? Of course not, their literacy will probably be higher than average because of our observation about their school. So as an alternative, we could develop a separate model for each school. This is great for big schools, but again: what about those small private schools? If we only have 15 kids in a class, we're probably not going to have a very accurate model.
Hierarchical models allow us to do both simultaneously. At one level, we calculate the literacy rate for the entire region. At another level, we calculate the school-specific literacy rates. The less information we have about a particular school, the more closely it will approximate the across-school mean. This also allows us to step up the model to consider other school districts, and maybe even go a level higher to compare literacy between states or even consider differences between countries. Anything going on all the way up at the country level won't have a huge impact all the way down at the county level because there are so many levels in between, but information is information and we should allow it the opportunity to influence our results, especially where we have very little data.
So if we have very little data on a particular school, but we know how schools in that country, state, and county generally behave, we can make some informed inferences about that school and treat new information as evidence against our beliefs informed by the larger groups (the higher levels in the hierarchy). | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) | Building hierarchical models is all about comparing groups. The power of the model is that you can treat the information about a particular group as evidence relating how that group compares to the ag | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression?
Building hierarchical models is all about comparing groups. The power of the model is that you can treat the information about a particular group as evidence relating how that group compares to the aggregate behavior for a particular level, so if you don't have a lot of information about a single group, that group gets pushed towards the mean for the level. Here's an example:
Let's say we wanted to build a linear model describing student literacy (perhaps as a function of grade-level and socioeconomic status) for a region. What's the best way to go about this? One naive way would be to just treat all the students in the region as one big group and calculate an OLS model for literacy rates at each grade level. There's nothing exactly wrong with this, but let's say that for a particular student, we know that they attend an especially good school out in the burbs. Is it really fair to apply the county-wide average literacy for their grade to this student? Of course not, their literacy will probably be higher than average because of our observation about their school. So as an alternative, we could develop a separate model for each school. This is great for big schools, but again: what about those small private schools? If we only have 15 kids in a class, we're probably not going to have a very accurate model.
Hierarchical models allow us to do both simultaneously. At one level, we calculate the literacy rate for the entire region. At another level, we calculate the school-specific literacy rates. The less information we have about a particular school, the more closely it will approximate the across-school mean. This also allows us to step up the model to consider other school districts, and maybe even go a level higher to compare literacy between states or even consider differences between countries. Anything going on all the way up at the country level won't have a huge impact all the way down at the county level because there are so many levels in between, but information is information and we should allow it the opportunity to influence our results, especially where we have very little data.
So if we have very little data on a particular school, but we know how schools in that country, state, and county generally behave, we can make some informed inferences about that school and treat new information as evidence against our beliefs informed by the larger groups (the higher levels in the hierarchy). | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS)
Building hierarchical models is all about comparing groups. The power of the model is that you can treat the information about a particular group as evidence relating how that group compares to the ag |
33,952 | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression? | There is some confusion regarding the term "hierarchical regression". Most often this indeed refers to multilevel models, as the previous poster indicated.
In psychology textbooks (e.g., Cohen, Cohen, West, and Aiken), hierarchical regression refers to a simple OLS regression in which predictors are entered in some order (presumably based on theory) and then increments in explained variance and changes in regression coefficients are evaluated. In that sense "hierarchical regression" is not much different from OLS regression, other than certain sets of predictors are entered in the regression in a certain order. The similarity of the terms is somewhat unfortunate, because it creates some confusion. | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) | There is some confusion regarding the term "hierarchical regression". Most often this indeed refers to multilevel models, as the previous poster indicated.
In psychology textbooks (e.g., Cohen, Cohen | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression?
There is some confusion regarding the term "hierarchical regression". Most often this indeed refers to multilevel models, as the previous poster indicated.
In psychology textbooks (e.g., Cohen, Cohen, West, and Aiken), hierarchical regression refers to a simple OLS regression in which predictors are entered in some order (presumably based on theory) and then increments in explained variance and changes in regression coefficients are evaluated. In that sense "hierarchical regression" is not much different from OLS regression, other than certain sets of predictors are entered in the regression in a certain order. The similarity of the terms is somewhat unfortunate, because it creates some confusion. | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS)
There is some confusion regarding the term "hierarchical regression". Most often this indeed refers to multilevel models, as the previous poster indicated.
In psychology textbooks (e.g., Cohen, Cohen |
33,953 | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression? | Suppose you have a data sampled over $N$ different geographical locations. At each location you take $n$ measurements: each measurement, say, records the wind speed, which is dependent on the temperature and humidity (I have no idea about the real world, this is just for illustration purposes). The simple way (or ordinary linear regression) to proceed is to assume that the data is independent of the geographical location. In this case you just pool everything into one sample and perform OLR analysis. But if you have a hunch, that the location might have influence, you add another level of hierarchy - you assume that wind speed and humidity are dependent on geographical location. Hence, the first level of hierarchy is used to measure the variability within-source, or in each different geographical locations, and the second level takes into account the between-source variability.
You can add as many hierarchies as you need.
P.S. hierarchical regression, as performed within frequentist framework, is usually called multilevel regression, while within Bayesian formalism it is hierarchical regression. | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) | Suppose you have a data sampled over $N$ different geographical locations. At each location you take $n$ measurements: each measurement, say, records the wind speed, which is dependent on the temperat | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression?
Suppose you have a data sampled over $N$ different geographical locations. At each location you take $n$ measurements: each measurement, say, records the wind speed, which is dependent on the temperature and humidity (I have no idea about the real world, this is just for illustration purposes). The simple way (or ordinary linear regression) to proceed is to assume that the data is independent of the geographical location. In this case you just pool everything into one sample and perform OLR analysis. But if you have a hunch, that the location might have influence, you add another level of hierarchy - you assume that wind speed and humidity are dependent on geographical location. Hence, the first level of hierarchy is used to measure the variability within-source, or in each different geographical locations, and the second level takes into account the between-source variability.
You can add as many hierarchies as you need.
P.S. hierarchical regression, as performed within frequentist framework, is usually called multilevel regression, while within Bayesian formalism it is hierarchical regression. | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS)
Suppose you have a data sampled over $N$ different geographical locations. At each location you take $n$ measurements: each measurement, say, records the wind speed, which is dependent on the temperat |
33,954 | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression? | Keeping my answer short - one difference is when you are trying to predict results for effects that are related to your other independent variables, but you didn't observe in the sample. The simplest example of this is if there are particular domains where there is no direct information from the data you have - the classic example is that you have not sampled all schools, or all teachers/classrooms within a school. In OLS you can't say anything about teacher effects for unsampled teachers - but for hierarchical regression, the variance component for teachers does allow you to predict what the likely size of non-sampled teacher effects could be.
Additionally, hierarchical regression typically uses "shrinkage", and allows a kind of interpolation between including a particular group of effects in an OLS framework (e.g. teachers), and excluding them. Because of this effect, they are less prone to "overfitting" the data. | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) | Keeping my answer short - one difference is when you are trying to predict results for effects that are related to your other independent variables, but you didn't observe in the sample. The simplest | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS) regression?
Keeping my answer short - one difference is when you are trying to predict results for effects that are related to your other independent variables, but you didn't observe in the sample. The simplest example of this is if there are particular domains where there is no direct information from the data you have - the classic example is that you have not sampled all schools, or all teachers/classrooms within a school. In OLS you can't say anything about teacher effects for unsampled teachers - but for hierarchical regression, the variance component for teachers does allow you to predict what the likely size of non-sampled teacher effects could be.
Additionally, hierarchical regression typically uses "shrinkage", and allows a kind of interpolation between including a particular group of effects in an OLS framework (e.g. teachers), and excluding them. Because of this effect, they are less prone to "overfitting" the data. | What is the difference between a hierarchical linear regression and an ordinary least squares (OLS)
Keeping my answer short - one difference is when you are trying to predict results for effects that are related to your other independent variables, but you didn't observe in the sample. The simplest |
33,955 | How to find a suitable association of color with data value in a visualization? | It sounds like you might want to dedicate each color in your palette to approximately the same amount of data.
To illustrate, here is a histogram of a set of $110$ simulated depth readings:
Imagine this were smoothed out. In so doing, the histogram could be evenly sliced into vertical segments of equal area, using as many slices as you like (I used $10$ pieces for this example.) To keep the areas equal, the slices have to be skinny where the histogram is high--that is, where there are lots of data--and fat where the histogram is low--that is, where there is little data.
One way to accomplish the slicing easily is to plot the total amount of data ("cumulative proportion") against the depth. Slice the vertical axis into even intervals, then read the depths where the slices cross the plot: use those as the cutpoints for visualizing depths.
The algorithm for computing the cutpoints from the data should be obvious and is simple to write in almost any programming language: sort the values, break the list into groups of approximately equal size, and choose cutpoints to separate the largest value in each group from the smallest value in the group that succeeds it. | How to find a suitable association of color with data value in a visualization? | It sounds like you might want to dedicate each color in your palette to approximately the same amount of data.
To illustrate, here is a histogram of a set of $110$ simulated depth readings:
Imagine t | How to find a suitable association of color with data value in a visualization?
It sounds like you might want to dedicate each color in your palette to approximately the same amount of data.
To illustrate, here is a histogram of a set of $110$ simulated depth readings:
Imagine this were smoothed out. In so doing, the histogram could be evenly sliced into vertical segments of equal area, using as many slices as you like (I used $10$ pieces for this example.) To keep the areas equal, the slices have to be skinny where the histogram is high--that is, where there are lots of data--and fat where the histogram is low--that is, where there is little data.
One way to accomplish the slicing easily is to plot the total amount of data ("cumulative proportion") against the depth. Slice the vertical axis into even intervals, then read the depths where the slices cross the plot: use those as the cutpoints for visualizing depths.
The algorithm for computing the cutpoints from the data should be obvious and is simple to write in almost any programming language: sort the values, break the list into groups of approximately equal size, and choose cutpoints to separate the largest value in each group from the smallest value in the group that succeeds it. | How to find a suitable association of color with data value in a visualization?
It sounds like you might want to dedicate each color in your palette to approximately the same amount of data.
To illustrate, here is a histogram of a set of $110$ simulated depth readings:
Imagine t |
33,956 | How to find a suitable association of color with data value in a visualization? | Though @whuber's answer provides just what you asked, I'd like to caution that what you ask may not be the best way to visually represent your data, for two reasons.
Viewers will naturally assume that colors are evenly distributed by value (depth) rather than by rank. You will have to work hard with your labeling to get the viewer's cognitive brain to overrule what their visual system is telling them.
Rank may not be more important to your viewers than actual depth. If there are lots of values between 0 and 1, say, does it matter analytically how those values are distributed?
You know your application best, of course, so I can't say what the right answer is, but below are some alternatives using data generated by
r = Sqrt((:x * :x + :y * :y) / 400);
t = ArcTan(:y, :x);
z = (12 * Exp(-r * r * 3)) * Abs(Sin(2 * Pi() * r) - r * Cos(3 * t))
The data goes from 0 to 12.5 with the following distribution:
A 3-D surface plot show a some peaks, a shallow trough and a small mound:
Now let's look at some 2-D contour plots.
Straight linear color mapping, which misses the smaller features as you've noticed:
If the variation in the deep areas is unimportant, then clipping the color mapping allows more colors for the smaller depths while maintaining a linear mapping in that area:
For comparison, here's the rank-colored view (sorry that my legend is in rank values instead of depth values):
I'm not sure if that is a good representation for your application or not. The detail in the shallow trough is exaggerated. A log color mapping is similar and has the advantages of having some real interpretation and can be consistent across data sets, but log is still not perceptual (apologies again for the legend):
Finally, here's an approach in a slightly different direction that can be combined with any of the above to increase resolution: a multi-hued color mapping. In this case, the coloring is linear and clipped:
Post-finally, an approach that my software doesn't readily allow is to use a multi-hued piece-wise linear color mapping, which I've seen in some elevation maps. For instance, the low altitudes are greens in 50 ft increments, the mid altitudes are tans in 200 ft increments and the highs are grays in 800 ft increments.
Bottom line: it's better if the viewer's brain works with your visual perception system instead of against it. | How to find a suitable association of color with data value in a visualization? | Though @whuber's answer provides just what you asked, I'd like to caution that what you ask may not be the best way to visually represent your data, for two reasons.
Viewers will naturally assume tha | How to find a suitable association of color with data value in a visualization?
Though @whuber's answer provides just what you asked, I'd like to caution that what you ask may not be the best way to visually represent your data, for two reasons.
Viewers will naturally assume that colors are evenly distributed by value (depth) rather than by rank. You will have to work hard with your labeling to get the viewer's cognitive brain to overrule what their visual system is telling them.
Rank may not be more important to your viewers than actual depth. If there are lots of values between 0 and 1, say, does it matter analytically how those values are distributed?
You know your application best, of course, so I can't say what the right answer is, but below are some alternatives using data generated by
r = Sqrt((:x * :x + :y * :y) / 400);
t = ArcTan(:y, :x);
z = (12 * Exp(-r * r * 3)) * Abs(Sin(2 * Pi() * r) - r * Cos(3 * t))
The data goes from 0 to 12.5 with the following distribution:
A 3-D surface plot show a some peaks, a shallow trough and a small mound:
Now let's look at some 2-D contour plots.
Straight linear color mapping, which misses the smaller features as you've noticed:
If the variation in the deep areas is unimportant, then clipping the color mapping allows more colors for the smaller depths while maintaining a linear mapping in that area:
For comparison, here's the rank-colored view (sorry that my legend is in rank values instead of depth values):
I'm not sure if that is a good representation for your application or not. The detail in the shallow trough is exaggerated. A log color mapping is similar and has the advantages of having some real interpretation and can be consistent across data sets, but log is still not perceptual (apologies again for the legend):
Finally, here's an approach in a slightly different direction that can be combined with any of the above to increase resolution: a multi-hued color mapping. In this case, the coloring is linear and clipped:
Post-finally, an approach that my software doesn't readily allow is to use a multi-hued piece-wise linear color mapping, which I've seen in some elevation maps. For instance, the low altitudes are greens in 50 ft increments, the mid altitudes are tans in 200 ft increments and the highs are grays in 800 ft increments.
Bottom line: it's better if the viewer's brain works with your visual perception system instead of against it. | How to find a suitable association of color with data value in a visualization?
Though @whuber's answer provides just what you asked, I'd like to caution that what you ask may not be the best way to visually represent your data, for two reasons.
Viewers will naturally assume tha |
33,957 | How to use glmnet without the intercept? | For compleness' sake (and because I accidentally bumped in to this question): starting with version 1.9-3, fitting without intercepts is supported (intercept=FALSE). | How to use glmnet without the intercept? | For compleness' sake (and because I accidentally bumped in to this question): starting with version 1.9-3, fitting without intercepts is supported (intercept=FALSE). | How to use glmnet without the intercept?
For compleness' sake (and because I accidentally bumped in to this question): starting with version 1.9-3, fitting without intercepts is supported (intercept=FALSE). | How to use glmnet without the intercept?
For compleness' sake (and because I accidentally bumped in to this question): starting with version 1.9-3, fitting without intercepts is supported (intercept=FALSE). |
33,958 | What's the distribution of these data? | I suggest you give heavy-tail Lambert W x F or skewed Lambert W x F distributions a try (disclaimer: I am the author). In R they are implemented in the LambertW package.
They arise from a parametric, non-linear transformation of a random variable (RV) $X \sim F$, to a heavy-tailed (skewed) version $Y \sim \text{Lambert W} \times F$. For $F$ being Gaussian, heavy-tail Lambert W x F reduces to Tukey's $h$ distribution. (I will here outline the heavy-tail version, the skewed one is analogous.)
They have one parameter $\delta \geq 0$ ($\gamma \in \mathbb{R}$ for skewed Lambert W x F) that regulates the degree of tail heaviness (skewness). Optionally, you can also choose different left and right heavy tails to achieve heavy-tails and asymmetry. It transforms a standard Normal $U \sim \mathcal{N}(0,1)$ to a Lambert W $\times$ Gaussian $Z$ by
$$
Z = U \exp\left(\frac{\delta}{2} U^2\right)
$$
If $\delta > 0$ $Z$ has heavier tails than $U$; for $\delta = 0$, $Z \equiv U$.
If you don't want to use the Gaussian as your baseline, you can create other Lambert W versions of your favorite distribution, e.g., t, uniform, gamma, exponential, beta, ... However, for your dataset a double heavy-tail Lambert W x Gaussian (or a skew Lambert W x t) distribution seem to be a good starting point.
library(LambertW)
set.seed(10)
### Set parameters ####
# skew Lambert W x t distribution with
# (location, scale, df) = (0,1,3) and positive skew parameter gamma = 0.1
theta.st <- list(beta = c(0, 1, 3), gamma = 0.1)
# double heavy-tail Lambert W x Gaussian
# with (mu, sigma) = (0,1) and left delta=0.2; right delta = 0.4 (-> heavier on the right)
theta.hh <- list(beta = c(0, 1), delta = c(0.2, 0.4))
### Draw random sample ####
# skewed Lambert W x t
yy <- rLambertW(n=1000, distname="t", theta = theta.st)
# double heavy-tail Lambert W x Gaussian (= Tukey's hh)
zz =<- rLambertW(n=1000, distname = "normal", theta = theta.hh)
### Plot ecdf and qq-plot ####
op <- par(no.readonly=TRUE)
par(mfrow=c(2,2), mar=c(3,3,2,1))
plot(ecdf(yy))
qqnorm(yy); qqline(yy)
plot(ecdf(zz))
qqnorm(zz); qqline(zz)
par(op)
In practice, of course, you have to estimate $\theta = (\beta, \delta)$, where $\beta$ is the parameter of your input distribution (e.g., $\beta = (\mu, \sigma)$ for a Gaussian, or $\beta = (c, s, \nu)$ for a $t$ distribution; see paper for details):
### Parameter estimation ####
mod.Lst <- MLE_LambertW(yy, distname="t", type="s")
mod.Lhh <- MLE_LambertW(zz, distname="normal", type="hh")
layout(matrix(1:2, ncol = 2))
plot(mod.Lst)
plot(mod.Lhh)
Since this heavy-tail generation is based on a bijective transformations of RVs/data, you can remove heavy-tails from data and check if they are nice now, i.e., if they are Gaussian (and test it using Normality tests).
### Test goodness of fit ####
## test if 'symmetrized' data follows a Gaussian
xx <- get_input(mod.Lhh)
normfit(xx)
This worked pretty well for the simulated dataset. I suggest you give it a try and see if you can also Gaussianize() your data.
However, as @whuber pointed out, bimodality can be an issue here. So maybe you want to check in the transformed data (without the heavy-tails) what's going on with this bimodality and thus give you insights on how to model your (original) data. | What's the distribution of these data? | I suggest you give heavy-tail Lambert W x F or skewed Lambert W x F distributions a try (disclaimer: I am the author). In R they are implemented in the LambertW package.
They arise from a parametric, | What's the distribution of these data?
I suggest you give heavy-tail Lambert W x F or skewed Lambert W x F distributions a try (disclaimer: I am the author). In R they are implemented in the LambertW package.
They arise from a parametric, non-linear transformation of a random variable (RV) $X \sim F$, to a heavy-tailed (skewed) version $Y \sim \text{Lambert W} \times F$. For $F$ being Gaussian, heavy-tail Lambert W x F reduces to Tukey's $h$ distribution. (I will here outline the heavy-tail version, the skewed one is analogous.)
They have one parameter $\delta \geq 0$ ($\gamma \in \mathbb{R}$ for skewed Lambert W x F) that regulates the degree of tail heaviness (skewness). Optionally, you can also choose different left and right heavy tails to achieve heavy-tails and asymmetry. It transforms a standard Normal $U \sim \mathcal{N}(0,1)$ to a Lambert W $\times$ Gaussian $Z$ by
$$
Z = U \exp\left(\frac{\delta}{2} U^2\right)
$$
If $\delta > 0$ $Z$ has heavier tails than $U$; for $\delta = 0$, $Z \equiv U$.
If you don't want to use the Gaussian as your baseline, you can create other Lambert W versions of your favorite distribution, e.g., t, uniform, gamma, exponential, beta, ... However, for your dataset a double heavy-tail Lambert W x Gaussian (or a skew Lambert W x t) distribution seem to be a good starting point.
library(LambertW)
set.seed(10)
### Set parameters ####
# skew Lambert W x t distribution with
# (location, scale, df) = (0,1,3) and positive skew parameter gamma = 0.1
theta.st <- list(beta = c(0, 1, 3), gamma = 0.1)
# double heavy-tail Lambert W x Gaussian
# with (mu, sigma) = (0,1) and left delta=0.2; right delta = 0.4 (-> heavier on the right)
theta.hh <- list(beta = c(0, 1), delta = c(0.2, 0.4))
### Draw random sample ####
# skewed Lambert W x t
yy <- rLambertW(n=1000, distname="t", theta = theta.st)
# double heavy-tail Lambert W x Gaussian (= Tukey's hh)
zz =<- rLambertW(n=1000, distname = "normal", theta = theta.hh)
### Plot ecdf and qq-plot ####
op <- par(no.readonly=TRUE)
par(mfrow=c(2,2), mar=c(3,3,2,1))
plot(ecdf(yy))
qqnorm(yy); qqline(yy)
plot(ecdf(zz))
qqnorm(zz); qqline(zz)
par(op)
In practice, of course, you have to estimate $\theta = (\beta, \delta)$, where $\beta$ is the parameter of your input distribution (e.g., $\beta = (\mu, \sigma)$ for a Gaussian, or $\beta = (c, s, \nu)$ for a $t$ distribution; see paper for details):
### Parameter estimation ####
mod.Lst <- MLE_LambertW(yy, distname="t", type="s")
mod.Lhh <- MLE_LambertW(zz, distname="normal", type="hh")
layout(matrix(1:2, ncol = 2))
plot(mod.Lst)
plot(mod.Lhh)
Since this heavy-tail generation is based on a bijective transformations of RVs/data, you can remove heavy-tails from data and check if they are nice now, i.e., if they are Gaussian (and test it using Normality tests).
### Test goodness of fit ####
## test if 'symmetrized' data follows a Gaussian
xx <- get_input(mod.Lhh)
normfit(xx)
This worked pretty well for the simulated dataset. I suggest you give it a try and see if you can also Gaussianize() your data.
However, as @whuber pointed out, bimodality can be an issue here. So maybe you want to check in the transformed data (without the heavy-tails) what's going on with this bimodality and thus give you insights on how to model your (original) data. | What's the distribution of these data?
I suggest you give heavy-tail Lambert W x F or skewed Lambert W x F distributions a try (disclaimer: I am the author). In R they are implemented in the LambertW package.
They arise from a parametric, |
33,959 | What's the distribution of these data? | This looks like an asymmetric distribution that has longer tails, in both directions, than the normal distribution.
You can see the long-tailedness because the observed points are more extreme than those expected under the normal distribution, on both the left and right side (i.e. they are below and above the line, respectively).
You can see the asymmetry because, in the right tail, the extent to which the points are more extreme than what would be expected under normal distribution is greater than it is in the left tail.
I can't think of any "canned" distributions that have this shape but it's not too hard to "cook up" a distribution that has the properties stated above.
Here is a simulated example (in R):
set.seed(1234)
x=rexp(1e3)
y=-rexp(1e3,rate=2)
z=c(x,y)
qqnorm(z)
qqline(z) # see below for the plot.
plot( ecdf(z) ) # see below for plot (2nd plot)
The variable here is a 50/50 mixture between an ${\rm exponential}(1)$ and an ${\rm exponential}(2)$ reflected around 0. This choice was made because it will be definitionally asymmetric, since there are different rate parameters, and they will both be long-tailed relative to the normal distribution, with the right tail being longer, since the rate on the right hand side is larger.
This example produces a pretty similar qqplot and empirical CDF (qualitatively) to what you're seeing: | What's the distribution of these data? | This looks like an asymmetric distribution that has longer tails, in both directions, than the normal distribution.
You can see the long-tailedness because the observed points are more extreme than | What's the distribution of these data?
This looks like an asymmetric distribution that has longer tails, in both directions, than the normal distribution.
You can see the long-tailedness because the observed points are more extreme than those expected under the normal distribution, on both the left and right side (i.e. they are below and above the line, respectively).
You can see the asymmetry because, in the right tail, the extent to which the points are more extreme than what would be expected under normal distribution is greater than it is in the left tail.
I can't think of any "canned" distributions that have this shape but it's not too hard to "cook up" a distribution that has the properties stated above.
Here is a simulated example (in R):
set.seed(1234)
x=rexp(1e3)
y=-rexp(1e3,rate=2)
z=c(x,y)
qqnorm(z)
qqline(z) # see below for the plot.
plot( ecdf(z) ) # see below for plot (2nd plot)
The variable here is a 50/50 mixture between an ${\rm exponential}(1)$ and an ${\rm exponential}(2)$ reflected around 0. This choice was made because it will be definitionally asymmetric, since there are different rate parameters, and they will both be long-tailed relative to the normal distribution, with the right tail being longer, since the rate on the right hand side is larger.
This example produces a pretty similar qqplot and empirical CDF (qualitatively) to what you're seeing: | What's the distribution of these data?
This looks like an asymmetric distribution that has longer tails, in both directions, than the normal distribution.
You can see the long-tailedness because the observed points are more extreme than |
33,960 | What's the distribution of these data? | In order to figure which distribution is the best fit, I would first identify some potential target distributions: I would think about the real world process that generated the data, then I would fit some potential densities to the data and compare their loglikelihood scores to see which potential distribution fit best. This is easy in R with the fitdistr function in the MASS library.
If your data is like Macro's z then:
>fitdistr(z,'cauchy',list(location=mean(z),scale=sqrt(sd(z))))$loglik
[1] -2949.068
> fitdistr(z,'normal')$loglik
[1] -3026.648
> fitdistr(z,'t')$loglik
[1] -2830.861
So this gives the t distribution as best fitting (of those we tried) for Macro's data. confirm this with some qqplots using the parameters from fitdistr.
> qqplot(z,rt(length(z),df=2.7))
Then compare this plot to the other distribution fits. | What's the distribution of these data? | In order to figure which distribution is the best fit, I would first identify some potential target distributions: I would think about the real world process that generated the data, then I would fit | What's the distribution of these data?
In order to figure which distribution is the best fit, I would first identify some potential target distributions: I would think about the real world process that generated the data, then I would fit some potential densities to the data and compare their loglikelihood scores to see which potential distribution fit best. This is easy in R with the fitdistr function in the MASS library.
If your data is like Macro's z then:
>fitdistr(z,'cauchy',list(location=mean(z),scale=sqrt(sd(z))))$loglik
[1] -2949.068
> fitdistr(z,'normal')$loglik
[1] -3026.648
> fitdistr(z,'t')$loglik
[1] -2830.861
So this gives the t distribution as best fitting (of those we tried) for Macro's data. confirm this with some qqplots using the parameters from fitdistr.
> qqplot(z,rt(length(z),df=2.7))
Then compare this plot to the other distribution fits. | What's the distribution of these data?
In order to figure which distribution is the best fit, I would first identify some potential target distributions: I would think about the real world process that generated the data, then I would fit |
33,961 | Base classifiers for boosting | I'm pretty sure you're correct and that there's no reason that necessarily requires using decision trees instead of other classifiers. That said, I think there are a few reasons they're often used. Speed is one factor: Boosting may require training a lot of classifiers. If each one is a giant, multi-layer neural network, the whole procedure is going to be very slow.
More importantly, I think decision trees are "good enough." Since the whole idea behind boosting is pooling weak classifiers, there's not a huge incentive to drop in a heavy-weight solutions that might require more tuning (e.g., fiddling with the hyperparameters and kernel for SVMs).
Finally, boosting and decision trees are, at least in my head, somewhat conceptually similar (e.g., add a node/build a new classifier). A lot of the ensemble learning stuff seems to use trees. I think you could have a "random forest" of Naive Bayes learners if you really wanted to. | Base classifiers for boosting | I'm pretty sure you're correct and that there's no reason that necessarily requires using decision trees instead of other classifiers. That said, I think there are a few reasons they're often used. Sp | Base classifiers for boosting
I'm pretty sure you're correct and that there's no reason that necessarily requires using decision trees instead of other classifiers. That said, I think there are a few reasons they're often used. Speed is one factor: Boosting may require training a lot of classifiers. If each one is a giant, multi-layer neural network, the whole procedure is going to be very slow.
More importantly, I think decision trees are "good enough." Since the whole idea behind boosting is pooling weak classifiers, there's not a huge incentive to drop in a heavy-weight solutions that might require more tuning (e.g., fiddling with the hyperparameters and kernel for SVMs).
Finally, boosting and decision trees are, at least in my head, somewhat conceptually similar (e.g., add a node/build a new classifier). A lot of the ensemble learning stuff seems to use trees. I think you could have a "random forest" of Naive Bayes learners if you really wanted to. | Base classifiers for boosting
I'm pretty sure you're correct and that there's no reason that necessarily requires using decision trees instead of other classifiers. That said, I think there are a few reasons they're often used. Sp |
33,962 | Base classifiers for boosting | There are some characteristics which may add insight to an understanding of ensemble methods.
Bagging
Probably the simplest ensemble method, bagging, which is nothing more than a collection of similar homogeneous classifiers built on resampled training data and held together by a combination method, ameliorates the variance caused by instability in the base classifiers by averaging their outputs. The ensemble leverages this instability to address the variance component of the error of the base classifier and to a lesser degree their bias.
You can think of bagging as providing a significant degree of smoothing to what would otherwise be a very unstable "weak" base classifier.One reason, apart from their tendency towards computational efficiency, why weak classifiers are chosen is that they exhibi higher diversity, which is a beneficial characteristic for ensembles.
If you visualise an bagged ensemble full of very strong stable classifiers, they will have a very high degree of agreement on their classifications of examples presented to the ensemble. In effect they all vote the same way.
A committee in which all members vote similarly has little utility over any single member of the committee.
So to work effectively an ensemble must embrace a degree of diversity amongst it's members. Clearly a committee of members who spew forth almost random opinions is not of great utility either. So some intermediate position between these extremes is sought.
In practice, as no complete theory on the subject exists, this compromise is found using empirical methods such as cross-validation or hold out trials. These are used to gauge a suitable strength for the base classifier.
Because this search for an optimum ensemble will normally involve adjusting parameters of the base classifiers and the ensemble itself, it is desirable that the number of such parameters be kept as small as possible. If not, the dimensionality of the parameter search space quickly means that finding the global minimum is computationally intractable. Decision trees are a popular choice because, as has been mentioned, they can be used effectively without necessarily tuning any of their parameters.
Random Forests
Random forests, which are primarily bagged decision trees, leverage the significant instability of trees by the injecting of a strong stochastic component [ the permutations of a small number of features/factors at each decision node within a tree ] to create diversity within the ensemble. Because each node of a tree is presented with a new random selection of features the trees are highly diverse. The ensemble then has the effect of averaging out the variance and bias of the diverse collection of trees.
To be effective a "random forest" of naive Bayes classifiers, or any other stable base classifier such as SVMs, needs the addition of stochastic element. For stable classifiers relatively small variations in training data, such as arise from bagging, lead to very similar classifiers.
To increase diversity other approaches could be applied. For instance permuting the features shown to each base classifier. This has a restriction that the significant available diversity is held to the number of combinations of the feature set. Once the combinations have been exhausted there are no new classifiers available to the ensemble which would vote differently to existing members.
For problems with relatively few features this severely limits the available pool of classifiers. It would be possible to inject further sources of randomness, say by aggressively sub-sampling the training data. The evidence would seem to be, that in the general case, such an approach is inferior to the particular blend of bias and diversity that a random forest offers.
It is possible to successfully utilise other unstable base classifiers, such as multi-layer perceptrons (neural networks) which have few nodes and restricted amounts of training or point based space filling approaches for instance stochastic discrimination, to inject diversity in ensembles methods. Certainly in the case of MLPs a degree of parameter tuning is essential.
Boosting
Boosting takes a different approach to building the ensemble than the simple agglomerative model adopted by Bagging. I suppose conceptually if you think of bagging as being a flat ensemble model, boosting constructs a layered classifier.
Each round of boosting chooses a new classifier from a set of potential classifiers constructed from training data weighted, or resampled, according to the mis-classifications of the previous round. The new classifier is selected so as to minimise the total ensemble error.
This is in sharp contrast to the lack of selection criteria resent in random forest ensemble construction. Each new base classifier is specifically required to focus on the weak points of the existing ensemble, with the result that boosting aggressively drives down training error.
In the early stages of ensemble construction boosting has few weak classifiers and each is focused on different areas of the training space, the effect of this is to primarily reduce bias. As the ensemble size grows the scope for bias reduction diminishes and error from variance is improved.
The benefit from instability in the base classifier for boosting is that as the ensemble grows, the number of remaining mis-classified examples falls. A higher degree of diversity is needed to generate a classifier which adopts a usefully different view of the remaining samples than its predecessors.
The power of this approach can be seen by the fact that acceptable results can be achieved with only decision stumps, though MLPs have proved very effective in general.
Because of this constant focus on the misclassified examples, boosting's weakness is that it can be susceptible to noise, to some extent logitboost attempts to address this failing.
No free lunch
It is worth remembering that no grand unified theory of machine learning exists and that the results of any particular classifier are highly dependent on the type of data it is used with. So, a priori, there isn't any hard and fast reason to assert one classifier type being superior over another, other than the consensus derived from previous experimentation with similar data and the general utility shown by an algorithm across a variety of data sets. To get a good solution, you may want to experiment with a handful of popular approaches. | Base classifiers for boosting | There are some characteristics which may add insight to an understanding of ensemble methods.
Bagging
Probably the simplest ensemble method, bagging, which is nothing more than a collection of similar | Base classifiers for boosting
There are some characteristics which may add insight to an understanding of ensemble methods.
Bagging
Probably the simplest ensemble method, bagging, which is nothing more than a collection of similar homogeneous classifiers built on resampled training data and held together by a combination method, ameliorates the variance caused by instability in the base classifiers by averaging their outputs. The ensemble leverages this instability to address the variance component of the error of the base classifier and to a lesser degree their bias.
You can think of bagging as providing a significant degree of smoothing to what would otherwise be a very unstable "weak" base classifier.One reason, apart from their tendency towards computational efficiency, why weak classifiers are chosen is that they exhibi higher diversity, which is a beneficial characteristic for ensembles.
If you visualise an bagged ensemble full of very strong stable classifiers, they will have a very high degree of agreement on their classifications of examples presented to the ensemble. In effect they all vote the same way.
A committee in which all members vote similarly has little utility over any single member of the committee.
So to work effectively an ensemble must embrace a degree of diversity amongst it's members. Clearly a committee of members who spew forth almost random opinions is not of great utility either. So some intermediate position between these extremes is sought.
In practice, as no complete theory on the subject exists, this compromise is found using empirical methods such as cross-validation or hold out trials. These are used to gauge a suitable strength for the base classifier.
Because this search for an optimum ensemble will normally involve adjusting parameters of the base classifiers and the ensemble itself, it is desirable that the number of such parameters be kept as small as possible. If not, the dimensionality of the parameter search space quickly means that finding the global minimum is computationally intractable. Decision trees are a popular choice because, as has been mentioned, they can be used effectively without necessarily tuning any of their parameters.
Random Forests
Random forests, which are primarily bagged decision trees, leverage the significant instability of trees by the injecting of a strong stochastic component [ the permutations of a small number of features/factors at each decision node within a tree ] to create diversity within the ensemble. Because each node of a tree is presented with a new random selection of features the trees are highly diverse. The ensemble then has the effect of averaging out the variance and bias of the diverse collection of trees.
To be effective a "random forest" of naive Bayes classifiers, or any other stable base classifier such as SVMs, needs the addition of stochastic element. For stable classifiers relatively small variations in training data, such as arise from bagging, lead to very similar classifiers.
To increase diversity other approaches could be applied. For instance permuting the features shown to each base classifier. This has a restriction that the significant available diversity is held to the number of combinations of the feature set. Once the combinations have been exhausted there are no new classifiers available to the ensemble which would vote differently to existing members.
For problems with relatively few features this severely limits the available pool of classifiers. It would be possible to inject further sources of randomness, say by aggressively sub-sampling the training data. The evidence would seem to be, that in the general case, such an approach is inferior to the particular blend of bias and diversity that a random forest offers.
It is possible to successfully utilise other unstable base classifiers, such as multi-layer perceptrons (neural networks) which have few nodes and restricted amounts of training or point based space filling approaches for instance stochastic discrimination, to inject diversity in ensembles methods. Certainly in the case of MLPs a degree of parameter tuning is essential.
Boosting
Boosting takes a different approach to building the ensemble than the simple agglomerative model adopted by Bagging. I suppose conceptually if you think of bagging as being a flat ensemble model, boosting constructs a layered classifier.
Each round of boosting chooses a new classifier from a set of potential classifiers constructed from training data weighted, or resampled, according to the mis-classifications of the previous round. The new classifier is selected so as to minimise the total ensemble error.
This is in sharp contrast to the lack of selection criteria resent in random forest ensemble construction. Each new base classifier is specifically required to focus on the weak points of the existing ensemble, with the result that boosting aggressively drives down training error.
In the early stages of ensemble construction boosting has few weak classifiers and each is focused on different areas of the training space, the effect of this is to primarily reduce bias. As the ensemble size grows the scope for bias reduction diminishes and error from variance is improved.
The benefit from instability in the base classifier for boosting is that as the ensemble grows, the number of remaining mis-classified examples falls. A higher degree of diversity is needed to generate a classifier which adopts a usefully different view of the remaining samples than its predecessors.
The power of this approach can be seen by the fact that acceptable results can be achieved with only decision stumps, though MLPs have proved very effective in general.
Because of this constant focus on the misclassified examples, boosting's weakness is that it can be susceptible to noise, to some extent logitboost attempts to address this failing.
No free lunch
It is worth remembering that no grand unified theory of machine learning exists and that the results of any particular classifier are highly dependent on the type of data it is used with. So, a priori, there isn't any hard and fast reason to assert one classifier type being superior over another, other than the consensus derived from previous experimentation with similar data and the general utility shown by an algorithm across a variety of data sets. To get a good solution, you may want to experiment with a handful of popular approaches. | Base classifiers for boosting
There are some characteristics which may add insight to an understanding of ensemble methods.
Bagging
Probably the simplest ensemble method, bagging, which is nothing more than a collection of similar |
33,963 | Seeking to understand asymmetry in hypothesis testing | I suspect it means that if you perform a test for H1 with null H0 and are not able to reject the null hypothesis, that does not imply that if you performed a test for H0 with H1 as the null that you would be able to reject H1.
The reason is that failing to reject the null hypothesis does not mean that the null hypothesis is true, it could just mean that there isn't enough data to be confident that the null hypothesis is false. | Seeking to understand asymmetry in hypothesis testing | I suspect it means that if you perform a test for H1 with null H0 and are not able to reject the null hypothesis, that does not imply that if you performed a test for H0 with H1 as the null that you w | Seeking to understand asymmetry in hypothesis testing
I suspect it means that if you perform a test for H1 with null H0 and are not able to reject the null hypothesis, that does not imply that if you performed a test for H0 with H1 as the null that you would be able to reject H1.
The reason is that failing to reject the null hypothesis does not mean that the null hypothesis is true, it could just mean that there isn't enough data to be confident that the null hypothesis is false. | Seeking to understand asymmetry in hypothesis testing
I suspect it means that if you perform a test for H1 with null H0 and are not able to reject the null hypothesis, that does not imply that if you performed a test for H0 with H1 as the null that you w |
33,964 | Seeking to understand asymmetry in hypothesis testing | Suppose you have a random sample of uncirculated US double eagle gold coins which you have assayed for gold content. Although manufacturing variations precluded the US Mint from guaranteeing that every double eagle had exactly 0.9675 Troy ounces of gold, the Mint tried to achieve this as an average value. If they succeeded, the distribution of weights in your sample should be centered close to this value. A sample average that is sufficiently far from 0.9675 (compared to the spread of your measured values) would be evidence that these coins are not honest double eagles.
In this example the null hypothesis is that the population of double eagles averages 0.9675 ounces and the alternative is that the average differs from 0.9675. Suppose you were to swap these two statements and instead tried to test whether the population mean differs from 0.9675. You cannot test this hypothesis with data because (literally) any set of values would be consistent with it. (If you always obtained 0.9675 in every assay, your measurement procedure itself would be called into question because the results would be too consistent!) There is an inherent, profound, asymmetry between the two hypotheses because one of them makes a specific quantitative prediction about how the data might be distributed but the other does not.
There's another asymmetry in hypothesis testing. In the same situation, you might be interested in assessing whether the population of US double eagles is underweight. A sample average that is sufficiently low would be good evidence of that. The average would have to be substantially lower than 0.9675, though: how much lower is the "critical value" for the test. In this situation you can switch the null and alternate hypotheses. The new null is that the population of US double eagles is overweight. A sample average that is sufficiently high would be good evidence of that. That average would have to be substantially higher than 0.9675, though: how much higher is the critical value for this reversed test. In each case, the set of possible sample averages is partitioned into two parts: those less than the critical value and those greater than the critical value. Because the two critical values are not the same, the partitions differ, too. For instance, a sufficiently low sample average in the first case lets you conclude that the population mean is underweight, but in the second case it is consistent with the null hypothesis that the population mean is not overweight. Notice the distinction between evidence that is consistent with a hypothesis and evidence that falsifies a hypothesis. That asymmetry is inherent in the logic of hypothesis testing. | Seeking to understand asymmetry in hypothesis testing | Suppose you have a random sample of uncirculated US double eagle gold coins which you have assayed for gold content. Although manufacturing variations precluded the US Mint from guaranteeing that eve | Seeking to understand asymmetry in hypothesis testing
Suppose you have a random sample of uncirculated US double eagle gold coins which you have assayed for gold content. Although manufacturing variations precluded the US Mint from guaranteeing that every double eagle had exactly 0.9675 Troy ounces of gold, the Mint tried to achieve this as an average value. If they succeeded, the distribution of weights in your sample should be centered close to this value. A sample average that is sufficiently far from 0.9675 (compared to the spread of your measured values) would be evidence that these coins are not honest double eagles.
In this example the null hypothesis is that the population of double eagles averages 0.9675 ounces and the alternative is that the average differs from 0.9675. Suppose you were to swap these two statements and instead tried to test whether the population mean differs from 0.9675. You cannot test this hypothesis with data because (literally) any set of values would be consistent with it. (If you always obtained 0.9675 in every assay, your measurement procedure itself would be called into question because the results would be too consistent!) There is an inherent, profound, asymmetry between the two hypotheses because one of them makes a specific quantitative prediction about how the data might be distributed but the other does not.
There's another asymmetry in hypothesis testing. In the same situation, you might be interested in assessing whether the population of US double eagles is underweight. A sample average that is sufficiently low would be good evidence of that. The average would have to be substantially lower than 0.9675, though: how much lower is the "critical value" for the test. In this situation you can switch the null and alternate hypotheses. The new null is that the population of US double eagles is overweight. A sample average that is sufficiently high would be good evidence of that. That average would have to be substantially higher than 0.9675, though: how much higher is the critical value for this reversed test. In each case, the set of possible sample averages is partitioned into two parts: those less than the critical value and those greater than the critical value. Because the two critical values are not the same, the partitions differ, too. For instance, a sufficiently low sample average in the first case lets you conclude that the population mean is underweight, but in the second case it is consistent with the null hypothesis that the population mean is not overweight. Notice the distinction between evidence that is consistent with a hypothesis and evidence that falsifies a hypothesis. That asymmetry is inherent in the logic of hypothesis testing. | Seeking to understand asymmetry in hypothesis testing
Suppose you have a random sample of uncirculated US double eagle gold coins which you have assayed for gold content. Although manufacturing variations precluded the US Mint from guaranteeing that eve |
33,965 | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different? | I've had issues with package glmnet over versions. If I remember well, it was going from version 1.5 to 1.6, but I may be off a little.
The package creators/maintainers changed the order of the classes of their objects (so it became c("lognet", "glmnet") instead of c("glmnet", "lognet") - or it may have been the other way around). Of course, they also changed all their S3 functions to properly handle this (e.g. predict.lognet).
The problem with this was: an object you had created with an old version of glmnet was not compatible with the new functions (since dispatching worked the other way around). Most people wouldn't be in that spot (who saves a glmnet object for later use?), but I was.
Mind you: this is a very powerful package, developed by extremely intelligent people, so it could happen to anyone :-) | Are there examples of R packages changing dramatically between version such that the results of a st | I've had issues with package glmnet over versions. If I remember well, it was going from version 1.5 to 1.6, but I may be off a little.
The package creators/maintainers changed the order of the classe | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different?
I've had issues with package glmnet over versions. If I remember well, it was going from version 1.5 to 1.6, but I may be off a little.
The package creators/maintainers changed the order of the classes of their objects (so it became c("lognet", "glmnet") instead of c("glmnet", "lognet") - or it may have been the other way around). Of course, they also changed all their S3 functions to properly handle this (e.g. predict.lognet).
The problem with this was: an object you had created with an old version of glmnet was not compatible with the new functions (since dispatching worked the other way around). Most people wouldn't be in that spot (who saves a glmnet object for later use?), but I was.
Mind you: this is a very powerful package, developed by extremely intelligent people, so it could happen to anyone :-) | Are there examples of R packages changing dramatically between version such that the results of a st
I've had issues with package glmnet over versions. If I remember well, it was going from version 1.5 to 1.6, but I may be off a little.
The package creators/maintainers changed the order of the classe |
33,966 | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different? | This will vary package to package, but the general answer is yes. Outputs can vary, and even basic usage too (input/ouput args). This is why, when I do an important analysis, I always like to document what versions were used with version() and sessionInfo(). Even if things change, old versions are retained on CRAN, so you can get the old versions if you need them. | Are there examples of R packages changing dramatically between version such that the results of a st | This will vary package to package, but the general answer is yes. Outputs can vary, and even basic usage too (input/ouput args). This is why, when I do an important analysis, I always like to document | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different?
This will vary package to package, but the general answer is yes. Outputs can vary, and even basic usage too (input/ouput args). This is why, when I do an important analysis, I always like to document what versions were used with version() and sessionInfo(). Even if things change, old versions are retained on CRAN, so you can get the old versions if you need them. | Are there examples of R packages changing dramatically between version such that the results of a st
This will vary package to package, but the general answer is yes. Outputs can vary, and even basic usage too (input/ouput args). This is why, when I do an important analysis, I always like to document |
33,967 | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different? | Just a quick point:
The R package ecosystem is very big, and it's really up to the individual author, whether they intend to maintain backwards compatibility.
I personally haven't had any issues with base R packages changing in ways that led to issues of backwards compatibility. In general, this is one reason why I prefer to use base R packages. | Are there examples of R packages changing dramatically between version such that the results of a st | Just a quick point:
The R package ecosystem is very big, and it's really up to the individual author, whether they intend to maintain backwards compatibility.
I personally haven't had any issues with | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different?
Just a quick point:
The R package ecosystem is very big, and it's really up to the individual author, whether they intend to maintain backwards compatibility.
I personally haven't had any issues with base R packages changing in ways that led to issues of backwards compatibility. In general, this is one reason why I prefer to use base R packages. | Are there examples of R packages changing dramatically between version such that the results of a st
Just a quick point:
The R package ecosystem is very big, and it's really up to the individual author, whether they intend to maintain backwards compatibility.
I personally haven't had any issues with |
33,968 | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different? | In my experience, most of the changes create the usual computing/programming type of issues. Functions get deprecated, arguments are different, etc. For example, it already happened to me that code would stop working because some function required an extra argument. This can be annoying but the problem is obvious and usually not too difficult to resolve.
Some packages could be better maintained in that respect but the usual “rules” of free software apply: You have to see that it is produced by volunteers – often statisticians who have other duties and not full-time professional software developers – and if quality and dependability are important to you, you should avoid anything with a version number like 0.x and only use mature packages with an active community of users and developers.
I have never encountered an update that would result in insidious changes of statistical results (e.g. switching the default method in some function, changing the degree of freedom and p value while producing superficially similar results). I guess it must happen though, at least through bug corrections (but I have read somewhere that Microsoft actually added code in its new products to emulate some older bugs to avoid breaking compatibility with programs that depend on these bugs). Maybe, some maintainers can give us some insights into the way these things are handled for their packages. | Are there examples of R packages changing dramatically between version such that the results of a st | In my experience, most of the changes create the usual computing/programming type of issues. Functions get deprecated, arguments are different, etc. For example, it already happened to me that code wo | Are there examples of R packages changing dramatically between version such that the results of a statistical function were significantly different?
In my experience, most of the changes create the usual computing/programming type of issues. Functions get deprecated, arguments are different, etc. For example, it already happened to me that code would stop working because some function required an extra argument. This can be annoying but the problem is obvious and usually not too difficult to resolve.
Some packages could be better maintained in that respect but the usual “rules” of free software apply: You have to see that it is produced by volunteers – often statisticians who have other duties and not full-time professional software developers – and if quality and dependability are important to you, you should avoid anything with a version number like 0.x and only use mature packages with an active community of users and developers.
I have never encountered an update that would result in insidious changes of statistical results (e.g. switching the default method in some function, changing the degree of freedom and p value while producing superficially similar results). I guess it must happen though, at least through bug corrections (but I have read somewhere that Microsoft actually added code in its new products to emulate some older bugs to avoid breaking compatibility with programs that depend on these bugs). Maybe, some maintainers can give us some insights into the way these things are handled for their packages. | Are there examples of R packages changing dramatically between version such that the results of a st
In my experience, most of the changes create the usual computing/programming type of issues. Functions get deprecated, arguments are different, etc. For example, it already happened to me that code wo |
33,969 | Internet statistics resources suitable for psychology students doing research | In general, encouraging research students to use Google and sites like Cross Validated to ask and answer their own questions is important.
Specific Sites
Andy Field is famous for making statistics more palatable for psychology students. He provides many online resources generally with a focus on SPSS.
UCLA Statistics Consulting has many useful resources.
@chl has many good statistics resources with a psychology flavour, such as this one on psychometrics and R
G. David Garson provides extensive notes on most techniques with a focus on SPSS generally suitable to a psychology research audience.
David Kenny has lots of resources particularly on SEM, mediation, moderation, and dyadic data analysis.
Encyclopedia - Psychology and Statistics has an extensive set of links to resources
mathpsych on Reddit is a small but interesting Reddit community.
A little self-promotion
One of my main aims over the last few years has been to develop resources designed to assist psychology students perform the data analysis for their research. Thus, I hope you'll forgive the self-promotion. The following links may be relevant:
Sitemap of the blog. Most of the blog is devoted to saying what I find myself saying to psychology research students in consultation settings. Thus, there's a fair bit of SPSS content in addition to my own preference for R.
Advice on completing data analysis for a thesis in psychology
General teaching resources with an SPSS manual and some multivariate course notes
General thoughts on encouraging students to use sites like Cross Validated
R in Psychology
I also have a post on getting started with R.
The following quotes the section of that post listing specific resources for researchers in psychology.
Task Views particularly relevant to psychology
Psychometric Models and Methods
Social Sciences
Multivariate
R Notes for Experimental Psychology
William Revelle's
Psychology R Site ;also see the package ;pscyh, ;and the ;online book and workshop
resources
Jonathan
Baron and Yelin Li's R for Psychology Experiments
Drew Conway suggests a list of must have R packages for the social
scientsist
SEM in R
Mailing
list for Psychology and R
Edinburgh Psychology R-users
Jason
Locklin's notes on standard experimental analyses in psychology
My posts with the R tag | Internet statistics resources suitable for psychology students doing research | In general, encouraging research students to use Google and sites like Cross Validated to ask and answer their own questions is important.
Specific Sites
Andy Field is famous for making statistics mo | Internet statistics resources suitable for psychology students doing research
In general, encouraging research students to use Google and sites like Cross Validated to ask and answer their own questions is important.
Specific Sites
Andy Field is famous for making statistics more palatable for psychology students. He provides many online resources generally with a focus on SPSS.
UCLA Statistics Consulting has many useful resources.
@chl has many good statistics resources with a psychology flavour, such as this one on psychometrics and R
G. David Garson provides extensive notes on most techniques with a focus on SPSS generally suitable to a psychology research audience.
David Kenny has lots of resources particularly on SEM, mediation, moderation, and dyadic data analysis.
Encyclopedia - Psychology and Statistics has an extensive set of links to resources
mathpsych on Reddit is a small but interesting Reddit community.
A little self-promotion
One of my main aims over the last few years has been to develop resources designed to assist psychology students perform the data analysis for their research. Thus, I hope you'll forgive the self-promotion. The following links may be relevant:
Sitemap of the blog. Most of the blog is devoted to saying what I find myself saying to psychology research students in consultation settings. Thus, there's a fair bit of SPSS content in addition to my own preference for R.
Advice on completing data analysis for a thesis in psychology
General teaching resources with an SPSS manual and some multivariate course notes
General thoughts on encouraging students to use sites like Cross Validated
R in Psychology
I also have a post on getting started with R.
The following quotes the section of that post listing specific resources for researchers in psychology.
Task Views particularly relevant to psychology
Psychometric Models and Methods
Social Sciences
Multivariate
R Notes for Experimental Psychology
William Revelle's
Psychology R Site ;also see the package ;pscyh, ;and the ;online book and workshop
resources
Jonathan
Baron and Yelin Li's R for Psychology Experiments
Drew Conway suggests a list of must have R packages for the social
scientsist
SEM in R
Mailing
list for Psychology and R
Edinburgh Psychology R-users
Jason
Locklin's notes on standard experimental analyses in psychology
My posts with the R tag | Internet statistics resources suitable for psychology students doing research
In general, encouraging research students to use Google and sites like Cross Validated to ask and answer their own questions is important.
Specific Sites
Andy Field is famous for making statistics mo |
33,970 | Internet statistics resources suitable for psychology students doing research | Copy N' Paste from my Google Reader: http://jeromyanglim.blogspot.com/ | Internet statistics resources suitable for psychology students doing research | Copy N' Paste from my Google Reader: http://jeromyanglim.blogspot.com/ | Internet statistics resources suitable for psychology students doing research
Copy N' Paste from my Google Reader: http://jeromyanglim.blogspot.com/ | Internet statistics resources suitable for psychology students doing research
Copy N' Paste from my Google Reader: http://jeromyanglim.blogspot.com/ |
33,971 | Internet statistics resources suitable for psychology students doing research | There's a correct answer here!
http://faculty.chass.ncsu.edu/garson/PA765/statnote.htm
Also good:
http://statcomp.ats.ucla.edu/
http://dss.princeton.edu/online_help/
http://www.psych.cornell.edu/darlington/
I know you didn't ask, probably because you know, the answer, but absolutely best statistics tests (for multivariate analysis) for psychologists (& for most other social scientists, although they don't all realize it) are:
Cohen, J., Cohen, P., West, S.G. & Aiken, L.S. Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences, (L. Erlbaum Associates, Mahwah, N.J., 2003).
Judd, C.M., McClelland, G.H. & Ryan, C.S. Data analysis : a model comparison approach, (Routledge/Taylor and Francis, New York, NY, 2008). | Internet statistics resources suitable for psychology students doing research | There's a correct answer here!
http://faculty.chass.ncsu.edu/garson/PA765/statnote.htm
Also good:
http://statcomp.ats.ucla.edu/
http://dss.princeton.edu/online_help/
http://www.psych.cornell.edu/dar | Internet statistics resources suitable for psychology students doing research
There's a correct answer here!
http://faculty.chass.ncsu.edu/garson/PA765/statnote.htm
Also good:
http://statcomp.ats.ucla.edu/
http://dss.princeton.edu/online_help/
http://www.psych.cornell.edu/darlington/
I know you didn't ask, probably because you know, the answer, but absolutely best statistics tests (for multivariate analysis) for psychologists (& for most other social scientists, although they don't all realize it) are:
Cohen, J., Cohen, P., West, S.G. & Aiken, L.S. Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences, (L. Erlbaum Associates, Mahwah, N.J., 2003).
Judd, C.M., McClelland, G.H. & Ryan, C.S. Data analysis : a model comparison approach, (Routledge/Taylor and Francis, New York, NY, 2008). | Internet statistics resources suitable for psychology students doing research
There's a correct answer here!
http://faculty.chass.ncsu.edu/garson/PA765/statnote.htm
Also good:
http://statcomp.ats.ucla.edu/
http://dss.princeton.edu/online_help/
http://www.psych.cornell.edu/dar |
33,972 | Internet statistics resources suitable for psychology students doing research | The UCLA server has a lot of ressources for statistical computing, including annotated output from various statistical packages. | Internet statistics resources suitable for psychology students doing research | The UCLA server has a lot of ressources for statistical computing, including annotated output from various statistical packages. | Internet statistics resources suitable for psychology students doing research
The UCLA server has a lot of ressources for statistical computing, including annotated output from various statistical packages. | Internet statistics resources suitable for psychology students doing research
The UCLA server has a lot of ressources for statistical computing, including annotated output from various statistical packages. |
33,973 | How to identify outliers in server uptime performance data? | Based on the way you phrase the question
are outliers not necessarily the best
way to attack the problem of finding
'badness'?
It is not clear that you are looking for outliers. For example, it seems that you are interested in machines performing above/below some threshold.
As an example, if all of your servers were at 98 $\pm$ 0.1 % availability, a server at 100% availability would be an outlier, as would a server at 97.6% availability. But these may be within your desired limits.
On the other hand, there may be good reasons apriori to want to be notified of any server at less than 95% availability, whether or not there are one or many servers below this threshold.
For this reason, a search for outliers may not provide the information that you are interested in. The thresholds could be determined statistically based on historical data, e.g. by modeling error rate as poisson or percent availability as beta variables. In an applied setting, these thresholds could probably be determined based on performance requirements. | How to identify outliers in server uptime performance data? | Based on the way you phrase the question
are outliers not necessarily the best
way to attack the problem of finding
'badness'?
It is not clear that you are looking for outliers. For example, it | How to identify outliers in server uptime performance data?
Based on the way you phrase the question
are outliers not necessarily the best
way to attack the problem of finding
'badness'?
It is not clear that you are looking for outliers. For example, it seems that you are interested in machines performing above/below some threshold.
As an example, if all of your servers were at 98 $\pm$ 0.1 % availability, a server at 100% availability would be an outlier, as would a server at 97.6% availability. But these may be within your desired limits.
On the other hand, there may be good reasons apriori to want to be notified of any server at less than 95% availability, whether or not there are one or many servers below this threshold.
For this reason, a search for outliers may not provide the information that you are interested in. The thresholds could be determined statistically based on historical data, e.g. by modeling error rate as poisson or percent availability as beta variables. In an applied setting, these thresholds could probably be determined based on performance requirements. | How to identify outliers in server uptime performance data?
Based on the way you phrase the question
are outliers not necessarily the best
way to attack the problem of finding
'badness'?
It is not clear that you are looking for outliers. For example, it |
33,974 | How to identify outliers in server uptime performance data? | A simple way to find anomalous servers would be to assume they are identically distributed, estimate the population parameters, and sort them according to their likelihoods, ascending. Column likelihoods would be combined either with their product or their minimum (or some other T-norm). This works pretty well as long as outliers are rare. For outlier detection itself, stable population parameters are usually estimated iteratively by dropping any discovered outliers, but that's not vital as long as you're manually inspecting the list and thereby avoiding thresholding.
For the likelihoods, you might try Beta for the proportions and Poisson for the rates.
As pointed out by David, outlier detection is not quite the same as reliability analysis, which would flag all servers that exceed some threshold. Furthermore, some people would approach the problem trough loss functions - defining the pain you feel when some server is at 50% availability or 500 error rate, and then rank them according to that pain. | How to identify outliers in server uptime performance data? | A simple way to find anomalous servers would be to assume they are identically distributed, estimate the population parameters, and sort them according to their likelihoods, ascending. Column likeliho | How to identify outliers in server uptime performance data?
A simple way to find anomalous servers would be to assume they are identically distributed, estimate the population parameters, and sort them according to their likelihoods, ascending. Column likelihoods would be combined either with their product or their minimum (or some other T-norm). This works pretty well as long as outliers are rare. For outlier detection itself, stable population parameters are usually estimated iteratively by dropping any discovered outliers, but that's not vital as long as you're manually inspecting the list and thereby avoiding thresholding.
For the likelihoods, you might try Beta for the proportions and Poisson for the rates.
As pointed out by David, outlier detection is not quite the same as reliability analysis, which would flag all servers that exceed some threshold. Furthermore, some people would approach the problem trough loss functions - defining the pain you feel when some server is at 50% availability or 500 error rate, and then rank them according to that pain. | How to identify outliers in server uptime performance data?
A simple way to find anomalous servers would be to assume they are identically distributed, estimate the population parameters, and sort them according to their likelihoods, ascending. Column likeliho |
33,975 | How to identify outliers in server uptime performance data? | Identifying a given data point as an outlier implies that there is some data generating process or model from which the data are expected to come from. It sounds like you are not sure what those models are for the given metrics and clusters you are concerned about. So, here is what I would consider exploring: statistical process control charts.
The idea here would be to collect the
%Availability
Requests/Sec
Errors/Sec
%Memory_Utilization
metrics for each of your clusters. For each metric, create a subset of the data that only includes values that are "reasonable" or in control. Build the charts for each metric based on this in-control data. Then you can start feeding live data to your charting code and visually assess if the metrics are in control or not.
Of course, visually doing this for multiple metrics across many clusters may not be feasible, but this could be a good way to start to learn about the dynamics you are faced with. You might then create a notification service for clusters with metrics that go out of control. Along these lines, I have played with using neural networks to automatically classify control chart patterns as being OK vs some specific flavor of out-of-control (e.g. %availability trending down or cyclic behavior in errors/sec). Doing this gives you the advantages of statistical process control charts (long used in manufacturing settings) but eases the burden of having to spend lots of time actually looking at charts, since you can train a neural network to classify patterns based upon your expert interpretation.
As for code, there is the spc package on pypi but I do not have any experience using this. My toy example of using neural networks (naive Bayes too) can be found here. | How to identify outliers in server uptime performance data? | Identifying a given data point as an outlier implies that there is some data generating process or model from which the data are expected to come from. It sounds like you are not sure what those model | How to identify outliers in server uptime performance data?
Identifying a given data point as an outlier implies that there is some data generating process or model from which the data are expected to come from. It sounds like you are not sure what those models are for the given metrics and clusters you are concerned about. So, here is what I would consider exploring: statistical process control charts.
The idea here would be to collect the
%Availability
Requests/Sec
Errors/Sec
%Memory_Utilization
metrics for each of your clusters. For each metric, create a subset of the data that only includes values that are "reasonable" or in control. Build the charts for each metric based on this in-control data. Then you can start feeding live data to your charting code and visually assess if the metrics are in control or not.
Of course, visually doing this for multiple metrics across many clusters may not be feasible, but this could be a good way to start to learn about the dynamics you are faced with. You might then create a notification service for clusters with metrics that go out of control. Along these lines, I have played with using neural networks to automatically classify control chart patterns as being OK vs some specific flavor of out-of-control (e.g. %availability trending down or cyclic behavior in errors/sec). Doing this gives you the advantages of statistical process control charts (long used in manufacturing settings) but eases the burden of having to spend lots of time actually looking at charts, since you can train a neural network to classify patterns based upon your expert interpretation.
As for code, there is the spc package on pypi but I do not have any experience using this. My toy example of using neural networks (naive Bayes too) can be found here. | How to identify outliers in server uptime performance data?
Identifying a given data point as an outlier implies that there is some data generating process or model from which the data are expected to come from. It sounds like you are not sure what those model |
33,976 | Papers on Bayesian factor analysis? | Some references to help you out.
Tipping, M. E. & Bishop, C. M.
Probabilistic principal component
analysis Journal of the Royal
Statistical Society (Series B),
1999, 21, 611-622
Tom Minka. Automatic choice of
dimensionality for PCA. NIPS 2000
url:
http://research.microsoft.com/en-us/um/people/minka/papers/pca/
Šmídl, V. & Quinn, A. On Bayesian
principal component analysis
Computational Statistics & Data
Analysis, 2007, 51, 4101-4123
If you are familiar with information theoretic model selection (MML, MDL, etc.), I highly recommend checking out:
Wallace, C. S. & Freeman, P. R.
Single-Factor Analysis by Minimum
Message Length Estimation Journal of
the Royal Statistical Society
(Series B), 1992, 54, 195-209
C. S. Wallace. Multiple Factor
Analysis by MML Estimation.
http://www.allisons.org/ll/Images/People/Wallace/Multi-Factor/
Tech report:
http://www.allisons.org/ll/Images/People/Wallace/Multi-Factor/TR95.218.pdf | Papers on Bayesian factor analysis? | Some references to help you out.
Tipping, M. E. & Bishop, C. M.
Probabilistic principal component
analysis Journal of the Royal
Statistical Society (Series B),
1999, 21, 611-622
Tom Minka. Automatic | Papers on Bayesian factor analysis?
Some references to help you out.
Tipping, M. E. & Bishop, C. M.
Probabilistic principal component
analysis Journal of the Royal
Statistical Society (Series B),
1999, 21, 611-622
Tom Minka. Automatic choice of
dimensionality for PCA. NIPS 2000
url:
http://research.microsoft.com/en-us/um/people/minka/papers/pca/
Šmídl, V. & Quinn, A. On Bayesian
principal component analysis
Computational Statistics & Data
Analysis, 2007, 51, 4101-4123
If you are familiar with information theoretic model selection (MML, MDL, etc.), I highly recommend checking out:
Wallace, C. S. & Freeman, P. R.
Single-Factor Analysis by Minimum
Message Length Estimation Journal of
the Royal Statistical Society
(Series B), 1992, 54, 195-209
C. S. Wallace. Multiple Factor
Analysis by MML Estimation.
http://www.allisons.org/ll/Images/People/Wallace/Multi-Factor/
Tech report:
http://www.allisons.org/ll/Images/People/Wallace/Multi-Factor/TR95.218.pdf | Papers on Bayesian factor analysis?
Some references to help you out.
Tipping, M. E. & Bishop, C. M.
Probabilistic principal component
analysis Journal of the Royal
Statistical Society (Series B),
1999, 21, 611-622
Tom Minka. Automatic |
33,977 | Papers on Bayesian factor analysis? | Here are a few suggestions, more from the statistics literature, with an eye toward applications in finance:
Geweke, J., & Zhou, G. (1996). Measuring the pricing error of the arbitrage pricing theory. Review of Financial Studies, 9(2), 557. Soc Financial Studies. Retrieved January 29, 2011, from http://rfs.oxfordjournals.org/content/9/2/557.abstract.
You might start here - a detailed discussion of identifiability issues (related to and including the sign indeterminacy you describe)
Aguilar, O., & West, M. (2000). Bayesian Dynamic Factor Models and Portfolio Allocation. Journal of Business & Economic Statistics, 18(3), 338. doi: 10.2307/1392266.
Lopes, H. F., & West, M. (2004). Bayesian model assessment in factor analysis. Statistica Sinica, 14(1), 41â68. Citeseer. Retrieved September 19, 2010, from here.
Good luck! | Papers on Bayesian factor analysis? | Here are a few suggestions, more from the statistics literature, with an eye toward applications in finance:
Geweke, J., & Zhou, G. (1996). Measuring the pricing error of the arbitrage pricing theory | Papers on Bayesian factor analysis?
Here are a few suggestions, more from the statistics literature, with an eye toward applications in finance:
Geweke, J., & Zhou, G. (1996). Measuring the pricing error of the arbitrage pricing theory. Review of Financial Studies, 9(2), 557. Soc Financial Studies. Retrieved January 29, 2011, from http://rfs.oxfordjournals.org/content/9/2/557.abstract.
You might start here - a detailed discussion of identifiability issues (related to and including the sign indeterminacy you describe)
Aguilar, O., & West, M. (2000). Bayesian Dynamic Factor Models and Portfolio Allocation. Journal of Business & Economic Statistics, 18(3), 338. doi: 10.2307/1392266.
Lopes, H. F., & West, M. (2004). Bayesian model assessment in factor analysis. Statistica Sinica, 14(1), 41â68. Citeseer. Retrieved September 19, 2010, from here.
Good luck! | Papers on Bayesian factor analysis?
Here are a few suggestions, more from the statistics literature, with an eye toward applications in finance:
Geweke, J., & Zhou, G. (1996). Measuring the pricing error of the arbitrage pricing theory |
33,978 | Papers on Bayesian factor analysis? | You should take a look at some of the nonparametric Bayesian approaches (see this paper and this paper) to factor analysis which do not assume the number of factors to be known; the first one can also model the case where the factors have a dependency structure among them. | Papers on Bayesian factor analysis? | You should take a look at some of the nonparametric Bayesian approaches (see this paper and this paper) to factor analysis which do not assume the number of factors to be known; the first one can also | Papers on Bayesian factor analysis?
You should take a look at some of the nonparametric Bayesian approaches (see this paper and this paper) to factor analysis which do not assume the number of factors to be known; the first one can also model the case where the factors have a dependency structure among them. | Papers on Bayesian factor analysis?
You should take a look at some of the nonparametric Bayesian approaches (see this paper and this paper) to factor analysis which do not assume the number of factors to be known; the first one can also |
33,979 | Papers on Bayesian factor analysis? | A decent overview of factor analysis is Latent Variable Methods and Factor Analysis by Bartholomew and Knott. They write about the interpretation of latent factors. This book is not as algorithmically-oriented as I would like, but their description of e.g. partial factor analysis is decent. | Papers on Bayesian factor analysis? | A decent overview of factor analysis is Latent Variable Methods and Factor Analysis by Bartholomew and Knott. They write about the interpretation of latent factors. This book is not as algorithmically | Papers on Bayesian factor analysis?
A decent overview of factor analysis is Latent Variable Methods and Factor Analysis by Bartholomew and Knott. They write about the interpretation of latent factors. This book is not as algorithmically-oriented as I would like, but their description of e.g. partial factor analysis is decent. | Papers on Bayesian factor analysis?
A decent overview of factor analysis is Latent Variable Methods and Factor Analysis by Bartholomew and Knott. They write about the interpretation of latent factors. This book is not as algorithmically |
33,980 | Papers on Bayesian factor analysis? | This article deals with Bayesian estimation of dynamical hierarchical factor model:
E. Moench, S. Ng, S. Potter. Dynamic Hierarchical Factor Models, Federal Reserve Bank of New York, 2009, Report No. 412. link.
Naturally it can be adapted for non-hierarchical case. As usual you will find more references on topic by perusing the references in the article. | Papers on Bayesian factor analysis? | This article deals with Bayesian estimation of dynamical hierarchical factor model:
E. Moench, S. Ng, S. Potter. Dynamic Hierarchical Factor Models, Federal Reserve Bank of New York, 2009, Report No. | Papers on Bayesian factor analysis?
This article deals with Bayesian estimation of dynamical hierarchical factor model:
E. Moench, S. Ng, S. Potter. Dynamic Hierarchical Factor Models, Federal Reserve Bank of New York, 2009, Report No. 412. link.
Naturally it can be adapted for non-hierarchical case. As usual you will find more references on topic by perusing the references in the article. | Papers on Bayesian factor analysis?
This article deals with Bayesian estimation of dynamical hierarchical factor model:
E. Moench, S. Ng, S. Potter. Dynamic Hierarchical Factor Models, Federal Reserve Bank of New York, 2009, Report No. |
33,981 | Learning how to use a new statistical GUI? | As someone who made the shift the other way from SPSS to R, I'd say that SPSS is relatively simple and intuitive relative to R. The menus and dialog boxes guide you through the process. Of course this means that it is also fairly easy to run analyses that don't make sense. And the GUI leads to less flexible analyses and tedious button pressing especially for repetitive analyses.
Thus, your approach of taking a dataset and just playing around might be sufficient.
There's plenty of how-to books out there, such as:
Discovering Statistics Using SPSS
SPSS Survival Manual
There's also plenty of websites offering tutorials:
Andy Field
My old notes
UCLA on SPSS
I'd also recommend that if you are teaching students about SPSS, you encourage them to use syntax. Using SPSS syntax is not as good as using technologies like R and Sweave.
However, using syntax is much better than just pressing menus and buttons in an ad hoc way and then wondering later what you've actually done.
I wrote a post listing tips for using SPSS syntax in order to approximate reproducible research with SPSS. | Learning how to use a new statistical GUI? | As someone who made the shift the other way from SPSS to R, I'd say that SPSS is relatively simple and intuitive relative to R. The menus and dialog boxes guide you through the process. Of course this | Learning how to use a new statistical GUI?
As someone who made the shift the other way from SPSS to R, I'd say that SPSS is relatively simple and intuitive relative to R. The menus and dialog boxes guide you through the process. Of course this means that it is also fairly easy to run analyses that don't make sense. And the GUI leads to less flexible analyses and tedious button pressing especially for repetitive analyses.
Thus, your approach of taking a dataset and just playing around might be sufficient.
There's plenty of how-to books out there, such as:
Discovering Statistics Using SPSS
SPSS Survival Manual
There's also plenty of websites offering tutorials:
Andy Field
My old notes
UCLA on SPSS
I'd also recommend that if you are teaching students about SPSS, you encourage them to use syntax. Using SPSS syntax is not as good as using technologies like R and Sweave.
However, using syntax is much better than just pressing menus and buttons in an ad hoc way and then wondering later what you've actually done.
I wrote a post listing tips for using SPSS syntax in order to approximate reproducible research with SPSS. | Learning how to use a new statistical GUI?
As someone who made the shift the other way from SPSS to R, I'd say that SPSS is relatively simple and intuitive relative to R. The menus and dialog boxes guide you through the process. Of course this |
33,982 | Learning how to use a new statistical GUI? | Since you are pretty well versed in R, get a copy of Muenchen's "R for SAS and SPSS Users" (Springer, 2009) and work backwards. | Learning how to use a new statistical GUI? | Since you are pretty well versed in R, get a copy of Muenchen's "R for SAS and SPSS Users" (Springer, 2009) and work backwards. | Learning how to use a new statistical GUI?
Since you are pretty well versed in R, get a copy of Muenchen's "R for SAS and SPSS Users" (Springer, 2009) and work backwards. | Learning how to use a new statistical GUI?
Since you are pretty well versed in R, get a copy of Muenchen's "R for SAS and SPSS Users" (Springer, 2009) and work backwards. |
33,983 | Learning how to use a new statistical GUI? | In youtube there are a lot of videos related with SPSS, I usually learn a gui with them. I recommend you record videos to teach how to apply methods and encourage them to use the "paste" button to learn a little of syntax | Learning how to use a new statistical GUI? | In youtube there are a lot of videos related with SPSS, I usually learn a gui with them. I recommend you record videos to teach how to apply methods and encourage them to use the "paste" button to lea | Learning how to use a new statistical GUI?
In youtube there are a lot of videos related with SPSS, I usually learn a gui with them. I recommend you record videos to teach how to apply methods and encourage them to use the "paste" button to learn a little of syntax | Learning how to use a new statistical GUI?
In youtube there are a lot of videos related with SPSS, I usually learn a gui with them. I recommend you record videos to teach how to apply methods and encourage them to use the "paste" button to lea |
33,984 | Learning how to use a new statistical GUI? | Your method will certainly work for most introductory techniques you'd need to do. I am quite familiar with R, but I was required to learn Minitab to teach to non-statistics people. In one afternoon, I had a basic enough understanding of Minitab to explain how to use it in the limited framework of an introductory stats class. I figure SPSS would behave similarly.
I would suggest reviewing the course syllabus and trying to complete all techniques outlined in the syllabus. A large majority of your students' questions will pertain to doing tasks the teacher has asked them to do, and a smaller percentage of questions will be related to doing tasks in their other statistics endeavors.
You will be able to answer a large majority of student questions by knowing how to use SPSS to solve a class-related problem, so just playing around within SPSS will benefit you. | Learning how to use a new statistical GUI? | Your method will certainly work for most introductory techniques you'd need to do. I am quite familiar with R, but I was required to learn Minitab to teach to non-statistics people. In one afternoon, | Learning how to use a new statistical GUI?
Your method will certainly work for most introductory techniques you'd need to do. I am quite familiar with R, but I was required to learn Minitab to teach to non-statistics people. In one afternoon, I had a basic enough understanding of Minitab to explain how to use it in the limited framework of an introductory stats class. I figure SPSS would behave similarly.
I would suggest reviewing the course syllabus and trying to complete all techniques outlined in the syllabus. A large majority of your students' questions will pertain to doing tasks the teacher has asked them to do, and a smaller percentage of questions will be related to doing tasks in their other statistics endeavors.
You will be able to answer a large majority of student questions by knowing how to use SPSS to solve a class-related problem, so just playing around within SPSS will benefit you. | Learning how to use a new statistical GUI?
Your method will certainly work for most introductory techniques you'd need to do. I am quite familiar with R, but I was required to learn Minitab to teach to non-statistics people. In one afternoon, |
33,985 | Is it ok to run post hoc comparisons if ANOVA is nearly significant? | I highly recommend reading Midway et al., 2020, which is probably the best article I have ever read that summarizes pairwise comparisons for ANOVA. Along with the guidelines they provide for how to properly utilize these post-hoc tests, one of the opening paragraphs states this:
The classic ANOVA (ANalysis Of Variance) is a general linear model that has been in use for over 100 years (Fisher, 1918) and is often used when categorical or factor data need to be analyzed. However, an ANOVA will only produce an F -statistic (and associated p-value) for the whole model. In other words, an ANOVA reports whether one or more significant differences among group levels exist, but it does not provide any information about specific group means compared to each other. Additionally, it is possible that group differences exist that ANOVA does not detect. For both of these reasons, a strong and defensible statistical method to compare groups is nearly a requirement for anyone analyzing data.
For this reason, it is useful to explore differences between groups even if there is no significant ANOVA. Remember that the f value derived from an ANOVA simply tests the overall variance between groups. How some groups compare to each other cannot be understood without exploring further. | Is it ok to run post hoc comparisons if ANOVA is nearly significant? | I highly recommend reading Midway et al., 2020, which is probably the best article I have ever read that summarizes pairwise comparisons for ANOVA. Along with the guidelines they provide for how to pr | Is it ok to run post hoc comparisons if ANOVA is nearly significant?
I highly recommend reading Midway et al., 2020, which is probably the best article I have ever read that summarizes pairwise comparisons for ANOVA. Along with the guidelines they provide for how to properly utilize these post-hoc tests, one of the opening paragraphs states this:
The classic ANOVA (ANalysis Of Variance) is a general linear model that has been in use for over 100 years (Fisher, 1918) and is often used when categorical or factor data need to be analyzed. However, an ANOVA will only produce an F -statistic (and associated p-value) for the whole model. In other words, an ANOVA reports whether one or more significant differences among group levels exist, but it does not provide any information about specific group means compared to each other. Additionally, it is possible that group differences exist that ANOVA does not detect. For both of these reasons, a strong and defensible statistical method to compare groups is nearly a requirement for anyone analyzing data.
For this reason, it is useful to explore differences between groups even if there is no significant ANOVA. Remember that the f value derived from an ANOVA simply tests the overall variance between groups. How some groups compare to each other cannot be understood without exploring further. | Is it ok to run post hoc comparisons if ANOVA is nearly significant?
I highly recommend reading Midway et al., 2020, which is probably the best article I have ever read that summarizes pairwise comparisons for ANOVA. Along with the guidelines they provide for how to pr |
33,986 | Is it ok to run post hoc comparisons if ANOVA is nearly significant? | Since multiple comparison tests are often called 'post tests', you'd think they logically follow the one-way ANOVA and should be used only when the overall ANOVA results in $p < 0.05$ (or whatever threshold you choose). In fact, this isn't so.
"An unfortunate common practice is to pursue multiple comparisons only
when the null hypothesis of homogeneity is rejected." (1)
With one exception, the results of multiple comparison tests (post-hoc tests) following ANOVA are valid even if the overall ANOVA did not find a statistically significant difference among means. The exception is the first multiple comparison test invented (now obsolete), the protected Fisher Least Significant Difference (LSD) test.
I suggest focusing on confidence intervals of the differences between means, and not on whether any p-value is less than 0.05. And please don't ever use the phrase "trending towards significance". You actually don't know what would happen to the p-value if there were more data, so you can't state a trend (2).
J. Hsu, Multiple Comparisons: Theory and Methods, page 177, ISBN 978-0412982811
Wood J, Freemantle N, King M, Nazareth I (2014) Trap of trends to statistical significance: likelihood of near significant P value becoming more significant with extra data. BMJ Br Medical J 348:g2215. https://doi.org/10.1136/bmj.g2215 | Is it ok to run post hoc comparisons if ANOVA is nearly significant? | Since multiple comparison tests are often called 'post tests', you'd think they logically follow the one-way ANOVA and should be used only when the overall ANOVA results in $p < 0.05$ (or whatever thr | Is it ok to run post hoc comparisons if ANOVA is nearly significant?
Since multiple comparison tests are often called 'post tests', you'd think they logically follow the one-way ANOVA and should be used only when the overall ANOVA results in $p < 0.05$ (or whatever threshold you choose). In fact, this isn't so.
"An unfortunate common practice is to pursue multiple comparisons only
when the null hypothesis of homogeneity is rejected." (1)
With one exception, the results of multiple comparison tests (post-hoc tests) following ANOVA are valid even if the overall ANOVA did not find a statistically significant difference among means. The exception is the first multiple comparison test invented (now obsolete), the protected Fisher Least Significant Difference (LSD) test.
I suggest focusing on confidence intervals of the differences between means, and not on whether any p-value is less than 0.05. And please don't ever use the phrase "trending towards significance". You actually don't know what would happen to the p-value if there were more data, so you can't state a trend (2).
J. Hsu, Multiple Comparisons: Theory and Methods, page 177, ISBN 978-0412982811
Wood J, Freemantle N, King M, Nazareth I (2014) Trap of trends to statistical significance: likelihood of near significant P value becoming more significant with extra data. BMJ Br Medical J 348:g2215. https://doi.org/10.1136/bmj.g2215 | Is it ok to run post hoc comparisons if ANOVA is nearly significant?
Since multiple comparison tests are often called 'post tests', you'd think they logically follow the one-way ANOVA and should be used only when the overall ANOVA results in $p < 0.05$ (or whatever thr |
33,987 | Dichotomising vs keeping categories in regression | If you test every number of children separately, you're running seven tests. According to Bonferroni, for making sure that you have a probability of smaller than 5% to find a significant result if in fact nothing is going on, you've got to run every single test at level 0.05/7. This is smaller than the p-value for 3 children. From this point of view nothing significant is going on in either situation. You may well keep all categories, but this doesn't give you a meaningful significance. (Obviously you could find that p-value suspicious and collect much more data to see whether it becomes even more significant, but it may not be worth the hassle.)
Added later: There was some discussion about whether it is wrong to treat the number of children as categorical, actually being a number, and what to do instead.
Generally I agree with the view that it makes sense to use the numerical meaning of the data. However this will usually involve assumptions about the functional form of the relationship. An important principle is that all available subject-matter knowledge should be used before actually analysing the data, as making modelling decisions based on the data will often produce selection bias effects and runs counter to theory behind some standard methods such as the significance tests for the coefficients.
So that first step before seeing the data should be to ask what kind of functional relationship could make sense here. The easiest assumed relationship would be linearity, but linearity may not be realistic, particularly because there may be a much bigger difference between 0 and any number of children than between two nonzero numbers of children (of course I can't tell without knowing the exact background). Also the relationship may be non-monotonic.
An additional problem is the question what can be identified from the data at what precision. Standard errors for 5, 6, 7 (maybe even 4) children suggest that there is not much data for these and whatever can be said will be very imprecise. In fact one could know this already from the plain numbers of observations falling into these categories (taking those into account will hardly bias later analyses as they don't imply information about the regression relationship).
This means that there may not be enough information to nail down confidently any relationship more complex (i.e., requiring more parameters) than a linear one, and making assumptions that require only a low number of parameters to be estimated is certainly desirable. This also means that treating the larger numbers of children as autonomous categories doesn't give useful information either. The standard errors of about 19 suggest that there is hardly any power to detect anything; for sure shown results cannot even exclude the possibility that there is a monotonic or even linear relationship (or none at all), even though the latter may not be realistic.
If relationships don't follow simple functional forms, in fact aggregation of categories can be a sensible choice; depending on the background comparing zero with existing children may be justifiable, and in general even something like "zero", "one or two", "more than two" can work better than either using all numbers as separate categories (particularly with very thin numbers on some categories) or assuming linearity or a more complex functional form. As said before, optimally such decisions should be made before seeing the data (or at least the regression relationship); however looking at the data may reveal a striking specific deviation from an initial assumption/decision, in which case model selection bias is probably less bad than sticking to an inappropriate initial decision at any cost.
From the numbers I currently see, I suspect however that clear evidence for any influence of this variable whatsoever cannot be found in the given data, and I'd be very skeptical if any of the ideas above applied at this time point would lead to a just about significant p-value, which in that case may well be explained by model selection bias.
Note also, as discussed elsewhere, that looking at p-values often isn't a very good way of doing variable selection. | Dichotomising vs keeping categories in regression | If you test every number of children separately, you're running seven tests. According to Bonferroni, for making sure that you have a probability of smaller than 5% to find a significant result if in | Dichotomising vs keeping categories in regression
If you test every number of children separately, you're running seven tests. According to Bonferroni, for making sure that you have a probability of smaller than 5% to find a significant result if in fact nothing is going on, you've got to run every single test at level 0.05/7. This is smaller than the p-value for 3 children. From this point of view nothing significant is going on in either situation. You may well keep all categories, but this doesn't give you a meaningful significance. (Obviously you could find that p-value suspicious and collect much more data to see whether it becomes even more significant, but it may not be worth the hassle.)
Added later: There was some discussion about whether it is wrong to treat the number of children as categorical, actually being a number, and what to do instead.
Generally I agree with the view that it makes sense to use the numerical meaning of the data. However this will usually involve assumptions about the functional form of the relationship. An important principle is that all available subject-matter knowledge should be used before actually analysing the data, as making modelling decisions based on the data will often produce selection bias effects and runs counter to theory behind some standard methods such as the significance tests for the coefficients.
So that first step before seeing the data should be to ask what kind of functional relationship could make sense here. The easiest assumed relationship would be linearity, but linearity may not be realistic, particularly because there may be a much bigger difference between 0 and any number of children than between two nonzero numbers of children (of course I can't tell without knowing the exact background). Also the relationship may be non-monotonic.
An additional problem is the question what can be identified from the data at what precision. Standard errors for 5, 6, 7 (maybe even 4) children suggest that there is not much data for these and whatever can be said will be very imprecise. In fact one could know this already from the plain numbers of observations falling into these categories (taking those into account will hardly bias later analyses as they don't imply information about the regression relationship).
This means that there may not be enough information to nail down confidently any relationship more complex (i.e., requiring more parameters) than a linear one, and making assumptions that require only a low number of parameters to be estimated is certainly desirable. This also means that treating the larger numbers of children as autonomous categories doesn't give useful information either. The standard errors of about 19 suggest that there is hardly any power to detect anything; for sure shown results cannot even exclude the possibility that there is a monotonic or even linear relationship (or none at all), even though the latter may not be realistic.
If relationships don't follow simple functional forms, in fact aggregation of categories can be a sensible choice; depending on the background comparing zero with existing children may be justifiable, and in general even something like "zero", "one or two", "more than two" can work better than either using all numbers as separate categories (particularly with very thin numbers on some categories) or assuming linearity or a more complex functional form. As said before, optimally such decisions should be made before seeing the data (or at least the regression relationship); however looking at the data may reveal a striking specific deviation from an initial assumption/decision, in which case model selection bias is probably less bad than sticking to an inappropriate initial decision at any cost.
From the numbers I currently see, I suspect however that clear evidence for any influence of this variable whatsoever cannot be found in the given data, and I'd be very skeptical if any of the ideas above applied at this time point would lead to a just about significant p-value, which in that case may well be explained by model selection bias.
Note also, as discussed elsewhere, that looking at p-values often isn't a very good way of doing variable selection. | Dichotomising vs keeping categories in regression
If you test every number of children separately, you're running seven tests. According to Bonferroni, for making sure that you have a probability of smaller than 5% to find a significant result if in |
33,988 | Dichotomising vs keeping categories in regression | This is a great example of why it is so difficult to 'hypothesize after the results are known' and why we should make analysis plans before we start, even for observational data. Every analysis we try now will just reflect something we've already seen, and we could probably find an analysis to give whatever answer we want.
IMO we can't say whether or not having children affects your outcome based on this data. Certainly your dataset is not inconsistent with 'no effect' so this is probably how you should explain it as that's how we normally think about statistical significance. Particularly if this also comes from a set of secondary outcomes that you are exploring. We also can't rule out a small effect.
From a programming point of view for an 'honest' quantification of your results you might try using emmeans to get the base vs all other group contrasts, and use whatever p-value and confidence interval correction is recommended for this kind of comparison. Or just report your initial model of 'number of kids' as a numeric, if this was supported by your theory and is what you tried initially.
Whether or not it makes sense to analyse the number of children in categories like this is up to you. Social factors might make 3 kids qualitatively different from 2, Its down to your population and your theory.
Statistical arguments aside you could also consider the Bradford Hill criteria to check if you believe a result is real or meaningful.
Finally, if you don't need have an opinion about what this data means then you don't need to overthink it. Just show your readers your model and your results and let them decide. A graph like this might be instructive: | Dichotomising vs keeping categories in regression | This is a great example of why it is so difficult to 'hypothesize after the results are known' and why we should make analysis plans before we start, even for observational data. Every analysis we tr | Dichotomising vs keeping categories in regression
This is a great example of why it is so difficult to 'hypothesize after the results are known' and why we should make analysis plans before we start, even for observational data. Every analysis we try now will just reflect something we've already seen, and we could probably find an analysis to give whatever answer we want.
IMO we can't say whether or not having children affects your outcome based on this data. Certainly your dataset is not inconsistent with 'no effect' so this is probably how you should explain it as that's how we normally think about statistical significance. Particularly if this also comes from a set of secondary outcomes that you are exploring. We also can't rule out a small effect.
From a programming point of view for an 'honest' quantification of your results you might try using emmeans to get the base vs all other group contrasts, and use whatever p-value and confidence interval correction is recommended for this kind of comparison. Or just report your initial model of 'number of kids' as a numeric, if this was supported by your theory and is what you tried initially.
Whether or not it makes sense to analyse the number of children in categories like this is up to you. Social factors might make 3 kids qualitatively different from 2, Its down to your population and your theory.
Statistical arguments aside you could also consider the Bradford Hill criteria to check if you believe a result is real or meaningful.
Finally, if you don't need have an opinion about what this data means then you don't need to overthink it. Just show your readers your model and your results and let them decide. A graph like this might be instructive: | Dichotomising vs keeping categories in regression
This is a great example of why it is so difficult to 'hypothesize after the results are known' and why we should make analysis plans before we start, even for observational data. Every analysis we tr |
33,989 | Dichotomising vs keeping categories in regression | Why not run an ANOVA and see whether adding all the levels improves overall fit? If it does then you can worry about which level is driving it. | Dichotomising vs keeping categories in regression | Why not run an ANOVA and see whether adding all the levels improves overall fit? If it does then you can worry about which level is driving it. | Dichotomising vs keeping categories in regression
Why not run an ANOVA and see whether adding all the levels improves overall fit? If it does then you can worry about which level is driving it. | Dichotomising vs keeping categories in regression
Why not run an ANOVA and see whether adding all the levels improves overall fit? If it does then you can worry about which level is driving it. |
33,990 | Summation of uncertainty intervals | I agree with Allan that having the data that makes up the estimates would be ideal. However, if you don't have the data I'm not sure you'd want to make the assumption of these all being Uniform distributions since this gives equal weight of all values between the lower/upper limits given. Since the column name is Best Estimate then I would think that you may not agree with that assumption.
Making a different assumption that these could each be Normally distributed and are independent of each other would allow you to take advantage of the sum of normally distributed random variables.
$$
\begin{aligned}
X \sim \mathcal N(\mu_X, \sigma^2_X) \\
Y \sim \mathcal N(\mu_Y, \sigma^2_Y) \\
Z = X + Y
\end{aligned}
$$
Then
$$Z \sim \mathcal N(\mu_X + \mu_Y, \sigma^2_X + \sigma^2_Y)$$
What you don't have is the variance for each but you could make another rough estimate using the range rule. For this you simply take the range for each and divide it by $4$ to have a rough estimate of your standard deviation.
Putting this all together in Julia you would have:
using Distributions
means = [379, 19, 80, 21, 698, 87]
lows = [321, 18, 68, 20, 650, 80]
highs = [441, 20, 92, 22, 747, 93]
# using the range rule
stds = (highs - lows) / 4
vars = stds.^2
# using the assumption of independent Normal R.V.s
world = Normal(sum(means), sqrt(sum(vars)))
# what's our 95% interval for the grand total?
quantile(world, [0.025, 0.5, 0.975])
Results in:
1207.2072954499056
1284.0
1360.7927045500944 | Summation of uncertainty intervals | I agree with Allan that having the data that makes up the estimates would be ideal. However, if you don't have the data I'm not sure you'd want to make the assumption of these all being Uniform distri | Summation of uncertainty intervals
I agree with Allan that having the data that makes up the estimates would be ideal. However, if you don't have the data I'm not sure you'd want to make the assumption of these all being Uniform distributions since this gives equal weight of all values between the lower/upper limits given. Since the column name is Best Estimate then I would think that you may not agree with that assumption.
Making a different assumption that these could each be Normally distributed and are independent of each other would allow you to take advantage of the sum of normally distributed random variables.
$$
\begin{aligned}
X \sim \mathcal N(\mu_X, \sigma^2_X) \\
Y \sim \mathcal N(\mu_Y, \sigma^2_Y) \\
Z = X + Y
\end{aligned}
$$
Then
$$Z \sim \mathcal N(\mu_X + \mu_Y, \sigma^2_X + \sigma^2_Y)$$
What you don't have is the variance for each but you could make another rough estimate using the range rule. For this you simply take the range for each and divide it by $4$ to have a rough estimate of your standard deviation.
Putting this all together in Julia you would have:
using Distributions
means = [379, 19, 80, 21, 698, 87]
lows = [321, 18, 68, 20, 650, 80]
highs = [441, 20, 92, 22, 747, 93]
# using the range rule
stds = (highs - lows) / 4
vars = stds.^2
# using the assumption of independent Normal R.V.s
world = Normal(sum(means), sqrt(sum(vars)))
# what's our 95% interval for the grand total?
quantile(world, [0.025, 0.5, 0.975])
Results in:
1207.2072954499056
1284.0
1360.7927045500944 | Summation of uncertainty intervals
I agree with Allan that having the data that makes up the estimates would be ideal. However, if you don't have the data I'm not sure you'd want to make the assumption of these all being Uniform distri |
33,991 | Summation of uncertainty intervals | While you cannot blindly add any intervals, assuming that those are lower and higher bounds, it's easy. If you only care about adding the intervals and learning what would be the interval for the sum, this can be solved with interval arithmetic. The sum of the intervals is
$$
[x_1, x_2] + [y_1, y_2] = [x_1+y_1, x_2+y_2]
$$
so you only need to sum lower bounds together and upper bounds together for the lower and upper bound of the sum. This gives you a conservative estimate (worst case, best case).
For data represented as the lower end, higher end, and the mode, there is a very simple probability distribution to represent it, the triangular distribution. It is popular because of its simplicity. You can use the distribution to conduct a Monte Carlo simulation to answer the question about the possible range of the values given the information provided. For the simulation, we will sample from the triangular distributions parametrized by lower bound, higher bound, and the mode and sum the results, to learn the distribution of the sums.
Let me also use Julia like @joshualeond.
using Random
using Distributions
Random.seed!(42)
dist = TriangularDist.(lows, highs, means)
world = [sum(rand.(dist)) for i in 1:500_000]
quantile(world, [0.025, 0.5, 0.975])
## 3-element Vector{Float64}:
## 1223.6470001955206
## 1285.2884768397992
## 1347.739670270986
As you can see, the average ends up very close to the result obtained by @joshualeond (+1) using the normal distribution, but the spread of the results is lower because the normal distribution is unbounded, while with triangular distribution we define the hard bounds that limit the variability.
The triangular distribution is hardly the most realistic choice, but it can be useful as a very simple model for simulation given the three-point summaries like the bounds and mode. | Summation of uncertainty intervals | While you cannot blindly add any intervals, assuming that those are lower and higher bounds, it's easy. If you only care about adding the intervals and learning what would be the interval for the sum, | Summation of uncertainty intervals
While you cannot blindly add any intervals, assuming that those are lower and higher bounds, it's easy. If you only care about adding the intervals and learning what would be the interval for the sum, this can be solved with interval arithmetic. The sum of the intervals is
$$
[x_1, x_2] + [y_1, y_2] = [x_1+y_1, x_2+y_2]
$$
so you only need to sum lower bounds together and upper bounds together for the lower and upper bound of the sum. This gives you a conservative estimate (worst case, best case).
For data represented as the lower end, higher end, and the mode, there is a very simple probability distribution to represent it, the triangular distribution. It is popular because of its simplicity. You can use the distribution to conduct a Monte Carlo simulation to answer the question about the possible range of the values given the information provided. For the simulation, we will sample from the triangular distributions parametrized by lower bound, higher bound, and the mode and sum the results, to learn the distribution of the sums.
Let me also use Julia like @joshualeond.
using Random
using Distributions
Random.seed!(42)
dist = TriangularDist.(lows, highs, means)
world = [sum(rand.(dist)) for i in 1:500_000]
quantile(world, [0.025, 0.5, 0.975])
## 3-element Vector{Float64}:
## 1223.6470001955206
## 1285.2884768397992
## 1347.739670270986
As you can see, the average ends up very close to the result obtained by @joshualeond (+1) using the normal distribution, but the spread of the results is lower because the normal distribution is unbounded, while with triangular distribution we define the hard bounds that limit the variability.
The triangular distribution is hardly the most realistic choice, but it can be useful as a very simple model for simulation given the three-point summaries like the bounds and mode. | Summation of uncertainty intervals
While you cannot blindly add any intervals, assuming that those are lower and higher bounds, it's easy. If you only care about adding the intervals and learning what would be the interval for the sum, |
33,992 | Summation of uncertainty intervals | Ideally you'd have the raw data concatenate everything and with that you can make the uncertainty intervals. But if you only have this data, you could make assumption about the shape of distributions and simulate the result. For example assuming everthing is uniform:
import numpy as np
import pandas as pd
sim = []
for n in range(int(1e4)):
africa = np.random.uniform(321, 421)
americas = np.random.uniform(18, 20)
medi = np.random.uniform(68, 92)
europe = np.random.uniform(20, 22)
sasia = np.random.uniform(650, 747)
wpacific = np.random.uniform(80, 93)
estimate = np.mean([africa, americas, medi, europe, sasia,wpacific])
print(estimate)
sim.append(estimate)
And with that is possible to estimate the intervals, and you could make this better weighting by the populations. | Summation of uncertainty intervals | Ideally you'd have the raw data concatenate everything and with that you can make the uncertainty intervals. But if you only have this data, you could make assumption about the shape of distributions | Summation of uncertainty intervals
Ideally you'd have the raw data concatenate everything and with that you can make the uncertainty intervals. But if you only have this data, you could make assumption about the shape of distributions and simulate the result. For example assuming everthing is uniform:
import numpy as np
import pandas as pd
sim = []
for n in range(int(1e4)):
africa = np.random.uniform(321, 421)
americas = np.random.uniform(18, 20)
medi = np.random.uniform(68, 92)
europe = np.random.uniform(20, 22)
sasia = np.random.uniform(650, 747)
wpacific = np.random.uniform(80, 93)
estimate = np.mean([africa, americas, medi, europe, sasia,wpacific])
print(estimate)
sim.append(estimate)
And with that is possible to estimate the intervals, and you could make this better weighting by the populations. | Summation of uncertainty intervals
Ideally you'd have the raw data concatenate everything and with that you can make the uncertainty intervals. But if you only have this data, you could make assumption about the shape of distributions |
33,993 | MLE and non-normality | To develop StubbornAtom's comment, if $X_i$ is i.i.d. uniformly distributed on $[0,\theta]$
and you have $n$ samples then the maximum likelihood estimator of $\theta$ is $\hat{\theta}_n=\max\limits_{1\le i \le n}X_i$.
$\hat{\theta}_n$ has a $\mathrm{Beta}(n,1)$ distribution scaled by $\theta$.
As $n$ increases, $n\left(\theta-\hat \theta_n\right)$ converges in distribution to $\mathrm{Exp}\left(\frac1\theta\right)$, not a normal distribution.
or in a handwaving sense, for large $n$, the maximum likelihood estimator $\hat{\theta}_n$ approximately has a reversed and shifted exponential distribution with density $\frac{n x^{n-1}}{\theta^n} \approx \frac n{\theta} \exp\left(\frac{nx}{\theta}-n\right)$ when $0 < x \le \theta$ looking like | MLE and non-normality | To develop StubbornAtom's comment, if $X_i$ is i.i.d. uniformly distributed on $[0,\theta]$
and you have $n$ samples then the maximum likelihood estimator of $\theta$ is $\hat{\theta}_n=\max\limits_{ | MLE and non-normality
To develop StubbornAtom's comment, if $X_i$ is i.i.d. uniformly distributed on $[0,\theta]$
and you have $n$ samples then the maximum likelihood estimator of $\theta$ is $\hat{\theta}_n=\max\limits_{1\le i \le n}X_i$.
$\hat{\theta}_n$ has a $\mathrm{Beta}(n,1)$ distribution scaled by $\theta$.
As $n$ increases, $n\left(\theta-\hat \theta_n\right)$ converges in distribution to $\mathrm{Exp}\left(\frac1\theta\right)$, not a normal distribution.
or in a handwaving sense, for large $n$, the maximum likelihood estimator $\hat{\theta}_n$ approximately has a reversed and shifted exponential distribution with density $\frac{n x^{n-1}}{\theta^n} \approx \frac n{\theta} \exp\left(\frac{nx}{\theta}-n\right)$ when $0 < x \le \theta$ looking like | MLE and non-normality
To develop StubbornAtom's comment, if $X_i$ is i.i.d. uniformly distributed on $[0,\theta]$
and you have $n$ samples then the maximum likelihood estimator of $\theta$ is $\hat{\theta}_n=\max\limits_{ |
33,994 | MLE and non-normality | Theorems showing asymptotic normality of the MLE generally hinge on the MLE being in in the interior of the parameter space and the information function existing. Moran (1971) examines the MLE under non-standard conditions, including when the parameter is on the boundary. That might be a good place to look if you would like a non-trivial example. | MLE and non-normality | Theorems showing asymptotic normality of the MLE generally hinge on the MLE being in in the interior of the parameter space and the information function existing. Moran (1971) examines the MLE under | MLE and non-normality
Theorems showing asymptotic normality of the MLE generally hinge on the MLE being in in the interior of the parameter space and the information function existing. Moran (1971) examines the MLE under non-standard conditions, including when the parameter is on the boundary. That might be a good place to look if you would like a non-trivial example. | MLE and non-normality
Theorems showing asymptotic normality of the MLE generally hinge on the MLE being in in the interior of the parameter space and the information function existing. Moran (1971) examines the MLE under |
33,995 | Why is entropy sometimes written as a function with a random variable as its argument? | This is notation that bypasses the distribution (similar to moments)
As can be seen from the formula, the entropy is fully determined by the probability distribution of the random variable, not the random variable itself. In the formula you give in your question the object $X$ is used as an index of summation, so the summation does not depend on $X$ (it is "summed out" of the equation). (Note that it is bad practice to use the same notation for the random variable and the index of summation.) The notation you are referring to is similar to the notation for the moments of random variables, which are also fully determined by the distribution of those random variables. I will try to explain the alternative notational methods here.
Two possible notations: If you take $Q$ to denote the mass function of the random variable (and let $\mathscr{X}$ denote its support) then a natural notation for the entropy would be:
$$H(Q) \equiv - \sum_{x \in \mathscr{X}} Q(x) \log Q(x).$$
However, if you accept the notation for moments, you could also reasonably denote the entropy as:
$$H(X) \equiv \mathbb{E}(-\log(X)) = - \sum_{x \in \mathscr{X}} Q(x) \log Q(x).$$
These two alternatives frame the notation either as a function of the distribution, or a function of the random variable. In the latter case we use the same notational convention used for moments of random variables, which are also functions of the underlying distribution of the random variable.
Technical issues with moment notation: From a technical perspective, a random variable is a mapping on the sample space. If we are working in the probability space $(\Omega, \mathscr{G}, \mathbb{P})$ then a random variable is a measureable function $X: \Omega \rightarrow \mathbb{R}$ from the sample space to the real numbers. Importantly, the random variable does not contain the information on its own distribution, so it is impossible to define the entropy of the distribution ---or any moments of the distribution--- purely as a function of the random variable. It is possible to obtain the probability distribution from the random variable $X$ and the probability measure $\mathbb{P}$, so such a function can have both arguments, but it cannot be a function only of the random variable.
This means that whenever we use moment notation (where we express moments as a function of the random variable rather than the distribution), the functions must be implicitly conditional on the underlying probability measure $\mathbb{P}$ or the specific distribution of the random variable in question. Sometimes we have a function where one or more arguments are only implicit, and do not appear in the function notation, and so it is certainly possible to write moments (and the entropy function) in this way. It is in common usage in statistical problems.
This notation is a convenience because it allows you to relate the moments/entropy directly to random variables rather than their distributions. | Why is entropy sometimes written as a function with a random variable as its argument? | This is notation that bypasses the distribution (similar to moments)
As can be seen from the formula, the entropy is fully determined by the probability distribution of the random variable, not the ra | Why is entropy sometimes written as a function with a random variable as its argument?
This is notation that bypasses the distribution (similar to moments)
As can be seen from the formula, the entropy is fully determined by the probability distribution of the random variable, not the random variable itself. In the formula you give in your question the object $X$ is used as an index of summation, so the summation does not depend on $X$ (it is "summed out" of the equation). (Note that it is bad practice to use the same notation for the random variable and the index of summation.) The notation you are referring to is similar to the notation for the moments of random variables, which are also fully determined by the distribution of those random variables. I will try to explain the alternative notational methods here.
Two possible notations: If you take $Q$ to denote the mass function of the random variable (and let $\mathscr{X}$ denote its support) then a natural notation for the entropy would be:
$$H(Q) \equiv - \sum_{x \in \mathscr{X}} Q(x) \log Q(x).$$
However, if you accept the notation for moments, you could also reasonably denote the entropy as:
$$H(X) \equiv \mathbb{E}(-\log(X)) = - \sum_{x \in \mathscr{X}} Q(x) \log Q(x).$$
These two alternatives frame the notation either as a function of the distribution, or a function of the random variable. In the latter case we use the same notational convention used for moments of random variables, which are also functions of the underlying distribution of the random variable.
Technical issues with moment notation: From a technical perspective, a random variable is a mapping on the sample space. If we are working in the probability space $(\Omega, \mathscr{G}, \mathbb{P})$ then a random variable is a measureable function $X: \Omega \rightarrow \mathbb{R}$ from the sample space to the real numbers. Importantly, the random variable does not contain the information on its own distribution, so it is impossible to define the entropy of the distribution ---or any moments of the distribution--- purely as a function of the random variable. It is possible to obtain the probability distribution from the random variable $X$ and the probability measure $\mathbb{P}$, so such a function can have both arguments, but it cannot be a function only of the random variable.
This means that whenever we use moment notation (where we express moments as a function of the random variable rather than the distribution), the functions must be implicitly conditional on the underlying probability measure $\mathbb{P}$ or the specific distribution of the random variable in question. Sometimes we have a function where one or more arguments are only implicit, and do not appear in the function notation, and so it is certainly possible to write moments (and the entropy function) in this way. It is in common usage in statistical problems.
This notation is a convenience because it allows you to relate the moments/entropy directly to random variables rather than their distributions. | Why is entropy sometimes written as a function with a random variable as its argument?
This is notation that bypasses the distribution (similar to moments)
As can be seen from the formula, the entropy is fully determined by the probability distribution of the random variable, not the ra |
33,996 | Why is entropy sometimes written as a function with a random variable as its argument? | It makes sense if you remember that X is a statistical ensemble, which has associated with it some probability distribution. For instance, the Wikipedia article for information-theoretic entropy consistently uses the notation $H(X)$. In that sense, it’s actually the Q that’s extraneous.
I can speculate two reasons your instructor includes the Q there.
The Q could be there to remind you what the associated probability distribution is. It could also be a preface to introducing concepts like cross-entropy, where you may take your average over a different distribution P. (The cross-entropy Wikipedia article exclusively uses distributions over the same support as arguments to the cross-entropy function.) | Why is entropy sometimes written as a function with a random variable as its argument? | It makes sense if you remember that X is a statistical ensemble, which has associated with it some probability distribution. For instance, the Wikipedia article for information-theoretic entropy consi | Why is entropy sometimes written as a function with a random variable as its argument?
It makes sense if you remember that X is a statistical ensemble, which has associated with it some probability distribution. For instance, the Wikipedia article for information-theoretic entropy consistently uses the notation $H(X)$. In that sense, it’s actually the Q that’s extraneous.
I can speculate two reasons your instructor includes the Q there.
The Q could be there to remind you what the associated probability distribution is. It could also be a preface to introducing concepts like cross-entropy, where you may take your average over a different distribution P. (The cross-entropy Wikipedia article exclusively uses distributions over the same support as arguments to the cross-entropy function.) | Why is entropy sometimes written as a function with a random variable as its argument?
It makes sense if you remember that X is a statistical ensemble, which has associated with it some probability distribution. For instance, the Wikipedia article for information-theoretic entropy consi |
33,997 | Why is entropy sometimes written as a function with a random variable as its argument? | $H$ is just a letter some smart guy use for Entropy. It is possible to use even $E$ for entropy but then there will be confusion with the expected value.
In here $X \sim \mathcal D$, means $\mathcal D$ is probability distribution of discrete random variable $X$.
$$
H[X] = - \sum_{x \sim \mathcal D, \\ x \in R_X} P(x) \log_2 P(x)
$$
where:
$P(x)$ is probability that $X=x$
$x \sim \mathcal D$ ($x$ is also drawn from $\mathcal D$)
$R_X$ is the support of $X$ (the set of all possible values $X$ can take) | Why is entropy sometimes written as a function with a random variable as its argument? | $H$ is just a letter some smart guy use for Entropy. It is possible to use even $E$ for entropy but then there will be confusion with the expected value.
In here $X \sim \mathcal D$, means $\mathcal D | Why is entropy sometimes written as a function with a random variable as its argument?
$H$ is just a letter some smart guy use for Entropy. It is possible to use even $E$ for entropy but then there will be confusion with the expected value.
In here $X \sim \mathcal D$, means $\mathcal D$ is probability distribution of discrete random variable $X$.
$$
H[X] = - \sum_{x \sim \mathcal D, \\ x \in R_X} P(x) \log_2 P(x)
$$
where:
$P(x)$ is probability that $X=x$
$x \sim \mathcal D$ ($x$ is also drawn from $\mathcal D$)
$R_X$ is the support of $X$ (the set of all possible values $X$ can take) | Why is entropy sometimes written as a function with a random variable as its argument?
$H$ is just a letter some smart guy use for Entropy. It is possible to use even $E$ for entropy but then there will be confusion with the expected value.
In here $X \sim \mathcal D$, means $\mathcal D |
33,998 | Why is entropy sometimes written as a function with a random variable as its argument? | A possible perspective is that it better accommodates the notation for conditional entropy (or mutual information): consider the common notation $H_P(X|Y)$, where $P_{XY}$ is understood to refer to the joint distribution on $XY$, versus alternatives one might consider such as e.g. $H(P_X|P_Y)$, which might mislead one into thinking it is a function of the marginal distributions $P_X$ and $P_Y$ alone.
(Of course, $H(P_X|P_Y)$ is not the only way one could try to denote this, but it seems very likely that any notation for conditional entropy will need to refer to $X$, $Y$ and the joint distribution $P_{XY}$ in some form - so you might as well put it together as $H_P(X|Y)$.)
Though in any case, you're not alone in suggesting the notation $H(P)$ when there is only one random variable - it's used in some places, but mostly when there is no danger of confusion along the lines of what's mentioned above. | Why is entropy sometimes written as a function with a random variable as its argument? | A possible perspective is that it better accommodates the notation for conditional entropy (or mutual information): consider the common notation $H_P(X|Y)$, where $P_{XY}$ is understood to refer to th | Why is entropy sometimes written as a function with a random variable as its argument?
A possible perspective is that it better accommodates the notation for conditional entropy (or mutual information): consider the common notation $H_P(X|Y)$, where $P_{XY}$ is understood to refer to the joint distribution on $XY$, versus alternatives one might consider such as e.g. $H(P_X|P_Y)$, which might mislead one into thinking it is a function of the marginal distributions $P_X$ and $P_Y$ alone.
(Of course, $H(P_X|P_Y)$ is not the only way one could try to denote this, but it seems very likely that any notation for conditional entropy will need to refer to $X$, $Y$ and the joint distribution $P_{XY}$ in some form - so you might as well put it together as $H_P(X|Y)$.)
Though in any case, you're not alone in suggesting the notation $H(P)$ when there is only one random variable - it's used in some places, but mostly when there is no danger of confusion along the lines of what's mentioned above. | Why is entropy sometimes written as a function with a random variable as its argument?
A possible perspective is that it better accommodates the notation for conditional entropy (or mutual information): consider the common notation $H_P(X|Y)$, where $P_{XY}$ is understood to refer to th |
33,999 | Why not always use generalized estimating equations (GEE) instead of linear mixed models? | I think there could be some confusion caused by those links. I believe the statement about "not for nonlinear models" is actually referring to generalised linear mixed models (GLMMs), for example when the response is binary or a count or generally whenever a non-gaussian link function is used; and not a nonlinear mixed model, such as those that can be fitted with nlme like the logistic growth model $f(x)={\frac {L}{1+e^{-k(x-x_{0})}}}$ where we would no longer have a linear predictor. GLMMs still have a linear predictor, but a lot of the literature on GLMMs talks about them being nonlinear models due to the link function, but not the functional form of the model iteslf. This inevitably can lead to some confusion.
So, usually the debate about GEE vs mixed models is actually about GEE vs GLMM.
GLMMs typically produce estimates that are conditional on the random effects, whereas GEEs average over the random effects to produce marginal estimates. The fundamental difference between the two is in this interpretation of the (fixed) effects. GEEs produce population-averaged effects, while GLMMs produce subject specific effects.
So there is indeed an argument for the use of GEE rather than GLMM when the marginal (population averaged) interpretation is wanted. GEEs are also useful when the correlation structure is mispecified, as the standard errors are robust. On the other hand GEE is know to require larger sample sizes and is not robust to data missing at random whereas GLMMs generally are. Finally, the GLMMAdaptive package in R can produced marginal as well as conditional estimates. | Why not always use generalized estimating equations (GEE) instead of linear mixed models? | I think there could be some confusion caused by those links. I believe the statement about "not for nonlinear models" is actually referring to generalised linear mixed models (GLMMs), for example when | Why not always use generalized estimating equations (GEE) instead of linear mixed models?
I think there could be some confusion caused by those links. I believe the statement about "not for nonlinear models" is actually referring to generalised linear mixed models (GLMMs), for example when the response is binary or a count or generally whenever a non-gaussian link function is used; and not a nonlinear mixed model, such as those that can be fitted with nlme like the logistic growth model $f(x)={\frac {L}{1+e^{-k(x-x_{0})}}}$ where we would no longer have a linear predictor. GLMMs still have a linear predictor, but a lot of the literature on GLMMs talks about them being nonlinear models due to the link function, but not the functional form of the model iteslf. This inevitably can lead to some confusion.
So, usually the debate about GEE vs mixed models is actually about GEE vs GLMM.
GLMMs typically produce estimates that are conditional on the random effects, whereas GEEs average over the random effects to produce marginal estimates. The fundamental difference between the two is in this interpretation of the (fixed) effects. GEEs produce population-averaged effects, while GLMMs produce subject specific effects.
So there is indeed an argument for the use of GEE rather than GLMM when the marginal (population averaged) interpretation is wanted. GEEs are also useful when the correlation structure is mispecified, as the standard errors are robust. On the other hand GEE is know to require larger sample sizes and is not robust to data missing at random whereas GLMMs generally are. Finally, the GLMMAdaptive package in R can produced marginal as well as conditional estimates. | Why not always use generalized estimating equations (GEE) instead of linear mixed models?
I think there could be some confusion caused by those links. I believe the statement about "not for nonlinear models" is actually referring to generalised linear mixed models (GLMMs), for example when |
34,000 | Why not always use generalized estimating equations (GEE) instead of linear mixed models? | GEE is an asymptotic method and is less robust than it would appear from its derivation. It may not be accurate in small samples, and it doesn't extend to multiple levels of clustering. It assumes that missing data are missing completely at random and is not robust to non-random dropouts in a longitiudinal study. Finally, GEE invites a disjointed way of thinking because not using a full likelihood means that you can't do a Bayesian GEE, you can only do frequentist GEE.
There are marginal models (i.e., models that don't condition on subject-specific random effects) that are full likelihood that are not GEE. The oldest example is growth curve analysis, now called generalized least squares. This assumes multivariate normality with a parametric correlation structure, and I have a full case study here. But this approach does not extend easily to ordinal and binary Y. | Why not always use generalized estimating equations (GEE) instead of linear mixed models? | GEE is an asymptotic method and is less robust than it would appear from its derivation. It may not be accurate in small samples, and it doesn't extend to multiple levels of clustering. It assumes t | Why not always use generalized estimating equations (GEE) instead of linear mixed models?
GEE is an asymptotic method and is less robust than it would appear from its derivation. It may not be accurate in small samples, and it doesn't extend to multiple levels of clustering. It assumes that missing data are missing completely at random and is not robust to non-random dropouts in a longitiudinal study. Finally, GEE invites a disjointed way of thinking because not using a full likelihood means that you can't do a Bayesian GEE, you can only do frequentist GEE.
There are marginal models (i.e., models that don't condition on subject-specific random effects) that are full likelihood that are not GEE. The oldest example is growth curve analysis, now called generalized least squares. This assumes multivariate normality with a parametric correlation structure, and I have a full case study here. But this approach does not extend easily to ordinal and binary Y. | Why not always use generalized estimating equations (GEE) instead of linear mixed models?
GEE is an asymptotic method and is less robust than it would appear from its derivation. It may not be accurate in small samples, and it doesn't extend to multiple levels of clustering. It assumes t |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.