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
|
|---|---|---|---|---|---|---|
39,701
|
How to prevent collinearity?
|
The example you mention is a little overly simplified for my taste. But the sentiment is right: correcting for collinearity is not a post-hoc procedure. This is guaranteed to lead to data dredging, since the result of collinearity is variance inflation, and adding or removing factors to get significant results (i.e. from reduced variance) is not a statistically sound procedure.
To dive into the example more, I think we have to distinguish randomized experimental studies and pseudo-randomized or observational studies.
randomized approaches
Basically, the examples suggests in both scenarios: use experimental or pseudo-experimental design to reduce collinearity of factors. Randomization should eliminate collinearity. This is called the randomization assumption. Blocking or blocked randomization, or blocked design, ensures that covariates are balanced exactly rather than probabilistically (i.e. in their expected value). Similar to this is re-randomization; you can re-roll your die to obtain covariate levels which are balanced if the cohort design is not staggered. Other blocking strategies have been discussed elsewhere, like Latin Squares, and so on.
pseudo-randomized approaches
In observational studies, then, a new field of causal modeling has emphasized the rationale for adjusting for certain variables in the analysis. With regards to whether it causes collinearity or not, we say, "So what?" And include it anyway. For instance, social depravity is highly correlated with the likelihood of child smoking and it is also highly correlated with children's health. When you adjust for its influence in measures of association between smoking and health, you find a somewhat attenuated estimate. This is because, by not accounting for social depravity, smoking is to some extent a measure of the hardship of life: low income, stable housing, adequate food, and so on, as well as the direct effect of smoking on health.
Often studies aren't randomized, so that several confounding variables may affect the association between a pseudo-treatment and an outcome. Here, a pseudo-treatment is something that can't be randomized for one reason or another, like smoking in children. Matching or paired design based on exposed and unexposed individuals in strata defined by confounders would result in the confounders being orthogonal to the exposure. The distribution of confounders then is balanced between exposed and unexposed participants (you may also categorize the exposure into quantiles or such and obtained matched samples there).
Related to this, you might consider using propensity matching. The concept was born out of an approach to blend observational and experimental design. It turns out, if you can construct a prediction model for the likelihood of receipt of exposure, based on measured confounding variables, that model produces a propensity score. By matching equally likely cases and controls, you may obtain a subsample of the observational sample which is "balanced" in some sense. But again, choice of confounders post hoc is often a bad idea, because we rarely just "conveniently" measure them, they must be pre-specified. Omitting confounders results in poor performance and bias of propensity matched analyses.
However, both of these approaches are equivalent to just adjusting for the confounders in the model.
So in both cases, collinearity is something which is addressed a priori to data collection. The question, then, shouldn't be how to prevent collinearity from a data analysis perspective. It's simply to make a note of it, and account for the reduction in power. If a factor is the correct thing to adjust for in a model, you must do it if you can. If it renders results non-significant when an association would be expected, you may hypothesize that variance inflation overspent your power, and additionally report unadjusted associations, commenting on their differences. This would be an inconclusive finding, however.
|
How to prevent collinearity?
|
The example you mention is a little overly simplified for my taste. But the sentiment is right: correcting for collinearity is not a post-hoc procedure. This is guaranteed to lead to data dredging, si
|
How to prevent collinearity?
The example you mention is a little overly simplified for my taste. But the sentiment is right: correcting for collinearity is not a post-hoc procedure. This is guaranteed to lead to data dredging, since the result of collinearity is variance inflation, and adding or removing factors to get significant results (i.e. from reduced variance) is not a statistically sound procedure.
To dive into the example more, I think we have to distinguish randomized experimental studies and pseudo-randomized or observational studies.
randomized approaches
Basically, the examples suggests in both scenarios: use experimental or pseudo-experimental design to reduce collinearity of factors. Randomization should eliminate collinearity. This is called the randomization assumption. Blocking or blocked randomization, or blocked design, ensures that covariates are balanced exactly rather than probabilistically (i.e. in their expected value). Similar to this is re-randomization; you can re-roll your die to obtain covariate levels which are balanced if the cohort design is not staggered. Other blocking strategies have been discussed elsewhere, like Latin Squares, and so on.
pseudo-randomized approaches
In observational studies, then, a new field of causal modeling has emphasized the rationale for adjusting for certain variables in the analysis. With regards to whether it causes collinearity or not, we say, "So what?" And include it anyway. For instance, social depravity is highly correlated with the likelihood of child smoking and it is also highly correlated with children's health. When you adjust for its influence in measures of association between smoking and health, you find a somewhat attenuated estimate. This is because, by not accounting for social depravity, smoking is to some extent a measure of the hardship of life: low income, stable housing, adequate food, and so on, as well as the direct effect of smoking on health.
Often studies aren't randomized, so that several confounding variables may affect the association between a pseudo-treatment and an outcome. Here, a pseudo-treatment is something that can't be randomized for one reason or another, like smoking in children. Matching or paired design based on exposed and unexposed individuals in strata defined by confounders would result in the confounders being orthogonal to the exposure. The distribution of confounders then is balanced between exposed and unexposed participants (you may also categorize the exposure into quantiles or such and obtained matched samples there).
Related to this, you might consider using propensity matching. The concept was born out of an approach to blend observational and experimental design. It turns out, if you can construct a prediction model for the likelihood of receipt of exposure, based on measured confounding variables, that model produces a propensity score. By matching equally likely cases and controls, you may obtain a subsample of the observational sample which is "balanced" in some sense. But again, choice of confounders post hoc is often a bad idea, because we rarely just "conveniently" measure them, they must be pre-specified. Omitting confounders results in poor performance and bias of propensity matched analyses.
However, both of these approaches are equivalent to just adjusting for the confounders in the model.
So in both cases, collinearity is something which is addressed a priori to data collection. The question, then, shouldn't be how to prevent collinearity from a data analysis perspective. It's simply to make a note of it, and account for the reduction in power. If a factor is the correct thing to adjust for in a model, you must do it if you can. If it renders results non-significant when an association would be expected, you may hypothesize that variance inflation overspent your power, and additionally report unadjusted associations, commenting on their differences. This would be an inconclusive finding, however.
|
How to prevent collinearity?
The example you mention is a little overly simplified for my taste. But the sentiment is right: correcting for collinearity is not a post-hoc procedure. This is guaranteed to lead to data dredging, si
|
39,702
|
How to prevent collinearity?
|
Generally your sample should be a random sample, therefore what you read is the intuitive description of credible randomness. The opposite would be systematic bias like are you only sampling from one town in a country? Or from one family in a village? Or is there a strong time trend and your cross-section is a quasi time series you're ignoring? Ask yourself these questions and if the answer is no then there should be no multicollinearity in the data.
Another issue is this: most estimation procedures involve inverting a second moment matrix of the type $(X'X)^{-1}$. Now, if your data quality is so low that there is not a lot of variation in it, and this will be reflected in the second moment matrices as they measure the spread, then they may be near non-invertible.
Your standard errors will be huge (b/c you're effectively dividing by zero) in this case meaning your t-stats will be low leading to less parameter significance but if you're stuck at the stage of inverting second moment matrices, then you can find a generalized inverse that will get you some coefficient but as I wrote, it is most likely insignificant.
|
How to prevent collinearity?
|
Generally your sample should be a random sample, therefore what you read is the intuitive description of credible randomness. The opposite would be systematic bias like are you only sampling from one
|
How to prevent collinearity?
Generally your sample should be a random sample, therefore what you read is the intuitive description of credible randomness. The opposite would be systematic bias like are you only sampling from one town in a country? Or from one family in a village? Or is there a strong time trend and your cross-section is a quasi time series you're ignoring? Ask yourself these questions and if the answer is no then there should be no multicollinearity in the data.
Another issue is this: most estimation procedures involve inverting a second moment matrix of the type $(X'X)^{-1}$. Now, if your data quality is so low that there is not a lot of variation in it, and this will be reflected in the second moment matrices as they measure the spread, then they may be near non-invertible.
Your standard errors will be huge (b/c you're effectively dividing by zero) in this case meaning your t-stats will be low leading to less parameter significance but if you're stuck at the stage of inverting second moment matrices, then you can find a generalized inverse that will get you some coefficient but as I wrote, it is most likely insignificant.
|
How to prevent collinearity?
Generally your sample should be a random sample, therefore what you read is the intuitive description of credible randomness. The opposite would be systematic bias like are you only sampling from one
|
39,703
|
How to prevent collinearity?
|
Remember collinearity is a consequence of having multiple predictor variables that have a large correlation because.... they might have too much in common! And this creates a problem because they make the analysis of the impact on the response very hard to understand since those variables affect significantly the change on the response at the same time. Therefore, in order to avoid this to happen (and introduce noise to your model) you need to evaluate each independent variable y on x(i) on analogous scatter plots (correlation plots) to see how they independently affect the response. Also, is good to get some background of what the variables are actually describing, because they might share similar properties or attributes, so you are basically describing something twice... Also, you can use the variance inflation factor (VIF) which quantifies the amount of variance for each variable. The correlation between two variables define the VIF, so the larger the VIF the larger the standard error. VIF helps asses the proportion if variation in a variable after the other one happened. VIF = 1 (or very close) means that the collinearity effect between variables is not statistically significant.
By using the plots, and using the VIF, you can have an idea of the collinearity and eventually take the decision to keep or remove a variable to improve your model.
There are several treatments that can be applied to collinearity
remove redundant variables
Re-express explanatory variable (maybe a ratio?)
do nothing, since the collinearity might not be to high but still helps to explain the change on the response.
|
How to prevent collinearity?
|
Remember collinearity is a consequence of having multiple predictor variables that have a large correlation because.... they might have too much in common! And this creates a problem because they make
|
How to prevent collinearity?
Remember collinearity is a consequence of having multiple predictor variables that have a large correlation because.... they might have too much in common! And this creates a problem because they make the analysis of the impact on the response very hard to understand since those variables affect significantly the change on the response at the same time. Therefore, in order to avoid this to happen (and introduce noise to your model) you need to evaluate each independent variable y on x(i) on analogous scatter plots (correlation plots) to see how they independently affect the response. Also, is good to get some background of what the variables are actually describing, because they might share similar properties or attributes, so you are basically describing something twice... Also, you can use the variance inflation factor (VIF) which quantifies the amount of variance for each variable. The correlation between two variables define the VIF, so the larger the VIF the larger the standard error. VIF helps asses the proportion if variation in a variable after the other one happened. VIF = 1 (or very close) means that the collinearity effect between variables is not statistically significant.
By using the plots, and using the VIF, you can have an idea of the collinearity and eventually take the decision to keep or remove a variable to improve your model.
There are several treatments that can be applied to collinearity
remove redundant variables
Re-express explanatory variable (maybe a ratio?)
do nothing, since the collinearity might not be to high but still helps to explain the change on the response.
|
How to prevent collinearity?
Remember collinearity is a consequence of having multiple predictor variables that have a large correlation because.... they might have too much in common! And this creates a problem because they make
|
39,704
|
Machine learning for discovering formulas
|
In addition to nice answer by @DankMasterDan (+1), I would like to share further information on the topic. It seems that an approach that you're looking for is symbolic regression. It seems to be closely associated with and usually is implemented via evolutionary algorithms, such as the most popular genetic programming (GP). However, other approaches are also proposed, especially in relation to analytical models of physical systems. For example, see a paper by Shmidt and Lipson (2009), published in Science. By the way, this small open source Java-based project presents an implementation of the above-mentioned approach.
In terms of software, available for symbolic regression, before I concentrate on my favorite open source solutions, I'd like to mention that Eureqa is definitely an interesting product, which has grown from an open source project. However it is quite expensive, as many commercial statistical or machine learning solutions, available on the market today.
I will start a brief review of open source solutions with a hybrid solution GPTIPS, which is an open source plug-in software for commercial MATLAB. It is referred to by authors as a "symbolic data mining platform for MATLAB".
Now, turning to a full open source software, we can find several IMHO very interesting solutions. A well-known language-agnostic (but still Python-based) system SageMath offers symbolic regression functionality via SymPy Python library, which can also be used independently as well. Another very interesting comprehensive open source software system is .NET-based HeuristicLab. While HeuristicLab is labeled "a framework for heuristic and evolutionary algorithms", it offers a much wider range of functionality beyond symbolic computations and evolutionary/GP solutions.
In addition to already-mentioned SymPy libarary, Python ecosystem offers DEAP open source project, where DEAP abbreviation refers to Distributed Evolutionary Algorithms in Python.
My brief analysis of open source software for symbolic regression and related solutions would be incomplete without mentioning what my favorite R ecosystem offers in that regard. An interesting R package for GP and symbolic regression is rgp (available on CRAN), which is referred to as "R genetic programming framework" (RGP). The RGP package is a part of a larger set of open source tools for symbolic computation in R, developed under the umbrella of a larger Rsymbolic project. There are also several optimization-focused GP packages (http://cran.r-project.org/web/views/Optimization.html), however it is highly unlikely that they offer symbolic regression functionality out-of-the-box, as RGP package does.
References
Schmidt, M., & Lipson, H. (2009). Distilling free-form natural laws from experimental data. Science, 324(5923), 81–85. doi:10.1126/science.1165893 Retrieved from http://creativemachines.cornell.edu/sites/default/files/Science09_Schmidt.pdf
|
Machine learning for discovering formulas
|
In addition to nice answer by @DankMasterDan (+1), I would like to share further information on the topic. It seems that an approach that you're looking for is symbolic regression. It seems to be clos
|
Machine learning for discovering formulas
In addition to nice answer by @DankMasterDan (+1), I would like to share further information on the topic. It seems that an approach that you're looking for is symbolic regression. It seems to be closely associated with and usually is implemented via evolutionary algorithms, such as the most popular genetic programming (GP). However, other approaches are also proposed, especially in relation to analytical models of physical systems. For example, see a paper by Shmidt and Lipson (2009), published in Science. By the way, this small open source Java-based project presents an implementation of the above-mentioned approach.
In terms of software, available for symbolic regression, before I concentrate on my favorite open source solutions, I'd like to mention that Eureqa is definitely an interesting product, which has grown from an open source project. However it is quite expensive, as many commercial statistical or machine learning solutions, available on the market today.
I will start a brief review of open source solutions with a hybrid solution GPTIPS, which is an open source plug-in software for commercial MATLAB. It is referred to by authors as a "symbolic data mining platform for MATLAB".
Now, turning to a full open source software, we can find several IMHO very interesting solutions. A well-known language-agnostic (but still Python-based) system SageMath offers symbolic regression functionality via SymPy Python library, which can also be used independently as well. Another very interesting comprehensive open source software system is .NET-based HeuristicLab. While HeuristicLab is labeled "a framework for heuristic and evolutionary algorithms", it offers a much wider range of functionality beyond symbolic computations and evolutionary/GP solutions.
In addition to already-mentioned SymPy libarary, Python ecosystem offers DEAP open source project, where DEAP abbreviation refers to Distributed Evolutionary Algorithms in Python.
My brief analysis of open source software for symbolic regression and related solutions would be incomplete without mentioning what my favorite R ecosystem offers in that regard. An interesting R package for GP and symbolic regression is rgp (available on CRAN), which is referred to as "R genetic programming framework" (RGP). The RGP package is a part of a larger set of open source tools for symbolic computation in R, developed under the umbrella of a larger Rsymbolic project. There are also several optimization-focused GP packages (http://cran.r-project.org/web/views/Optimization.html), however it is highly unlikely that they offer symbolic regression functionality out-of-the-box, as RGP package does.
References
Schmidt, M., & Lipson, H. (2009). Distilling free-form natural laws from experimental data. Science, 324(5923), 81–85. doi:10.1126/science.1165893 Retrieved from http://creativemachines.cornell.edu/sites/default/files/Science09_Schmidt.pdf
|
Machine learning for discovering formulas
In addition to nice answer by @DankMasterDan (+1), I would like to share further information on the topic. It seems that an approach that you're looking for is symbolic regression. It seems to be clos
|
39,705
|
Machine learning for discovering formulas
|
It sounds like your goal is to find an arbitrary function g(:) such that y=g(x).
The answer to your question depends on what you mean by explicit. Specifically, you should note that there are an infinite number of ways to specify any function g(:), for example g(x)=x on -1
If by 'explicit' you mean find a a g*(:) which is functionally equivalent to g(x) - ie gives the same output of g(x) for all values of x then yes, there are many ML algorithms which can do this for arbitrary functions g(:). These algorithms could give you perfect predictive power from x to y, albeit at the possible expense of overfitting the data. They include SVM with RBF kernels and decision trees (ie any algorithm w/ infinite VK dimension).
However, if by explicit you mean the SIMPLEST g(:) which describes y=g(x), then things get much more complicated because simplicity/sparsity/complexity is a human notion which can only be quantified very clumsily. For example, in theory, SVM regression w/ rbf kernel could perfectly fit y=sin(x), but it wouldn't output g=sin(:) but rather an uninterpretable series of coefficients, and you would have to do the work to piece them together into 'sin(x)'.
Now done with that theoretical mumbo-jumbo, I think a good way of getting started is to fit the the data with a taylor expansion as this is at least somewhat interpretable.
Good luck, hope this helps!
|
Machine learning for discovering formulas
|
It sounds like your goal is to find an arbitrary function g(:) such that y=g(x).
The answer to your question depends on what you mean by explicit. Specifically, you should note that there are an infin
|
Machine learning for discovering formulas
It sounds like your goal is to find an arbitrary function g(:) such that y=g(x).
The answer to your question depends on what you mean by explicit. Specifically, you should note that there are an infinite number of ways to specify any function g(:), for example g(x)=x on -1
If by 'explicit' you mean find a a g*(:) which is functionally equivalent to g(x) - ie gives the same output of g(x) for all values of x then yes, there are many ML algorithms which can do this for arbitrary functions g(:). These algorithms could give you perfect predictive power from x to y, albeit at the possible expense of overfitting the data. They include SVM with RBF kernels and decision trees (ie any algorithm w/ infinite VK dimension).
However, if by explicit you mean the SIMPLEST g(:) which describes y=g(x), then things get much more complicated because simplicity/sparsity/complexity is a human notion which can only be quantified very clumsily. For example, in theory, SVM regression w/ rbf kernel could perfectly fit y=sin(x), but it wouldn't output g=sin(:) but rather an uninterpretable series of coefficients, and you would have to do the work to piece them together into 'sin(x)'.
Now done with that theoretical mumbo-jumbo, I think a good way of getting started is to fit the the data with a taylor expansion as this is at least somewhat interpretable.
Good luck, hope this helps!
|
Machine learning for discovering formulas
It sounds like your goal is to find an arbitrary function g(:) such that y=g(x).
The answer to your question depends on what you mean by explicit. Specifically, you should note that there are an infin
|
39,706
|
Machine learning for discovering formulas
|
I strongly prefer Mathematica for such tasks. Given data of the form $mydata = \{ \{ x_1, y_1 \}, \{ x_2, y_2 \}, ... \}$, one searches for the unknown parameters such as $a$, $b$, $c$, and $d$ in a non-linear function of your choice in this way:
NonlinearModelFit[mydata, {a + b x + c x^2 + d Sin[x]}, {a, b, c, d}, x]
The symbolic output is
FittedModel[2.8 + 1.075 x + .292 x^2 + 4.9 Sin[x]]
A plot of that nonlinear model and the data looks like this:
You can put in as many basis functions as you like, and some may be "fit" with $0$ coefficients and such. Of course, too, you need more data points than free parameters for your fit to be meaningful.
|
Machine learning for discovering formulas
|
I strongly prefer Mathematica for such tasks. Given data of the form $mydata = \{ \{ x_1, y_1 \}, \{ x_2, y_2 \}, ... \}$, one searches for the unknown parameters such as $a$, $b$, $c$, and $d$ in a
|
Machine learning for discovering formulas
I strongly prefer Mathematica for such tasks. Given data of the form $mydata = \{ \{ x_1, y_1 \}, \{ x_2, y_2 \}, ... \}$, one searches for the unknown parameters such as $a$, $b$, $c$, and $d$ in a non-linear function of your choice in this way:
NonlinearModelFit[mydata, {a + b x + c x^2 + d Sin[x]}, {a, b, c, d}, x]
The symbolic output is
FittedModel[2.8 + 1.075 x + .292 x^2 + 4.9 Sin[x]]
A plot of that nonlinear model and the data looks like this:
You can put in as many basis functions as you like, and some may be "fit" with $0$ coefficients and such. Of course, too, you need more data points than free parameters for your fit to be meaningful.
|
Machine learning for discovering formulas
I strongly prefer Mathematica for such tasks. Given data of the form $mydata = \{ \{ x_1, y_1 \}, \{ x_2, y_2 \}, ... \}$, one searches for the unknown parameters such as $a$, $b$, $c$, and $d$ in a
|
39,707
|
Using multiple comparisons corrections in Fisher p-value framework
|
Following @MichaelLew's answer (+1), I changed my point of view to the opposite one; now I think that $p$-values should NOT be corrected. I have reworked my answer.
To make the discussion more lively, I will refer to the famous XKCD comic where $20$ colours of jelly beans are independently tested to be linked to acne, and green jelly beans yield $p<0.05$; for concreteness, let us assume it was $p=0.02$:
The Fisher approach is to consider $p$-value as quantifying the strength of evidence, or rather as a measure of surprise ("surprisingness") -- I like this expression and find it intuitively clear and the same time quite precise. We pretend that the null is true and quantify how surprised we should then be to observe such results. This yields a $p$-value. In the "hybrid" Fisher-Neyman-Pearson approach, if we are surprised more than some chosen surprisingness threshold ($p<\alpha$) then we additionally call the results "significant"; this allows to control type I error rate.
Importantly, the threshold should represent our prior beliefs and expectations. For example, "extraordinary claims require extraordinary evidence": we would need to be very surprised to believe the evidence of e.g. clairvoyance, and so would like to set a very low threshold.
In the jelly beans example, each individual $p$-value reflects the surprisingness of each individual correlation. Bonferroni correction replaces $\alpha$ with $\alpha/k$ to control the overall type I error rate. In the first version of this answer, I argued that we should also be less surprised (and should consider that we have less evidence) by getting $p=0.02$ for green jelly beans if we know that we ran $20$ tests, hence Fisher's $p$-values should also be replaced with $kp$.
Now I think it is wrong, and $p$-values should not be adjusted.
First of all, let's point out that for the hybrid approach to be coherent, we cannot possibly adjust both, $p$-values and $\alpha$ threshold. Only one or another can be adjusted. Here are two arguments for why it should be $\alpha$.
Consider exactly the same jelly beans setting, but now we a priori expected that green jelly beans are likely to be linked to acne (say, somebody suggested a theory with this prediction). Then we would be happy to see $p=0.02$ and would not make any adjustments to anything. But nothing about the experiment has changed! If $p$-value is a measure of surprisingness (of each individual experiment), then $p=0.02$ should stay the same. What changes is our $\alpha$, and it is only natural, because as I argued above, the threshold always in one way or another reflects our assumptions and expectations.
$P$-value has a clear interpretation: it is a probability of obtaining the observed (or even less favorable) results under the null hypothesis. If there is no link between green jelly beans and acne, then this probability is $p=0.02$. Replacing it with $kp=20\cdot 0.02=0.4$ ruins this interpretation; this is now not a probability of anything anymore. Moreover, imagine that not the $20$ colours were tested, but $100$. Then $kp=2$, which is larger than $1$, and obviously cannot be a probability. Whereas reducing $\alpha$ by $100$ still makes sense.
To put it in terms of evidence, the "evidence" that green jelly beans are linked to acne is measured as $p=0.02$ and that's that; what changes depending on the circumstances (in this case, on the number of performed tests), is how we treat this evidence.
I should stress that "how we treat the evidence" is something that is very much not fixed in the Fisher's framework either (see this famous quote). When I say that $p$-values should better not be adjusted, it does not mean that Sir Ronald Fisher would look at $p=0.02$ for green jelly beans and consider that a convincing result. I am sure he would still be wary of it.
Concluding metaphor: the process of cherry picking does not modify the cherries! It modifies how we treat these cherries.
|
Using multiple comparisons corrections in Fisher p-value framework
|
Following @MichaelLew's answer (+1), I changed my point of view to the opposite one; now I think that $p$-values should NOT be corrected. I have reworked my answer.
To make the discussion more lively,
|
Using multiple comparisons corrections in Fisher p-value framework
Following @MichaelLew's answer (+1), I changed my point of view to the opposite one; now I think that $p$-values should NOT be corrected. I have reworked my answer.
To make the discussion more lively, I will refer to the famous XKCD comic where $20$ colours of jelly beans are independently tested to be linked to acne, and green jelly beans yield $p<0.05$; for concreteness, let us assume it was $p=0.02$:
The Fisher approach is to consider $p$-value as quantifying the strength of evidence, or rather as a measure of surprise ("surprisingness") -- I like this expression and find it intuitively clear and the same time quite precise. We pretend that the null is true and quantify how surprised we should then be to observe such results. This yields a $p$-value. In the "hybrid" Fisher-Neyman-Pearson approach, if we are surprised more than some chosen surprisingness threshold ($p<\alpha$) then we additionally call the results "significant"; this allows to control type I error rate.
Importantly, the threshold should represent our prior beliefs and expectations. For example, "extraordinary claims require extraordinary evidence": we would need to be very surprised to believe the evidence of e.g. clairvoyance, and so would like to set a very low threshold.
In the jelly beans example, each individual $p$-value reflects the surprisingness of each individual correlation. Bonferroni correction replaces $\alpha$ with $\alpha/k$ to control the overall type I error rate. In the first version of this answer, I argued that we should also be less surprised (and should consider that we have less evidence) by getting $p=0.02$ for green jelly beans if we know that we ran $20$ tests, hence Fisher's $p$-values should also be replaced with $kp$.
Now I think it is wrong, and $p$-values should not be adjusted.
First of all, let's point out that for the hybrid approach to be coherent, we cannot possibly adjust both, $p$-values and $\alpha$ threshold. Only one or another can be adjusted. Here are two arguments for why it should be $\alpha$.
Consider exactly the same jelly beans setting, but now we a priori expected that green jelly beans are likely to be linked to acne (say, somebody suggested a theory with this prediction). Then we would be happy to see $p=0.02$ and would not make any adjustments to anything. But nothing about the experiment has changed! If $p$-value is a measure of surprisingness (of each individual experiment), then $p=0.02$ should stay the same. What changes is our $\alpha$, and it is only natural, because as I argued above, the threshold always in one way or another reflects our assumptions and expectations.
$P$-value has a clear interpretation: it is a probability of obtaining the observed (or even less favorable) results under the null hypothesis. If there is no link between green jelly beans and acne, then this probability is $p=0.02$. Replacing it with $kp=20\cdot 0.02=0.4$ ruins this interpretation; this is now not a probability of anything anymore. Moreover, imagine that not the $20$ colours were tested, but $100$. Then $kp=2$, which is larger than $1$, and obviously cannot be a probability. Whereas reducing $\alpha$ by $100$ still makes sense.
To put it in terms of evidence, the "evidence" that green jelly beans are linked to acne is measured as $p=0.02$ and that's that; what changes depending on the circumstances (in this case, on the number of performed tests), is how we treat this evidence.
I should stress that "how we treat the evidence" is something that is very much not fixed in the Fisher's framework either (see this famous quote). When I say that $p$-values should better not be adjusted, it does not mean that Sir Ronald Fisher would look at $p=0.02$ for green jelly beans and consider that a convincing result. I am sure he would still be wary of it.
Concluding metaphor: the process of cherry picking does not modify the cherries! It modifies how we treat these cherries.
|
Using multiple comparisons corrections in Fisher p-value framework
Following @MichaelLew's answer (+1), I changed my point of view to the opposite one; now I think that $p$-values should NOT be corrected. I have reworked my answer.
To make the discussion more lively,
|
39,708
|
Using multiple comparisons corrections in Fisher p-value framework
|
Amoeba's answer is good, but it not the answer that I would give, as he notes.
The answer is, of course, it depends. It depends on whether you want the P-value to be conditioned on the actual results of the particular comparison or to be conditioned additionally on the number of comparisons that you have made. In the former case you do not need to adjust the P-value for the multiplicity. In the latter case you should do so.
Why would you want to condition on the number of comparisons? To allow an algorithm-based decision process to provide a guarantee regarding the long term rate of a false positive errors.
Why would you not want to condition on the number of comparisons? To allow the P-value to represent the evidence in the particular experimental results of interest without being modified by the presence of other comparisons involving other data.
The long run error rate is a property of the method, and the evidence is a property of the particular set of data under consideration. A frequentist adjustment of the P-value for multiplicity treats the method properties as more important than the evidential meaning of the P-value. It is my opinion that the performance of the method that yielded the data in question is a useful piece of information to have when making inference from the evidence, but it should be kept as a separate piece of information rather than being rolled into the evidence by `correction' of the P-value. To roll it into the evidence is to modify the evidence in a manner that takes the responsibility for inference away from the analyst.
|
Using multiple comparisons corrections in Fisher p-value framework
|
Amoeba's answer is good, but it not the answer that I would give, as he notes.
The answer is, of course, it depends. It depends on whether you want the P-value to be conditioned on the actual results
|
Using multiple comparisons corrections in Fisher p-value framework
Amoeba's answer is good, but it not the answer that I would give, as he notes.
The answer is, of course, it depends. It depends on whether you want the P-value to be conditioned on the actual results of the particular comparison or to be conditioned additionally on the number of comparisons that you have made. In the former case you do not need to adjust the P-value for the multiplicity. In the latter case you should do so.
Why would you want to condition on the number of comparisons? To allow an algorithm-based decision process to provide a guarantee regarding the long term rate of a false positive errors.
Why would you not want to condition on the number of comparisons? To allow the P-value to represent the evidence in the particular experimental results of interest without being modified by the presence of other comparisons involving other data.
The long run error rate is a property of the method, and the evidence is a property of the particular set of data under consideration. A frequentist adjustment of the P-value for multiplicity treats the method properties as more important than the evidential meaning of the P-value. It is my opinion that the performance of the method that yielded the data in question is a useful piece of information to have when making inference from the evidence, but it should be kept as a separate piece of information rather than being rolled into the evidence by `correction' of the P-value. To roll it into the evidence is to modify the evidence in a manner that takes the responsibility for inference away from the analyst.
|
Using multiple comparisons corrections in Fisher p-value framework
Amoeba's answer is good, but it not the answer that I would give, as he notes.
The answer is, of course, it depends. It depends on whether you want the P-value to be conditioned on the actual results
|
39,709
|
PDF of function of X
|
Draw a picture.
Although you can apply a standard formula for changes of variable, this one is tricky because the transformation $X\to Y$ is not one-to-one. Often the most convenient and reliable method is to compute the distribution function (CDF) and then differentiate it.
The distribution function of $Y=\sin(X)$ is, by definition,
$$F_Y(y) = \Pr(Y \le y) = \Pr(\sin(X) \le y) = \Pr(\{X\,|\, \sin(X) \le y\}).$$
The latter probability is with respect to $X$. The graph of $\sin$ has been emphasized where its height is less than or equal to $y$. The values of $X$ where this occurs, shown in thick blue along the axis, show the set $\{x\in[0,4\pi]\,|\, \sin(x) \le y\}$.
When $0 \lt y$, this set consists of three disjoint intervals $\newcommand{s}{\sin^{-1}y}[0, \s]$, $[\pi -\s, 2\pi + \s]$, and $[3\pi - \s, 4\pi]$. Because they are disjoint, the chance that $X$ lies within this union is the sum of the chances of each interval:
$$\eqalign{
\Pr(\sin(X) \le y) &= F_X(\s) - F_X(0) \\
&+ F_X(2\pi + \s) - F_X(\pi - \s)\\
&+1 - F(3\pi - \s).
}$$
The value $1 = F_X(4\pi)$ appeared because the range of $X$ is $[0, 4\pi]$. However, we may not replace $F_X(0)$ by $0$ because possibly $X$ has nonzero probability there.
When $y \lt 0$, the set $\{X \in[0,4\pi]\,|\, \sin(X) \le y\}$ is the union of just two disjoint intervals:
By emulating the preceding argument, you should have no trouble writing down an expression for their probability in terms of $F_X$.
The PDF, when it exists, is the derivative of $F_Y$. In the first case
$$f_Y(y) = \frac{d}{dy} F_Y(y) = \frac{d}{dy}\left(F_X(\s) - F_X(0) + F_X(2\pi + \s) \cdots - F(3\pi - \s)\right).$$
Apply the Chain Rule, recognizing that $\frac{d}{dy}\s = 1/\sqrt{1-y^2}$:
$$f_Y(y) = \frac{1}{\sqrt{1-y^2}}\left(f_X(\s) + f_X(\pi-\s) + f_X(2\pi+\s) + f_X(3\pi-\s)\right)$$
This formula can be understood for all $y$ provided we replace $f_X(\s)$ by $f_X(4\pi + \s)$ whenever $y \lt 0$. Equivalently, and much more generally (with no restrictions on the range of $X$),
$$f_Y(y) = \frac{1}{\sqrt{1-y^2}}\sum_{i=-\infty}^\infty f_X(2i \pi + \s) + f_X((2i+1)\pi - \s).$$
|
PDF of function of X
|
Draw a picture.
Although you can apply a standard formula for changes of variable, this one is tricky because the transformation $X\to Y$ is not one-to-one. Often the most convenient and reliable met
|
PDF of function of X
Draw a picture.
Although you can apply a standard formula for changes of variable, this one is tricky because the transformation $X\to Y$ is not one-to-one. Often the most convenient and reliable method is to compute the distribution function (CDF) and then differentiate it.
The distribution function of $Y=\sin(X)$ is, by definition,
$$F_Y(y) = \Pr(Y \le y) = \Pr(\sin(X) \le y) = \Pr(\{X\,|\, \sin(X) \le y\}).$$
The latter probability is with respect to $X$. The graph of $\sin$ has been emphasized where its height is less than or equal to $y$. The values of $X$ where this occurs, shown in thick blue along the axis, show the set $\{x\in[0,4\pi]\,|\, \sin(x) \le y\}$.
When $0 \lt y$, this set consists of three disjoint intervals $\newcommand{s}{\sin^{-1}y}[0, \s]$, $[\pi -\s, 2\pi + \s]$, and $[3\pi - \s, 4\pi]$. Because they are disjoint, the chance that $X$ lies within this union is the sum of the chances of each interval:
$$\eqalign{
\Pr(\sin(X) \le y) &= F_X(\s) - F_X(0) \\
&+ F_X(2\pi + \s) - F_X(\pi - \s)\\
&+1 - F(3\pi - \s).
}$$
The value $1 = F_X(4\pi)$ appeared because the range of $X$ is $[0, 4\pi]$. However, we may not replace $F_X(0)$ by $0$ because possibly $X$ has nonzero probability there.
When $y \lt 0$, the set $\{X \in[0,4\pi]\,|\, \sin(X) \le y\}$ is the union of just two disjoint intervals:
By emulating the preceding argument, you should have no trouble writing down an expression for their probability in terms of $F_X$.
The PDF, when it exists, is the derivative of $F_Y$. In the first case
$$f_Y(y) = \frac{d}{dy} F_Y(y) = \frac{d}{dy}\left(F_X(\s) - F_X(0) + F_X(2\pi + \s) \cdots - F(3\pi - \s)\right).$$
Apply the Chain Rule, recognizing that $\frac{d}{dy}\s = 1/\sqrt{1-y^2}$:
$$f_Y(y) = \frac{1}{\sqrt{1-y^2}}\left(f_X(\s) + f_X(\pi-\s) + f_X(2\pi+\s) + f_X(3\pi-\s)\right)$$
This formula can be understood for all $y$ provided we replace $f_X(\s)$ by $f_X(4\pi + \s)$ whenever $y \lt 0$. Equivalently, and much more generally (with no restrictions on the range of $X$),
$$f_Y(y) = \frac{1}{\sqrt{1-y^2}}\sum_{i=-\infty}^\infty f_X(2i \pi + \s) + f_X((2i+1)\pi - \s).$$
|
PDF of function of X
Draw a picture.
Although you can apply a standard formula for changes of variable, this one is tricky because the transformation $X\to Y$ is not one-to-one. Often the most convenient and reliable met
|
39,710
|
Testing a regression coefficient against 1 rather than 0
|
Examine the confidence interval of the slope coefficient. If it includes 1, then we will not reject the null hypothesis stating that the slope is 1. The drawback is that you will not know the p-value other than it has to be smaller than 0.05.
Some software such as Stata allows user to implement customized testing of the coefficient. And that can get you the specific p-value. For example, in Stata, one can use the test command to further test the slope against a null value is that not zero.
. sysuse auto
(1978 Automobile Data)
. reg price mpg
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 1, 72) = 20.26
Model | 139449474 1 139449474 Prob > F = 0.0000
Residual | 495615923 72 6883554.48 R-squared = 0.2196
-------------+------------------------------ Adj R-squared = 0.2087
Total | 635065396 73 8699525.97 Root MSE = 2623.7
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg | -238.8943 53.07669 -4.50 0.000 -344.7008 -133.0879
_cons | 11253.06 1170.813 9.61 0.000 8919.088 13587.03
------------------------------------------------------------------------------
Here we see that the regression coefficient for mile/gallon is -238.9 with a 95% CI of -344.7 and -133.1. Using test, we can test against our value, like, -400:
. test mpg = -400
( 1) mpg = -400
F( 1, 72) = 9.21
Prob > F = 0.0033
The p-value is 0.0033, and we reject the null that the coefficient is equal to -400. (Should also note that the 95% CI does not include -400.) Similar function can be found in other software as well. For instance, in SAS, the same function is also called test, assigned after the proc reg model statement.
An alternate way (which I think is better, thanks to whuber's comment) is to compute the mean of the pairs and then use a one-sample t-test to check if their means are equal to zero. If one of the methods, however, is constantly and persistently bigger and you know what that difference is, you can also test the difference against that number rather than zero.
|
Testing a regression coefficient against 1 rather than 0
|
Examine the confidence interval of the slope coefficient. If it includes 1, then we will not reject the null hypothesis stating that the slope is 1. The drawback is that you will not know the p-value
|
Testing a regression coefficient against 1 rather than 0
Examine the confidence interval of the slope coefficient. If it includes 1, then we will not reject the null hypothesis stating that the slope is 1. The drawback is that you will not know the p-value other than it has to be smaller than 0.05.
Some software such as Stata allows user to implement customized testing of the coefficient. And that can get you the specific p-value. For example, in Stata, one can use the test command to further test the slope against a null value is that not zero.
. sysuse auto
(1978 Automobile Data)
. reg price mpg
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 1, 72) = 20.26
Model | 139449474 1 139449474 Prob > F = 0.0000
Residual | 495615923 72 6883554.48 R-squared = 0.2196
-------------+------------------------------ Adj R-squared = 0.2087
Total | 635065396 73 8699525.97 Root MSE = 2623.7
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg | -238.8943 53.07669 -4.50 0.000 -344.7008 -133.0879
_cons | 11253.06 1170.813 9.61 0.000 8919.088 13587.03
------------------------------------------------------------------------------
Here we see that the regression coefficient for mile/gallon is -238.9 with a 95% CI of -344.7 and -133.1. Using test, we can test against our value, like, -400:
. test mpg = -400
( 1) mpg = -400
F( 1, 72) = 9.21
Prob > F = 0.0033
The p-value is 0.0033, and we reject the null that the coefficient is equal to -400. (Should also note that the 95% CI does not include -400.) Similar function can be found in other software as well. For instance, in SAS, the same function is also called test, assigned after the proc reg model statement.
An alternate way (which I think is better, thanks to whuber's comment) is to compute the mean of the pairs and then use a one-sample t-test to check if their means are equal to zero. If one of the methods, however, is constantly and persistently bigger and you know what that difference is, you can also test the difference against that number rather than zero.
|
Testing a regression coefficient against 1 rather than 0
Examine the confidence interval of the slope coefficient. If it includes 1, then we will not reject the null hypothesis stating that the slope is 1. The drawback is that you will not know the p-value
|
39,711
|
Testing a regression coefficient against 1 rather than 0
|
The key is the use of an offset. Offsets are simple algebraic manipulations to a linear model. In this case, fitting the reduced model with an offset is done by fitting an intercept-only model (since the intercept is a free parameter) and specifying offset(mpg) in the options. This is algebraically equivalent to calculating a new response variable as price-mpg. You could specify offset(2*mpg) to test the null hypothesis that $\beta=2$ in the linear model given by:
$$E[\text{price}|\text{mpg}] = \alpha + \beta \cdot \text{mpg}$$
This is better than the confidence interval in Penguin_Knight's approach because:
You can use other tests like likelihood ratio and score.
You can report the actual $p$-value of the significance test.
You get a more precise estimate that can break ties when the sig-figs of the report limits of the CI tie with the null value.
|
Testing a regression coefficient against 1 rather than 0
|
The key is the use of an offset. Offsets are simple algebraic manipulations to a linear model. In this case, fitting the reduced model with an offset is done by fitting an intercept-only model (since
|
Testing a regression coefficient against 1 rather than 0
The key is the use of an offset. Offsets are simple algebraic manipulations to a linear model. In this case, fitting the reduced model with an offset is done by fitting an intercept-only model (since the intercept is a free parameter) and specifying offset(mpg) in the options. This is algebraically equivalent to calculating a new response variable as price-mpg. You could specify offset(2*mpg) to test the null hypothesis that $\beta=2$ in the linear model given by:
$$E[\text{price}|\text{mpg}] = \alpha + \beta \cdot \text{mpg}$$
This is better than the confidence interval in Penguin_Knight's approach because:
You can use other tests like likelihood ratio and score.
You can report the actual $p$-value of the significance test.
You get a more precise estimate that can break ties when the sig-figs of the report limits of the CI tie with the null value.
|
Testing a regression coefficient against 1 rather than 0
The key is the use of an offset. Offsets are simple algebraic manipulations to a linear model. In this case, fitting the reduced model with an offset is done by fitting an intercept-only model (since
|
39,712
|
Does k-fold cross validation always imply k uniformly sized subsets?
|
I didn't meant to imply that the folds should be different sizes in that answer (and I'll update it to match).
Each fold should contain an equal number of observations, or as close to equal as possible. If you want to perform 10-fold cross-validation on $N=101$ observations, one fold will have 11, rather than 10, items in it. That's fine. If you have 102 observations, it'd be best to have two folds of 11 items each, rather than 1 of 12 and 9 of 10, though I doubt this matters much in practice, particularly as $N/k$ increases.
There is no need to choose $k$ that divides evenly divides $N$ (how would you even run cross-validation on a prime-number-sized data set?), or discard examples until $N$ is evenly divisible by $k$ (data is hard to get; don't throw it away).
|
Does k-fold cross validation always imply k uniformly sized subsets?
|
I didn't meant to imply that the folds should be different sizes in that answer (and I'll update it to match).
Each fold should contain an equal number of observations, or as close to equal as possib
|
Does k-fold cross validation always imply k uniformly sized subsets?
I didn't meant to imply that the folds should be different sizes in that answer (and I'll update it to match).
Each fold should contain an equal number of observations, or as close to equal as possible. If you want to perform 10-fold cross-validation on $N=101$ observations, one fold will have 11, rather than 10, items in it. That's fine. If you have 102 observations, it'd be best to have two folds of 11 items each, rather than 1 of 12 and 9 of 10, though I doubt this matters much in practice, particularly as $N/k$ increases.
There is no need to choose $k$ that divides evenly divides $N$ (how would you even run cross-validation on a prime-number-sized data set?), or discard examples until $N$ is evenly divisible by $k$ (data is hard to get; don't throw it away).
|
Does k-fold cross validation always imply k uniformly sized subsets?
I didn't meant to imply that the folds should be different sizes in that answer (and I'll update it to match).
Each fold should contain an equal number of observations, or as close to equal as possib
|
39,713
|
Does k-fold cross validation always imply k uniformly sized subsets?
|
Just one caveat to keep an eye on - if the fold sizes are not equal then the average of fold results is not the same as the average over whole dataset. You should weight fold results by fold size to get the correct average.
Suppose you have a dataset $X=\{1,2,3,4,5\}$ and use 2-fold cross-validation. The first fold is $\{1,2\}$ and the second fold is $\{3,4,5\}$. Let's say your predictions for the first fold are $\{2,2\}$ and for the second fold $\{4,4,4\}$. Then MSE for the first fold is $(1 + 0)/2 = 1/2$ and for the second fold $(1 + 0 + 1)/3 = 2/3$. Naive cross-validation result would be $(1/2 + 2/3)/2 = 7/12$. But if you calculate the same thing over entire dataset you get $(1 + 0 + 1 + 0 + 1)/5 = 3/5$. The correct way to calculate cross-validation results would have been $1/2*2/5 + 2/3*3/5 = 3/5$,
|
Does k-fold cross validation always imply k uniformly sized subsets?
|
Just one caveat to keep an eye on - if the fold sizes are not equal then the average of fold results is not the same as the average over whole dataset. You should weight fold results by fold size to g
|
Does k-fold cross validation always imply k uniformly sized subsets?
Just one caveat to keep an eye on - if the fold sizes are not equal then the average of fold results is not the same as the average over whole dataset. You should weight fold results by fold size to get the correct average.
Suppose you have a dataset $X=\{1,2,3,4,5\}$ and use 2-fold cross-validation. The first fold is $\{1,2\}$ and the second fold is $\{3,4,5\}$. Let's say your predictions for the first fold are $\{2,2\}$ and for the second fold $\{4,4,4\}$. Then MSE for the first fold is $(1 + 0)/2 = 1/2$ and for the second fold $(1 + 0 + 1)/3 = 2/3$. Naive cross-validation result would be $(1/2 + 2/3)/2 = 7/12$. But if you calculate the same thing over entire dataset you get $(1 + 0 + 1 + 0 + 1)/5 = 3/5$. The correct way to calculate cross-validation results would have been $1/2*2/5 + 2/3*3/5 = 3/5$,
|
Does k-fold cross validation always imply k uniformly sized subsets?
Just one caveat to keep an eye on - if the fold sizes are not equal then the average of fold results is not the same as the average over whole dataset. You should weight fold results by fold size to g
|
39,714
|
Does k-fold cross validation always imply k uniformly sized subsets?
|
$k$-fold cross-validation will divide your data into $k$ subsets. Then you iterate $k$ times: $i=1,2,...,k$, using the union of subsets except the $i$th subset to train your model. Then testing that model on the $i$th subset. If $k$ is not a divisor of the amount of observations you have in your data set it is impossible to get subsets of equal size. This can happen easily and you usually end up with subsets of approximately the same size, depending on how the splitting of data is implemented in the tool you are using. You can, for example, have $k-1$ subsets of the same size and one which compensantes by having a different amount of observations than the rest.
|
Does k-fold cross validation always imply k uniformly sized subsets?
|
$k$-fold cross-validation will divide your data into $k$ subsets. Then you iterate $k$ times: $i=1,2,...,k$, using the union of subsets except the $i$th subset to train your model. Then testing that m
|
Does k-fold cross validation always imply k uniformly sized subsets?
$k$-fold cross-validation will divide your data into $k$ subsets. Then you iterate $k$ times: $i=1,2,...,k$, using the union of subsets except the $i$th subset to train your model. Then testing that model on the $i$th subset. If $k$ is not a divisor of the amount of observations you have in your data set it is impossible to get subsets of equal size. This can happen easily and you usually end up with subsets of approximately the same size, depending on how the splitting of data is implemented in the tool you are using. You can, for example, have $k-1$ subsets of the same size and one which compensantes by having a different amount of observations than the rest.
|
Does k-fold cross validation always imply k uniformly sized subsets?
$k$-fold cross-validation will divide your data into $k$ subsets. Then you iterate $k$ times: $i=1,2,...,k$, using the union of subsets except the $i$th subset to train your model. Then testing that m
|
39,715
|
How does CCA find a low-dimensional common subspace?
|
This question was based on a false premise that CCA finds one "common subspace". It does not.
CCA deals with two datasets $X$ and $Y$ of $n$ points each: points from dataset $X$ are $p$-dimensional and live in $\mathbb R^p$ and points from dataset $Y$ are $q$-dimensional and live in $\mathbb R^q$. Let $\mathbf X$ and $\mathbf Y$ be two centered data matrices of $n\times p$ and $n\times q$ size respectively.
CCA finds $m=\min(p,q)$ pairs of canonical axes. The first pair $(\mathbf w_1, \mathbf v_1)$ consists of one canonical axis $\mathbf w_1 \in \mathbb R^p$ and one canonical axis $\mathbf v_1 \in \mathbb R^p$. Projections of the data onto these axes (called "canonical components", "canonical variates", or "canonical variables") are given by $\mathbf X \mathbf w_1$ and $\mathbf Y \mathbf v_1$, and they have highest possible correlation between each other. Projections of the data on the next pair, $\mathbf w_2$ and $\mathbf v_2$ have second highest correlation, etc.
So the first pair of canonical axes defines a 1-dimensional subspace in each space, but these are two different subspaces in two different spaces. Two first pairs define a 2-dimensional subspace, but these are again two different subspaces. There is never a "common subspace", because the spaces $X$ and $Y$ are different to begin with.
|
How does CCA find a low-dimensional common subspace?
|
This question was based on a false premise that CCA finds one "common subspace". It does not.
CCA deals with two datasets $X$ and $Y$ of $n$ points each: points from dataset $X$ are $p$-dimensional an
|
How does CCA find a low-dimensional common subspace?
This question was based on a false premise that CCA finds one "common subspace". It does not.
CCA deals with two datasets $X$ and $Y$ of $n$ points each: points from dataset $X$ are $p$-dimensional and live in $\mathbb R^p$ and points from dataset $Y$ are $q$-dimensional and live in $\mathbb R^q$. Let $\mathbf X$ and $\mathbf Y$ be two centered data matrices of $n\times p$ and $n\times q$ size respectively.
CCA finds $m=\min(p,q)$ pairs of canonical axes. The first pair $(\mathbf w_1, \mathbf v_1)$ consists of one canonical axis $\mathbf w_1 \in \mathbb R^p$ and one canonical axis $\mathbf v_1 \in \mathbb R^p$. Projections of the data onto these axes (called "canonical components", "canonical variates", or "canonical variables") are given by $\mathbf X \mathbf w_1$ and $\mathbf Y \mathbf v_1$, and they have highest possible correlation between each other. Projections of the data on the next pair, $\mathbf w_2$ and $\mathbf v_2$ have second highest correlation, etc.
So the first pair of canonical axes defines a 1-dimensional subspace in each space, but these are two different subspaces in two different spaces. Two first pairs define a 2-dimensional subspace, but these are again two different subspaces. There is never a "common subspace", because the spaces $X$ and $Y$ are different to begin with.
|
How does CCA find a low-dimensional common subspace?
This question was based on a false premise that CCA finds one "common subspace". It does not.
CCA deals with two datasets $X$ and $Y$ of $n$ points each: points from dataset $X$ are $p$-dimensional an
|
39,716
|
Classification score for Random Forest
|
You typically plot a confusion matrix of your test set (recall and precision), and report an F1 score on them.
If you have your correct labels of your test set in y_test and your predicted labels in pred, then your F1 score is:
from sklearn import metrics
# testing score
score = metrics.f1_score(y_test, pred, pos_label=list(set(y_test)))
# training score
score_train = metrics.f1_score(y_train, pred_train, pos_label=list(set(y_train)))
These are the scores you likely want to plot.
You can also use accuracy:
pscore = metrics.accuracy_score(y_test, pred)
pscore_train = metrics.accuracy_score(y_train, pred_train)
However, you get more insight from a confusion matrix.
You can plot a confusion matrix like so, assuming you have a full set of your labels in categories:
import numpy as np, pylab as pl
# get overall accuracy and F1 score to print at top of plot
pscore = metrics.accuracy_score(y_test, pred)
score = metrics.f1_score(y_test, pred, pos_label=list(set(y_test)))
# get size of the full label set
dur = len(categories)
print "Building testing confusion matrix..."
# initialize score matrices
trueScores = np.zeros(shape=(dur,dur))
predScores = np.zeros(shape=(dur,dur))
# populate totals
for i in xrange(len(y_test)-1):
trueIdx = y_test[i]
predIdx = pred[i]
trueScores[trueIdx,trueIdx] += 1
predScores[trueIdx,predIdx] += 1
# create %-based results
trueSums = np.sum(trueScores,axis=0)
conf = np.zeros(shape=predScores.shape)
for i in xrange(len(predScores)):
for j in xrange(dur):
conf[i,j] = predScores[i,j] / trueSums[i]
# plot the confusion matrix
hq = pl.figure(figsize=(15,15));
aq = hq.add_subplot(1,1,1)
aq.set_aspect(1)
res = aq.imshow(conf,cmap=pl.get_cmap('Greens'),interpolation='nearest',vmin=-0.05,vmax=1.)
width = len(conf)
height = len(conf[0])
done = []
# label each grid cell with the misclassification rates
for w in xrange(width):
for h in xrange(height):
pval = conf[w][h]
c = 'k'
rais = w
if pval > 0.5: c = 'w'
if pval > 0.001:
if w == h:
aq.annotate("{0:1.1f}%\n{1:1.0f}/{2:1.0f}".format(pval*100.,predScores[w][h],trueSums[w]), xy=(h, w),
horizontalalignment='center',
verticalalignment='center',color=c,size=10)
else:
aq.annotate("{0:1.1f}%\n{1:1.0f}".format(pval*100.,predScores[w][h]), xy=(h, w),
horizontalalignment='center',
verticalalignment='center',color=c,size=10)
# label the axes
pl.xticks(range(width), categories[:width],rotation=90,size=10)
pl.yticks(range(height), categories[:height],size=10)
# add a title with the F1 score and accuracy
aq.set_title(lbl + " Prediction, Test Set (f1: "+"{0:1.3f}".format(score)+', accuracy: '+'{0:2.1f}%'.format(100*pscore)+", " + str(len(y_test)) + " items)",fontname='Arial',size=10,color='k')
aq.set_ylabel("Actual",fontname='Arial',size=10,color='k')
aq.set_xlabel("Predicted",fontname='Arial',size=10,color='k')
pl.grid(b=True,axis='both')
# save it
pl.savefig("pred.conf.test.png")
and you end up with something like this (example from LiblinearSVC model), where you look for a darker green for better performance, and a solid diagonal for overall good performance. Labels missing from the test set show as empty rows. This also gives you a good visual of what labels are being misclassified as. For example, take a look at the "Music" column. You can see along the diagonal that 75.7% of the items that were predicted to be "Music" where actually "Music". Travel along the column and you can see what the other labels really were. There was clearly some confusion with music-related labels, like "Tuba", "Viola", "Violin", indicating that perhaps "Music" is too general to try and predict if we can be more specific.
|
Classification score for Random Forest
|
You typically plot a confusion matrix of your test set (recall and precision), and report an F1 score on them.
If you have your correct labels of your test set in y_test and your predicted labels in p
|
Classification score for Random Forest
You typically plot a confusion matrix of your test set (recall and precision), and report an F1 score on them.
If you have your correct labels of your test set in y_test and your predicted labels in pred, then your F1 score is:
from sklearn import metrics
# testing score
score = metrics.f1_score(y_test, pred, pos_label=list(set(y_test)))
# training score
score_train = metrics.f1_score(y_train, pred_train, pos_label=list(set(y_train)))
These are the scores you likely want to plot.
You can also use accuracy:
pscore = metrics.accuracy_score(y_test, pred)
pscore_train = metrics.accuracy_score(y_train, pred_train)
However, you get more insight from a confusion matrix.
You can plot a confusion matrix like so, assuming you have a full set of your labels in categories:
import numpy as np, pylab as pl
# get overall accuracy and F1 score to print at top of plot
pscore = metrics.accuracy_score(y_test, pred)
score = metrics.f1_score(y_test, pred, pos_label=list(set(y_test)))
# get size of the full label set
dur = len(categories)
print "Building testing confusion matrix..."
# initialize score matrices
trueScores = np.zeros(shape=(dur,dur))
predScores = np.zeros(shape=(dur,dur))
# populate totals
for i in xrange(len(y_test)-1):
trueIdx = y_test[i]
predIdx = pred[i]
trueScores[trueIdx,trueIdx] += 1
predScores[trueIdx,predIdx] += 1
# create %-based results
trueSums = np.sum(trueScores,axis=0)
conf = np.zeros(shape=predScores.shape)
for i in xrange(len(predScores)):
for j in xrange(dur):
conf[i,j] = predScores[i,j] / trueSums[i]
# plot the confusion matrix
hq = pl.figure(figsize=(15,15));
aq = hq.add_subplot(1,1,1)
aq.set_aspect(1)
res = aq.imshow(conf,cmap=pl.get_cmap('Greens'),interpolation='nearest',vmin=-0.05,vmax=1.)
width = len(conf)
height = len(conf[0])
done = []
# label each grid cell with the misclassification rates
for w in xrange(width):
for h in xrange(height):
pval = conf[w][h]
c = 'k'
rais = w
if pval > 0.5: c = 'w'
if pval > 0.001:
if w == h:
aq.annotate("{0:1.1f}%\n{1:1.0f}/{2:1.0f}".format(pval*100.,predScores[w][h],trueSums[w]), xy=(h, w),
horizontalalignment='center',
verticalalignment='center',color=c,size=10)
else:
aq.annotate("{0:1.1f}%\n{1:1.0f}".format(pval*100.,predScores[w][h]), xy=(h, w),
horizontalalignment='center',
verticalalignment='center',color=c,size=10)
# label the axes
pl.xticks(range(width), categories[:width],rotation=90,size=10)
pl.yticks(range(height), categories[:height],size=10)
# add a title with the F1 score and accuracy
aq.set_title(lbl + " Prediction, Test Set (f1: "+"{0:1.3f}".format(score)+', accuracy: '+'{0:2.1f}%'.format(100*pscore)+", " + str(len(y_test)) + " items)",fontname='Arial',size=10,color='k')
aq.set_ylabel("Actual",fontname='Arial',size=10,color='k')
aq.set_xlabel("Predicted",fontname='Arial',size=10,color='k')
pl.grid(b=True,axis='both')
# save it
pl.savefig("pred.conf.test.png")
and you end up with something like this (example from LiblinearSVC model), where you look for a darker green for better performance, and a solid diagonal for overall good performance. Labels missing from the test set show as empty rows. This also gives you a good visual of what labels are being misclassified as. For example, take a look at the "Music" column. You can see along the diagonal that 75.7% of the items that were predicted to be "Music" where actually "Music". Travel along the column and you can see what the other labels really were. There was clearly some confusion with music-related labels, like "Tuba", "Viola", "Violin", indicating that perhaps "Music" is too general to try and predict if we can be more specific.
|
Classification score for Random Forest
You typically plot a confusion matrix of your test set (recall and precision), and report an F1 score on them.
If you have your correct labels of your test set in y_test and your predicted labels in p
|
39,717
|
How to do MANCOVA in R?
|
See: http://www.statmethods.net/stats/anova.html
Y <- cbind(VAR1, VAR2, VAR3)
fit <- manova(Y ~ GRP+age+gender)
summary(fit, test="Pillai")
Other test options are "Wilks", "Hotelling-Lawley", and "Roy".
summary.aov(fit) # for univariate statistics.
Following link may be helpful for permutation based multiple comparisons: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2611984/pdf/1751-0473-3-15.pdf
R code on this page is also helpful: http://biostatistics1014.blogspot.in/2013/04/one-way-anova-permutation-test-and.html
|
How to do MANCOVA in R?
|
See: http://www.statmethods.net/stats/anova.html
Y <- cbind(VAR1, VAR2, VAR3)
fit <- manova(Y ~ GRP+age+gender)
summary(fit, test="Pillai")
Other test options are "Wilks", "Hotelling-Lawley", and "Ro
|
How to do MANCOVA in R?
See: http://www.statmethods.net/stats/anova.html
Y <- cbind(VAR1, VAR2, VAR3)
fit <- manova(Y ~ GRP+age+gender)
summary(fit, test="Pillai")
Other test options are "Wilks", "Hotelling-Lawley", and "Roy".
summary.aov(fit) # for univariate statistics.
Following link may be helpful for permutation based multiple comparisons: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2611984/pdf/1751-0473-3-15.pdf
R code on this page is also helpful: http://biostatistics1014.blogspot.in/2013/04/one-way-anova-permutation-test-and.html
|
How to do MANCOVA in R?
See: http://www.statmethods.net/stats/anova.html
Y <- cbind(VAR1, VAR2, VAR3)
fit <- manova(Y ~ GRP+age+gender)
summary(fit, test="Pillai")
Other test options are "Wilks", "Hotelling-Lawley", and "Ro
|
39,718
|
Nonstationary panel data, spurious regression
|
Admittedly a bit confusing wording from Baltagi in this specific excerpt. But unfortunately, the expression "spurious regression" has come to be used in the econometrics literature as a synonym for "non-stationary and non-cointegrated regression"
Let's first attempt to clarify what the "spurious regression phenomenon" is:
Spurious regression : when the estimation method produces a
statistically significant relation between two variables,
irrespective of whether such a relation exists or not.
And the phenomenon typically arises when the processes are not-stationary, and not co-integrated.
Note carefully that a relation may indeed exist -under "spurious regression" we do not describe the case where such a relation does not exist, but the estimator produces a phoney one. The problem lies in the fact that since we will get a statistically significant relation in all cases, we cannot tell whether what we see is actual or an artifact.
Then, Philips and Moon (see this 2000 paper of theirs for an accessible exposition) showed that in a panel-data setting, the regression stops being spurious, but it consistently estimates what actually is there -if there is a relation, it will estimate the relation, if there is not a relation, it will estimate zero. But, this will happen under two-dimensional asymptotics, i.e. as both $n$ and $T$ go to infinity. After all, the intuition behind this result, is exactly the exploitation of the two-dimensional information provided by a panel-data structure.
But I would refrain from general assertions like "we don't have to worry about non-stationary (and non-cointegrated) panels" - one should first study and understand the theoretical results and under which conditions (and for which kind of panels) do they hold.
|
Nonstationary panel data, spurious regression
|
Admittedly a bit confusing wording from Baltagi in this specific excerpt. But unfortunately, the expression "spurious regression" has come to be used in the econometrics literature as a synonym for "n
|
Nonstationary panel data, spurious regression
Admittedly a bit confusing wording from Baltagi in this specific excerpt. But unfortunately, the expression "spurious regression" has come to be used in the econometrics literature as a synonym for "non-stationary and non-cointegrated regression"
Let's first attempt to clarify what the "spurious regression phenomenon" is:
Spurious regression : when the estimation method produces a
statistically significant relation between two variables,
irrespective of whether such a relation exists or not.
And the phenomenon typically arises when the processes are not-stationary, and not co-integrated.
Note carefully that a relation may indeed exist -under "spurious regression" we do not describe the case where such a relation does not exist, but the estimator produces a phoney one. The problem lies in the fact that since we will get a statistically significant relation in all cases, we cannot tell whether what we see is actual or an artifact.
Then, Philips and Moon (see this 2000 paper of theirs for an accessible exposition) showed that in a panel-data setting, the regression stops being spurious, but it consistently estimates what actually is there -if there is a relation, it will estimate the relation, if there is not a relation, it will estimate zero. But, this will happen under two-dimensional asymptotics, i.e. as both $n$ and $T$ go to infinity. After all, the intuition behind this result, is exactly the exploitation of the two-dimensional information provided by a panel-data structure.
But I would refrain from general assertions like "we don't have to worry about non-stationary (and non-cointegrated) panels" - one should first study and understand the theoretical results and under which conditions (and for which kind of panels) do they hold.
|
Nonstationary panel data, spurious regression
Admittedly a bit confusing wording from Baltagi in this specific excerpt. But unfortunately, the expression "spurious regression" has come to be used in the econometrics literature as a synonym for "n
|
39,719
|
Natural example of bad results with a Lehmer Random Number Generator
|
I finally came up with a question that send Wichman-Hill’s generator off the road. It is not as natural as one may wish but I hope it’s spectacular enough.
Here’s the problem: study the distribution of
$$ X = -10U_1 - 22U_2 + 38U_3 - 3U_4 + U_5 + 4U_6 - 38 U_7$$
with the $U_i$ iid uniform on $(0,1)$.
We will just draw an histogram.
x <- c(-10, -22, 38, -3, 1, 4, -38)
RNGkind(kind="Mersenne")
U <- matrix( runif(7*1e6), nrow= 7 )
hist( colSums(x * U), breaks = seq(-70,50,by=0.25), col="black" )
Now try with Wichman-Hill:
RNGkind(kind="Wichman")
U <- matrix( runif(7*1e6), nrow= 7 )
hist( colSums(x * U), breaks = seq(-70,50,by=0.25), col="black" )
Yep, all generated values are integer:
> head(colSums(x*U), 20)
[1] 3 -9 -52 -21 -23 -14 -18 8 -23 12 5 4 -17 -16 -19 -44 5 4 -23
[20] -15
If some people show interest, I may explain briefly how I constructed this example.
Here is a sketch of the construction of the example. Linear Congruential Generators rely on a sequence in $[1,\dots m-1]$ defined by $x_{n+1} = \alpha x_n \ [m]$ (which means modulo $m$), with $\gcd(\alpha,m)=1$. The pseudo random numbers $u_n = {1\over m} x_n$ behave roughly as uniform random numbers in $(0,1)$.
A known issue of these generators is that you can find lots of coefficients $a_0, a_1, \dots, a_k\in \mathbb{Z}$ such that
$$ a_0 + a_1 \alpha + \cdots + a_k \alpha^k = 0 \ [m].$$
This results in $a_0 x_n + \cdots + a_k x_{n+k} = 0 \ [m]$ for all $n$, which in turns results in $a_0 u_n + \cdots + a_k u_{n+k} \in \mathbb{Z}$. This means that all $(k+1)$-tuples $(u_n, \dots, u_{n+k})$ fall in planes orthogonal to $(a_0, \dots, a_k)'$.
Of course with $k=1$, $a_0=\alpha$ and $a_1 = -1$, you have such an example. But as $\alpha$ is usually big, this won’t give a nice looking example as above. The point is to find "small" $a_0, \dots, a_k$ values.
Let
$$L = \{ (a_0, \dots, a_k) \ :\ a_0 + a_1 \alpha + \cdots + a_k \alpha^k = 0 \ [m] \}.$$
This is a $\mathbb{Z}$-lattice.
Using a little modular algebra, one can check that $f_0 = (m,0,\dots,0)'$, $f_1 = (\alpha,-1,0,\dots,0)'$, $f_2 = (0,\alpha,-1,0,\dots,0)'$, $\dots$, $f_k = (0,\dots,0,\alpha,-1)'$ is a base of this lattice (this is the key result here...).
The problem is then to find a short vector in $L$. I used LLL algorithm for this purpose. Algorithm 2.3 from Brian Ripley Stochastic Simulation pointed (after my answer) by kjetil b halvorsen could have been used as well.
For Wichman-Hill, the Chinese remainder theorem allows to check easily that it is equivalent to a generator of the above kind, with $\alpha = 16555425264690$ and $m = 30269\times30307\times30323 = 27817185604309$.
|
Natural example of bad results with a Lehmer Random Number Generator
|
I finally came up with a question that send Wichman-Hill’s generator off the road. It is not as natural as one may wish but I hope it’s spectacular enough.
Here’s the problem: study the distribution o
|
Natural example of bad results with a Lehmer Random Number Generator
I finally came up with a question that send Wichman-Hill’s generator off the road. It is not as natural as one may wish but I hope it’s spectacular enough.
Here’s the problem: study the distribution of
$$ X = -10U_1 - 22U_2 + 38U_3 - 3U_4 + U_5 + 4U_6 - 38 U_7$$
with the $U_i$ iid uniform on $(0,1)$.
We will just draw an histogram.
x <- c(-10, -22, 38, -3, 1, 4, -38)
RNGkind(kind="Mersenne")
U <- matrix( runif(7*1e6), nrow= 7 )
hist( colSums(x * U), breaks = seq(-70,50,by=0.25), col="black" )
Now try with Wichman-Hill:
RNGkind(kind="Wichman")
U <- matrix( runif(7*1e6), nrow= 7 )
hist( colSums(x * U), breaks = seq(-70,50,by=0.25), col="black" )
Yep, all generated values are integer:
> head(colSums(x*U), 20)
[1] 3 -9 -52 -21 -23 -14 -18 8 -23 12 5 4 -17 -16 -19 -44 5 4 -23
[20] -15
If some people show interest, I may explain briefly how I constructed this example.
Here is a sketch of the construction of the example. Linear Congruential Generators rely on a sequence in $[1,\dots m-1]$ defined by $x_{n+1} = \alpha x_n \ [m]$ (which means modulo $m$), with $\gcd(\alpha,m)=1$. The pseudo random numbers $u_n = {1\over m} x_n$ behave roughly as uniform random numbers in $(0,1)$.
A known issue of these generators is that you can find lots of coefficients $a_0, a_1, \dots, a_k\in \mathbb{Z}$ such that
$$ a_0 + a_1 \alpha + \cdots + a_k \alpha^k = 0 \ [m].$$
This results in $a_0 x_n + \cdots + a_k x_{n+k} = 0 \ [m]$ for all $n$, which in turns results in $a_0 u_n + \cdots + a_k u_{n+k} \in \mathbb{Z}$. This means that all $(k+1)$-tuples $(u_n, \dots, u_{n+k})$ fall in planes orthogonal to $(a_0, \dots, a_k)'$.
Of course with $k=1$, $a_0=\alpha$ and $a_1 = -1$, you have such an example. But as $\alpha$ is usually big, this won’t give a nice looking example as above. The point is to find "small" $a_0, \dots, a_k$ values.
Let
$$L = \{ (a_0, \dots, a_k) \ :\ a_0 + a_1 \alpha + \cdots + a_k \alpha^k = 0 \ [m] \}.$$
This is a $\mathbb{Z}$-lattice.
Using a little modular algebra, one can check that $f_0 = (m,0,\dots,0)'$, $f_1 = (\alpha,-1,0,\dots,0)'$, $f_2 = (0,\alpha,-1,0,\dots,0)'$, $\dots$, $f_k = (0,\dots,0,\alpha,-1)'$ is a base of this lattice (this is the key result here...).
The problem is then to find a short vector in $L$. I used LLL algorithm for this purpose. Algorithm 2.3 from Brian Ripley Stochastic Simulation pointed (after my answer) by kjetil b halvorsen could have been used as well.
For Wichman-Hill, the Chinese remainder theorem allows to check easily that it is equivalent to a generator of the above kind, with $\alpha = 16555425264690$ and $m = 30269\times30307\times30323 = 27817185604309$.
|
Natural example of bad results with a Lehmer Random Number Generator
I finally came up with a question that send Wichman-Hill’s generator off the road. It is not as natural as one may wish but I hope it’s spectacular enough.
Here’s the problem: study the distribution o
|
39,720
|
Natural example of bad results with a Lehmer Random Number Generator
|
The application most concerned with tiny deviations from correlation is cryptography. The ability to predict a pseudo-random value with better than ordinary accuracy can translate into superior abilities to break encryption schemes.
This can be illustrated with a somewhat artificial example designed to help the intuition. It shows how a truly dramatic change in predictability can be incurred by an arbitrarily tiny serial correlation. Let $X_1, X_2, \ldots, X_n$ be iid standard Normal variables. Let $\bar X = (X_1+X_2+\cdots+X_n)/n$ be their mean and designate
$$Y_i = X_i - \bar X$$
as their residuals. It is elementary to establish that (1) the $Y_i$ have identical Normal distributions but (2) the correlation among $Y_i$ and $Y_j$ (for $i\ne j$) is $-1/(n-1)$. For large $n$ this is negligible, right?
Consider the task of predicting $Y_n$ from $Y_1, Y_2, \ldots, Y_{n-1}$. Under the assumption of independence, the best possible predictor is their mean. In fact, though, the construction of the $Y_i$ guarantees that their sum is zero, whence
$$\hat{Y_n} = -\sum_{i=1}^{n-1}Y_i$$
is a perfect (error-free) predictor of $Y_n$. This shows how even a tiny bit of correlation can enormously improve predictability. In cryptanalysis the details will differ--one studies streams of bits, not Normal variates, and the serial correlations can be tiny indeed--but the potential for equally dramatic results nevertheless exists.
For those who like to play with things, the following simulation in R replicates this hypothetical situation and summarizes the mean and standard deviations of the prediction errors. It also summarizes the first-order serial correlation coefficients of the simulated $Y_i$. For reference, it does the same for the $X_i$.
predict.mean <- function(x) mean(x[-length(x)])
predict.correl <- function(x) -sum(x[-length(x)])
n <- 1e5
set.seed(17)
sim <- replicate(1e3, {
x <-rnorm(n)
y <- x - mean(x)
c(predict.mean(y) - y[n], predict.correl(y) - y[n],
predict.mean(x) - x[n], predict.correl(x) - x[n],
cor(y[-1], y[-n]))
})
rownames(sim) <- c("Mean method", "Exploit",
"Mean (reference)", "Exploit (reference)",
"Autocorrelation")
zapsmall(apply(sim, 1, mean))
zapsmall(apply(sim, 1, sd))
As written, this will take a good fraction of a minute to run: it performs $1000$ simulations of the case $n=10^5$. The timing is proportional to the product of these numbers, so reducing that by an order of magnitude will give satisfactory turnaround for interactive experiments. In this case, because such a large number of simulations were performed, the results will be pretty accurate, and they are
Mean method Exploit Mean (reference) Exploit (reference) Autocorrelation
-0.064697 0.000000 -0.064697 5.502087 -0.000046
Mean method Exploit Mean (reference) Exploit (reference) Autocorrelation
1.0235 0.0000 1.0235 321.8314 0.0031
On average, estimating $Y_n$ with the mean of the preceding values made an error of $-0.06$, but the standard deviation of those errors was close to $1$. The exploit offered by recognition of the correlation was absolutely perfect: it always got the prediction right. However, when applied to the truly independent values $(X_i)$, the exploit performed terribly, with a standard deviation of $321.8$ (essentially equal to $\sqrt{n}$). This trade-off between assumptions and performance is instructive!
|
Natural example of bad results with a Lehmer Random Number Generator
|
The application most concerned with tiny deviations from correlation is cryptography. The ability to predict a pseudo-random value with better than ordinary accuracy can translate into superior abili
|
Natural example of bad results with a Lehmer Random Number Generator
The application most concerned with tiny deviations from correlation is cryptography. The ability to predict a pseudo-random value with better than ordinary accuracy can translate into superior abilities to break encryption schemes.
This can be illustrated with a somewhat artificial example designed to help the intuition. It shows how a truly dramatic change in predictability can be incurred by an arbitrarily tiny serial correlation. Let $X_1, X_2, \ldots, X_n$ be iid standard Normal variables. Let $\bar X = (X_1+X_2+\cdots+X_n)/n$ be their mean and designate
$$Y_i = X_i - \bar X$$
as their residuals. It is elementary to establish that (1) the $Y_i$ have identical Normal distributions but (2) the correlation among $Y_i$ and $Y_j$ (for $i\ne j$) is $-1/(n-1)$. For large $n$ this is negligible, right?
Consider the task of predicting $Y_n$ from $Y_1, Y_2, \ldots, Y_{n-1}$. Under the assumption of independence, the best possible predictor is their mean. In fact, though, the construction of the $Y_i$ guarantees that their sum is zero, whence
$$\hat{Y_n} = -\sum_{i=1}^{n-1}Y_i$$
is a perfect (error-free) predictor of $Y_n$. This shows how even a tiny bit of correlation can enormously improve predictability. In cryptanalysis the details will differ--one studies streams of bits, not Normal variates, and the serial correlations can be tiny indeed--but the potential for equally dramatic results nevertheless exists.
For those who like to play with things, the following simulation in R replicates this hypothetical situation and summarizes the mean and standard deviations of the prediction errors. It also summarizes the first-order serial correlation coefficients of the simulated $Y_i$. For reference, it does the same for the $X_i$.
predict.mean <- function(x) mean(x[-length(x)])
predict.correl <- function(x) -sum(x[-length(x)])
n <- 1e5
set.seed(17)
sim <- replicate(1e3, {
x <-rnorm(n)
y <- x - mean(x)
c(predict.mean(y) - y[n], predict.correl(y) - y[n],
predict.mean(x) - x[n], predict.correl(x) - x[n],
cor(y[-1], y[-n]))
})
rownames(sim) <- c("Mean method", "Exploit",
"Mean (reference)", "Exploit (reference)",
"Autocorrelation")
zapsmall(apply(sim, 1, mean))
zapsmall(apply(sim, 1, sd))
As written, this will take a good fraction of a minute to run: it performs $1000$ simulations of the case $n=10^5$. The timing is proportional to the product of these numbers, so reducing that by an order of magnitude will give satisfactory turnaround for interactive experiments. In this case, because such a large number of simulations were performed, the results will be pretty accurate, and they are
Mean method Exploit Mean (reference) Exploit (reference) Autocorrelation
-0.064697 0.000000 -0.064697 5.502087 -0.000046
Mean method Exploit Mean (reference) Exploit (reference) Autocorrelation
1.0235 0.0000 1.0235 321.8314 0.0031
On average, estimating $Y_n$ with the mean of the preceding values made an error of $-0.06$, but the standard deviation of those errors was close to $1$. The exploit offered by recognition of the correlation was absolutely perfect: it always got the prediction right. However, when applied to the truly independent values $(X_i)$, the exploit performed terribly, with a standard deviation of $321.8$ (essentially equal to $\sqrt{n}$). This trade-off between assumptions and performance is instructive!
|
Natural example of bad results with a Lehmer Random Number Generator
The application most concerned with tiny deviations from correlation is cryptography. The ability to predict a pseudo-random value with better than ordinary accuracy can translate into superior abili
|
39,721
|
WLLN: can expectation exist but be infinite?
|
The expectation of a random variable $X: \{\Omega, \frak{S}, \mathbb{P}\}\to \mathbb{R}$ is the Lebesgue integral
$$\mathbb{E}[X] = \int_\Omega X(\omega)d\mathbb{P}(\omega).$$
The Lebesgue integral is constructed in a sequence of steps whereby its domain of application is broadened to encompass an ever wider variety of random variables. The first steps ultimately define the integral for variables with non-negative values: the complications of integrating functions which might oscillate arbitrarily between negative and positive values are thereby avoided. To extend the integral to variables with negative values, decompose them into their positive and negative parts:
$$X(\omega) = X^{+}(\omega) - X^{-}(\omega)$$
where $X^{+}(\omega) = X(\omega)$ when $X(\omega)\ge 0$ and $X^{+}(\omega) = 0$ otherwise; similarly, $X^{-} = (-X)^{+}$. These are readily seen to be random variables, too (that is, they will be measurable). The integral is defined to be the difference
$$\int_\Omega X(\omega)d\mathbb{P}(\omega) = \int_\Omega X^{+}(\omega)d\mathbb{P}(\omega) - \int_\Omega X^{-}(\omega)d\mathbb{P}(\omega),$$
each of which involves a non-negative random variable and therefore the meaning of its integral has already been defined.
At this point conventions may vary. The Wikipedia articles I have linked to declare that the integral is defined only when both the positive and negative integrals are finite. One could, however, allow that the integral is also defined when at most one of the integrals is finite. We could say that it equals "$+\infty$" when the integral of the positive part diverges and equals "$-\infty$" when the integral of the negative part diverges.
In this extended sense of being defined, consider a random variable $X$ with a half-Cauchy distribution. Its probability density function (PDF) $f$ is defined and equal to $0$ when $X\lt 0$ and otherwise equal to $(2/\pi)/(1+x^2)$. Thus $X^{+}=X,$ $X^{-}=0$, and by definition
$$\mathbb{E}(X) = \int_{-\infty}^{+\infty} f(x) dx = \frac{2}{\pi}\int_0^\infty \frac{x dx}{1+x^2} - \int_\mathbb{R} 0 dx.$$
Although the first integral diverges, the second obviously is finite, so we could consider this expectation to be infinite. This example answers the question, but a full appreciation requires analysis of a distribution that looks infinite but actually cannot be defined at all. The standard example is the Cauchy distribution (also known as the Student t with one degree of freedom).
For a Cauchy-distributed variable the PDF is $(1/\pi)/(1+x^2)$ everywhere. Splitting the expectation into its positive and negative parts yields
$$\mathbb{E}(X) = \frac{1}{\pi}\int_0^\infty \frac{x dx}{1+x^2} - \frac{1}{\pi}\int_{-\infty}^0 \frac{-x dx}{1+x^2}.$$
Now both sides diverge. Since an expression like "$\infty - \infty$" is nonsensical, we have no choice but to declare this expectation undefined. One way to convince yourself of this is to consider the various ways in which the integral might be calculated: they concern how the limits of $\pm \infty$ are approached. Pick any nonnegative real value $\alpha$. As a mechanism to control the relative rates at which those limits increase, define
$$f(n) = \sqrt{(1+n^2)\exp(2\pi\alpha)-1}.$$
As $n$ grows large without bound, so does $f(n)$. Therefore, if this integral indeed had a well-defined value, it would be valid to compute it as
$$\frac{1}{\pi}\int_{-\infty}^{+\infty} \frac{x dx}{1+x^2} =\,(?) \lim_{n\to\infty}\frac{1}{\pi}\int_{-n}^{f(n)} \frac{x dx}{1+x^2}$$
because both the limits, $-n$ and $f(n)$, are expanding to encompass the entire Real line.
This plot of the PDF shows how $f$ is chosen to assure that the upper limit $f(n)$ extends just a little further to the right than the lower limit $-n$ extends to the left. The parts between $-n$ and $n$ balance, contributing $0$ to the expectation. The value of $f$ is chosen so that the contribution from the excess--shown in red--is always equal to $\alpha$, no matter what $n$ may be.
But a straightforward calculation gives
$$\frac{1}{\pi}\int_{-n}^{f(n)} \frac{x dx}{1+x^2} = \frac{1}{2\pi}\log(1+x^2)|_{-n}^{f(n)} = \frac{1}{2\pi}\left(\log(1+f(n)^2) - \log(1+n^2)\right)=\alpha.$$
(Using the integration endpoints $-f(n)$ and $n$ shows that $-\alpha$ is a possible value of this limit, too.) Accordingly, since this integral can be made to equal any Real number merely by varying how the limits are taken, it cannot be considered to have a definite value.
|
WLLN: can expectation exist but be infinite?
|
The expectation of a random variable $X: \{\Omega, \frak{S}, \mathbb{P}\}\to \mathbb{R}$ is the Lebesgue integral
$$\mathbb{E}[X] = \int_\Omega X(\omega)d\mathbb{P}(\omega).$$
The Lebesgue integral is
|
WLLN: can expectation exist but be infinite?
The expectation of a random variable $X: \{\Omega, \frak{S}, \mathbb{P}\}\to \mathbb{R}$ is the Lebesgue integral
$$\mathbb{E}[X] = \int_\Omega X(\omega)d\mathbb{P}(\omega).$$
The Lebesgue integral is constructed in a sequence of steps whereby its domain of application is broadened to encompass an ever wider variety of random variables. The first steps ultimately define the integral for variables with non-negative values: the complications of integrating functions which might oscillate arbitrarily between negative and positive values are thereby avoided. To extend the integral to variables with negative values, decompose them into their positive and negative parts:
$$X(\omega) = X^{+}(\omega) - X^{-}(\omega)$$
where $X^{+}(\omega) = X(\omega)$ when $X(\omega)\ge 0$ and $X^{+}(\omega) = 0$ otherwise; similarly, $X^{-} = (-X)^{+}$. These are readily seen to be random variables, too (that is, they will be measurable). The integral is defined to be the difference
$$\int_\Omega X(\omega)d\mathbb{P}(\omega) = \int_\Omega X^{+}(\omega)d\mathbb{P}(\omega) - \int_\Omega X^{-}(\omega)d\mathbb{P}(\omega),$$
each of which involves a non-negative random variable and therefore the meaning of its integral has already been defined.
At this point conventions may vary. The Wikipedia articles I have linked to declare that the integral is defined only when both the positive and negative integrals are finite. One could, however, allow that the integral is also defined when at most one of the integrals is finite. We could say that it equals "$+\infty$" when the integral of the positive part diverges and equals "$-\infty$" when the integral of the negative part diverges.
In this extended sense of being defined, consider a random variable $X$ with a half-Cauchy distribution. Its probability density function (PDF) $f$ is defined and equal to $0$ when $X\lt 0$ and otherwise equal to $(2/\pi)/(1+x^2)$. Thus $X^{+}=X,$ $X^{-}=0$, and by definition
$$\mathbb{E}(X) = \int_{-\infty}^{+\infty} f(x) dx = \frac{2}{\pi}\int_0^\infty \frac{x dx}{1+x^2} - \int_\mathbb{R} 0 dx.$$
Although the first integral diverges, the second obviously is finite, so we could consider this expectation to be infinite. This example answers the question, but a full appreciation requires analysis of a distribution that looks infinite but actually cannot be defined at all. The standard example is the Cauchy distribution (also known as the Student t with one degree of freedom).
For a Cauchy-distributed variable the PDF is $(1/\pi)/(1+x^2)$ everywhere. Splitting the expectation into its positive and negative parts yields
$$\mathbb{E}(X) = \frac{1}{\pi}\int_0^\infty \frac{x dx}{1+x^2} - \frac{1}{\pi}\int_{-\infty}^0 \frac{-x dx}{1+x^2}.$$
Now both sides diverge. Since an expression like "$\infty - \infty$" is nonsensical, we have no choice but to declare this expectation undefined. One way to convince yourself of this is to consider the various ways in which the integral might be calculated: they concern how the limits of $\pm \infty$ are approached. Pick any nonnegative real value $\alpha$. As a mechanism to control the relative rates at which those limits increase, define
$$f(n) = \sqrt{(1+n^2)\exp(2\pi\alpha)-1}.$$
As $n$ grows large without bound, so does $f(n)$. Therefore, if this integral indeed had a well-defined value, it would be valid to compute it as
$$\frac{1}{\pi}\int_{-\infty}^{+\infty} \frac{x dx}{1+x^2} =\,(?) \lim_{n\to\infty}\frac{1}{\pi}\int_{-n}^{f(n)} \frac{x dx}{1+x^2}$$
because both the limits, $-n$ and $f(n)$, are expanding to encompass the entire Real line.
This plot of the PDF shows how $f$ is chosen to assure that the upper limit $f(n)$ extends just a little further to the right than the lower limit $-n$ extends to the left. The parts between $-n$ and $n$ balance, contributing $0$ to the expectation. The value of $f$ is chosen so that the contribution from the excess--shown in red--is always equal to $\alpha$, no matter what $n$ may be.
But a straightforward calculation gives
$$\frac{1}{\pi}\int_{-n}^{f(n)} \frac{x dx}{1+x^2} = \frac{1}{2\pi}\log(1+x^2)|_{-n}^{f(n)} = \frac{1}{2\pi}\left(\log(1+f(n)^2) - \log(1+n^2)\right)=\alpha.$$
(Using the integration endpoints $-f(n)$ and $n$ shows that $-\alpha$ is a possible value of this limit, too.) Accordingly, since this integral can be made to equal any Real number merely by varying how the limits are taken, it cannot be considered to have a definite value.
|
WLLN: can expectation exist but be infinite?
The expectation of a random variable $X: \{\Omega, \frak{S}, \mathbb{P}\}\to \mathbb{R}$ is the Lebesgue integral
$$\mathbb{E}[X] = \int_\Omega X(\omega)d\mathbb{P}(\omega).$$
The Lebesgue integral is
|
39,722
|
WLLN: can expectation exist but be infinite?
|
There are some useful and well-known distributions which have undefined mean. I think one of the most used is Cauchy distribution. See Wikipedia article.
For example the standard Cauchy distribution has pdf
$$ f(x)=\frac{1}{\pi(1+x^2)}$$
So, the mean is
$$ E(x) = \int_{-\infty}^{\infty}x\frac{1}{\pi(1+x^2)}dx = \frac{log(1+x^2)}{2\pi}\bigg|_{-\infty}^{\infty}$$
You can see that both ends evaluates to infinity, so the expected value is undefined.
|
WLLN: can expectation exist but be infinite?
|
There are some useful and well-known distributions which have undefined mean. I think one of the most used is Cauchy distribution. See Wikipedia article.
For example the standard Cauchy distribution h
|
WLLN: can expectation exist but be infinite?
There are some useful and well-known distributions which have undefined mean. I think one of the most used is Cauchy distribution. See Wikipedia article.
For example the standard Cauchy distribution has pdf
$$ f(x)=\frac{1}{\pi(1+x^2)}$$
So, the mean is
$$ E(x) = \int_{-\infty}^{\infty}x\frac{1}{\pi(1+x^2)}dx = \frac{log(1+x^2)}{2\pi}\bigg|_{-\infty}^{\infty}$$
You can see that both ends evaluates to infinity, so the expected value is undefined.
|
WLLN: can expectation exist but be infinite?
There are some useful and well-known distributions which have undefined mean. I think one of the most used is Cauchy distribution. See Wikipedia article.
For example the standard Cauchy distribution h
|
39,723
|
What does "statistically insignificantly worse" mean?
|
I've never heard this before, and hope I don't again! They should say something like "the $A$ mean is less than the $B$ mean, but the difference is not statistically significant".
Often in articles you see something like "$\bar y_B - \bar y_A = 1.32$ ($P = 0.236$)." which conveys a lot more information in less space. There could be worse conventions than this.
|
What does "statistically insignificantly worse" mean?
|
I've never heard this before, and hope I don't again! They should say something like "the $A$ mean is less than the $B$ mean, but the difference is not statistically significant".
Often in articles y
|
What does "statistically insignificantly worse" mean?
I've never heard this before, and hope I don't again! They should say something like "the $A$ mean is less than the $B$ mean, but the difference is not statistically significant".
Often in articles you see something like "$\bar y_B - \bar y_A = 1.32$ ($P = 0.236$)." which conveys a lot more information in less space. There could be worse conventions than this.
|
What does "statistically insignificantly worse" mean?
I've never heard this before, and hope I don't again! They should say something like "the $A$ mean is less than the $B$ mean, but the difference is not statistically significant".
Often in articles y
|
39,724
|
Control variables- Difference in Difference
|
There are two reasons for including covariates in a difference in differences regression:
for identification of the treatment effect;
to reduce the error variance (i.e. increase power of statistical tests).
Suppose you want to know the effect of a job market program on employment in a city where this program was randomly assigned to unemployed individuals. You regress
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \epsilon_{igt},$$
where $Y$ is the outcome (0 = unemployed, 1 = employed), $J$ is the dummy which equals one for the treated in the treatment period, $i$, indexes individuals, $g$ indexes groups (1 = treatment group, 0 = control group), $t$ indexes time periods (1 = post-treatment, 0 = pre-treatment), $\gamma$ and $\lambda$ are group and period fixed effects, and $\epsilon$ is a stochastic error term.
This is equivalent to the regression
$$Y_{igt} = \alpha + \beta_1 \text{treat}_i + \beta_2 \text{post}_t + \beta_3 \text{(treat$\cdot$ post)}_{it} + \epsilon_{it},$$
where you indicate treatment and control group, and the pre- and post-treatment periods with two dummies that are then interacted. This is probably the difference in difference regression you have seen in a textbook or class notes.
Suppose in the two periods the GDP in our city increases. Then the outcome is affected by another time-varying factor which has nothing to do with the job market program but it occurs at the same time. This violates the common trend assumption. In order to not overstate $\beta$ in the first regression, you would want to include GDP as a control in the regression which separates out this additional effect on the outcome which is not due to the job market program. This is the case of including a covariate for identification when you regress
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \delta \text{GDP}_t + \epsilon_{igt}.$$
Only information at the group level (treatment-control) is required for identification of your treatment effect. If you have additional information on your individuals, for instance their age, you can include this in the regression as well, as follows:
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \delta \text{GDP}_t + \theta \text{age}_{igt} + \epsilon_{igt}.$$
The within-group variation in age does not matter for identification (for a detailed explanation see the notes here) but they can help to reduce the error variance of the regression. In this case your statistical tests will have more power and it will be easier to determine whether $\beta$ has a significant effect or not.
|
Control variables- Difference in Difference
|
There are two reasons for including covariates in a difference in differences regression:
for identification of the treatment effect;
to reduce the error variance (i.e. increase power of statistical
|
Control variables- Difference in Difference
There are two reasons for including covariates in a difference in differences regression:
for identification of the treatment effect;
to reduce the error variance (i.e. increase power of statistical tests).
Suppose you want to know the effect of a job market program on employment in a city where this program was randomly assigned to unemployed individuals. You regress
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \epsilon_{igt},$$
where $Y$ is the outcome (0 = unemployed, 1 = employed), $J$ is the dummy which equals one for the treated in the treatment period, $i$, indexes individuals, $g$ indexes groups (1 = treatment group, 0 = control group), $t$ indexes time periods (1 = post-treatment, 0 = pre-treatment), $\gamma$ and $\lambda$ are group and period fixed effects, and $\epsilon$ is a stochastic error term.
This is equivalent to the regression
$$Y_{igt} = \alpha + \beta_1 \text{treat}_i + \beta_2 \text{post}_t + \beta_3 \text{(treat$\cdot$ post)}_{it} + \epsilon_{it},$$
where you indicate treatment and control group, and the pre- and post-treatment periods with two dummies that are then interacted. This is probably the difference in difference regression you have seen in a textbook or class notes.
Suppose in the two periods the GDP in our city increases. Then the outcome is affected by another time-varying factor which has nothing to do with the job market program but it occurs at the same time. This violates the common trend assumption. In order to not overstate $\beta$ in the first regression, you would want to include GDP as a control in the regression which separates out this additional effect on the outcome which is not due to the job market program. This is the case of including a covariate for identification when you regress
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \delta \text{GDP}_t + \epsilon_{igt}.$$
Only information at the group level (treatment-control) is required for identification of your treatment effect. If you have additional information on your individuals, for instance their age, you can include this in the regression as well, as follows:
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \delta \text{GDP}_t + \theta \text{age}_{igt} + \epsilon_{igt}.$$
The within-group variation in age does not matter for identification (for a detailed explanation see the notes here) but they can help to reduce the error variance of the regression. In this case your statistical tests will have more power and it will be easier to determine whether $\beta$ has a significant effect or not.
|
Control variables- Difference in Difference
There are two reasons for including covariates in a difference in differences regression:
for identification of the treatment effect;
to reduce the error variance (i.e. increase power of statistical
|
39,725
|
In convolutional neural networks, how to prevent the overfitting?
|
I would say there might be a bug when calculating the errors when using backpropagation.
Also how big is your data? And how many epochs are you using for your simulation? How is your training being done? I could help you more if i could get more data.
This might help you: http://www.cs.toronto.edu/~hinton/csc2515/notes/lec4.htm
|
In convolutional neural networks, how to prevent the overfitting?
|
I would say there might be a bug when calculating the errors when using backpropagation.
Also how big is your data? And how many epochs are you using for your simulation? How is your training being do
|
In convolutional neural networks, how to prevent the overfitting?
I would say there might be a bug when calculating the errors when using backpropagation.
Also how big is your data? And how many epochs are you using for your simulation? How is your training being done? I could help you more if i could get more data.
This might help you: http://www.cs.toronto.edu/~hinton/csc2515/notes/lec4.htm
|
In convolutional neural networks, how to prevent the overfitting?
I would say there might be a bug when calculating the errors when using backpropagation.
Also how big is your data? And how many epochs are you using for your simulation? How is your training being do
|
39,726
|
In convolutional neural networks, how to prevent the overfitting?
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Maybe you could try the dropout technique. I have heard it can be effective against overfitting.
Dropout: A simple way to prevent neural networks from overfitting, by Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, Ruslan R. Salakhutdinov Journal of Machine Learning Research, 2014. PDF
Recently, Google even patended this technique!!!
|
In convolutional neural networks, how to prevent the overfitting?
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
In convolutional neural networks, how to prevent the overfitting?
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Maybe you could try the dropout technique. I have heard it can be effective against overfitting.
Dropout: A simple way to prevent neural networks from overfitting, by Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, Ruslan R. Salakhutdinov Journal of Machine Learning Research, 2014. PDF
Recently, Google even patended this technique!!!
|
In convolutional neural networks, how to prevent the overfitting?
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
39,727
|
What are the Mild Regularity Conditions in the context of GEEs?
|
Regularity conditions in statistics usually refer to requirements that functions or groups of functions (usually probability density functions) "behave well" in various senses. These are assumptions made in proofs of statements that are thought to hold in most practical cases and often not explicitly mentioned when giving statements of theorems. "Mild" or "weak" in reference to regularity conditions essentially means "we expect these regularity conditions to almost always hold in practice."
For example (roughly taken from Wikipedia), the Cramér-Rao lower bound states that if we have a random variable $X$ with probability density function $f(x;\theta)$, the variance of any unbiased estimator of $\theta$ is bounded below by the reciprocal of the Fisher information $I(\theta)$. However, the article notes that there are two additional conditions: the Fisher information must always be defined, and the operations of integration with respect to $x$ and differentiation with respect to $\theta$ can be interchanged in the expectation of the estimator of $\theta$.
The most common analytical regularity condition I've come across is some variation of exchangeability of limits. For example, we might require that we are able to:
change the order of integration,
switch the order of differentiation and integration
switch the order of a summation or integration and a limit.
Other regularity conditions more specific to statistics include:
the pdf must be differentiable (or twice, or thrice differentiable),
the pdfs of a set of random variables must have common support
the parameter space is open in $\mathbb{R}^k$
the Fisher Information is always defined.
A richer list can be found here (PDF).
As for the regularity conditions for the consistency of GEE estimates under misspecified covariance structures, it is well-known that the actual model for the mean has to be correct (e.g. if the data is Poisson you must use the log link), but I don't know the more technical conditions. Agresti's Categorical Data Analysis lists a few papers relating to this topic, including
Firth, D. 1993. Recent developments in quasi-likelihood methods. Proc. ISI 49th Session*, pp. 341-358.
McCullagh, P. 1983. Quasi-likelihood functions. Ann. Stat. 11:59-67.
|
What are the Mild Regularity Conditions in the context of GEEs?
|
Regularity conditions in statistics usually refer to requirements that functions or groups of functions (usually probability density functions) "behave well" in various senses. These are assumptions m
|
What are the Mild Regularity Conditions in the context of GEEs?
Regularity conditions in statistics usually refer to requirements that functions or groups of functions (usually probability density functions) "behave well" in various senses. These are assumptions made in proofs of statements that are thought to hold in most practical cases and often not explicitly mentioned when giving statements of theorems. "Mild" or "weak" in reference to regularity conditions essentially means "we expect these regularity conditions to almost always hold in practice."
For example (roughly taken from Wikipedia), the Cramér-Rao lower bound states that if we have a random variable $X$ with probability density function $f(x;\theta)$, the variance of any unbiased estimator of $\theta$ is bounded below by the reciprocal of the Fisher information $I(\theta)$. However, the article notes that there are two additional conditions: the Fisher information must always be defined, and the operations of integration with respect to $x$ and differentiation with respect to $\theta$ can be interchanged in the expectation of the estimator of $\theta$.
The most common analytical regularity condition I've come across is some variation of exchangeability of limits. For example, we might require that we are able to:
change the order of integration,
switch the order of differentiation and integration
switch the order of a summation or integration and a limit.
Other regularity conditions more specific to statistics include:
the pdf must be differentiable (or twice, or thrice differentiable),
the pdfs of a set of random variables must have common support
the parameter space is open in $\mathbb{R}^k$
the Fisher Information is always defined.
A richer list can be found here (PDF).
As for the regularity conditions for the consistency of GEE estimates under misspecified covariance structures, it is well-known that the actual model for the mean has to be correct (e.g. if the data is Poisson you must use the log link), but I don't know the more technical conditions. Agresti's Categorical Data Analysis lists a few papers relating to this topic, including
Firth, D. 1993. Recent developments in quasi-likelihood methods. Proc. ISI 49th Session*, pp. 341-358.
McCullagh, P. 1983. Quasi-likelihood functions. Ann. Stat. 11:59-67.
|
What are the Mild Regularity Conditions in the context of GEEs?
Regularity conditions in statistics usually refer to requirements that functions or groups of functions (usually probability density functions) "behave well" in various senses. These are assumptions m
|
39,728
|
Existence of fractional moment of cauchy distribution
|
Let's apply the law of the unconscious statistician, so we want to be able to evaluate
$\int_{-a}^b \frac{x^k}{1+x^2} dx$
in the limit as $a,b$ each $\to\infty$.
As mentioned in comments, for most fractional $k$ there's problems for negative $x$.
Let's step aside from that issue, and just talk about convergence of the right side.
Consider then, the convergence of
$I(b)=\int_0^b \frac{x^k}{1+x^2} dx\,$, for $0<k<1$
First consider splitting into $\int_0^1$ and $\int_1^b$ for $b>1$
for $\int_0^1 \frac{x^k}{1+x^2} dx$ note that when $x$ and $k$ are between 0 and 1 and that $x^k\leq 1$, so that integral is bounded.
Now note that for $x>0$, we have $\frac{1}{(1+x^2)}<x^{-2}$, so
$\int_1^b \frac{x^k}{1+x^2} dx<\int_1^b x^{k-2} dx = \left. \frac{x^{k-1}}{k-1}\right|_1^b = \frac{b^{k-1}-1}{k-1}=\frac{1-b^{k-1}}{1-k}$
which doesn't get any bigger than $\frac{1}{1-k}$ (when $b>1$ and $0<k<1$, as here).
So in the limit as $b\to\infty$, the integral converges.
As a result, $\int_{-\infty}^\infty \frac{|x|^k}{1+x^2} dx$ converges, and so when $x^k$ is real, $\int_{-\infty}^\infty \frac{x^k}{1+x^2} dx$ will converge to a real answer.
Specifically, the $\frac{1}{3}$ moment of a standard Cauchy is therefore 0 (as are all reciprocal-of-odd-positive-integer moments), by symmetry.
Note that according to Wolfram alpha (I didn't try to integrate it myself) $\int_{0}^\infty \frac{x^{1/3}}{1+x^2} dx=\frac{\pi}{\sqrt{3}}$.
|
Existence of fractional moment of cauchy distribution
|
Let's apply the law of the unconscious statistician, so we want to be able to evaluate
$\int_{-a}^b \frac{x^k}{1+x^2} dx$
in the limit as $a,b$ each $\to\infty$.
As mentioned in comments, for most fr
|
Existence of fractional moment of cauchy distribution
Let's apply the law of the unconscious statistician, so we want to be able to evaluate
$\int_{-a}^b \frac{x^k}{1+x^2} dx$
in the limit as $a,b$ each $\to\infty$.
As mentioned in comments, for most fractional $k$ there's problems for negative $x$.
Let's step aside from that issue, and just talk about convergence of the right side.
Consider then, the convergence of
$I(b)=\int_0^b \frac{x^k}{1+x^2} dx\,$, for $0<k<1$
First consider splitting into $\int_0^1$ and $\int_1^b$ for $b>1$
for $\int_0^1 \frac{x^k}{1+x^2} dx$ note that when $x$ and $k$ are between 0 and 1 and that $x^k\leq 1$, so that integral is bounded.
Now note that for $x>0$, we have $\frac{1}{(1+x^2)}<x^{-2}$, so
$\int_1^b \frac{x^k}{1+x^2} dx<\int_1^b x^{k-2} dx = \left. \frac{x^{k-1}}{k-1}\right|_1^b = \frac{b^{k-1}-1}{k-1}=\frac{1-b^{k-1}}{1-k}$
which doesn't get any bigger than $\frac{1}{1-k}$ (when $b>1$ and $0<k<1$, as here).
So in the limit as $b\to\infty$, the integral converges.
As a result, $\int_{-\infty}^\infty \frac{|x|^k}{1+x^2} dx$ converges, and so when $x^k$ is real, $\int_{-\infty}^\infty \frac{x^k}{1+x^2} dx$ will converge to a real answer.
Specifically, the $\frac{1}{3}$ moment of a standard Cauchy is therefore 0 (as are all reciprocal-of-odd-positive-integer moments), by symmetry.
Note that according to Wolfram alpha (I didn't try to integrate it myself) $\int_{0}^\infty \frac{x^{1/3}}{1+x^2} dx=\frac{\pi}{\sqrt{3}}$.
|
Existence of fractional moment of cauchy distribution
Let's apply the law of the unconscious statistician, so we want to be able to evaluate
$\int_{-a}^b \frac{x^k}{1+x^2} dx$
in the limit as $a,b$ each $\to\infty$.
As mentioned in comments, for most fr
|
39,729
|
Existence of fractional moment of cauchy distribution
|
To complement @Glen_b's answer, I asked maple for help, and it gives the following answer, which is a complex number since we ask for fractional powers of negative numbers! If such a complex moment is of any use I do not know, probably one would have to take the moments of the positive and negative part separately, as is done in definition of The Mellin transform https://en.wikipedia.org/wiki/Mellin_transform As that page shows, these fractional moments is essentially the Mellin transform. The Mellin transform is used in studying products of random variables.
The result is (I did not check on maple ...)
$$
\int_{-\infty}^\infty x^\alpha \frac1{\pi (1+x^2)}\; dx = \frac{(-1)^\alpha + 1}{2 \cos (\pi\alpha/2)}, \quad \alpha < 1
$$
That's mostly curiosa, more interesting is the fractional moment of the absolute value
$$
2\int_0^\infty |x|^\alpha \frac1{\pi (1+x^2)}\; dx = \sec(\pi\alpha/2), \quad \alpha<1
$$
Some papers which seems to have more details: On Distribution of Product of Stable Laws and On the Use of Fractional Calculus for the Probabilistic
Characterization of Random Variables and MELLIN-BARNES INTEGRALS FOR STABLE
DISTRIBUTIONS AND THEIR CONVOLUTIONS (I did'nt look much at them yet, but they seem to be relevant)
|
Existence of fractional moment of cauchy distribution
|
To complement @Glen_b's answer, I asked maple for help, and it gives the following answer, which is a complex number since we ask for fractional powers of negative numbers! If such a complex moment is
|
Existence of fractional moment of cauchy distribution
To complement @Glen_b's answer, I asked maple for help, and it gives the following answer, which is a complex number since we ask for fractional powers of negative numbers! If such a complex moment is of any use I do not know, probably one would have to take the moments of the positive and negative part separately, as is done in definition of The Mellin transform https://en.wikipedia.org/wiki/Mellin_transform As that page shows, these fractional moments is essentially the Mellin transform. The Mellin transform is used in studying products of random variables.
The result is (I did not check on maple ...)
$$
\int_{-\infty}^\infty x^\alpha \frac1{\pi (1+x^2)}\; dx = \frac{(-1)^\alpha + 1}{2 \cos (\pi\alpha/2)}, \quad \alpha < 1
$$
That's mostly curiosa, more interesting is the fractional moment of the absolute value
$$
2\int_0^\infty |x|^\alpha \frac1{\pi (1+x^2)}\; dx = \sec(\pi\alpha/2), \quad \alpha<1
$$
Some papers which seems to have more details: On Distribution of Product of Stable Laws and On the Use of Fractional Calculus for the Probabilistic
Characterization of Random Variables and MELLIN-BARNES INTEGRALS FOR STABLE
DISTRIBUTIONS AND THEIR CONVOLUTIONS (I did'nt look much at them yet, but they seem to be relevant)
|
Existence of fractional moment of cauchy distribution
To complement @Glen_b's answer, I asked maple for help, and it gives the following answer, which is a complex number since we ask for fractional powers of negative numbers! If such a complex moment is
|
39,730
|
Existence of fractional moment of cauchy distribution
|
The fractional moments $E[x^k]$ do exist for $k<1$. You have to be careful with fractional moments of distributions with negative values, of course. The value $x^k$ may end up being a complex number.
The absolute moments $E[|x|^k]$ were studied in Goria, M. N. "Fractional absolute moments of the Cauchy distribution." Quaderni di Statistica e Matematica applicata alle scienze Economico-Sociali 1 (1992): 3-9.
|
Existence of fractional moment of cauchy distribution
|
The fractional moments $E[x^k]$ do exist for $k<1$. You have to be careful with fractional moments of distributions with negative values, of course. The value $x^k$ may end up being a complex number.
|
Existence of fractional moment of cauchy distribution
The fractional moments $E[x^k]$ do exist for $k<1$. You have to be careful with fractional moments of distributions with negative values, of course. The value $x^k$ may end up being a complex number.
The absolute moments $E[|x|^k]$ were studied in Goria, M. N. "Fractional absolute moments of the Cauchy distribution." Quaderni di Statistica e Matematica applicata alle scienze Economico-Sociali 1 (1992): 3-9.
|
Existence of fractional moment of cauchy distribution
The fractional moments $E[x^k]$ do exist for $k<1$. You have to be careful with fractional moments of distributions with negative values, of course. The value $x^k$ may end up being a complex number.
|
39,731
|
Existence of fractional moment of cauchy distribution
|
Let $\mu \in \mathbb{R}$ and $\sigma > 0$ be the location and scale parameters of a Cauchy distribution respectively.
Let $r > 0$ and $\theta \in (0, \pi)$ such that $r\exp(i \theta) = \mu +
\sigma i$, where $i$ denotes the imaginary unit.
Let $-1 < \text{Re}(a) < 1$.
Assume that $x^a = |x|^a \text{sign}(x), \ x \ne 0$ and $0^a = 0$.
Then, by (3.0.3) in V. M. Zolotarev, One-dimensional stable distributions, AMS, 1986
https://bookstore.ams.org/mmono-65,
$$ E[|X|^a] = \frac{\cos\left(a (\pi /2 - \theta)\right)}{\cos(a\pi /2)} $$
and
$$ E[X^a] = \frac{\sin\left(a (\pi/2 - \theta) \right)}{\sin(a \pi/2)}, \ a \ne 0, $$
and
$$ E[X^a] = 1 - \frac{2\theta}{\pi}, \ a = 0. $$
|
Existence of fractional moment of cauchy distribution
|
Let $\mu \in \mathbb{R}$ and $\sigma > 0$ be the location and scale parameters of a Cauchy distribution respectively.
Let $r > 0$ and $\theta \in (0, \pi)$ such that $r\exp(i \theta) = \mu +
\sigma
|
Existence of fractional moment of cauchy distribution
Let $\mu \in \mathbb{R}$ and $\sigma > 0$ be the location and scale parameters of a Cauchy distribution respectively.
Let $r > 0$ and $\theta \in (0, \pi)$ such that $r\exp(i \theta) = \mu +
\sigma i$, where $i$ denotes the imaginary unit.
Let $-1 < \text{Re}(a) < 1$.
Assume that $x^a = |x|^a \text{sign}(x), \ x \ne 0$ and $0^a = 0$.
Then, by (3.0.3) in V. M. Zolotarev, One-dimensional stable distributions, AMS, 1986
https://bookstore.ams.org/mmono-65,
$$ E[|X|^a] = \frac{\cos\left(a (\pi /2 - \theta)\right)}{\cos(a\pi /2)} $$
and
$$ E[X^a] = \frac{\sin\left(a (\pi/2 - \theta) \right)}{\sin(a \pi/2)}, \ a \ne 0, $$
and
$$ E[X^a] = 1 - \frac{2\theta}{\pi}, \ a = 0. $$
|
Existence of fractional moment of cauchy distribution
Let $\mu \in \mathbb{R}$ and $\sigma > 0$ be the location and scale parameters of a Cauchy distribution respectively.
Let $r > 0$ and $\theta \in (0, \pi)$ such that $r\exp(i \theta) = \mu +
\sigma
|
39,732
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
The OP has not specified an estimation procedure, so I will consider the question for the case of linear least-squares regression. I will also ignore the constant term-let's say variables are already centered on their means.
Should we use model 1 to predict 100% of $\hat{y_i}$ and use them on model 2?
If we do that, then the regressor matrix in the regression for $W$ will exhibit perfect collinearity (since the one regressor will be $X$ and the other $Χ \hat \beta$ throughout). In this case we could instead regress $W$ on $X$ alone and obtain estimates of composite coefficients (see this post).
Is it correct to mix measured and predicted Y on model 2?
It does not violate a priori any mathematical rule, and so it is "correct". Whether the estimator has good properties it is a matter to be investigated.
In the regression for $W$ the postulated relation is that $W$ depends on the actual realizations of $Y$. Denoting $Z$ the theoretical regressor matrix, and writing it in block form (for the two halves of the population) we have:
$$\mathbf Z_{n \times 2} = \left [\begin{matrix}
\mathbf x_1 & \mathbf y_1 \\
\mathbf x_2 & \mathbf y_2
\end {matrix}\right]$$
while the actual regressor matrix used will be
$$\mathbf {\hat Z} = \left [\begin{matrix}
\mathbf x_1 & \mathbf y_1 \\
\mathbf x_2 & \hat \beta\mathbf x_2
\end {matrix}\right],\;\;\mathbf {\hat Z}' = \left [\begin{matrix}
\mathbf x_1' & \mathbf x_2' \\
\mathbf y_1' & \hat \beta\mathbf x_2'
\end {matrix}\right]$$
Then the $\gamma$ vector that has the coefficients in the regression for $W$ will be estimated by OLS as
$$\hat \gamma = \left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf w = \left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\left(\mathbf Z\gamma + \mathbf u\right)$$
$$=\left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf Z\gamma +\left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf u \tag{1}$$
Writing $ \mathbf y_2 = \hat \beta\mathbf x_2 + \mathbf e_{y_2}$ where $\mathbf e_{y_2}$ is the prediction error We have
$$\mathbf {\hat Z}'\mathbf Z = \mathbf {\hat Z}'\left [\begin{matrix}
\mathbf x_1 & \mathbf y_2 \\
\mathbf x_1 & \hat \beta\mathbf x_2 + \mathbf e_{y_2}
\end {matrix}\right]= $$
$$=\mathbf {\hat Z}'\left( \left [\begin{matrix}
\mathbf x_1 & \mathbf y_2 \\
\mathbf x_2 & \hat \beta\mathbf x_2
\end {matrix}\right] + \left [\begin{matrix}
\mathbf 0 & \mathbf 0 \\
\mathbf 0 & \mathbf e_{y_2}
\end {matrix}\right]\right) = \mathbf {\hat Z}'\mathbf {\hat Z} + \left [\begin{matrix}
0 & \mathbf x_2'\mathbf e_{y_2} \\
0 & \hat \beta\mathbf x_2'\mathbf e_{y_2}
\end {matrix}\right] \tag{2}$$
Inserting $(2)$ into $(1)$ we get
$$\hat \gamma = \gamma + \left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1} \left [\begin{matrix}
0 & \mathbf x_2'\mathbf e_{y_2} \\
0 & \hat \beta\mathbf x_2'\mathbf e_{y_2}
\end {matrix}\right]\gamma +\left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf u \tag{3}$$
If in the regression of $W$ we have assumed strictly exogenous regressors, then taking the expected value in $(3)$ conditional on the observable random variables, the 3d term (as usual) is zero, but also the 2nd term is zero, since the prediction error is conditionally orthogonal to the predictor. So $\hat \gamma$ is unbiased. It is also consistent. In these aspects it is equivalent to the OLS estimator we would obtain if we could observe all $Y$. But the variance will be different.
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
The OP has not specified an estimation procedure, so I will consider the question for the case of linear least-squares regression. I will also ignore the constant term-let's say variables are already
|
Mixing observed and predicted values within explanatory variables - is it ok?
The OP has not specified an estimation procedure, so I will consider the question for the case of linear least-squares regression. I will also ignore the constant term-let's say variables are already centered on their means.
Should we use model 1 to predict 100% of $\hat{y_i}$ and use them on model 2?
If we do that, then the regressor matrix in the regression for $W$ will exhibit perfect collinearity (since the one regressor will be $X$ and the other $Χ \hat \beta$ throughout). In this case we could instead regress $W$ on $X$ alone and obtain estimates of composite coefficients (see this post).
Is it correct to mix measured and predicted Y on model 2?
It does not violate a priori any mathematical rule, and so it is "correct". Whether the estimator has good properties it is a matter to be investigated.
In the regression for $W$ the postulated relation is that $W$ depends on the actual realizations of $Y$. Denoting $Z$ the theoretical regressor matrix, and writing it in block form (for the two halves of the population) we have:
$$\mathbf Z_{n \times 2} = \left [\begin{matrix}
\mathbf x_1 & \mathbf y_1 \\
\mathbf x_2 & \mathbf y_2
\end {matrix}\right]$$
while the actual regressor matrix used will be
$$\mathbf {\hat Z} = \left [\begin{matrix}
\mathbf x_1 & \mathbf y_1 \\
\mathbf x_2 & \hat \beta\mathbf x_2
\end {matrix}\right],\;\;\mathbf {\hat Z}' = \left [\begin{matrix}
\mathbf x_1' & \mathbf x_2' \\
\mathbf y_1' & \hat \beta\mathbf x_2'
\end {matrix}\right]$$
Then the $\gamma$ vector that has the coefficients in the regression for $W$ will be estimated by OLS as
$$\hat \gamma = \left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf w = \left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\left(\mathbf Z\gamma + \mathbf u\right)$$
$$=\left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf Z\gamma +\left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf u \tag{1}$$
Writing $ \mathbf y_2 = \hat \beta\mathbf x_2 + \mathbf e_{y_2}$ where $\mathbf e_{y_2}$ is the prediction error We have
$$\mathbf {\hat Z}'\mathbf Z = \mathbf {\hat Z}'\left [\begin{matrix}
\mathbf x_1 & \mathbf y_2 \\
\mathbf x_1 & \hat \beta\mathbf x_2 + \mathbf e_{y_2}
\end {matrix}\right]= $$
$$=\mathbf {\hat Z}'\left( \left [\begin{matrix}
\mathbf x_1 & \mathbf y_2 \\
\mathbf x_2 & \hat \beta\mathbf x_2
\end {matrix}\right] + \left [\begin{matrix}
\mathbf 0 & \mathbf 0 \\
\mathbf 0 & \mathbf e_{y_2}
\end {matrix}\right]\right) = \mathbf {\hat Z}'\mathbf {\hat Z} + \left [\begin{matrix}
0 & \mathbf x_2'\mathbf e_{y_2} \\
0 & \hat \beta\mathbf x_2'\mathbf e_{y_2}
\end {matrix}\right] \tag{2}$$
Inserting $(2)$ into $(1)$ we get
$$\hat \gamma = \gamma + \left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1} \left [\begin{matrix}
0 & \mathbf x_2'\mathbf e_{y_2} \\
0 & \hat \beta\mathbf x_2'\mathbf e_{y_2}
\end {matrix}\right]\gamma +\left(\mathbf {\hat Z}'\mathbf {\hat Z}\right)^{-1}\mathbf {\hat Z}'\mathbf u \tag{3}$$
If in the regression of $W$ we have assumed strictly exogenous regressors, then taking the expected value in $(3)$ conditional on the observable random variables, the 3d term (as usual) is zero, but also the 2nd term is zero, since the prediction error is conditionally orthogonal to the predictor. So $\hat \gamma$ is unbiased. It is also consistent. In these aspects it is equivalent to the OLS estimator we would obtain if we could observe all $Y$. But the variance will be different.
|
Mixing observed and predicted values within explanatory variables - is it ok?
The OP has not specified an estimation procedure, so I will consider the question for the case of linear least-squares regression. I will also ignore the constant term-let's say variables are already
|
39,733
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
Using half of the predicted $y$s would mean that you strongly underestimate the variance of $\beta_4$ in model 2 as the prediction would not be accounted for!
What you suggest would be some form of single imputation which in general leads to underestimation of variance.
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
Using half of the predicted $y$s would mean that you strongly underestimate the variance of $\beta_4$ in model 2 as the prediction would not be accounted for!
What you suggest would be some form of s
|
Mixing observed and predicted values within explanatory variables - is it ok?
Using half of the predicted $y$s would mean that you strongly underestimate the variance of $\beta_4$ in model 2 as the prediction would not be accounted for!
What you suggest would be some form of single imputation which in general leads to underestimation of variance.
|
Mixing observed and predicted values within explanatory variables - is it ok?
Using half of the predicted $y$s would mean that you strongly underestimate the variance of $\beta_4$ in model 2 as the prediction would not be accounted for!
What you suggest would be some form of s
|
39,734
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
You can think of this in terms of learning a feature of an ensemble in machine learning.
Normally an ensemble would say have 5 models all trained to predict W and then the ensemble model would combine these models to make a better prediction on W. Normally by something simple like a vote. But there is no reason why these 5 predictions could not be combined in a more complex way using any ML algorithm.
Now you want to learn a model to predict Y and then use this as a feature to predict W. Nothing wrong in that.
You are using one model -Y as an input feature to model W.
I think this is also related to semi supervised learning, where you can use proxy measures- To predict the measure you want.
For example in an image classification you train one model to predict sea(Your labelled Y for example), another to predict sand (another model say Z, where you have labels) and then combine these models to predict beach. (Your W where you have limited labelled data). Where W would be a model built out of Y and Z.
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
You can think of this in terms of learning a feature of an ensemble in machine learning.
Normally an ensemble would say have 5 models all trained to predict W and then the ensemble model would combine
|
Mixing observed and predicted values within explanatory variables - is it ok?
You can think of this in terms of learning a feature of an ensemble in machine learning.
Normally an ensemble would say have 5 models all trained to predict W and then the ensemble model would combine these models to make a better prediction on W. Normally by something simple like a vote. But there is no reason why these 5 predictions could not be combined in a more complex way using any ML algorithm.
Now you want to learn a model to predict Y and then use this as a feature to predict W. Nothing wrong in that.
You are using one model -Y as an input feature to model W.
I think this is also related to semi supervised learning, where you can use proxy measures- To predict the measure you want.
For example in an image classification you train one model to predict sea(Your labelled Y for example), another to predict sand (another model say Z, where you have labels) and then combine these models to predict beach. (Your W where you have limited labelled data). Where W would be a model built out of Y and Z.
|
Mixing observed and predicted values within explanatory variables - is it ok?
You can think of this in terms of learning a feature of an ensemble in machine learning.
Normally an ensemble would say have 5 models all trained to predict W and then the ensemble model would combine
|
39,735
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
Nice question. I can’t say I have come across this before but the following paper on mediation, compounding and suppression might be useful. I can’t see how mixing up $y_i$ and $\hat{y_i}$ in model 2 is incorrect for any statistical reason. Whether or not it leads to better prediction would depend on the relationships between the different variables. To begin with, you can determine an expected error distribution where the predicted $y_i$'s are included and excluded and see where that leads you.
If I was faced with this, I would start by testing the models on a generated dataset to get a better understanding of how the inclusion of the known and predicted $y_i$ values compare to including only the known $y_i$. You can pick values for your model parameters and randomly generate a set of $x_i$ and $y_i$ - discard half of the $y_i$'s. Given this dataset you can calculate the parameters and error distributions for model 1 and model 2. You can repeat this for many generated datasets to help understand the characteristics of the models when the predicted $y_i$’s are included or excluded. The insight gained should help inform your decision on the best approach.
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
Nice question. I can’t say I have come across this before but the following paper on mediation, compounding and suppression might be useful. I can’t see how mixing up $y_i$ and $\hat{y_i}$ in model 2
|
Mixing observed and predicted values within explanatory variables - is it ok?
Nice question. I can’t say I have come across this before but the following paper on mediation, compounding and suppression might be useful. I can’t see how mixing up $y_i$ and $\hat{y_i}$ in model 2 is incorrect for any statistical reason. Whether or not it leads to better prediction would depend on the relationships between the different variables. To begin with, you can determine an expected error distribution where the predicted $y_i$'s are included and excluded and see where that leads you.
If I was faced with this, I would start by testing the models on a generated dataset to get a better understanding of how the inclusion of the known and predicted $y_i$ values compare to including only the known $y_i$. You can pick values for your model parameters and randomly generate a set of $x_i$ and $y_i$ - discard half of the $y_i$'s. Given this dataset you can calculate the parameters and error distributions for model 1 and model 2. You can repeat this for many generated datasets to help understand the characteristics of the models when the predicted $y_i$’s are included or excluded. The insight gained should help inform your decision on the best approach.
|
Mixing observed and predicted values within explanatory variables - is it ok?
Nice question. I can’t say I have come across this before but the following paper on mediation, compounding and suppression might be useful. I can’t see how mixing up $y_i$ and $\hat{y_i}$ in model 2
|
39,736
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
The problem that you pose reminds me a bit of the classic problem of fitting multivariate Gaussian mixture models (GMM), which is the archetypal application for the expectation maximization (EM) algorithm.
At a high level, it's instructive to think a little bit about how the EM algorithm solves the GMM fitting problem, because some of the basic EM concepts (if not the actual EM algorithm directly itself) are quite applicable and can easily be borrowed and modified to address your situation.
By way of comparison with your own problem, in a GMM fitting context, the basic problem statement is this: you are given a data set consisting of bunch of random vector variables $\vec{x}_{i}$ which are drawn from a probability distribution which is a sum of several multivariate Gaussian distributions. Each "mode" of the distribution has several defining parameters, which you are trying to estimate based upon the data: the mean and covariance of course, plus a relative amplitude parameter which gives the relative size of each mode, compared to the others. These defining parameters are directly analogous to the $\beta_{k}$ in the above problem. The GMM problem also contains an entire second set of what are usually termed latent variables $z_{i}$, which essentially are a postulated set of additional variables that would go a long way toward explaining the observations $\vec{x}_{i}$, if only we could observe them. Unfortunately however, they are essentially "missing information", which is why we refer to them as latent.
In the GMM problem, the information that one imagines residing within the latent variables would theoretically be able to tell you (provided you could actually observe them) which mode within the mixture was specifically responsible for giving rise to each of the observations $\vec{x}_{i}$. If the nodes are numbered $1, 2, 3,..., n$, then each of the $z_{i}$ will be assigned a corresponding value of $1,...,n$ as well, indicating which node the $i$th data point came from. (Variations upon the basic EM scheme also include alternate definitions of the $z_{i}$ which attempt to assign "degree or likelihood of belonging", so that we do not make a hard assignment of each data point to a single mode, but that's starting to get beyond the scope of the discussion here.)
Anyway, in the context of this particular stackexchange question, the $y_{i}$ data in the original question are a sort of loosely analogous to "half-latent" variables in the parlance of the EM algorithm: i.e., some of the values are observed, and some are not, so they are neither fully observed nor fully latent.
For the case with fully latent (i.e, 100% non-observable) variables, the way that the EM algorithm actually solves the GMM problem is to start by randomly assigning a value to each latent variable $z_{i}$, then estimate the best fit parameters $\beta_{k}$ (i.e., the mean, covariance and relative amplitude in GMM), assuming that all of the initial $z_{i}$ assignments were correct (of course they're not correct at all, really, since we just assigned the starting values at random, but don't worry about that yet). Next, using the recently estimated $\hat{\beta}_{k}$, the algorithm estimates the most likely values (i.e., it sort of re-predicts) for the missing/latent variables $\hat{z}_{i}$. Essentially, the algorithm goes back and forth between two complementary steps: first, it tries to estimate the most likely values $\hat{\beta}_{k}$ for the true $\beta_{k}$, based upon its most recent estimates of the $\hat{z}_{i}$, and then it tries to update its estimate of the $\hat{z}_{i}$ based upon the newest estimate of the $\hat{\beta}_{k}$. The algorithm continues to go back and forth in this fashion, until some type of convergence criterion is met for both quantities.
So, in analogy with the EM algorithm, here's what I'd recommend for you: either path that you suggest (either mixing 50% observed $y_{i}$ with 50% predicted $\hat{y}_{i}$, or alternately, using 100% predicted $\hat{y}_{i}$) is equally acceptable, because actually, in either case, it's only an initial step. What you should do next, after you've obtained initial estimates for both the $\hat{\beta}_{k}$ and the $\hat{y}_{i}$, is follow the example of the EM algorithm: go through several alternating stages of refining your estimates of both $\hat{\beta}_{k}$ and $\hat{y}_{i}$, by deriving each new estimate for one set of quantities based upon the previous estimate of the others, continuing back and forth until you reach convergence on both. Of course, in iterating back and forth, when predicting the next update for $\hat{\beta}_{k}$ from the previous $\hat{y}_{i}$, you should substitute the real observed $y_{i}$ wherever they are available, so in that sense, I suppose that my recommendation is indeed to mix together 50% predicted $\hat{y}_{i}$ with 50% observed $y_{i}$, but since the point of the algorithm is to iteratively pursue solution convergence, it doesn't necessarily matter all that much what type of $y$ values you use at the beginning in order to start the ball rolling.
Doing it this way has an additional benefit as well: if anyone ever asks you to justify your approach on theoretical grounds, you can say it's essentially just an extension of the EM algorithm, which relies upon the concept of local convergence in order to reach a stable answer. Since both the EM algorithm as well as local convergence are established principles of iterative/recursive parameter estimation, this methodology rests on solid ground, theoretically speaking.
|
Mixing observed and predicted values within explanatory variables - is it ok?
|
The problem that you pose reminds me a bit of the classic problem of fitting multivariate Gaussian mixture models (GMM), which is the archetypal application for the expectation maximization (EM) algor
|
Mixing observed and predicted values within explanatory variables - is it ok?
The problem that you pose reminds me a bit of the classic problem of fitting multivariate Gaussian mixture models (GMM), which is the archetypal application for the expectation maximization (EM) algorithm.
At a high level, it's instructive to think a little bit about how the EM algorithm solves the GMM fitting problem, because some of the basic EM concepts (if not the actual EM algorithm directly itself) are quite applicable and can easily be borrowed and modified to address your situation.
By way of comparison with your own problem, in a GMM fitting context, the basic problem statement is this: you are given a data set consisting of bunch of random vector variables $\vec{x}_{i}$ which are drawn from a probability distribution which is a sum of several multivariate Gaussian distributions. Each "mode" of the distribution has several defining parameters, which you are trying to estimate based upon the data: the mean and covariance of course, plus a relative amplitude parameter which gives the relative size of each mode, compared to the others. These defining parameters are directly analogous to the $\beta_{k}$ in the above problem. The GMM problem also contains an entire second set of what are usually termed latent variables $z_{i}$, which essentially are a postulated set of additional variables that would go a long way toward explaining the observations $\vec{x}_{i}$, if only we could observe them. Unfortunately however, they are essentially "missing information", which is why we refer to them as latent.
In the GMM problem, the information that one imagines residing within the latent variables would theoretically be able to tell you (provided you could actually observe them) which mode within the mixture was specifically responsible for giving rise to each of the observations $\vec{x}_{i}$. If the nodes are numbered $1, 2, 3,..., n$, then each of the $z_{i}$ will be assigned a corresponding value of $1,...,n$ as well, indicating which node the $i$th data point came from. (Variations upon the basic EM scheme also include alternate definitions of the $z_{i}$ which attempt to assign "degree or likelihood of belonging", so that we do not make a hard assignment of each data point to a single mode, but that's starting to get beyond the scope of the discussion here.)
Anyway, in the context of this particular stackexchange question, the $y_{i}$ data in the original question are a sort of loosely analogous to "half-latent" variables in the parlance of the EM algorithm: i.e., some of the values are observed, and some are not, so they are neither fully observed nor fully latent.
For the case with fully latent (i.e, 100% non-observable) variables, the way that the EM algorithm actually solves the GMM problem is to start by randomly assigning a value to each latent variable $z_{i}$, then estimate the best fit parameters $\beta_{k}$ (i.e., the mean, covariance and relative amplitude in GMM), assuming that all of the initial $z_{i}$ assignments were correct (of course they're not correct at all, really, since we just assigned the starting values at random, but don't worry about that yet). Next, using the recently estimated $\hat{\beta}_{k}$, the algorithm estimates the most likely values (i.e., it sort of re-predicts) for the missing/latent variables $\hat{z}_{i}$. Essentially, the algorithm goes back and forth between two complementary steps: first, it tries to estimate the most likely values $\hat{\beta}_{k}$ for the true $\beta_{k}$, based upon its most recent estimates of the $\hat{z}_{i}$, and then it tries to update its estimate of the $\hat{z}_{i}$ based upon the newest estimate of the $\hat{\beta}_{k}$. The algorithm continues to go back and forth in this fashion, until some type of convergence criterion is met for both quantities.
So, in analogy with the EM algorithm, here's what I'd recommend for you: either path that you suggest (either mixing 50% observed $y_{i}$ with 50% predicted $\hat{y}_{i}$, or alternately, using 100% predicted $\hat{y}_{i}$) is equally acceptable, because actually, in either case, it's only an initial step. What you should do next, after you've obtained initial estimates for both the $\hat{\beta}_{k}$ and the $\hat{y}_{i}$, is follow the example of the EM algorithm: go through several alternating stages of refining your estimates of both $\hat{\beta}_{k}$ and $\hat{y}_{i}$, by deriving each new estimate for one set of quantities based upon the previous estimate of the others, continuing back and forth until you reach convergence on both. Of course, in iterating back and forth, when predicting the next update for $\hat{\beta}_{k}$ from the previous $\hat{y}_{i}$, you should substitute the real observed $y_{i}$ wherever they are available, so in that sense, I suppose that my recommendation is indeed to mix together 50% predicted $\hat{y}_{i}$ with 50% observed $y_{i}$, but since the point of the algorithm is to iteratively pursue solution convergence, it doesn't necessarily matter all that much what type of $y$ values you use at the beginning in order to start the ball rolling.
Doing it this way has an additional benefit as well: if anyone ever asks you to justify your approach on theoretical grounds, you can say it's essentially just an extension of the EM algorithm, which relies upon the concept of local convergence in order to reach a stable answer. Since both the EM algorithm as well as local convergence are established principles of iterative/recursive parameter estimation, this methodology rests on solid ground, theoretically speaking.
|
Mixing observed and predicted values within explanatory variables - is it ok?
The problem that you pose reminds me a bit of the classic problem of fitting multivariate Gaussian mixture models (GMM), which is the archetypal application for the expectation maximization (EM) algor
|
39,737
|
What is the difference between multiple regression & mutivariate regression? [duplicate]
|
"Multiple regression" refers to situations in which you have more than one predictor / explanatory variable ($X$).
"Multivariate regression" refers to situations in which you have more than one response / outcome / dependent variable ($Y$).
It is also possible to have both multiple predictors and multiple responses, in which case you could call it a "multivariate multiple regression". But since people rarely have only one predictor, I don't think people are worried about making the multiple predictor part distinct. This raises the question of why we worry about "multiple" vs. "simple" (only one predictor) regression in the typical case when you have only one response. I think that it is mostly for historical and pedagogical (teaching) reasons: simple regression was worked out first, and is taught first to help students get the main ideas before going further.
In your case, I gather you have only one response variable (Pakistan's GDP growth), and several predictor variables (growth in mining, electricity, communication, manufacturing and electricity), so your regression model will be a regular old multiple regression.
|
What is the difference between multiple regression & mutivariate regression? [duplicate]
|
"Multiple regression" refers to situations in which you have more than one predictor / explanatory variable ($X$).
"Multivariate regression" refers to situations in which you have more than one resp
|
What is the difference between multiple regression & mutivariate regression? [duplicate]
"Multiple regression" refers to situations in which you have more than one predictor / explanatory variable ($X$).
"Multivariate regression" refers to situations in which you have more than one response / outcome / dependent variable ($Y$).
It is also possible to have both multiple predictors and multiple responses, in which case you could call it a "multivariate multiple regression". But since people rarely have only one predictor, I don't think people are worried about making the multiple predictor part distinct. This raises the question of why we worry about "multiple" vs. "simple" (only one predictor) regression in the typical case when you have only one response. I think that it is mostly for historical and pedagogical (teaching) reasons: simple regression was worked out first, and is taught first to help students get the main ideas before going further.
In your case, I gather you have only one response variable (Pakistan's GDP growth), and several predictor variables (growth in mining, electricity, communication, manufacturing and electricity), so your regression model will be a regular old multiple regression.
|
What is the difference between multiple regression & mutivariate regression? [duplicate]
"Multiple regression" refers to situations in which you have more than one predictor / explanatory variable ($X$).
"Multivariate regression" refers to situations in which you have more than one resp
|
39,738
|
Practical vs Statistical significance
|
In a nutshell:
Suppose you are testing the effect of drinking a glass of wine per day on the risk of a heart attack. In layman terms, statistical significance refers to whether drinking affects such risk. Practical significance refers to whether such change in risk is of a relevant magnitude for real life concerns. If this is not the case, then you should not be worried about drinking one glass of wine per day, as the effect it has on your health is too small to be a concern.
More precisely, say you find, for a given significance level, that the effect of drinking is non-zero (e.g. p-value below 0.05). Then, the effect of wine on risk of heart attack is statistically significant.
Say however, that such effect, albeit non-negative is "very small". For example, say that drinking one glass of wine per day increases your risk of heart attack by 0.01%. Then, such effect has no practical significance. Conversely, if such effect were to be "large" (e.g. a 20% increase), the effect has practical significance. (the qualification of "very small" and "large" is usually estimated based on the standard deviation of the outcome variable in the sample/population)
In economics, the term for the latter is "economic significance". It is common to ask, after finding a statistically significant effect, whether such effect is economically significant. This is sometimes seen by exploring how much one standard deviation change in the regressor/control relates to the distribution of the dependent/outcome variable.
|
Practical vs Statistical significance
|
In a nutshell:
Suppose you are testing the effect of drinking a glass of wine per day on the risk of a heart attack. In layman terms, statistical significance refers to whether drinking affects such r
|
Practical vs Statistical significance
In a nutshell:
Suppose you are testing the effect of drinking a glass of wine per day on the risk of a heart attack. In layman terms, statistical significance refers to whether drinking affects such risk. Practical significance refers to whether such change in risk is of a relevant magnitude for real life concerns. If this is not the case, then you should not be worried about drinking one glass of wine per day, as the effect it has on your health is too small to be a concern.
More precisely, say you find, for a given significance level, that the effect of drinking is non-zero (e.g. p-value below 0.05). Then, the effect of wine on risk of heart attack is statistically significant.
Say however, that such effect, albeit non-negative is "very small". For example, say that drinking one glass of wine per day increases your risk of heart attack by 0.01%. Then, such effect has no practical significance. Conversely, if such effect were to be "large" (e.g. a 20% increase), the effect has practical significance. (the qualification of "very small" and "large" is usually estimated based on the standard deviation of the outcome variable in the sample/population)
In economics, the term for the latter is "economic significance". It is common to ask, after finding a statistically significant effect, whether such effect is economically significant. This is sometimes seen by exploring how much one standard deviation change in the regressor/control relates to the distribution of the dependent/outcome variable.
|
Practical vs Statistical significance
In a nutshell:
Suppose you are testing the effect of drinking a glass of wine per day on the risk of a heart attack. In layman terms, statistical significance refers to whether drinking affects such r
|
39,739
|
Practical vs Statistical significance
|
This is a large topic but I suggest that the following are key points.
The relation between practical and statistical significance is not well described in terms of relative importance. To think in those terms rather suggests that a researcher has collected some data, used the data to test a hypothesis chosen without too much thought (perhaps that a regression parameter differs from zero), found that the test points to rejection of the hypothesis, and then asked whether this finding is significant. Having reached that position it is certainly appropriate to assess practical significance, rather than assuming that statistical significance implies practical significance.
However, a better approach in the context of scientific research is to consider practical significance much earlier, at the stage of research design. A hypothesis can then be chosen such that whether or not it is found to be correct is of practical significance. In the case of a regression parameter $\beta$, for example, this might lead to the choice of a null hypothesis as $H_0: \beta > \delta$, for some value $\delta$ judged to be a threshold of practical significance, rather than simply $H_0: \beta = 0$. Of course the appropriate value of $\delta$ will depend as rocinante says on the field of study, and also on the particular question within that field. Once a hypothesis is selected, consideration can then be given to data collection, and having collected data the hypothesis can be tested, the result being assessed in terms of statistical significance.
|
Practical vs Statistical significance
|
This is a large topic but I suggest that the following are key points.
The relation between practical and statistical significance is not well described in terms of relative importance. To think in t
|
Practical vs Statistical significance
This is a large topic but I suggest that the following are key points.
The relation between practical and statistical significance is not well described in terms of relative importance. To think in those terms rather suggests that a researcher has collected some data, used the data to test a hypothesis chosen without too much thought (perhaps that a regression parameter differs from zero), found that the test points to rejection of the hypothesis, and then asked whether this finding is significant. Having reached that position it is certainly appropriate to assess practical significance, rather than assuming that statistical significance implies practical significance.
However, a better approach in the context of scientific research is to consider practical significance much earlier, at the stage of research design. A hypothesis can then be chosen such that whether or not it is found to be correct is of practical significance. In the case of a regression parameter $\beta$, for example, this might lead to the choice of a null hypothesis as $H_0: \beta > \delta$, for some value $\delta$ judged to be a threshold of practical significance, rather than simply $H_0: \beta = 0$. Of course the appropriate value of $\delta$ will depend as rocinante says on the field of study, and also on the particular question within that field. Once a hypothesis is selected, consideration can then be given to data collection, and having collected data the hypothesis can be tested, the result being assessed in terms of statistical significance.
|
Practical vs Statistical significance
This is a large topic but I suggest that the following are key points.
The relation between practical and statistical significance is not well described in terms of relative importance. To think in t
|
39,740
|
Practical vs Statistical significance
|
Some points about the practical importance (I'm trying to avoid significant here) of statistically significant findings that come to my mind:
With increasing sample size, small effects will become statistically significant. Whether they are practically of importance won't change.
This is another way of looking at @Adam Bailey's point.
On top of that, I see a second level of practical significance:
Roughly speaking, "statistically significant" means it is unlikely to observe such (or more extreme) differences if the null hypothesis is true. This is also the case for the carefully formulated Null hypothesis that takes into account the effect size that would be considered as practically important according to the previous point.
However, usually this is not all that I as your reader am interested in. What I want to know is not only what your findings are but also how much I can rely on your conclusions. That would be more like the predictive value of your results. In order to judge this, I'd need to know the "prevalence" of true hypotheses among the hypotheses you generate and test.
Which is a way of saying that testing a huge number of more-or-less randomly generated hypotheses usually is not going to help much, and why the total number of tests conducted is of huge importance for the practical conclusions you can draw from a statistically significant result.
|
Practical vs Statistical significance
|
Some points about the practical importance (I'm trying to avoid significant here) of statistically significant findings that come to my mind:
With increasing sample size, small effects will become st
|
Practical vs Statistical significance
Some points about the practical importance (I'm trying to avoid significant here) of statistically significant findings that come to my mind:
With increasing sample size, small effects will become statistically significant. Whether they are practically of importance won't change.
This is another way of looking at @Adam Bailey's point.
On top of that, I see a second level of practical significance:
Roughly speaking, "statistically significant" means it is unlikely to observe such (or more extreme) differences if the null hypothesis is true. This is also the case for the carefully formulated Null hypothesis that takes into account the effect size that would be considered as practically important according to the previous point.
However, usually this is not all that I as your reader am interested in. What I want to know is not only what your findings are but also how much I can rely on your conclusions. That would be more like the predictive value of your results. In order to judge this, I'd need to know the "prevalence" of true hypotheses among the hypotheses you generate and test.
Which is a way of saying that testing a huge number of more-or-less randomly generated hypotheses usually is not going to help much, and why the total number of tests conducted is of huge importance for the practical conclusions you can draw from a statistically significant result.
|
Practical vs Statistical significance
Some points about the practical importance (I'm trying to avoid significant here) of statistically significant findings that come to my mind:
With increasing sample size, small effects will become st
|
39,741
|
Practical vs Statistical significance
|
Statistical significance always becomes more likely the larger the sample size is. This holds since almost no experiment is done exactly under the null hypothesis. Small irrelevant differences can never be ruled out. Consistency of the tests can make such irrelevant differences significant.
Practical relevance depends on the scientific fact, not on statistical convergences. In applied sciences, effect sizes are irrelevant if they cause no difference in the expert's judgement.
But both concepts can be brought together: Statistical tests for relevance can often be constructed by choosing an interval of irrelevant effect sizes. Significant relevance at $\alpha$ level can be concluded, iff a $1-\alpha$-confidence interval is disjoint from this irrelevance interval. This way, enlarging the sample size increases the chance of statistical significance iff the effect is relevant. Otherwise even a confidence interval of length $0$ stays inside the interval of irrelevance.
|
Practical vs Statistical significance
|
Statistical significance always becomes more likely the larger the sample size is. This holds since almost no experiment is done exactly under the null hypothesis. Small irrelevant differences can nev
|
Practical vs Statistical significance
Statistical significance always becomes more likely the larger the sample size is. This holds since almost no experiment is done exactly under the null hypothesis. Small irrelevant differences can never be ruled out. Consistency of the tests can make such irrelevant differences significant.
Practical relevance depends on the scientific fact, not on statistical convergences. In applied sciences, effect sizes are irrelevant if they cause no difference in the expert's judgement.
But both concepts can be brought together: Statistical tests for relevance can often be constructed by choosing an interval of irrelevant effect sizes. Significant relevance at $\alpha$ level can be concluded, iff a $1-\alpha$-confidence interval is disjoint from this irrelevance interval. This way, enlarging the sample size increases the chance of statistical significance iff the effect is relevant. Otherwise even a confidence interval of length $0$ stays inside the interval of irrelevance.
|
Practical vs Statistical significance
Statistical significance always becomes more likely the larger the sample size is. This holds since almost no experiment is done exactly under the null hypothesis. Small irrelevant differences can nev
|
39,742
|
Practical vs Statistical significance
|
Nutshell is being studied in relation to, among other things, prevention of diabetes and obesity.
Say you wish to analyse the difference between rats that get nutshell extract in their feed and rats that do not.
Then the 'effect of the nutshell' is statistically significant if the results are unlikely given the hypothesis that there is no effect of the nutshell.
And the 'effect of the nutshell' is practically significant if the results show a large size difference (estimated), 'large' being defined in relation to practical purposes.
Importance in drawing scientific inference: Statistical and practical significance do not need to occur at the same time (depending on the test size and variation of the population). It depends much on the estimated standard error for the effect size. If the SE is small then very tiny (practically insignificant) effects can still be tested as statistically significant. And if the SE is big then large (practically significant) effects can be tested as statistically insignificant (not because the effect is small but because the test is a bad detector).
So errors are being made if these different types of significance are mixed:
Arguing that no effect is present because of low statistical significance, while the test might have been not accurate enough to detect a practical significant difference.
Arguing that a (practical )significant effect is present because of high significance, while the test might have been extremely sensitive to detect tiny effect sizes with little practical significance.
|
Practical vs Statistical significance
|
Nutshell is being studied in relation to, among other things, prevention of diabetes and obesity.
Say you wish to analyse the difference between rats that get nutshell extract in their feed and rats
|
Practical vs Statistical significance
Nutshell is being studied in relation to, among other things, prevention of diabetes and obesity.
Say you wish to analyse the difference between rats that get nutshell extract in their feed and rats that do not.
Then the 'effect of the nutshell' is statistically significant if the results are unlikely given the hypothesis that there is no effect of the nutshell.
And the 'effect of the nutshell' is practically significant if the results show a large size difference (estimated), 'large' being defined in relation to practical purposes.
Importance in drawing scientific inference: Statistical and practical significance do not need to occur at the same time (depending on the test size and variation of the population). It depends much on the estimated standard error for the effect size. If the SE is small then very tiny (practically insignificant) effects can still be tested as statistically significant. And if the SE is big then large (practically significant) effects can be tested as statistically insignificant (not because the effect is small but because the test is a bad detector).
So errors are being made if these different types of significance are mixed:
Arguing that no effect is present because of low statistical significance, while the test might have been not accurate enough to detect a practical significant difference.
Arguing that a (practical )significant effect is present because of high significance, while the test might have been extremely sensitive to detect tiny effect sizes with little practical significance.
|
Practical vs Statistical significance
Nutshell is being studied in relation to, among other things, prevention of diabetes and obesity.
Say you wish to analyse the difference between rats that get nutshell extract in their feed and rats
|
39,743
|
Practical vs Statistical significance
|
While I agree with the existing answers, I think one nuance hasn't been stressed enough and I will try to illustrate it with an example.
If you increase $n$, the power of your test rises which means that you are better able to detect real effects. If your $n$ is very large, you will be able to detect very small effects which are practically irrelevant.
Although not of practical relevance, those tiny effects that you can detect with very large $n$ are still real though. They are not statistical flukes as they are sometimes mistakenly called. A large $n$ doesn't give you an increased risk of finding small effects that do not exist. If such was the case, we would need to warn against studies with large $n$. The detected small effects are real, but unimportant for reasons related to practical applications.
Let's suppose you measure the height of one million male babies, all exactly one year old since their birth and none of which were prematurely born. One week later, you measure the same million babies again.
Usually, I would advice to use two-sided tests, but here we can exclude that the babies have shrunk I would say:
$H_0$ The babies have not grown
$H_a$ The babies have grown
You can, for each baby, subtract both measures and see how much it has grown. This gives you one column with a million measures. A t-test can show if it's mean is significantly larger than 0. The enormous sample size of 1000000 and the paired setup increase the power of the test.
According to the WHO the median baby grows from 75.7cm to 87.8cm between his first and second birthday. Assuming linearity within that year, babies would grow on average $0.23cm$ during the week that our observations span.
With the enormous $n$, I am quite confident we could find a highly statistically significant result that the growth was not zero, a very low p-value. That growth of the average baby is real, not a statistical fluke stemming from our large sample size. But does that mean this result has practical relevance? No, as a clothing manufacturer I still wouldn't produce separate onesies for 53 week olds than for 52 week olds for two reasons:
0.23cm is not enough of a difference to warrant another intermediate size of clothing.
Those 0.23cm are for the average baby anyway, not for each individual baby. Individual shoppers are used buying smaller or larger sizes than indicated for the age. Because the variance of baby height is considerable and doesn't depend in any way on our study, some parents don't have the choice but to do this. This variance of baby height is not to be confused with the variance of the estimator of the average baby height, that one decreases with $n$, hence the power of the test.
In this example, the scale on which the test compares measures is intuitive and the effect size can and should be measured with a confidence interval on that scale. In some scenarios that cannot be done, for example when comparing the effect sizes of multiple tests on different scales. Standardized effect size measures like Cohen's d can then be used.
Simulation in R:
I cannot simulate what it would look like to measure the same babies twice, but I can reasonably approximate a test in which a million 52 week olds were measured and another million other babies which are all 53 weeks old were measured for comparison.
This test is not paired and has lower power than the paired one. If I can show that the practically irrelevant $0.23cm$ are statistically significant with this test, they will be significant with the other as well.
Height is normally distributed and from the WHO data, I can roughly deduce the following distributions:
52 week olds: $\mathcal{N}(\mu=75.735,\sigma=(80.35 - 71.10)/4=2.313)$
53 week olds: $\mathcal{N}(\mu=75.995,\sigma=(80.79 - 71.25)/4=2,385)$
I did this using the thumb rule that there are 4 standard deviations $\sigma$ between the $0.025^{th}$ and the $0.975^{th}$ quantile.
> t.test(rnorm(1e+6,75.995,2.385),
rnorm(1e+6,75.735,2.3125),
alternative = "two.sided",
mu = 0,
paired = FALSE,
var.equal = FALSE,
conf.level = 0.999)
Welch Two Sample t-test
data: rnorm(1e+06, 75.995, 2.385) and rnorm(1e+06, 75.735, 2.3125)
t = 79.403, df = 1998100, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
99.9 percent confidence interval:
0.2528959 0.2747625
sample estimates:
mean of x mean of y
75.99828 75.73445
I even used the Welch test that doesn't assume equal variances (they are very close to equal) and used a two sided test (babies will not shrink). Both of these circumstances reduce the power of the test. And yet the statistical significance of the test is exceptional with $p-value < 2.2 * 10^{-16}$.
Regarding the effect size we can say that 999 out of 1000 confidence intervals would contain the true height gain of the average baby and our confidence interval is $[ 0.253, 0.275 ]$ cm which is a practically irrelevant although real quantity.
|
Practical vs Statistical significance
|
While I agree with the existing answers, I think one nuance hasn't been stressed enough and I will try to illustrate it with an example.
If you increase $n$, the power of your test rises which means t
|
Practical vs Statistical significance
While I agree with the existing answers, I think one nuance hasn't been stressed enough and I will try to illustrate it with an example.
If you increase $n$, the power of your test rises which means that you are better able to detect real effects. If your $n$ is very large, you will be able to detect very small effects which are practically irrelevant.
Although not of practical relevance, those tiny effects that you can detect with very large $n$ are still real though. They are not statistical flukes as they are sometimes mistakenly called. A large $n$ doesn't give you an increased risk of finding small effects that do not exist. If such was the case, we would need to warn against studies with large $n$. The detected small effects are real, but unimportant for reasons related to practical applications.
Let's suppose you measure the height of one million male babies, all exactly one year old since their birth and none of which were prematurely born. One week later, you measure the same million babies again.
Usually, I would advice to use two-sided tests, but here we can exclude that the babies have shrunk I would say:
$H_0$ The babies have not grown
$H_a$ The babies have grown
You can, for each baby, subtract both measures and see how much it has grown. This gives you one column with a million measures. A t-test can show if it's mean is significantly larger than 0. The enormous sample size of 1000000 and the paired setup increase the power of the test.
According to the WHO the median baby grows from 75.7cm to 87.8cm between his first and second birthday. Assuming linearity within that year, babies would grow on average $0.23cm$ during the week that our observations span.
With the enormous $n$, I am quite confident we could find a highly statistically significant result that the growth was not zero, a very low p-value. That growth of the average baby is real, not a statistical fluke stemming from our large sample size. But does that mean this result has practical relevance? No, as a clothing manufacturer I still wouldn't produce separate onesies for 53 week olds than for 52 week olds for two reasons:
0.23cm is not enough of a difference to warrant another intermediate size of clothing.
Those 0.23cm are for the average baby anyway, not for each individual baby. Individual shoppers are used buying smaller or larger sizes than indicated for the age. Because the variance of baby height is considerable and doesn't depend in any way on our study, some parents don't have the choice but to do this. This variance of baby height is not to be confused with the variance of the estimator of the average baby height, that one decreases with $n$, hence the power of the test.
In this example, the scale on which the test compares measures is intuitive and the effect size can and should be measured with a confidence interval on that scale. In some scenarios that cannot be done, for example when comparing the effect sizes of multiple tests on different scales. Standardized effect size measures like Cohen's d can then be used.
Simulation in R:
I cannot simulate what it would look like to measure the same babies twice, but I can reasonably approximate a test in which a million 52 week olds were measured and another million other babies which are all 53 weeks old were measured for comparison.
This test is not paired and has lower power than the paired one. If I can show that the practically irrelevant $0.23cm$ are statistically significant with this test, they will be significant with the other as well.
Height is normally distributed and from the WHO data, I can roughly deduce the following distributions:
52 week olds: $\mathcal{N}(\mu=75.735,\sigma=(80.35 - 71.10)/4=2.313)$
53 week olds: $\mathcal{N}(\mu=75.995,\sigma=(80.79 - 71.25)/4=2,385)$
I did this using the thumb rule that there are 4 standard deviations $\sigma$ between the $0.025^{th}$ and the $0.975^{th}$ quantile.
> t.test(rnorm(1e+6,75.995,2.385),
rnorm(1e+6,75.735,2.3125),
alternative = "two.sided",
mu = 0,
paired = FALSE,
var.equal = FALSE,
conf.level = 0.999)
Welch Two Sample t-test
data: rnorm(1e+06, 75.995, 2.385) and rnorm(1e+06, 75.735, 2.3125)
t = 79.403, df = 1998100, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
99.9 percent confidence interval:
0.2528959 0.2747625
sample estimates:
mean of x mean of y
75.99828 75.73445
I even used the Welch test that doesn't assume equal variances (they are very close to equal) and used a two sided test (babies will not shrink). Both of these circumstances reduce the power of the test. And yet the statistical significance of the test is exceptional with $p-value < 2.2 * 10^{-16}$.
Regarding the effect size we can say that 999 out of 1000 confidence intervals would contain the true height gain of the average baby and our confidence interval is $[ 0.253, 0.275 ]$ cm which is a practically irrelevant although real quantity.
|
Practical vs Statistical significance
While I agree with the existing answers, I think one nuance hasn't been stressed enough and I will try to illustrate it with an example.
If you increase $n$, the power of your test rises which means t
|
39,744
|
Is it possible to combine the F-test and t-test to test for differences in both the variance and the mean?
|
This problem of detecting a difference in two Normal distributions based on independent random samples from each was solved asymptotically by Pearson and Neyman in 1930 using the likelihood ratio test. (Specifically, the alternative hypothesis is that $\mu_1\ne\mu_2$ or $\sigma_1^2\ne\sigma_2^2.$ Under the null hypothesis, the likelihood ratio statistic is asymptotically uniform as the sizes of both samples grow large.) In 2012, Zhang, Xu, and Chen provided a tractable expression for the CDF of the likelihood ratio statistic: it is a double integral that they compute numerically.
For other parametric families of distributions the problem can, in principle, be solved with similar techniques.
Let the two samples be $(x_i|1\le i\le n)$ from a Normal$(\mu_1, \sigma_1^2)$ distribution and $(y_j|1\le j\le m)$ from a Normal$(\mu_2, \sigma_2^2)$ distribution. The likelihood ratio statistic is
$$\lambda_{n,m} = \frac{s_x^{n/2} s_y^{m/2}}{s^{(n+m)/2}}$$
where
$$s_x = \sum_{i=1}^n(x_i-\bar{x})^2/n,$$
$$s_y = \sum_{j=1}^m(y_j - \bar{y})^2/m,$$
$$s = \left(\sum_{i=1}^n(x_i-u)^2 + \sum_{j=1}^m(y_j-u)^2\right)/(n+m)$$
and $\bar{x}, \bar{y},$ and $u$ are the sample means of the $x_i,$ the $y_j,$ and the combined sample, respectively. The CDF of $\lambda_{n,m}$ is
$$F_{n,m}(\lambda) = 1 - C\iint_D\frac{w_1^{(n-1)/2}w_2^{(m-1)/2}}{\sqrt{1-w_1-w_2}}\frac{dw_1}{w_1}\frac{dw_2}{w_2}$$
with
$$C = \frac{\Gamma(\frac{n+m-1}{2})}{\Gamma(\frac{n-1}{2})\Gamma(\frac{m-1}{2})\Gamma(\frac{1}{2})},$$
$$D = \left\{(w_1,w_2)|w_1\gt 0, w_2\gt 0, w_1+w_2\lt 1, \frac{(n+m)^{(n+m)/2}}{n^{n/2}m^{m/2}}w_1^{n/2}w_2^{m/2}\gt \lambda\right\}.$$
Plot of the CDF of the likelihood ratio statistic $\lambda_{2,2}$. The curve is calculated using numeric integration at the points $\lambda=0, 1/20, 2/20, \ldots, 1$ while the points are the result of a simulation of $10,000$ pairs of samples.
References
Lingyun Zhang, Xinzhong Xu, and Gemai Chen. The Exact Likelihood Ratio Test for Equality of Two Normal Populations. The American Statistician, August 2012, Vol. 66, No.3 pp 180-184.
E. S. Pearson and J. Neyman, On the Problem of Two Samples (1930). Published in Joint Statistical Papers (1967), eds. J. Neyman and E. S. Pearson, Cambridge University Press, pp 99-115.
|
Is it possible to combine the F-test and t-test to test for differences in both the variance and the
|
This problem of detecting a difference in two Normal distributions based on independent random samples from each was solved asymptotically by Pearson and Neyman in 1930 using the likelihood ratio test
|
Is it possible to combine the F-test and t-test to test for differences in both the variance and the mean?
This problem of detecting a difference in two Normal distributions based on independent random samples from each was solved asymptotically by Pearson and Neyman in 1930 using the likelihood ratio test. (Specifically, the alternative hypothesis is that $\mu_1\ne\mu_2$ or $\sigma_1^2\ne\sigma_2^2.$ Under the null hypothesis, the likelihood ratio statistic is asymptotically uniform as the sizes of both samples grow large.) In 2012, Zhang, Xu, and Chen provided a tractable expression for the CDF of the likelihood ratio statistic: it is a double integral that they compute numerically.
For other parametric families of distributions the problem can, in principle, be solved with similar techniques.
Let the two samples be $(x_i|1\le i\le n)$ from a Normal$(\mu_1, \sigma_1^2)$ distribution and $(y_j|1\le j\le m)$ from a Normal$(\mu_2, \sigma_2^2)$ distribution. The likelihood ratio statistic is
$$\lambda_{n,m} = \frac{s_x^{n/2} s_y^{m/2}}{s^{(n+m)/2}}$$
where
$$s_x = \sum_{i=1}^n(x_i-\bar{x})^2/n,$$
$$s_y = \sum_{j=1}^m(y_j - \bar{y})^2/m,$$
$$s = \left(\sum_{i=1}^n(x_i-u)^2 + \sum_{j=1}^m(y_j-u)^2\right)/(n+m)$$
and $\bar{x}, \bar{y},$ and $u$ are the sample means of the $x_i,$ the $y_j,$ and the combined sample, respectively. The CDF of $\lambda_{n,m}$ is
$$F_{n,m}(\lambda) = 1 - C\iint_D\frac{w_1^{(n-1)/2}w_2^{(m-1)/2}}{\sqrt{1-w_1-w_2}}\frac{dw_1}{w_1}\frac{dw_2}{w_2}$$
with
$$C = \frac{\Gamma(\frac{n+m-1}{2})}{\Gamma(\frac{n-1}{2})\Gamma(\frac{m-1}{2})\Gamma(\frac{1}{2})},$$
$$D = \left\{(w_1,w_2)|w_1\gt 0, w_2\gt 0, w_1+w_2\lt 1, \frac{(n+m)^{(n+m)/2}}{n^{n/2}m^{m/2}}w_1^{n/2}w_2^{m/2}\gt \lambda\right\}.$$
Plot of the CDF of the likelihood ratio statistic $\lambda_{2,2}$. The curve is calculated using numeric integration at the points $\lambda=0, 1/20, 2/20, \ldots, 1$ while the points are the result of a simulation of $10,000$ pairs of samples.
References
Lingyun Zhang, Xinzhong Xu, and Gemai Chen. The Exact Likelihood Ratio Test for Equality of Two Normal Populations. The American Statistician, August 2012, Vol. 66, No.3 pp 180-184.
E. S. Pearson and J. Neyman, On the Problem of Two Samples (1930). Published in Joint Statistical Papers (1967), eds. J. Neyman and E. S. Pearson, Cambridge University Press, pp 99-115.
|
Is it possible to combine the F-test and t-test to test for differences in both the variance and the
This problem of detecting a difference in two Normal distributions based on independent random samples from each was solved asymptotically by Pearson and Neyman in 1930 using the likelihood ratio test
|
39,745
|
How do I get the amplitude and phase for sine wave from lm() summary?
|
The fit is
$$y = 26.9188 + 1.7468\sin(x) + 1.2077\cos(x).$$
Consider a general (non-zero) linear combination $\alpha \sin(x) + \beta\cos(x).$ Viewing $(\alpha, \beta)$ as a vector and writing it in polar coordinates $(r, \phi)$ yields
$$\alpha = r \cos(\phi),\quad \beta = r \sin(\phi), \quad r = \sqrt{\alpha^2+\beta^2}$$
whence
$$\alpha\sin(x) + \beta\cos(x) = r\cos(\phi)\sin(x) + r\sin(\phi)\cos(x) = r\sin(x+\phi).$$
$r$ is the amplitude and $\phi$ is the phase. In the present case $\alpha=1.7468$ and $ \beta=1.2077$ entailing
$$r = \sqrt{ 1.7468^2+1.2077^2 } = 2.123641$$
and
$$\phi = \arctan(\beta, \alpha) = 0.6049163.$$
Consequently
$$y = 26.9188 + 2.123641 \sin(x + 0.6049163).$$
This can be checked by plotting. Here is R code to do it:
b0 <- coef(fit.lm2)[1]
alpha <- coef(fit.lm2)[2]
beta <- coef(fit.lm2)[3]
r <- sqrt(alpha^2 + beta^2)
phi <- atan2(beta, alpha)
par(mfrow=c(1,2))
curve(b0 + r * sin(x + phi), 0, 2*pi, lwd=3, col="Gray",
main="Overplotted Graphs", xlab="x", ylab="y")
curve(b0 + alpha * sin(x) + beta * cos(x), lwd=3, lty=3, col="Red", add=TRUE)
curve(b0 + r * sin(x + phi) - (b0 + alpha * sin(x) + beta * cos(x)),
0, 2*pi, n=257, lwd=3, col="Gray", main="Difference", xlab="x", y="")
The two formulas agree to sixteen significant figures in double-precision arithmetic. The difference reflects pseudo-random floating point errors. (Because my data are not exactly the same as the original data, the "difference" plot will differ in its details but will still exhibit only tiny variations.)
|
How do I get the amplitude and phase for sine wave from lm() summary?
|
The fit is
$$y = 26.9188 + 1.7468\sin(x) + 1.2077\cos(x).$$
Consider a general (non-zero) linear combination $\alpha \sin(x) + \beta\cos(x).$ Viewing $(\alpha, \beta)$ as a vector and writing it in po
|
How do I get the amplitude and phase for sine wave from lm() summary?
The fit is
$$y = 26.9188 + 1.7468\sin(x) + 1.2077\cos(x).$$
Consider a general (non-zero) linear combination $\alpha \sin(x) + \beta\cos(x).$ Viewing $(\alpha, \beta)$ as a vector and writing it in polar coordinates $(r, \phi)$ yields
$$\alpha = r \cos(\phi),\quad \beta = r \sin(\phi), \quad r = \sqrt{\alpha^2+\beta^2}$$
whence
$$\alpha\sin(x) + \beta\cos(x) = r\cos(\phi)\sin(x) + r\sin(\phi)\cos(x) = r\sin(x+\phi).$$
$r$ is the amplitude and $\phi$ is the phase. In the present case $\alpha=1.7468$ and $ \beta=1.2077$ entailing
$$r = \sqrt{ 1.7468^2+1.2077^2 } = 2.123641$$
and
$$\phi = \arctan(\beta, \alpha) = 0.6049163.$$
Consequently
$$y = 26.9188 + 2.123641 \sin(x + 0.6049163).$$
This can be checked by plotting. Here is R code to do it:
b0 <- coef(fit.lm2)[1]
alpha <- coef(fit.lm2)[2]
beta <- coef(fit.lm2)[3]
r <- sqrt(alpha^2 + beta^2)
phi <- atan2(beta, alpha)
par(mfrow=c(1,2))
curve(b0 + r * sin(x + phi), 0, 2*pi, lwd=3, col="Gray",
main="Overplotted Graphs", xlab="x", ylab="y")
curve(b0 + alpha * sin(x) + beta * cos(x), lwd=3, lty=3, col="Red", add=TRUE)
curve(b0 + r * sin(x + phi) - (b0 + alpha * sin(x) + beta * cos(x)),
0, 2*pi, n=257, lwd=3, col="Gray", main="Difference", xlab="x", y="")
The two formulas agree to sixteen significant figures in double-precision arithmetic. The difference reflects pseudo-random floating point errors. (Because my data are not exactly the same as the original data, the "difference" plot will differ in its details but will still exhibit only tiny variations.)
|
How do I get the amplitude and phase for sine wave from lm() summary?
The fit is
$$y = 26.9188 + 1.7468\sin(x) + 1.2077\cos(x).$$
Consider a general (non-zero) linear combination $\alpha \sin(x) + \beta\cos(x).$ Viewing $(\alpha, \beta)$ as a vector and writing it in po
|
39,746
|
Different results by using chi square test and logistic regression
|
A few points:
1) The fact that the independent variables are categorical is irrelevant for the choice of logistic regression.
2) A significant chi-square value means the two variables are associated, but if both are categorical, it's not really correlation. If both variables have only 2 levels, there are analogues of correlation.
3) (your main question) It appears you did a logistic regression with multiple independent variables and compared it to a chi-square test between only two variables (infection and A). These ask two different questions, so they get different answers. The first asks whether A affects the odds of infection after controlling for other variables. The second does not control for any other variables. If all the independent variables were completely unrelated, then I believe the effect sizes (odds ratios) would stay the same. However, this hardly ever happens in real life (except in some very controlled experiments).
4) Just as an aside, it is better to look at effect sizes, not just p values.
|
Different results by using chi square test and logistic regression
|
A few points:
1) The fact that the independent variables are categorical is irrelevant for the choice of logistic regression.
2) A significant chi-square value means the two variables are associated,
|
Different results by using chi square test and logistic regression
A few points:
1) The fact that the independent variables are categorical is irrelevant for the choice of logistic regression.
2) A significant chi-square value means the two variables are associated, but if both are categorical, it's not really correlation. If both variables have only 2 levels, there are analogues of correlation.
3) (your main question) It appears you did a logistic regression with multiple independent variables and compared it to a chi-square test between only two variables (infection and A). These ask two different questions, so they get different answers. The first asks whether A affects the odds of infection after controlling for other variables. The second does not control for any other variables. If all the independent variables were completely unrelated, then I believe the effect sizes (odds ratios) would stay the same. However, this hardly ever happens in real life (except in some very controlled experiments).
4) Just as an aside, it is better to look at effect sizes, not just p values.
|
Different results by using chi square test and logistic regression
A few points:
1) The fact that the independent variables are categorical is irrelevant for the choice of logistic regression.
2) A significant chi-square value means the two variables are associated,
|
39,747
|
pattern of ROC curve and choice of AUC
|
I agree with your concerns.
given that people in reality will seldom choose a FPR cut-off of 0.5 or higher, why people would prefer a ROC curve with FPR ranging from 0 to 1 and use the full AUC value (i.e. calculate the entire area under the ROC curve) instead of just reporting the area made from, say, 0 to 0.25 or to 0.5? Is that called "partial AUC"?
I'm a big fan of having the complete ROC, as it gives much more information that just the sensitivity/specificity pair of one working point of a classifier.
For the same reason, I'm not a big fan of summarizing all that information even further into one single number. But if you have to do so, I agree that it is better to restrict the calculations to parts of the ROC that are relevant for the application.
in the figure below, what can we say about the performances of the three models? The AUC values are: green (0.805), red (0.815), blue (0.768). The red curve turns out to be superior, but as you see, the superiority is only reflected after FPR > 0.2. Thanks :)
That depends entirely on your application. In your example, if high specificity is needed, then the green classifier would be best. If high sensitivity is needed, go for the red one.
As to the comparison of classifiers: there are lots of questions and answers here discussing this. Summary:
classifier comparison is far more difficult than one would expect at first
not all classifier performance measures are good for this task. Read @FrankHarrells answers, and go for so-called proper scoring rules (e.g. Brier's score/mean squared error).
|
pattern of ROC curve and choice of AUC
|
I agree with your concerns.
given that people in reality will seldom choose a FPR cut-off of 0.5 or higher, why people would prefer a ROC curve with FPR ranging from 0 to 1 and use the full AUC value
|
pattern of ROC curve and choice of AUC
I agree with your concerns.
given that people in reality will seldom choose a FPR cut-off of 0.5 or higher, why people would prefer a ROC curve with FPR ranging from 0 to 1 and use the full AUC value (i.e. calculate the entire area under the ROC curve) instead of just reporting the area made from, say, 0 to 0.25 or to 0.5? Is that called "partial AUC"?
I'm a big fan of having the complete ROC, as it gives much more information that just the sensitivity/specificity pair of one working point of a classifier.
For the same reason, I'm not a big fan of summarizing all that information even further into one single number. But if you have to do so, I agree that it is better to restrict the calculations to parts of the ROC that are relevant for the application.
in the figure below, what can we say about the performances of the three models? The AUC values are: green (0.805), red (0.815), blue (0.768). The red curve turns out to be superior, but as you see, the superiority is only reflected after FPR > 0.2. Thanks :)
That depends entirely on your application. In your example, if high specificity is needed, then the green classifier would be best. If high sensitivity is needed, go for the red one.
As to the comparison of classifiers: there are lots of questions and answers here discussing this. Summary:
classifier comparison is far more difficult than one would expect at first
not all classifier performance measures are good for this task. Read @FrankHarrells answers, and go for so-called proper scoring rules (e.g. Brier's score/mean squared error).
|
pattern of ROC curve and choice of AUC
I agree with your concerns.
given that people in reality will seldom choose a FPR cut-off of 0.5 or higher, why people would prefer a ROC curve with FPR ranging from 0 to 1 and use the full AUC value
|
39,748
|
pattern of ROC curve and choice of AUC
|
Usually, it will be your application that will determine whether your focus is on precision or recall.
@2
These will be dramatically different in the medical field, where you will often tolerate having a bad precision for the sake of a very good recall, when it comes to prevention, i.e. you prefer to label a lot of healthy people as sick and make additional tests, rather than to let someone die (here sickness is considered "relevant", and labeled as sick "retrieved").
On the other hand, in production, you can tolerate a certain quota of bad apples and you might prefer a test that does not catch all the faulty products but is much more precise in identifying the bad apples - usually the costs associated with inspecting the items can not be disregarded. This corresponds to a high precision, and low recall scenario.
For your models, either you know what you need and pick a better model for that purpose, or you pick the one with better AUC. Of course there are also other things you might take into consideration, such as, which model is more parsimonious (has fewer explanatory variables), where are the assumptions better met, etc.
@1
I don't see the advantage of putting less information in a plot, especially if it could be misleading. (unless you work in marketing)
|
pattern of ROC curve and choice of AUC
|
Usually, it will be your application that will determine whether your focus is on precision or recall.
@2
These will be dramatically different in the medical field, where you will often tolerate havi
|
pattern of ROC curve and choice of AUC
Usually, it will be your application that will determine whether your focus is on precision or recall.
@2
These will be dramatically different in the medical field, where you will often tolerate having a bad precision for the sake of a very good recall, when it comes to prevention, i.e. you prefer to label a lot of healthy people as sick and make additional tests, rather than to let someone die (here sickness is considered "relevant", and labeled as sick "retrieved").
On the other hand, in production, you can tolerate a certain quota of bad apples and you might prefer a test that does not catch all the faulty products but is much more precise in identifying the bad apples - usually the costs associated with inspecting the items can not be disregarded. This corresponds to a high precision, and low recall scenario.
For your models, either you know what you need and pick a better model for that purpose, or you pick the one with better AUC. Of course there are also other things you might take into consideration, such as, which model is more parsimonious (has fewer explanatory variables), where are the assumptions better met, etc.
@1
I don't see the advantage of putting less information in a plot, especially if it could be misleading. (unless you work in marketing)
|
pattern of ROC curve and choice of AUC
Usually, it will be your application that will determine whether your focus is on precision or recall.
@2
These will be dramatically different in the medical field, where you will often tolerate havi
|
39,749
|
pattern of ROC curve and choice of AUC
|
You didn't state the ultimate goal of the exercise, hence the choice of ROC curves was not well motivated. Many useful things can be done with log-likelihood and Brier scores, as well as with the distribution of predicted risks (ignoring $Y$). The use of cutoffs is questionable.
|
pattern of ROC curve and choice of AUC
|
You didn't state the ultimate goal of the exercise, hence the choice of ROC curves was not well motivated. Many useful things can be done with log-likelihood and Brier scores, as well as with the dis
|
pattern of ROC curve and choice of AUC
You didn't state the ultimate goal of the exercise, hence the choice of ROC curves was not well motivated. Many useful things can be done with log-likelihood and Brier scores, as well as with the distribution of predicted risks (ignoring $Y$). The use of cutoffs is questionable.
|
pattern of ROC curve and choice of AUC
You didn't state the ultimate goal of the exercise, hence the choice of ROC curves was not well motivated. Many useful things can be done with log-likelihood and Brier scores, as well as with the dis
|
39,750
|
Whether to transform non-normal independent variables in logistic regression?
|
Why odds ratios look strange on transformed variables
Transformations change the metric of the variable. Odds ratios are the predicted difference in odds for a one unit increase on the IV holding all other IVs constant. The meaning of one unit will be very different after a square root transformation.
For example, if you had a 1 to 100 raw scale, then after transformation, the difference between 16 and 25 on the raw scale would be the same as the difference between 4 and 5 on the square root transformed scale. Thus, it's not surprising that your odds ratios became a lot larger after square root transformation.
If you want to examine the effect of the transformation in a scaling-neutral way, you could standardise your IVs (i.e., make them z-scores). Thus, you could compare the odds ratio of a z-score of the raw variable to a z-score of the transformed variable. This will allow you to isolate the effect of changing the relative distance between categories.
Whether to transform non-normal predictors in logistic regression
Normality of predictors is not an assumption of logistic regression, or linear regression for that matter. See @whuber's answer here for more details.
That said, you may find one scaling of your IVs more predictive or interpretable. I'd use criteria like that to decide whether you want to transform a predictor variable.
|
Whether to transform non-normal independent variables in logistic regression?
|
Why odds ratios look strange on transformed variables
Transformations change the metric of the variable. Odds ratios are the predicted difference in odds for a one unit increase on the IV holding all
|
Whether to transform non-normal independent variables in logistic regression?
Why odds ratios look strange on transformed variables
Transformations change the metric of the variable. Odds ratios are the predicted difference in odds for a one unit increase on the IV holding all other IVs constant. The meaning of one unit will be very different after a square root transformation.
For example, if you had a 1 to 100 raw scale, then after transformation, the difference between 16 and 25 on the raw scale would be the same as the difference between 4 and 5 on the square root transformed scale. Thus, it's not surprising that your odds ratios became a lot larger after square root transformation.
If you want to examine the effect of the transformation in a scaling-neutral way, you could standardise your IVs (i.e., make them z-scores). Thus, you could compare the odds ratio of a z-score of the raw variable to a z-score of the transformed variable. This will allow you to isolate the effect of changing the relative distance between categories.
Whether to transform non-normal predictors in logistic regression
Normality of predictors is not an assumption of logistic regression, or linear regression for that matter. See @whuber's answer here for more details.
That said, you may find one scaling of your IVs more predictive or interpretable. I'd use criteria like that to decide whether you want to transform a predictor variable.
|
Whether to transform non-normal independent variables in logistic regression?
Why odds ratios look strange on transformed variables
Transformations change the metric of the variable. Odds ratios are the predicted difference in odds for a one unit increase on the IV holding all
|
39,751
|
Partial derivative of bivariate normal cdf and pdf
|
\begin{align}
y &= \Phi(x_1,x_2,\rho)
= \int_{-\infty}^{x_1}\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm
db\right]\,\mathrm da\\
\frac{\partial y}{\partial x_1}
&= \frac{\partial}{\partial x_1}\Phi(x_1,x_2,\rho) = \frac{\partial}{\partial x_1}\int_{-\infty}^{x_1}
\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm db\right]\,\mathrm da\\
&= \int_{-\infty}^{x_2} \phi(x_1,b,\rho)\,\mathrm db
\end{align}
via the rule for differentiating under the integral sign. Similarly,
$$\frac{\partial y}{\partial x_2} = \int_{-\infty}^{x_1} \phi(a,x_2,\rho)\,\mathrm da.$$
If you don't recall the rule for differentiating integrals, see for
example, the comments following
this answer on math.SE.
The derivative with respect to $\rho$ is straightforward to find but
messy in its details. We have that
$$\phi(x_1,x_2,\rho)=\frac{1}{2\pi\sqrt{1-\rho^2}}
\exp\left[-\frac{x^2 -2\rho xy + y^2}{2(1-\rho^2)}\right]$$
whose partial derivative with respect to $\rho$ is left to the OP to find.
If $g(x_1,x_2,\rho)$ denotes this partial derivative, then
$$\frac{\partial}{\partial \rho}\Phi(x_1,x_2,\rho) = \frac{\partial}{\partial \rho}\int_{-\infty}^{x_1}
\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm db\right]\,\mathrm da
= \int_{-\infty}^{x_1}
\int_{-\infty}^{x_2} g(a,b,\rho)\,\mathrm db\,\mathrm da$$
|
Partial derivative of bivariate normal cdf and pdf
|
\begin{align}
y &= \Phi(x_1,x_2,\rho)
= \int_{-\infty}^{x_1}\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm
db\right]\,\mathrm da\\
\frac{\partial y}{\partial x_1}
&= \frac{\partial}{\partial x_1}
|
Partial derivative of bivariate normal cdf and pdf
\begin{align}
y &= \Phi(x_1,x_2,\rho)
= \int_{-\infty}^{x_1}\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm
db\right]\,\mathrm da\\
\frac{\partial y}{\partial x_1}
&= \frac{\partial}{\partial x_1}\Phi(x_1,x_2,\rho) = \frac{\partial}{\partial x_1}\int_{-\infty}^{x_1}
\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm db\right]\,\mathrm da\\
&= \int_{-\infty}^{x_2} \phi(x_1,b,\rho)\,\mathrm db
\end{align}
via the rule for differentiating under the integral sign. Similarly,
$$\frac{\partial y}{\partial x_2} = \int_{-\infty}^{x_1} \phi(a,x_2,\rho)\,\mathrm da.$$
If you don't recall the rule for differentiating integrals, see for
example, the comments following
this answer on math.SE.
The derivative with respect to $\rho$ is straightforward to find but
messy in its details. We have that
$$\phi(x_1,x_2,\rho)=\frac{1}{2\pi\sqrt{1-\rho^2}}
\exp\left[-\frac{x^2 -2\rho xy + y^2}{2(1-\rho^2)}\right]$$
whose partial derivative with respect to $\rho$ is left to the OP to find.
If $g(x_1,x_2,\rho)$ denotes this partial derivative, then
$$\frac{\partial}{\partial \rho}\Phi(x_1,x_2,\rho) = \frac{\partial}{\partial \rho}\int_{-\infty}^{x_1}
\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm db\right]\,\mathrm da
= \int_{-\infty}^{x_1}
\int_{-\infty}^{x_2} g(a,b,\rho)\,\mathrm db\,\mathrm da$$
|
Partial derivative of bivariate normal cdf and pdf
\begin{align}
y &= \Phi(x_1,x_2,\rho)
= \int_{-\infty}^{x_1}\left[\int_{-\infty}^{x_2} \phi(a,b,\rho)\,\mathrm
db\right]\,\mathrm da\\
\frac{\partial y}{\partial x_1}
&= \frac{\partial}{\partial x_1}
|
39,752
|
Partial derivative of bivariate normal cdf and pdf
|
While the accepted answer provides great tips for somebody looking to re-derive these quantities, for some work I was doing I actually just needed to know the closed-form partial derivatives of the bivariate normal cdf. Further, the integral for the partial with respect to $\rho$ is non-trivial. Since my google search brought me here (and then down a rabbit hole of statistics papers from decades ago), I thought I'd share my findings for the rest of the internet community:
\begin{align*}
\frac{\partial}{\partial x_1} \Phi(x_1, x_2, \rho) &= \phi(x_1)\Phi\bigg(\frac{x_2-\rho x_1}{\sqrt{1-\rho^2}}\bigg), \\
\frac{\partial}{\partial x_2} \Phi(x_1, x_2, \rho) &= \phi(x_2)\Phi\bigg(\frac{x_1-\rho x_2}{\sqrt{1-\rho^2}}\bigg),~\text{and} \\
\frac{\partial}{\partial \rho} \Phi(x_1, x_2, \rho) &= \frac{1}{2\pi\sqrt{1-\rho^2}}\exp\bigg\{\frac{-(x_1^2-2\rho x_1x_2+x_2^2)}{2(1-\rho^2)}\bigg\}.
\end{align*}
Here, $\phi(\cdot)$ and $\Phi(\cdot)$ are the standard normal pdf and cdf, respectively. The literature reference for the partial with respect to $\rho$ is:
Z. Drezner and G.O. Wesolowsky (1990). On the computation of the
bivariate normal integral. Journal of Statistical Computation
and Simulation 35 (1-2): 101-107. Equation (4).
|
Partial derivative of bivariate normal cdf and pdf
|
While the accepted answer provides great tips for somebody looking to re-derive these quantities, for some work I was doing I actually just needed to know the closed-form partial derivatives of the bi
|
Partial derivative of bivariate normal cdf and pdf
While the accepted answer provides great tips for somebody looking to re-derive these quantities, for some work I was doing I actually just needed to know the closed-form partial derivatives of the bivariate normal cdf. Further, the integral for the partial with respect to $\rho$ is non-trivial. Since my google search brought me here (and then down a rabbit hole of statistics papers from decades ago), I thought I'd share my findings for the rest of the internet community:
\begin{align*}
\frac{\partial}{\partial x_1} \Phi(x_1, x_2, \rho) &= \phi(x_1)\Phi\bigg(\frac{x_2-\rho x_1}{\sqrt{1-\rho^2}}\bigg), \\
\frac{\partial}{\partial x_2} \Phi(x_1, x_2, \rho) &= \phi(x_2)\Phi\bigg(\frac{x_1-\rho x_2}{\sqrt{1-\rho^2}}\bigg),~\text{and} \\
\frac{\partial}{\partial \rho} \Phi(x_1, x_2, \rho) &= \frac{1}{2\pi\sqrt{1-\rho^2}}\exp\bigg\{\frac{-(x_1^2-2\rho x_1x_2+x_2^2)}{2(1-\rho^2)}\bigg\}.
\end{align*}
Here, $\phi(\cdot)$ and $\Phi(\cdot)$ are the standard normal pdf and cdf, respectively. The literature reference for the partial with respect to $\rho$ is:
Z. Drezner and G.O. Wesolowsky (1990). On the computation of the
bivariate normal integral. Journal of Statistical Computation
and Simulation 35 (1-2): 101-107. Equation (4).
|
Partial derivative of bivariate normal cdf and pdf
While the accepted answer provides great tips for somebody looking to re-derive these quantities, for some work I was doing I actually just needed to know the closed-form partial derivatives of the bi
|
39,753
|
Why are Bayesian methods widely considered particularly "convenient"?
|
In my personal opinion I think that Bayesian methods are extremely convenient in that you need to specify only four main ingredients for solving problems of inference, prediction, and decision making.
These questions encompass almost all of the discipline of statistics: describing a data set $D$, generalizing outward inferentially from $D$, predicting new data $D^*$, and helping people make decisions in the presence of uncertainty.
Given the set $\mathcal{B}$, of propositions summarizing your background
assumptions and judgments about how the world works as far as $\theta$,
$D$ and future data $D^*$ are concerned:
(a) It's natural (and indeed you must be prepared as a Bayesian) to
specify two conditional probability distributions:
$p(\theta|\mathcal{B})$, to quantify all information about external to $D$ that You
judge relevant; and
$p(D|\theta,\mathcal{B})$, to quantify your predictive uncertainty, given $\theta$, about
the data set $D$ before it's arrived.
(b) Given the distributions in (a), the distribution $p(\theta|D,\mathcal{B})$ quantifies
all relevant information about $\theta$, both internal and external to $D$,
and must be computed via Bayes's Theorem:
$$p(\theta|D,\mathcal{B})=c\times p(D|\theta,\mathcal{B})p(\theta|\mathcal{B})\hspace{.75cm}\text{(inference)}$$
where $c > 0$ is a normalizing constant chosen so that the left-hand
side of of the above equation integrates (or sums) over $\Theta$ to 1.
(c) Your predictive distribution $p(D^*|\theta,D,\mathcal{B})$ for future data $D^*$ given the observed data set $D$ must be expressible as follows:
$$p(D^*|D,\mathcal{B})=\int_{\Theta}p(D^*|\theta,D,\mathcal{B})p(\theta|D,\mathcal{B})d\theta$$
often there's no information about $D^*$ contained in $D$ if is known, in which case this expression simplifies to
$$p(D^*|\mathcal{B})=\int_{\Theta}p(D^*|\theta,D,\mathcal{B})p(\theta|D,\mathcal{B})d\theta\hspace{.75cm}\text{(prediction)}$$
(d) to make a sensible decision about which action $a$ you should take in
the face of your uncertainty about $\theta$, however, you must be prepared to specify
(i) the set $\mathcal{A}$ of feasible actions among which you're choosing, and
(ii) a utility function $U(a,\theta)$, taking values on $\mathbb{R}$ and quantifying your
judgments about the rewards (monetary or otherwise) that would
ensue if you chose action $a$ and the unknown actually took the value $\theta$ (without loss of generality you can take large values of $U(a,\theta$) to be better than small values) then the optimal decision is to choose the action $a$ that maximizes the expectation of $U(a,\theta)$ over $p(\theta|D,\mathcal{B})$, i.e.,
$$a=\arg\max_{a\in\mathcal{A}}\mathbb{E}_{(\theta|D,\mathcal{B})}U(a,\theta)=\arg\max_{a\in\mathcal{A}}\int_{\Theta}U(a,\theta)p(\theta|D,\mathcal{B})d\theta\hspace{.75cm}\text{(decision making)}$$
And thus, there is a very simple and straight forward framework for conducting statistical analysis under the Bayesian framework. Once again, all you need to specify are the following four ingredients: $p(\theta|\mathcal{B}),p(D|\theta,\mathcal{B})$,the possible actions $a$, and the utility function $U(a,\theta)$.
Now as convenient as that is, there is no complete guidance under the Bayesian framework that actually tells you how to spefficy those four ingredients and this is actually the subjective and hard part from the Bayesian point of view. The true convenience of the Bayesian framework comes from the fact that if you are prepared to specify those four ingredients, then there is a clear routine for conducting most all of statistical reasoning. Once again though this is just my opinion.
|
Why are Bayesian methods widely considered particularly "convenient"?
|
In my personal opinion I think that Bayesian methods are extremely convenient in that you need to specify only four main ingredients for solving problems of inference, prediction, and decision making.
|
Why are Bayesian methods widely considered particularly "convenient"?
In my personal opinion I think that Bayesian methods are extremely convenient in that you need to specify only four main ingredients for solving problems of inference, prediction, and decision making.
These questions encompass almost all of the discipline of statistics: describing a data set $D$, generalizing outward inferentially from $D$, predicting new data $D^*$, and helping people make decisions in the presence of uncertainty.
Given the set $\mathcal{B}$, of propositions summarizing your background
assumptions and judgments about how the world works as far as $\theta$,
$D$ and future data $D^*$ are concerned:
(a) It's natural (and indeed you must be prepared as a Bayesian) to
specify two conditional probability distributions:
$p(\theta|\mathcal{B})$, to quantify all information about external to $D$ that You
judge relevant; and
$p(D|\theta,\mathcal{B})$, to quantify your predictive uncertainty, given $\theta$, about
the data set $D$ before it's arrived.
(b) Given the distributions in (a), the distribution $p(\theta|D,\mathcal{B})$ quantifies
all relevant information about $\theta$, both internal and external to $D$,
and must be computed via Bayes's Theorem:
$$p(\theta|D,\mathcal{B})=c\times p(D|\theta,\mathcal{B})p(\theta|\mathcal{B})\hspace{.75cm}\text{(inference)}$$
where $c > 0$ is a normalizing constant chosen so that the left-hand
side of of the above equation integrates (or sums) over $\Theta$ to 1.
(c) Your predictive distribution $p(D^*|\theta,D,\mathcal{B})$ for future data $D^*$ given the observed data set $D$ must be expressible as follows:
$$p(D^*|D,\mathcal{B})=\int_{\Theta}p(D^*|\theta,D,\mathcal{B})p(\theta|D,\mathcal{B})d\theta$$
often there's no information about $D^*$ contained in $D$ if is known, in which case this expression simplifies to
$$p(D^*|\mathcal{B})=\int_{\Theta}p(D^*|\theta,D,\mathcal{B})p(\theta|D,\mathcal{B})d\theta\hspace{.75cm}\text{(prediction)}$$
(d) to make a sensible decision about which action $a$ you should take in
the face of your uncertainty about $\theta$, however, you must be prepared to specify
(i) the set $\mathcal{A}$ of feasible actions among which you're choosing, and
(ii) a utility function $U(a,\theta)$, taking values on $\mathbb{R}$ and quantifying your
judgments about the rewards (monetary or otherwise) that would
ensue if you chose action $a$ and the unknown actually took the value $\theta$ (without loss of generality you can take large values of $U(a,\theta$) to be better than small values) then the optimal decision is to choose the action $a$ that maximizes the expectation of $U(a,\theta)$ over $p(\theta|D,\mathcal{B})$, i.e.,
$$a=\arg\max_{a\in\mathcal{A}}\mathbb{E}_{(\theta|D,\mathcal{B})}U(a,\theta)=\arg\max_{a\in\mathcal{A}}\int_{\Theta}U(a,\theta)p(\theta|D,\mathcal{B})d\theta\hspace{.75cm}\text{(decision making)}$$
And thus, there is a very simple and straight forward framework for conducting statistical analysis under the Bayesian framework. Once again, all you need to specify are the following four ingredients: $p(\theta|\mathcal{B}),p(D|\theta,\mathcal{B})$,the possible actions $a$, and the utility function $U(a,\theta)$.
Now as convenient as that is, there is no complete guidance under the Bayesian framework that actually tells you how to spefficy those four ingredients and this is actually the subjective and hard part from the Bayesian point of view. The true convenience of the Bayesian framework comes from the fact that if you are prepared to specify those four ingredients, then there is a clear routine for conducting most all of statistical reasoning. Once again though this is just my opinion.
|
Why are Bayesian methods widely considered particularly "convenient"?
In my personal opinion I think that Bayesian methods are extremely convenient in that you need to specify only four main ingredients for solving problems of inference, prediction, and decision making.
|
39,754
|
Why are Bayesian methods widely considered particularly "convenient"?
|
Reasons why I think they're convenient, working in a field that's still somewhat dominated by frequentist statistics, but where a "Bayesian" analysis carry some cachet:
Credible intervals are awesome, in that they can be interpreted the way people really want to interpret confidence intervals from frequentist analysis. This is generally a benefit of Bayesian methods, they're easier to translate into "plain English" statements.
By "Bayesian" sometimes people mean "MCMC". It's pretty easy to argue that this is incorrect, but a "Bayesian" analysis using MCMC and uninformative priors can occasionally plow through computational problems that likelihood based methods will struggle with.
A properly done analysis with a very carefully considered set of priors can already set the stage for "How this finding changes the field's understanding of $TOPIC" with no additional input of effort.
That being said, I don't know that I'd actually consider them more convenient than conventional frequentist statistics from an analysis/coding point of view, though well written packages, and things like the BAYES statement in SAS help a great deal.
|
Why are Bayesian methods widely considered particularly "convenient"?
|
Reasons why I think they're convenient, working in a field that's still somewhat dominated by frequentist statistics, but where a "Bayesian" analysis carry some cachet:
Credible intervals are awesome
|
Why are Bayesian methods widely considered particularly "convenient"?
Reasons why I think they're convenient, working in a field that's still somewhat dominated by frequentist statistics, but where a "Bayesian" analysis carry some cachet:
Credible intervals are awesome, in that they can be interpreted the way people really want to interpret confidence intervals from frequentist analysis. This is generally a benefit of Bayesian methods, they're easier to translate into "plain English" statements.
By "Bayesian" sometimes people mean "MCMC". It's pretty easy to argue that this is incorrect, but a "Bayesian" analysis using MCMC and uninformative priors can occasionally plow through computational problems that likelihood based methods will struggle with.
A properly done analysis with a very carefully considered set of priors can already set the stage for "How this finding changes the field's understanding of $TOPIC" with no additional input of effort.
That being said, I don't know that I'd actually consider them more convenient than conventional frequentist statistics from an analysis/coding point of view, though well written packages, and things like the BAYES statement in SAS help a great deal.
|
Why are Bayesian methods widely considered particularly "convenient"?
Reasons why I think they're convenient, working in a field that's still somewhat dominated by frequentist statistics, but where a "Bayesian" analysis carry some cachet:
Credible intervals are awesome
|
39,755
|
Why are Bayesian methods widely considered particularly "convenient"?
|
I'm just a rookie in all of this, but it seems to me that the Bayesian "Prior * Likelihood = Posterior" model is simple and flexible, which means "convenient".
For example, your priors are explicitly stated and your procedure does not change because you choose different priors. I could look at your analysis and decide that different priors seem more realistic and could otherwise use the same procedure as you. I may be oversimplifying here, but my feeling about frequentist methods is that they tend to have implicit prior-like assumptions and you choose your method based on what assumptions you accept.
Priors can easily be used to keep your posteriors away from awkward boundary conditions (negative values for counts, for example). The Bayesian procedure is also naturally iterative and mirrors the scientific process: the results of prior experiments/theory become your priors, and the posteriors of your experiment naturally become priors for further experimentation.
Posteriors are convenient because they are not points or even intervals, but rather distributions. This makes it convenient to do various things without complicated follow-on analysis. For example, if you want to determine if two parameters are equal, you can simply look at the differences of their posterior samples, take appropriate quantiles, and decide whether they are equal (difference near zero) or not.
A frequentist test can reject or fail to reject the null. A Bayesian analysis has three possibilities: accept, reject, and not-enough-information. It's convenient when you can actually accept a hypothesis rather than failing to reject it.
As EpiGrad says, Credible Intervals match human intuition and actually answer the question that most of us have. They're simple to calculate and don't require a model to do so: for a 95% CI you take the 0.025 and 0.975 quantiles of your posterior. Simple.
As EpiGrad also says, some people may be confusing MCMC and Bayesian methods, since real-world Bayesina analysis will almost always be MCMC-based. MCMC is a nice, generic black-box procedure, which is convenient -- you could live your whole Bayesian life in BUGS, JAGS, or Stan. Convenient. Though, of course, there can be a lot of tuning and analyzing involved in determining that the MCMC procedure ha actually converged and actually explores the entire density. Which might be the dark underbelly of Bayesian statistics.
|
Why are Bayesian methods widely considered particularly "convenient"?
|
I'm just a rookie in all of this, but it seems to me that the Bayesian "Prior * Likelihood = Posterior" model is simple and flexible, which means "convenient".
For example, your priors are explicitly
|
Why are Bayesian methods widely considered particularly "convenient"?
I'm just a rookie in all of this, but it seems to me that the Bayesian "Prior * Likelihood = Posterior" model is simple and flexible, which means "convenient".
For example, your priors are explicitly stated and your procedure does not change because you choose different priors. I could look at your analysis and decide that different priors seem more realistic and could otherwise use the same procedure as you. I may be oversimplifying here, but my feeling about frequentist methods is that they tend to have implicit prior-like assumptions and you choose your method based on what assumptions you accept.
Priors can easily be used to keep your posteriors away from awkward boundary conditions (negative values for counts, for example). The Bayesian procedure is also naturally iterative and mirrors the scientific process: the results of prior experiments/theory become your priors, and the posteriors of your experiment naturally become priors for further experimentation.
Posteriors are convenient because they are not points or even intervals, but rather distributions. This makes it convenient to do various things without complicated follow-on analysis. For example, if you want to determine if two parameters are equal, you can simply look at the differences of their posterior samples, take appropriate quantiles, and decide whether they are equal (difference near zero) or not.
A frequentist test can reject or fail to reject the null. A Bayesian analysis has three possibilities: accept, reject, and not-enough-information. It's convenient when you can actually accept a hypothesis rather than failing to reject it.
As EpiGrad says, Credible Intervals match human intuition and actually answer the question that most of us have. They're simple to calculate and don't require a model to do so: for a 95% CI you take the 0.025 and 0.975 quantiles of your posterior. Simple.
As EpiGrad also says, some people may be confusing MCMC and Bayesian methods, since real-world Bayesina analysis will almost always be MCMC-based. MCMC is a nice, generic black-box procedure, which is convenient -- you could live your whole Bayesian life in BUGS, JAGS, or Stan. Convenient. Though, of course, there can be a lot of tuning and analyzing involved in determining that the MCMC procedure ha actually converged and actually explores the entire density. Which might be the dark underbelly of Bayesian statistics.
|
Why are Bayesian methods widely considered particularly "convenient"?
I'm just a rookie in all of this, but it seems to me that the Bayesian "Prior * Likelihood = Posterior" model is simple and flexible, which means "convenient".
For example, your priors are explicitly
|
39,756
|
Unpaired repeated measures data
|
A simple two-sample t-test would actually be a conservative way of testing for time differences here.
Let's say that $t_{paired}$ is the t-statistic that you would get from a paired t-test on your data, if you knew the pairings, whereas $t_{unpaired}$ is the t-statistic you get from a simple two-group t-test on the data. These two t-statistics have the following relationship:
$$
t_{paired} = \frac{t_{unpaired}}{\sqrt{1-r}}
$$
where $r$ is the correlation between the time 1 scores and the time 2 scores, which you can't estimate because you don't know the pairings in the data.
$t_{paired} = t_{unpaired}$ when and only when $r = 0$. But notice that this is also exactly the condition where $t_{paired}$ takes its minimum value$^1$. As $r$ increases, $t_{paired}$ becomes larger and larger compared to $t_{unpaired}$.
So if you just report the two-sample t-test, essentially assuming that $r = 0$, then what you are really doing is reporting a lower bound on the correct $t_{paired}$. If you have a significant difference according to the two-sample t-test, then the paired t-test would definitely also show a significant difference if you could compute it. But if there is not a significant difference according to the two-sample t-test, it is still possible that the difference would be significant if you could compute the paired t-test.
$^1$ Technically, theoretically, $r$ could go down to as low as -1 and this would actually be the minimum value of the function across the range of $r$. And when $r<0$, the paired $t$-test is actually less powerful than the unpaired $t$-test. However, in real life it would be unlikely (without further info about the specific context) for the time1 and time2 scores to have a negative correlation. It is even unlikely for the correlation to be 0. There is most likely a modest positive correlation.
|
Unpaired repeated measures data
|
A simple two-sample t-test would actually be a conservative way of testing for time differences here.
Let's say that $t_{paired}$ is the t-statistic that you would get from a paired t-test on your dat
|
Unpaired repeated measures data
A simple two-sample t-test would actually be a conservative way of testing for time differences here.
Let's say that $t_{paired}$ is the t-statistic that you would get from a paired t-test on your data, if you knew the pairings, whereas $t_{unpaired}$ is the t-statistic you get from a simple two-group t-test on the data. These two t-statistics have the following relationship:
$$
t_{paired} = \frac{t_{unpaired}}{\sqrt{1-r}}
$$
where $r$ is the correlation between the time 1 scores and the time 2 scores, which you can't estimate because you don't know the pairings in the data.
$t_{paired} = t_{unpaired}$ when and only when $r = 0$. But notice that this is also exactly the condition where $t_{paired}$ takes its minimum value$^1$. As $r$ increases, $t_{paired}$ becomes larger and larger compared to $t_{unpaired}$.
So if you just report the two-sample t-test, essentially assuming that $r = 0$, then what you are really doing is reporting a lower bound on the correct $t_{paired}$. If you have a significant difference according to the two-sample t-test, then the paired t-test would definitely also show a significant difference if you could compute it. But if there is not a significant difference according to the two-sample t-test, it is still possible that the difference would be significant if you could compute the paired t-test.
$^1$ Technically, theoretically, $r$ could go down to as low as -1 and this would actually be the minimum value of the function across the range of $r$. And when $r<0$, the paired $t$-test is actually less powerful than the unpaired $t$-test. However, in real life it would be unlikely (without further info about the specific context) for the time1 and time2 scores to have a negative correlation. It is even unlikely for the correlation to be 0. There is most likely a modest positive correlation.
|
Unpaired repeated measures data
A simple two-sample t-test would actually be a conservative way of testing for time differences here.
Let's say that $t_{paired}$ is the t-statistic that you would get from a paired t-test on your dat
|
39,757
|
Statistics, Expected values and Philosophy
|
I think the answer to your question is best answered by focusing on what it is, precisely, that you want to know.
You're correct that the typist's average words-per-minute is only a meaningful inference on that particular typist. But measuring the typist's performance at many intervals will, hopefully, randomly mix in those other states and therefore average over them. The mean value can be seen as the weighted average of all of these different states. If you wanted, you could construct a model to incorporate other explanatory information which might improve or degrade the typist's abilities -- headaches, poor sleep, etc. But this is probably only necessary if you need to measure the importance or effect size of some circumstances on the typist.
If you're interested in inferences across the universe of typists, you would clearly have to collect information on more than that one typist. Using a large random sample the typing pool, you could describe the rate of the typical typist, their dispersion, etc. Even though their rate is likely a complicated function of biological, physical and environmental factors, and therefore deterministic rather than stochastic, if we are not interested in those features, and we believe that our random sample is representative of these characteristics, our inferences will effectively "average over" these characteristics. Likewise, if some typists have hands tied behind their backs, then random sampling will capture this phenomenon and reflect it in whatever statistics you computed using that random sample.
If our research is instead concerned with the covariates of typing, then it would be essential to collect information on the typists' condition -- maybe their headache status, whether they have arthritis, their age, etc.
I hope that this provides the context to understand the logic underlying statistics and addressed the questions you've raised. Let me know if you would like further elaboration, and welcome to Cross Validated.
|
Statistics, Expected values and Philosophy
|
I think the answer to your question is best answered by focusing on what it is, precisely, that you want to know.
You're correct that the typist's average words-per-minute is only a meaningful inferen
|
Statistics, Expected values and Philosophy
I think the answer to your question is best answered by focusing on what it is, precisely, that you want to know.
You're correct that the typist's average words-per-minute is only a meaningful inference on that particular typist. But measuring the typist's performance at many intervals will, hopefully, randomly mix in those other states and therefore average over them. The mean value can be seen as the weighted average of all of these different states. If you wanted, you could construct a model to incorporate other explanatory information which might improve or degrade the typist's abilities -- headaches, poor sleep, etc. But this is probably only necessary if you need to measure the importance or effect size of some circumstances on the typist.
If you're interested in inferences across the universe of typists, you would clearly have to collect information on more than that one typist. Using a large random sample the typing pool, you could describe the rate of the typical typist, their dispersion, etc. Even though their rate is likely a complicated function of biological, physical and environmental factors, and therefore deterministic rather than stochastic, if we are not interested in those features, and we believe that our random sample is representative of these characteristics, our inferences will effectively "average over" these characteristics. Likewise, if some typists have hands tied behind their backs, then random sampling will capture this phenomenon and reflect it in whatever statistics you computed using that random sample.
If our research is instead concerned with the covariates of typing, then it would be essential to collect information on the typists' condition -- maybe their headache status, whether they have arthritis, their age, etc.
I hope that this provides the context to understand the logic underlying statistics and addressed the questions you've raised. Let me know if you would like further elaboration, and welcome to Cross Validated.
|
Statistics, Expected values and Philosophy
I think the answer to your question is best answered by focusing on what it is, precisely, that you want to know.
You're correct that the typist's average words-per-minute is only a meaningful inferen
|
39,758
|
Statistics, Expected values and Philosophy
|
DJE gave a great answer, but I would just add some clarification about which states we can and can't accept.
When you measure the typist's speed, you are really measuring the marginal expected value. For simplicity, let's consider the typist's speed to be in one of two states (fast =1, slow=0) and say we are trying to estimate the probability that this is a fast typist.
So, when you measure the speed over several time points and average these, you are estimating Pr(fast). But by selecting time points at random, you are estimating this via the contributions to the marginal probability by the probability that the typist is fast given those states that occur for the typist: Pr(fast) = Pr(fast|headache)Pr(headache) + Pr(fast|tired)Pr(tired) + Pr(fast|hungry)Pr(hungry) + Pr(fast|deadline)Pr(deadline)+... etc.
If you select your time points randomly, then the states that occur in your dataset should be representative of the distribution of states that occur in the population of this typist's time. Very rare states may be missed, but unless they have a large effect on typing speed this will not cause much bias. If your typist ever spends time with her hand tied behind her back while typing, then Pr(hand tied) >0 and it will be represented in your data with probability = Pr(hand tied). The reason we don't accept 'having one hand tied behind the typist's back' as a state is because this is not a normal variation in the typist's state - i.e. we believe that Pr(hand tied) = 0. Similarly, if Pr(typist A = typist B) = 0, then we don't accept switching typists as a state to which our marginal probability applies.
|
Statistics, Expected values and Philosophy
|
DJE gave a great answer, but I would just add some clarification about which states we can and can't accept.
When you measure the typist's speed, you are really measuring the marginal expected value.
|
Statistics, Expected values and Philosophy
DJE gave a great answer, but I would just add some clarification about which states we can and can't accept.
When you measure the typist's speed, you are really measuring the marginal expected value. For simplicity, let's consider the typist's speed to be in one of two states (fast =1, slow=0) and say we are trying to estimate the probability that this is a fast typist.
So, when you measure the speed over several time points and average these, you are estimating Pr(fast). But by selecting time points at random, you are estimating this via the contributions to the marginal probability by the probability that the typist is fast given those states that occur for the typist: Pr(fast) = Pr(fast|headache)Pr(headache) + Pr(fast|tired)Pr(tired) + Pr(fast|hungry)Pr(hungry) + Pr(fast|deadline)Pr(deadline)+... etc.
If you select your time points randomly, then the states that occur in your dataset should be representative of the distribution of states that occur in the population of this typist's time. Very rare states may be missed, but unless they have a large effect on typing speed this will not cause much bias. If your typist ever spends time with her hand tied behind her back while typing, then Pr(hand tied) >0 and it will be represented in your data with probability = Pr(hand tied). The reason we don't accept 'having one hand tied behind the typist's back' as a state is because this is not a normal variation in the typist's state - i.e. we believe that Pr(hand tied) = 0. Similarly, if Pr(typist A = typist B) = 0, then we don't accept switching typists as a state to which our marginal probability applies.
|
Statistics, Expected values and Philosophy
DJE gave a great answer, but I would just add some clarification about which states we can and can't accept.
When you measure the typist's speed, you are really measuring the marginal expected value.
|
39,759
|
Statistics, Expected values and Philosophy
|
This question hinges on the probabilistic concept of exchangeability. Consider an experiment that generates a series of outcomes $X_1, X_2, X_3,...$ and suppose that we have "stable conditions", by which we mean that the conditions of the experiment are sufficiently similar in essentials from trial to trial that we are confident that the order of the outcomes is not informative. This "stability" in the experiment is captured by the notion of exchangeability of the sequence of outcomes. Indeed, we can reasonably define "stable conditions" in an experiment as being conditions that we believe lead to exchangeability of the outcomes.
Parametric estimation in an experiment can be understood operationally as follows. If we have an experiment that can generate a (hypothetically infinite) sequence of outcomes $X_1, X_2, X_3,...$ then we can define the parametric mean:
$$\mu \equiv \lim_{n \rightarrow \infty} \frac{1}{n} \sum_{i=1}^n X_i.$$
Under the condition of exchangeability, it can be shown that $\mathbb{E}(X_i) = \mu$ for every outcome in the sequence. Philosophically, this is operational result for an infinite sequence is the justification for considering this "parameter" at all. That is, the "parameter" is only a thing if we assume that there is some infinite sequence of values from which it is operationally defined. From the common mean that arises under exchangeability, the sample mean $\bar{X}_n = \sum_{i=1}^n X_i / n$ is a reasonable estimator of $\mu$ that is unbiased and strongly consistent.
Now, if we change the conditions of the experiment (e.g., by changing the typist, or changing the conditions under which the original typist operates) then we can no longer say that the combined outcomes of those two experiments are exchangeable outcomes. Hence, we can no longer appeal to the common mean for an exchangeable sequence of random variables, and we no longer have any reason to believe that the sample mean from one experiment will act as a reasonable estimator of the parametric mean of another. In this case we now effectively have two separate sequences of outcomes, which might be individually exchangeable (if each has stable conditions in its own right), but which are not exchangeable when fused together.
Understanding the philosophical basis for this issue requires a deep familiarity with the IID model derived from an exchangeable sequence. In this regard, I strongly recommend reading up on exchangeability, and operational models of parameters (see e.g., Bernardo 1996).
|
Statistics, Expected values and Philosophy
|
This question hinges on the probabilistic concept of exchangeability. Consider an experiment that generates a series of outcomes $X_1, X_2, X_3,...$ and suppose that we have "stable conditions", by w
|
Statistics, Expected values and Philosophy
This question hinges on the probabilistic concept of exchangeability. Consider an experiment that generates a series of outcomes $X_1, X_2, X_3,...$ and suppose that we have "stable conditions", by which we mean that the conditions of the experiment are sufficiently similar in essentials from trial to trial that we are confident that the order of the outcomes is not informative. This "stability" in the experiment is captured by the notion of exchangeability of the sequence of outcomes. Indeed, we can reasonably define "stable conditions" in an experiment as being conditions that we believe lead to exchangeability of the outcomes.
Parametric estimation in an experiment can be understood operationally as follows. If we have an experiment that can generate a (hypothetically infinite) sequence of outcomes $X_1, X_2, X_3,...$ then we can define the parametric mean:
$$\mu \equiv \lim_{n \rightarrow \infty} \frac{1}{n} \sum_{i=1}^n X_i.$$
Under the condition of exchangeability, it can be shown that $\mathbb{E}(X_i) = \mu$ for every outcome in the sequence. Philosophically, this is operational result for an infinite sequence is the justification for considering this "parameter" at all. That is, the "parameter" is only a thing if we assume that there is some infinite sequence of values from which it is operationally defined. From the common mean that arises under exchangeability, the sample mean $\bar{X}_n = \sum_{i=1}^n X_i / n$ is a reasonable estimator of $\mu$ that is unbiased and strongly consistent.
Now, if we change the conditions of the experiment (e.g., by changing the typist, or changing the conditions under which the original typist operates) then we can no longer say that the combined outcomes of those two experiments are exchangeable outcomes. Hence, we can no longer appeal to the common mean for an exchangeable sequence of random variables, and we no longer have any reason to believe that the sample mean from one experiment will act as a reasonable estimator of the parametric mean of another. In this case we now effectively have two separate sequences of outcomes, which might be individually exchangeable (if each has stable conditions in its own right), but which are not exchangeable when fused together.
Understanding the philosophical basis for this issue requires a deep familiarity with the IID model derived from an exchangeable sequence. In this regard, I strongly recommend reading up on exchangeability, and operational models of parameters (see e.g., Bernardo 1996).
|
Statistics, Expected values and Philosophy
This question hinges on the probabilistic concept of exchangeability. Consider an experiment that generates a series of outcomes $X_1, X_2, X_3,...$ and suppose that we have "stable conditions", by w
|
39,760
|
Statistics, Expected values and Philosophy
|
If you consider x to be constant, well the expected value will be x.
If you want to look at the evolution of x you cannot make the hypothesis that x is constant.
My approach would be different.
Suppose now that your x is evolving over time, you have a time series.
To guess the expected value you can build a model. This model should include:
A trend: x will grow as the typist learns how to type, will decrease as the typist gets older.
Periodical effects: Annually as motivation come and go with the weather, Monthly as motivation come and come with the pay, daily as the typist can feel fatigue.
And some high variation: sickness if you look at days, loss of attention if you look at hour, typo if you look at minutes.
As you can see, taking a mean as an estimator of the future is not enough. You have to build a good estimator. This could be complex as I probably forget some effects (fear of the blank page, a publication to finish ... ) and as it will need lots of x measures.
So we can come back to your solution.
Suppose the trend is slow.
Choose a period wich will keep the periodical effects you need and avoid the others.
Build a model for other effects. A simple one can just take the probability of being affected and the loss of speed.
You can take the mean on the period mentioned above, and adjust for other effects to have a good estimation of the expected value.
|
Statistics, Expected values and Philosophy
|
If you consider x to be constant, well the expected value will be x.
If you want to look at the evolution of x you cannot make the hypothesis that x is constant.
My approach would be different.
Suppo
|
Statistics, Expected values and Philosophy
If you consider x to be constant, well the expected value will be x.
If you want to look at the evolution of x you cannot make the hypothesis that x is constant.
My approach would be different.
Suppose now that your x is evolving over time, you have a time series.
To guess the expected value you can build a model. This model should include:
A trend: x will grow as the typist learns how to type, will decrease as the typist gets older.
Periodical effects: Annually as motivation come and go with the weather, Monthly as motivation come and come with the pay, daily as the typist can feel fatigue.
And some high variation: sickness if you look at days, loss of attention if you look at hour, typo if you look at minutes.
As you can see, taking a mean as an estimator of the future is not enough. You have to build a good estimator. This could be complex as I probably forget some effects (fear of the blank page, a publication to finish ... ) and as it will need lots of x measures.
So we can come back to your solution.
Suppose the trend is slow.
Choose a period wich will keep the periodical effects you need and avoid the others.
Build a model for other effects. A simple one can just take the probability of being affected and the loss of speed.
You can take the mean on the period mentioned above, and adjust for other effects to have a good estimation of the expected value.
|
Statistics, Expected values and Philosophy
If you consider x to be constant, well the expected value will be x.
If you want to look at the evolution of x you cannot make the hypothesis that x is constant.
My approach would be different.
Suppo
|
39,761
|
Statistics, Expected values and Philosophy
|
When we say "the typist A types $\mu$ words a minute", we mean the typist A in all his/her different (but normal) states. It means, to evaluate the mean $\mu$ you need to measure his/her performance during several regular working days. No typist works with the hand tied behind her/his back. This is not part of their job description. The higher is the variability of the mean from one day to another, the longer you need to observe the typist to evaluate the $\mu$. Eventually, the values of $\mu$ will converge: additional observations will not change $\mu$ much, and will not be necessary. This is the law of larger numbers!
|
Statistics, Expected values and Philosophy
|
When we say "the typist A types $\mu$ words a minute", we mean the typist A in all his/her different (but normal) states. It means, to evaluate the mean $\mu$ you need to measure his/her performance d
|
Statistics, Expected values and Philosophy
When we say "the typist A types $\mu$ words a minute", we mean the typist A in all his/her different (but normal) states. It means, to evaluate the mean $\mu$ you need to measure his/her performance during several regular working days. No typist works with the hand tied behind her/his back. This is not part of their job description. The higher is the variability of the mean from one day to another, the longer you need to observe the typist to evaluate the $\mu$. Eventually, the values of $\mu$ will converge: additional observations will not change $\mu$ much, and will not be necessary. This is the law of larger numbers!
|
Statistics, Expected values and Philosophy
When we say "the typist A types $\mu$ words a minute", we mean the typist A in all his/her different (but normal) states. It means, to evaluate the mean $\mu$ you need to measure his/her performance d
|
39,762
|
Account for spatial autocorrelation with a binomial regression model
|
If you are happy to assume your binomial responses are coming from a spatially correlated gaussian random field via a logit link, and your non-spatial covariates have the usual log-linear form, then stuff it all into geoRglm:
http://cran.r-project.org/web/packages/geoRglm/vignettes/geoRglmintro.pdf
and once you've got your MCMC all tuned, out pops the parameter estimates.
|
Account for spatial autocorrelation with a binomial regression model
|
If you are happy to assume your binomial responses are coming from a spatially correlated gaussian random field via a logit link, and your non-spatial covariates have the usual log-linear form, then s
|
Account for spatial autocorrelation with a binomial regression model
If you are happy to assume your binomial responses are coming from a spatially correlated gaussian random field via a logit link, and your non-spatial covariates have the usual log-linear form, then stuff it all into geoRglm:
http://cran.r-project.org/web/packages/geoRglm/vignettes/geoRglmintro.pdf
and once you've got your MCMC all tuned, out pops the parameter estimates.
|
Account for spatial autocorrelation with a binomial regression model
If you are happy to assume your binomial responses are coming from a spatially correlated gaussian random field via a logit link, and your non-spatial covariates have the usual log-linear form, then s
|
39,763
|
Account for spatial autocorrelation with a binomial regression model
|
It sounds to me like x, y are potential independent variables in your model. The issue is that the binomial regression model you mention assumes that the independent variables are not correlated. Some people add interaction terms to their model to deal with this, but a lot of model interpretability is lost when you do this.
You have several options for your classification problem. You could use for example k-means clustering. You can find a nice cheat sheet for classification methods in R here.
|
Account for spatial autocorrelation with a binomial regression model
|
It sounds to me like x, y are potential independent variables in your model. The issue is that the binomial regression model you mention assumes that the independent variables are not correlated. Some
|
Account for spatial autocorrelation with a binomial regression model
It sounds to me like x, y are potential independent variables in your model. The issue is that the binomial regression model you mention assumes that the independent variables are not correlated. Some people add interaction terms to their model to deal with this, but a lot of model interpretability is lost when you do this.
You have several options for your classification problem. You could use for example k-means clustering. You can find a nice cheat sheet for classification methods in R here.
|
Account for spatial autocorrelation with a binomial regression model
It sounds to me like x, y are potential independent variables in your model. The issue is that the binomial regression model you mention assumes that the independent variables are not correlated. Some
|
39,764
|
Account for spatial autocorrelation with a binomial regression model
|
I found this tutorial for the spdep package to be quite useful.
In the end, you would want to create spatial weights like this:
us.nb4 <- knearneigh(coordinates(data[,1:2]), k=4)
us.nb4 <- knn2nb(us.nb4)
us.nb4 <- make.sym.nb(us.nb4)
us.wt4 <- nb2listw(us.nb4, style="W")
... which you could use into a Moran eigenvector filtering function to remove spatial autocorrelation from the residuals of (generalised) linear models (if you see the tutorial it will make sense).
|
Account for spatial autocorrelation with a binomial regression model
|
I found this tutorial for the spdep package to be quite useful.
In the end, you would want to create spatial weights like this:
us.nb4 <- knearneigh(coordinates(data[,1:2]), k=4)
us.nb4 <- knn2nb(us.n
|
Account for spatial autocorrelation with a binomial regression model
I found this tutorial for the spdep package to be quite useful.
In the end, you would want to create spatial weights like this:
us.nb4 <- knearneigh(coordinates(data[,1:2]), k=4)
us.nb4 <- knn2nb(us.nb4)
us.nb4 <- make.sym.nb(us.nb4)
us.wt4 <- nb2listw(us.nb4, style="W")
... which you could use into a Moran eigenvector filtering function to remove spatial autocorrelation from the residuals of (generalised) linear models (if you see the tutorial it will make sense).
|
Account for spatial autocorrelation with a binomial regression model
I found this tutorial for the spdep package to be quite useful.
In the end, you would want to create spatial weights like this:
us.nb4 <- knearneigh(coordinates(data[,1:2]), k=4)
us.nb4 <- knn2nb(us.n
|
39,765
|
Plotting and presenting longitudinal data, options?
|
Here's one idea for visualizing your data. Using a variation of small multiples, you could have two charts: one showing the variables' mean with a focus on a variable of interest (including SE or SD), with the second showing the focused variables individual observations.
The following chart shows three variables across 6 time periods, with 50 observations each. The shaded area indicates the SE of the focus variable, which is highlighted similarly in both charts.
This could be easily scaled up or down based upon your specific needs. It can also be interactive, with a drop-down selection of a variable, and the focus and observations changing to the new item of interest.
EDIT: Here's another example, using your sample data. This shows the mean and SE (disregarding the NA's, since I don't know how you'll handle the calcs).
These were done in Excel, so I have no idea what the equivalent R code would be, but someone else here probably does. To create this chart, you'll have to nudge Excel into doing what you want. For the sample data you provided, I:
Added four calculated rows: Mean, SE, Mean-SE, and 2*SE
Create a line chart with all of your observations as series across your time periods. Format to your taste (it's probably worth some VBA to format everything at once, instead of individually selecting all 150 series). Format the rest of this chart to your preferences.
Copy the chart, and paste it onto the same worksheet.
Using the copy, delete all the series and add the Mean-SE and 2*SE series.
Convert the chart type from Line Chart to Stacked Area Chart.
Format the bottom series (Mean-SE) to No Fill. This should create the appearance of the 2*SE series floating.
Add the Mean Series, and convert it to a Line Chart Type. This will cause it to appear in front of the 2*SE area series.
Format the Chart Area and Plot Area to No Fill.
Using Page Layout > Align > Snap to Grid align the two charts with the second chart on top.
While this looks pretty convoluted, it only takes 10-15 minutes to complete, which if you're like me is much less than trying to learn R.
|
Plotting and presenting longitudinal data, options?
|
Here's one idea for visualizing your data. Using a variation of small multiples, you could have two charts: one showing the variables' mean with a focus on a variable of interest (including SE or SD)
|
Plotting and presenting longitudinal data, options?
Here's one idea for visualizing your data. Using a variation of small multiples, you could have two charts: one showing the variables' mean with a focus on a variable of interest (including SE or SD), with the second showing the focused variables individual observations.
The following chart shows three variables across 6 time periods, with 50 observations each. The shaded area indicates the SE of the focus variable, which is highlighted similarly in both charts.
This could be easily scaled up or down based upon your specific needs. It can also be interactive, with a drop-down selection of a variable, and the focus and observations changing to the new item of interest.
EDIT: Here's another example, using your sample data. This shows the mean and SE (disregarding the NA's, since I don't know how you'll handle the calcs).
These were done in Excel, so I have no idea what the equivalent R code would be, but someone else here probably does. To create this chart, you'll have to nudge Excel into doing what you want. For the sample data you provided, I:
Added four calculated rows: Mean, SE, Mean-SE, and 2*SE
Create a line chart with all of your observations as series across your time periods. Format to your taste (it's probably worth some VBA to format everything at once, instead of individually selecting all 150 series). Format the rest of this chart to your preferences.
Copy the chart, and paste it onto the same worksheet.
Using the copy, delete all the series and add the Mean-SE and 2*SE series.
Convert the chart type from Line Chart to Stacked Area Chart.
Format the bottom series (Mean-SE) to No Fill. This should create the appearance of the 2*SE series floating.
Add the Mean Series, and convert it to a Line Chart Type. This will cause it to appear in front of the 2*SE area series.
Format the Chart Area and Plot Area to No Fill.
Using Page Layout > Align > Snap to Grid align the two charts with the second chart on top.
While this looks pretty convoluted, it only takes 10-15 minutes to complete, which if you're like me is much less than trying to learn R.
|
Plotting and presenting longitudinal data, options?
Here's one idea for visualizing your data. Using a variation of small multiples, you could have two charts: one showing the variables' mean with a focus on a variable of interest (including SE or SD)
|
39,766
|
Plotting and presenting longitudinal data, options?
|
One often overlooked problem with plotting/analyzing summary (e.g. mean) curves is how to deal with Phase Variation. In an extreme example, one could plot the mean of 2 sin curves that are 180 degrees out of phase. This would of course be a straight line, which clearly doesn't reflect anything interesting about the individual curves (expect perhaps that they are out of phase).
Thinking in terms of a latent growth curve model, estimated variances of the random growth factors do nothing to account for phase variation, which is one reason why overall model fit for latent growth curve models is often poor (and usually not even assessed in hierarchical linear models).
I know this isn't exactly what your question is about, but I'll go ahead and mention two ways to try and deal with this. The first is to expand a LGCM to a growth mixture model, where you can use latent group membership to try and capture differences in when the curves peak. Another idea is to use functional data analysis for curve registration. I can add more detail later if it would be helpful.
Regarding growth mixture models:
Your choice for the functional form with a latent growth curve model is somewhat limited. Depending on the number of time points available, you can do linear, polynomials, and linear splines. A less used option however is a "freed-loading" model, in which the factor loadings for a single "slope" factor are freely estimated, expect 2 of them, which are set to define the scale of the latent factor (this is nicely described in Bollen and Curran's book on LGCMs). You can estimate this model with as few as 5 time points. It comes in realy useful for non-monotonic, multi-modal curves.
One problem though is that this functional form is the same for every person...it assumed that they all peak and trough and the same points, and variation in the slope factor just describes how much they peak or trough relative to the mean. It does nothing for phase variation. By extending this to a mixture model, where the slope factor loadings are freely estimated for each latent class, you can have a model that captures any important differences in phase variation because they each get their own curves.
|
Plotting and presenting longitudinal data, options?
|
One often overlooked problem with plotting/analyzing summary (e.g. mean) curves is how to deal with Phase Variation. In an extreme example, one could plot the mean of 2 sin curves that are 180 degrees
|
Plotting and presenting longitudinal data, options?
One often overlooked problem with plotting/analyzing summary (e.g. mean) curves is how to deal with Phase Variation. In an extreme example, one could plot the mean of 2 sin curves that are 180 degrees out of phase. This would of course be a straight line, which clearly doesn't reflect anything interesting about the individual curves (expect perhaps that they are out of phase).
Thinking in terms of a latent growth curve model, estimated variances of the random growth factors do nothing to account for phase variation, which is one reason why overall model fit for latent growth curve models is often poor (and usually not even assessed in hierarchical linear models).
I know this isn't exactly what your question is about, but I'll go ahead and mention two ways to try and deal with this. The first is to expand a LGCM to a growth mixture model, where you can use latent group membership to try and capture differences in when the curves peak. Another idea is to use functional data analysis for curve registration. I can add more detail later if it would be helpful.
Regarding growth mixture models:
Your choice for the functional form with a latent growth curve model is somewhat limited. Depending on the number of time points available, you can do linear, polynomials, and linear splines. A less used option however is a "freed-loading" model, in which the factor loadings for a single "slope" factor are freely estimated, expect 2 of them, which are set to define the scale of the latent factor (this is nicely described in Bollen and Curran's book on LGCMs). You can estimate this model with as few as 5 time points. It comes in realy useful for non-monotonic, multi-modal curves.
One problem though is that this functional form is the same for every person...it assumed that they all peak and trough and the same points, and variation in the slope factor just describes how much they peak or trough relative to the mean. It does nothing for phase variation. By extending this to a mixture model, where the slope factor loadings are freely estimated for each latent class, you can have a model that captures any important differences in phase variation because they each get their own curves.
|
Plotting and presenting longitudinal data, options?
One often overlooked problem with plotting/analyzing summary (e.g. mean) curves is how to deal with Phase Variation. In an extreme example, one could plot the mean of 2 sin curves that are 180 degrees
|
39,767
|
Matched binomial pairs
|
I would recommend you to use Generalized Estimating Equations (GEE). This is analogous to Repeated-measures ANOVA but allows for non-continuous or non-normal response because, being a Generalized linear model, it adopts various link functions.
With your example, I'd use binomial distribution with logit link (albeit you might prefer probit). The input data was restructured from "wide" into "long" which appears this:
id pre_post count
1 1 5
2 1 5
3 1 5
4 1 5
5 1 4
6 1 5
7 1 5
8 1 5
9 1 5
1 2 3
2 2 4
3 2 3
4 2 3
5 2 4
6 2 4
7 2 3
8 2 5
9 2 5
The DV is count, how much a respondent scored out of 5 attempts. pre_post is the repeated-measures factor levels of which you want to compare. Id is respondent. I'll use SPSS to analyse it; the command is below.
GENLIN count /*response variable: score
OF 5 /*out of 5 trials
BY pre_post
/MODEL pre_post INTERCEPT=YES /*the only factor to test is pre_post
DISTRIBUTION=BINOMIAL LINK=LOGIT
/REPEATED SUBJECT=id WITHINSUBJECT=pre_post /*id is respondent id, pre_post is the repeated measures factor
CORRTYPE=INDEPENDENT ADJUSTCORR=YES /*we'll assume Independent correlation structure.
Here is an excerpt from the results:
You see that is a significant difference between pre and post. Usual RM ANOVA (paired-samples t-test) gave close significance, .007.
|
Matched binomial pairs
|
I would recommend you to use Generalized Estimating Equations (GEE). This is analogous to Repeated-measures ANOVA but allows for non-continuous or non-normal response because, being a Generalized line
|
Matched binomial pairs
I would recommend you to use Generalized Estimating Equations (GEE). This is analogous to Repeated-measures ANOVA but allows for non-continuous or non-normal response because, being a Generalized linear model, it adopts various link functions.
With your example, I'd use binomial distribution with logit link (albeit you might prefer probit). The input data was restructured from "wide" into "long" which appears this:
id pre_post count
1 1 5
2 1 5
3 1 5
4 1 5
5 1 4
6 1 5
7 1 5
8 1 5
9 1 5
1 2 3
2 2 4
3 2 3
4 2 3
5 2 4
6 2 4
7 2 3
8 2 5
9 2 5
The DV is count, how much a respondent scored out of 5 attempts. pre_post is the repeated-measures factor levels of which you want to compare. Id is respondent. I'll use SPSS to analyse it; the command is below.
GENLIN count /*response variable: score
OF 5 /*out of 5 trials
BY pre_post
/MODEL pre_post INTERCEPT=YES /*the only factor to test is pre_post
DISTRIBUTION=BINOMIAL LINK=LOGIT
/REPEATED SUBJECT=id WITHINSUBJECT=pre_post /*id is respondent id, pre_post is the repeated measures factor
CORRTYPE=INDEPENDENT ADJUSTCORR=YES /*we'll assume Independent correlation structure.
Here is an excerpt from the results:
You see that is a significant difference between pre and post. Usual RM ANOVA (paired-samples t-test) gave close significance, .007.
|
Matched binomial pairs
I would recommend you to use Generalized Estimating Equations (GEE). This is analogous to Repeated-measures ANOVA but allows for non-continuous or non-normal response because, being a Generalized line
|
39,768
|
Matched binomial pairs
|
I don't think fisher exact test is appropriate here is it?
It is saying that pre-test there are 34 points arranged in this manner (343344355), and that post test there are 44 points. The arrangement of those 44 points is consistent with the pattern (marginal) established in the pre-test. It is also saying that each pairing looks similar (row part of the test) - people generally do better in the second test by the same amount.
Fisher test isn't testing that the rows are equal, just that they are independent of the columns. You want to answer the question "Do people do better post-test", but fisher test is asking the question "Do all people do better on the post-test in the same way".
I think sign test is perfectly appropriate here, and I've just see @ttnphns answer appear which is particularly good.
|
Matched binomial pairs
|
I don't think fisher exact test is appropriate here is it?
It is saying that pre-test there are 34 points arranged in this manner (343344355), and that post test there are 44 points. The arrangement
|
Matched binomial pairs
I don't think fisher exact test is appropriate here is it?
It is saying that pre-test there are 34 points arranged in this manner (343344355), and that post test there are 44 points. The arrangement of those 44 points is consistent with the pattern (marginal) established in the pre-test. It is also saying that each pairing looks similar (row part of the test) - people generally do better in the second test by the same amount.
Fisher test isn't testing that the rows are equal, just that they are independent of the columns. You want to answer the question "Do people do better post-test", but fisher test is asking the question "Do all people do better on the post-test in the same way".
I think sign test is perfectly appropriate here, and I've just see @ttnphns answer appear which is particularly good.
|
Matched binomial pairs
I don't think fisher exact test is appropriate here is it?
It is saying that pre-test there are 34 points arranged in this manner (343344355), and that post test there are 44 points. The arrangement
|
39,769
|
Matched binomial pairs
|
One other option would be run a binomial mixed model. You would need to code the data like this:
result id time
0 1 pre
0 1 pre
1 1 pre
1 1 pre
1 1 pre
1 1 post
1 1 post
1 1 post
1 1 post
1 1 post
With the R package lme4 you could then run the modell
lmer(result ~ timepoint + (1|id), family = "binomial")
But with results like these I suspect any method will deliver significant results and it is properly convenient if you use a method with sound theoretical background with which you are comfortable AND yields the answer you want.
The sign test is absolutely sufficient and appropiate if you just want to show an improvement, but when you also want to quantify the improvement and variation between individuals you start needing more complex models.
|
Matched binomial pairs
|
One other option would be run a binomial mixed model. You would need to code the data like this:
result id time
0 1 pre
0 1 pre
1 1 pre
1 1 pre
1 1 pre
|
Matched binomial pairs
One other option would be run a binomial mixed model. You would need to code the data like this:
result id time
0 1 pre
0 1 pre
1 1 pre
1 1 pre
1 1 pre
1 1 post
1 1 post
1 1 post
1 1 post
1 1 post
With the R package lme4 you could then run the modell
lmer(result ~ timepoint + (1|id), family = "binomial")
But with results like these I suspect any method will deliver significant results and it is properly convenient if you use a method with sound theoretical background with which you are comfortable AND yields the answer you want.
The sign test is absolutely sufficient and appropiate if you just want to show an improvement, but when you also want to quantify the improvement and variation between individuals you start needing more complex models.
|
Matched binomial pairs
One other option would be run a binomial mixed model. You would need to code the data like this:
result id time
0 1 pre
0 1 pre
1 1 pre
1 1 pre
1 1 pre
|
39,770
|
How can I interpret coefficients of categorical predictors in the negative binomial regression model?
|
I'm going to answer this using a Poisson model, which is precisely a negative binomial model without overdispersion, because the math will be simpler. The poisson model predicts the probability of observing $y_i$ to be a particular non-negative discrete number
$$P(y_i|X) = \dfrac{\exp(-\lambda_i)\lambda_i ^{y_i}}{y_i!}$$
The conditional mean of this distribution $\lambda_i$.
$$E[y_i|x_i] = \lambda_i = \exp(x_i\beta)$$
$$\log \lambda_i = x_i\beta$$
The conditional variance of the poisson model is also $\lambda_i$, but the variance of the negative binomial model is $\lambda_i + \alpha \lambda_i$. This is the only practical difference between the two models for the purposes of this answer.
This is effectively a log-linear model. So the marginal effect of $x$ on $\lambda$ can be shown as
$$\dfrac{\partial E[y|x]}{\partial x} = \dfrac{\partial\lambda_i}{\partial x} = \exp(\beta)$$
So if you have a negative $\beta$ for a dummy variable $x$, you can say that "on average, $x$ lowers the expected value of $\log(y)$ by $\beta$*100 percent."
|
How can I interpret coefficients of categorical predictors in the negative binomial regression model
|
I'm going to answer this using a Poisson model, which is precisely a negative binomial model without overdispersion, because the math will be simpler. The poisson model predicts the probability of ob
|
How can I interpret coefficients of categorical predictors in the negative binomial regression model?
I'm going to answer this using a Poisson model, which is precisely a negative binomial model without overdispersion, because the math will be simpler. The poisson model predicts the probability of observing $y_i$ to be a particular non-negative discrete number
$$P(y_i|X) = \dfrac{\exp(-\lambda_i)\lambda_i ^{y_i}}{y_i!}$$
The conditional mean of this distribution $\lambda_i$.
$$E[y_i|x_i] = \lambda_i = \exp(x_i\beta)$$
$$\log \lambda_i = x_i\beta$$
The conditional variance of the poisson model is also $\lambda_i$, but the variance of the negative binomial model is $\lambda_i + \alpha \lambda_i$. This is the only practical difference between the two models for the purposes of this answer.
This is effectively a log-linear model. So the marginal effect of $x$ on $\lambda$ can be shown as
$$\dfrac{\partial E[y|x]}{\partial x} = \dfrac{\partial\lambda_i}{\partial x} = \exp(\beta)$$
So if you have a negative $\beta$ for a dummy variable $x$, you can say that "on average, $x$ lowers the expected value of $\log(y)$ by $\beta$*100 percent."
|
How can I interpret coefficients of categorical predictors in the negative binomial regression model
I'm going to answer this using a Poisson model, which is precisely a negative binomial model without overdispersion, because the math will be simpler. The poisson model predicts the probability of ob
|
39,771
|
Examples of drastic improvements when using deep neural networks
|
"Dramatic" is subjective.
One example where deep networks do better is the MNIST hand-written digit set. Yann LeCun keeps a web page of progress made by various techniques with many useful links. This is a relatively simple classification problem compared with speech recognition and image recognition, and deep networks are expected to outperform single hidden layer neural networks (with the same number of parameters) by even more on more complicated tasks.
|
Examples of drastic improvements when using deep neural networks
|
"Dramatic" is subjective.
One example where deep networks do better is the MNIST hand-written digit set. Yann LeCun keeps a web page of progress made by various techniques with many useful links. Thi
|
Examples of drastic improvements when using deep neural networks
"Dramatic" is subjective.
One example where deep networks do better is the MNIST hand-written digit set. Yann LeCun keeps a web page of progress made by various techniques with many useful links. This is a relatively simple classification problem compared with speech recognition and image recognition, and deep networks are expected to outperform single hidden layer neural networks (with the same number of parameters) by even more on more complicated tasks.
|
Examples of drastic improvements when using deep neural networks
"Dramatic" is subjective.
One example where deep networks do better is the MNIST hand-written digit set. Yann LeCun keeps a web page of progress made by various techniques with many useful links. Thi
|
39,772
|
Examples of drastic improvements when using deep neural networks
|
In my opinion, some of the most convincing results from the deep learning community in the past few years have come from the area of automatic speech recognition (ASR).
At this point, ASR has seen about four decades of excellent work from a number of really smart people, so the field has been on something of a plateau for the past 10 years or so. For example, it's generally considered publishable in this field if you get a result with one-half percent decrease in word error rate over the state of the art.
However, results using deep models have seen remarkable progress in the field in the past few years. Notably, deep models have resulted in a 5% decrease in word error rate for some systems. In addition, deep models appear to be able to learn appropriate feature representations from simpler encodings of speech ; that is, instead of using a typically hand-coded pipeline transforming speech waveforms into mel-frequency cepstral coefficients (MFCCs), deep models appear to be able to learn effective representations of speech data solely from the data, thus removing the need to hard-code these cepstral (or other) representations. These results are remarkable given the historical progress in the field.
Sample references
L Deng et al. "Recent Advances in Deep Learning for Speech Research at Microsoft." ICASSP 2013.
A-R Mohamed et al. "Deep belief networks using discriminative features for phone recognition." ICASSP 2011.
G Dahl, T Sainath, G Hinton. "Improving Deep Neural Networks for LVCSR using Rectified Linear Units and Dropout." ICASSP 2013.
|
Examples of drastic improvements when using deep neural networks
|
In my opinion, some of the most convincing results from the deep learning community in the past few years have come from the area of automatic speech recognition (ASR).
At this point, ASR has seen abo
|
Examples of drastic improvements when using deep neural networks
In my opinion, some of the most convincing results from the deep learning community in the past few years have come from the area of automatic speech recognition (ASR).
At this point, ASR has seen about four decades of excellent work from a number of really smart people, so the field has been on something of a plateau for the past 10 years or so. For example, it's generally considered publishable in this field if you get a result with one-half percent decrease in word error rate over the state of the art.
However, results using deep models have seen remarkable progress in the field in the past few years. Notably, deep models have resulted in a 5% decrease in word error rate for some systems. In addition, deep models appear to be able to learn appropriate feature representations from simpler encodings of speech ; that is, instead of using a typically hand-coded pipeline transforming speech waveforms into mel-frequency cepstral coefficients (MFCCs), deep models appear to be able to learn effective representations of speech data solely from the data, thus removing the need to hard-code these cepstral (or other) representations. These results are remarkable given the historical progress in the field.
Sample references
L Deng et al. "Recent Advances in Deep Learning for Speech Research at Microsoft." ICASSP 2013.
A-R Mohamed et al. "Deep belief networks using discriminative features for phone recognition." ICASSP 2011.
G Dahl, T Sainath, G Hinton. "Improving Deep Neural Networks for LVCSR using Rectified Linear Units and Dropout." ICASSP 2013.
|
Examples of drastic improvements when using deep neural networks
In my opinion, some of the most convincing results from the deep learning community in the past few years have come from the area of automatic speech recognition (ASR).
At this point, ASR has seen abo
|
39,773
|
Conditional Expectation of Multivariate Distributions
|
Try to build your intuition with particular cases first. Suppose that $X\in\{x_1,\dots,x_m\}$ with pmf $p_X$ and $Y\in\{y_1,\dots,y_n\}$ with pmf $p_Y$, such that $p_Y(y_i)>0$, for $i=1,\dots,n$. Let $p_{X,Y}$ be the joint pmf of $X$ and $Y$. The conditional pmf of $X$ given $Y$ is defined as
$$
p_{X\mid Y}(x_i\mid y_j) = \frac{p_{X,Y}(x_i,y_j)}{p_Y(y_j)} \qquad . \qquad\qquad (*)
$$
Note that $(*)$ is a pmf for each "fixed" $y_j$. Now, interpret the expectation
$$
\mathrm{E}[X]=\sum_{i=1}^m x_i\,p_X(x_i)
$$
intuitively as your best guess about the value of $X$, and extend this interpretation to a new object $\mathrm{E}[X\mid Y=y]$, called the conditional expectation of $X$ given that $Y=y$, which represents your best guess about the value of $X$ when you are given the information that $Y=y$.
The key point is that this conditional expectation is computed from $(*)$ as
$$
\mathrm{E}[X\mid Y=y] = \sum_{i=1}^m x_i\,p_{X\mid Y}(x_i\mid y) = g(y) \, ,
$$
for some nice function $g$. The notation $\mathrm{E}[X\mid Y]$ is just an abreviation for the random variable $g(Y)$ (that is what I've asked you in my comment). But you already now how to compute the expectation of $g(Y)$ using the "law of the unconscious statistician" as
$$
\mathrm{E}[g(Y)] = \sum_{i=1}^n g(y_i)\,p_Y(y_i) = \sum_{i=1}^n \mathrm{E}[X\mid Y=y_i]\,p_Y(y_i)
$$
$$
= \sum_{i=1}^n \sum_{j=1}^m x_j\,p_{X\mid Y}(x_j\mid y_i)\,p_Y(y_i)
$$
$$
= \sum_{j=1}^m x_j \sum_{i=1}^n p_{X,Y}(x_j,y_i) = \sum_{j=1}^m x_j\, p_X(x_j)
$$
which can be written as
$$
\mathrm{E}[\mathrm{E}[X\mid Y]]=\mathrm{E}[X] \, .
$$
The importance of this concept is impossible to overstate. Its generalization to the conditional expectation given a sigma-field dominates the development of modern probability theory, martingale theory, etc. Defining conditional variance $\mathrm{Var}[X\mid Y]$ in the same spirit, the corresponding property
$$
\mathrm{Var}[X] = \mathrm{E}[\mathrm{Var}[X\mid Y]] + \mathrm{Var}[\mathrm{E}[X\mid Y]]
$$
is the basis for a variance reduction technique extensively used in simulation known as rao-blackwelization.
To give you a taste of the conditional expectation as a tool, consider this problem. Let $N$ be the number of questions posted monthly at Stack Exchange, and let $X_i$ be the number of answers to question $i$. Suppose that the $X_i$'s are IID, and that $N$ and the $X_i$'s are independent. The number of total answers in a month is given by the random sum
$\sum_{i=1}^N X_i$ (note that the number of terms in this sum is random). What is $\mathrm{E}\left[\sum_{i=1}^N X_i\right]$?
To solve this we will justify some properties of the conditional expectation intuitively. First, we "use what we know", plus the independence of the $X_i$'s and $N$ to get
$$
\mathrm{E}\left[\sum_{i=1}^N X_i \,\Bigg|\, N = n\right] = \mathrm{E}\left[\sum_{i=1}^n X_i \,\Bigg|\, N = n\right] = \mathrm{E}\left[\sum_{i=1}^n X_i\right] = n \,\mathrm{E}\left[X_1\right] \, .
$$
Hence, the random variable $\mathrm{E}\left[\sum_{i=1}^N X_i\mid N\right]=N \,\mathrm{E}\left[X_1\right]$, and using the fundamental property we have
$$
\mathrm{E}\left[\sum_{i=1}^N X_i\right]=\mathrm{E}\left[\mathrm{E}\left[\sum_{i=1}^N X_i \,\Bigg|\, N\right]\right] = \mathrm{E}[N]\, \mathrm{E}\left[X_1\right] \, .
$$
|
Conditional Expectation of Multivariate Distributions
|
Try to build your intuition with particular cases first. Suppose that $X\in\{x_1,\dots,x_m\}$ with pmf $p_X$ and $Y\in\{y_1,\dots,y_n\}$ with pmf $p_Y$, such that $p_Y(y_i)>0$, for $i=1,\dots,n$. Let
|
Conditional Expectation of Multivariate Distributions
Try to build your intuition with particular cases first. Suppose that $X\in\{x_1,\dots,x_m\}$ with pmf $p_X$ and $Y\in\{y_1,\dots,y_n\}$ with pmf $p_Y$, such that $p_Y(y_i)>0$, for $i=1,\dots,n$. Let $p_{X,Y}$ be the joint pmf of $X$ and $Y$. The conditional pmf of $X$ given $Y$ is defined as
$$
p_{X\mid Y}(x_i\mid y_j) = \frac{p_{X,Y}(x_i,y_j)}{p_Y(y_j)} \qquad . \qquad\qquad (*)
$$
Note that $(*)$ is a pmf for each "fixed" $y_j$. Now, interpret the expectation
$$
\mathrm{E}[X]=\sum_{i=1}^m x_i\,p_X(x_i)
$$
intuitively as your best guess about the value of $X$, and extend this interpretation to a new object $\mathrm{E}[X\mid Y=y]$, called the conditional expectation of $X$ given that $Y=y$, which represents your best guess about the value of $X$ when you are given the information that $Y=y$.
The key point is that this conditional expectation is computed from $(*)$ as
$$
\mathrm{E}[X\mid Y=y] = \sum_{i=1}^m x_i\,p_{X\mid Y}(x_i\mid y) = g(y) \, ,
$$
for some nice function $g$. The notation $\mathrm{E}[X\mid Y]$ is just an abreviation for the random variable $g(Y)$ (that is what I've asked you in my comment). But you already now how to compute the expectation of $g(Y)$ using the "law of the unconscious statistician" as
$$
\mathrm{E}[g(Y)] = \sum_{i=1}^n g(y_i)\,p_Y(y_i) = \sum_{i=1}^n \mathrm{E}[X\mid Y=y_i]\,p_Y(y_i)
$$
$$
= \sum_{i=1}^n \sum_{j=1}^m x_j\,p_{X\mid Y}(x_j\mid y_i)\,p_Y(y_i)
$$
$$
= \sum_{j=1}^m x_j \sum_{i=1}^n p_{X,Y}(x_j,y_i) = \sum_{j=1}^m x_j\, p_X(x_j)
$$
which can be written as
$$
\mathrm{E}[\mathrm{E}[X\mid Y]]=\mathrm{E}[X] \, .
$$
The importance of this concept is impossible to overstate. Its generalization to the conditional expectation given a sigma-field dominates the development of modern probability theory, martingale theory, etc. Defining conditional variance $\mathrm{Var}[X\mid Y]$ in the same spirit, the corresponding property
$$
\mathrm{Var}[X] = \mathrm{E}[\mathrm{Var}[X\mid Y]] + \mathrm{Var}[\mathrm{E}[X\mid Y]]
$$
is the basis for a variance reduction technique extensively used in simulation known as rao-blackwelization.
To give you a taste of the conditional expectation as a tool, consider this problem. Let $N$ be the number of questions posted monthly at Stack Exchange, and let $X_i$ be the number of answers to question $i$. Suppose that the $X_i$'s are IID, and that $N$ and the $X_i$'s are independent. The number of total answers in a month is given by the random sum
$\sum_{i=1}^N X_i$ (note that the number of terms in this sum is random). What is $\mathrm{E}\left[\sum_{i=1}^N X_i\right]$?
To solve this we will justify some properties of the conditional expectation intuitively. First, we "use what we know", plus the independence of the $X_i$'s and $N$ to get
$$
\mathrm{E}\left[\sum_{i=1}^N X_i \,\Bigg|\, N = n\right] = \mathrm{E}\left[\sum_{i=1}^n X_i \,\Bigg|\, N = n\right] = \mathrm{E}\left[\sum_{i=1}^n X_i\right] = n \,\mathrm{E}\left[X_1\right] \, .
$$
Hence, the random variable $\mathrm{E}\left[\sum_{i=1}^N X_i\mid N\right]=N \,\mathrm{E}\left[X_1\right]$, and using the fundamental property we have
$$
\mathrm{E}\left[\sum_{i=1}^N X_i\right]=\mathrm{E}\left[\mathrm{E}\left[\sum_{i=1}^N X_i \,\Bigg|\, N\right]\right] = \mathrm{E}[N]\, \mathrm{E}\left[X_1\right] \, .
$$
|
Conditional Expectation of Multivariate Distributions
Try to build your intuition with particular cases first. Suppose that $X\in\{x_1,\dots,x_m\}$ with pmf $p_X$ and $Y\in\{y_1,\dots,y_n\}$ with pmf $p_Y$, such that $p_Y(y_i)>0$, for $i=1,\dots,n$. Let
|
39,774
|
Maximising the correlation between vectors vs minimising the angle between them
|
It is often useful to geometrically represent random variables $X_{1}, \ldots, X_{p}$ (theoretical or empirical data) as vectors $\bf{x}_{1}, \ldots, \bf{x}_{p}$ such that their standard deviations $\sigma(X_{i})$ equal their lengths $||\bf{x}_{i}||$, and their correlations $\rho(X_{i}, X_{j})$ equal the cosine of their angles $\angle(\bf{x}_{i}, \bf{x}_{j})$. One can then use graphical illustrations and geometric intuitions to gain statistical insight.
To this end, let $\bf{\Sigma}$ be the $(p \times p)$-covariance matrix of $X_{1}, \ldots, X_{p}$ with rank $k$. Since $\bf{\Sigma}$ is positive semidefinite, we can find a decomposition $\bf{\Sigma} = \bf{B} \bf{B}'$ by defining the $(p \times k)$-matrix $\bf{B} := \bf{G} \bf{D}^{1/2}$, where $\bf{G}$ is the $(p \times k)$-matrix of eigenvectors of $\bf{\Sigma}$ and $\bf{D}$ is the $(k \times k)$-diagonal matrix of corresponding positive eigenvalues.
$\bf{B} \bf{B}'$ is the matrix of dot products of the rows of $\bf{B}$, i.e., $\bf{\Sigma}_{ij} = \langle\bf{B}_{i}, \bf{B}_{j}\rangle = \bf{B}_{i}'\bf{B}_{j}$. Now we get the desired representation in $k$-dimensional space by defining $\bf{x}_{i} := \bf{B}_{i}$, because then we have
$$
||\bf{x}_{i}|| = \sqrt{\langle\bf{x}_{i}, \bf{x}_{i}\rangle} = \sqrt{\bf{\Sigma}_{ii}} = \sigma(X_{i})
$$
And we also have (assuming $||\bf{x}_{i}|| > 0$ and $||\bf{x}_{j}|| > 0$)
$$
\begin{array}{rcl}
\cos(\angle(\bf{x}_{i}, \bf{x}_{j})) &=& \frac{\langle\bf{x}_{i}, \bf{x}_{j}\rangle}{||\bf{x}_{i}|| \cdot ||\bf{x}_{j}||} = \frac{\langle\bf{x}_{i}, \bf{x}_{j}\rangle}{\sqrt{\langle\bf{x}_{i}, \bf{x}_{i}\rangle} \cdot \sqrt{\langle\bf{x}_{j}, \bf{x}_{j}\rangle}}\\
&=& \frac{\bf{\Sigma}_{r} \bf{x}_{ir} \bf{x}_{jr}}{\sqrt{\bf{\Sigma}_{r} \bf{x}_{ir}^{2}} \, \sqrt{\bf{\Sigma}_{r} \bf{x}_{jr}^{2}}} = \frac{Cov(X_{i}, X_{j})}{\sigma(X_{i}) \, \sigma(X_{j})}\\
&=& \rho(X_{i}, X_{j})
\end{array}
$$
Since $\cos(0) = 1$, maximizing the correlation between variables can be viewed as minimizing the angle between their corresponding vectors.
If we have empirical data $n$-vectors $\bf{x}_{i}$ with mean vectors $\bar{\bf{x}}_{i}$, then the representation immediately follows for the corresponding centered variables $\dot{\bf{x}}_{i}$ since $\langle\dot{\bf{x}}_{i}, \dot{\bf{x}}_{j}\rangle = \sum\limits_{r=1}^{n}(\bf{x}_{ir} - \bar{\bf{x}}_{i})(\bf{x}_{jr} - \bar{\bf{x}}_{j}) = n \, Cov(X_{i}, X_{j})$.
So in this case, $\dot{\bf{x}}_{i} / \sqrt{n}$ already is the desired representation - although in $n$-dimensional space, whereas we only need $k \leqslant n$ dimensions in general.
For applications, see e.g. this answer or this answer.
|
Maximising the correlation between vectors vs minimising the angle between them
|
It is often useful to geometrically represent random variables $X_{1}, \ldots, X_{p}$ (theoretical or empirical data) as vectors $\bf{x}_{1}, \ldots, \bf{x}_{p}$ such that their standard deviations $\
|
Maximising the correlation between vectors vs minimising the angle between them
It is often useful to geometrically represent random variables $X_{1}, \ldots, X_{p}$ (theoretical or empirical data) as vectors $\bf{x}_{1}, \ldots, \bf{x}_{p}$ such that their standard deviations $\sigma(X_{i})$ equal their lengths $||\bf{x}_{i}||$, and their correlations $\rho(X_{i}, X_{j})$ equal the cosine of their angles $\angle(\bf{x}_{i}, \bf{x}_{j})$. One can then use graphical illustrations and geometric intuitions to gain statistical insight.
To this end, let $\bf{\Sigma}$ be the $(p \times p)$-covariance matrix of $X_{1}, \ldots, X_{p}$ with rank $k$. Since $\bf{\Sigma}$ is positive semidefinite, we can find a decomposition $\bf{\Sigma} = \bf{B} \bf{B}'$ by defining the $(p \times k)$-matrix $\bf{B} := \bf{G} \bf{D}^{1/2}$, where $\bf{G}$ is the $(p \times k)$-matrix of eigenvectors of $\bf{\Sigma}$ and $\bf{D}$ is the $(k \times k)$-diagonal matrix of corresponding positive eigenvalues.
$\bf{B} \bf{B}'$ is the matrix of dot products of the rows of $\bf{B}$, i.e., $\bf{\Sigma}_{ij} = \langle\bf{B}_{i}, \bf{B}_{j}\rangle = \bf{B}_{i}'\bf{B}_{j}$. Now we get the desired representation in $k$-dimensional space by defining $\bf{x}_{i} := \bf{B}_{i}$, because then we have
$$
||\bf{x}_{i}|| = \sqrt{\langle\bf{x}_{i}, \bf{x}_{i}\rangle} = \sqrt{\bf{\Sigma}_{ii}} = \sigma(X_{i})
$$
And we also have (assuming $||\bf{x}_{i}|| > 0$ and $||\bf{x}_{j}|| > 0$)
$$
\begin{array}{rcl}
\cos(\angle(\bf{x}_{i}, \bf{x}_{j})) &=& \frac{\langle\bf{x}_{i}, \bf{x}_{j}\rangle}{||\bf{x}_{i}|| \cdot ||\bf{x}_{j}||} = \frac{\langle\bf{x}_{i}, \bf{x}_{j}\rangle}{\sqrt{\langle\bf{x}_{i}, \bf{x}_{i}\rangle} \cdot \sqrt{\langle\bf{x}_{j}, \bf{x}_{j}\rangle}}\\
&=& \frac{\bf{\Sigma}_{r} \bf{x}_{ir} \bf{x}_{jr}}{\sqrt{\bf{\Sigma}_{r} \bf{x}_{ir}^{2}} \, \sqrt{\bf{\Sigma}_{r} \bf{x}_{jr}^{2}}} = \frac{Cov(X_{i}, X_{j})}{\sigma(X_{i}) \, \sigma(X_{j})}\\
&=& \rho(X_{i}, X_{j})
\end{array}
$$
Since $\cos(0) = 1$, maximizing the correlation between variables can be viewed as minimizing the angle between their corresponding vectors.
If we have empirical data $n$-vectors $\bf{x}_{i}$ with mean vectors $\bar{\bf{x}}_{i}$, then the representation immediately follows for the corresponding centered variables $\dot{\bf{x}}_{i}$ since $\langle\dot{\bf{x}}_{i}, \dot{\bf{x}}_{j}\rangle = \sum\limits_{r=1}^{n}(\bf{x}_{ir} - \bar{\bf{x}}_{i})(\bf{x}_{jr} - \bar{\bf{x}}_{j}) = n \, Cov(X_{i}, X_{j})$.
So in this case, $\dot{\bf{x}}_{i} / \sqrt{n}$ already is the desired representation - although in $n$-dimensional space, whereas we only need $k \leqslant n$ dimensions in general.
For applications, see e.g. this answer or this answer.
|
Maximising the correlation between vectors vs minimising the angle between them
It is often useful to geometrically represent random variables $X_{1}, \ldots, X_{p}$ (theoretical or empirical data) as vectors $\bf{x}_{1}, \ldots, \bf{x}_{p}$ such that their standard deviations $\
|
39,775
|
Maximising the correlation between vectors vs minimising the angle between them
|
Since you ask for a reference, Statistics methods: the geometric approach explains this and many other properties by visualization in geometric space. For teaching purposes, it can also be useful because you can explain deep concepts to people with a weak background in calculus.
@caracal's answer is very comprehensive. All I will add is a little bit of background. Formally, angles and norms (distances) are defined from a scalar product. So all you need is a scalar product $\langle x ; y \rangle$.
The norm of a vector $x$ is then defined as $\|x\|^2 = \langle x ; x \rangle$.
The angle $\theta$ between $x$ and $y$ is such that $\cos \theta = \frac{\langle x ; y \rangle}{\|x\| \cdot \|y\|}$.
What is a scalar product? By definition, it is a function that
is linear and symmetric in both of its arguments,
such that $\langle x ; x \rangle \geq 0$,
and such that $\langle x ; x \rangle = 0$ if and only if $x = 0$.
We easily check that the covariance is a scalar product.
$Cov(X + \lambda \cdot Y ; Z) = Cov(X ; Z) + \lambda \cdot Cov(Y ; Z)$, and $Cov(X;Z) = Cov(Z;X)$,
$Cov(X ; X) = Var(X) \geq 0$,
... but we don't have $Var(X) = 0 \iff X = 0$.
Actually, a random variable has zero variance if it is equal to a constant $a$. The difficulty is addressed by re-defining the space vector as the random variables, up to an additive constant (we say that two random variables are the same if they differ by a constant). With this new definition, we have a scalar product and we can interpret the coefficient of correlation (second bullet point above) as the cosine between two random variables. It is then obvious that maximizing the correlation is like minimizing the angle.
This all comes from the properties of space vectors, which capture the essential features of geometry in simple formulas.
|
Maximising the correlation between vectors vs minimising the angle between them
|
Since you ask for a reference, Statistics methods: the geometric approach explains this and many other properties by visualization in geometric space. For teaching purposes, it can also be useful beca
|
Maximising the correlation between vectors vs minimising the angle between them
Since you ask for a reference, Statistics methods: the geometric approach explains this and many other properties by visualization in geometric space. For teaching purposes, it can also be useful because you can explain deep concepts to people with a weak background in calculus.
@caracal's answer is very comprehensive. All I will add is a little bit of background. Formally, angles and norms (distances) are defined from a scalar product. So all you need is a scalar product $\langle x ; y \rangle$.
The norm of a vector $x$ is then defined as $\|x\|^2 = \langle x ; x \rangle$.
The angle $\theta$ between $x$ and $y$ is such that $\cos \theta = \frac{\langle x ; y \rangle}{\|x\| \cdot \|y\|}$.
What is a scalar product? By definition, it is a function that
is linear and symmetric in both of its arguments,
such that $\langle x ; x \rangle \geq 0$,
and such that $\langle x ; x \rangle = 0$ if and only if $x = 0$.
We easily check that the covariance is a scalar product.
$Cov(X + \lambda \cdot Y ; Z) = Cov(X ; Z) + \lambda \cdot Cov(Y ; Z)$, and $Cov(X;Z) = Cov(Z;X)$,
$Cov(X ; X) = Var(X) \geq 0$,
... but we don't have $Var(X) = 0 \iff X = 0$.
Actually, a random variable has zero variance if it is equal to a constant $a$. The difficulty is addressed by re-defining the space vector as the random variables, up to an additive constant (we say that two random variables are the same if they differ by a constant). With this new definition, we have a scalar product and we can interpret the coefficient of correlation (second bullet point above) as the cosine between two random variables. It is then obvious that maximizing the correlation is like minimizing the angle.
This all comes from the properties of space vectors, which capture the essential features of geometry in simple formulas.
|
Maximising the correlation between vectors vs minimising the angle between them
Since you ask for a reference, Statistics methods: the geometric approach explains this and many other properties by visualization in geometric space. For teaching purposes, it can also be useful beca
|
39,776
|
How to statistically describe chain-like patterns in bivariate data?
|
The correlation between X and Y measures the presence or absence of a linear relationship between them. If y=aX+B -- a pure line with no scatter and no error - the correlation will be 1 (if a>0) and -1 (if a < 0). It is not a general measure of causality or relatedness.
Your second scatter plot shows no linearity at all. A correlation is not an appropriate measure in this case.
|
How to statistically describe chain-like patterns in bivariate data?
|
The correlation between X and Y measures the presence or absence of a linear relationship between them. If y=aX+B -- a pure line with no scatter and no error - the correlation will be 1 (if a>0) and -
|
How to statistically describe chain-like patterns in bivariate data?
The correlation between X and Y measures the presence or absence of a linear relationship between them. If y=aX+B -- a pure line with no scatter and no error - the correlation will be 1 (if a>0) and -1 (if a < 0). It is not a general measure of causality or relatedness.
Your second scatter plot shows no linearity at all. A correlation is not an appropriate measure in this case.
|
How to statistically describe chain-like patterns in bivariate data?
The correlation between X and Y measures the presence or absence of a linear relationship between them. If y=aX+B -- a pure line with no scatter and no error - the correlation will be 1 (if a>0) and -
|
39,777
|
How to statistically describe chain-like patterns in bivariate data?
|
The pattern you describe is completely uncorrelated but can be picked up with some information theoretic measure such as mutual information. There are a number of packages implementing it, e.g. entropy and infotheo.
There is also a quite recent dependency measure called MIC, implemented in java with an R wrapper that you can get at www.exploredata.net. It has a bunch of nice properties such as being on the [0, 1] interval and not favoring any particular type of relationship (e.g. linear) over others. It is not entirely uncontroversial though, so I recommend reading the orgignal article by Reshef et al (Science 2012).
|
How to statistically describe chain-like patterns in bivariate data?
|
The pattern you describe is completely uncorrelated but can be picked up with some information theoretic measure such as mutual information. There are a number of packages implementing it, e.g. entrop
|
How to statistically describe chain-like patterns in bivariate data?
The pattern you describe is completely uncorrelated but can be picked up with some information theoretic measure such as mutual information. There are a number of packages implementing it, e.g. entropy and infotheo.
There is also a quite recent dependency measure called MIC, implemented in java with an R wrapper that you can get at www.exploredata.net. It has a bunch of nice properties such as being on the [0, 1] interval and not favoring any particular type of relationship (e.g. linear) over others. It is not entirely uncontroversial though, so I recommend reading the orgignal article by Reshef et al (Science 2012).
|
How to statistically describe chain-like patterns in bivariate data?
The pattern you describe is completely uncorrelated but can be picked up with some information theoretic measure such as mutual information. There are a number of packages implementing it, e.g. entrop
|
39,778
|
Jonckheere-Terpstra interpretation
|
First, one note. Like Kruskal-Wallis, Jonckheere-Terpstra is generally not a test of medians. It is a test of distributional "locations", or stochastic prevalence. It can give significant result even if medians are equal.
Now, for your test (let us honour your medians as locations). The test is highly significant because there is expressed trend in 0.1387, 0.2814, 0.5882. You tested the "all groups equal" null against the alternative hypothesis that, in population, Lev1<=Lev2<=Lev3<=Lev4 with at least one of the inequalities is strict (<). Jonckheere-Terpstra, unlike Kruskal-Wallis, considers only such a monotonic alternative hypothesis, not curvilinear one such as Lev1<=Lev2<=Lev3>=Lev4 for example. Therefore, under J-T pairwise comparisons, Lev3>Lev4 never will be significant. It is the constraint. Under K-W pairwise comparisons, it can be significant, certainly.
Please see this answer for particulars what hypotheses Jonckheere-Terpstra test tests and what are their p values.
|
Jonckheere-Terpstra interpretation
|
First, one note. Like Kruskal-Wallis, Jonckheere-Terpstra is generally not a test of medians. It is a test of distributional "locations", or stochastic prevalence. It can give significant result even
|
Jonckheere-Terpstra interpretation
First, one note. Like Kruskal-Wallis, Jonckheere-Terpstra is generally not a test of medians. It is a test of distributional "locations", or stochastic prevalence. It can give significant result even if medians are equal.
Now, for your test (let us honour your medians as locations). The test is highly significant because there is expressed trend in 0.1387, 0.2814, 0.5882. You tested the "all groups equal" null against the alternative hypothesis that, in population, Lev1<=Lev2<=Lev3<=Lev4 with at least one of the inequalities is strict (<). Jonckheere-Terpstra, unlike Kruskal-Wallis, considers only such a monotonic alternative hypothesis, not curvilinear one such as Lev1<=Lev2<=Lev3>=Lev4 for example. Therefore, under J-T pairwise comparisons, Lev3>Lev4 never will be significant. It is the constraint. Under K-W pairwise comparisons, it can be significant, certainly.
Please see this answer for particulars what hypotheses Jonckheere-Terpstra test tests and what are their p values.
|
Jonckheere-Terpstra interpretation
First, one note. Like Kruskal-Wallis, Jonckheere-Terpstra is generally not a test of medians. It is a test of distributional "locations", or stochastic prevalence. It can give significant result even
|
39,779
|
Jonckheere-Terpstra interpretation
|
The J-T test combines all the comparisons into a single test so it doesn't really make sense to extract a specific conclusion about one comparison. Specifically, the J-T test statistic is the sum of a set of two-sample rank-sum statistics. For your data, the reversal in trend between levels 3 and 4 will reduce the J-T statistic (the rank-sum statistic from this comparison will be negative), but clearly the overall positive trend outweighs this, giving a large J-T statistic, a small P-value, and favoring the alternative hypothesis. As ttnphns has written, the alternative hypothesis is a string of <= with at least one strict <. So your K-W result is not inconsistent with the alternative hypothesis of the J-T test. A pattern of true locations of 1 < 2 < 3 = 4 would be compatible with your medians, the J-T alternative hypothesis, and the K-W null hypothesis.
Of course another plausible true pattern could be 1 < 2 < 3 > 4, which is not consistent with either hypothesis, null or alternative, of the J-T test. One price for the added power of a more specific alternative is the possibility that it will miss the target, that the true pattern will not match either the null or the alternative.
But also if you had a legitimate a priori reason to hypothesize a peaked pattern of 1 < 2 < 3 > 4, there's a variant of the J-T test, due to Mack & Wolfe ("K-sample rank tests for umbrella alternatives" JASA 76:175-181, 1981), that tests for this.
|
Jonckheere-Terpstra interpretation
|
The J-T test combines all the comparisons into a single test so it doesn't really make sense to extract a specific conclusion about one comparison. Specifically, the J-T test statistic is the sum of a
|
Jonckheere-Terpstra interpretation
The J-T test combines all the comparisons into a single test so it doesn't really make sense to extract a specific conclusion about one comparison. Specifically, the J-T test statistic is the sum of a set of two-sample rank-sum statistics. For your data, the reversal in trend between levels 3 and 4 will reduce the J-T statistic (the rank-sum statistic from this comparison will be negative), but clearly the overall positive trend outweighs this, giving a large J-T statistic, a small P-value, and favoring the alternative hypothesis. As ttnphns has written, the alternative hypothesis is a string of <= with at least one strict <. So your K-W result is not inconsistent with the alternative hypothesis of the J-T test. A pattern of true locations of 1 < 2 < 3 = 4 would be compatible with your medians, the J-T alternative hypothesis, and the K-W null hypothesis.
Of course another plausible true pattern could be 1 < 2 < 3 > 4, which is not consistent with either hypothesis, null or alternative, of the J-T test. One price for the added power of a more specific alternative is the possibility that it will miss the target, that the true pattern will not match either the null or the alternative.
But also if you had a legitimate a priori reason to hypothesize a peaked pattern of 1 < 2 < 3 > 4, there's a variant of the J-T test, due to Mack & Wolfe ("K-sample rank tests for umbrella alternatives" JASA 76:175-181, 1981), that tests for this.
|
Jonckheere-Terpstra interpretation
The J-T test combines all the comparisons into a single test so it doesn't really make sense to extract a specific conclusion about one comparison. Specifically, the J-T test statistic is the sum of a
|
39,780
|
How to determine whether data is slightly or extremely non-normally distributed?
|
The sample skewness $$\gamma=\frac{\sum_{i=1}^n(x_i-\bar{x})^3}{\Big(\sum_{i=1}^n(x_i-\bar{x})^2\Big)^{3/2}}$$ and the sample (excess) kurtosis $$\kappa=\frac{\sum_{i=1}^n(x_i-\bar{x})^4}{\Big(\sum_{i=1}^n(x_i-\bar{x})^2\Big)^{2}}-3$$ are often used as measures of non-normality.
The sample skewness measures the asymmetry of the empirical distribution. If it is far from $0$, the distribution is not very symmetric. Since the normal distribution is symmetric, a sample from the normal distribution should be close to $0$.
The sample kurtosis measures the "peakedness" of the distribution. If it is much greater than $0$, then the distribution is more peaked than the normal distribution, which typically means that it has heavier tails. If it is less than $0$ it is less peaked, which typically means that the distribution is bimodal. The sample kurtosis is bounded from below by $-2$ (a value that is obtained for a two-point distribution, which of course is extremely bimodal).!
Here are two examples (normal distribution in grey, other distributions in red):
The skew distribution has theoretical skewness $1.6$ whereas the kurtotic distributions has theoretical (excess) kurtosis $1.5$. As you can see, the kurtotic distribution has heavier tails than the normal distribution.
So, why use skewness and kurtosis as quantifications of non-normality? The main reason is that they affect the asymptotics of the central limit theorem, which as you may know often can be used to motivate the use of a statistical procedure (that is based on normality) even if the data does not come from a normal distribution, given that you have a "large enough" sample. If either the skewness or the kurtosis is high, larger sample sizes are needed for such motivations to be valid.
For some inferential procedures you need to worry more about skewness, and for some you need to worry about heavy tails (kurtosis). I've written more about that elsewhere on this site.
|
How to determine whether data is slightly or extremely non-normally distributed?
|
The sample skewness $$\gamma=\frac{\sum_{i=1}^n(x_i-\bar{x})^3}{\Big(\sum_{i=1}^n(x_i-\bar{x})^2\Big)^{3/2}}$$ and the sample (excess) kurtosis $$\kappa=\frac{\sum_{i=1}^n(x_i-\bar{x})^4}{\Big(\sum_{i
|
How to determine whether data is slightly or extremely non-normally distributed?
The sample skewness $$\gamma=\frac{\sum_{i=1}^n(x_i-\bar{x})^3}{\Big(\sum_{i=1}^n(x_i-\bar{x})^2\Big)^{3/2}}$$ and the sample (excess) kurtosis $$\kappa=\frac{\sum_{i=1}^n(x_i-\bar{x})^4}{\Big(\sum_{i=1}^n(x_i-\bar{x})^2\Big)^{2}}-3$$ are often used as measures of non-normality.
The sample skewness measures the asymmetry of the empirical distribution. If it is far from $0$, the distribution is not very symmetric. Since the normal distribution is symmetric, a sample from the normal distribution should be close to $0$.
The sample kurtosis measures the "peakedness" of the distribution. If it is much greater than $0$, then the distribution is more peaked than the normal distribution, which typically means that it has heavier tails. If it is less than $0$ it is less peaked, which typically means that the distribution is bimodal. The sample kurtosis is bounded from below by $-2$ (a value that is obtained for a two-point distribution, which of course is extremely bimodal).!
Here are two examples (normal distribution in grey, other distributions in red):
The skew distribution has theoretical skewness $1.6$ whereas the kurtotic distributions has theoretical (excess) kurtosis $1.5$. As you can see, the kurtotic distribution has heavier tails than the normal distribution.
So, why use skewness and kurtosis as quantifications of non-normality? The main reason is that they affect the asymptotics of the central limit theorem, which as you may know often can be used to motivate the use of a statistical procedure (that is based on normality) even if the data does not come from a normal distribution, given that you have a "large enough" sample. If either the skewness or the kurtosis is high, larger sample sizes are needed for such motivations to be valid.
For some inferential procedures you need to worry more about skewness, and for some you need to worry about heavy tails (kurtosis). I've written more about that elsewhere on this site.
|
How to determine whether data is slightly or extremely non-normally distributed?
The sample skewness $$\gamma=\frac{\sum_{i=1}^n(x_i-\bar{x})^3}{\Big(\sum_{i=1}^n(x_i-\bar{x})^2\Big)^{3/2}}$$ and the sample (excess) kurtosis $$\kappa=\frac{\sum_{i=1}^n(x_i-\bar{x})^4}{\Big(\sum_{i
|
39,781
|
How to determine whether data is slightly or extremely non-normally distributed?
|
I think the other answers really address methods for deciding non-normality. But I think the OP asks a different question. Basically he is asking about how to decide once normality is rejected how do you determine the severity? If it is mild perhaps the deviation can be ignored. Skewness and kurtosis can be looked at as measures of non-normality but I think it comes down to a subjective decision as to how large a difference should be to call it, mild, moderate or large. I think the point is that this decision can be made by looking at histograms, qq plots, or the magnitude of the skewness and kutosis. But this is going to be subjective and not formal.
|
How to determine whether data is slightly or extremely non-normally distributed?
|
I think the other answers really address methods for deciding non-normality. But I think the OP asks a different question. Basically he is asking about how to decide once normality is rejected how d
|
How to determine whether data is slightly or extremely non-normally distributed?
I think the other answers really address methods for deciding non-normality. But I think the OP asks a different question. Basically he is asking about how to decide once normality is rejected how do you determine the severity? If it is mild perhaps the deviation can be ignored. Skewness and kurtosis can be looked at as measures of non-normality but I think it comes down to a subjective decision as to how large a difference should be to call it, mild, moderate or large. I think the point is that this decision can be made by looking at histograms, qq plots, or the magnitude of the skewness and kutosis. But this is going to be subjective and not formal.
|
How to determine whether data is slightly or extremely non-normally distributed?
I think the other answers really address methods for deciding non-normality. But I think the OP asks a different question. Basically he is asking about how to decide once normality is rejected how d
|
39,782
|
How to determine whether data is slightly or extremely non-normally distributed?
|
Although a wikipedia link might be not considered extremely helpful, the list of methods for testing normality is quite long.
The methods range from (already mentioned) histograms and qq-Plots if you want to stay on the graphical side over more lets say "empirical tests" (multiple sigma events in relation to sample size) to parametric and nonparametric statistical tests. A complete review of these would be, in my opinion, out of scope here (and for some methods definitely also out of my scope) so I will be quite frank here.
Since you were mentioning regression analysis I guess you want to test the normality of the residuals. Just use one of the normality tests on the wiki page. The more popular variants compare skewness and kurtosis to that of a normal distribution. The nonparametric versions are Kolmogorov-Smirnov type of tests that use the empirical cumulative distribution function of your data (probably the residuals). Just look at the wiki page. The standard tests are quite simple to implement.
|
How to determine whether data is slightly or extremely non-normally distributed?
|
Although a wikipedia link might be not considered extremely helpful, the list of methods for testing normality is quite long.
The methods range from (already mentioned) histograms and qq-Plots if you
|
How to determine whether data is slightly or extremely non-normally distributed?
Although a wikipedia link might be not considered extremely helpful, the list of methods for testing normality is quite long.
The methods range from (already mentioned) histograms and qq-Plots if you want to stay on the graphical side over more lets say "empirical tests" (multiple sigma events in relation to sample size) to parametric and nonparametric statistical tests. A complete review of these would be, in my opinion, out of scope here (and for some methods definitely also out of my scope) so I will be quite frank here.
Since you were mentioning regression analysis I guess you want to test the normality of the residuals. Just use one of the normality tests on the wiki page. The more popular variants compare skewness and kurtosis to that of a normal distribution. The nonparametric versions are Kolmogorov-Smirnov type of tests that use the empirical cumulative distribution function of your data (probably the residuals). Just look at the wiki page. The standard tests are quite simple to implement.
|
How to determine whether data is slightly or extremely non-normally distributed?
Although a wikipedia link might be not considered extremely helpful, the list of methods for testing normality is quite long.
The methods range from (already mentioned) histograms and qq-Plots if you
|
39,783
|
How to determine whether data is slightly or extremely non-normally distributed?
|
The Skewness of the Normal distribution is 0. The Kurtosis of the Normal distribution is 0. Those two statistics are concrete measures of distribution characteristics as opposed to subjective plot interpretation. Of course the question remaining is how far from Normal your distribution is for $n$ points and some value of Kurtosis and Skewness.
Hence you will be better off by running some Normality Tests. The Shapiro-Wilk is a sensible choice for univariate data.
If you use R you will find the function shapiro.test() in the stats package useful. The moments package includes the functions skewness() and kurtosis() plus jarque.test() if you want a second opinion after the results of the Shapiro-Wilk test.
|
How to determine whether data is slightly or extremely non-normally distributed?
|
The Skewness of the Normal distribution is 0. The Kurtosis of the Normal distribution is 0. Those two statistics are concrete measures of distribution characteristics as opposed to subjective plot int
|
How to determine whether data is slightly or extremely non-normally distributed?
The Skewness of the Normal distribution is 0. The Kurtosis of the Normal distribution is 0. Those two statistics are concrete measures of distribution characteristics as opposed to subjective plot interpretation. Of course the question remaining is how far from Normal your distribution is for $n$ points and some value of Kurtosis and Skewness.
Hence you will be better off by running some Normality Tests. The Shapiro-Wilk is a sensible choice for univariate data.
If you use R you will find the function shapiro.test() in the stats package useful. The moments package includes the functions skewness() and kurtosis() plus jarque.test() if you want a second opinion after the results of the Shapiro-Wilk test.
|
How to determine whether data is slightly or extremely non-normally distributed?
The Skewness of the Normal distribution is 0. The Kurtosis of the Normal distribution is 0. Those two statistics are concrete measures of distribution characteristics as opposed to subjective plot int
|
39,784
|
How to determine whether data is slightly or extremely non-normally distributed?
|
Here I found some rules of thumb on how to evaluate.
If skewness is:
less than −1 or greater than +1, the distribution is highly skewed.
between −1 and −½ or between +½ and +1, the distribution is moderately skewed.
between −½ and +½, the distribution is approximately symmetric.
|
How to determine whether data is slightly or extremely non-normally distributed?
|
Here I found some rules of thumb on how to evaluate.
If skewness is:
less than −1 or greater than +1, the distribution is highly skewed.
between −1 and −½ or between +½ and +1, the distribution is
|
How to determine whether data is slightly or extremely non-normally distributed?
Here I found some rules of thumb on how to evaluate.
If skewness is:
less than −1 or greater than +1, the distribution is highly skewed.
between −1 and −½ or between +½ and +1, the distribution is moderately skewed.
between −½ and +½, the distribution is approximately symmetric.
|
How to determine whether data is slightly or extremely non-normally distributed?
Here I found some rules of thumb on how to evaluate.
If skewness is:
less than −1 or greater than +1, the distribution is highly skewed.
between −1 and −½ or between +½ and +1, the distribution is
|
39,785
|
Is it okay to compare fitted distributions with the AIC?
|
You have to penalize the model for number of parameters. Let's say you had 30 data points and a model to fit it to that takes 29 parameters to define it. You could fit the data perfectly. But, that's not a terribly fair way to compare it to a uniform distribution with far fewer parameters.
The paper you cite mentions this. Likely you're having trouble making an argument against it because there isn't a good general one. The argument would be against how much you penalize for extra parameters in the model. In that case you may want to examine different kinds of information criteria.
Furthermore, it's also a good idea to look at some other fit measures as well. There's nothing wrong with using multiple ones and making rational arguments when the AIC differences are very small.
|
Is it okay to compare fitted distributions with the AIC?
|
You have to penalize the model for number of parameters. Let's say you had 30 data points and a model to fit it to that takes 29 parameters to define it. You could fit the data perfectly. But, that
|
Is it okay to compare fitted distributions with the AIC?
You have to penalize the model for number of parameters. Let's say you had 30 data points and a model to fit it to that takes 29 parameters to define it. You could fit the data perfectly. But, that's not a terribly fair way to compare it to a uniform distribution with far fewer parameters.
The paper you cite mentions this. Likely you're having trouble making an argument against it because there isn't a good general one. The argument would be against how much you penalize for extra parameters in the model. In that case you may want to examine different kinds of information criteria.
Furthermore, it's also a good idea to look at some other fit measures as well. There's nothing wrong with using multiple ones and making rational arguments when the AIC differences are very small.
|
Is it okay to compare fitted distributions with the AIC?
You have to penalize the model for number of parameters. Let's say you had 30 data points and a model to fit it to that takes 29 parameters to define it. You could fit the data perfectly. But, that
|
39,786
|
Is it okay to compare fitted distributions with the AIC?
|
I'd go further and say it is probably the most widely accepted method for comparing distributions. But you should really use the corrected AIC, which has a piece added to it to adjust for small sample sizes. See Burnham and Anderson 2002, for example.
This site will take a set of numbers and do the comparisons for you, using the corrected AIC mentioned above.
http://www.easydatascience.com/
|
Is it okay to compare fitted distributions with the AIC?
|
I'd go further and say it is probably the most widely accepted method for comparing distributions. But you should really use the corrected AIC, which has a piece added to it to adjust for small sample
|
Is it okay to compare fitted distributions with the AIC?
I'd go further and say it is probably the most widely accepted method for comparing distributions. But you should really use the corrected AIC, which has a piece added to it to adjust for small sample sizes. See Burnham and Anderson 2002, for example.
This site will take a set of numbers and do the comparisons for you, using the corrected AIC mentioned above.
http://www.easydatascience.com/
|
Is it okay to compare fitted distributions with the AIC?
I'd go further and say it is probably the most widely accepted method for comparing distributions. But you should really use the corrected AIC, which has a piece added to it to adjust for small sample
|
39,787
|
How to interpret the confidence interval of a variance F-test using R?
|
The rejection region for a test and a confidence interval are different things. The rejection region is the region where you reject the null hypothesis that the ratio of variances equals $1$. A $100(1-α)\%$ confidence interval is an interval that has the property that in repeated sampling would include the true parameter value in $100(1-α)\%$ of the cases. There is a 1-1 correspondence between a confidence interval and the related hypothesis test but that does not mean that the rejection region equals the confidence region even when the confidence level is the same as the significance level for the test.
|
How to interpret the confidence interval of a variance F-test using R?
|
The rejection region for a test and a confidence interval are different things. The rejection region is the region where you reject the null hypothesis that the ratio of variances equals $1$. A $100
|
How to interpret the confidence interval of a variance F-test using R?
The rejection region for a test and a confidence interval are different things. The rejection region is the region where you reject the null hypothesis that the ratio of variances equals $1$. A $100(1-α)\%$ confidence interval is an interval that has the property that in repeated sampling would include the true parameter value in $100(1-α)\%$ of the cases. There is a 1-1 correspondence between a confidence interval and the related hypothesis test but that does not mean that the rejection region equals the confidence region even when the confidence level is the same as the significance level for the test.
|
How to interpret the confidence interval of a variance F-test using R?
The rejection region for a test and a confidence interval are different things. The rejection region is the region where you reject the null hypothesis that the ratio of variances equals $1$. A $100
|
39,788
|
How to interpret the confidence interval of a variance F-test using R?
|
Your method using qf computes the rejection region that you would compare the ratio of the 2 variance to. Using the central F is the correct thing to do because we calculate the rejection region assuming the null hypothesis is true and if the null (that the variances are equal) is true then we have a central F distribution.
The derivation for the formula for the confidence interval goes along these lines (I only show the lower limit, some slight modifications give the upper limit)
$ \frac{v1}{\sigma_1^2} / \frac{v2}{\sigma_2^2} \sim f(df_1,df_2) $
$ \frac{v1}{v2} \times \frac{\sigma_1^2}{\sigma_2^2} \sim f(df_1,df_2)$
$prob( \frac{v1}{v2} \times \frac{\sigma_2^2}{\sigma_1^2} > f_{0.975} ) = 0.025 $
$prob( \frac{\sigma_1^2}{\sigma_2^2} < \frac{v1}{v2}/f_{0.975} )= 0.025$
So the confidence interval is also based on the central F since it is estimating the ratio of the 2 true variances.
And in R to get the value "manually" you do
vr <- var(s1)/var(s2)
vr/qf(.975,2,3)
which matches the result of var.test()
|
How to interpret the confidence interval of a variance F-test using R?
|
Your method using qf computes the rejection region that you would compare the ratio of the 2 variance to. Using the central F is the correct thing to do because we calculate the rejection region assu
|
How to interpret the confidence interval of a variance F-test using R?
Your method using qf computes the rejection region that you would compare the ratio of the 2 variance to. Using the central F is the correct thing to do because we calculate the rejection region assuming the null hypothesis is true and if the null (that the variances are equal) is true then we have a central F distribution.
The derivation for the formula for the confidence interval goes along these lines (I only show the lower limit, some slight modifications give the upper limit)
$ \frac{v1}{\sigma_1^2} / \frac{v2}{\sigma_2^2} \sim f(df_1,df_2) $
$ \frac{v1}{v2} \times \frac{\sigma_1^2}{\sigma_2^2} \sim f(df_1,df_2)$
$prob( \frac{v1}{v2} \times \frac{\sigma_2^2}{\sigma_1^2} > f_{0.975} ) = 0.025 $
$prob( \frac{\sigma_1^2}{\sigma_2^2} < \frac{v1}{v2}/f_{0.975} )= 0.025$
So the confidence interval is also based on the central F since it is estimating the ratio of the 2 true variances.
And in R to get the value "manually" you do
vr <- var(s1)/var(s2)
vr/qf(.975,2,3)
which matches the result of var.test()
|
How to interpret the confidence interval of a variance F-test using R?
Your method using qf computes the rejection region that you would compare the ratio of the 2 variance to. Using the central F is the correct thing to do because we calculate the rejection region assu
|
39,789
|
Testing whether two regression coefficients are significantly different
|
CHCH's answer is interesting. But would it be simpler to use Fisher's Z transformation and the corresponding difference formula to compare the standardized regression coefficients of the two IVs?
|
Testing whether two regression coefficients are significantly different
|
CHCH's answer is interesting. But would it be simpler to use Fisher's Z transformation and the corresponding difference formula to compare the standardized regression coefficients of the two IVs?
|
Testing whether two regression coefficients are significantly different
CHCH's answer is interesting. But would it be simpler to use Fisher's Z transformation and the corresponding difference formula to compare the standardized regression coefficients of the two IVs?
|
Testing whether two regression coefficients are significantly different
CHCH's answer is interesting. But would it be simpler to use Fisher's Z transformation and the corresponding difference formula to compare the standardized regression coefficients of the two IVs?
|
39,790
|
Testing whether two regression coefficients are significantly different
|
If you have the estimated covariance matrix for the coefficients, then you can construct the t-test as follows. Let the hypothesis, in its general form, be $R^T\beta = b$, and $\widehat{\Sigma} = \hat{\sigma}^2(X^TX)^{-1}$ be the estimated covariance matrix of the coefficients. In your case, assuming the test is that $\beta_2 = \beta_3$ and you have $K=3$ coefficients, $R^T = [0, 1, -1]$ and $b=0$. Then:
$T^* = \frac{R^T\beta - b}{\sqrt{R^T\widehat{\Sigma}R}}$
is distributed $t(N-K)$.
Source: Principles of Econometrics, Theil.
|
Testing whether two regression coefficients are significantly different
|
If you have the estimated covariance matrix for the coefficients, then you can construct the t-test as follows. Let the hypothesis, in its general form, be $R^T\beta = b$, and $\widehat{\Sigma} = \ha
|
Testing whether two regression coefficients are significantly different
If you have the estimated covariance matrix for the coefficients, then you can construct the t-test as follows. Let the hypothesis, in its general form, be $R^T\beta = b$, and $\widehat{\Sigma} = \hat{\sigma}^2(X^TX)^{-1}$ be the estimated covariance matrix of the coefficients. In your case, assuming the test is that $\beta_2 = \beta_3$ and you have $K=3$ coefficients, $R^T = [0, 1, -1]$ and $b=0$. Then:
$T^* = \frac{R^T\beta - b}{\sqrt{R^T\widehat{\Sigma}R}}$
is distributed $t(N-K)$.
Source: Principles of Econometrics, Theil.
|
Testing whether two regression coefficients are significantly different
If you have the estimated covariance matrix for the coefficients, then you can construct the t-test as follows. Let the hypothesis, in its general form, be $R^T\beta = b$, and $\widehat{\Sigma} = \ha
|
39,791
|
Testing whether two regression coefficients are significantly different
|
I believe the correct approach here is to compare the fit of a model where IV(a) and IV(b) are allowed to vary - that is, your present model - with the fit of a model where IV(a) and IV(b) are fit to the same value (in which case the mediator is just an average of the two). The two models can be compared using a Chi-Square difference test.
This is simple enough to be performed by hand - I am not quite sure how to do that last, final step in SPSS. But all of the requisite values for calculating the Chi-Square difference will be available to you in SPSS, and there are several online calculators that could be used for determining the value of this test statistic and its p-value. I hope that helps!
|
Testing whether two regression coefficients are significantly different
|
I believe the correct approach here is to compare the fit of a model where IV(a) and IV(b) are allowed to vary - that is, your present model - with the fit of a model where IV(a) and IV(b) are fit to
|
Testing whether two regression coefficients are significantly different
I believe the correct approach here is to compare the fit of a model where IV(a) and IV(b) are allowed to vary - that is, your present model - with the fit of a model where IV(a) and IV(b) are fit to the same value (in which case the mediator is just an average of the two). The two models can be compared using a Chi-Square difference test.
This is simple enough to be performed by hand - I am not quite sure how to do that last, final step in SPSS. But all of the requisite values for calculating the Chi-Square difference will be available to you in SPSS, and there are several online calculators that could be used for determining the value of this test statistic and its p-value. I hope that helps!
|
Testing whether two regression coefficients are significantly different
I believe the correct approach here is to compare the fit of a model where IV(a) and IV(b) are allowed to vary - that is, your present model - with the fit of a model where IV(a) and IV(b) are fit to
|
39,792
|
Improving recall in a neural network
|
Your second question has been answered; as such I will attempt to answer your first question "Is there anything else that I can do?":
As time is the commodity of most value, I would recommend spending time on identifying the cause rather than randomly changing things on gut feel (precision and recall do not always answer question on bias and variance nor the appropriateness of the model chosen for classification. As such:
In your neural network implementation determine if you have a high bias or variance (e.g., see here), i.e. is your high precision and low recall due to under fitting High bias or over fitting High variance your positive examples as the methods for solving these issues differ from those for high variance, i.e.:
Getting more training examples -Fixes high variance
Trying smaller sets of features -Fixes high variance
Increasing lambda -Fixes high variance
Adding features -Fixes high bias
Adding polynomial features -Fixes high bias
Decreasing lambda -Fixes high bias
Examining the cases that are incorrectly classified can help determine why the model failed to classify these correctly (graphing and colouring the features on 2d plots can help sometimes (feature scaling / compression may be of use/ can make this possible in some cases).
Other good options include using a different architecture on your neural network, a different algorithm or modified features per below:
Consider treating your problem as anomaly detection, i.e. When normalizing your data (chose functions of features $x$ such that you get a Gaussian distribution i.e.:
$f_1(x) = log(x +c) $
$f(x)2 = x.^{1/2}$
...
$f_8(x) = x.^{1/3}$
(check by plotting histograms) also Multivariate Gaussian models may be of value for new features that have some kind of correlation (e.g., see here).
A density detection algorithm could be applied which may better fit your needs than a neural network (a formula for which could be found in Wikipedia per above and in this publicly available article, it is also possible if this method is used to create the 3 subsets of your +- 27 000neg and +- 3000pos examples slightly differently, i.e. allow your training set to have say 60% of the negative examples (16 200) and it would have no positive examples, allow your cross validation set to have (5400 neg and 1500 pos) and your test set to have (5400 neg and 1500pos).
You can use your cross validation set to automatically choose your threshold and allows you to adjust your system and tweak it.
As measures of success consider different evaluation formats and counts (sometimes seeing how items were classified in different measures can help you visualise the problem more clearly):
Calculate your F score (as this may be a good second way to view how well your algorithm is doing since your data set is bias to negative examples the formula for which is simply: $2*((\text{precision}*\text{recall})/(\text{precision} + \text{recall}))$.
And finally use your test set to verify classifiers' ability without any tweaking based on these results.
|
Improving recall in a neural network
|
Your second question has been answered; as such I will attempt to answer your first question "Is there anything else that I can do?":
As time is the commodity of most value, I would recommend spending
|
Improving recall in a neural network
Your second question has been answered; as such I will attempt to answer your first question "Is there anything else that I can do?":
As time is the commodity of most value, I would recommend spending time on identifying the cause rather than randomly changing things on gut feel (precision and recall do not always answer question on bias and variance nor the appropriateness of the model chosen for classification. As such:
In your neural network implementation determine if you have a high bias or variance (e.g., see here), i.e. is your high precision and low recall due to under fitting High bias or over fitting High variance your positive examples as the methods for solving these issues differ from those for high variance, i.e.:
Getting more training examples -Fixes high variance
Trying smaller sets of features -Fixes high variance
Increasing lambda -Fixes high variance
Adding features -Fixes high bias
Adding polynomial features -Fixes high bias
Decreasing lambda -Fixes high bias
Examining the cases that are incorrectly classified can help determine why the model failed to classify these correctly (graphing and colouring the features on 2d plots can help sometimes (feature scaling / compression may be of use/ can make this possible in some cases).
Other good options include using a different architecture on your neural network, a different algorithm or modified features per below:
Consider treating your problem as anomaly detection, i.e. When normalizing your data (chose functions of features $x$ such that you get a Gaussian distribution i.e.:
$f_1(x) = log(x +c) $
$f(x)2 = x.^{1/2}$
...
$f_8(x) = x.^{1/3}$
(check by plotting histograms) also Multivariate Gaussian models may be of value for new features that have some kind of correlation (e.g., see here).
A density detection algorithm could be applied which may better fit your needs than a neural network (a formula for which could be found in Wikipedia per above and in this publicly available article, it is also possible if this method is used to create the 3 subsets of your +- 27 000neg and +- 3000pos examples slightly differently, i.e. allow your training set to have say 60% of the negative examples (16 200) and it would have no positive examples, allow your cross validation set to have (5400 neg and 1500 pos) and your test set to have (5400 neg and 1500pos).
You can use your cross validation set to automatically choose your threshold and allows you to adjust your system and tweak it.
As measures of success consider different evaluation formats and counts (sometimes seeing how items were classified in different measures can help you visualise the problem more clearly):
Calculate your F score (as this may be a good second way to view how well your algorithm is doing since your data set is bias to negative examples the formula for which is simply: $2*((\text{precision}*\text{recall})/(\text{precision} + \text{recall}))$.
And finally use your test set to verify classifiers' ability without any tweaking based on these results.
|
Improving recall in a neural network
Your second question has been answered; as such I will attempt to answer your first question "Is there anything else that I can do?":
As time is the commodity of most value, I would recommend spending
|
39,793
|
Improving recall in a neural network
|
The part of your loss function related to the prediction accuracy is:
sum(sum(y1.*log(r) + (1-y1).*log(1-r)))
Assuming that y1(n) == 1 indicates that test case n is a positive example.
Changing this to:
sum(sum( POS_WEIGHT * (y1 .* log(r)) + (1-y1).*log(1-r)))
will increase the penalty associated with getting a positive example wrong by a factor of POS_WEIGHT. Play around with this value to find something that works, but I'd start with num_negatives / num_positives and go from there.
This technical report found that adjusting the cost penalty was more effective than either up or downsampling in most situations.
|
Improving recall in a neural network
|
The part of your loss function related to the prediction accuracy is:
sum(sum(y1.*log(r) + (1-y1).*log(1-r)))
Assuming that y1(n) == 1 indicates that test case n is a positive example.
Changing this
|
Improving recall in a neural network
The part of your loss function related to the prediction accuracy is:
sum(sum(y1.*log(r) + (1-y1).*log(1-r)))
Assuming that y1(n) == 1 indicates that test case n is a positive example.
Changing this to:
sum(sum( POS_WEIGHT * (y1 .* log(r)) + (1-y1).*log(1-r)))
will increase the penalty associated with getting a positive example wrong by a factor of POS_WEIGHT. Play around with this value to find something that works, but I'd start with num_negatives / num_positives and go from there.
This technical report found that adjusting the cost penalty was more effective than either up or downsampling in most situations.
|
Improving recall in a neural network
The part of your loss function related to the prediction accuracy is:
sum(sum(y1.*log(r) + (1-y1).*log(1-r)))
Assuming that y1(n) == 1 indicates that test case n is a positive example.
Changing this
|
39,794
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
|
Think of a typical clustering situation - a personal interview household survey where the primary sampling unit is the neighborhood or street, for logistic and cost reasons (a simple random sample of households over a nation or even a city is rarely practicable). Obviously sample subjects in the same street do not have the same information as the same number if drawn at random over the whole population, because those in the same street are likely to have in common a range of socio-economic variables (affording the rent/property prices for starters, never mind subtler cultural issues).
Any text on sample design or surveys would have a mathematical demonstration. Sampling in clusters is only done for practical and logistic reasons.
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
|
Think of a typical clustering situation - a personal interview household survey where the primary sampling unit is the neighborhood or street, for logistic and cost reasons (a simple random sample of
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
Think of a typical clustering situation - a personal interview household survey where the primary sampling unit is the neighborhood or street, for logistic and cost reasons (a simple random sample of households over a nation or even a city is rarely practicable). Obviously sample subjects in the same street do not have the same information as the same number if drawn at random over the whole population, because those in the same street are likely to have in common a range of socio-economic variables (affording the rent/property prices for starters, never mind subtler cultural issues).
Any text on sample design or surveys would have a mathematical demonstration. Sampling in clusters is only done for practical and logistic reasons.
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
Think of a typical clustering situation - a personal interview household survey where the primary sampling unit is the neighborhood or street, for logistic and cost reasons (a simple random sample of
|
39,795
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
|
Because if you sample the cluster you just get information about the samples within the cluster. Samples within the cluster are more similar than random samples would be, else they would not be put in the same cluster.
The assumption is that when you cluster your data, the clusters are driven by one or more covariates (which might or might not be observed). So if your data happens to cluster by Factor A and you only sample within a cluster, you will not get any information about the effect of Factor A because all of your samples in the cluster will have the same level for that factor. This explanation is a little simplified, because it assumes clean clustering and assumes we know what drives it, but it should illustrate the point.
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
|
Because if you sample the cluster you just get information about the samples within the cluster. Samples within the cluster are more similar than random samples would be, else they would not be put in
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
Because if you sample the cluster you just get information about the samples within the cluster. Samples within the cluster are more similar than random samples would be, else they would not be put in the same cluster.
The assumption is that when you cluster your data, the clusters are driven by one or more covariates (which might or might not be observed). So if your data happens to cluster by Factor A and you only sample within a cluster, you will not get any information about the effect of Factor A because all of your samples in the cluster will have the same level for that factor. This explanation is a little simplified, because it assumes clean clustering and assumes we know what drives it, but it should illustrate the point.
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
Because if you sample the cluster you just get information about the samples within the cluster. Samples within the cluster are more similar than random samples would be, else they would not be put in
|
39,796
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
|
If you can go through the mathematics of cluster sampling, just follow an explanation of the variance of the total for a cluster survey. See e.g. p. 174 of Lohr's 2nd edition (open the amazon look inside and type "icc" to search for it; the first reference on p. 174 gives you ANOVA table for cluster sampling in a balanced situation). The reference formula (5.7) that Amazon does not show is
$$
\mathbf{V}(\hat t_{\rm cluster}) = N^2(1-\frac nN)\frac{M \, ({\rm MSB})}n
$$
One can construct artificial examples of populations (or rather their cluster structures) when ICC<0, and hence the cluster sample is more efficient than SRS. For instance, the population clustered as $\{ \{1, 6, 8 \}, \{3, 5, 7\}, \{2, 4, 9 \} \}$ will have this weird property:
y = c(1, 6, 8, 3, 5, 7, 2, 4, 9)
i = rep(1:3, each=3)
anova(lm(y~as.factor(i)))
So we see that this population (or rather the way it has been clustered) produces ${\rm MSB}=0$, and hence the variance of the total of the cluster sample of size $m=1$ cluster will be equal to 0, while the variance of the total of the SRS of the same size $n=3$ will be non-zero by that formula you will see on Amazon:
N = length(y)
n = 3
V_SRS = N*N*(1-n/N)*sd(y)*sd(y)/n
The trick is that the mean of each cluster is equal to 5, the population mean (or rather the total of each cluster is equal to 15, as we talk about the variance between cluster totals; it will make a difference in an unbalanced situation), so there indeed is no variability between clusters.
I would suggest that you go through both the derivation of the cluster variance formula, as well as the above computation, step by step, to see how they work, and try to come up with two different cluster structures for the above y so that the cluster sample (i) will be less efficient than SRS (easy), and (ii) have non-zero MSB, unlike my example above, but still be more efficient than SRS (difficult).
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
|
If you can go through the mathematics of cluster sampling, just follow an explanation of the variance of the total for a cluster survey. See e.g. p. 174 of Lohr's 2nd edition (open the amazon look ins
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
If you can go through the mathematics of cluster sampling, just follow an explanation of the variance of the total for a cluster survey. See e.g. p. 174 of Lohr's 2nd edition (open the amazon look inside and type "icc" to search for it; the first reference on p. 174 gives you ANOVA table for cluster sampling in a balanced situation). The reference formula (5.7) that Amazon does not show is
$$
\mathbf{V}(\hat t_{\rm cluster}) = N^2(1-\frac nN)\frac{M \, ({\rm MSB})}n
$$
One can construct artificial examples of populations (or rather their cluster structures) when ICC<0, and hence the cluster sample is more efficient than SRS. For instance, the population clustered as $\{ \{1, 6, 8 \}, \{3, 5, 7\}, \{2, 4, 9 \} \}$ will have this weird property:
y = c(1, 6, 8, 3, 5, 7, 2, 4, 9)
i = rep(1:3, each=3)
anova(lm(y~as.factor(i)))
So we see that this population (or rather the way it has been clustered) produces ${\rm MSB}=0$, and hence the variance of the total of the cluster sample of size $m=1$ cluster will be equal to 0, while the variance of the total of the SRS of the same size $n=3$ will be non-zero by that formula you will see on Amazon:
N = length(y)
n = 3
V_SRS = N*N*(1-n/N)*sd(y)*sd(y)/n
The trick is that the mean of each cluster is equal to 5, the population mean (or rather the total of each cluster is equal to 15, as we talk about the variance between cluster totals; it will make a difference in an unbalanced situation), so there indeed is no variability between clusters.
I would suggest that you go through both the derivation of the cluster variance formula, as well as the above computation, step by step, to see how they work, and try to come up with two different cluster structures for the above y so that the cluster sample (i) will be less efficient than SRS (easy), and (ii) have non-zero MSB, unlike my example above, but still be more efficient than SRS (difficult).
|
Why are samples within a cluster less informative than randomly chosen ones from entire population?
If you can go through the mathematics of cluster sampling, just follow an explanation of the variance of the total for a cluster survey. See e.g. p. 174 of Lohr's 2nd edition (open the amazon look ins
|
39,797
|
Betweenness centrality applied to Amazon books graph
|
The difference between in-degree centrality and closeness centrality - or really any other centrality measure - the answer is that you're identifying different things.
Currently I'm working on betweenness centrality, and it yields quite interesting results, often contradicting degree centrality. But how would you interpret these results? Most important product?
I wouldn't necessarily call it the most important product. To my mind, a better description might be "core" products - those that regardless of what you purchase, it's relatively easy to end up at those books. Looking at your figure, the three most popular nodes are all near the center of your graph. They define places where, as soon as you move outside your sub-field, you have a somewhat higher level book that defines several groups.
Take Visualize This, as its the clearest illustration of this. Even if people don't jointly buy books about Tufte's theories and infographics about trivia, Visualize This is a common foundational book not very far removed from either group.
The same is true with the p-value book. No one jointly buys an "Idiots Guide to a Natural Science" book, a "Popular Statistics" book and a "Biostatistics" book. But all three can and do end up buying What Is a p-value anyway? Its a core book, useful to three different groups of readers.
|
Betweenness centrality applied to Amazon books graph
|
The difference between in-degree centrality and closeness centrality - or really any other centrality measure - the answer is that you're identifying different things.
Currently I'm working on betwee
|
Betweenness centrality applied to Amazon books graph
The difference between in-degree centrality and closeness centrality - or really any other centrality measure - the answer is that you're identifying different things.
Currently I'm working on betweenness centrality, and it yields quite interesting results, often contradicting degree centrality. But how would you interpret these results? Most important product?
I wouldn't necessarily call it the most important product. To my mind, a better description might be "core" products - those that regardless of what you purchase, it's relatively easy to end up at those books. Looking at your figure, the three most popular nodes are all near the center of your graph. They define places where, as soon as you move outside your sub-field, you have a somewhat higher level book that defines several groups.
Take Visualize This, as its the clearest illustration of this. Even if people don't jointly buy books about Tufte's theories and infographics about trivia, Visualize This is a common foundational book not very far removed from either group.
The same is true with the p-value book. No one jointly buys an "Idiots Guide to a Natural Science" book, a "Popular Statistics" book and a "Biostatistics" book. But all three can and do end up buying What Is a p-value anyway? Its a core book, useful to three different groups of readers.
|
Betweenness centrality applied to Amazon books graph
The difference between in-degree centrality and closeness centrality - or really any other centrality measure - the answer is that you're identifying different things.
Currently I'm working on betwee
|
39,798
|
Betweenness centrality applied to Amazon books graph
|
I have spent a fair amount of time looking at social networks (e.g., networks of players in Facebook social games) which involved frequent calculation and comparison of these three measures of Centrality (degree centrality, betweenness centrality, and closeness centrality).
For what it's worth, here's my interpretation of these metrics based on having repeatedly calculated and compared them them for people who play Facebook games.
Degree Centrality: celebrities--nearly always the players sorted in decreasing order of degree centrality, were names i immediately recognized (which might also be because i spend too much time reading yahoo celebrity news and gossip).
to calculate D/C: this metric is just a raw count of the number of edges for a given node.
Closeness Centrality: the players with the highest C/C are for the most part a different group than the group with the highest D/C. In general, players with a high C/C spend a lot of time playing FB games--for the top 5% of players, C/C correlates quite strongly with total sessions or total minutes played.
to calculate C/C: (i) calculate pairwise minimum path length for all nodes in the network (using Dijkstra's algorithm); (ii) for Node A, calculate the mean path length to all other nodes in the network; (iii) Closeness Centrality is equal to one over mean path length divided by maximum path length. Values of C/C range from 0 to 1, with higher numbers indicating lower mean distance
Betweeness Centrality: Once again, i noticed very little correlation between the leaders in this metric and the top scorers in either D/C or C/C.
That doesn't surprise me though given how different is the intuition behind this metric. B/C captures two related concepts. The first is the notion of a "boundary spanner"--e..g, a person is likely to be influential if they bridge two otherwise distinctd, separate sub-networks. "Bottleneck" is the second concept--e.g., a person or company positioned at a distribution bottleneck wields power solely as a result of that position.
To calculate B/C: (i) repeat the first step in the Closeness Centrality calculation above; (ii) from the list of shortest paths calculated in the first step, count the number which includes Node A.
|
Betweenness centrality applied to Amazon books graph
|
I have spent a fair amount of time looking at social networks (e.g., networks of players in Facebook social games) which involved frequent calculation and comparison of these three measures of Central
|
Betweenness centrality applied to Amazon books graph
I have spent a fair amount of time looking at social networks (e.g., networks of players in Facebook social games) which involved frequent calculation and comparison of these three measures of Centrality (degree centrality, betweenness centrality, and closeness centrality).
For what it's worth, here's my interpretation of these metrics based on having repeatedly calculated and compared them them for people who play Facebook games.
Degree Centrality: celebrities--nearly always the players sorted in decreasing order of degree centrality, were names i immediately recognized (which might also be because i spend too much time reading yahoo celebrity news and gossip).
to calculate D/C: this metric is just a raw count of the number of edges for a given node.
Closeness Centrality: the players with the highest C/C are for the most part a different group than the group with the highest D/C. In general, players with a high C/C spend a lot of time playing FB games--for the top 5% of players, C/C correlates quite strongly with total sessions or total minutes played.
to calculate C/C: (i) calculate pairwise minimum path length for all nodes in the network (using Dijkstra's algorithm); (ii) for Node A, calculate the mean path length to all other nodes in the network; (iii) Closeness Centrality is equal to one over mean path length divided by maximum path length. Values of C/C range from 0 to 1, with higher numbers indicating lower mean distance
Betweeness Centrality: Once again, i noticed very little correlation between the leaders in this metric and the top scorers in either D/C or C/C.
That doesn't surprise me though given how different is the intuition behind this metric. B/C captures two related concepts. The first is the notion of a "boundary spanner"--e..g, a person is likely to be influential if they bridge two otherwise distinctd, separate sub-networks. "Bottleneck" is the second concept--e.g., a person or company positioned at a distribution bottleneck wields power solely as a result of that position.
To calculate B/C: (i) repeat the first step in the Closeness Centrality calculation above; (ii) from the list of shortest paths calculated in the first step, count the number which includes Node A.
|
Betweenness centrality applied to Amazon books graph
I have spent a fair amount of time looking at social networks (e.g., networks of players in Facebook social games) which involved frequent calculation and comparison of these three measures of Central
|
39,799
|
Choosing between best two attributes with the same information gain when building decision tree
|
You could look ahead at the information gain of the remaining attributes after a split and select based on that. In general though, if you're using information gain as your splitting criterion, it will be the only thing to look at.
|
Choosing between best two attributes with the same information gain when building decision tree
|
You could look ahead at the information gain of the remaining attributes after a split and select based on that. In general though, if you're using information gain as your splitting criterion, it wil
|
Choosing between best two attributes with the same information gain when building decision tree
You could look ahead at the information gain of the remaining attributes after a split and select based on that. In general though, if you're using information gain as your splitting criterion, it will be the only thing to look at.
|
Choosing between best two attributes with the same information gain when building decision tree
You could look ahead at the information gain of the remaining attributes after a split and select based on that. In general though, if you're using information gain as your splitting criterion, it wil
|
39,800
|
Choosing between best two attributes with the same information gain when building decision tree
|
The answer is simply that the first predictor (as found from left to right in the original data frame) is selected. See this thread for the proof. So, to sort everything out:
Will there be any difference between choosing any of the two
attributes to be a tree node?
No, selecting one or the other makes absolutely no difference.
So for text classification, it will check in the alphabetical order.
This is only true to the extent that (the columns of) the data frame of predictors are ordered alphabetically.
You could look ahead at the information gain of the remaining
attributes after a split and select based on that.
This is not a bad idea and is doable by hand for a small tree, but that's definitely not what's implemented in CART. First, it would be very expensive: imagine for a big tree, all the combinations that one would have to try. More importantly, this goes against the idea of recursive partitioning where at each step, the best predictor can be determined simply as the one that yields the best partition of the current node. This process is conditional on the previous splits (the current node was created by the previous splits); it's not the other way around. CART is inherently greedy and it was shown that looking ahead did not give significantly better results, see this PhD thesis section 2.5.4.
Can you try both trees, and see which creates a better separation at
your terminal nodes and/or builds a tree that fits more closely with
the theoretical understanding you have of your data?
Again, with a large number of predictors, the numbers of trees to try would be immense. Further, machine learning is often used when the understanding of the relationship between input and output variables is very limited (otherwise, an explicit model could be specified, see this paper), so making a decision based on theoretical understanding is most of the time not possible. Finally, CART trees are usually the base models of ensembles such as RForest and Boosting, where large numbers of trees are automatically grown, so it is completely impossible to inject any kind of human-understanding into the tree-building process in these cases.
|
Choosing between best two attributes with the same information gain when building decision tree
|
The answer is simply that the first predictor (as found from left to right in the original data frame) is selected. See this thread for the proof. So, to sort everything out:
Will there be any differ
|
Choosing between best two attributes with the same information gain when building decision tree
The answer is simply that the first predictor (as found from left to right in the original data frame) is selected. See this thread for the proof. So, to sort everything out:
Will there be any difference between choosing any of the two
attributes to be a tree node?
No, selecting one or the other makes absolutely no difference.
So for text classification, it will check in the alphabetical order.
This is only true to the extent that (the columns of) the data frame of predictors are ordered alphabetically.
You could look ahead at the information gain of the remaining
attributes after a split and select based on that.
This is not a bad idea and is doable by hand for a small tree, but that's definitely not what's implemented in CART. First, it would be very expensive: imagine for a big tree, all the combinations that one would have to try. More importantly, this goes against the idea of recursive partitioning where at each step, the best predictor can be determined simply as the one that yields the best partition of the current node. This process is conditional on the previous splits (the current node was created by the previous splits); it's not the other way around. CART is inherently greedy and it was shown that looking ahead did not give significantly better results, see this PhD thesis section 2.5.4.
Can you try both trees, and see which creates a better separation at
your terminal nodes and/or builds a tree that fits more closely with
the theoretical understanding you have of your data?
Again, with a large number of predictors, the numbers of trees to try would be immense. Further, machine learning is often used when the understanding of the relationship between input and output variables is very limited (otherwise, an explicit model could be specified, see this paper), so making a decision based on theoretical understanding is most of the time not possible. Finally, CART trees are usually the base models of ensembles such as RForest and Boosting, where large numbers of trees are automatically grown, so it is completely impossible to inject any kind of human-understanding into the tree-building process in these cases.
|
Choosing between best two attributes with the same information gain when building decision tree
The answer is simply that the first predictor (as found from left to right in the original data frame) is selected. See this thread for the proof. So, to sort everything out:
Will there be any differ
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.