idx
int64
1
56k
question
stringlengths
15
155
answer
stringlengths
2
29.2k
question_cut
stringlengths
15
100
answer_cut
stringlengths
2
200
conversation
stringlengths
47
29.3k
conversation_cut
stringlengths
47
301
33,001
Creating "demo" data from real data: disguising without disfiguring
There are some suggestions: Convert it to dimensionless form. If it goes from 0 to 1 and doesn't have units like furlongs per fortnight or tons of coal attached then it is harder to recognize. Add a small random number to it. When you convolute a gaussian with a gaussian, you just get another gaussian. It doesn't change the essensce of it, but moving from exact values keeps someone googling numbers to try and figure out what it is. I like the idea of rotating it. You could take a lag of some number of time-steps to create a 2d data-set from the 1d data set. You can then use PCA, or SVD (after centering and scaling) to determine a rotation. Once the data is rotated appropriately you have changed the variance and confounded the information in itself. You can report out one of the rotated coordinate axes as the "sample data". You could mix it with strongly formed data from some other source. So if your sample data is stock market data, you could add perturbations based on the weather, or on the variations from the mean of pitch from your favorite soundtrack of the Beatles. Whether or not people can make sense of Nasdaq, they will have trouble making sense of Nasdaq + Beatles.
Creating "demo" data from real data: disguising without disfiguring
There are some suggestions: Convert it to dimensionless form. If it goes from 0 to 1 and doesn't have units like furlongs per fortnight or tons of coal attached then it is harder to recognize. Add a
Creating "demo" data from real data: disguising without disfiguring There are some suggestions: Convert it to dimensionless form. If it goes from 0 to 1 and doesn't have units like furlongs per fortnight or tons of coal attached then it is harder to recognize. Add a small random number to it. When you convolute a gaussian with a gaussian, you just get another gaussian. It doesn't change the essensce of it, but moving from exact values keeps someone googling numbers to try and figure out what it is. I like the idea of rotating it. You could take a lag of some number of time-steps to create a 2d data-set from the 1d data set. You can then use PCA, or SVD (after centering and scaling) to determine a rotation. Once the data is rotated appropriately you have changed the variance and confounded the information in itself. You can report out one of the rotated coordinate axes as the "sample data". You could mix it with strongly formed data from some other source. So if your sample data is stock market data, you could add perturbations based on the weather, or on the variations from the mean of pitch from your favorite soundtrack of the Beatles. Whether or not people can make sense of Nasdaq, they will have trouble making sense of Nasdaq + Beatles.
Creating "demo" data from real data: disguising without disfiguring There are some suggestions: Convert it to dimensionless form. If it goes from 0 to 1 and doesn't have units like furlongs per fortnight or tons of coal attached then it is harder to recognize. Add a
33,002
Creating "demo" data from real data: disguising without disfiguring
I would suggest a two step approach. The first step would be sampling with replacement - similar to the method used in bootstrapping. In R, you could use newdata = sample(olddata, replace = TRUE) You now have a different data set with the same properties as the original. The second step would be to add a random variable centered around zero: newdata = newdata + runif(1, min = -10, max = 10) Any random variable that is symmetric around zero will work and the bounds of the distribution aren't important. At the end, you should have a completely different set of data with the same properties as the old data set.
Creating "demo" data from real data: disguising without disfiguring
I would suggest a two step approach. The first step would be sampling with replacement - similar to the method used in bootstrapping. In R, you could use newdata = sample(olddata, replace = TRUE) Yo
Creating "demo" data from real data: disguising without disfiguring I would suggest a two step approach. The first step would be sampling with replacement - similar to the method used in bootstrapping. In R, you could use newdata = sample(olddata, replace = TRUE) You now have a different data set with the same properties as the original. The second step would be to add a random variable centered around zero: newdata = newdata + runif(1, min = -10, max = 10) Any random variable that is symmetric around zero will work and the bounds of the distribution aren't important. At the end, you should have a completely different set of data with the same properties as the old data set.
Creating "demo" data from real data: disguising without disfiguring I would suggest a two step approach. The first step would be sampling with replacement - similar to the method used in bootstrapping. In R, you could use newdata = sample(olddata, replace = TRUE) Yo
33,003
Unable to fit negative binomial regression in R (attempting to replicate published results)
There is a lot of literature about the stable parameterization of nonlinear models. For some reason this seems to be largely ignored in R. In this case the "design matrix" for the linear predictor benefits from some work. Let $M$ be the design matrix and $p$ be the parameters of the model. The linear predictor for the means $\mu$ is given by $$\mu=\exp(Mp)$$ The reparameterization is accomplished by modified gram-Schmidt which produces a square matrix $\Sigma$ such that $$M=O\Sigma$$ where the columns of $O$ are orthonormal. (In fact some of the columns in this case are 0 so that the method must be modified slightly to deal with this.) Then $$Mp=O\Sigma p$$ Let the new parameters $q$ satisfy $$p=\Sigma q$$ So that the equation for the means becomes $$\mu=\exp(Oq)$$ This parametrization is much more stable and one can fit the model for $q$ and then solve for the $p$. I used this technique to fit the model with AD Model Builder, but it might work with R. In any event, having fit the model one should look at the "residuals" which are the squared difference between each observation and its mean divided by the estimate for the variance. As seems to be common for this type of model there are some huge residuals. I think these should be examined before the results of the paper are taken seriously.
Unable to fit negative binomial regression in R (attempting to replicate published results)
There is a lot of literature about the stable parameterization of nonlinear models. For some reason this seems to be largely ignored in R. In this case the "design matrix" for the linear predictor ben
Unable to fit negative binomial regression in R (attempting to replicate published results) There is a lot of literature about the stable parameterization of nonlinear models. For some reason this seems to be largely ignored in R. In this case the "design matrix" for the linear predictor benefits from some work. Let $M$ be the design matrix and $p$ be the parameters of the model. The linear predictor for the means $\mu$ is given by $$\mu=\exp(Mp)$$ The reparameterization is accomplished by modified gram-Schmidt which produces a square matrix $\Sigma$ such that $$M=O\Sigma$$ where the columns of $O$ are orthonormal. (In fact some of the columns in this case are 0 so that the method must be modified slightly to deal with this.) Then $$Mp=O\Sigma p$$ Let the new parameters $q$ satisfy $$p=\Sigma q$$ So that the equation for the means becomes $$\mu=\exp(Oq)$$ This parametrization is much more stable and one can fit the model for $q$ and then solve for the $p$. I used this technique to fit the model with AD Model Builder, but it might work with R. In any event, having fit the model one should look at the "residuals" which are the squared difference between each observation and its mean divided by the estimate for the variance. As seems to be common for this type of model there are some huge residuals. I think these should be examined before the results of the paper are taken seriously.
Unable to fit negative binomial regression in R (attempting to replicate published results) There is a lot of literature about the stable parameterization of nonlinear models. For some reason this seems to be largely ignored in R. In this case the "design matrix" for the linear predictor ben
33,004
Binomial GLM and different sample sizes
Could you get the correct level of inferences from a Generalized Linear Mixed Model? Treating the advertisement as a practical random effect should introduce the correct level of penalization only on the smaller sampled levels. Those levels with any reasonable magnitude will get the appropriate fixed effect estimates. Assuming the use of lme4 in R, I'm not sure if you'd need to replicate the rows or not. (I'm leaning towards yes). Then you would have something like: glmm.fit <- glmer(success~ns(age,df=6)+(1|advertisement),family=binomial(),data=rep.df) (Notice I splined the age using ns() from splines package since I can't imagine it would actually be linear.)
Binomial GLM and different sample sizes
Could you get the correct level of inferences from a Generalized Linear Mixed Model? Treating the advertisement as a practical random effect should introduce the correct level of penalization only on
Binomial GLM and different sample sizes Could you get the correct level of inferences from a Generalized Linear Mixed Model? Treating the advertisement as a practical random effect should introduce the correct level of penalization only on the smaller sampled levels. Those levels with any reasonable magnitude will get the appropriate fixed effect estimates. Assuming the use of lme4 in R, I'm not sure if you'd need to replicate the rows or not. (I'm leaning towards yes). Then you would have something like: glmm.fit <- glmer(success~ns(age,df=6)+(1|advertisement),family=binomial(),data=rep.df) (Notice I splined the age using ns() from splines package since I can't imagine it would actually be linear.)
Binomial GLM and different sample sizes Could you get the correct level of inferences from a Generalized Linear Mixed Model? Treating the advertisement as a practical random effect should introduce the correct level of penalization only on
33,005
Binomial GLM and different sample sizes
You may want to consider the arcsine transformation of your response. If $X \sim$ Bin($n,p$) then $E(\sin^{-1} (\sqrt{\frac{X+c}{n+2c}})) = \sin^{-1} \sqrt{p} + p^{-1/2}O(c-1/2) + O(p^{-3/2})$ and $n Var(sin^{-1}(\sqrt{\frac{X+c}{n+2c}}) = 1/4 + p^{-1}O(c-3/8) + O(p^{-2})$ Set $c=3/8$ and you have the variance stabilizing transformation. Then you could use a weighted least squares model where $n$ is your weight under the assumption that your variance covariance matrix is heteroskedastic, but diagonal.
Binomial GLM and different sample sizes
You may want to consider the arcsine transformation of your response. If $X \sim$ Bin($n,p$) then $E(\sin^{-1} (\sqrt{\frac{X+c}{n+2c}})) = \sin^{-1} \sqrt{p} + p^{-1/2}O(c-1/2) + O(p^{-3/2})$ and
Binomial GLM and different sample sizes You may want to consider the arcsine transformation of your response. If $X \sim$ Bin($n,p$) then $E(\sin^{-1} (\sqrt{\frac{X+c}{n+2c}})) = \sin^{-1} \sqrt{p} + p^{-1/2}O(c-1/2) + O(p^{-3/2})$ and $n Var(sin^{-1}(\sqrt{\frac{X+c}{n+2c}}) = 1/4 + p^{-1}O(c-3/8) + O(p^{-2})$ Set $c=3/8$ and you have the variance stabilizing transformation. Then you could use a weighted least squares model where $n$ is your weight under the assumption that your variance covariance matrix is heteroskedastic, but diagonal.
Binomial GLM and different sample sizes You may want to consider the arcsine transformation of your response. If $X \sim$ Bin($n,p$) then $E(\sin^{-1} (\sqrt{\frac{X+c}{n+2c}})) = \sin^{-1} \sqrt{p} + p^{-1/2}O(c-1/2) + O(p^{-3/2})$ and
33,006
Binomial GLM and different sample sizes
With so many observations I would be worried about extra-binomial variance, that is, overdispersion. Did you try with a quasibinomial family? That is, change your R code to lrfit.quasi <- glm ( cbind(converted,not_converted) ~ advertisement + age, family = quasibinomial) Can you tell us what happens when you do that? What was the estimated overdispersion factor? I would guess it could be much larger than one, the binomial case. Also, with 1 million observations, I guess there could be some extra structure to the sampling, like different sampling sites, subgroups, differing structure with time, autocorrelation ... That would introduce dependencies which would have to be modeled. You need to tell us much more about how you obtained this data. The binomial model also assumes that the count is exact, with 1 million counts that could easily be false ... That is another source of extrabinomial variance! An alternative to using a quasibinomial model is to use some mixed model (or a negative binomial model). Say, with $n=1000000$ and binomial $p$ around 0.5, then the (binomial) standard error of $\hat{p}$ is around $0.0005$. An error in the count of about $500$ then changes the estimated $p$ with about the same amount, one standard error. That is a count error of about $1 ^0\!\!/\!_{00}$, one in thousand. Even a quite accurate count could give such and larger errors! Are you really sure your counts are without error? If you would investigate what would happen with the fit if you try to model errors in the counts, the last chapter (on optimization) in Venables & Ripley MASS (fourth edition) have some theory and methods for that case.
Binomial GLM and different sample sizes
With so many observations I would be worried about extra-binomial variance, that is, overdispersion. Did you try with a quasibinomial family? That is, change your R code to lrfit.quasi <- glm ( cbi
Binomial GLM and different sample sizes With so many observations I would be worried about extra-binomial variance, that is, overdispersion. Did you try with a quasibinomial family? That is, change your R code to lrfit.quasi <- glm ( cbind(converted,not_converted) ~ advertisement + age, family = quasibinomial) Can you tell us what happens when you do that? What was the estimated overdispersion factor? I would guess it could be much larger than one, the binomial case. Also, with 1 million observations, I guess there could be some extra structure to the sampling, like different sampling sites, subgroups, differing structure with time, autocorrelation ... That would introduce dependencies which would have to be modeled. You need to tell us much more about how you obtained this data. The binomial model also assumes that the count is exact, with 1 million counts that could easily be false ... That is another source of extrabinomial variance! An alternative to using a quasibinomial model is to use some mixed model (or a negative binomial model). Say, with $n=1000000$ and binomial $p$ around 0.5, then the (binomial) standard error of $\hat{p}$ is around $0.0005$. An error in the count of about $500$ then changes the estimated $p$ with about the same amount, one standard error. That is a count error of about $1 ^0\!\!/\!_{00}$, one in thousand. Even a quite accurate count could give such and larger errors! Are you really sure your counts are without error? If you would investigate what would happen with the fit if you try to model errors in the counts, the last chapter (on optimization) in Venables & Ripley MASS (fourth edition) have some theory and methods for that case.
Binomial GLM and different sample sizes With so many observations I would be worried about extra-binomial variance, that is, overdispersion. Did you try with a quasibinomial family? That is, change your R code to lrfit.quasi <- glm ( cbi
33,007
Anova from R output interpretation
From the above, i guess the most important value is Pr(>F), right? Not to me. The idea that the size of the p-value is the most important thing in an ANOVA is pervasive but I think almost entirely misguided. For a start the p-value is a random quantity (moreso when the null is true, when it is uniformly distributed between 0 and 1). As such a lower p-value may not be particularly informative in any case, but even beyond the issue of the size of the p-value things like effect sizes are generally much more important. You may like to read around a bit Cohen, J. (1990). Things I have learned (so far), American Psychologist 45, 1304-1312. Cohen, J. (1994). The earth is round (p < .05). American Psychologist, 49, 997-1003. http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1119478/ http://www.biostat.jhsph.edu/~cfrangak/cominte/goodmanvalues.pdf http://en.wikipedia.org/wiki/Statistical_hypothesis_testing#Ongoing_Controversy -- I didn't really address interpreting the output when a p-value is below $\alpha$. Without saying exactly what hypothesis is being considered, mentioning "significance" seems pointless. In that sense, then it would be preferable to mention the conclusion that results from the rejection of the null. In the case you present, it's hard to interpret without context (I don't even know if V2 is categorical or continuous), but if V2 was continuous I might say something about concluding there's an association between V1 and V2. If V2 was categorical (0-1), I might say something about differences in mean V1 for the two categories, and so on. Now some things NOT to say: is less than 0.05 (95% level) Never call p<0.05 "significant at the 95% level". That's wrong. Nor indeed should you call it 95% anything else. like "I am 95% confident that ...." . Never say that either. It's wrong.
Anova from R output interpretation
From the above, i guess the most important value is Pr(>F), right? Not to me. The idea that the size of the p-value is the most important thing in an ANOVA is pervasive but I think almost entirely m
Anova from R output interpretation From the above, i guess the most important value is Pr(>F), right? Not to me. The idea that the size of the p-value is the most important thing in an ANOVA is pervasive but I think almost entirely misguided. For a start the p-value is a random quantity (moreso when the null is true, when it is uniformly distributed between 0 and 1). As such a lower p-value may not be particularly informative in any case, but even beyond the issue of the size of the p-value things like effect sizes are generally much more important. You may like to read around a bit Cohen, J. (1990). Things I have learned (so far), American Psychologist 45, 1304-1312. Cohen, J. (1994). The earth is round (p < .05). American Psychologist, 49, 997-1003. http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1119478/ http://www.biostat.jhsph.edu/~cfrangak/cominte/goodmanvalues.pdf http://en.wikipedia.org/wiki/Statistical_hypothesis_testing#Ongoing_Controversy -- I didn't really address interpreting the output when a p-value is below $\alpha$. Without saying exactly what hypothesis is being considered, mentioning "significance" seems pointless. In that sense, then it would be preferable to mention the conclusion that results from the rejection of the null. In the case you present, it's hard to interpret without context (I don't even know if V2 is categorical or continuous), but if V2 was continuous I might say something about concluding there's an association between V1 and V2. If V2 was categorical (0-1), I might say something about differences in mean V1 for the two categories, and so on. Now some things NOT to say: is less than 0.05 (95% level) Never call p<0.05 "significant at the 95% level". That's wrong. Nor indeed should you call it 95% anything else. like "I am 95% confident that ...." . Never say that either. It's wrong.
Anova from R output interpretation From the above, i guess the most important value is Pr(>F), right? Not to me. The idea that the size of the p-value is the most important thing in an ANOVA is pervasive but I think almost entirely m
33,008
Anova from R output interpretation
The chunk of output I might look at first is this: Multiple R-squared: 0.073, Adjusted R-squared: 0.065 F-statistic: 9.24 on 1 and 118 DF, p-value: 0.003 It tell you the overall model was significant (F(1,118) = 9.24, p= .003) And V1 is accounting for about 7% of the variance in V2. The effect size (0.039) tells you that if V2 increases by 1, your model predicts V1 will increase (positive relationship) by ~ .04). The standard error on that estimate (0.013) indicates that (roughly), the 95% confidence interval of the effect is CI95 = [.0135, .064] (i.e., .039- 1.96*.013 to .039+ 1.96*.013) The confidence interval doesn't include zero, which jives (as it must) with the p-value. If you want anova output (as you state), you need to ask for that (not a regression summary, which is what summary() gives). anova(), or, from the car package, Anova will give you this. Depending on your purposes, you may prefer car's Anova default output, which give the effect of each variable in your ANOVA as if it was entered last, so-called "type III sums of squares". If we switch to a built-in example using Rs mtcars dataset of car miles per gallon and other data like weight and engine size, you can generate an Anova example: m1 = lm(mpg ~ wt + disp + cyl+gear+am, data = mtcars); Anova(m1) | | Sum Sq| Df| F value| Pr(>F) | |:---------|------:|--:|-------:|-------:| |wt | 58.02| 1| 8.27| 0.01*| |disp | 1.53| 1| 0.22| 0.64 | |cyl | 57.59| 1| 8.21| 0.01*| |gear | 6.02| 1| 0.86| 0.36 | |am | 3.44| 1| 0.49| 0.49 | |Residuals | 182.41| 26| | | This suggests that vehicle weight and number of cylinders are significant factors in vehicle achieved miles per gallon. Of course all these variables are confounded in the cars dataset, showing we really need a theory of fuel consumption to make progress here.
Anova from R output interpretation
The chunk of output I might look at first is this: Multiple R-squared: 0.073, Adjusted R-squared: 0.065 F-statistic: 9.24 on 1 and 118 DF, p-value: 0.003 It tell you the overall model was signif
Anova from R output interpretation The chunk of output I might look at first is this: Multiple R-squared: 0.073, Adjusted R-squared: 0.065 F-statistic: 9.24 on 1 and 118 DF, p-value: 0.003 It tell you the overall model was significant (F(1,118) = 9.24, p= .003) And V1 is accounting for about 7% of the variance in V2. The effect size (0.039) tells you that if V2 increases by 1, your model predicts V1 will increase (positive relationship) by ~ .04). The standard error on that estimate (0.013) indicates that (roughly), the 95% confidence interval of the effect is CI95 = [.0135, .064] (i.e., .039- 1.96*.013 to .039+ 1.96*.013) The confidence interval doesn't include zero, which jives (as it must) with the p-value. If you want anova output (as you state), you need to ask for that (not a regression summary, which is what summary() gives). anova(), or, from the car package, Anova will give you this. Depending on your purposes, you may prefer car's Anova default output, which give the effect of each variable in your ANOVA as if it was entered last, so-called "type III sums of squares". If we switch to a built-in example using Rs mtcars dataset of car miles per gallon and other data like weight and engine size, you can generate an Anova example: m1 = lm(mpg ~ wt + disp + cyl+gear+am, data = mtcars); Anova(m1) | | Sum Sq| Df| F value| Pr(>F) | |:---------|------:|--:|-------:|-------:| |wt | 58.02| 1| 8.27| 0.01*| |disp | 1.53| 1| 0.22| 0.64 | |cyl | 57.59| 1| 8.21| 0.01*| |gear | 6.02| 1| 0.86| 0.36 | |am | 3.44| 1| 0.49| 0.49 | |Residuals | 182.41| 26| | | This suggests that vehicle weight and number of cylinders are significant factors in vehicle achieved miles per gallon. Of course all these variables are confounded in the cars dataset, showing we really need a theory of fuel consumption to make progress here.
Anova from R output interpretation The chunk of output I might look at first is this: Multiple R-squared: 0.073, Adjusted R-squared: 0.065 F-statistic: 9.24 on 1 and 118 DF, p-value: 0.003 It tell you the overall model was signif
33,009
How is the distance formula related to the formula for standard deviation
Any set in which you can define a 'distance' function which satisfies a few properties (distances are positive, symmetric, and additive). Is called a Metric space. $\mathbb{R}^k$ is a metric space with the distance function typically defined to be $d(\mathbf{x},\mathbf{y}) = |\mathbf{x}-\mathbf{y}|$, the norm of the difference (although we can use whatever distance function we want as long as it satisfies the 3 properties, more on that later). The norm is defined to be $|\mathbf{x}| = \sqrt{\sum_{i=1}^n x_i^2}$. That right there looks strangely familiar you might think. So if you have some observed values $\mathbf{x}=x_1,\ldots,x_n$ and if we find the distance between your observed values and their mean, $\mu$ we have $d(\mathbf{x},\mu) = |\mathbf{x}-\mu| = \sqrt{\sum_{i=1}^n (x_i-\mu)^2}$ which is almost like the standard deviation (missing a $1/n$ or $1/(n-1)$. However, we can easily redefine our distance function to be something like $d(\mathbf{x},\mathbf{y}) = +\sqrt{1/n}|\mathbf{x}-\mathbf{y}|$ and it will still have the three properties required to make $\mathbb{R}^k$ a metric space. You might be more familiar with distances in a 2-dimensional space like $\mathbb{R}^2$. In this space we can use the same distance function as above, but since instead of $k$ components we have only 2 the formula simplifies to $d((x_1,y_1), (x_2,y_2)) = \sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$
How is the distance formula related to the formula for standard deviation
Any set in which you can define a 'distance' function which satisfies a few properties (distances are positive, symmetric, and additive). Is called a Metric space. $\mathbb{R}^k$ is a metric space wit
How is the distance formula related to the formula for standard deviation Any set in which you can define a 'distance' function which satisfies a few properties (distances are positive, symmetric, and additive). Is called a Metric space. $\mathbb{R}^k$ is a metric space with the distance function typically defined to be $d(\mathbf{x},\mathbf{y}) = |\mathbf{x}-\mathbf{y}|$, the norm of the difference (although we can use whatever distance function we want as long as it satisfies the 3 properties, more on that later). The norm is defined to be $|\mathbf{x}| = \sqrt{\sum_{i=1}^n x_i^2}$. That right there looks strangely familiar you might think. So if you have some observed values $\mathbf{x}=x_1,\ldots,x_n$ and if we find the distance between your observed values and their mean, $\mu$ we have $d(\mathbf{x},\mu) = |\mathbf{x}-\mu| = \sqrt{\sum_{i=1}^n (x_i-\mu)^2}$ which is almost like the standard deviation (missing a $1/n$ or $1/(n-1)$. However, we can easily redefine our distance function to be something like $d(\mathbf{x},\mathbf{y}) = +\sqrt{1/n}|\mathbf{x}-\mathbf{y}|$ and it will still have the three properties required to make $\mathbb{R}^k$ a metric space. You might be more familiar with distances in a 2-dimensional space like $\mathbb{R}^2$. In this space we can use the same distance function as above, but since instead of $k$ components we have only 2 the formula simplifies to $d((x_1,y_1), (x_2,y_2)) = \sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$
How is the distance formula related to the formula for standard deviation Any set in which you can define a 'distance' function which satisfies a few properties (distances are positive, symmetric, and additive). Is called a Metric space. $\mathbb{R}^k$ is a metric space wit
33,010
Analogues of sensitivity and specificity for continuous outcomes
As the question is still not answered, here are my 2ct: I think here are two different topics mixed into this question: How can I calculate the sensitivity and specificity (or analogous measures) of a continuous diagnostic test in predicting a continuous outcome (e.g., blood pressure) without dichotomizing the outcome? I take it that you want to measure the performance of the model. The model predicts continuous (metric) outcome from some kind of input (happens to be metric in your example as well, but that doesn't really matter here). This is a regression scenario, not a classification. So you better look for performance measures for regression models, sensitivity and specificity are not what you are looking for*. Some regression problems have a "natural" grouping into presence and absence of something, which gives a link to classification. For that you may have a bimodal distribution: lots of cases with absence, and a metric distribution of values for cases of presence. For example, think of a substance that contaminates some product. Many of the product samples will not contain the contaminant, but for those that do, a range of concentrations is observed. However, this is not the case for your example of blood pressure (absence of blood pressure is not a sensible concept here). I'd even guess that blood pressures come in a unimodal distribution. All that points to a regression problem without close link to classification. * With the caveat that both words are used in analytical chemistry for regression (calibration), but with a different meaning: there, the sensitivity is the slope of the calibration/regression function, and specific sometimes means that the method is completely selective, that is it is insensitive to other substances than the analyte, and no cross-sensitivities occur. A. D. McNaught und A. Wilkinson, eds.: Compendium of Chemical Terminology (the “Gold Book”). Blackwell Scientific, 1997. ISBN: 0-9678550-9-8. DOI: doi:10.1351/ goldbook. URL: http://goldbook.iupac.org/. Analogues of sensitivity and specificity for continuous outcomes On the other hand, if the underlying nature of the problem is a classification, you may nevertheless find yourself describing it better by a regression: the regression describes a degree of belonging to the classes (as in fuzzy sets). the regression models (posterior) probability of beloning to the classes (as in logistic regression) your cases can be described as mixtures of the pure classes (very close to "normal" regression, the contamination example above) For these cases it does make sense to extend the concepts behind sensitivity and specificity to "continuous outcome classifiers". The basic idea is to weight each case according to its degree of belonging to the class in question. For sensitivity and specificity that refers to the reference label, for the predictive values to the predicted class memberships. It turns out that this leads to a very close link to regression-type performance measures. We recently described this in C. Beleites, R. Salzer and V. Sergo: Validation of Soft Classification Models using Partial Class Memberships: An Extended Concept of Sensitivity & Co. applied to Grading of Astrocytoma Tissues Chemom. Intell. Lab. Syst., 122 (2013), 12 - 22. The link points to the home page of the R package implementing the proposed perfromance measures. Again, the blood pressure example IMHO is not adequately described as classification problem. However, you may still want to read the paper - I think the formulation of the reference values there will make clear that blood pressure is not sensibly described in a way that is suitable for classification. (If you formulate a continuous degree of "high blood pressure" that would itself be a model, and a different one from the problem you describe.) I had only a quick glance at the paper you linked, but if I understood correctly the authors use thresholds (dichotomize) for both modeling strategies: for the continuous prediction is further processed: a prediction interval is calculated and compared to some threshold. In the end, they have a dichotomous prediction, and generate the ROC by varying the specification for the interval. As you specify that you want to avoid this, the paper doesn't seem to be overly relevant.
Analogues of sensitivity and specificity for continuous outcomes
As the question is still not answered, here are my 2ct: I think here are two different topics mixed into this question: How can I calculate the sensitivity and specificity (or analogous measures) of
Analogues of sensitivity and specificity for continuous outcomes As the question is still not answered, here are my 2ct: I think here are two different topics mixed into this question: How can I calculate the sensitivity and specificity (or analogous measures) of a continuous diagnostic test in predicting a continuous outcome (e.g., blood pressure) without dichotomizing the outcome? I take it that you want to measure the performance of the model. The model predicts continuous (metric) outcome from some kind of input (happens to be metric in your example as well, but that doesn't really matter here). This is a regression scenario, not a classification. So you better look for performance measures for regression models, sensitivity and specificity are not what you are looking for*. Some regression problems have a "natural" grouping into presence and absence of something, which gives a link to classification. For that you may have a bimodal distribution: lots of cases with absence, and a metric distribution of values for cases of presence. For example, think of a substance that contaminates some product. Many of the product samples will not contain the contaminant, but for those that do, a range of concentrations is observed. However, this is not the case for your example of blood pressure (absence of blood pressure is not a sensible concept here). I'd even guess that blood pressures come in a unimodal distribution. All that points to a regression problem without close link to classification. * With the caveat that both words are used in analytical chemistry for regression (calibration), but with a different meaning: there, the sensitivity is the slope of the calibration/regression function, and specific sometimes means that the method is completely selective, that is it is insensitive to other substances than the analyte, and no cross-sensitivities occur. A. D. McNaught und A. Wilkinson, eds.: Compendium of Chemical Terminology (the “Gold Book”). Blackwell Scientific, 1997. ISBN: 0-9678550-9-8. DOI: doi:10.1351/ goldbook. URL: http://goldbook.iupac.org/. Analogues of sensitivity and specificity for continuous outcomes On the other hand, if the underlying nature of the problem is a classification, you may nevertheless find yourself describing it better by a regression: the regression describes a degree of belonging to the classes (as in fuzzy sets). the regression models (posterior) probability of beloning to the classes (as in logistic regression) your cases can be described as mixtures of the pure classes (very close to "normal" regression, the contamination example above) For these cases it does make sense to extend the concepts behind sensitivity and specificity to "continuous outcome classifiers". The basic idea is to weight each case according to its degree of belonging to the class in question. For sensitivity and specificity that refers to the reference label, for the predictive values to the predicted class memberships. It turns out that this leads to a very close link to regression-type performance measures. We recently described this in C. Beleites, R. Salzer and V. Sergo: Validation of Soft Classification Models using Partial Class Memberships: An Extended Concept of Sensitivity & Co. applied to Grading of Astrocytoma Tissues Chemom. Intell. Lab. Syst., 122 (2013), 12 - 22. The link points to the home page of the R package implementing the proposed perfromance measures. Again, the blood pressure example IMHO is not adequately described as classification problem. However, you may still want to read the paper - I think the formulation of the reference values there will make clear that blood pressure is not sensibly described in a way that is suitable for classification. (If you formulate a continuous degree of "high blood pressure" that would itself be a model, and a different one from the problem you describe.) I had only a quick glance at the paper you linked, but if I understood correctly the authors use thresholds (dichotomize) for both modeling strategies: for the continuous prediction is further processed: a prediction interval is calculated and compared to some threshold. In the end, they have a dichotomous prediction, and generate the ROC by varying the specification for the interval. As you specify that you want to avoid this, the paper doesn't seem to be overly relevant.
Analogues of sensitivity and specificity for continuous outcomes As the question is still not answered, here are my 2ct: I think here are two different topics mixed into this question: How can I calculate the sensitivity and specificity (or analogous measures) of
33,011
Analogues of sensitivity and specificity for continuous outcomes
Trying to do this with continuous variables will expose the severe problems with backwards time-order measures even in the binary case (i.e., predicting X from Y in general).
Analogues of sensitivity and specificity for continuous outcomes
Trying to do this with continuous variables will expose the severe problems with backwards time-order measures even in the binary case (i.e., predicting X from Y in general).
Analogues of sensitivity and specificity for continuous outcomes Trying to do this with continuous variables will expose the severe problems with backwards time-order measures even in the binary case (i.e., predicting X from Y in general).
Analogues of sensitivity and specificity for continuous outcomes Trying to do this with continuous variables will expose the severe problems with backwards time-order measures even in the binary case (i.e., predicting X from Y in general).
33,012
Analogues of sensitivity and specificity for continuous outcomes
Taken loosely, sensitivity means the ability to respond to something if it's present, and specificity means the ability to suppress responding when it's absent. For continuous variables, sensitivity corresponds to the slope of the regression of the obtained measures on the true values of the variable being measured, and specificity corresponds to the standard error of measurement (i.e., the standard deviation of the obtained measures when the quantity being measured does not vary). EDIT, responding to comments by Frank Harrell and cbeleites. I was trying to give conceptual analogs of sensitivity and specificity. For continuous variables, the basic idea of sensitivity is that if two objects (or the same object at different times or under different conditions, etc) differ on the variable we are trying to measure, then our obtained measures should also differ, with bigger true differences leading to bigger measured differences. The regression of any variable, say $Y$, on any other, say $X$, is simply the conditional expected value, $\mathrm{E}\,Y|X$, treated as a function of $X$. The sensitivity of $Y$ to $X$ is the slope of that function -- i.e., its derivative with respect to $X$ -- evaluated at whatever values of $X$ are of interest, and possibly averaged with weights that reflect the relative importance or frequency of occurrence of different $X$-values. The basic idea of specificity is the converse of sensitivity: if $Y$ has high specificity and there are no true differences on $X$ then all our measured $Y$-values should be the same, regardless of whatever differences there may be among the objects on variables other than $X$; $Y$ should not respond to those differences. When $X$ is constant, higher variability among the $Y$-values implies lower specificity. The conditional standard deviation -- i.e., the s.d. of $Y|X$, again treated as a function of $X$ -- is an inverse measure of specificity. The ratio of the conditional slope over the conditional s.d. is a signal-to-noise ratio, and its square is referred to in psychometrics as the information function.
Analogues of sensitivity and specificity for continuous outcomes
Taken loosely, sensitivity means the ability to respond to something if it's present, and specificity means the ability to suppress responding when it's absent. For continuous variables, sensitivity c
Analogues of sensitivity and specificity for continuous outcomes Taken loosely, sensitivity means the ability to respond to something if it's present, and specificity means the ability to suppress responding when it's absent. For continuous variables, sensitivity corresponds to the slope of the regression of the obtained measures on the true values of the variable being measured, and specificity corresponds to the standard error of measurement (i.e., the standard deviation of the obtained measures when the quantity being measured does not vary). EDIT, responding to comments by Frank Harrell and cbeleites. I was trying to give conceptual analogs of sensitivity and specificity. For continuous variables, the basic idea of sensitivity is that if two objects (or the same object at different times or under different conditions, etc) differ on the variable we are trying to measure, then our obtained measures should also differ, with bigger true differences leading to bigger measured differences. The regression of any variable, say $Y$, on any other, say $X$, is simply the conditional expected value, $\mathrm{E}\,Y|X$, treated as a function of $X$. The sensitivity of $Y$ to $X$ is the slope of that function -- i.e., its derivative with respect to $X$ -- evaluated at whatever values of $X$ are of interest, and possibly averaged with weights that reflect the relative importance or frequency of occurrence of different $X$-values. The basic idea of specificity is the converse of sensitivity: if $Y$ has high specificity and there are no true differences on $X$ then all our measured $Y$-values should be the same, regardless of whatever differences there may be among the objects on variables other than $X$; $Y$ should not respond to those differences. When $X$ is constant, higher variability among the $Y$-values implies lower specificity. The conditional standard deviation -- i.e., the s.d. of $Y|X$, again treated as a function of $X$ -- is an inverse measure of specificity. The ratio of the conditional slope over the conditional s.d. is a signal-to-noise ratio, and its square is referred to in psychometrics as the information function.
Analogues of sensitivity and specificity for continuous outcomes Taken loosely, sensitivity means the ability to respond to something if it's present, and specificity means the ability to suppress responding when it's absent. For continuous variables, sensitivity c
33,013
"forgetfulness" of the prior in the Bayesian setting?
Just a rough, but hopefully intuitive answer. Look at it from the log-space point of view: $$ -\log P(\theta|x_1, \ldots, x_n) = -\log P(\theta) -\sum_{i=1}^n \log P(x_i|\theta) - C_n $$ where $C_n>0$ is a constant that depends on the data, but not on the parameter, and where your likelihoods assume i.i.d. observations. Hence, just concentrate on the part that determines the shape of your posterior, namely $$ S_n = -\log P(\theta) -\sum_{i=1}^n \log P(x_i|\theta) $$ Assume that there is a $D>0$ such that $-\log P(\theta) \leq D$. This is reasonable for discrete distributions. Since the terms are all positive, $S_n$ "will" grow (I'm skipping the technicalities here). But the contribution of the prior is bounded by $D$. Hence, the fraction contributed by the prior, which is at most $D/S_n$, decreases monotonically with each additional observation. Rigorous proofs of course have to face the technicalities (and they can be very difficult), but the setting above is IMHO the very basic part.
"forgetfulness" of the prior in the Bayesian setting?
Just a rough, but hopefully intuitive answer. Look at it from the log-space point of view: $$ -\log P(\theta|x_1, \ldots, x_n) = -\log P(\theta) -\sum_{i=1}^n \log P(x_i|\theta) - C_n $$ where
"forgetfulness" of the prior in the Bayesian setting? Just a rough, but hopefully intuitive answer. Look at it from the log-space point of view: $$ -\log P(\theta|x_1, \ldots, x_n) = -\log P(\theta) -\sum_{i=1}^n \log P(x_i|\theta) - C_n $$ where $C_n>0$ is a constant that depends on the data, but not on the parameter, and where your likelihoods assume i.i.d. observations. Hence, just concentrate on the part that determines the shape of your posterior, namely $$ S_n = -\log P(\theta) -\sum_{i=1}^n \log P(x_i|\theta) $$ Assume that there is a $D>0$ such that $-\log P(\theta) \leq D$. This is reasonable for discrete distributions. Since the terms are all positive, $S_n$ "will" grow (I'm skipping the technicalities here). But the contribution of the prior is bounded by $D$. Hence, the fraction contributed by the prior, which is at most $D/S_n$, decreases monotonically with each additional observation. Rigorous proofs of course have to face the technicalities (and they can be very difficult), but the setting above is IMHO the very basic part.
"forgetfulness" of the prior in the Bayesian setting? Just a rough, but hopefully intuitive answer. Look at it from the log-space point of view: $$ -\log P(\theta|x_1, \ldots, x_n) = -\log P(\theta) -\sum_{i=1}^n \log P(x_i|\theta) - C_n $$ where
33,014
"forgetfulness" of the prior in the Bayesian setting?
I am somewhat confused by what the statements the "prior is forgetten" and "most of the inference is impacted by the evidence" are supposed to mean. I assume you mean as the amount of data increases, the (sequence of) estimator(s) approaches the true value of the parameter regardless of our prior. Assuming some regularity conditions on the form of the posterior distribution, Bayes Estimators are consistent and asymptotically unbiased (see Gelman et al, chapter 4). This means as the sample size increases the bayes estimator approaches the true value of the parameter. Consistency means the bayes estimator converges in probability to the true parameter value and asymptotic unbiasedness means that, assuming $\theta_0$ is the true value of the parameter, $$ \frac{E[\hat{\theta}|\theta_0]-\theta_0}{\sqrt{\mathrm{Var}(\hat{\theta})}}\overset{p}\rightarrow0 $$ The convergence does not depend on the specific form of the prior, but only that the posterior distribution obtained from the prior and the likelihood satisfy the regularity conditions. The most important regularity condition mentioned in Gelman et al is that the likelihood be a continuous function of the parameter and the true value of the parameter be in the interior of the parameter space. Also, as you noted, the posterior must be nonzero in an open neighborhood of the true value of the true value of the parameter. Usually, your prior should be nonzero on the entire parameter space.
"forgetfulness" of the prior in the Bayesian setting?
I am somewhat confused by what the statements the "prior is forgetten" and "most of the inference is impacted by the evidence" are supposed to mean. I assume you mean as the amount of data increases,
"forgetfulness" of the prior in the Bayesian setting? I am somewhat confused by what the statements the "prior is forgetten" and "most of the inference is impacted by the evidence" are supposed to mean. I assume you mean as the amount of data increases, the (sequence of) estimator(s) approaches the true value of the parameter regardless of our prior. Assuming some regularity conditions on the form of the posterior distribution, Bayes Estimators are consistent and asymptotically unbiased (see Gelman et al, chapter 4). This means as the sample size increases the bayes estimator approaches the true value of the parameter. Consistency means the bayes estimator converges in probability to the true parameter value and asymptotic unbiasedness means that, assuming $\theta_0$ is the true value of the parameter, $$ \frac{E[\hat{\theta}|\theta_0]-\theta_0}{\sqrt{\mathrm{Var}(\hat{\theta})}}\overset{p}\rightarrow0 $$ The convergence does not depend on the specific form of the prior, but only that the posterior distribution obtained from the prior and the likelihood satisfy the regularity conditions. The most important regularity condition mentioned in Gelman et al is that the likelihood be a continuous function of the parameter and the true value of the parameter be in the interior of the parameter space. Also, as you noted, the posterior must be nonzero in an open neighborhood of the true value of the true value of the parameter. Usually, your prior should be nonzero on the entire parameter space.
"forgetfulness" of the prior in the Bayesian setting? I am somewhat confused by what the statements the "prior is forgetten" and "most of the inference is impacted by the evidence" are supposed to mean. I assume you mean as the amount of data increases,
33,015
Determine the optimum learning rate for gradient descent in linear regression
(Years later) look up the Barzilai-Borwein step size method; onmyphd.com has a nice 3-page description. The author says this approach works well, even for large dimensional problems but it's terrible for his applet of the 2d Rosenbrock function. If anyone uses Barzilai-Borwein, please comment.
Determine the optimum learning rate for gradient descent in linear regression
(Years later) look up the Barzilai-Borwein step size method; onmyphd.com has a nice 3-page description. The author says this approach works well, even for large dimensional problems but it's terribl
Determine the optimum learning rate for gradient descent in linear regression (Years later) look up the Barzilai-Borwein step size method; onmyphd.com has a nice 3-page description. The author says this approach works well, even for large dimensional problems but it's terrible for his applet of the 2d Rosenbrock function. If anyone uses Barzilai-Borwein, please comment.
Determine the optimum learning rate for gradient descent in linear regression (Years later) look up the Barzilai-Borwein step size method; onmyphd.com has a nice 3-page description. The author says this approach works well, even for large dimensional problems but it's terribl
33,016
Determine the optimum learning rate for gradient descent in linear regression
You are on the right track. A common approach is to double the step size whenever you take a successful downhill step and halve the step size when you accidentally go "too far." You could scale by some factor other than 2, of course, but it generally won't make a big difference. More sophisticated optimization methods will likely speed up convergence quite a bit, but if you have to roll your own update for some reason the above is attractively simple and often good enough.
Determine the optimum learning rate for gradient descent in linear regression
You are on the right track. A common approach is to double the step size whenever you take a successful downhill step and halve the step size when you accidentally go "too far." You could scale by som
Determine the optimum learning rate for gradient descent in linear regression You are on the right track. A common approach is to double the step size whenever you take a successful downhill step and halve the step size when you accidentally go "too far." You could scale by some factor other than 2, of course, but it generally won't make a big difference. More sophisticated optimization methods will likely speed up convergence quite a bit, but if you have to roll your own update for some reason the above is attractively simple and often good enough.
Determine the optimum learning rate for gradient descent in linear regression You are on the right track. A common approach is to double the step size whenever you take a successful downhill step and halve the step size when you accidentally go "too far." You could scale by som
33,017
When submitting analyses to FDA how does using R affect issues of software validation?
We have done tons of submission to the FDA with R. The Agency do not prefer a software versus the other.
When submitting analyses to FDA how does using R affect issues of software validation?
We have done tons of submission to the FDA with R. The Agency do not prefer a software versus the other.
When submitting analyses to FDA how does using R affect issues of software validation? We have done tons of submission to the FDA with R. The Agency do not prefer a software versus the other.
When submitting analyses to FDA how does using R affect issues of software validation? We have done tons of submission to the FDA with R. The Agency do not prefer a software versus the other.
33,018
Identification of parameters problem
Lets first define the following objects: In a statistical model $M$ that is used to model $Y$ as a function of $X$, there are $p$ parameters denoted by vector $\theta$. These parameters are allowed to vary within the parameter space $\Theta \subset \mathbb{R^p}$. We are not interested in estimation of all these parameters, but only of a certain subset, say in $q \leq p$ of the parameters that we denote $\theta^0$ and that varies within the parameter space $\Theta^0 \subset \mathbb{R^q}$. In our model $M$ the variables $X$ and the parameters $\theta$ will now be mapped such as to explain $Y$. This mapping is defined by $M$ and the parameters. Within this setting, identifiability says something about Observational Equivalence. In particular, if parameters $\theta^0$ are identifiable w.r.t. $M$ then it will hold that $\nexists \theta^1 \in \Theta^0: \theta^1 \neq \theta^0, M(\theta^0) = M(\theta^1)$. In words, there does not exist a different parameter vector $\theta^1$ that would induce the same data generating process, given our model specification $M$. To make these concepts more conceivable, I give two examples. Example 1: Define for $\theta = (a,b)$; $X\sim N(\mu, \sigma^2I_{n}); \varepsilon \sim N(0, \sigma_e^2 I_{n})$ the simple statistical model $M$: \begin{align} Y = a+Xb+\varepsilon \end{align} and suppose that $(a,b) \in \mathbb{R^2}$ (so $\Theta = \mathbb{R^2}$). It is clear that whether $\theta^0 = (a,b)$ or $\theta^0 = a$, it will always hold that $\theta^0$ is identifiable: The process generating $Y$ from $X$ has a $1:1$ relationship with the parameters $a$ and $b$. Fixing $(a,b)$, it will not be possible to find a second tuple in $\mathbb{R}$ describing the same Data Generating Process. Example 2: Define for $\theta = (a,b,c)$; $X\sim N(\mu, \sigma^2I_{n}); \varepsilon \sim N(0, \sigma_e^2 I_{n})$ the more tricky statistical model $M'$: \begin{align} Y = a+X(\frac{b}{c})+\varepsilon \end{align} and suppose that $(a,b) \in \mathbb{R^2}$ and $c \in \mathbb{R}\setminus\{0\}$ (so $\Theta = \mathbb{R^3}\setminus\{(l,m,0)| (l,m) \in \mathbb{R^2}\}$). While for $\theta^0$, this would be an identifiable statistical model, this does not hold if one includes another parameter (i.e., $b$ or $c$). Why? Because for any pair of $(b,c)$, there exist infinitely many other pairs in the set $B:=\{(x,y)|(x/y) = (b/c), (x,y)\in\mathbb{R}^2\}$. The obvious solution to the problem in this case would be to introduce a new parameter $d = b/c$ replacing the fraction to identify the model. However, one might be interested in $b$ and $c$ as separate parameters for theoretical reasons - the parameters could correspond to parameters of interest in an (economic) theory sense. (E.g., $b$ could be 'propensity to consume' and $c$ could be 'confidence', and you might want to estimate these two quantities from your regression model. Unfortunately, this would not be possible.)
Identification of parameters problem
Lets first define the following objects: In a statistical model $M$ that is used to model $Y$ as a function of $X$, there are $p$ parameters denoted by vector $\theta$. These parameters are allowed to
Identification of parameters problem Lets first define the following objects: In a statistical model $M$ that is used to model $Y$ as a function of $X$, there are $p$ parameters denoted by vector $\theta$. These parameters are allowed to vary within the parameter space $\Theta \subset \mathbb{R^p}$. We are not interested in estimation of all these parameters, but only of a certain subset, say in $q \leq p$ of the parameters that we denote $\theta^0$ and that varies within the parameter space $\Theta^0 \subset \mathbb{R^q}$. In our model $M$ the variables $X$ and the parameters $\theta$ will now be mapped such as to explain $Y$. This mapping is defined by $M$ and the parameters. Within this setting, identifiability says something about Observational Equivalence. In particular, if parameters $\theta^0$ are identifiable w.r.t. $M$ then it will hold that $\nexists \theta^1 \in \Theta^0: \theta^1 \neq \theta^0, M(\theta^0) = M(\theta^1)$. In words, there does not exist a different parameter vector $\theta^1$ that would induce the same data generating process, given our model specification $M$. To make these concepts more conceivable, I give two examples. Example 1: Define for $\theta = (a,b)$; $X\sim N(\mu, \sigma^2I_{n}); \varepsilon \sim N(0, \sigma_e^2 I_{n})$ the simple statistical model $M$: \begin{align} Y = a+Xb+\varepsilon \end{align} and suppose that $(a,b) \in \mathbb{R^2}$ (so $\Theta = \mathbb{R^2}$). It is clear that whether $\theta^0 = (a,b)$ or $\theta^0 = a$, it will always hold that $\theta^0$ is identifiable: The process generating $Y$ from $X$ has a $1:1$ relationship with the parameters $a$ and $b$. Fixing $(a,b)$, it will not be possible to find a second tuple in $\mathbb{R}$ describing the same Data Generating Process. Example 2: Define for $\theta = (a,b,c)$; $X\sim N(\mu, \sigma^2I_{n}); \varepsilon \sim N(0, \sigma_e^2 I_{n})$ the more tricky statistical model $M'$: \begin{align} Y = a+X(\frac{b}{c})+\varepsilon \end{align} and suppose that $(a,b) \in \mathbb{R^2}$ and $c \in \mathbb{R}\setminus\{0\}$ (so $\Theta = \mathbb{R^3}\setminus\{(l,m,0)| (l,m) \in \mathbb{R^2}\}$). While for $\theta^0$, this would be an identifiable statistical model, this does not hold if one includes another parameter (i.e., $b$ or $c$). Why? Because for any pair of $(b,c)$, there exist infinitely many other pairs in the set $B:=\{(x,y)|(x/y) = (b/c), (x,y)\in\mathbb{R}^2\}$. The obvious solution to the problem in this case would be to introduce a new parameter $d = b/c$ replacing the fraction to identify the model. However, one might be interested in $b$ and $c$ as separate parameters for theoretical reasons - the parameters could correspond to parameters of interest in an (economic) theory sense. (E.g., $b$ could be 'propensity to consume' and $c$ could be 'confidence', and you might want to estimate these two quantities from your regression model. Unfortunately, this would not be possible.)
Identification of parameters problem Lets first define the following objects: In a statistical model $M$ that is used to model $Y$ as a function of $X$, there are $p$ parameters denoted by vector $\theta$. These parameters are allowed to
33,019
Simultaneous heteroscedasticity and heavy tails in a regression model
Heteroscedasticity and leptokurtosis are easily conflated in data analysis. Take a data model which generates an error term as Cauchy. This meets the criteria for homoscedasticty. The Cauchy distribution has infinite variance. A Cauchy error is a simulator's way of including an outlier-sampling process. With these heavy tailed errors, even when you fit the correct mean model, the outlier leads to a large residual. A test of heteroscedasticity has greatly inflated type I error under this model. A Cauchy distribution also has a scale parameter. Generating error terms with a linear increase in scale produces heteroscedastic data, but the power to detect such effects is practically null so the type II error is inflated as well. Let me suggest then, the proper data analytic approach isn't to become mired in tests. Statistical tests are primarily misleading. No where is this more obvious than tests intended to verify secondary modeling assumptions. They are no substitution for common sense. For your data, you can plainly see two large residuals. Their effect on the trend is minimal as few if any residuals are offset in a linear departure from the 0 line in the plot of residuals vs. fitted. That is all you need to know. What is desired then is a means of estimating a flexible variance model that will allow you to create prediction intervals over a range of fitted responses. Interestingly, this approach is capable of handling most sane forms of both heteroscedasticity and kurtotis. Why not then use a smoothing spline approach to estimating the mean squared error. Take the following example: set.seed(123) x <- sort(rexp(100)) y <- rcauchy(100, 10*x) f <- lm(y ~ x) abline(f, col='red') p <- predict(f) r <- residuals(f)^2 s <- smooth.spline(x=p, y=r) phi <- p + 1.96*sqrt(s$y) plo <- p - 1.96*sqrt(s$y) par(mfrow=c(2,1)) plot(p, r, xlab='Fitted', ylab='Squared-residuals') lines(s, col='red') legend('topleft', lty=1, col='red', "predicted variance") plot(x,y, ylim=range(c(plo, phi), na.rm=T)) abline(f, col='red') lines(x, plo, col='red', lty=2) lines(x, phi, col='red', lty=2) Gives the following prediction interval that "widens up" to accommodate the outlier. It is still a consistent estimator of the variance and usefully tells people, "Hey there's this big, wonky observation around X=4 and we can't predict values very usefully there."
Simultaneous heteroscedasticity and heavy tails in a regression model
Heteroscedasticity and leptokurtosis are easily conflated in data analysis. Take a data model which generates an error term as Cauchy. This meets the criteria for homoscedasticty. The Cauchy distribut
Simultaneous heteroscedasticity and heavy tails in a regression model Heteroscedasticity and leptokurtosis are easily conflated in data analysis. Take a data model which generates an error term as Cauchy. This meets the criteria for homoscedasticty. The Cauchy distribution has infinite variance. A Cauchy error is a simulator's way of including an outlier-sampling process. With these heavy tailed errors, even when you fit the correct mean model, the outlier leads to a large residual. A test of heteroscedasticity has greatly inflated type I error under this model. A Cauchy distribution also has a scale parameter. Generating error terms with a linear increase in scale produces heteroscedastic data, but the power to detect such effects is practically null so the type II error is inflated as well. Let me suggest then, the proper data analytic approach isn't to become mired in tests. Statistical tests are primarily misleading. No where is this more obvious than tests intended to verify secondary modeling assumptions. They are no substitution for common sense. For your data, you can plainly see two large residuals. Their effect on the trend is minimal as few if any residuals are offset in a linear departure from the 0 line in the plot of residuals vs. fitted. That is all you need to know. What is desired then is a means of estimating a flexible variance model that will allow you to create prediction intervals over a range of fitted responses. Interestingly, this approach is capable of handling most sane forms of both heteroscedasticity and kurtotis. Why not then use a smoothing spline approach to estimating the mean squared error. Take the following example: set.seed(123) x <- sort(rexp(100)) y <- rcauchy(100, 10*x) f <- lm(y ~ x) abline(f, col='red') p <- predict(f) r <- residuals(f)^2 s <- smooth.spline(x=p, y=r) phi <- p + 1.96*sqrt(s$y) plo <- p - 1.96*sqrt(s$y) par(mfrow=c(2,1)) plot(p, r, xlab='Fitted', ylab='Squared-residuals') lines(s, col='red') legend('topleft', lty=1, col='red', "predicted variance") plot(x,y, ylim=range(c(plo, phi), na.rm=T)) abline(f, col='red') lines(x, plo, col='red', lty=2) lines(x, phi, col='red', lty=2) Gives the following prediction interval that "widens up" to accommodate the outlier. It is still a consistent estimator of the variance and usefully tells people, "Hey there's this big, wonky observation around X=4 and we can't predict values very usefully there."
Simultaneous heteroscedasticity and heavy tails in a regression model Heteroscedasticity and leptokurtosis are easily conflated in data analysis. Take a data model which generates an error term as Cauchy. This meets the criteria for homoscedasticty. The Cauchy distribut
33,020
Simultaneous heteroscedasticity and heavy tails in a regression model
Given heteroscedasticity and outliers, If you seek a hypotheses testing of model coefficients, use robust standard errors generated by {sandwich} package like in lmtest::coeftest(lm(), vcov. = vcovHC(lm(), type = "HC1")). If you seek the regression line representing population mean, no need to worry too much, as the point estimates are unbiased. Otherwise, (1) use lm(weights =...) for weighted least squares, where weights are 1/resid()^2 using (estimated) residual variance from a different model that estimate the residual variance like lm(resid()^2 ~ ) without weights but resid() from yet another lm() model; or nlme::gls() for generalized least squares where heteroscedasticity functional form must be specified correctly in weights = varFunc(), correlation = corStruc. The point estimates in lm(weights =...) and gls() should be very similar to OLS as lm(), but the residual variance and standard error are more efficient IF the weights are specified correctly. If you seek confidence intervals of population means in prediction, use lm() and prediction functions that accepts vcov = ... like predictions() in {marginaleffects}, and use robust standard errors that vcovHC() generates. Or weighted least squares lm(weights = ...) and regular predict(se.fit = T, interval = "confidence"). Or generalized least squares gls() with prediction functions like marginaleffects::predictions() If you seek prediction intervals of individual values in prediction, use weighted least squares lm(weights = ...) and weighted predict(se.fit = T, interval = "prediction", weights = = ~x^2). See predict.lm help. Or hack gls() like https://fw8051statistics4ecologists.netlify.app/gls.html#Sockeye
Simultaneous heteroscedasticity and heavy tails in a regression model
Given heteroscedasticity and outliers, If you seek a hypotheses testing of model coefficients, use robust standard errors generated by {sandwich} package like in lmtest::coeftest(lm(), vcov. = vcovHC
Simultaneous heteroscedasticity and heavy tails in a regression model Given heteroscedasticity and outliers, If you seek a hypotheses testing of model coefficients, use robust standard errors generated by {sandwich} package like in lmtest::coeftest(lm(), vcov. = vcovHC(lm(), type = "HC1")). If you seek the regression line representing population mean, no need to worry too much, as the point estimates are unbiased. Otherwise, (1) use lm(weights =...) for weighted least squares, where weights are 1/resid()^2 using (estimated) residual variance from a different model that estimate the residual variance like lm(resid()^2 ~ ) without weights but resid() from yet another lm() model; or nlme::gls() for generalized least squares where heteroscedasticity functional form must be specified correctly in weights = varFunc(), correlation = corStruc. The point estimates in lm(weights =...) and gls() should be very similar to OLS as lm(), but the residual variance and standard error are more efficient IF the weights are specified correctly. If you seek confidence intervals of population means in prediction, use lm() and prediction functions that accepts vcov = ... like predictions() in {marginaleffects}, and use robust standard errors that vcovHC() generates. Or weighted least squares lm(weights = ...) and regular predict(se.fit = T, interval = "confidence"). Or generalized least squares gls() with prediction functions like marginaleffects::predictions() If you seek prediction intervals of individual values in prediction, use weighted least squares lm(weights = ...) and weighted predict(se.fit = T, interval = "prediction", weights = = ~x^2). See predict.lm help. Or hack gls() like https://fw8051statistics4ecologists.netlify.app/gls.html#Sockeye
Simultaneous heteroscedasticity and heavy tails in a regression model Given heteroscedasticity and outliers, If you seek a hypotheses testing of model coefficients, use robust standard errors generated by {sandwich} package like in lmtest::coeftest(lm(), vcov. = vcovHC
33,021
Comparing incidence rates
A couple thoughts: First, your suggested comparison - the incident rate ratio between A and B - currently isn't conditioned on any covariates. Which means your number of events is 54 for Group A and 28 for Group B. That's more than enough to go with the usual large sample based Confidence Interval Methods. Second, even if you are intending to adjust for the effect of age, rather than computing the ratio for each group, you might be better served by using a regression approach. Generally, if you're stratifying by many levels of a variable, it becomes rather cumbersome compared to a regression equation, which would give you the ratio of the rates of A and B while controlling for Age. I believe the standard approaches will still work for your sample size, though if you're worried about it, you could use something like glmperm.
Comparing incidence rates
A couple thoughts: First, your suggested comparison - the incident rate ratio between A and B - currently isn't conditioned on any covariates. Which means your number of events is 54 for Group A and 2
Comparing incidence rates A couple thoughts: First, your suggested comparison - the incident rate ratio between A and B - currently isn't conditioned on any covariates. Which means your number of events is 54 for Group A and 28 for Group B. That's more than enough to go with the usual large sample based Confidence Interval Methods. Second, even if you are intending to adjust for the effect of age, rather than computing the ratio for each group, you might be better served by using a regression approach. Generally, if you're stratifying by many levels of a variable, it becomes rather cumbersome compared to a regression equation, which would give you the ratio of the rates of A and B while controlling for Age. I believe the standard approaches will still work for your sample size, though if you're worried about it, you could use something like glmperm.
Comparing incidence rates A couple thoughts: First, your suggested comparison - the incident rate ratio between A and B - currently isn't conditioned on any covariates. Which means your number of events is 54 for Group A and 2
33,022
Comparing incidence rates
The incidence rate of each group in your data is just the mean of a sum of independent Bernoulli (0/1) variables - each patient has its own variable receiving a value of 0 or 1, you sum them up and take the mean, which is the incidence rate. I large samples (and your sample is large), the mean will be distributed normally, so you can use a simple z-test to test if the two rates are different or not. In R, take a look at prop.test: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/prop.test.html If you would like to make full use of the data, try to see if the distribution of incidence rates is different between group A and B. For that, a test of independence might do the trick, such as a chi-square of a G-test: http://udel.edu/~mcdonald/statchiind.html
Comparing incidence rates
The incidence rate of each group in your data is just the mean of a sum of independent Bernoulli (0/1) variables - each patient has its own variable receiving a value of 0 or 1, you sum them up and ta
Comparing incidence rates The incidence rate of each group in your data is just the mean of a sum of independent Bernoulli (0/1) variables - each patient has its own variable receiving a value of 0 or 1, you sum them up and take the mean, which is the incidence rate. I large samples (and your sample is large), the mean will be distributed normally, so you can use a simple z-test to test if the two rates are different or not. In R, take a look at prop.test: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/prop.test.html If you would like to make full use of the data, try to see if the distribution of incidence rates is different between group A and B. For that, a test of independence might do the trick, such as a chi-square of a G-test: http://udel.edu/~mcdonald/statchiind.html
Comparing incidence rates The incidence rate of each group in your data is just the mean of a sum of independent Bernoulli (0/1) variables - each patient has its own variable receiving a value of 0 or 1, you sum them up and ta
33,023
Comparing incidence rates
The only way to be sure the sample is large enough (or as Charlie Geyer would put it - that you actually are in asymtopia land) is to do a lot of Monte-Carlo simulation or as EpiGard suggested use something like glmperm. As for what method is best in exactci, there is no best here - or as Fisher used to put it Best for what? Michael Fay provides some clarification here
Comparing incidence rates
The only way to be sure the sample is large enough (or as Charlie Geyer would put it - that you actually are in asymtopia land) is to do a lot of Monte-Carlo simulation or as EpiGard suggested use som
Comparing incidence rates The only way to be sure the sample is large enough (or as Charlie Geyer would put it - that you actually are in asymtopia land) is to do a lot of Monte-Carlo simulation or as EpiGard suggested use something like glmperm. As for what method is best in exactci, there is no best here - or as Fisher used to put it Best for what? Michael Fay provides some clarification here
Comparing incidence rates The only way to be sure the sample is large enough (or as Charlie Geyer would put it - that you actually are in asymtopia land) is to do a lot of Monte-Carlo simulation or as EpiGard suggested use som
33,024
Modified Poisson binomial distribution
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. This is a Generalized Poisson Binomial distribution. Have a look at R package PoissonBinomial (vignete) implementing a number of new high-performance algorithms for this distribution.
Modified Poisson binomial distribution
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.
Modified Poisson binomial distribution 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. This is a Generalized Poisson Binomial distribution. Have a look at R package PoissonBinomial (vignete) implementing a number of new high-performance algorithms for this distribution.
Modified Poisson binomial distribution 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.
33,025
Modified Poisson binomial distribution
First, you probably don't want to use a Poisson distribution, as it describes a random variable that can take on any of an infinite collection of integers. Stick with a Binomial(1,p), otherwise known as a Bernoulli(p). If $X \sim \text{Bernoulli}(p)$, and $Y = NX$, then the pmf of $Y$ would be $$ p_Y(y) = p_X([y/N]) = p^{y/N}(1-p)^{1-y/N}. $$ For an individual worker, you can simply scale a Bernoulli rv to get what you want. For adding the outcomes of multiple, independent workers, it is helpful to look at MGFs. The MGF from above is $$ M_Y(t) = E[e^{tY}] = E[e^{tNX}] = M_X(tN) = (1-p+pe^{tN}). $$ If you have several ($M$) workers, all with the same $N$, then the MGF of the sum is $$ (1-p+pe^{tN})^M. $$ This is the MGF of the random variable $\sum_{i=1}^M N X_i$. Add together $M$ Bernoulli random variables, and then multiply the result by $N$. As @jbowman was saying, if you have a different $N_i$ for each worker, then you will not get the above scaled Bernoulli distribution, and you will have to calculate probabilities by hand.
Modified Poisson binomial distribution
First, you probably don't want to use a Poisson distribution, as it describes a random variable that can take on any of an infinite collection of integers. Stick with a Binomial(1,p), otherwise known
Modified Poisson binomial distribution First, you probably don't want to use a Poisson distribution, as it describes a random variable that can take on any of an infinite collection of integers. Stick with a Binomial(1,p), otherwise known as a Bernoulli(p). If $X \sim \text{Bernoulli}(p)$, and $Y = NX$, then the pmf of $Y$ would be $$ p_Y(y) = p_X([y/N]) = p^{y/N}(1-p)^{1-y/N}. $$ For an individual worker, you can simply scale a Bernoulli rv to get what you want. For adding the outcomes of multiple, independent workers, it is helpful to look at MGFs. The MGF from above is $$ M_Y(t) = E[e^{tY}] = E[e^{tNX}] = M_X(tN) = (1-p+pe^{tN}). $$ If you have several ($M$) workers, all with the same $N$, then the MGF of the sum is $$ (1-p+pe^{tN})^M. $$ This is the MGF of the random variable $\sum_{i=1}^M N X_i$. Add together $M$ Bernoulli random variables, and then multiply the result by $N$. As @jbowman was saying, if you have a different $N_i$ for each worker, then you will not get the above scaled Bernoulli distribution, and you will have to calculate probabilities by hand.
Modified Poisson binomial distribution First, you probably don't want to use a Poisson distribution, as it describes a random variable that can take on any of an infinite collection of integers. Stick with a Binomial(1,p), otherwise known
33,026
Confidence intervals when using Bayes' theorem
Well, you can't just take the confidence interval for $p(b|a)$ and scale it by $p(a)/p(b)$ because of the uncertainty in the estimate of that ratio. If you can construct a $100(1-\alpha)\%$ confidence interval $[A, B]$ for $p(a)/p(b)$, then take the lower bound for a $100(1-\alpha)\%$ confidence interval for $p(b|a)$ and multiply it by $A$ and take the upper bound for $p(b|a)$ and multiply it by $B$. That should give at an interval that has at least a $100(1-\alpha)^2\%$ confidence level for $p(a|b)$.
Confidence intervals when using Bayes' theorem
Well, you can't just take the confidence interval for $p(b|a)$ and scale it by $p(a)/p(b)$ because of the uncertainty in the estimate of that ratio. If you can construct a $100(1-\alpha)\%$ confidence
Confidence intervals when using Bayes' theorem Well, you can't just take the confidence interval for $p(b|a)$ and scale it by $p(a)/p(b)$ because of the uncertainty in the estimate of that ratio. If you can construct a $100(1-\alpha)\%$ confidence interval $[A, B]$ for $p(a)/p(b)$, then take the lower bound for a $100(1-\alpha)\%$ confidence interval for $p(b|a)$ and multiply it by $A$ and take the upper bound for $p(b|a)$ and multiply it by $B$. That should give at an interval that has at least a $100(1-\alpha)^2\%$ confidence level for $p(a|b)$.
Confidence intervals when using Bayes' theorem Well, you can't just take the confidence interval for $p(b|a)$ and scale it by $p(a)/p(b)$ because of the uncertainty in the estimate of that ratio. If you can construct a $100(1-\alpha)\%$ confidence
33,027
Multiple imputation questions for multiple regression in SPSS
Whether you should impute both the pre- and post- scores, or the difference score, depends on how you analyze the pre-post difference. You should be aware there are legitimate limitations to analyses of difference scores (see Edwards, 1994, for a nice review), and a regression approach in which you analyze the residual for post- scores after controlling for pre-scores might be better. In that case, you would want to impute pre- and post- scores, since those are the variables that will be in your analytic model. However, if you're intent on analyzing difference scores, impute the difference scores, since it's unlikely you will want to manually compute difference scores across all your imputed data sets. In other words, whatever variable(s) you are using in your actual analytic model, is/are the variable(s) that you should use in your imputation model. Again, I would impute with the transformed variable, since that is what is used in your analytic model. Adding variables to the imputation model will increase the computational demands of the imputation process, BUT, if you have the time, more information is always better. Variables with complete data could potentially be very useful auxiliary variables for explaining MAR missingness. If using all your variables results in too time/computation demanding of an imputation model (i.e., if you have a big data set), create dummy variables for each cases's missingness for each variable, and see which complete variables predict those missingness variables in logistic models--then include those particular complete case variables in your imputation model. I wouldn't report the original (i.e., list-wise deleted) analyses. If your missingness mechanism is MAR, then MI is not only going to give you increased power, but it will also give you more accurate estimates (Enders, 2010). Thus, the significant effect with MI might be non-significant with list-wise deletion because that analysis is underpowered, biased, or both. References Edwards, J. R. (1994). Regression analysis as an alternative to difference scores. Journal of Management, 20, 683-689. Enders, C. K. (2010). Applied Missing Data Analysis. New York, NY: Guilford Press.
Multiple imputation questions for multiple regression in SPSS
Whether you should impute both the pre- and post- scores, or the difference score, depends on how you analyze the pre-post difference. You should be aware there are legitimate limitations to analyses
Multiple imputation questions for multiple regression in SPSS Whether you should impute both the pre- and post- scores, or the difference score, depends on how you analyze the pre-post difference. You should be aware there are legitimate limitations to analyses of difference scores (see Edwards, 1994, for a nice review), and a regression approach in which you analyze the residual for post- scores after controlling for pre-scores might be better. In that case, you would want to impute pre- and post- scores, since those are the variables that will be in your analytic model. However, if you're intent on analyzing difference scores, impute the difference scores, since it's unlikely you will want to manually compute difference scores across all your imputed data sets. In other words, whatever variable(s) you are using in your actual analytic model, is/are the variable(s) that you should use in your imputation model. Again, I would impute with the transformed variable, since that is what is used in your analytic model. Adding variables to the imputation model will increase the computational demands of the imputation process, BUT, if you have the time, more information is always better. Variables with complete data could potentially be very useful auxiliary variables for explaining MAR missingness. If using all your variables results in too time/computation demanding of an imputation model (i.e., if you have a big data set), create dummy variables for each cases's missingness for each variable, and see which complete variables predict those missingness variables in logistic models--then include those particular complete case variables in your imputation model. I wouldn't report the original (i.e., list-wise deleted) analyses. If your missingness mechanism is MAR, then MI is not only going to give you increased power, but it will also give you more accurate estimates (Enders, 2010). Thus, the significant effect with MI might be non-significant with list-wise deletion because that analysis is underpowered, biased, or both. References Edwards, J. R. (1994). Regression analysis as an alternative to difference scores. Journal of Management, 20, 683-689. Enders, C. K. (2010). Applied Missing Data Analysis. New York, NY: Guilford Press.
Multiple imputation questions for multiple regression in SPSS Whether you should impute both the pre- and post- scores, or the difference score, depends on how you analyze the pre-post difference. You should be aware there are legitimate limitations to analyses
33,028
Multiple imputation questions for multiple regression in SPSS
In my experience SPSS's imputation function is easy to use, both in creating datasets and in analyzing and pooling the resulting imputation datasets. However, its ease of use is its downfall as well. If you look at a similar imputation function in the R statistical software (see for example the mice package), you will see far more options. See Stef van Buurens website for an excellent explanation of multiple imputation in general (with or without using the mice package). It is very important to note that these additional options are not 'luxury' choices for advanced users only. Some are essential in order to attain proper congeniality, specific models for specific missing variables, specific predictors for specific missing variables,imputation diagnostics, and more, which are not available in the SPSS imputation function. As to your questions: imputation of pre- and post scores and passively replacing the missing differences is appropriate when you want to conserve the relation between the pre- and post scores, and the difference (as answered by jsakaluk). In your case this might be so when you want to build a model with the difference in pre and post score as outcome/dependent variable and the baseline (pre-score) as (one of the) predictors/indepenent variables. Any model used to replace missing values should abide by its assumptions. Meaning that to replace a continuous variable you need to adhere to the assumptions of a linear regression model (in the simplest case). for linear regression, and most other regression model, the predictor variables need not be normally distributed, the model's residuals however, do have to be! Some transformation might therefore be necessary if the latter is the case. See jsakaluk's answer. Do note however that SPSS uses massive imputation, which basically means all entered variables are used to replace variables with missing cases. If you only have one variable with missing this is no problem. If you have multiple however, this means the variables with missingness are also used to complete the other variables with missingness. This might not be a problem, but in some cases this creates feedback loops which bias your final imputation values. It is imperative to check this by looking for trends throughout the iterations of your imputation instead of 'stabilizing' replaced values. I agree with jsakaluk's answer on this one. If you decide to 'distrust' your complete data because you suspect selective missings, and solve or partly remedy this by using multiple imputation techniques (which I think would indeed be the least biased), then your multiple imputation results should be the main results you show. Regrettably, experience has shown reviewers or other interested people sometimes do want to see complete case analyses as well (so keep them at hand).
Multiple imputation questions for multiple regression in SPSS
In my experience SPSS's imputation function is easy to use, both in creating datasets and in analyzing and pooling the resulting imputation datasets. However, its ease of use is its downfall as well.
Multiple imputation questions for multiple regression in SPSS In my experience SPSS's imputation function is easy to use, both in creating datasets and in analyzing and pooling the resulting imputation datasets. However, its ease of use is its downfall as well. If you look at a similar imputation function in the R statistical software (see for example the mice package), you will see far more options. See Stef van Buurens website for an excellent explanation of multiple imputation in general (with or without using the mice package). It is very important to note that these additional options are not 'luxury' choices for advanced users only. Some are essential in order to attain proper congeniality, specific models for specific missing variables, specific predictors for specific missing variables,imputation diagnostics, and more, which are not available in the SPSS imputation function. As to your questions: imputation of pre- and post scores and passively replacing the missing differences is appropriate when you want to conserve the relation between the pre- and post scores, and the difference (as answered by jsakaluk). In your case this might be so when you want to build a model with the difference in pre and post score as outcome/dependent variable and the baseline (pre-score) as (one of the) predictors/indepenent variables. Any model used to replace missing values should abide by its assumptions. Meaning that to replace a continuous variable you need to adhere to the assumptions of a linear regression model (in the simplest case). for linear regression, and most other regression model, the predictor variables need not be normally distributed, the model's residuals however, do have to be! Some transformation might therefore be necessary if the latter is the case. See jsakaluk's answer. Do note however that SPSS uses massive imputation, which basically means all entered variables are used to replace variables with missing cases. If you only have one variable with missing this is no problem. If you have multiple however, this means the variables with missingness are also used to complete the other variables with missingness. This might not be a problem, but in some cases this creates feedback loops which bias your final imputation values. It is imperative to check this by looking for trends throughout the iterations of your imputation instead of 'stabilizing' replaced values. I agree with jsakaluk's answer on this one. If you decide to 'distrust' your complete data because you suspect selective missings, and solve or partly remedy this by using multiple imputation techniques (which I think would indeed be the least biased), then your multiple imputation results should be the main results you show. Regrettably, experience has shown reviewers or other interested people sometimes do want to see complete case analyses as well (so keep them at hand).
Multiple imputation questions for multiple regression in SPSS In my experience SPSS's imputation function is easy to use, both in creating datasets and in analyzing and pooling the resulting imputation datasets. However, its ease of use is its downfall as well.
33,029
Is there a quantitative way to compare the distribution shape of different samples?
If the problem is uni-variate, then why not just do a KS test on the (centered, re scaled) vectors? You can't use the associated pvalues (because the center and scale components have been determined by the data) but the D statistics gives a relative measure of the distance between the two vectors (In a nutshell, it's simply the Chebychev distance between the two CDF). So, in R, it would be (assuming x and y are two vectors of potentially different lengths (each vector contains one of the sample whose shape of the distribution you want to compare). For example, if $x\sim\mathcal{P}(\lambda)$ and $y\sim\mathcal{N}(\mu,\sigma^2)$: #two distributions with different shape y<-rnorm(100,0,3) x<-rpois(100,1) x_s<-(x-median(x))/mad(x) y_s<-(y-median(y))/mad(y) par(mfrow=c(2,1)) hist(y_s) hist(x_s) ks.test(x_s,y_s) P.S. I left the original answer, because it seemed to be useful and frankly took me time to write. @Modo: let me know if it's better to remove it.
Is there a quantitative way to compare the distribution shape of different samples?
If the problem is uni-variate, then why not just do a KS test on the (centered, re scaled) vectors? You can't use the associated pvalues (because the center and scale components have been determined
Is there a quantitative way to compare the distribution shape of different samples? If the problem is uni-variate, then why not just do a KS test on the (centered, re scaled) vectors? You can't use the associated pvalues (because the center and scale components have been determined by the data) but the D statistics gives a relative measure of the distance between the two vectors (In a nutshell, it's simply the Chebychev distance between the two CDF). So, in R, it would be (assuming x and y are two vectors of potentially different lengths (each vector contains one of the sample whose shape of the distribution you want to compare). For example, if $x\sim\mathcal{P}(\lambda)$ and $y\sim\mathcal{N}(\mu,\sigma^2)$: #two distributions with different shape y<-rnorm(100,0,3) x<-rpois(100,1) x_s<-(x-median(x))/mad(x) y_s<-(y-median(y))/mad(y) par(mfrow=c(2,1)) hist(y_s) hist(x_s) ks.test(x_s,y_s) P.S. I left the original answer, because it seemed to be useful and frankly took me time to write. @Modo: let me know if it's better to remove it.
Is there a quantitative way to compare the distribution shape of different samples? If the problem is uni-variate, then why not just do a KS test on the (centered, re scaled) vectors? You can't use the associated pvalues (because the center and scale components have been determined
33,030
Is there a quantitative way to compare the distribution shape of different samples?
Sure, if the problem is multivariate: Given a cloud of points with $p$ by $p$ covariance matrix $\varSigma$, the shape matrix of $\varSigma$ is defined as $\Gamma = |\varSigma|^{-1/p}\varSigma$. It follows that always $|\Gamma|=1$, and we can decompose the original matrix as $\varSigma = |\varSigma|^{1/p}\Gamma$. The square root of this scalar factor, $|\varSigma|^{1/2p}$, is called the scale component of $\varSigma$. The shape matrix of the estimated scatter matrix S is computed analogously as $G = |S|^{-1/p}S$, and its scale component is $|S|^{1/2p}$. The difference (distance) between two shape matrices $G_1$ and $G_2$ can be defined as \begin{equation} \mbox{D_s}(G_1,G_2) = \log\frac{\lambda_1(G^{-1/2}_{2} G_{1} G^{-1/2}_{2})} {\lambda_p(G^{-1/2}_{2} G_{1} G^{-1/2}_{2})} \end{equation} where $\lambda_1\geq...\geq\lambda_p$ are the eigenvalues.
Is there a quantitative way to compare the distribution shape of different samples?
Sure, if the problem is multivariate: Given a cloud of points with $p$ by $p$ covariance matrix $\varSigma$, the shape matrix of $\varSigma$ is defined as $\Gamma = |\varSigma|^{-1/p}\varSigma$. I
Is there a quantitative way to compare the distribution shape of different samples? Sure, if the problem is multivariate: Given a cloud of points with $p$ by $p$ covariance matrix $\varSigma$, the shape matrix of $\varSigma$ is defined as $\Gamma = |\varSigma|^{-1/p}\varSigma$. It follows that always $|\Gamma|=1$, and we can decompose the original matrix as $\varSigma = |\varSigma|^{1/p}\Gamma$. The square root of this scalar factor, $|\varSigma|^{1/2p}$, is called the scale component of $\varSigma$. The shape matrix of the estimated scatter matrix S is computed analogously as $G = |S|^{-1/p}S$, and its scale component is $|S|^{1/2p}$. The difference (distance) between two shape matrices $G_1$ and $G_2$ can be defined as \begin{equation} \mbox{D_s}(G_1,G_2) = \log\frac{\lambda_1(G^{-1/2}_{2} G_{1} G^{-1/2}_{2})} {\lambda_p(G^{-1/2}_{2} G_{1} G^{-1/2}_{2})} \end{equation} where $\lambda_1\geq...\geq\lambda_p$ are the eigenvalues.
Is there a quantitative way to compare the distribution shape of different samples? Sure, if the problem is multivariate: Given a cloud of points with $p$ by $p$ covariance matrix $\varSigma$, the shape matrix of $\varSigma$ is defined as $\Gamma = |\varSigma|^{-1/p}\varSigma$. I
33,031
Techniques for incremental online learning of classifier on stream data
If this is a binary classification problem then it should be possible to apply an online SVM such as Bordes, A. and Bottou, L., "The Huller: a simple and efficient online SVM", ECML 2005. If this is a non-binary classification (i.e. more than 2 possible labels) you could look into kernel recursive least-squares techniques. They are made for online regression, but they perform pretty well for online classification too. Here's one basic KRLS algorithm: Y. Engel, S. Mannor and R. Meir, "The Kernel Recusrive Least Squares Algorithm", IEEE Trans. Signal Processing, 2004. Both of these approaches will require fixed window-sizes in order to compare input vectors of the same size.
Techniques for incremental online learning of classifier on stream data
If this is a binary classification problem then it should be possible to apply an online SVM such as Bordes, A. and Bottou, L., "The Huller: a simple and efficient online SVM", ECML 2005. If this is a
Techniques for incremental online learning of classifier on stream data If this is a binary classification problem then it should be possible to apply an online SVM such as Bordes, A. and Bottou, L., "The Huller: a simple and efficient online SVM", ECML 2005. If this is a non-binary classification (i.e. more than 2 possible labels) you could look into kernel recursive least-squares techniques. They are made for online regression, but they perform pretty well for online classification too. Here's one basic KRLS algorithm: Y. Engel, S. Mannor and R. Meir, "The Kernel Recusrive Least Squares Algorithm", IEEE Trans. Signal Processing, 2004. Both of these approaches will require fixed window-sizes in order to compare input vectors of the same size.
Techniques for incremental online learning of classifier on stream data If this is a binary classification problem then it should be possible to apply an online SVM such as Bordes, A. and Bottou, L., "The Huller: a simple and efficient online SVM", ECML 2005. If this is a
33,032
Nonlinear regression / Curve fitting with L-infinity norm
For those who may be interested, I have found a paper that proposes a solution to my problem: "A min-max algorithm for non-linear regression models", by A. Tishler and I. Zang. I have tested it myself, and I get the results I need.
Nonlinear regression / Curve fitting with L-infinity norm
For those who may be interested, I have found a paper that proposes a solution to my problem: "A min-max algorithm for non-linear regression models", by A. Tishler and I. Zang. I have tested it myself
Nonlinear regression / Curve fitting with L-infinity norm For those who may be interested, I have found a paper that proposes a solution to my problem: "A min-max algorithm for non-linear regression models", by A. Tishler and I. Zang. I have tested it myself, and I get the results I need.
Nonlinear regression / Curve fitting with L-infinity norm For those who may be interested, I have found a paper that proposes a solution to my problem: "A min-max algorithm for non-linear regression models", by A. Tishler and I. Zang. I have tested it myself
33,033
Imputation to account for systematic error in survey responses
The first thing to note is that your variables are: "what student said about mother's education" and "what student's mother said about student's mother's education". Call them S and M respectively, and label the unobserved true level of mother's education as T. S and M have both got missing values and there is nothing wrong (modulo the observation below) with putting M and S in an imputation model but only using one of them in the subsequent analysis. The other way around would always be unadvisable. This is separate from three other questions: Does a missing value mean the students don't know or don't want to say that much about their mothers? How to use S and M to learn about T? Do you have the right sort of missingness to allow multiple imputation to work? Ignorance and missingness You might be interested in T, but you need not be: perceptions of educational attainment (via S, and possibly M) or lack of student knowledge might be more causally interesting than T itself. Imputation may be a sensible route for the first, but may or may not be for the second. You have to decide. Learning about T Say you are actually interested in T. In the absence of a gold standard measurement (since you sometimes doubt M) it's hard to know how you might non-arbitraily combine S and M to learn about T. If, on other hand, you were willing to treat the M as correct when it is available, then you could use S to predict M in a classification model that contains other information from the students and then use M rather than S in the final analysis. The concern here would be about selection bias in the cases you trained on, which leads to the third issue: Missingness Whether multiple imputation can work depends on whether data is missing completely at random (MCAR) or missing at random (MAR). Is S missing at random (MAR)? Perhaps not, since students might be ashamed to answer about their mother's lack of education and skip the question. Then the value alone determines whether it will be missing and multiple imputation cannot help here. On the other hand, if low education covaries with something that is asked and partly answered in the survey e.g. some indicator of income, then MAR may be more reasonable and multiple imputation has something to get a grip on. Is M missing at random? Same considerations apply. Finally, even if you are interesting in T and take a classification approach, you'd still want to impute to fit that model.
Imputation to account for systematic error in survey responses
The first thing to note is that your variables are: "what student said about mother's education" and "what student's mother said about student's mother's education". Call them S and M respectively, a
Imputation to account for systematic error in survey responses The first thing to note is that your variables are: "what student said about mother's education" and "what student's mother said about student's mother's education". Call them S and M respectively, and label the unobserved true level of mother's education as T. S and M have both got missing values and there is nothing wrong (modulo the observation below) with putting M and S in an imputation model but only using one of them in the subsequent analysis. The other way around would always be unadvisable. This is separate from three other questions: Does a missing value mean the students don't know or don't want to say that much about their mothers? How to use S and M to learn about T? Do you have the right sort of missingness to allow multiple imputation to work? Ignorance and missingness You might be interested in T, but you need not be: perceptions of educational attainment (via S, and possibly M) or lack of student knowledge might be more causally interesting than T itself. Imputation may be a sensible route for the first, but may or may not be for the second. You have to decide. Learning about T Say you are actually interested in T. In the absence of a gold standard measurement (since you sometimes doubt M) it's hard to know how you might non-arbitraily combine S and M to learn about T. If, on other hand, you were willing to treat the M as correct when it is available, then you could use S to predict M in a classification model that contains other information from the students and then use M rather than S in the final analysis. The concern here would be about selection bias in the cases you trained on, which leads to the third issue: Missingness Whether multiple imputation can work depends on whether data is missing completely at random (MCAR) or missing at random (MAR). Is S missing at random (MAR)? Perhaps not, since students might be ashamed to answer about their mother's lack of education and skip the question. Then the value alone determines whether it will be missing and multiple imputation cannot help here. On the other hand, if low education covaries with something that is asked and partly answered in the survey e.g. some indicator of income, then MAR may be more reasonable and multiple imputation has something to get a grip on. Is M missing at random? Same considerations apply. Finally, even if you are interesting in T and take a classification approach, you'd still want to impute to fit that model.
Imputation to account for systematic error in survey responses The first thing to note is that your variables are: "what student said about mother's education" and "what student's mother said about student's mother's education". Call them S and M respectively, a
33,034
Imputation to account for systematic error in survey responses
If you're going to assume that the "contradiction rate" is the same for the whole sample as it is for the subsample whose mothers were polled then the subsample must have been drawn at random. In your description you don't say, so I raise this issue because I think it has important implications for how or if you can use this information from the subsample to draw conclusions about the entire sample of students. It seems to me that there are three facets to this contradiction issue. 1 is the rate of contradiction. Is it really the case that 3/4th's of students guessed wrong? 2 is the degree of wrongness - it's one thing to say your mother never finished elementary school when she in fact completed it but stopped there and quite another to say she never completed elementary school when she has a Ph.D. 3 is the proportion of the sample you can cross-check. If you're drawing these conclusions on a subsample of 20 then I'd bet the estimates are fairly unstable and probably not worth much. It seems to me that what you do will depend on your answer to these questions and to the question I raised initially. For example, if 1 is quite high and 3 is quite high then I might just use the subsample and be done with it. If 1 is high but 2 is low then the issue doesn't seem to be that bad and, again, it might not be worth bothering with. It's probably also worth knowing if the error is random or systematic. If students tend to systematically under estimate their mother's education then that's more problematic than if they just get it totally wrong sometimes. I've done some imputation on a couple papers and it seems like I always create more trouble for myself as a result. Reviewers, in my area at least, often don't have a good handle on the method and are thus suspicious of its use. I feel like sometimes it's better, from a publication standpoint, to just acknowledge the problem and move on. But in this case you're not really 'imputing missing data' but are introducing some sort of predicted error variance for the variable. It is a very interesting question and, putting all the concerns aside, I'm not even sure how I would go about this if I decided it was the best course of action
Imputation to account for systematic error in survey responses
If you're going to assume that the "contradiction rate" is the same for the whole sample as it is for the subsample whose mothers were polled then the subsample must have been drawn at random. In you
Imputation to account for systematic error in survey responses If you're going to assume that the "contradiction rate" is the same for the whole sample as it is for the subsample whose mothers were polled then the subsample must have been drawn at random. In your description you don't say, so I raise this issue because I think it has important implications for how or if you can use this information from the subsample to draw conclusions about the entire sample of students. It seems to me that there are three facets to this contradiction issue. 1 is the rate of contradiction. Is it really the case that 3/4th's of students guessed wrong? 2 is the degree of wrongness - it's one thing to say your mother never finished elementary school when she in fact completed it but stopped there and quite another to say she never completed elementary school when she has a Ph.D. 3 is the proportion of the sample you can cross-check. If you're drawing these conclusions on a subsample of 20 then I'd bet the estimates are fairly unstable and probably not worth much. It seems to me that what you do will depend on your answer to these questions and to the question I raised initially. For example, if 1 is quite high and 3 is quite high then I might just use the subsample and be done with it. If 1 is high but 2 is low then the issue doesn't seem to be that bad and, again, it might not be worth bothering with. It's probably also worth knowing if the error is random or systematic. If students tend to systematically under estimate their mother's education then that's more problematic than if they just get it totally wrong sometimes. I've done some imputation on a couple papers and it seems like I always create more trouble for myself as a result. Reviewers, in my area at least, often don't have a good handle on the method and are thus suspicious of its use. I feel like sometimes it's better, from a publication standpoint, to just acknowledge the problem and move on. But in this case you're not really 'imputing missing data' but are introducing some sort of predicted error variance for the variable. It is a very interesting question and, putting all the concerns aside, I'm not even sure how I would go about this if I decided it was the best course of action
Imputation to account for systematic error in survey responses If you're going to assume that the "contradiction rate" is the same for the whole sample as it is for the subsample whose mothers were polled then the subsample must have been drawn at random. In you
33,035
Predicting the time until an expected event occurs
The answer can be offered by survival analysis which, when used in engineering, is called reliability analysis. I understand that you need to estimate fault occurrence cross-time so you might consider this article on assessing product Reliability. Models you might want to consider include: Power low (Duane) model Homogeneous Poisson Process model or if it comes to survival analysis: Cox-Regression Analysis: A good reference that covers these is the book Survival Analysis Using S. A second approach is from perspective of processes control and quality control. A theoretical point of view is in in the book Reliability Modeling, Analysis And Optimization.
Predicting the time until an expected event occurs
The answer can be offered by survival analysis which, when used in engineering, is called reliability analysis. I understand that you need to estimate fault occurrence cross-time so you might conside
Predicting the time until an expected event occurs The answer can be offered by survival analysis which, when used in engineering, is called reliability analysis. I understand that you need to estimate fault occurrence cross-time so you might consider this article on assessing product Reliability. Models you might want to consider include: Power low (Duane) model Homogeneous Poisson Process model or if it comes to survival analysis: Cox-Regression Analysis: A good reference that covers these is the book Survival Analysis Using S. A second approach is from perspective of processes control and quality control. A theoretical point of view is in in the book Reliability Modeling, Analysis And Optimization.
Predicting the time until an expected event occurs The answer can be offered by survival analysis which, when used in engineering, is called reliability analysis. I understand that you need to estimate fault occurrence cross-time so you might conside
33,036
Distribution of reciprocal of regression coefficient
Q1. If $\hat\beta_1$ is the MLE of $\beta_1$, then $\hat\theta$ is the MLE of $\theta$ and $\beta_1 \neq 0$ is a sufficient condition for this estimator to be well-defined. Q2. $\hat\theta = 1/\hat\beta$ is the MLE of $\theta$ by invariance property of the MLE. In addition, you do not need monotonicity of $g$ if you do not need to obtain its inverse. There is only need for $g$ to be well-defined at each point. You can check this in Theorem 7.2.1 pp. 350 of "Probability and Statistical Inference" by Nitis Mukhopadhyay. Q3. Yes, you can use both methods, I would also check the profile likelihood of $\theta$. Q4. Here, you can reparameterise the model in terms of the parameters of interest $(\theta,\gamma)$. For instance, the MLE of $\gamma$ is $\hat\gamma=\hat\beta_0/\hat\beta_1$ and you can calculate the profile likelihood of this parameter or its bootstrap distribution as usual. The approach you mention at the end is incorrect, you are actually considering a "calibration model" which you can check in the literature. The only thing you need is to reparameterise in terms of the parameters of interest. I hope this helps. Kind regards.
Distribution of reciprocal of regression coefficient
Q1. If $\hat\beta_1$ is the MLE of $\beta_1$, then $\hat\theta$ is the MLE of $\theta$ and $\beta_1 \neq 0$ is a sufficient condition for this estimator to be well-defined. Q2. $\hat\theta = 1/\hat\be
Distribution of reciprocal of regression coefficient Q1. If $\hat\beta_1$ is the MLE of $\beta_1$, then $\hat\theta$ is the MLE of $\theta$ and $\beta_1 \neq 0$ is a sufficient condition for this estimator to be well-defined. Q2. $\hat\theta = 1/\hat\beta$ is the MLE of $\theta$ by invariance property of the MLE. In addition, you do not need monotonicity of $g$ if you do not need to obtain its inverse. There is only need for $g$ to be well-defined at each point. You can check this in Theorem 7.2.1 pp. 350 of "Probability and Statistical Inference" by Nitis Mukhopadhyay. Q3. Yes, you can use both methods, I would also check the profile likelihood of $\theta$. Q4. Here, you can reparameterise the model in terms of the parameters of interest $(\theta,\gamma)$. For instance, the MLE of $\gamma$ is $\hat\gamma=\hat\beta_0/\hat\beta_1$ and you can calculate the profile likelihood of this parameter or its bootstrap distribution as usual. The approach you mention at the end is incorrect, you are actually considering a "calibration model" which you can check in the literature. The only thing you need is to reparameterise in terms of the parameters of interest. I hope this helps. Kind regards.
Distribution of reciprocal of regression coefficient Q1. If $\hat\beta_1$ is the MLE of $\beta_1$, then $\hat\theta$ is the MLE of $\theta$ and $\beta_1 \neq 0$ is a sufficient condition for this estimator to be well-defined. Q2. $\hat\theta = 1/\hat\be
33,037
Testing normality and independence of time series residuals
Notwithstanding IrishStat's comments, you could use a Breusch-Godfrey test. It is used to test for a lack of correlation among the residuals of a regression model. First, you perform your regression. Get the residuals. Run a regression of the residuals on all the variables from your regression of interest from step 1 plus some number of lagged residuals. You can guess how many lags you should include by looking at the autocorrelation function. You can test for a lack of serial correlation by testing that the coefficients on the lags of the residuals are jointly 0 by using an F test or a version of a Lagrange multiplier test (the test statistic is the number of observations in the second, auxiliary regression times the $R^2$ from that regression; the test statistic is distributed as a $\chi^2_l$, where $l$ is the number of lags, under the null of no serial correlation).
Testing normality and independence of time series residuals
Notwithstanding IrishStat's comments, you could use a Breusch-Godfrey test. It is used to test for a lack of correlation among the residuals of a regression model. First, you perform your regression.
Testing normality and independence of time series residuals Notwithstanding IrishStat's comments, you could use a Breusch-Godfrey test. It is used to test for a lack of correlation among the residuals of a regression model. First, you perform your regression. Get the residuals. Run a regression of the residuals on all the variables from your regression of interest from step 1 plus some number of lagged residuals. You can guess how many lags you should include by looking at the autocorrelation function. You can test for a lack of serial correlation by testing that the coefficients on the lags of the residuals are jointly 0 by using an F test or a version of a Lagrange multiplier test (the test statistic is the number of observations in the second, auxiliary regression times the $R^2$ from that regression; the test statistic is distributed as a $\chi^2_l$, where $l$ is the number of lags, under the null of no serial correlation).
Testing normality and independence of time series residuals Notwithstanding IrishStat's comments, you could use a Breusch-Godfrey test. It is used to test for a lack of correlation among the residuals of a regression model. First, you perform your regression.
33,038
Testing normality and independence of time series residuals
A case in point is where the residuals are perceived to be independent via the tests you define BUT are not normally distributed is when the mean of the errors is not-constant. Including a constant in the model guarantees that the overall mean of the errors is zero BUT not necessarily for all time intervals. If you have one anomaly in the residuals this will inflate the variance of the errors thus providing a downward-bias to the correlation coefficient. If you have an error process that has a mean shift at a particular point in time you again will have indflated error variance and a (severe) downward bias ("Alice in Wonderland") in the acf of the errors. In summary the tests you are relying on assume that there is no mean bias in the errors. Simply use Intervention Detection procedures to identify omitted Pulses, Level Shifts , Seasonal Pulses and/or Local Time Trends and then incorporate any and all of these statistically significant variables into your Transfer Function. The fixup will then allow you to proceed with your standard tests. You then might find that the error variance might be related to the level of Y suggesting the need fpr a power transform ( logs/reciprovals/square root etc )/ Alternatively the error variance may have changed at fixed points over time suggesting GLS or stochastically suggesting the need for a GARCH augmentation.
Testing normality and independence of time series residuals
A case in point is where the residuals are perceived to be independent via the tests you define BUT are not normally distributed is when the mean of the errors is not-constant. Including a constant in
Testing normality and independence of time series residuals A case in point is where the residuals are perceived to be independent via the tests you define BUT are not normally distributed is when the mean of the errors is not-constant. Including a constant in the model guarantees that the overall mean of the errors is zero BUT not necessarily for all time intervals. If you have one anomaly in the residuals this will inflate the variance of the errors thus providing a downward-bias to the correlation coefficient. If you have an error process that has a mean shift at a particular point in time you again will have indflated error variance and a (severe) downward bias ("Alice in Wonderland") in the acf of the errors. In summary the tests you are relying on assume that there is no mean bias in the errors. Simply use Intervention Detection procedures to identify omitted Pulses, Level Shifts , Seasonal Pulses and/or Local Time Trends and then incorporate any and all of these statistically significant variables into your Transfer Function. The fixup will then allow you to proceed with your standard tests. You then might find that the error variance might be related to the level of Y suggesting the need fpr a power transform ( logs/reciprovals/square root etc )/ Alternatively the error variance may have changed at fixed points over time suggesting GLS or stochastically suggesting the need for a GARCH augmentation.
Testing normality and independence of time series residuals A case in point is where the residuals are perceived to be independent via the tests you define BUT are not normally distributed is when the mean of the errors is not-constant. Including a constant in
33,039
Subsample of a random sample: random sample?
Generally speaking, what you really want from a sample, is to be "representative". Random sampling is a good way to go since it allows all subjects the same probability of being sampled; In the hope that all attributes and attribute-relations existing in the population will exist in the sample. Making it "representative". In your case, if you believe all Spanish players had a a-priori equal chance of being drawn in the (sub)sample, then it is "random". Regarding size considerations: A single observation can still be a "random sample". Larger samples are needed when you want more precision, and especially when you are looking for rare relations in the population, which might not be present in a small sample.
Subsample of a random sample: random sample?
Generally speaking, what you really want from a sample, is to be "representative". Random sampling is a good way to go since it allows all subjects the same probability of being sampled; In the hope t
Subsample of a random sample: random sample? Generally speaking, what you really want from a sample, is to be "representative". Random sampling is a good way to go since it allows all subjects the same probability of being sampled; In the hope that all attributes and attribute-relations existing in the population will exist in the sample. Making it "representative". In your case, if you believe all Spanish players had a a-priori equal chance of being drawn in the (sub)sample, then it is "random". Regarding size considerations: A single observation can still be a "random sample". Larger samples are needed when you want more precision, and especially when you are looking for rare relations in the population, which might not be present in a small sample.
Subsample of a random sample: random sample? Generally speaking, what you really want from a sample, is to be "representative". Random sampling is a good way to go since it allows all subjects the same probability of being sampled; In the hope t
33,040
Subsample of a random sample: random sample?
Assuming there are no biases in the sampling technique, this should be fine. Some questions to ask might be: -> Was the survey conducted in Spanish if requested? (Language bias) -> Was the survey conducted over the phone or in person? If over the phone, and cell phones were excluded, are Spanish players more or less likely to own cell phones than players in the rest of Europe, and for what reasons? -> Was the rate at which Spanish players refused to answer survey questions different from the rate for players as a whole? -> Overall, what proportion of Spanish players were sampled? Without knowing the exact composition of the data it's hard to say more. Are there any specific issues you're concerned about?
Subsample of a random sample: random sample?
Assuming there are no biases in the sampling technique, this should be fine. Some questions to ask might be: -> Was the survey conducted in Spanish if requested? (Language bias) -> Was the survey cond
Subsample of a random sample: random sample? Assuming there are no biases in the sampling technique, this should be fine. Some questions to ask might be: -> Was the survey conducted in Spanish if requested? (Language bias) -> Was the survey conducted over the phone or in person? If over the phone, and cell phones were excluded, are Spanish players more or less likely to own cell phones than players in the rest of Europe, and for what reasons? -> Was the rate at which Spanish players refused to answer survey questions different from the rate for players as a whole? -> Overall, what proportion of Spanish players were sampled? Without knowing the exact composition of the data it's hard to say more. Are there any specific issues you're concerned about?
Subsample of a random sample: random sample? Assuming there are no biases in the sampling technique, this should be fine. Some questions to ask might be: -> Was the survey conducted in Spanish if requested? (Language bias) -> Was the survey cond
33,041
So how would you include Bayesian estimates in a meta-analysis?
Something else. To perform Bayesian analysis on the results of several studies that address the same parameter (or parameters) you need to get hold of their likelihoods - or approximations thereof - and multiply them by the prior. If each individual analysis has reported its just its own Bayesian inference, this will not be possible - though an approximation might be feasible. Happily, most papers will report a straight summary of the data before giving their fully Bayesian inference. For your Bayesian inference, you can start with that summary and add your prior.
So how would you include Bayesian estimates in a meta-analysis?
Something else. To perform Bayesian analysis on the results of several studies that address the same parameter (or parameters) you need to get hold of their likelihoods - or approximations thereof - a
So how would you include Bayesian estimates in a meta-analysis? Something else. To perform Bayesian analysis on the results of several studies that address the same parameter (or parameters) you need to get hold of their likelihoods - or approximations thereof - and multiply them by the prior. If each individual analysis has reported its just its own Bayesian inference, this will not be possible - though an approximation might be feasible. Happily, most papers will report a straight summary of the data before giving their fully Bayesian inference. For your Bayesian inference, you can start with that summary and add your prior.
So how would you include Bayesian estimates in a meta-analysis? Something else. To perform Bayesian analysis on the results of several studies that address the same parameter (or parameters) you need to get hold of their likelihoods - or approximations thereof - a
33,042
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two regressions on the individual variables?
Here's a little bit of R that sets a random seed that will result in a dataset that shows it in action. set.seed(103) d <- data.frame(y=rnorm(20, 0, 1), a=rnorm(20, 0, 1), b=rnorm(20, 0, 1)) m1 <- lm(y~a, data=d) m2 <- lm(y~b, data=d) m3 <- lm(y~a+b, data=d) r2.a <- summary(m1)[["r.squared"]] r2.b <- summary(m2)[["r.squared"]] r2.sum <- summary(m3)[["r.squared"]] r2.sum > r2.a + r2.b Not only is it possible (as you've already shown analytically) it's not hard to do. Given 3 normally distributed variables, it seems to happen about 40% of the time.
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two r
Here's a little bit of R that sets a random seed that will result in a dataset that shows it in action. set.seed(103) d <- data.frame(y=rnorm(20, 0, 1), a=rnorm(20, 0, 1),
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two regressions on the individual variables? Here's a little bit of R that sets a random seed that will result in a dataset that shows it in action. set.seed(103) d <- data.frame(y=rnorm(20, 0, 1), a=rnorm(20, 0, 1), b=rnorm(20, 0, 1)) m1 <- lm(y~a, data=d) m2 <- lm(y~b, data=d) m3 <- lm(y~a+b, data=d) r2.a <- summary(m1)[["r.squared"]] r2.b <- summary(m2)[["r.squared"]] r2.sum <- summary(m3)[["r.squared"]] r2.sum > r2.a + r2.b Not only is it possible (as you've already shown analytically) it's not hard to do. Given 3 normally distributed variables, it seems to happen about 40% of the time.
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two r Here's a little bit of R that sets a random seed that will result in a dataset that shows it in action. set.seed(103) d <- data.frame(y=rnorm(20, 0, 1), a=rnorm(20, 0, 1),
33,043
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two regressions on the individual variables?
It isn't possible. Moreover, if A and B are correlated at all (if their r is nonzero), the rsq of the regression on both will be less than the sum of their individual regressions' rsq's. Note that even if A and B are completely uncorrelated, adjusted rsq's (which penalize for a low case-to-predictor ratio) may be slightly different between the two solutions. Maybe you'd like to share more about the empirical evidence that's got you crossed up.
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two r
It isn't possible. Moreover, if A and B are correlated at all (if their r is nonzero), the rsq of the regression on both will be less than the sum of their individual regressions' rsq's. Note that ev
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two regressions on the individual variables? It isn't possible. Moreover, if A and B are correlated at all (if their r is nonzero), the rsq of the regression on both will be less than the sum of their individual regressions' rsq's. Note that even if A and B are completely uncorrelated, adjusted rsq's (which penalize for a low case-to-predictor ratio) may be slightly different between the two solutions. Maybe you'd like to share more about the empirical evidence that's got you crossed up.
Is it possible for $R^2$ of a regression on two variables be higher than the sum of $R^2$ for two r It isn't possible. Moreover, if A and B are correlated at all (if their r is nonzero), the rsq of the regression on both will be less than the sum of their individual regressions' rsq's. Note that ev
33,044
How do you call this dynamic sample-size selection strategy?
This has been called 'Progressive Sampling', e.g. see this paper Efficient Progressive Sampling.
How do you call this dynamic sample-size selection strategy?
This has been called 'Progressive Sampling', e.g. see this paper Efficient Progressive Sampling.
How do you call this dynamic sample-size selection strategy? This has been called 'Progressive Sampling', e.g. see this paper Efficient Progressive Sampling.
How do you call this dynamic sample-size selection strategy? This has been called 'Progressive Sampling', e.g. see this paper Efficient Progressive Sampling.
33,045
Calculating 2D Confidence Regions from MCMC Samples
I once did something like this with pymc, matplotlib, and scipy that you could adapt, the relevant code is in this gist, and the resulting plot looks like this:
Calculating 2D Confidence Regions from MCMC Samples
I once did something like this with pymc, matplotlib, and scipy that you could adapt, the relevant code is in this gist, and the resulting plot looks like this:
Calculating 2D Confidence Regions from MCMC Samples I once did something like this with pymc, matplotlib, and scipy that you could adapt, the relevant code is in this gist, and the resulting plot looks like this:
Calculating 2D Confidence Regions from MCMC Samples I once did something like this with pymc, matplotlib, and scipy that you could adapt, the relevant code is in this gist, and the resulting plot looks like this:
33,046
Calculating 2D Confidence Regions from MCMC Samples
There is the R function ci2d from gplots that can create 2-dimensional empirical confidence regions: https://rdrr.io/cran/gplots/man/ci2d.html
Calculating 2D Confidence Regions from MCMC Samples
There is the R function ci2d from gplots that can create 2-dimensional empirical confidence regions: https://rdrr.io/cran/gplots/man/ci2d.html
Calculating 2D Confidence Regions from MCMC Samples There is the R function ci2d from gplots that can create 2-dimensional empirical confidence regions: https://rdrr.io/cran/gplots/man/ci2d.html
Calculating 2D Confidence Regions from MCMC Samples There is the R function ci2d from gplots that can create 2-dimensional empirical confidence regions: https://rdrr.io/cran/gplots/man/ci2d.html
33,047
On the use of weighted correlations in aggregated survey data
I imagine this is history by now, but just in case... 1) Yes, this seems appropriate. Your research question must be "are teacher attitudes/behaviours at a school related to student attitudes/behaviours at that school?" If this is your question, a school is the appropriate unit of analysis (and there would be no way to match up individual teachers to students anyway). I would just add caveats on the use of Pearson's correlation coefficient, unrelated to the question of the unit of analysis or sampling strategy. The correlation coefficient cannot pick up non-linear relationships, can be misleading to interpret, is easily distorted by a few outliers, and classical inference based on it depends on Normality (which won't hold exactly with your proportion data, although it may be a reasonable approximation). At a minimum I would carefully use graphical methods to check that this is a sensible approach and there is not a better way of inferring the relationship between the two variables. 2) I don't think you need to weight the data but I would certainly try it (and hope it doesn't change the results). But I would weight by your sample size in the school, not by the enrollment size. The reason would be about estimation rather than either your unit of analysis or any need to "weight to population". You only have an estimate of the true teacher and student responses in each school, drawing on your finite sample. Schools where you had a larger sample you are more confident in your estimate, and hence it would be good if they were taken more seriously in fitting your correlation or linear regression.
On the use of weighted correlations in aggregated survey data
I imagine this is history by now, but just in case... 1) Yes, this seems appropriate. Your research question must be "are teacher attitudes/behaviours at a school related to student attitudes/behavio
On the use of weighted correlations in aggregated survey data I imagine this is history by now, but just in case... 1) Yes, this seems appropriate. Your research question must be "are teacher attitudes/behaviours at a school related to student attitudes/behaviours at that school?" If this is your question, a school is the appropriate unit of analysis (and there would be no way to match up individual teachers to students anyway). I would just add caveats on the use of Pearson's correlation coefficient, unrelated to the question of the unit of analysis or sampling strategy. The correlation coefficient cannot pick up non-linear relationships, can be misleading to interpret, is easily distorted by a few outliers, and classical inference based on it depends on Normality (which won't hold exactly with your proportion data, although it may be a reasonable approximation). At a minimum I would carefully use graphical methods to check that this is a sensible approach and there is not a better way of inferring the relationship between the two variables. 2) I don't think you need to weight the data but I would certainly try it (and hope it doesn't change the results). But I would weight by your sample size in the school, not by the enrollment size. The reason would be about estimation rather than either your unit of analysis or any need to "weight to population". You only have an estimate of the true teacher and student responses in each school, drawing on your finite sample. Schools where you had a larger sample you are more confident in your estimate, and hence it would be good if they were taken more seriously in fitting your correlation or linear regression.
On the use of weighted correlations in aggregated survey data I imagine this is history by now, but just in case... 1) Yes, this seems appropriate. Your research question must be "are teacher attitudes/behaviours at a school related to student attitudes/behavio
33,048
How to remove trend with no look ahead bias?
There is no way to get rid of the end effects. Like any interpolation technique, the HP method depends on data before and after the current location to provide a filtered point/line for that location. As you approach either end of the data series and drop below the required number of future (or past) points, you either don't provide the filtered line or the characteristics of the filtered line must change. It is dangerous to blindly extend the line and assume that it has the same properties at the ends of the series as it does in the middle. The bottom line is, the HP filter has no predicting power.
How to remove trend with no look ahead bias?
There is no way to get rid of the end effects. Like any interpolation technique, the HP method depends on data before and after the current location to provide a filtered point/line for that location.
How to remove trend with no look ahead bias? There is no way to get rid of the end effects. Like any interpolation technique, the HP method depends on data before and after the current location to provide a filtered point/line for that location. As you approach either end of the data series and drop below the required number of future (or past) points, you either don't provide the filtered line or the characteristics of the filtered line must change. It is dangerous to blindly extend the line and assume that it has the same properties at the ends of the series as it does in the middle. The bottom line is, the HP filter has no predicting power.
How to remove trend with no look ahead bias? There is no way to get rid of the end effects. Like any interpolation technique, the HP method depends on data before and after the current location to provide a filtered point/line for that location.
33,049
How to remove trend with no look ahead bias?
De-trending requires a pre-specification of of how many values do you require before declaring that a new trend has started. Given this specification , say n values then one has to be concerned with distinguishing between Level Shifts ( i.e. intercept changes ) and time trend changes. If you assume that there are no Level Shifts then simply search for different points in time and select those points which have been find to be statistically significant. For example if you have the series 1,2,3,4,5,7,9,11 ...this would suggest two points in time where the trend "changed" , period 1 and period 5. Alternatively if you have a series like 0,0,0,0,0,1,2,3,4,5,,,,,, there is only 1 point in time where a significant trend is evidenced i.e. period 5 . Outliers and ARIMA structure in a time series can lead to distortions in the identification of trend-point changes and may need to be incorporated prior to trend-point detection. A recent paper on tree-ring data http://www.autobox.com/pdfs/forestdisturbance.pdf discusses this issue.
How to remove trend with no look ahead bias?
De-trending requires a pre-specification of of how many values do you require before declaring that a new trend has started. Given this specification , say n values then one has to be concerned with d
How to remove trend with no look ahead bias? De-trending requires a pre-specification of of how many values do you require before declaring that a new trend has started. Given this specification , say n values then one has to be concerned with distinguishing between Level Shifts ( i.e. intercept changes ) and time trend changes. If you assume that there are no Level Shifts then simply search for different points in time and select those points which have been find to be statistically significant. For example if you have the series 1,2,3,4,5,7,9,11 ...this would suggest two points in time where the trend "changed" , period 1 and period 5. Alternatively if you have a series like 0,0,0,0,0,1,2,3,4,5,,,,,, there is only 1 point in time where a significant trend is evidenced i.e. period 5 . Outliers and ARIMA structure in a time series can lead to distortions in the identification of trend-point changes and may need to be incorporated prior to trend-point detection. A recent paper on tree-ring data http://www.autobox.com/pdfs/forestdisturbance.pdf discusses this issue.
How to remove trend with no look ahead bias? De-trending requires a pre-specification of of how many values do you require before declaring that a new trend has started. Given this specification , say n values then one has to be concerned with d
33,050
How to remove trend with no look ahead bias?
One possibility would be to forecast/backcast both endpoints. Many seasonal adjustment methods like X12-ARIMA and TRAMO-SEATS do that. If you apply centered moving averages to the data, then you must somehow have more observations than series has. Some future and past values are needed. Regards, -A
How to remove trend with no look ahead bias?
One possibility would be to forecast/backcast both endpoints. Many seasonal adjustment methods like X12-ARIMA and TRAMO-SEATS do that. If you apply centered moving averages to the data, then you must
How to remove trend with no look ahead bias? One possibility would be to forecast/backcast both endpoints. Many seasonal adjustment methods like X12-ARIMA and TRAMO-SEATS do that. If you apply centered moving averages to the data, then you must somehow have more observations than series has. Some future and past values are needed. Regards, -A
How to remove trend with no look ahead bias? One possibility would be to forecast/backcast both endpoints. Many seasonal adjustment methods like X12-ARIMA and TRAMO-SEATS do that. If you apply centered moving averages to the data, then you must
33,051
STFT statistical analysis
I think the use of the spectrogram is visually interesting but not that obvious to exploit because of information redundency along frequencies. What we can see is that the changes between period are obvious. Also I would go back to the initial problem where you have for 3 different time periods indexed by $k=1,2,3$ a set of $n$ ($n=50$) signals of length $T>0$: $ i=1,\dots,n\; \; X^{k}_i\in \mathbb{R}^T$. From this I would simply do a some sort of "Functional ANOVA" (or "multivariate ANOVA") : $$X^{k}_i(t)=\mu_k+\beta_k(t)+\epsilon_{k,i}(t)$$ and test for difference in the mean i.e. test $\beta_1-\beta_2=0$ versus $\|\beta_1-\beta_2\|>\rho$. You might be interested in this paper also this paper involves a different FANOVA modelling. The difficult point in your real case might be that all assumption that are made in these papers are false (homoscedasticity, or stationnarity, ...) and you might need to build a different "functional" test adapted to your problem. Note that your idea of using multiscale analysis is not lost here because you can integrate it in the test (if I remember it is what is done in the first paper I mention).
STFT statistical analysis
I think the use of the spectrogram is visually interesting but not that obvious to exploit because of information redundency along frequencies. What we can see is that the changes between period are o
STFT statistical analysis I think the use of the spectrogram is visually interesting but not that obvious to exploit because of information redundency along frequencies. What we can see is that the changes between period are obvious. Also I would go back to the initial problem where you have for 3 different time periods indexed by $k=1,2,3$ a set of $n$ ($n=50$) signals of length $T>0$: $ i=1,\dots,n\; \; X^{k}_i\in \mathbb{R}^T$. From this I would simply do a some sort of "Functional ANOVA" (or "multivariate ANOVA") : $$X^{k}_i(t)=\mu_k+\beta_k(t)+\epsilon_{k,i}(t)$$ and test for difference in the mean i.e. test $\beta_1-\beta_2=0$ versus $\|\beta_1-\beta_2\|>\rho$. You might be interested in this paper also this paper involves a different FANOVA modelling. The difficult point in your real case might be that all assumption that are made in these papers are false (homoscedasticity, or stationnarity, ...) and you might need to build a different "functional" test adapted to your problem. Note that your idea of using multiscale analysis is not lost here because you can integrate it in the test (if I remember it is what is done in the first paper I mention).
STFT statistical analysis I think the use of the spectrogram is visually interesting but not that obvious to exploit because of information redundency along frequencies. What we can see is that the changes between period are o
33,052
Correlating continuous clinical variables and gene expression data
There are at least two possibilities for this data. One possibility is that your microarrays contain no disease markers whatsoever. But, they do contain information about age, and since in your case the sick and control populations are of different age, you get the illusion of good classification performance. Another possibility is that the microarrays do contain disease markers, and, moreover, these markers is exactly what SVM focuses on. It seems like the principal components of the data may be correlated with age in both of these possibilities. In the first case it will be because age is what the data expresses. In the second case it will be because disease is what the data expresses, and this disease is itself correlated with age (for your dataset). I don't think there is an easy way to look at the correlation value and conclude which case it is. I could think of several ways to assess the effect differently. One option is to split your training set into groups of equal age. In this case, for 'young' ages the normal class will have more training examples than the disease class, and vice versa for the older ages. But as long as there are enough examples, this should not be a problem. Another option is to do the same with the test sets, i.e. see whether the classifier tends to say 'sick' more often for older patients. Both of these options could be difficult since you don't have that many examples. One more option is to train two classifiers. In the first, the only feature will be the age. It seems this has AUC of 0.82. In the second, there will be age and the microarray data. (It seems that currently you train a different classifier which only uses the microarray data, and it gives you AUC 0.95. Adding the age feature explicitly is likely to improve performance, so AUC will be even higher.) If the second classifier performs better than the first, this indicates that age is not the only thing of interest in this data. Based on your comment, the improvement in AUC is 0.13 or more, which seems fair.
Correlating continuous clinical variables and gene expression data
There are at least two possibilities for this data. One possibility is that your microarrays contain no disease markers whatsoever. But, they do contain information about age, and since in your case t
Correlating continuous clinical variables and gene expression data There are at least two possibilities for this data. One possibility is that your microarrays contain no disease markers whatsoever. But, they do contain information about age, and since in your case the sick and control populations are of different age, you get the illusion of good classification performance. Another possibility is that the microarrays do contain disease markers, and, moreover, these markers is exactly what SVM focuses on. It seems like the principal components of the data may be correlated with age in both of these possibilities. In the first case it will be because age is what the data expresses. In the second case it will be because disease is what the data expresses, and this disease is itself correlated with age (for your dataset). I don't think there is an easy way to look at the correlation value and conclude which case it is. I could think of several ways to assess the effect differently. One option is to split your training set into groups of equal age. In this case, for 'young' ages the normal class will have more training examples than the disease class, and vice versa for the older ages. But as long as there are enough examples, this should not be a problem. Another option is to do the same with the test sets, i.e. see whether the classifier tends to say 'sick' more often for older patients. Both of these options could be difficult since you don't have that many examples. One more option is to train two classifiers. In the first, the only feature will be the age. It seems this has AUC of 0.82. In the second, there will be age and the microarray data. (It seems that currently you train a different classifier which only uses the microarray data, and it gives you AUC 0.95. Adding the age feature explicitly is likely to improve performance, so AUC will be even higher.) If the second classifier performs better than the first, this indicates that age is not the only thing of interest in this data. Based on your comment, the improvement in AUC is 0.13 or more, which seems fair.
Correlating continuous clinical variables and gene expression data There are at least two possibilities for this data. One possibility is that your microarrays contain no disease markers whatsoever. But, they do contain information about age, and since in your case t
33,053
Boundary effect in a wavelet multi resolution analysis
I think this is a good question and I don't kown much about implementations. Since wavelet is 'mutli-resolution' you have two types of solutions (which are somehow connected): Modify your signal for example extend you signal over the actual boundary to have meaningfull coefficients. Exemples of that are : periodic wavelet on the interval Zero padding (extend the signal by zero outside ist domain finer prodecure are extensions of zero padding with smoothness condition at the boundary. Modify the wavelet (somehow equivalent to threshold or lower wavelet coefficient that are near the boundary). More generally, there are procedures I know there have been many work since that of A Cohen I Daubechies et P Vial 1993. For example, in (Monasse and Perrier, 1995), wavelet that forms a basis adapted to conditions such as Dirichlet or Neumann are constructed. I guess some are implemented ? If you found implementations, I am interested. References: Monasse and Perrier : 1995 CRAS Ondelettes sur lintervalle pour la prise en compte de conditions aux limites A Cohen I Daubechies et P Vial Wavelets on the interval and fast wavelet transforms Appl Comp Harmonic Analysis (1993)
Boundary effect in a wavelet multi resolution analysis
I think this is a good question and I don't kown much about implementations. Since wavelet is 'mutli-resolution' you have two types of solutions (which are somehow connected): Modify your signal for
Boundary effect in a wavelet multi resolution analysis I think this is a good question and I don't kown much about implementations. Since wavelet is 'mutli-resolution' you have two types of solutions (which are somehow connected): Modify your signal for example extend you signal over the actual boundary to have meaningfull coefficients. Exemples of that are : periodic wavelet on the interval Zero padding (extend the signal by zero outside ist domain finer prodecure are extensions of zero padding with smoothness condition at the boundary. Modify the wavelet (somehow equivalent to threshold or lower wavelet coefficient that are near the boundary). More generally, there are procedures I know there have been many work since that of A Cohen I Daubechies et P Vial 1993. For example, in (Monasse and Perrier, 1995), wavelet that forms a basis adapted to conditions such as Dirichlet or Neumann are constructed. I guess some are implemented ? If you found implementations, I am interested. References: Monasse and Perrier : 1995 CRAS Ondelettes sur lintervalle pour la prise en compte de conditions aux limites A Cohen I Daubechies et P Vial Wavelets on the interval and fast wavelet transforms Appl Comp Harmonic Analysis (1993)
Boundary effect in a wavelet multi resolution analysis I think this is a good question and I don't kown much about implementations. Since wavelet is 'mutli-resolution' you have two types of solutions (which are somehow connected): Modify your signal for
33,054
Bayesian inference for multinomial distribution with asymmetric prior knowledge?
You have framed your question very well. I think what you are looking for here is a case of hierarchical modeling. And you may want to model multiple layers of hierarchy (at the moment you only talk about priors). Having another layer of hyper-priors for the hyper--parameters lets you model the additional variabilities in hyper-parameters (as you are concerned about the variability issues of hyper-parameters). It also makes your modeling flexible and robust (may be slower). Specifically in your case, you may benefit by having priors for the Dirichlet distribution parameters (Beta is a special case). This post by Gelman talks about how to impose priors on the parameters of Dirichlet distribution. He also cites on of his papers in a journal of toxicology.
Bayesian inference for multinomial distribution with asymmetric prior knowledge?
You have framed your question very well. I think what you are looking for here is a case of hierarchical modeling. And you may want to model multiple layers of hierarchy (at the moment you only talk a
Bayesian inference for multinomial distribution with asymmetric prior knowledge? You have framed your question very well. I think what you are looking for here is a case of hierarchical modeling. And you may want to model multiple layers of hierarchy (at the moment you only talk about priors). Having another layer of hyper-priors for the hyper--parameters lets you model the additional variabilities in hyper-parameters (as you are concerned about the variability issues of hyper-parameters). It also makes your modeling flexible and robust (may be slower). Specifically in your case, you may benefit by having priors for the Dirichlet distribution parameters (Beta is a special case). This post by Gelman talks about how to impose priors on the parameters of Dirichlet distribution. He also cites on of his papers in a journal of toxicology.
Bayesian inference for multinomial distribution with asymmetric prior knowledge? You have framed your question very well. I think what you are looking for here is a case of hierarchical modeling. And you may want to model multiple layers of hierarchy (at the moment you only talk a
33,055
Any ideas about how to analyze survival data with pseudo-replication (dependent data)?
Here's some thoughts on what I'd do using relatively simple methods (i.e. avoiding frailty models, which I admit I've never used and don't really understand, so someone else may like to provide an answer involving them). I'm assuming you don't have other forms of censoring apart from the end of the experiment and that there are no time-dependent exposures (i.e. the treatment is either constant or applied only at the start before any deaths have taken place) Do some descriptive statistics and Kaplan-Meier plots ignoring the issue of dependence and therefore without reporting or displaying standard errors, confidence intervals or p-values. Ignore the time component and just count the number of deaths out of the total starting number in each aquarium. Fit a generalized linear model with a binomial distribution to these counts, using either a logistic link function (to give odds ratios) or a log link function (giving easier-to-interpret risk ratios at the price of potential problems with fitting the model). I think this is along the same lines as the analysis you said you're considering in the first comment to the question. As your mortalities are reasonably low, the loss in power over a full survival analysis with frailty modelling will probably be modest. This overcomes the dependence issue as you are using each aquarium as the unit of analysis instead of each individual.
Any ideas about how to analyze survival data with pseudo-replication (dependent data)?
Here's some thoughts on what I'd do using relatively simple methods (i.e. avoiding frailty models, which I admit I've never used and don't really understand, so someone else may like to provide an ans
Any ideas about how to analyze survival data with pseudo-replication (dependent data)? Here's some thoughts on what I'd do using relatively simple methods (i.e. avoiding frailty models, which I admit I've never used and don't really understand, so someone else may like to provide an answer involving them). I'm assuming you don't have other forms of censoring apart from the end of the experiment and that there are no time-dependent exposures (i.e. the treatment is either constant or applied only at the start before any deaths have taken place) Do some descriptive statistics and Kaplan-Meier plots ignoring the issue of dependence and therefore without reporting or displaying standard errors, confidence intervals or p-values. Ignore the time component and just count the number of deaths out of the total starting number in each aquarium. Fit a generalized linear model with a binomial distribution to these counts, using either a logistic link function (to give odds ratios) or a log link function (giving easier-to-interpret risk ratios at the price of potential problems with fitting the model). I think this is along the same lines as the analysis you said you're considering in the first comment to the question. As your mortalities are reasonably low, the loss in power over a full survival analysis with frailty modelling will probably be modest. This overcomes the dependence issue as you are using each aquarium as the unit of analysis instead of each individual.
Any ideas about how to analyze survival data with pseudo-replication (dependent data)? Here's some thoughts on what I'd do using relatively simple methods (i.e. avoiding frailty models, which I admit I've never used and don't really understand, so someone else may like to provide an ans
33,056
Why report test statistics in a publication?
I'm certainly not a mind reader as to why or how these recommendations came into being; however, I can at least speculate and share some personal experience in APA. As you observed in your response to @BruceET, the APA guidelines for reporting the test statistic do predate the major position papers on the misuse of p-values. As such, the recommendations also predate the transition to assuming that effect sizes will be reported for every test. Prior to such a requirement, interested readers could at least compute some rough effect measures from the test statistics (e.g., d = t/sqrt(df)). Ultimately, though, I think the short answer is as a matter of transparency. If someone reports their results as t(30) = 1.50, p < .001, d = 1.25, then readers (ideally this would be caught by the reviewers/editors) can look at those values and see clearly that this is incorrect. Similarly, if someone were to just report, "The means differed significantly, p < .001," then we may be missing some vital information. I think your question is fair in a world where research know exactly what they're doing and are making well-informed decisions; however, the reality is that statistical software packages can't always warn someone that they are requesting a non-sensical test. I think this also matters for questions of parametric versus non-parametric tests. Saying something like, "the variables were significantly correlated, p < .05" doesn't tell us the kind of correlation and thus might not help us understand the potential meaning of that result. On the note of degrees of freedom, I do think part of that is related to ways of computing effect sizes, but I think it is also a transparency issue as well. Just because the total sample for a study may be large, once you factor in missing observations, the n for specific statistical tests and the N of the sample can be fairly different. Should an author find that their test was non-significant in the entire sample, they may be tempted to start looking at subgroups or portions of the sample, and reporting the degrees of freedom for each of those results helps prevent mis-interpretation. In short, I think in a perfect world where everyone is very responsible in their research and everyone understand the statistics they are using, there wouldn't be any need for reporting the statistics themselves. I think, however, as a matter of pragmatism and good faith effort for transparency in research, reference styles like APA recommend such practices.
Why report test statistics in a publication?
I'm certainly not a mind reader as to why or how these recommendations came into being; however, I can at least speculate and share some personal experience in APA. As you observed in your response to
Why report test statistics in a publication? I'm certainly not a mind reader as to why or how these recommendations came into being; however, I can at least speculate and share some personal experience in APA. As you observed in your response to @BruceET, the APA guidelines for reporting the test statistic do predate the major position papers on the misuse of p-values. As such, the recommendations also predate the transition to assuming that effect sizes will be reported for every test. Prior to such a requirement, interested readers could at least compute some rough effect measures from the test statistics (e.g., d = t/sqrt(df)). Ultimately, though, I think the short answer is as a matter of transparency. If someone reports their results as t(30) = 1.50, p < .001, d = 1.25, then readers (ideally this would be caught by the reviewers/editors) can look at those values and see clearly that this is incorrect. Similarly, if someone were to just report, "The means differed significantly, p < .001," then we may be missing some vital information. I think your question is fair in a world where research know exactly what they're doing and are making well-informed decisions; however, the reality is that statistical software packages can't always warn someone that they are requesting a non-sensical test. I think this also matters for questions of parametric versus non-parametric tests. Saying something like, "the variables were significantly correlated, p < .05" doesn't tell us the kind of correlation and thus might not help us understand the potential meaning of that result. On the note of degrees of freedom, I do think part of that is related to ways of computing effect sizes, but I think it is also a transparency issue as well. Just because the total sample for a study may be large, once you factor in missing observations, the n for specific statistical tests and the N of the sample can be fairly different. Should an author find that their test was non-significant in the entire sample, they may be tempted to start looking at subgroups or portions of the sample, and reporting the degrees of freedom for each of those results helps prevent mis-interpretation. In short, I think in a perfect world where everyone is very responsible in their research and everyone understand the statistics they are using, there wouldn't be any need for reporting the statistics themselves. I think, however, as a matter of pragmatism and good faith effort for transparency in research, reference styles like APA recommend such practices.
Why report test statistics in a publication? I'm certainly not a mind reader as to why or how these recommendations came into being; however, I can at least speculate and share some personal experience in APA. As you observed in your response to
33,057
Type of residuals to check linear regression assumptions
From my experience, you should not get different conclusions when assessing the normality of residuals. Some authors note that standardized residuals z >|2.00| should be assessed. However, note that the calculation of standardized residuals (ZRESID) is based on the generally untenable assumption that all residuals have the same variance. To avoid making this assumption, it is suggested that studentized residuals (SRESID) are used instead. Essentially, you can accomplish this by dividing each residual by its estimated standard deviation. To be frank, I am not sure, but I wanted to add a couple of notes for consideration. In terms of autocorrelation: it normally only makes sense to test for it, once your observations have some ordering (e.g. time, distance). Also, when checking for outliers and influential cases, you might think of using Cook's D (distance) instead (Cook, 1977). This measure was designed to identify an influential observation or an outlier whose influence is due to its status on the independent variables(s), the dependent variable, or both. References: Cook, R. D. (1977). Detection of influential observation in linear regression. Technometrics, 19(1), 15-18. Pedhazur, E. J. (1997). Multiple regression in behavioral research: Explanation and prediction. Thompson Learning. Inc: New York, NY.
Type of residuals to check linear regression assumptions
From my experience, you should not get different conclusions when assessing the normality of residuals. Some authors note that standardized residuals z >|2.00| should be assessed. However, note that
Type of residuals to check linear regression assumptions From my experience, you should not get different conclusions when assessing the normality of residuals. Some authors note that standardized residuals z >|2.00| should be assessed. However, note that the calculation of standardized residuals (ZRESID) is based on the generally untenable assumption that all residuals have the same variance. To avoid making this assumption, it is suggested that studentized residuals (SRESID) are used instead. Essentially, you can accomplish this by dividing each residual by its estimated standard deviation. To be frank, I am not sure, but I wanted to add a couple of notes for consideration. In terms of autocorrelation: it normally only makes sense to test for it, once your observations have some ordering (e.g. time, distance). Also, when checking for outliers and influential cases, you might think of using Cook's D (distance) instead (Cook, 1977). This measure was designed to identify an influential observation or an outlier whose influence is due to its status on the independent variables(s), the dependent variable, or both. References: Cook, R. D. (1977). Detection of influential observation in linear regression. Technometrics, 19(1), 15-18. Pedhazur, E. J. (1997). Multiple regression in behavioral research: Explanation and prediction. Thompson Learning. Inc: New York, NY.
Type of residuals to check linear regression assumptions From my experience, you should not get different conclusions when assessing the normality of residuals. Some authors note that standardized residuals z >|2.00| should be assessed. However, note that
33,058
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array?
Such arrays are sometimes called tensors, although you can see there are other definitions that become more relevant in general relativity and abstract algebra. Specifically in the literature on tensor decomposition we find a more specialized lexicon. For a 3-mode tensor (analogous to 3d array) there are special names: Mode 1: columns Mode 2: rows Mode 3: tubes The following diagram from Kolda and Bader 2009 is quite clarifying. But since such tensors are often $n$-modal it is desirable to have the terminology of a mode-$k$ fiber for the $k$th mode of the tensor. We can access the ith, jth tube in the example array given as follows: import numpy as np X = np.array([[[ 0, 1], [ 2, 3], [ 4, 5]], [[ 6, 7], [ 8, 9], [10, 11]], [[12, 13], [14, 15], [16, 17]]]) # Let us pick (i,j) = (0,1) i = 0 j = 1 print(X[i,j,:])
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array?
Such arrays are sometimes called tensors, although you can see there are other definitions that become more relevant in general relativity and abstract algebra. Specifically in the literature on tenso
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array? Such arrays are sometimes called tensors, although you can see there are other definitions that become more relevant in general relativity and abstract algebra. Specifically in the literature on tensor decomposition we find a more specialized lexicon. For a 3-mode tensor (analogous to 3d array) there are special names: Mode 1: columns Mode 2: rows Mode 3: tubes The following diagram from Kolda and Bader 2009 is quite clarifying. But since such tensors are often $n$-modal it is desirable to have the terminology of a mode-$k$ fiber for the $k$th mode of the tensor. We can access the ith, jth tube in the example array given as follows: import numpy as np X = np.array([[[ 0, 1], [ 2, 3], [ 4, 5]], [[ 6, 7], [ 8, 9], [10, 11]], [[12, 13], [14, 15], [16, 17]]]) # Let us pick (i,j) = (0,1) i = 0 j = 1 print(X[i,j,:])
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array? Such arrays are sometimes called tensors, although you can see there are other definitions that become more relevant in general relativity and abstract algebra. Specifically in the literature on tenso
33,059
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array?
As far as I know, there’s no single name for them. Usually with multi-dimensional data, the dimensions have particular meaning, e.g. the third dimension could be time in time-series, or RGB channels for pictures, use those for naming them. Rows and columns are popular with tabular data, but for same reason as above, it is usually more informative to talk about samples in rows and features in columns, especially since different software may use different defaults for them, e.g. Python’s Numpy by default assumes samples in columns and features in rows.
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array?
As far as I know, there’s no single name for them. Usually with multi-dimensional data, the dimensions have particular meaning, e.g. the third dimension could be time in time-series, or RGB channels f
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array? As far as I know, there’s no single name for them. Usually with multi-dimensional data, the dimensions have particular meaning, e.g. the third dimension could be time in time-series, or RGB channels for pictures, use those for naming them. Rows and columns are popular with tabular data, but for same reason as above, it is usually more informative to talk about samples in rows and features in columns, especially since different software may use different defaults for them, e.g. Python’s Numpy by default assumes samples in columns and features in rows.
"row" and "column" are the names of axes of 2d array, is there a similar naming for a 3d array? As far as I know, there’s no single name for them. Usually with multi-dimensional data, the dimensions have particular meaning, e.g. the third dimension could be time in time-series, or RGB channels f
33,060
Limiting distribution of $\frac1n \sum_{k=1}^{n}|S_{k-1}|(X_k^2 - 1)$ where $X_k$ are i.i.d standard normal
When I simulate the distribution then I get something that resembles a Laplace distribution. Even better seems to be a q-Gausian (the exact parameters you would have to find using theory). I guess that your book must contain some variation of the CLT that relates to that (q-generalised central limit theorem, probably it is in Section 7.6 The central limit theorem for sums of dependent variables, but I can't look it up as I do not have the book available). library(qGaussian) set.seed(1) Qstore <- c(0) # vector to store result n <- 10^6 # columns X_i m <- 10^2 # rows repetitions pb <- txtProgressBar(title = "progress bar", min = 0, max = 100, style=3) for (i in 1:100) { # doing this several times because this matrix method takes a lot of memory # with smaller numbers n*m it can be done at once X <- matrix(rnorm(n*m,0,1),m) S <- t(sapply(1:m, FUN = function(x) cumsum(X[x,]))) S <- cbind(rep(0,m),S[,-n]) R <- abs(S)*(X^2-1) Q <- t(sapply(1:m, FUN = function(x) cumsum(R[x,]))) Qstore <- c(Qstore,t(Q[,n])) setTxtProgressBar(pb, i) } close(pb) # compute histogram x <- seq(floor(min(Qstore/n)), ceiling(max(Qstore/n)), 0.2) h <- hist(Qstore/(n),breaks = x) # plot simulation plot( h$mid, h$density, log = "y", xlim=c(-7,7), ylab = "log density" , xlab = expression(over(1,n)*sum(abs(S[k-1])*(X[k]^2-1),k==1,n) ) ) # distributions for comparison lines(x, dnorm(x,0,1), col=1, lty=3) #normal lines(x, dexp(abs(x),sqrt(2))/2, col=1, lty=2) #laplace lines(x, qGaussian::dqgauss(x,sqrt(2),0,1/sqrt(2)), col=1, lty=1) #qgauss # further plotting title("10^4 repetitions with n=10^6") legend(-7,0.6,c("Gaussian", "Laplace", "Q-Gaussian"),col=1, lty=c(3,2,1),cex=0.8)
Limiting distribution of $\frac1n \sum_{k=1}^{n}|S_{k-1}|(X_k^2 - 1)$ where $X_k$ are i.i.d standard
When I simulate the distribution then I get something that resembles a Laplace distribution. Even better seems to be a q-Gausian (the exact parameters you would have to find using theory). I guess th
Limiting distribution of $\frac1n \sum_{k=1}^{n}|S_{k-1}|(X_k^2 - 1)$ where $X_k$ are i.i.d standard normal When I simulate the distribution then I get something that resembles a Laplace distribution. Even better seems to be a q-Gausian (the exact parameters you would have to find using theory). I guess that your book must contain some variation of the CLT that relates to that (q-generalised central limit theorem, probably it is in Section 7.6 The central limit theorem for sums of dependent variables, but I can't look it up as I do not have the book available). library(qGaussian) set.seed(1) Qstore <- c(0) # vector to store result n <- 10^6 # columns X_i m <- 10^2 # rows repetitions pb <- txtProgressBar(title = "progress bar", min = 0, max = 100, style=3) for (i in 1:100) { # doing this several times because this matrix method takes a lot of memory # with smaller numbers n*m it can be done at once X <- matrix(rnorm(n*m,0,1),m) S <- t(sapply(1:m, FUN = function(x) cumsum(X[x,]))) S <- cbind(rep(0,m),S[,-n]) R <- abs(S)*(X^2-1) Q <- t(sapply(1:m, FUN = function(x) cumsum(R[x,]))) Qstore <- c(Qstore,t(Q[,n])) setTxtProgressBar(pb, i) } close(pb) # compute histogram x <- seq(floor(min(Qstore/n)), ceiling(max(Qstore/n)), 0.2) h <- hist(Qstore/(n),breaks = x) # plot simulation plot( h$mid, h$density, log = "y", xlim=c(-7,7), ylab = "log density" , xlab = expression(over(1,n)*sum(abs(S[k-1])*(X[k]^2-1),k==1,n) ) ) # distributions for comparison lines(x, dnorm(x,0,1), col=1, lty=3) #normal lines(x, dexp(abs(x),sqrt(2))/2, col=1, lty=2) #laplace lines(x, qGaussian::dqgauss(x,sqrt(2),0,1/sqrt(2)), col=1, lty=1) #qgauss # further plotting title("10^4 repetitions with n=10^6") legend(-7,0.6,c("Gaussian", "Laplace", "Q-Gaussian"),col=1, lty=c(3,2,1),cex=0.8)
Limiting distribution of $\frac1n \sum_{k=1}^{n}|S_{k-1}|(X_k^2 - 1)$ where $X_k$ are i.i.d standard When I simulate the distribution then I get something that resembles a Laplace distribution. Even better seems to be a q-Gausian (the exact parameters you would have to find using theory). I guess th
33,061
Asymmetric or unequal misclassification costs in random forest
Misclassification costs can often be dealt with through class weights, the same way as unbalanced classes can. This means that if the misclassification cost is higher for a class, elements of such a class will be more influent when making predictions. For decision trees and random forests, this has been shown in this paper by Breiman, that I would say puts together points 1 and 2 of your question. Indeed, Weighted Random Forest uses a weighted version of the Gini Coefficient in order to make the splits. This means that the Gini Coefficient will be maximum when the weighted sum of the elements of each class is equal (normally, Gini is maximum when elements are evenly distributed within the classes) (1). At the same time, this also means that the threshold that is used when considering the majority class of a node will not be 0.5, but it will come from the ratio of the class weights. Finally, this also applies for predictions (2), as the threshold will be modified by the weights. Unfortunately, to this day I do not know any major statistical package using this method, as class weights are usually used for over/undersampling of the classes, which is much more specific to unbalanced classes. Finally, using the ROC score is always advised when your classes and/or your costs are not balanced, so that you can tweak the thresholds to balance the results of your classifier.
Asymmetric or unequal misclassification costs in random forest
Misclassification costs can often be dealt with through class weights, the same way as unbalanced classes can. This means that if the misclassification cost is higher for a class, elements of such a c
Asymmetric or unequal misclassification costs in random forest Misclassification costs can often be dealt with through class weights, the same way as unbalanced classes can. This means that if the misclassification cost is higher for a class, elements of such a class will be more influent when making predictions. For decision trees and random forests, this has been shown in this paper by Breiman, that I would say puts together points 1 and 2 of your question. Indeed, Weighted Random Forest uses a weighted version of the Gini Coefficient in order to make the splits. This means that the Gini Coefficient will be maximum when the weighted sum of the elements of each class is equal (normally, Gini is maximum when elements are evenly distributed within the classes) (1). At the same time, this also means that the threshold that is used when considering the majority class of a node will not be 0.5, but it will come from the ratio of the class weights. Finally, this also applies for predictions (2), as the threshold will be modified by the weights. Unfortunately, to this day I do not know any major statistical package using this method, as class weights are usually used for over/undersampling of the classes, which is much more specific to unbalanced classes. Finally, using the ROC score is always advised when your classes and/or your costs are not balanced, so that you can tweak the thresholds to balance the results of your classifier.
Asymmetric or unequal misclassification costs in random forest Misclassification costs can often be dealt with through class weights, the same way as unbalanced classes can. This means that if the misclassification cost is higher for a class, elements of such a c
33,062
Name of mean- or median-like values?
This is only a partial answer for $c \in (0,1]$: A Fréchet mean has the form $$\Psi(x) = \operatorname{argmin}_r \sum_i d(r, x_i)$$ where $(M,d)$ is a metric space and $x \in M^k$ and $d$ is a metric. In our case $$ d(x, y) = | x - y |^c$$ is indeed a metric on $M = \mathbb R$, but only for $c \in (0,1]$. In this case we can indeed call it a Fréchet mean with the given metric $d$.
Name of mean- or median-like values?
This is only a partial answer for $c \in (0,1]$: A Fréchet mean has the form $$\Psi(x) = \operatorname{argmin}_r \sum_i d(r, x_i)$$ where $(M,d)$ is a metric space and $x \in M^k$ and $d$ is a metric.
Name of mean- or median-like values? This is only a partial answer for $c \in (0,1]$: A Fréchet mean has the form $$\Psi(x) = \operatorname{argmin}_r \sum_i d(r, x_i)$$ where $(M,d)$ is a metric space and $x \in M^k$ and $d$ is a metric. In our case $$ d(x, y) = | x - y |^c$$ is indeed a metric on $M = \mathbb R$, but only for $c \in (0,1]$. In this case we can indeed call it a Fréchet mean with the given metric $d$.
Name of mean- or median-like values? This is only a partial answer for $c \in (0,1]$: A Fréchet mean has the form $$\Psi(x) = \operatorname{argmin}_r \sum_i d(r, x_i)$$ where $(M,d)$ is a metric space and $x \in M^k$ and $d$ is a metric.
33,063
Name of mean- or median-like values?
The term "$L_p$-estimator" (i.e., L1, L2,..., where the $p$ in the literature is your $c$) is sometimes used to refer to such estimators. https://iopscience.iop.org/article/10.1088/0026-1394/43/3/004 However, I have hardly seen this term used for estimators of 1-dimensional location, more in regression (of which 1-d location is a special case). More generally, M-estimators are defined by $\sum_{i=1}^n \rho(x_i,\theta)=\min!$.
Name of mean- or median-like values?
The term "$L_p$-estimator" (i.e., L1, L2,..., where the $p$ in the literature is your $c$) is sometimes used to refer to such estimators. https://iopscience.iop.org/article/10.1088/0026-1394/43/3/004
Name of mean- or median-like values? The term "$L_p$-estimator" (i.e., L1, L2,..., where the $p$ in the literature is your $c$) is sometimes used to refer to such estimators. https://iopscience.iop.org/article/10.1088/0026-1394/43/3/004 However, I have hardly seen this term used for estimators of 1-dimensional location, more in regression (of which 1-d location is a special case). More generally, M-estimators are defined by $\sum_{i=1}^n \rho(x_i,\theta)=\min!$.
Name of mean- or median-like values? The term "$L_p$-estimator" (i.e., L1, L2,..., where the $p$ in the literature is your $c$) is sometimes used to refer to such estimators. https://iopscience.iop.org/article/10.1088/0026-1394/43/3/004
33,064
Name of mean- or median-like values?
A rather old paper (1917) Algebraic means by Fujisawa refers to them as power means although you have to take the $c$th root to get that. His article also discusses algebraic means which are related.
Name of mean- or median-like values?
A rather old paper (1917) Algebraic means by Fujisawa refers to them as power means although you have to take the $c$th root to get that. His article also discusses algebraic means which are related.
Name of mean- or median-like values? A rather old paper (1917) Algebraic means by Fujisawa refers to them as power means although you have to take the $c$th root to get that. His article also discusses algebraic means which are related.
Name of mean- or median-like values? A rather old paper (1917) Algebraic means by Fujisawa refers to them as power means although you have to take the $c$th root to get that. His article also discusses algebraic means which are related.
33,065
What problem or game are variance and standard deviation optimal solutions for?
If I have understood the question as intended, you have in mind a setting in which you can obtain independent realizations of any random variable $X$ with any distribution $F$ (having finite variance $\sigma^2(F)$). The "game" is determined by functions $h$ and $\mathcal L$ to be described. It consists of the following steps and rules: Your opponent ("Nature") reveals $F.$ In response you produce a number $t(F),$ your "prediction." To evaluate the outcome of the game, the following calculations are performed: A sample of $n$ iid observations $\mathbf{X}=X_1, X_2, \ldots, X_n$ is drawn from $F.$ A predetermined function $h$ is applied to the sample, producing a number $h(\mathbf{X}),$ the "statistic." The "loss function" $\mathcal{L}$ compares your "prediction" $t(F)$ to the statistic $h(\mathbf{X}),$ producing a non-negative number $\mathcal{L}(t(F), h(\mathbf{X})).$ The outcome of the game is the expected loss (or "risk") $$R_{(\mathcal{L}, h)}(t, F) = E(\mathcal{L}(t(F), h(\mathbf{X}))).$$ Your objective is to respond to Nature's move by specifying some $t$ that minimizes the risk. For example, in the game with the function $h(X_1)=X_1$ and any loss of the form $\mathcal{L}(t, h) = \lambda(t-h)^2$ for some positive number $\lambda,$ your optimal move is to pick $t(F)$ to be the expectation of $F.$ The question before us is, Do there exist $\mathcal{L}$ and $h$ for which the optimal move is to pick $t(F)$ to be the variance $\sigma^2(F)$? This is readily answered by exhibiting the variance as an expectation. One way is to stipulate that $$h(X_1,X_2) = \frac{1}{2}(X_1-X_2)^2$$ and continue to use quadratic loss $$\mathcal{L}(t,h) = (t-h)^2.$$ Upon observing that $$E(h(\mathbf{X})) = \sigma^2(F),$$ the example allows us to conclude that this $h$ and this $\mathcal L$ answer the question about variance. What about the standard deviation $\sigma(F)$? Again, we need only exhibit this as the expectation of a sample statistic. However, that's not possible, because even when we limit $F$ to the family of Bernoulli$(p)$ distributions we can only obtain unbiased estimators of polynomial functions of $p,$ but $\sigma(F) = \sqrt{p(1-p)}$ is not a polynomial function on the domain $p\in (0,1).$ (See For the binomial distribution, why does no unbiased estimator exist for $1/p$? for the general argument about Binomial distributions, to which this question can be reduced after averaging $h$ over all permutations of the $X_i.$)
What problem or game are variance and standard deviation optimal solutions for?
If I have understood the question as intended, you have in mind a setting in which you can obtain independent realizations of any random variable $X$ with any distribution $F$ (having finite variance
What problem or game are variance and standard deviation optimal solutions for? If I have understood the question as intended, you have in mind a setting in which you can obtain independent realizations of any random variable $X$ with any distribution $F$ (having finite variance $\sigma^2(F)$). The "game" is determined by functions $h$ and $\mathcal L$ to be described. It consists of the following steps and rules: Your opponent ("Nature") reveals $F.$ In response you produce a number $t(F),$ your "prediction." To evaluate the outcome of the game, the following calculations are performed: A sample of $n$ iid observations $\mathbf{X}=X_1, X_2, \ldots, X_n$ is drawn from $F.$ A predetermined function $h$ is applied to the sample, producing a number $h(\mathbf{X}),$ the "statistic." The "loss function" $\mathcal{L}$ compares your "prediction" $t(F)$ to the statistic $h(\mathbf{X}),$ producing a non-negative number $\mathcal{L}(t(F), h(\mathbf{X})).$ The outcome of the game is the expected loss (or "risk") $$R_{(\mathcal{L}, h)}(t, F) = E(\mathcal{L}(t(F), h(\mathbf{X}))).$$ Your objective is to respond to Nature's move by specifying some $t$ that minimizes the risk. For example, in the game with the function $h(X_1)=X_1$ and any loss of the form $\mathcal{L}(t, h) = \lambda(t-h)^2$ for some positive number $\lambda,$ your optimal move is to pick $t(F)$ to be the expectation of $F.$ The question before us is, Do there exist $\mathcal{L}$ and $h$ for which the optimal move is to pick $t(F)$ to be the variance $\sigma^2(F)$? This is readily answered by exhibiting the variance as an expectation. One way is to stipulate that $$h(X_1,X_2) = \frac{1}{2}(X_1-X_2)^2$$ and continue to use quadratic loss $$\mathcal{L}(t,h) = (t-h)^2.$$ Upon observing that $$E(h(\mathbf{X})) = \sigma^2(F),$$ the example allows us to conclude that this $h$ and this $\mathcal L$ answer the question about variance. What about the standard deviation $\sigma(F)$? Again, we need only exhibit this as the expectation of a sample statistic. However, that's not possible, because even when we limit $F$ to the family of Bernoulli$(p)$ distributions we can only obtain unbiased estimators of polynomial functions of $p,$ but $\sigma(F) = \sqrt{p(1-p)}$ is not a polynomial function on the domain $p\in (0,1).$ (See For the binomial distribution, why does no unbiased estimator exist for $1/p$? for the general argument about Binomial distributions, to which this question can be reduced after averaging $h$ over all permutations of the $X_i.$)
What problem or game are variance and standard deviation optimal solutions for? If I have understood the question as intended, you have in mind a setting in which you can obtain independent realizations of any random variable $X$ with any distribution $F$ (having finite variance
33,066
Approximating the mathematical expectation of the argmax of a Gaussian random vector
You can use the law of large numbers to approximate your expectation pretty easily. Edit: Analyticaly you can multiply a bunch of normal cdf evaluations together. For $i > 0$ \begin{align*} \mathbb{P}\left( {I = i} \right) &= \mathbb{P}\left( {{X_i} = \mathop {\max {X_j}}\limits_{j = 1,n} } \right) \\ &= \prod_{j \ne i} \mathbb{P}\left( {{X_i} > X_j } \right) \\ &= \prod_{j \ne i} \mathbb{P}\left( Y_j \le 0 \right) \end{align*} where $Y_j \sim \text{Normal}(\mu_j - \mu_i, \Sigma_j + \Sigma_i)$. If we code $i=0$ as the event that no data point is clearly a maximum, then $\mathbb{P}\left( I = 0 \right) = 1 - \sum_{k=1}^n \mathbb{P}\left( I = k \right)$
Approximating the mathematical expectation of the argmax of a Gaussian random vector
You can use the law of large numbers to approximate your expectation pretty easily. Edit: Analyticaly you can multiply a bunch of normal cdf evaluations together. For $i > 0$ \begin{align*} \mathbb{P
Approximating the mathematical expectation of the argmax of a Gaussian random vector You can use the law of large numbers to approximate your expectation pretty easily. Edit: Analyticaly you can multiply a bunch of normal cdf evaluations together. For $i > 0$ \begin{align*} \mathbb{P}\left( {I = i} \right) &= \mathbb{P}\left( {{X_i} = \mathop {\max {X_j}}\limits_{j = 1,n} } \right) \\ &= \prod_{j \ne i} \mathbb{P}\left( {{X_i} > X_j } \right) \\ &= \prod_{j \ne i} \mathbb{P}\left( Y_j \le 0 \right) \end{align*} where $Y_j \sim \text{Normal}(\mu_j - \mu_i, \Sigma_j + \Sigma_i)$. If we code $i=0$ as the event that no data point is clearly a maximum, then $\mathbb{P}\left( I = 0 \right) = 1 - \sum_{k=1}^n \mathbb{P}\left( I = k \right)$
Approximating the mathematical expectation of the argmax of a Gaussian random vector You can use the law of large numbers to approximate your expectation pretty easily. Edit: Analyticaly you can multiply a bunch of normal cdf evaluations together. For $i > 0$ \begin{align*} \mathbb{P
33,067
forecast::auto.arima() is not returning a model with a differencing parameter when it should
auto.arima is a brute force list-based procedure that tries a fixed set of models and selects the calculated AIC based upon estimated parameters. The AIC should be calculated from residuals using models that control for intervention administration, otherwise the intervention effects are taken to be Gaussian noise, underestimating the actual model's autoregressive effect and thus miscalculates the model parameters which leads directly to an incorrect error sum of squares and ultimately an incorrect AIC. More importantly the only remedy it has for non-stationarity ( besides power transforms ) is to suggest differencing. I took the 58 values and used AUTOBOX (my tool of choice .. since I helped to develop it ! )to automatically identify a possible arima model with any needed Interventions effects included. The model identified (arima portion) is remarkably similar to auto.arima with the exception that the forecast assymptotes to a much lower level. This is due to the detection and incorporation of a level shift (N.B. a level shift refelects that de-meaning the series is needed NOT differencing the series as the suggested cause of the non-stationarity ). The equation is here with a level shift at period 48 . with statistics here The residuals from the model are here with acf here . The plot of the forecasts is here Finally the reflection by @jbowman is well intended as it highlights the AR(1) as deficient due to the untreated anomalous structure in the residuals i.e. the level shift at period 48 . Note the permanent drop-off (level shift) at period 48 . Manual/visual detecting the need for a level shift in the model can sometimes be done in this manner by identifying structure in a tentative set of residuals. In closing , the adf tests you cited have assumptions .. one of them is no pulses , level shifts , local time trends or seasonal pulses are needed. That is possibly why your are experiencing a conundrum . Test assumptions are very important . IN answer to your question/comment .... The series is non-stationary BUT differencing is not needed.
forecast::auto.arima() is not returning a model with a differencing parameter when it should
auto.arima is a brute force list-based procedure that tries a fixed set of models and selects the calculated AIC based upon estimated parameters. The AIC should be calculated from residuals using mode
forecast::auto.arima() is not returning a model with a differencing parameter when it should auto.arima is a brute force list-based procedure that tries a fixed set of models and selects the calculated AIC based upon estimated parameters. The AIC should be calculated from residuals using models that control for intervention administration, otherwise the intervention effects are taken to be Gaussian noise, underestimating the actual model's autoregressive effect and thus miscalculates the model parameters which leads directly to an incorrect error sum of squares and ultimately an incorrect AIC. More importantly the only remedy it has for non-stationarity ( besides power transforms ) is to suggest differencing. I took the 58 values and used AUTOBOX (my tool of choice .. since I helped to develop it ! )to automatically identify a possible arima model with any needed Interventions effects included. The model identified (arima portion) is remarkably similar to auto.arima with the exception that the forecast assymptotes to a much lower level. This is due to the detection and incorporation of a level shift (N.B. a level shift refelects that de-meaning the series is needed NOT differencing the series as the suggested cause of the non-stationarity ). The equation is here with a level shift at period 48 . with statistics here The residuals from the model are here with acf here . The plot of the forecasts is here Finally the reflection by @jbowman is well intended as it highlights the AR(1) as deficient due to the untreated anomalous structure in the residuals i.e. the level shift at period 48 . Note the permanent drop-off (level shift) at period 48 . Manual/visual detecting the need for a level shift in the model can sometimes be done in this manner by identifying structure in a tentative set of residuals. In closing , the adf tests you cited have assumptions .. one of them is no pulses , level shifts , local time trends or seasonal pulses are needed. That is possibly why your are experiencing a conundrum . Test assumptions are very important . IN answer to your question/comment .... The series is non-stationary BUT differencing is not needed.
forecast::auto.arima() is not returning a model with a differencing parameter when it should auto.arima is a brute force list-based procedure that tries a fixed set of models and selects the calculated AIC based upon estimated parameters. The AIC should be calculated from residuals using mode
33,068
When using GAMs, how much concurvity is too much?
I realise this is a very late response, but in case anyone else is looking for an answer on this too: Noam Ross' free course on GAMs advises 0.80 for the "worst concurvity" measure (as opposed to estimate and observed concurvity). The course does not provide a justification for this "threshold" though nor an explanation on why to look at worst concurvity rather than estimate or observed concurvity, or what the difference is between these estimates of concurvity. Hopefully someone with a greater understanding of GAMs and mgcv can chip in too! I for one am looking for an answer to the latter issue.
When using GAMs, how much concurvity is too much?
I realise this is a very late response, but in case anyone else is looking for an answer on this too: Noam Ross' free course on GAMs advises 0.80 for the "worst concurvity" measure (as opposed to esti
When using GAMs, how much concurvity is too much? I realise this is a very late response, but in case anyone else is looking for an answer on this too: Noam Ross' free course on GAMs advises 0.80 for the "worst concurvity" measure (as opposed to estimate and observed concurvity). The course does not provide a justification for this "threshold" though nor an explanation on why to look at worst concurvity rather than estimate or observed concurvity, or what the difference is between these estimates of concurvity. Hopefully someone with a greater understanding of GAMs and mgcv can chip in too! I for one am looking for an answer to the latter issue.
When using GAMs, how much concurvity is too much? I realise this is a very late response, but in case anyone else is looking for an answer on this too: Noam Ross' free course on GAMs advises 0.80 for the "worst concurvity" measure (as opposed to esti
33,069
Is the Berry-Esseen theorem useful for justifying normality?
No. Different confidence interval procedures have difference sensitivities to normality, and various requirements of the work can influence how much deviation from the theoretical coverage is acceptable.$^{\dagger}$ For instance, while confidence intervals for the mean that are based on the t-test are known for their robustness to deviations from normality, confidence intervals for variance that are based on the F-test are known for their lack of robustness to such deviations. $^{\dagger}$Is $94.5\%$ coverage good enough for a $95\%$ confidence interval? Under most circumstances, I would say so, but perhaps you have an application where that is inadequate.
Is the Berry-Esseen theorem useful for justifying normality?
No. Different confidence interval procedures have difference sensitivities to normality, and various requirements of the work can influence how much deviation from the theoretical coverage is acceptab
Is the Berry-Esseen theorem useful for justifying normality? No. Different confidence interval procedures have difference sensitivities to normality, and various requirements of the work can influence how much deviation from the theoretical coverage is acceptable.$^{\dagger}$ For instance, while confidence intervals for the mean that are based on the t-test are known for their robustness to deviations from normality, confidence intervals for variance that are based on the F-test are known for their lack of robustness to such deviations. $^{\dagger}$Is $94.5\%$ coverage good enough for a $95\%$ confidence interval? Under most circumstances, I would say so, but perhaps you have an application where that is inadequate.
Is the Berry-Esseen theorem useful for justifying normality? No. Different confidence interval procedures have difference sensitivities to normality, and various requirements of the work can influence how much deviation from the theoretical coverage is acceptab
33,070
Why maximizing the lower bound of variational evidence maximizes the probability of observing data
The maximization of model evidence (observation) and the approximation of a posterior distribution is achieved via the Expectation Maximization algorithm (specifically the maximization-maximization variant). This algorithm, then, has two steps: Given that the posterior distribution is defined by $\theta$, Compute a distribution $q$ over the range of $z$ such that $q^{(t)}(z) = argmin_{q}KL(q(z)||p(z|X; \theta^{(t-1)}))$ by maximising $ELBO$ w.r.t $q(z)$, while keeping $\theta$ fixed. For the sake of the theory behind this let's assume this ends up with $q = p$ This step is the the approximation of the posterior, which can be done in a variety of ways depending on the problem case and the distribution family of $q$. In this step, as you mentioned, $log(p(X;\theta^{(t-1)}))$ remains constant as it does not depend on $q$ and the KL-divergence linearly decreases as ELBO increases. Now given that $q^{(t)}(z) = argmin_{q}KL(q(z)||p(z|X; \theta^{(t-1)}))$ maximize $ELBO$ w.r.t $\theta$, while keeping $q(z)$ fixed. In this step, the KL-divergence potentially increases as ELBO increases, as $KL(q(z)||p(z|X; \theta^{(t)})) \geq KL(q(z)||p(z|X; \theta^{(t-1)}))$. Since $KL(q(z)||p(z|X; \theta)) = -ELBO + log(p(X;\theta))$, the only way this relationship holds is if $log(p(X;\theta))$ increases at least linearly as $ELBO$ increases w.r.t $\theta$ Once a maxima of $log(p(X;\theta))$ has been found, repeat step 1 to compute the best posterior approximation.
Why maximizing the lower bound of variational evidence maximizes the probability of observing data
The maximization of model evidence (observation) and the approximation of a posterior distribution is achieved via the Expectation Maximization algorithm (specifically the maximization-maximization va
Why maximizing the lower bound of variational evidence maximizes the probability of observing data The maximization of model evidence (observation) and the approximation of a posterior distribution is achieved via the Expectation Maximization algorithm (specifically the maximization-maximization variant). This algorithm, then, has two steps: Given that the posterior distribution is defined by $\theta$, Compute a distribution $q$ over the range of $z$ such that $q^{(t)}(z) = argmin_{q}KL(q(z)||p(z|X; \theta^{(t-1)}))$ by maximising $ELBO$ w.r.t $q(z)$, while keeping $\theta$ fixed. For the sake of the theory behind this let's assume this ends up with $q = p$ This step is the the approximation of the posterior, which can be done in a variety of ways depending on the problem case and the distribution family of $q$. In this step, as you mentioned, $log(p(X;\theta^{(t-1)}))$ remains constant as it does not depend on $q$ and the KL-divergence linearly decreases as ELBO increases. Now given that $q^{(t)}(z) = argmin_{q}KL(q(z)||p(z|X; \theta^{(t-1)}))$ maximize $ELBO$ w.r.t $\theta$, while keeping $q(z)$ fixed. In this step, the KL-divergence potentially increases as ELBO increases, as $KL(q(z)||p(z|X; \theta^{(t)})) \geq KL(q(z)||p(z|X; \theta^{(t-1)}))$. Since $KL(q(z)||p(z|X; \theta)) = -ELBO + log(p(X;\theta))$, the only way this relationship holds is if $log(p(X;\theta))$ increases at least linearly as $ELBO$ increases w.r.t $\theta$ Once a maxima of $log(p(X;\theta))$ has been found, repeat step 1 to compute the best posterior approximation.
Why maximizing the lower bound of variational evidence maximizes the probability of observing data The maximization of model evidence (observation) and the approximation of a posterior distribution is achieved via the Expectation Maximization algorithm (specifically the maximization-maximization va
33,071
Question on Inference - Catching Cheating Students
While it is tempting to think, that such pair relations are somehow autocorrelated, and this causes inference problems, the straightforward answer would be, that this is not a problem here. Rationale behind it is close to typical clustering problem. Clustering do not disrupt significance of variables that vary at unit level, it makes too significant variables, that vary only at cluster level. If we introduced a student-level, not pair-level variable, it should be significant too often. As this is potential autocorrelation problem, the value in question would be p-value of the estimator for the parameter of interest: $\beta_1$. We worry about potential wrong number of False Positives. In order to check false positive rate, I propose Monte Carlo simulation, with given assumptions: Students do not cheat. We check False Positive rate, then there is no need for introduction of cheating mechanism. n (250) students sit in one row, every student has two neighbours (first and last - one). Students have a test of k (20) answers each with a (2) possibilities. Answers are random with equal probabilities. Students are matched in pairs and if they sit next to each other, they are marked as neighbours. The number of similar answers for each pair is calculated. Then the Monte Carlo simulation takes place (unit: a pair): Regression $similar\_answers_i = \beta_0 + \beta_1 neighbours_i + \varepsilon_i$ is evaluated. P-value of $b_1$ estimator is saved. Process is repeated N (10000) times. Shares, how many times p-value was smaller than 0.5, 0.2, 0.1, 0.05 are presented: p < 0.50: 0.5227 p < 0.20: 0.2166 p < 0.10: 0.1147 p < 0.05: 0.0511 The shares are not that different for 10000 Monte Carlo simulation. It looks as fair enough argument, that the False Positive rate is not disrupt. Replication code (python): import pandas as pd import random import numpy as np from multiprocessing import Pool # number of students: n = 250 # number of possible answers and length of the test: a = 2 k = 20 # number of monte carlo sims: N = 10000 # number of processors: cpu = 2 def get_pvals(iter = 0): print(iter) answers = [] for i in range(n): answers.append(np.random.choice(range(a),k)) pairs = [] for i1 in range(n): for i2 in range(i1+1, n): neigh = 0 sim_ans = sum(answers[i1] == answers[i2]) if i1 != i2: if i1 == i2-1: neigh = 1 if i2 == i1-1: neigh = 1 pairs.append({"sim_ans":sim_ans, "neigh":neigh}) d = pd.DataFrame(rows) import statsmodels.formula.api as sm result = sm.ols(formula = "sim_ans ~ neigh", data = d).fit() p = result.pvalues['neigh'] return p pvals = [] if __name__ == '__main__': with Pool(cpu) as p: pvals = p.map(get_pvals, range(N)) print(pvals) print(sum(np.array(pvals) < 0.5)/N) print(sum(np.array(pvals) < 0.2)/N) print(sum(np.array(pvals) < 0.1)/N) print(sum(np.array(pvals) < 0.05)/N)
Question on Inference - Catching Cheating Students
While it is tempting to think, that such pair relations are somehow autocorrelated, and this causes inference problems, the straightforward answer would be, that this is not a problem here. Rationale
Question on Inference - Catching Cheating Students While it is tempting to think, that such pair relations are somehow autocorrelated, and this causes inference problems, the straightforward answer would be, that this is not a problem here. Rationale behind it is close to typical clustering problem. Clustering do not disrupt significance of variables that vary at unit level, it makes too significant variables, that vary only at cluster level. If we introduced a student-level, not pair-level variable, it should be significant too often. As this is potential autocorrelation problem, the value in question would be p-value of the estimator for the parameter of interest: $\beta_1$. We worry about potential wrong number of False Positives. In order to check false positive rate, I propose Monte Carlo simulation, with given assumptions: Students do not cheat. We check False Positive rate, then there is no need for introduction of cheating mechanism. n (250) students sit in one row, every student has two neighbours (first and last - one). Students have a test of k (20) answers each with a (2) possibilities. Answers are random with equal probabilities. Students are matched in pairs and if they sit next to each other, they are marked as neighbours. The number of similar answers for each pair is calculated. Then the Monte Carlo simulation takes place (unit: a pair): Regression $similar\_answers_i = \beta_0 + \beta_1 neighbours_i + \varepsilon_i$ is evaluated. P-value of $b_1$ estimator is saved. Process is repeated N (10000) times. Shares, how many times p-value was smaller than 0.5, 0.2, 0.1, 0.05 are presented: p < 0.50: 0.5227 p < 0.20: 0.2166 p < 0.10: 0.1147 p < 0.05: 0.0511 The shares are not that different for 10000 Monte Carlo simulation. It looks as fair enough argument, that the False Positive rate is not disrupt. Replication code (python): import pandas as pd import random import numpy as np from multiprocessing import Pool # number of students: n = 250 # number of possible answers and length of the test: a = 2 k = 20 # number of monte carlo sims: N = 10000 # number of processors: cpu = 2 def get_pvals(iter = 0): print(iter) answers = [] for i in range(n): answers.append(np.random.choice(range(a),k)) pairs = [] for i1 in range(n): for i2 in range(i1+1, n): neigh = 0 sim_ans = sum(answers[i1] == answers[i2]) if i1 != i2: if i1 == i2-1: neigh = 1 if i2 == i1-1: neigh = 1 pairs.append({"sim_ans":sim_ans, "neigh":neigh}) d = pd.DataFrame(rows) import statsmodels.formula.api as sm result = sm.ols(formula = "sim_ans ~ neigh", data = d).fit() p = result.pvalues['neigh'] return p pvals = [] if __name__ == '__main__': with Pool(cpu) as p: pvals = p.map(get_pvals, range(N)) print(pvals) print(sum(np.array(pvals) < 0.5)/N) print(sum(np.array(pvals) < 0.2)/N) print(sum(np.array(pvals) < 0.1)/N) print(sum(np.array(pvals) < 0.05)/N)
Question on Inference - Catching Cheating Students While it is tempting to think, that such pair relations are somehow autocorrelated, and this causes inference problems, the straightforward answer would be, that this is not a problem here. Rationale
33,072
Why in latin squares the rows, treatments and columns are said to be orthogonal
what it means, or, what the latin square does The orthogonality of columns $i$ and rows $j$ means that their effect is being removed from the expectation values for some treatment $k$ (A,B,C,D). See the formula (for a model without cross effects) $Y_{ijk} = \alpha + c_i + r_j + \beta_k + \epsilon_{ijk}$ whose expectation for a certain level of $k$ (A, B, C or D) becomes the following $E(Y_{ijk} \vert k) = \alpha + \beta_k$ provided that the treatment does not correlate (is orthogonal to) with the rows and columns. the treatment for A (and similarly for B, C and D) is tested the same number of times in each row and so you can eliminate (average out) the effect of the row on the expectation value of the treatment A. orthogonality I am not sure if this is the origin of the etymology but this is what I imagine with orthogonality In the example you have the following tests (column, row, treatment): 1,1,A 1,2,B 1,3,C 1,4,D 2,1,B 2,2,C 2,3,D 2,4,A 3,1,C 3,2,D 3,3,B 3,4,A 4,1,D 4,2,A 4,3,B 4,4,C if you take this as a matrix $M$ and calculate $M^TM$ then you obtain in the non-diagonal elements a sum of products in which each term occurs the same number of times. for example the product of the first and third column $(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) \cdot (A,B,C,D,B,C,D,A,C,D,A,B,D,A,B,C) = (1+2+3+4)(A+B+C+D) = 16 \mu_i \mu_j $ and this property may be associated with orthogonality of columns in a matrix
Why in latin squares the rows, treatments and columns are said to be orthogonal
what it means, or, what the latin square does The orthogonality of columns $i$ and rows $j$ means that their effect is being removed from the expectation values for some treatment $k$ (A,B,C,D). See t
Why in latin squares the rows, treatments and columns are said to be orthogonal what it means, or, what the latin square does The orthogonality of columns $i$ and rows $j$ means that their effect is being removed from the expectation values for some treatment $k$ (A,B,C,D). See the formula (for a model without cross effects) $Y_{ijk} = \alpha + c_i + r_j + \beta_k + \epsilon_{ijk}$ whose expectation for a certain level of $k$ (A, B, C or D) becomes the following $E(Y_{ijk} \vert k) = \alpha + \beta_k$ provided that the treatment does not correlate (is orthogonal to) with the rows and columns. the treatment for A (and similarly for B, C and D) is tested the same number of times in each row and so you can eliminate (average out) the effect of the row on the expectation value of the treatment A. orthogonality I am not sure if this is the origin of the etymology but this is what I imagine with orthogonality In the example you have the following tests (column, row, treatment): 1,1,A 1,2,B 1,3,C 1,4,D 2,1,B 2,2,C 2,3,D 2,4,A 3,1,C 3,2,D 3,3,B 3,4,A 4,1,D 4,2,A 4,3,B 4,4,C if you take this as a matrix $M$ and calculate $M^TM$ then you obtain in the non-diagonal elements a sum of products in which each term occurs the same number of times. for example the product of the first and third column $(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) \cdot (A,B,C,D,B,C,D,A,C,D,A,B,D,A,B,C) = (1+2+3+4)(A+B+C+D) = 16 \mu_i \mu_j $ and this property may be associated with orthogonality of columns in a matrix
Why in latin squares the rows, treatments and columns are said to be orthogonal what it means, or, what the latin square does The orthogonality of columns $i$ and rows $j$ means that their effect is being removed from the expectation values for some treatment $k$ (A,B,C,D). See t
33,073
What is the best way to estimate the average treatment effect in a longitudinal study?
Addressing your question "I wonder how to get the ATE out of model 2" in the comments: First of all, in your model 2, not all $\gamma_j$ is identifiable which leads to the problem of rank deficiency in design matrix. It is necessary to drop one level, for instance assuming $\gamma_j =0$ for $j=1$. That is, using the contrast coding and assume the treatment effect at period 1 is 0. In R, it will code the interaction term with treatment effect at period 1 as the reference level, and that is also the reason why $\tilde{\beta}$ has the interpretation of treatment effect at period 1. In SAS, it will code the treatment effect at period $m$ as the reference level, then $\tilde{\beta}$ has the interpretation of treatment effect at period $m$, not period 1 anymore. Assuming the contrast is created in the R way, then the coefficients estimated for each interaction term (I will still denote this by $\gamma_j$, though it is not precisely what you defined in your model) has the interpretation of treatment effect difference between time period $j$ and time period 1. Denote ATE at each period $\mathrm{ATE}_j$, then $\gamma_j= \mathrm{ATE}_j - \mathrm{ATE}_1$ for $j=2,\dots, m$. Therefore an estimator for $\mathrm{ATE}_j$ is $\tilde{\beta} + \gamma_j$. (ignoring the notation difference between true parameter and estimator itself because laziness) And naturally your $\mathrm{ATE}=\beta=\frac{1}{m} \sum_{j=1}^m \mathrm{ATE}_j=\frac{\tilde{\beta}+(\tilde{\beta}+\gamma_2)+\cdots+(\tilde{\beta}+\gamma_m)}{m} = \tilde{\beta}+\frac{1}{m}(\gamma_2 + \cdots + \gamma_m)$. I did a simple simulation in R to verify this: set.seed(1234) time <- 4 n <-2000 trt.period <- c(2,3,4,5) #ATE=3.5 kj <- c(1,2,3,4) intercept <- rep(rnorm(n, 1, 1), each=time) eij <- rnorm(n*time, 0, 1.5) trt <- rep(c(rep(0,n/2),rep(1,n/2)), each=time) y <- intercept + trt*(rep(trt.period, n))+rep(kj,n)+eij sim.data <- data.frame(id=rep(1:n, each=time), period=factor(rep(1:time, n)), y=y, trt=factor(trt)) library(lme4) fit.model1 <- lmer(y~trt+(1|id), data=sim.data) beta <- getME(fit.model1, "fixef")["trt1"] fit.model2 <- lmer(y~trt*period + (1|id), data=sim.data) beta_t <- getME(fit.model2, "fixef")["trt1"] gamma_j <- getME(fit.model2, "fixef")[c("trt1:period2","trt1:period3","trt1:period4")] results <-c(beta, beta_t+sum(gamma_j)/time) names(results)<-c("ATE.m1", "ATE.m2") print(results) And the results verifies this: ATE.m1 ATE.m2 3.549213 3.549213 I don't know how to directly change contrast coding in model 2 above, so to illustrate how one can directly use a linear function of the interaction terms, as well as how to obtain the standard error, I used the multcomp package: sim.data$tp <- interaction(sim.data$trt, sim.data$period) fit.model3 <- lmer(y~tp+ (1|id), data=sim.data) library(multcomp) # w= tp.1.1 + (tp.2.1-tp.2.0)+(tp.3.1-tp.3.0)+(tp.4.1-tp.4.0) # tp.x.y=interaction effect of period x and treatment y w <- matrix(c(0, 1,-1,1,-1,1,-1,1)/time,nrow=1) names(w)<- names(getME(fit.model3,"fixef")) xx <- glht(fit.model3, linfct=w) summary(xx) And here is the output: Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = y ~ tp + (1 | id), data = sim.data) Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) 1 == 0 3.54921 0.05589 63.51 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Adjusted p values reported -- single-step method) I think the standard error is obtained by $\sqrt{w \hat{V} w^T}$ with $w$ being the above linear combination form and $V$ the estimated variance-covariance matrix of the coefficients from model 3. Deviation coding Another way to make $\tilde{\beta}$ having directly the interpretation of $\mathrm{ATE}$ is to use deviation coding, so that later covariates represent $\mathrm{ATE}_j - \mathrm{ATE}$ comparison: sim.data$p2vsmean <- 0 sim.data$p3vsmean <- 0 sim.data$p4vsmean <- 0 sim.data$p2vsmean[sim.data$period==2 & sim.data$trt==1] <- 1 sim.data$p3vsmean[sim.data$period==3 & sim.data$trt==1] <- 1 sim.data$p4vsmean[sim.data$period==4 & sim.data$trt==1] <- 1 sim.data$p2vsmean[sim.data$period==1 & sim.data$trt==1] <- -1 sim.data$p3vsmean[sim.data$period==1 & sim.data$trt==1] <- -1 sim.data$p4vsmean[sim.data$period==1 & sim.data$trt==1] <- -1 fit.model4 <- lmer(y~trt+p2vsmean+p3vsmean+p4vsmean+ (1|id), data=sim.data) Output: Fixed effects: Estimate Std. Error t value (Intercept) 3.48308 0.03952 88.14 trt1 3.54921 0.05589 63.51 p2vsmean -1.14774 0.04720 -24.32 p3vsmean 1.11729 0.04720 23.67 p4vsmean 3.01025 0.04720 63.77
What is the best way to estimate the average treatment effect in a longitudinal study?
Addressing your question "I wonder how to get the ATE out of model 2" in the comments: First of all, in your model 2, not all $\gamma_j$ is identifiable which leads to the problem of rank deficiency i
What is the best way to estimate the average treatment effect in a longitudinal study? Addressing your question "I wonder how to get the ATE out of model 2" in the comments: First of all, in your model 2, not all $\gamma_j$ is identifiable which leads to the problem of rank deficiency in design matrix. It is necessary to drop one level, for instance assuming $\gamma_j =0$ for $j=1$. That is, using the contrast coding and assume the treatment effect at period 1 is 0. In R, it will code the interaction term with treatment effect at period 1 as the reference level, and that is also the reason why $\tilde{\beta}$ has the interpretation of treatment effect at period 1. In SAS, it will code the treatment effect at period $m$ as the reference level, then $\tilde{\beta}$ has the interpretation of treatment effect at period $m$, not period 1 anymore. Assuming the contrast is created in the R way, then the coefficients estimated for each interaction term (I will still denote this by $\gamma_j$, though it is not precisely what you defined in your model) has the interpretation of treatment effect difference between time period $j$ and time period 1. Denote ATE at each period $\mathrm{ATE}_j$, then $\gamma_j= \mathrm{ATE}_j - \mathrm{ATE}_1$ for $j=2,\dots, m$. Therefore an estimator for $\mathrm{ATE}_j$ is $\tilde{\beta} + \gamma_j$. (ignoring the notation difference between true parameter and estimator itself because laziness) And naturally your $\mathrm{ATE}=\beta=\frac{1}{m} \sum_{j=1}^m \mathrm{ATE}_j=\frac{\tilde{\beta}+(\tilde{\beta}+\gamma_2)+\cdots+(\tilde{\beta}+\gamma_m)}{m} = \tilde{\beta}+\frac{1}{m}(\gamma_2 + \cdots + \gamma_m)$. I did a simple simulation in R to verify this: set.seed(1234) time <- 4 n <-2000 trt.period <- c(2,3,4,5) #ATE=3.5 kj <- c(1,2,3,4) intercept <- rep(rnorm(n, 1, 1), each=time) eij <- rnorm(n*time, 0, 1.5) trt <- rep(c(rep(0,n/2),rep(1,n/2)), each=time) y <- intercept + trt*(rep(trt.period, n))+rep(kj,n)+eij sim.data <- data.frame(id=rep(1:n, each=time), period=factor(rep(1:time, n)), y=y, trt=factor(trt)) library(lme4) fit.model1 <- lmer(y~trt+(1|id), data=sim.data) beta <- getME(fit.model1, "fixef")["trt1"] fit.model2 <- lmer(y~trt*period + (1|id), data=sim.data) beta_t <- getME(fit.model2, "fixef")["trt1"] gamma_j <- getME(fit.model2, "fixef")[c("trt1:period2","trt1:period3","trt1:period4")] results <-c(beta, beta_t+sum(gamma_j)/time) names(results)<-c("ATE.m1", "ATE.m2") print(results) And the results verifies this: ATE.m1 ATE.m2 3.549213 3.549213 I don't know how to directly change contrast coding in model 2 above, so to illustrate how one can directly use a linear function of the interaction terms, as well as how to obtain the standard error, I used the multcomp package: sim.data$tp <- interaction(sim.data$trt, sim.data$period) fit.model3 <- lmer(y~tp+ (1|id), data=sim.data) library(multcomp) # w= tp.1.1 + (tp.2.1-tp.2.0)+(tp.3.1-tp.3.0)+(tp.4.1-tp.4.0) # tp.x.y=interaction effect of period x and treatment y w <- matrix(c(0, 1,-1,1,-1,1,-1,1)/time,nrow=1) names(w)<- names(getME(fit.model3,"fixef")) xx <- glht(fit.model3, linfct=w) summary(xx) And here is the output: Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = y ~ tp + (1 | id), data = sim.data) Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) 1 == 0 3.54921 0.05589 63.51 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Adjusted p values reported -- single-step method) I think the standard error is obtained by $\sqrt{w \hat{V} w^T}$ with $w$ being the above linear combination form and $V$ the estimated variance-covariance matrix of the coefficients from model 3. Deviation coding Another way to make $\tilde{\beta}$ having directly the interpretation of $\mathrm{ATE}$ is to use deviation coding, so that later covariates represent $\mathrm{ATE}_j - \mathrm{ATE}$ comparison: sim.data$p2vsmean <- 0 sim.data$p3vsmean <- 0 sim.data$p4vsmean <- 0 sim.data$p2vsmean[sim.data$period==2 & sim.data$trt==1] <- 1 sim.data$p3vsmean[sim.data$period==3 & sim.data$trt==1] <- 1 sim.data$p4vsmean[sim.data$period==4 & sim.data$trt==1] <- 1 sim.data$p2vsmean[sim.data$period==1 & sim.data$trt==1] <- -1 sim.data$p3vsmean[sim.data$period==1 & sim.data$trt==1] <- -1 sim.data$p4vsmean[sim.data$period==1 & sim.data$trt==1] <- -1 fit.model4 <- lmer(y~trt+p2vsmean+p3vsmean+p4vsmean+ (1|id), data=sim.data) Output: Fixed effects: Estimate Std. Error t value (Intercept) 3.48308 0.03952 88.14 trt1 3.54921 0.05589 63.51 p2vsmean -1.14774 0.04720 -24.32 p3vsmean 1.11729 0.04720 23.67 p4vsmean 3.01025 0.04720 63.77
What is the best way to estimate the average treatment effect in a longitudinal study? Addressing your question "I wonder how to get the ATE out of model 2" in the comments: First of all, in your model 2, not all $\gamma_j$ is identifiable which leads to the problem of rank deficiency i
33,074
What is the best way to estimate the average treatment effect in a longitudinal study?
For the first question, my understanding is that "fancy" ways are only needed when it's not immediately obvious that treatment is independent of potential outcomes. In these cases, you need to argue that some aspect of the data allows for an approximation of random assignment to treatment, which gets us to instrumental variables, regression discontinuity, and so forth. In your case, units are randomly assigned to treatment, so it seems believable that treatment is independent of potential outcomes. Then we can just keep things simple: estimate model 1 with ordinary least squares, and you have a consistent estimate of the ATE. Since units are randomly assigned to treatment, this is one of the few cases where a random-effects assumption is believable.
What is the best way to estimate the average treatment effect in a longitudinal study?
For the first question, my understanding is that "fancy" ways are only needed when it's not immediately obvious that treatment is independent of potential outcomes. In these cases, you need to argue t
What is the best way to estimate the average treatment effect in a longitudinal study? For the first question, my understanding is that "fancy" ways are only needed when it's not immediately obvious that treatment is independent of potential outcomes. In these cases, you need to argue that some aspect of the data allows for an approximation of random assignment to treatment, which gets us to instrumental variables, regression discontinuity, and so forth. In your case, units are randomly assigned to treatment, so it seems believable that treatment is independent of potential outcomes. Then we can just keep things simple: estimate model 1 with ordinary least squares, and you have a consistent estimate of the ATE. Since units are randomly assigned to treatment, this is one of the few cases where a random-effects assumption is believable.
What is the best way to estimate the average treatment effect in a longitudinal study? For the first question, my understanding is that "fancy" ways are only needed when it's not immediately obvious that treatment is independent of potential outcomes. In these cases, you need to argue t
33,075
Expected value of ratio of correlated random variables?
I thought of one lower bound, though I don't think it's very tight. I just pick an arbitrary value less than the mean of $\alpha$ and another arbitrary value around the mean of $\beta^2$. Since the expectation is of a non-negative random variable, and because $\alpha$ and $\beta$ are independent, $$\mathbb E \left[ \frac{\alpha}{\sqrt{\alpha^2 + \beta^2}} \right] \ge \frac{1}{\sqrt{2}}\mathbb P\left(\alpha \ge \frac{1}{2}\right) \mathbb P\left(\beta^2 \le\frac{1}{4}\right). $$ By Chebyshev's inequality, $$\mathbb P\left(\alpha \ge \frac{1}{2}\right) = \mathbb P\left(\alpha - 1 \ge -\frac{1}{2}\right) \ge \mathbb P\left(|\alpha - 1| \le \frac{1}{2}\right) = 1 - \mathbb P\left(|\alpha - 1| \ge \frac{1}{2}\right) \ge 1 - 4\mathrm{var}(\alpha) $$ By Markov's inequality, $$\mathbb P\left(\beta^2 \le\frac{1}{4}\right) = 1 - \mathbb P\left(\beta^2 \ge\frac{1}{4}\right) \ge 1 - 4 \mathbb E[\beta^2] = 1 - 4\mathrm{var}(\beta) $$ Therefore, $$\mathbb E \left[ \frac{\alpha}{\sqrt{\alpha^2 + \beta^2}} \right] \ge \frac{1}{\sqrt{2}} (1 - 4 \times 0.3^2) (1 - 4 \times 0.3^2) > 0.28 $$ Is a more standard/systematic way to do what I'm doing here, that gets a tighter bound?
Expected value of ratio of correlated random variables?
I thought of one lower bound, though I don't think it's very tight. I just pick an arbitrary value less than the mean of $\alpha$ and another arbitrary value around the mean of $\beta^2$. Since the ex
Expected value of ratio of correlated random variables? I thought of one lower bound, though I don't think it's very tight. I just pick an arbitrary value less than the mean of $\alpha$ and another arbitrary value around the mean of $\beta^2$. Since the expectation is of a non-negative random variable, and because $\alpha$ and $\beta$ are independent, $$\mathbb E \left[ \frac{\alpha}{\sqrt{\alpha^2 + \beta^2}} \right] \ge \frac{1}{\sqrt{2}}\mathbb P\left(\alpha \ge \frac{1}{2}\right) \mathbb P\left(\beta^2 \le\frac{1}{4}\right). $$ By Chebyshev's inequality, $$\mathbb P\left(\alpha \ge \frac{1}{2}\right) = \mathbb P\left(\alpha - 1 \ge -\frac{1}{2}\right) \ge \mathbb P\left(|\alpha - 1| \le \frac{1}{2}\right) = 1 - \mathbb P\left(|\alpha - 1| \ge \frac{1}{2}\right) \ge 1 - 4\mathrm{var}(\alpha) $$ By Markov's inequality, $$\mathbb P\left(\beta^2 \le\frac{1}{4}\right) = 1 - \mathbb P\left(\beta^2 \ge\frac{1}{4}\right) \ge 1 - 4 \mathbb E[\beta^2] = 1 - 4\mathrm{var}(\beta) $$ Therefore, $$\mathbb E \left[ \frac{\alpha}{\sqrt{\alpha^2 + \beta^2}} \right] \ge \frac{1}{\sqrt{2}} (1 - 4 \times 0.3^2) (1 - 4 \times 0.3^2) > 0.28 $$ Is a more standard/systematic way to do what I'm doing here, that gets a tighter bound?
Expected value of ratio of correlated random variables? I thought of one lower bound, though I don't think it's very tight. I just pick an arbitrary value less than the mean of $\alpha$ and another arbitrary value around the mean of $\beta^2$. Since the ex
33,076
Nonlinear Dimensionality Reduction: geometric/topologic algorithms vs. autoencoders
Before I attempt to answer your question I want to create a stronger separation between the methods you are referring to. The first set of methods I believe you are referring to are neighborhood based dimensionality reduction methods, where a neighborhood graph is constructed where the edges represent a distance metric. Now to play devil's advocate against myself, MDS/ISOMAP can both be interpreted as a form of kernel PCA. So although this distinction seems relatively sharp, various interpretation shift these methods from one class to another. The second set of methods you are referring to I would place in the field of unsupervised neural network learning. Autoencoders are a special architecture that attempts to map an input space into a lower-dimensional space that allows decoding back to the input space with minimal loss in information. First, let's talk about benefits and drawbacks of autoencoders. Autoencoders are generally trained using some variant of stochastic gradient descent which yields some advantages. The dataset does not have to fit into memory, and can dynamically be loaded up and trained with gradient descent. Unlike a lot of methods in neighborhood-based learning which forces the dataset to exist in memory. The architecture of the autoencoders allows prior knowledge of the data to be incorporated into the model. For example, if are dataset contains images we can create an architecture that utilizes 2d convolution. If the dataset contains time-series that have long term connections, we can use gated recurrent networks (check out Seq2Seq learning). This is the power of neural networks in general. It allows us to encode prior knowledge about the problem into our models. This is something that other models, and to be more specific, dimensionality reduction algorithms cannot do. From a theoretical perspective, there are a couple nice theorems. The deeper the network, the complexity of functions that are learnable by the network increases exponentially. In general, at least before something new is discovered, you are not going to find a more expressive/powerful model than a correctly selected neural network. Now although all this sounds great, there are drawbacks. Convergence of neural networks is non-deterministic and depends heavily on the architecture used, the complexity of the problem, choice of hyper-parameters, etc. The expressiveness of neural networks causes problems too, they tend to overfit very quickly if the right regularization is not chosen/used. On the other hand, neighborhood methods are less expressive and tend to run a deterministic amount of time until convergence based on much fewer parameters than neural networks. The choice of method depends directly on the problem. If you have a small dataset that fits in memory and does not utilize any type of structured data (images, videos, audio) classical dimensionality reduction would probably be the way to go. But as structure is introduced, the complexity of your problem increases, and the amount of data you have grows neural networks become the correct choice. Hope this helps.
Nonlinear Dimensionality Reduction: geometric/topologic algorithms vs. autoencoders
Before I attempt to answer your question I want to create a stronger separation between the methods you are referring to. The first set of methods I believe you are referring to are neighborhood based
Nonlinear Dimensionality Reduction: geometric/topologic algorithms vs. autoencoders Before I attempt to answer your question I want to create a stronger separation between the methods you are referring to. The first set of methods I believe you are referring to are neighborhood based dimensionality reduction methods, where a neighborhood graph is constructed where the edges represent a distance metric. Now to play devil's advocate against myself, MDS/ISOMAP can both be interpreted as a form of kernel PCA. So although this distinction seems relatively sharp, various interpretation shift these methods from one class to another. The second set of methods you are referring to I would place in the field of unsupervised neural network learning. Autoencoders are a special architecture that attempts to map an input space into a lower-dimensional space that allows decoding back to the input space with minimal loss in information. First, let's talk about benefits and drawbacks of autoencoders. Autoencoders are generally trained using some variant of stochastic gradient descent which yields some advantages. The dataset does not have to fit into memory, and can dynamically be loaded up and trained with gradient descent. Unlike a lot of methods in neighborhood-based learning which forces the dataset to exist in memory. The architecture of the autoencoders allows prior knowledge of the data to be incorporated into the model. For example, if are dataset contains images we can create an architecture that utilizes 2d convolution. If the dataset contains time-series that have long term connections, we can use gated recurrent networks (check out Seq2Seq learning). This is the power of neural networks in general. It allows us to encode prior knowledge about the problem into our models. This is something that other models, and to be more specific, dimensionality reduction algorithms cannot do. From a theoretical perspective, there are a couple nice theorems. The deeper the network, the complexity of functions that are learnable by the network increases exponentially. In general, at least before something new is discovered, you are not going to find a more expressive/powerful model than a correctly selected neural network. Now although all this sounds great, there are drawbacks. Convergence of neural networks is non-deterministic and depends heavily on the architecture used, the complexity of the problem, choice of hyper-parameters, etc. The expressiveness of neural networks causes problems too, they tend to overfit very quickly if the right regularization is not chosen/used. On the other hand, neighborhood methods are less expressive and tend to run a deterministic amount of time until convergence based on much fewer parameters than neural networks. The choice of method depends directly on the problem. If you have a small dataset that fits in memory and does not utilize any type of structured data (images, videos, audio) classical dimensionality reduction would probably be the way to go. But as structure is introduced, the complexity of your problem increases, and the amount of data you have grows neural networks become the correct choice. Hope this helps.
Nonlinear Dimensionality Reduction: geometric/topologic algorithms vs. autoencoders Before I attempt to answer your question I want to create a stronger separation between the methods you are referring to. The first set of methods I believe you are referring to are neighborhood based
33,077
How to determine weights for WLS regression in R?
There are two issues here You would, ideally, use weights inversely proportional to the variance of the individual $Y_i$. So says the Gauss-Markov Theorem. You don't know the variance of the individual $Y_i$ If you have deterministic weights $w_i$, you are in the situation that WLS/GLS are designed for. One traditional example is when each observation is an average of multiple measurements, and $w_i$ the number of measurements. If you have weights that depend on the data through a small number of parameters, you can treat them as fixed and use them in WLS/GLS even though they aren't fixed. For example, you could estimate $\sigma^2(\mu)$ as a function of the fitted $\mu$ and use $w_i=1/\sigma^2(\mu_i)$ -- this seems to be what you are doing in the first example. This is also what happens in linear mixed models, where the weights for the fixed-effects part of the model depend on the variance components, which are estimated from the data. In this scenario it is possible to prove that although there is some randomness in the weights, it does not affect the large-sample distribution of the resulting $\hat\beta$. It's ok to treat the $w_i$ as if they were known in advance. If you have weights that are not nearly deterministic, the whole thing breaks down and the randomness in the weights becomes important for both bias and variance. That's what happens in your second example, when you use $w_i=1/r_i^2$. It's an obvious thing to think of, but it doesn't work. The estimating equations (normal equations, score equations) for $\hat\beta$ are $$\sum_i x_iw_i(y_i-x_i\beta)=0$$ With that choice of weights, you get $$\sum_i x_i\frac{(y_i-x_i\beta)}{(y_i-x_i\hat\beta^*)^2}=0$$ where $\hat\beta^*$ is the unweighted estimate. If the new estimate is close to the old one (which should be true for large data sets, because both are consistent), you'd end up with equations like $$\sum_i x_i\frac{1}{(y_i-x_i\beta)}=0$$ which divides by a variable with mean zero, a bad sign. So: It's ok to estimate the weights if you have a good mean model (so that the squared residuals are approximately unbiased for the variance) and as long as you don't overfit them. If you do overfit them, you will get a bad estimate of $\beta$ and inaccurate standard errors.
How to determine weights for WLS regression in R?
There are two issues here You would, ideally, use weights inversely proportional to the variance of the individual $Y_i$. So says the Gauss-Markov Theorem. You don't know the variance of the individ
How to determine weights for WLS regression in R? There are two issues here You would, ideally, use weights inversely proportional to the variance of the individual $Y_i$. So says the Gauss-Markov Theorem. You don't know the variance of the individual $Y_i$ If you have deterministic weights $w_i$, you are in the situation that WLS/GLS are designed for. One traditional example is when each observation is an average of multiple measurements, and $w_i$ the number of measurements. If you have weights that depend on the data through a small number of parameters, you can treat them as fixed and use them in WLS/GLS even though they aren't fixed. For example, you could estimate $\sigma^2(\mu)$ as a function of the fitted $\mu$ and use $w_i=1/\sigma^2(\mu_i)$ -- this seems to be what you are doing in the first example. This is also what happens in linear mixed models, where the weights for the fixed-effects part of the model depend on the variance components, which are estimated from the data. In this scenario it is possible to prove that although there is some randomness in the weights, it does not affect the large-sample distribution of the resulting $\hat\beta$. It's ok to treat the $w_i$ as if they were known in advance. If you have weights that are not nearly deterministic, the whole thing breaks down and the randomness in the weights becomes important for both bias and variance. That's what happens in your second example, when you use $w_i=1/r_i^2$. It's an obvious thing to think of, but it doesn't work. The estimating equations (normal equations, score equations) for $\hat\beta$ are $$\sum_i x_iw_i(y_i-x_i\beta)=0$$ With that choice of weights, you get $$\sum_i x_i\frac{(y_i-x_i\beta)}{(y_i-x_i\hat\beta^*)^2}=0$$ where $\hat\beta^*$ is the unweighted estimate. If the new estimate is close to the old one (which should be true for large data sets, because both are consistent), you'd end up with equations like $$\sum_i x_i\frac{1}{(y_i-x_i\beta)}=0$$ which divides by a variable with mean zero, a bad sign. So: It's ok to estimate the weights if you have a good mean model (so that the squared residuals are approximately unbiased for the variance) and as long as you don't overfit them. If you do overfit them, you will get a bad estimate of $\beta$ and inaccurate standard errors.
How to determine weights for WLS regression in R? There are two issues here You would, ideally, use weights inversely proportional to the variance of the individual $Y_i$. So says the Gauss-Markov Theorem. You don't know the variance of the individ
33,078
How to determine weights for WLS regression in R?
Why are you using FLGS? Have you got heteroscedasticity and correlation between the residuals? And is the matrix var-cov matrix unknown? Try bptest(your_model) and if the p-value is less the alpha (e.g., 0.05) there is heteroscedasticity. And then you should try to understand if there is correlation between the residuals with a Durbin Watson test: dwtest(your_model), if the statistic W is between 1 and 3, then there isn't correlation. So if you have only heteroscedasticity you should use WLS, like this: mod_lin <- lm(Price~Weight+HP+Disp., data=df) wts <- 1/fitted( lm(abs(residuals(mod_lin))~fitted(mod_lin)) )^2 mod2 <- lm(Price~Weight+HP+Disp., data=df, weights=wts) So mod2 is with the old model, now with WLS. R-square = 1, it's too weird. Maybe there is collinearity.
How to determine weights for WLS regression in R?
Why are you using FLGS? Have you got heteroscedasticity and correlation between the residuals? And is the matrix var-cov matrix unknown? Try bptest(your_model) and if the p-value is less the alpha (e.
How to determine weights for WLS regression in R? Why are you using FLGS? Have you got heteroscedasticity and correlation between the residuals? And is the matrix var-cov matrix unknown? Try bptest(your_model) and if the p-value is less the alpha (e.g., 0.05) there is heteroscedasticity. And then you should try to understand if there is correlation between the residuals with a Durbin Watson test: dwtest(your_model), if the statistic W is between 1 and 3, then there isn't correlation. So if you have only heteroscedasticity you should use WLS, like this: mod_lin <- lm(Price~Weight+HP+Disp., data=df) wts <- 1/fitted( lm(abs(residuals(mod_lin))~fitted(mod_lin)) )^2 mod2 <- lm(Price~Weight+HP+Disp., data=df, weights=wts) So mod2 is with the old model, now with WLS. R-square = 1, it's too weird. Maybe there is collinearity.
How to determine weights for WLS regression in R? Why are you using FLGS? Have you got heteroscedasticity and correlation between the residuals? And is the matrix var-cov matrix unknown? Try bptest(your_model) and if the p-value is less the alpha (e.
33,079
Variance/standard deviation versus interquartile range (IQR)
The main use of variance is in inferential statistics. So, variance and standard deviation are integral to understanding z-scores, t-scores and F-tests. This means that when your data are normally distributed, the standard deviation is going to have specific properties and interpretations. When your data are not normal (skewed, multi-modal, fat-tailed,...), the standard deviation cannot be used for classicial inference like confidence intervals, prediction intervals, t-tests, etc., and cannot be interpreted as a distance from the mean. You can say things like "any observation that's 1.96 standard deviations away from the mean is in the 97.5th percentile." if your data are normally distributed.
Variance/standard deviation versus interquartile range (IQR)
The main use of variance is in inferential statistics. So, variance and standard deviation are integral to understanding z-scores, t-scores and F-tests. This means that when your data are normally dis
Variance/standard deviation versus interquartile range (IQR) The main use of variance is in inferential statistics. So, variance and standard deviation are integral to understanding z-scores, t-scores and F-tests. This means that when your data are normally distributed, the standard deviation is going to have specific properties and interpretations. When your data are not normal (skewed, multi-modal, fat-tailed,...), the standard deviation cannot be used for classicial inference like confidence intervals, prediction intervals, t-tests, etc., and cannot be interpreted as a distance from the mean. You can say things like "any observation that's 1.96 standard deviations away from the mean is in the 97.5th percentile." if your data are normally distributed.
Variance/standard deviation versus interquartile range (IQR) The main use of variance is in inferential statistics. So, variance and standard deviation are integral to understanding z-scores, t-scores and F-tests. This means that when your data are normally dis
33,080
Variance/standard deviation versus interquartile range (IQR)
There are several advantages to using the standard deviation over the interquartile range: 1.) Efficiency: the interquartile range uses only two data points, while the standard deviation considers the entire distribution. If you are estimating population characteristics from a sample, one is going to be a more confident measure than the other*. 2.) Meaning: if you data is normally distributed, the mean and standard deviation tell you all of the characteristics of the distribution. The interquartile range doesn't really tell you anything about the distribution other than the interquartile range. 3.) If you are willing to sacrifice some accuracy for robustness, there are better measures like the mean absolute deviation and median absolute deviation, which are both decent robust estimators of variation for fat-tailed distributions. 4.) Better yet, if you distribution isn't normal you should find out what kind of distribution it is closest to and model that using the recommended robust estimators. *It's important here to point out the difference between accuracy and robustness. Standard deviation is never "inaccurate" per ce, if you have outliers than the sample standard deviation really is very high. "Outliers" usually means either data that you're not certain is legitimate in some sense or data that was generated from a non-normal population. TL;DR don't tell you're students that they are comparable measures, tell them that they measure different things and sometimes we care about one and sometimes we care about the other. Tell them to think about what they are using the information for and that will tell them what measures they should care about.
Variance/standard deviation versus interquartile range (IQR)
There are several advantages to using the standard deviation over the interquartile range: 1.) Efficiency: the interquartile range uses only two data points, while the standard deviation considers the
Variance/standard deviation versus interquartile range (IQR) There are several advantages to using the standard deviation over the interquartile range: 1.) Efficiency: the interquartile range uses only two data points, while the standard deviation considers the entire distribution. If you are estimating population characteristics from a sample, one is going to be a more confident measure than the other*. 2.) Meaning: if you data is normally distributed, the mean and standard deviation tell you all of the characteristics of the distribution. The interquartile range doesn't really tell you anything about the distribution other than the interquartile range. 3.) If you are willing to sacrifice some accuracy for robustness, there are better measures like the mean absolute deviation and median absolute deviation, which are both decent robust estimators of variation for fat-tailed distributions. 4.) Better yet, if you distribution isn't normal you should find out what kind of distribution it is closest to and model that using the recommended robust estimators. *It's important here to point out the difference between accuracy and robustness. Standard deviation is never "inaccurate" per ce, if you have outliers than the sample standard deviation really is very high. "Outliers" usually means either data that you're not certain is legitimate in some sense or data that was generated from a non-normal population. TL;DR don't tell you're students that they are comparable measures, tell them that they measure different things and sometimes we care about one and sometimes we care about the other. Tell them to think about what they are using the information for and that will tell them what measures they should care about.
Variance/standard deviation versus interquartile range (IQR) There are several advantages to using the standard deviation over the interquartile range: 1.) Efficiency: the interquartile range uses only two data points, while the standard deviation considers the
33,081
Variance/standard deviation versus interquartile range (IQR)
A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the values are spread out over a wider range1. The standard deviation and mean are often used for symmetric distributions, and for normally distributed variables about 70% of observations will be within one standard deviation of the mean and about 95% will be within two standard deviations(68–95–99.7 rule). For non-normally distributed variables it follows the three-sigma rule. As shown below we can find that the boxplot is weak in describing symmetric observations. Generated by this snippet of R code(borrowed from this answer): set.seed(1) normal <- rnorm(10000) a_vector <- c(-3, -2.65, rep((-2:2)*.674, 5), 2.65, 3) boxplot(normal, a_vector) We can see that the IQR is the same for the two populations 1 and 2 but we can see the difference of the two by their means and standard deviations. mean(normal); var(normal); mean(a_vector); var(a_vector) -0.00653703946166382 1.02486558733286 -3.0626842058625e-17 1.95567142857143 We can see from the above case that what median and IQR cannot reflect can be obviously conveyed by the mean and variance. References: 1. https://en.wikipedia.org/wiki/Standard_deviation
Variance/standard deviation versus interquartile range (IQR)
A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the values are spread out ov
Variance/standard deviation versus interquartile range (IQR) A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the values are spread out over a wider range1. The standard deviation and mean are often used for symmetric distributions, and for normally distributed variables about 70% of observations will be within one standard deviation of the mean and about 95% will be within two standard deviations(68–95–99.7 rule). For non-normally distributed variables it follows the three-sigma rule. As shown below we can find that the boxplot is weak in describing symmetric observations. Generated by this snippet of R code(borrowed from this answer): set.seed(1) normal <- rnorm(10000) a_vector <- c(-3, -2.65, rep((-2:2)*.674, 5), 2.65, 3) boxplot(normal, a_vector) We can see that the IQR is the same for the two populations 1 and 2 but we can see the difference of the two by their means and standard deviations. mean(normal); var(normal); mean(a_vector); var(a_vector) -0.00653703946166382 1.02486558733286 -3.0626842058625e-17 1.95567142857143 We can see from the above case that what median and IQR cannot reflect can be obviously conveyed by the mean and variance. References: 1. https://en.wikipedia.org/wiki/Standard_deviation
Variance/standard deviation versus interquartile range (IQR) A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the values are spread out ov
33,082
How do you verify test assumptions in real world cases, without testing them
What I have seen done most often (and would tend to do myself) is to look at several sets of historical data from the same area for the same variables and use that as a basis to decide what is appropriate. When doing that one of course should keep in mind that mild deviations from e.g. normality in the regression residuals are generally not too much of an issue given sufficiently large sample sizes in the planned application. By looking at independent data, one avoids the issue of messing up test properties like type I error control (which are very important in some areas like confirmatory clinical trial for regulatory purposes). The reason for (when appropriate) using parametric approaches is, as you say, efficiency, as well as the ability to easily adjust for predictive covariates like a pre-experiment assessment of your main variable and to get effect size estimates that are easier to interpret than, say, the Hedges-Lehmann estimate.
How do you verify test assumptions in real world cases, without testing them
What I have seen done most often (and would tend to do myself) is to look at several sets of historical data from the same area for the same variables and use that as a basis to decide what is appropr
How do you verify test assumptions in real world cases, without testing them What I have seen done most often (and would tend to do myself) is to look at several sets of historical data from the same area for the same variables and use that as a basis to decide what is appropriate. When doing that one of course should keep in mind that mild deviations from e.g. normality in the regression residuals are generally not too much of an issue given sufficiently large sample sizes in the planned application. By looking at independent data, one avoids the issue of messing up test properties like type I error control (which are very important in some areas like confirmatory clinical trial for regulatory purposes). The reason for (when appropriate) using parametric approaches is, as you say, efficiency, as well as the ability to easily adjust for predictive covariates like a pre-experiment assessment of your main variable and to get effect size estimates that are easier to interpret than, say, the Hedges-Lehmann estimate.
How do you verify test assumptions in real world cases, without testing them What I have seen done most often (and would tend to do myself) is to look at several sets of historical data from the same area for the same variables and use that as a basis to decide what is appropr
33,083
How do you verify test assumptions in real world cases, without testing them
Personally, I like to run a parametric test and its non-parametric equivalent, and test the assumptions of each all at once. If the assumptions of the parametric test aren't massively violated or if I get similar results with the non-parametric text, I will use the parametric test. Even if the parametric assumptions are violated, if you get significant results, you can be pretty confident in them because the test was weakened by the violation. Plus, let's be honest, it hard to make a meaningful interpretation of results like "group A had a mean rank score that was 12 higher than the mean rank score of group B."
How do you verify test assumptions in real world cases, without testing them
Personally, I like to run a parametric test and its non-parametric equivalent, and test the assumptions of each all at once. If the assumptions of the parametric test aren't massively violated or if I
How do you verify test assumptions in real world cases, without testing them Personally, I like to run a parametric test and its non-parametric equivalent, and test the assumptions of each all at once. If the assumptions of the parametric test aren't massively violated or if I get similar results with the non-parametric text, I will use the parametric test. Even if the parametric assumptions are violated, if you get significant results, you can be pretty confident in them because the test was weakened by the violation. Plus, let's be honest, it hard to make a meaningful interpretation of results like "group A had a mean rank score that was 12 higher than the mean rank score of group B."
How do you verify test assumptions in real world cases, without testing them Personally, I like to run a parametric test and its non-parametric equivalent, and test the assumptions of each all at once. If the assumptions of the parametric test aren't massively violated or if I
33,084
Modeling cricket bowlers getting batsmen out
$\DeclareMathOperator{\E}{\mathbb{E}}$ If I took the whole dataset and divided the total number of balls that got a batsman out by the total number of balls bowled I can see that I would have the average probability of a bowler getting a batsman out - it will be around 0.03 (hopefully I haven't gone wrong already?) Unfortunately, this is maybe already not exactly what you're looking for. Suppose we have a single bowler, and two batsmen: Don Bradman and me. (I know very very little about cricket, so if I'm doing something way off here, let me know.) The games go something like: Don goes to bat, and is out on the 99th bowl. I go to bat, and am immediately out. Don goes to bat, and is out on the 99th bowl. I go to bat, and am immediately out. In this case, there are four outs out of 200 bowls, so the marginal probability of a bowler getting a batsman out is estimated as 4/200 = 2%. But really, the Don's probability of being out is more like 1%, whereas mine is 100%. So if you choose a batsman and a bowler at random, the probability that this bowler gets this batsman out this time is more like (50% chance you picked Don) * (1% chance he gets out) + (50% chance you picked me) * (100% chance I get out) = 50.05%. But if you choose a pitch at random, then it's a 2% chance that it gets out. So you need to think carefully about which of those sampling models you're thinking of. Anyway, your proposal is not crazy. More symbolically, let $b$ be the bowler and $m$ the batsman; let $f(b, m)$ be the probability that $b$ gets $m$ out. Then you're saying: $$ f(b, m) = \frac{\E_{m'}[ f(b, m') ] \E_{b'}[ f(b', m) ]}{\E_{b', m'}[ f(b', m') ]} .$$ This does have the desired property that: $$ \E_{b,m}[f(b, m)] = \frac{\E_{b,m'}[ f(b, m') ] \E_{b',m}[ f(b', m) ]}{\E_{b',m'}[ f(b', m') ]} = \E_{b,m}[ f(b, m) ] ;$$ it's similarly consistent if you take means over only $b$ or $m$. Note that in this case we can assign \begin{gather} C := \E_{b, m}[f(b, m)] \\ g(b) := \E_{m}[f(b, m)] / \sqrt{C} \\ h(m) := \E_{b}[f(b, m)] / \sqrt{C} \\ \text{so that } f(b, m) = g(b) \, h(m) .\end{gather} Your assumption is that you can observe $g(b)$ and $h(m)$ reasonably well from the data. As long as (a) you have enough games [which you do] and (b) the players all play each other with reasonably similar frequencies, then this is fine. To elaborate on (b) a bit: imagine that you have data from a bunch of professional games, and a bunch of games of me playing with my friends. If there's no overlap, maybe I look really good compared to my friends, so maybe you think I'm much better than the worst professional player. This is obviously false, but you don't have any data to refute that. If you have a little overlap though, where I played against a professional player one time and got destroyed, then the data does support ranking me and my friends as all way worse than the pros, but your method wouldn't account for it. Technically, the problem here is that you're assuming you have a good sample for e.g. $\E_{b'}[f(b', m)]$, but your $b'$ distribution is biased. Of course your data won't look this bad, but depending on the league structure or whatever, it might have some elements of that problem. You can try working around it with a different approach. The proposed model for $f$ is actually an instance of low-rank matrix factorization models common in collaborative filtering, as in the Netflix problem. There, you choose the function $g(b)$ and $h(m)$ to be of dimension $r$, and represent $f(b, m) = g(b)^T h(m)$. You can interpret $r>1$ as complexifying your model from a single "quality" score to having scores along multiple dimensions: perhaps certain bowlers do better against certain types of batsmen. (This has been done e.g. for NBA games.) The reason they're called matrix factorization is because if you make a matrix $F$ with as many rows as bowlers and as many columns as batsmen, you can write this as $$ \underbrace{\begin{bmatrix} f(b_1, m_1) & f(b_1, m_2) & \dots & f(b_1, m_M) \\ f(b_2, m_1) & f(b_2, m_2) & \dots & f(b_2, m_M) \\ \vdots & \vdots & \ddots& \vdots \\ f(b_N, m_1) & f(b_N, m_2) & \dots & f(b_N, m_M) \end{bmatrix}}_{F} = \underbrace{\begin{bmatrix} g(b_1) \\ \vdots \\ g(b_N) \end{bmatrix}}_{G} \underbrace{\begin{bmatrix} h(m_1) \\ \vdots \\ h(m_M) \end{bmatrix}^T}_{H^T} $$ where you've factored an $N \times M$ matrix $F$ into an $N \times r$ one $G$ and an $M \times r$ one $H$. Of course, you don't get to observe $F$ directly. The usual model is that you get to observe noisy entries of $F$ at random; in your case, you get to observe a draw from a binomial distribution with a random number of trials for each entry of $F$. You could construct a probability model like, say: \begin{gather} G_{ik} \sim \mathcal{N}(0, \sigma_G^2) \\ H_{jk} \sim \mathcal{N}(0, \sigma_H^2) \\ F_{ij} = G_i^T H_j \\ R_{ij} \sim \mathcal{Binomial}(n_{ij}, F_{ij}) \end{gather} where the $n_{ij}$ and $R_{ij}$ are observed, and you'd probably put some hyperpriors over $\sigma_G$/$\sigma_H$ and do inference e.g. in Stan. This isn't a perfect model: for one, it ignores that $n$ is correlated to the scores (as I mentioned in the first section), and more importantly, it doesn't constrain $F_{ij}$ to be in $[0, 1]$ (you'd probably use a logistic sigmoid or similar to achieve that). A related article, with more complex priors for $G$ and $H$ (but that doesn't use the binomial likelihood) is: Salakhutdinov and Mnih, Bayesian probabilistic matrix factorization using Markov chain Monte Carlo, ICML 2008. (doi / author's pdf)
Modeling cricket bowlers getting batsmen out
$\DeclareMathOperator{\E}{\mathbb{E}}$ If I took the whole dataset and divided the total number of balls that got a batsman out by the total number of balls bowled I can see that I would have the ave
Modeling cricket bowlers getting batsmen out $\DeclareMathOperator{\E}{\mathbb{E}}$ If I took the whole dataset and divided the total number of balls that got a batsman out by the total number of balls bowled I can see that I would have the average probability of a bowler getting a batsman out - it will be around 0.03 (hopefully I haven't gone wrong already?) Unfortunately, this is maybe already not exactly what you're looking for. Suppose we have a single bowler, and two batsmen: Don Bradman and me. (I know very very little about cricket, so if I'm doing something way off here, let me know.) The games go something like: Don goes to bat, and is out on the 99th bowl. I go to bat, and am immediately out. Don goes to bat, and is out on the 99th bowl. I go to bat, and am immediately out. In this case, there are four outs out of 200 bowls, so the marginal probability of a bowler getting a batsman out is estimated as 4/200 = 2%. But really, the Don's probability of being out is more like 1%, whereas mine is 100%. So if you choose a batsman and a bowler at random, the probability that this bowler gets this batsman out this time is more like (50% chance you picked Don) * (1% chance he gets out) + (50% chance you picked me) * (100% chance I get out) = 50.05%. But if you choose a pitch at random, then it's a 2% chance that it gets out. So you need to think carefully about which of those sampling models you're thinking of. Anyway, your proposal is not crazy. More symbolically, let $b$ be the bowler and $m$ the batsman; let $f(b, m)$ be the probability that $b$ gets $m$ out. Then you're saying: $$ f(b, m) = \frac{\E_{m'}[ f(b, m') ] \E_{b'}[ f(b', m) ]}{\E_{b', m'}[ f(b', m') ]} .$$ This does have the desired property that: $$ \E_{b,m}[f(b, m)] = \frac{\E_{b,m'}[ f(b, m') ] \E_{b',m}[ f(b', m) ]}{\E_{b',m'}[ f(b', m') ]} = \E_{b,m}[ f(b, m) ] ;$$ it's similarly consistent if you take means over only $b$ or $m$. Note that in this case we can assign \begin{gather} C := \E_{b, m}[f(b, m)] \\ g(b) := \E_{m}[f(b, m)] / \sqrt{C} \\ h(m) := \E_{b}[f(b, m)] / \sqrt{C} \\ \text{so that } f(b, m) = g(b) \, h(m) .\end{gather} Your assumption is that you can observe $g(b)$ and $h(m)$ reasonably well from the data. As long as (a) you have enough games [which you do] and (b) the players all play each other with reasonably similar frequencies, then this is fine. To elaborate on (b) a bit: imagine that you have data from a bunch of professional games, and a bunch of games of me playing with my friends. If there's no overlap, maybe I look really good compared to my friends, so maybe you think I'm much better than the worst professional player. This is obviously false, but you don't have any data to refute that. If you have a little overlap though, where I played against a professional player one time and got destroyed, then the data does support ranking me and my friends as all way worse than the pros, but your method wouldn't account for it. Technically, the problem here is that you're assuming you have a good sample for e.g. $\E_{b'}[f(b', m)]$, but your $b'$ distribution is biased. Of course your data won't look this bad, but depending on the league structure or whatever, it might have some elements of that problem. You can try working around it with a different approach. The proposed model for $f$ is actually an instance of low-rank matrix factorization models common in collaborative filtering, as in the Netflix problem. There, you choose the function $g(b)$ and $h(m)$ to be of dimension $r$, and represent $f(b, m) = g(b)^T h(m)$. You can interpret $r>1$ as complexifying your model from a single "quality" score to having scores along multiple dimensions: perhaps certain bowlers do better against certain types of batsmen. (This has been done e.g. for NBA games.) The reason they're called matrix factorization is because if you make a matrix $F$ with as many rows as bowlers and as many columns as batsmen, you can write this as $$ \underbrace{\begin{bmatrix} f(b_1, m_1) & f(b_1, m_2) & \dots & f(b_1, m_M) \\ f(b_2, m_1) & f(b_2, m_2) & \dots & f(b_2, m_M) \\ \vdots & \vdots & \ddots& \vdots \\ f(b_N, m_1) & f(b_N, m_2) & \dots & f(b_N, m_M) \end{bmatrix}}_{F} = \underbrace{\begin{bmatrix} g(b_1) \\ \vdots \\ g(b_N) \end{bmatrix}}_{G} \underbrace{\begin{bmatrix} h(m_1) \\ \vdots \\ h(m_M) \end{bmatrix}^T}_{H^T} $$ where you've factored an $N \times M$ matrix $F$ into an $N \times r$ one $G$ and an $M \times r$ one $H$. Of course, you don't get to observe $F$ directly. The usual model is that you get to observe noisy entries of $F$ at random; in your case, you get to observe a draw from a binomial distribution with a random number of trials for each entry of $F$. You could construct a probability model like, say: \begin{gather} G_{ik} \sim \mathcal{N}(0, \sigma_G^2) \\ H_{jk} \sim \mathcal{N}(0, \sigma_H^2) \\ F_{ij} = G_i^T H_j \\ R_{ij} \sim \mathcal{Binomial}(n_{ij}, F_{ij}) \end{gather} where the $n_{ij}$ and $R_{ij}$ are observed, and you'd probably put some hyperpriors over $\sigma_G$/$\sigma_H$ and do inference e.g. in Stan. This isn't a perfect model: for one, it ignores that $n$ is correlated to the scores (as I mentioned in the first section), and more importantly, it doesn't constrain $F_{ij}$ to be in $[0, 1]$ (you'd probably use a logistic sigmoid or similar to achieve that). A related article, with more complex priors for $G$ and $H$ (but that doesn't use the binomial likelihood) is: Salakhutdinov and Mnih, Bayesian probabilistic matrix factorization using Markov chain Monte Carlo, ICML 2008. (doi / author's pdf)
Modeling cricket bowlers getting batsmen out $\DeclareMathOperator{\E}{\mathbb{E}}$ If I took the whole dataset and divided the total number of balls that got a batsman out by the total number of balls bowled I can see that I would have the ave
33,085
Modeling cricket bowlers getting batsmen out
You can't infer the correct probability that B will be out given that A is the bowler if A and B never met on the field just based on their averages with other players.
Modeling cricket bowlers getting batsmen out
You can't infer the correct probability that B will be out given that A is the bowler if A and B never met on the field just based on their averages with other players.
Modeling cricket bowlers getting batsmen out You can't infer the correct probability that B will be out given that A is the bowler if A and B never met on the field just based on their averages with other players.
Modeling cricket bowlers getting batsmen out You can't infer the correct probability that B will be out given that A is the bowler if A and B never met on the field just based on their averages with other players.
33,086
Law of total expecation/tower rule: Why must both random variables come from the same probability space?
I don't understand what they mean by the same probability space That's the problem. The standard way to think of the objects of probability theory (random variables, distributions, etc.) is through Kolmogorov's axioms. These axioms are framed in the language of measure theory, but it's quite possible to understand simple cases without any measure theory. Basically, a probability model consists of three things: a set $\Omega$, whose individual elements you can think of as summarising the "true state of the world" (or at least all you need to know about it); a collection $\mathcal{F}$ of subsets of $\Omega$ (whose elements are the possible events whose probability you may need to measure); and a probability measure $P$, which is a function that takes an event $E \in \mathcal{F}$ and spits out a number $P(E) \in [0, 1]$ (whose interpretation is the probability that event $E$ occurs). The triple $(\Omega, \mathcal{F}, P)$ is known as a probability space as long as it satisfies certain natural properties (for instance, ththe probability of a union of countably many disjoint events is the sum of their probabilities). In this framework, a random variable $X$ is a function from $\Omega$ to $\mathbb{R}$. In your example, we have two random variables: $T$ (the amount of time a light bulb lasts) and $F$ (which factory a light bulb comes from). How can these two have the same probability space? The question now amounts to: how do we define a probability space $(\Omega, \mathcal{F}, P)$ and functions $T, F : \Omega \to \mathbb{R}$ in such a way as to model the problem under consideration. There are many ways, but a simple one is to let $\Omega = \{ (f, t) : f = 0, 1, t > 0 \}$. An element $(f, t) \in \Omega$ specifies a particular (non-random) light bulb from factory $f$ that will last for time $t$. Then we would define $T(f, t) = t$ and $F(f, t) = f$. The joint distribution of $(T, F)$ is then defined by specifying $\mathcal{F}$ and $P$. I don't understand... why this is an important part of the definition The conditional expectation $E[X \mid Y]$ of a random variable $X$ given another random variable $Y$ is itself defined to be a type of random variable satsifying certain properties. You can find the formal definition here, however it may seem quite arcane if you are not familiar with measure-theoretic probability. Basically, this definition doesn't make sense if $X$ and $Y$ are not defined on the same probability space. Ultimately, though, it is usually not problematic to define two random variables on a common probability space, so this condition amounts to a technicality.
Law of total expecation/tower rule: Why must both random variables come from the same probability sp
I don't understand what they mean by the same probability space That's the problem. The standard way to think of the objects of probability theory (random variables, distributions, etc.) is through K
Law of total expecation/tower rule: Why must both random variables come from the same probability space? I don't understand what they mean by the same probability space That's the problem. The standard way to think of the objects of probability theory (random variables, distributions, etc.) is through Kolmogorov's axioms. These axioms are framed in the language of measure theory, but it's quite possible to understand simple cases without any measure theory. Basically, a probability model consists of three things: a set $\Omega$, whose individual elements you can think of as summarising the "true state of the world" (or at least all you need to know about it); a collection $\mathcal{F}$ of subsets of $\Omega$ (whose elements are the possible events whose probability you may need to measure); and a probability measure $P$, which is a function that takes an event $E \in \mathcal{F}$ and spits out a number $P(E) \in [0, 1]$ (whose interpretation is the probability that event $E$ occurs). The triple $(\Omega, \mathcal{F}, P)$ is known as a probability space as long as it satisfies certain natural properties (for instance, ththe probability of a union of countably many disjoint events is the sum of their probabilities). In this framework, a random variable $X$ is a function from $\Omega$ to $\mathbb{R}$. In your example, we have two random variables: $T$ (the amount of time a light bulb lasts) and $F$ (which factory a light bulb comes from). How can these two have the same probability space? The question now amounts to: how do we define a probability space $(\Omega, \mathcal{F}, P)$ and functions $T, F : \Omega \to \mathbb{R}$ in such a way as to model the problem under consideration. There are many ways, but a simple one is to let $\Omega = \{ (f, t) : f = 0, 1, t > 0 \}$. An element $(f, t) \in \Omega$ specifies a particular (non-random) light bulb from factory $f$ that will last for time $t$. Then we would define $T(f, t) = t$ and $F(f, t) = f$. The joint distribution of $(T, F)$ is then defined by specifying $\mathcal{F}$ and $P$. I don't understand... why this is an important part of the definition The conditional expectation $E[X \mid Y]$ of a random variable $X$ given another random variable $Y$ is itself defined to be a type of random variable satsifying certain properties. You can find the formal definition here, however it may seem quite arcane if you are not familiar with measure-theoretic probability. Basically, this definition doesn't make sense if $X$ and $Y$ are not defined on the same probability space. Ultimately, though, it is usually not problematic to define two random variables on a common probability space, so this condition amounts to a technicality.
Law of total expecation/tower rule: Why must both random variables come from the same probability sp I don't understand what they mean by the same probability space That's the problem. The standard way to think of the objects of probability theory (random variables, distributions, etc.) is through K
33,087
What is good modern book/resource on advanced experiments?
Some of your problems had been studied in the literatures. Specially on works on ECOLOGY. The song of the dodo by David Quammen is one which is more like stories. But another ones Ecological Diversity and Mathematical Ecology by Pielou had been studied mathematically. Also there is a book by Stephen P. Hubbell name The unified neutral theory of biodiversity and biogeography which had both. Then you may recall those concepts appear in the books and translate to the ones that you asked.
What is good modern book/resource on advanced experiments?
Some of your problems had been studied in the literatures. Specially on works on ECOLOGY. The song of the dodo by David Quammen is one which is more like stories. But another ones Ecological Diversity
What is good modern book/resource on advanced experiments? Some of your problems had been studied in the literatures. Specially on works on ECOLOGY. The song of the dodo by David Quammen is one which is more like stories. But another ones Ecological Diversity and Mathematical Ecology by Pielou had been studied mathematically. Also there is a book by Stephen P. Hubbell name The unified neutral theory of biodiversity and biogeography which had both. Then you may recall those concepts appear in the books and translate to the ones that you asked.
What is good modern book/resource on advanced experiments? Some of your problems had been studied in the literatures. Specially on works on ECOLOGY. The song of the dodo by David Quammen is one which is more like stories. But another ones Ecological Diversity
33,088
Confidence interval of the third moment of normal distribution
In order to find a confidence interval for this quantity you will need to form a pivotal quantity that uses the third raw moment as its only unknown parameter. It might not be possible to do this exactly, but you can usually get something that is an approximately pivotal quantity that can be used to form an approximate confidence interval. In order to do this, we will first find the form of the third raw moment that is being estimated, then construct a sample estimator of this moment, and then try to use this to construct a quasi-pivotal quantity and resulting confidence interval. What is the third raw moment of a normal distribution? Take $X \sim \text{N}(\mu, \sigma^2)$ to be an arbitrary normal random variable and define $Y = X-\mu \sim \text{N}(0, \sigma^2)$. The third raw moment of $X$ is: $$\begin{equation} \begin{aligned} \mu_3 \equiv \mathbb{E}(X^3) &= \mathbb{E}((\mu + Y)^3) \\[6pt] &= \mathbb{E}(Y^3 + 3 \mu Y^2 + 3 \mu^2 Y + \mu^3) \\[6pt] &= 0 + 3 \mu \sigma^2 + 0 + \mu^3 \\[6pt] &= 3 \mu \sigma^2 + \mu^3. \\[6pt] \end{aligned} \end{equation}$$ This is the parameter you are trying to estimate in your analysis. Unbiased estimator of the third raw moment: Ordinarily we would estimate the mean parameter with the sample mean and the variance parameter with the sample variance, but in this case we want to estimate a function of these things, and substitution of these estimators is likely to lead to a biased estimator. We will start by trying to find an unbiased estimator of the third raw moment. To do this, we begin by noting that: $$\begin{equation} \begin{aligned} \mathbb{E}(\bar{X}_n^3) &= \mathbb{E}((\mu + \bar{Y}_n)^3) \\[6pt] &= \mathbb{E}(\bar{Y}_n^3 + 3 \mu \bar{Y}_n^2 + 3 \mu^2 \bar{Y}_n + \mu^3) \\[6pt] &= 0 + 3 \mu \frac{\sigma^2}{n} + 0 + \mu^3 \\[6pt] &= \frac{3}{n} \mu \sigma^2 + \mu^3. \\[6pt] \end{aligned} \end{equation}$$ We know from Cochran's theorem that the sample mean and sample variance from normal data are independent, and so we also have $\mathbb{E}(\bar{X}_n S_n^2) = \mathbb{E}(\bar{X}_n) \mathbb{E}(S_n^2) = \mu \sigma^2$. Hence, based on these results, we can form the unbiased estimator: $$\hat{\mu}_3 = \frac{3(n-1)}{n} \cdot \bar{X}_n S^2 + \bar{X}_n^3.$$ Variance of the estimator: We know that the expected value of this estimator is equal to the third raw moment of the distribution (to see this, simple substitute the above expected value expressions), however the variance of the estimator is laborious to derive. As preliminary results we have: $$\begin{equation} \begin{aligned} \mathbb{V}(\bar{X}_n S^2) &= \mathbb{V}(\bar{X}_n) \mathbb{V}(S^2) \\[6pt] &= \frac{1}{n} \sigma^2 \cdot \frac{2}{n-1} \sigma^4 \\[6pt] &= \frac{2}{n(n-1)} \sigma^6, \\[12pt] \mathbb{V}(\bar{X}_n^3) &= \mathbb{E}(\bar{X}_n^6) - \mathbb{E}(\bar{X}_n^3)^2 \\[6pt] &= \Big( \frac{15}{n^3} \sigma^6 + \frac{45}{n^2} \mu^2 \sigma^4 + \frac{15}{n} \mu^4 \sigma^2 + \mu^6 \Big) - \Big( \frac{3}{n} \mu \sigma^2 + \mu^3 \Big)^2 \\[6pt] &= \Big( \frac{15}{n^3} \sigma^6 + \frac{45}{n^2} \mu^2 \sigma^4 + \frac{15}{n} \mu^4 \sigma^2 + \mu^6 \Big) - \Big( \frac{9}{n^2} \mu^2 \sigma^4 + \frac{6}{n} \mu^4 \sigma^2 + \mu^6 \Big) \\[6pt] &= \frac{15}{n^3} \sigma^6 + \frac{36}{n^2} \mu^2 \sigma^4 + \frac{9}{n} \mu^4 \sigma^2, \\[12pt] \mathbb{C}(\bar{X}_n S^2, \bar{X}_n^3) &= \mathbb{E}(\bar{X}_n^4 S^2) - \mathbb{E}(\bar{X}_n S^2) \mathbb{E}(\bar{X}_n^3) \\[6pt] &= \mathbb{E}(\bar{X}_n^4) \mathbb{E}(S^2) - \mathbb{E}(\bar{X}_n) \mathbb{E}(\bar{X}_n^3) \mathbb{E}(S^2) \\[6pt] &= \Big( \frac{3}{n^2} \sigma^4 + \frac{6}{n} \mu^2 \sigma^2 + \mu^4 \Big) \sigma^2 - \mu \Big( \frac{3}{n} \mu \sigma^2 + \mu^3 \Big) \sigma^2 \\[6pt] &= \Big( \frac{3}{n^2} \sigma^4 + \frac{6}{n} \mu^2 \sigma^2 + \mu^4 \Big) \sigma^2 - \Big( \frac{3}{n} \mu^2 \sigma^2 + \mu^4 \Big) \sigma^2 \\[6pt] &= \Big( \frac{3}{n^2} \sigma^4 + \frac{3}{n} \mu^2 \sigma^2 \Big) \sigma^2 \\[6pt] &= \frac{3}{n^2} \sigma^6 + \frac{3}{n} \mu^2 \sigma^4. \\[6pt] \end{aligned} \end{equation}$$ This gives us the variance: $$\begin{equation} \begin{aligned} \mathbb{V}(\hat{\mu}_3) &= \mathbb{V} \Big( \frac{3(n-1)}{n} \cdot \bar{X}_n S^2 + \bar{X}_n^3 \Big) \\[6pt] &= \frac{9(n-1)^2}{n^2} \cdot \mathbb{V}(\bar{X}_n S^2) + \mathbb{V}(\bar{X}_n^3) + \frac{3(n-1)}{n} \cdot \mathbb{C} (\bar{X}_n S^2, \bar{X}_n^3) \\[6pt] &= \frac{18(n-1)}{n^3} \sigma^6 + \Big( \frac{15}{n^3} \sigma^6 + \frac{36}{n^2} \mu^2 \sigma^4 + \frac{9}{n} \mu^4 \sigma^2 \Big) + \Big( \frac{9(n-1)}{n^3} \sigma^6 + \frac{9(n-1)}{n^2} \mu^2 \sigma^4 \Big) \\[6pt] &= \frac{27n-12}{n^3} \cdot \sigma^6 + \frac{9n+27}{n^2} \cdot \mu^2 \sigma^4 + \frac{9}{n} \cdot \mu^4 \sigma^2 \\[6pt] &= \frac{3}{n^3} \Big[ (9n-4) \sigma^6 + (3n^2+9n) \mu^2 \sigma^4 + 3n^2 \mu^4 \sigma^2 \Big]. \\[6pt] \end{aligned} \end{equation}$$ Forming a confidence interval: From the above results, we can obtain an unbiased estimator for the third raw moment, with known variance. The exact distribution of this estimator is complicated, and its density cannot be expressed in closed-form. It is possible to form a studentised quantity with this estimator, approximate its distribution, and treat it as a quasi-pivotal quantity to obtain an approximate confidence interval. However, this would not be an exact confidence interval.
Confidence interval of the third moment of normal distribution
In order to find a confidence interval for this quantity you will need to form a pivotal quantity that uses the third raw moment as its only unknown parameter. It might not be possible to do this exa
Confidence interval of the third moment of normal distribution In order to find a confidence interval for this quantity you will need to form a pivotal quantity that uses the third raw moment as its only unknown parameter. It might not be possible to do this exactly, but you can usually get something that is an approximately pivotal quantity that can be used to form an approximate confidence interval. In order to do this, we will first find the form of the third raw moment that is being estimated, then construct a sample estimator of this moment, and then try to use this to construct a quasi-pivotal quantity and resulting confidence interval. What is the third raw moment of a normal distribution? Take $X \sim \text{N}(\mu, \sigma^2)$ to be an arbitrary normal random variable and define $Y = X-\mu \sim \text{N}(0, \sigma^2)$. The third raw moment of $X$ is: $$\begin{equation} \begin{aligned} \mu_3 \equiv \mathbb{E}(X^3) &= \mathbb{E}((\mu + Y)^3) \\[6pt] &= \mathbb{E}(Y^3 + 3 \mu Y^2 + 3 \mu^2 Y + \mu^3) \\[6pt] &= 0 + 3 \mu \sigma^2 + 0 + \mu^3 \\[6pt] &= 3 \mu \sigma^2 + \mu^3. \\[6pt] \end{aligned} \end{equation}$$ This is the parameter you are trying to estimate in your analysis. Unbiased estimator of the third raw moment: Ordinarily we would estimate the mean parameter with the sample mean and the variance parameter with the sample variance, but in this case we want to estimate a function of these things, and substitution of these estimators is likely to lead to a biased estimator. We will start by trying to find an unbiased estimator of the third raw moment. To do this, we begin by noting that: $$\begin{equation} \begin{aligned} \mathbb{E}(\bar{X}_n^3) &= \mathbb{E}((\mu + \bar{Y}_n)^3) \\[6pt] &= \mathbb{E}(\bar{Y}_n^3 + 3 \mu \bar{Y}_n^2 + 3 \mu^2 \bar{Y}_n + \mu^3) \\[6pt] &= 0 + 3 \mu \frac{\sigma^2}{n} + 0 + \mu^3 \\[6pt] &= \frac{3}{n} \mu \sigma^2 + \mu^3. \\[6pt] \end{aligned} \end{equation}$$ We know from Cochran's theorem that the sample mean and sample variance from normal data are independent, and so we also have $\mathbb{E}(\bar{X}_n S_n^2) = \mathbb{E}(\bar{X}_n) \mathbb{E}(S_n^2) = \mu \sigma^2$. Hence, based on these results, we can form the unbiased estimator: $$\hat{\mu}_3 = \frac{3(n-1)}{n} \cdot \bar{X}_n S^2 + \bar{X}_n^3.$$ Variance of the estimator: We know that the expected value of this estimator is equal to the third raw moment of the distribution (to see this, simple substitute the above expected value expressions), however the variance of the estimator is laborious to derive. As preliminary results we have: $$\begin{equation} \begin{aligned} \mathbb{V}(\bar{X}_n S^2) &= \mathbb{V}(\bar{X}_n) \mathbb{V}(S^2) \\[6pt] &= \frac{1}{n} \sigma^2 \cdot \frac{2}{n-1} \sigma^4 \\[6pt] &= \frac{2}{n(n-1)} \sigma^6, \\[12pt] \mathbb{V}(\bar{X}_n^3) &= \mathbb{E}(\bar{X}_n^6) - \mathbb{E}(\bar{X}_n^3)^2 \\[6pt] &= \Big( \frac{15}{n^3} \sigma^6 + \frac{45}{n^2} \mu^2 \sigma^4 + \frac{15}{n} \mu^4 \sigma^2 + \mu^6 \Big) - \Big( \frac{3}{n} \mu \sigma^2 + \mu^3 \Big)^2 \\[6pt] &= \Big( \frac{15}{n^3} \sigma^6 + \frac{45}{n^2} \mu^2 \sigma^4 + \frac{15}{n} \mu^4 \sigma^2 + \mu^6 \Big) - \Big( \frac{9}{n^2} \mu^2 \sigma^4 + \frac{6}{n} \mu^4 \sigma^2 + \mu^6 \Big) \\[6pt] &= \frac{15}{n^3} \sigma^6 + \frac{36}{n^2} \mu^2 \sigma^4 + \frac{9}{n} \mu^4 \sigma^2, \\[12pt] \mathbb{C}(\bar{X}_n S^2, \bar{X}_n^3) &= \mathbb{E}(\bar{X}_n^4 S^2) - \mathbb{E}(\bar{X}_n S^2) \mathbb{E}(\bar{X}_n^3) \\[6pt] &= \mathbb{E}(\bar{X}_n^4) \mathbb{E}(S^2) - \mathbb{E}(\bar{X}_n) \mathbb{E}(\bar{X}_n^3) \mathbb{E}(S^2) \\[6pt] &= \Big( \frac{3}{n^2} \sigma^4 + \frac{6}{n} \mu^2 \sigma^2 + \mu^4 \Big) \sigma^2 - \mu \Big( \frac{3}{n} \mu \sigma^2 + \mu^3 \Big) \sigma^2 \\[6pt] &= \Big( \frac{3}{n^2} \sigma^4 + \frac{6}{n} \mu^2 \sigma^2 + \mu^4 \Big) \sigma^2 - \Big( \frac{3}{n} \mu^2 \sigma^2 + \mu^4 \Big) \sigma^2 \\[6pt] &= \Big( \frac{3}{n^2} \sigma^4 + \frac{3}{n} \mu^2 \sigma^2 \Big) \sigma^2 \\[6pt] &= \frac{3}{n^2} \sigma^6 + \frac{3}{n} \mu^2 \sigma^4. \\[6pt] \end{aligned} \end{equation}$$ This gives us the variance: $$\begin{equation} \begin{aligned} \mathbb{V}(\hat{\mu}_3) &= \mathbb{V} \Big( \frac{3(n-1)}{n} \cdot \bar{X}_n S^2 + \bar{X}_n^3 \Big) \\[6pt] &= \frac{9(n-1)^2}{n^2} \cdot \mathbb{V}(\bar{X}_n S^2) + \mathbb{V}(\bar{X}_n^3) + \frac{3(n-1)}{n} \cdot \mathbb{C} (\bar{X}_n S^2, \bar{X}_n^3) \\[6pt] &= \frac{18(n-1)}{n^3} \sigma^6 + \Big( \frac{15}{n^3} \sigma^6 + \frac{36}{n^2} \mu^2 \sigma^4 + \frac{9}{n} \mu^4 \sigma^2 \Big) + \Big( \frac{9(n-1)}{n^3} \sigma^6 + \frac{9(n-1)}{n^2} \mu^2 \sigma^4 \Big) \\[6pt] &= \frac{27n-12}{n^3} \cdot \sigma^6 + \frac{9n+27}{n^2} \cdot \mu^2 \sigma^4 + \frac{9}{n} \cdot \mu^4 \sigma^2 \\[6pt] &= \frac{3}{n^3} \Big[ (9n-4) \sigma^6 + (3n^2+9n) \mu^2 \sigma^4 + 3n^2 \mu^4 \sigma^2 \Big]. \\[6pt] \end{aligned} \end{equation}$$ Forming a confidence interval: From the above results, we can obtain an unbiased estimator for the third raw moment, with known variance. The exact distribution of this estimator is complicated, and its density cannot be expressed in closed-form. It is possible to form a studentised quantity with this estimator, approximate its distribution, and treat it as a quasi-pivotal quantity to obtain an approximate confidence interval. However, this would not be an exact confidence interval.
Confidence interval of the third moment of normal distribution In order to find a confidence interval for this quantity you will need to form a pivotal quantity that uses the third raw moment as its only unknown parameter. It might not be possible to do this exa
33,089
Original (?) model selection with k-fold CV
The $MSD_K$ is an odd measure of generalization error, since the holdout set doesn't even come into the picture. All this will tell you is how correlated the model's predictions are with each other, but nothing about how well either actually predicts the test data point. For example, I could come up with a dumb pair of predictors: $$\hat y_A(\mathbf{x},\theta)= 1+\frac{\langle \mathbf{x},1\rangle}\theta$$ $$\hat y_B(\mathbf{x},\theta):= 1+\frac{\langle \mathbf{x},1\rangle}{\theta^2}$$ In this case, tuning on cross validation would tell me to set $\theta$ has large as possible since that would drive down the $MSD_K$, but I doubt these models would be good predictors. I took a look at the link, but I didn't see your $MSD_K$ measure there. Andrew Gelman is a well-respected statistician, so I doubt he'd endorse something like the above, which clearly fails as an estimator of generalization error. His paper and the link discuss Leave One Out (LOO) cross validation, which still requires a comparison with a test data point (i.e., held-out from training) as the benchmark. The $MSD_K$ is a purely "inward" looking metric that won't tell you anything about the expected test error (except perhaps that the two models may have similar errors...). Response to OP comment The formula presented in your comment requires a bit of context: It is a Bayesian measure of accuracy, in that elpd is the expected log pointwise predictive density - quite a mouthful, but basically, it is the sum of expected values of the logarithm of the posterior predictive density evaluated at each data point under some prior predictive density that is estimated using cross validation. The above measure (elpd) is calculated using leave one out cross-validation, where the predictive density is taken at the omitted point. What their formula (19) is doing is calculating the standard error of the difference in predictive accuracy (measured using elpd) between two models. The idea is that the difference in elpd's is asymptoticallly normal, so the standard error has inferential meaninig (and can be used to test if the underlying difference is zero), or is Model A has a smaller prediction error than Model B. So, there are a lot of moving parts to this measure: You need to have run an MCMC sampling algorithm to get points from the posterior parameter density. You then need to integrate it to get predictive densities. Then you need to take expected values of each of these (over many draws). Its quite a process, but in the end it's supposed to give a useful standard error. Note: In the third full paragraph below equation (19), the authors state that more research is needed to determine if this approach performs well for model comparison...so, its not well tested yet (highly experimental). Thus, you are basically trusting in the usefulness of this method until follow-up studies verify it reliably identifies the better model (in terms of elpd).
Original (?) model selection with k-fold CV
The $MSD_K$ is an odd measure of generalization error, since the holdout set doesn't even come into the picture. All this will tell you is how correlated the model's predictions are with each other, b
Original (?) model selection with k-fold CV The $MSD_K$ is an odd measure of generalization error, since the holdout set doesn't even come into the picture. All this will tell you is how correlated the model's predictions are with each other, but nothing about how well either actually predicts the test data point. For example, I could come up with a dumb pair of predictors: $$\hat y_A(\mathbf{x},\theta)= 1+\frac{\langle \mathbf{x},1\rangle}\theta$$ $$\hat y_B(\mathbf{x},\theta):= 1+\frac{\langle \mathbf{x},1\rangle}{\theta^2}$$ In this case, tuning on cross validation would tell me to set $\theta$ has large as possible since that would drive down the $MSD_K$, but I doubt these models would be good predictors. I took a look at the link, but I didn't see your $MSD_K$ measure there. Andrew Gelman is a well-respected statistician, so I doubt he'd endorse something like the above, which clearly fails as an estimator of generalization error. His paper and the link discuss Leave One Out (LOO) cross validation, which still requires a comparison with a test data point (i.e., held-out from training) as the benchmark. The $MSD_K$ is a purely "inward" looking metric that won't tell you anything about the expected test error (except perhaps that the two models may have similar errors...). Response to OP comment The formula presented in your comment requires a bit of context: It is a Bayesian measure of accuracy, in that elpd is the expected log pointwise predictive density - quite a mouthful, but basically, it is the sum of expected values of the logarithm of the posterior predictive density evaluated at each data point under some prior predictive density that is estimated using cross validation. The above measure (elpd) is calculated using leave one out cross-validation, where the predictive density is taken at the omitted point. What their formula (19) is doing is calculating the standard error of the difference in predictive accuracy (measured using elpd) between two models. The idea is that the difference in elpd's is asymptoticallly normal, so the standard error has inferential meaninig (and can be used to test if the underlying difference is zero), or is Model A has a smaller prediction error than Model B. So, there are a lot of moving parts to this measure: You need to have run an MCMC sampling algorithm to get points from the posterior parameter density. You then need to integrate it to get predictive densities. Then you need to take expected values of each of these (over many draws). Its quite a process, but in the end it's supposed to give a useful standard error. Note: In the third full paragraph below equation (19), the authors state that more research is needed to determine if this approach performs well for model comparison...so, its not well tested yet (highly experimental). Thus, you are basically trusting in the usefulness of this method until follow-up studies verify it reliably identifies the better model (in terms of elpd).
Original (?) model selection with k-fold CV The $MSD_K$ is an odd measure of generalization error, since the holdout set doesn't even come into the picture. All this will tell you is how correlated the model's predictions are with each other, b
33,090
It's all in the family; but do we include the in-laws too?
No one's answered yet, so I'll take a crack at this. It's my opinion (and I would love to hear other's thoughts) that you should be adjusting for the full 9 tests in this case. Assuming we're using family-wise error rate correction, We are simultaneously drawing conclusions from all 9 tests at once. I.e. scanning down the list and seeing to find anything significant. To be able to do this, we are considering an overall family-wise error rate of 5%. The alternative would be to individually correct the groups to a 5% FWER. This would mean that when interpreting, we could not interpret the tests together, and would rather have to look at the first 6 tests and think that there's a 5% chance of a false positive, then subsequently examine each of the further tests in turn knowing that there is a 5% chance of a false positive for each group. IMO the utility of multiple testing correction is that we are able to simultaneously draw inference from multiple tests at once. It seems more logical that we should look at all 9 tests and know there's a 5% chance of a false positive, rather than having to examine them separately, akin to not correcting at all. The issue of adjusting for the three $F$-tests in the ANOVA is interesting, but in my opinion only relevant if you plan to do some model selection in which you only accept significant predictors. This might be a good read, specifically the conclusion is a very succinct and excellent read. I stole that link from this question. Your point about the inclusion of interaction effects is interesting, and I think you could define that as model selection. Would you have included the interaction effects if they were significant? In this case perhaps the $F$ statistics in the original ANOVA should have been adjusted in order to facilitate selection of significant predictors. Overall I think that if you are drawing simultaneous inference from a group, you must consider each test in that group for correction. Otherwise the standard understanding of controlled group error rate doesn't hold up, and it's quite difficult to conceptually keep track of what has been adjusted and what hasn't. Much better, in my opinion, to hold all tests accountable and hold the family-wise error rate at a given threshold. If you have any rebuttals, I would love to hear them, and I'm sure some people will disagree with some things in here. Very interested to hear other's thoughts.
It's all in the family; but do we include the in-laws too?
No one's answered yet, so I'll take a crack at this. It's my opinion (and I would love to hear other's thoughts) that you should be adjusting for the full 9 tests in this case. Assuming we're using
It's all in the family; but do we include the in-laws too? No one's answered yet, so I'll take a crack at this. It's my opinion (and I would love to hear other's thoughts) that you should be adjusting for the full 9 tests in this case. Assuming we're using family-wise error rate correction, We are simultaneously drawing conclusions from all 9 tests at once. I.e. scanning down the list and seeing to find anything significant. To be able to do this, we are considering an overall family-wise error rate of 5%. The alternative would be to individually correct the groups to a 5% FWER. This would mean that when interpreting, we could not interpret the tests together, and would rather have to look at the first 6 tests and think that there's a 5% chance of a false positive, then subsequently examine each of the further tests in turn knowing that there is a 5% chance of a false positive for each group. IMO the utility of multiple testing correction is that we are able to simultaneously draw inference from multiple tests at once. It seems more logical that we should look at all 9 tests and know there's a 5% chance of a false positive, rather than having to examine them separately, akin to not correcting at all. The issue of adjusting for the three $F$-tests in the ANOVA is interesting, but in my opinion only relevant if you plan to do some model selection in which you only accept significant predictors. This might be a good read, specifically the conclusion is a very succinct and excellent read. I stole that link from this question. Your point about the inclusion of interaction effects is interesting, and I think you could define that as model selection. Would you have included the interaction effects if they were significant? In this case perhaps the $F$ statistics in the original ANOVA should have been adjusted in order to facilitate selection of significant predictors. Overall I think that if you are drawing simultaneous inference from a group, you must consider each test in that group for correction. Otherwise the standard understanding of controlled group error rate doesn't hold up, and it's quite difficult to conceptually keep track of what has been adjusted and what hasn't. Much better, in my opinion, to hold all tests accountable and hold the family-wise error rate at a given threshold. If you have any rebuttals, I would love to hear them, and I'm sure some people will disagree with some things in here. Very interested to hear other's thoughts.
It's all in the family; but do we include the in-laws too? No one's answered yet, so I'll take a crack at this. It's my opinion (and I would love to hear other's thoughts) that you should be adjusting for the full 9 tests in this case. Assuming we're using
33,091
Why is backward elimination justified when doing multiple regression?
I think building a model and testing it are different things. The backward elimination is part of model building. Jack knife and bootstrap are more used to test it. You can certainly have more reliable estimates with bootstrap and jack knife than the simple backward eleimination. But if you really want to test overfitting, the ultimate test is a split-sample, train on some, test on others. Leave-one-out is too unstable/unreliable for this purpose: http://www.russpoldrack.org/2012/12/the-perils-of-leave-one-out.html I think at least 10% of subjects need to be out to get more stable estimates of robustness of the model. And if you have 20 subjects, 2 subjects are still very few. But then the question becomes whether you have a large enough sample to build a model that can be applied to the rest of the population. Hope it answered your question at least in part.
Why is backward elimination justified when doing multiple regression?
I think building a model and testing it are different things. The backward elimination is part of model building. Jack knife and bootstrap are more used to test it. You can certainly have more reliabl
Why is backward elimination justified when doing multiple regression? I think building a model and testing it are different things. The backward elimination is part of model building. Jack knife and bootstrap are more used to test it. You can certainly have more reliable estimates with bootstrap and jack knife than the simple backward eleimination. But if you really want to test overfitting, the ultimate test is a split-sample, train on some, test on others. Leave-one-out is too unstable/unreliable for this purpose: http://www.russpoldrack.org/2012/12/the-perils-of-leave-one-out.html I think at least 10% of subjects need to be out to get more stable estimates of robustness of the model. And if you have 20 subjects, 2 subjects are still very few. But then the question becomes whether you have a large enough sample to build a model that can be applied to the rest of the population. Hope it answered your question at least in part.
Why is backward elimination justified when doing multiple regression? I think building a model and testing it are different things. The backward elimination is part of model building. Jack knife and bootstrap are more used to test it. You can certainly have more reliabl
33,092
Incorporate new unlabeled data into classifier trained on a small set of labeled data
(3) doesn't have to be bad if you have some prior about what the clusters might look like, however you wouldn't be using your labelled data optimally. As you point out, you can iteratively train a classifier on its own output. (2) isn't that different from (3) really, it'll depend on how good your metric is (1) is what I would recommend, though it doesn't have to be S3VM. A Bayesian model would treat all the missing label as latent variables and learn the posterior distribution of both the missing labels and the classifier's parameters.
Incorporate new unlabeled data into classifier trained on a small set of labeled data
(3) doesn't have to be bad if you have some prior about what the clusters might look like, however you wouldn't be using your labelled data optimally. As you point out, you can iteratively train a cla
Incorporate new unlabeled data into classifier trained on a small set of labeled data (3) doesn't have to be bad if you have some prior about what the clusters might look like, however you wouldn't be using your labelled data optimally. As you point out, you can iteratively train a classifier on its own output. (2) isn't that different from (3) really, it'll depend on how good your metric is (1) is what I would recommend, though it doesn't have to be S3VM. A Bayesian model would treat all the missing label as latent variables and learn the posterior distribution of both the missing labels and the classifier's parameters.
Incorporate new unlabeled data into classifier trained on a small set of labeled data (3) doesn't have to be bad if you have some prior about what the clusters might look like, however you wouldn't be using your labelled data optimally. As you point out, you can iteratively train a cla
33,093
Incorporate new unlabeled data into classifier trained on a small set of labeled data
I would stick with the approach 1 and then use your set aside data to test if the new rule is any better than the original rule. It is not a given that this will be the case. Likely, you will use different class of functions for modeling than the one your original classifier used, and this may change the results for worse (as well as for better). The approaches 2 and 3 seem doubtful because you add noise by using, possibly, wrong labels from your original classifier. It depends on the accuracy of your original classifier though. The approaches 2 and 3 model your original classifier with new unlabeled data and different methods. The labels from a classifier are expected to be less reliable than the original training data. So, I do not see how these approaches can make you closer to the true labels.
Incorporate new unlabeled data into classifier trained on a small set of labeled data
I would stick with the approach 1 and then use your set aside data to test if the new rule is any better than the original rule. It is not a given that this will be the case. Likely, you will use diff
Incorporate new unlabeled data into classifier trained on a small set of labeled data I would stick with the approach 1 and then use your set aside data to test if the new rule is any better than the original rule. It is not a given that this will be the case. Likely, you will use different class of functions for modeling than the one your original classifier used, and this may change the results for worse (as well as for better). The approaches 2 and 3 seem doubtful because you add noise by using, possibly, wrong labels from your original classifier. It depends on the accuracy of your original classifier though. The approaches 2 and 3 model your original classifier with new unlabeled data and different methods. The labels from a classifier are expected to be less reliable than the original training data. So, I do not see how these approaches can make you closer to the true labels.
Incorporate new unlabeled data into classifier trained on a small set of labeled data I would stick with the approach 1 and then use your set aside data to test if the new rule is any better than the original rule. It is not a given that this will be the case. Likely, you will use diff
33,094
Distribution with a given moment generating function
There is an explicit density for $S_n$ when $\sigma=1/2$ and a limiting density of $$\frac{e^{-\frac{z}{2}-\frac{e^{-z}}{2}}}{\sqrt{2 \pi }}$$ (And there might be a general density for other values of $\sigma$.) I have to confess ignorance of what extreme value distribution has the above density. It's similar to a Gumbel distribution not quite. This is done with a brute force approach where the pdf of $\sum_{i=1}^n Y_i$ is found followed by the density of $S_n=\sum_{i=1}^n Y_i - \log(n)$ (again, just for $\sigma=1/2$). Then the limit of the density of $S_n$ is found along with the limiting moment generating function. First, the distribution of $Y_i$ (using Mathematica throughout). pdf[j_, y_] := Simplify[PDF[TransformedDistribution[-Log[1 - x], x \[Distributed] BetaDistribution[1 - 1/2, j /2]], y] // TrigToExp, Assumptions -> y > 0] So the pdf for $Y_1$ and $Y_2$ are pdf[1, y1] $$\frac{1}{\pi \sqrt{e^{y_1}-1}}$$ pdf[2, y2] $$\frac{e^{-\frac{y_2}{2}}}{2 \sqrt{e^{y_2}-1}}$$ The distribution of the sums of the $Y$'s are constructed sequentially: pdfSum[1] = pdf[1, y1] pdfSum[2] = Integrate[pdfSum[1] pdf[2, y2 - y1], {y1, 0, y2}, Assumptions -> y2 > 0] pdfSum[3] = Integrate[pdfSum[2] pdf[3, y3 - y2], {y2, 0, y3}, Assumptions -> y3 > 0] pdfSum[4] = Integrate[pdfSum[3] pdf[4, y4 - y3], {y3, 0, y4}, Assumptions -> y4 > 0] pdfSum[5] = Integrate[pdfSum[4] pdf[5, y5 - y4], {y4, 0, y5}, Assumptions -> y5 > 0] pdfSum[6] = Integrate[pdfSum[5] pdf[6, y6 - y5], {y5, 0, y6}, Assumptions -> y6 > 0] pdfSum[7] = Integrate[pdfSum[6] pdf[7, y7 - y6], {y6, 0, y7}, Assumptions -> y7 > 0] pdfSum[8] = Integrate[pdfSum[7] pdf[8, y8 - y7], {y7, 0, y8}, Assumptions -> y8 > 0] We see the pattern and the pdf for a general $n$ is $$\frac{\Gamma \left(\frac{n+1}{2}\right) \exp \left(\frac{1}{2} (-(n-1)) z\right) (\exp (z)-1)^{\frac{n-2}{2}}}{\sqrt{\pi } \Gamma \left(\frac{n}{2}\right)}$$ So the pdf for $S_n$ is that of the above but including the shift of $\log(n)$: pdfSn[n_] := Gamma[(1 + n)/2]/(Sqrt[\[Pi]] Gamma[n/2])* Exp[-(n - 1) (z + Log[n])/2] (-1 + Exp[z + Log[n]])^((n - 2)/2) Taking the limit of this function we have pdfS = Limit[pdfSn[n], n -> \[Infinity], Assumptions -> z \[Element] Reals] $$\frac{e^{-\frac{z}{2}-\frac{e^{-z}}{2}}}{\sqrt{2 \pi }}$$ The moment generating function associated with this pdf is mgf = Integrate[Exp[\[Lambda] z] pdfS, {z, -\[Infinity], \[Infinity]}, Assumptions -> Re[\[Lambda]] < 1/2] $$\frac{2^{-\lambda } \Gamma \left(\frac{1}{2}-\lambda \right)}{\sqrt{\pi }}$$ This doesn't look exactly like the mgf in the OP's question when $\sigma=1/2$ but Mathematica declares them identical with Gamma[1 - \[Lambda]/(1/2)]/((1/2)^\[Lambda] Gamma[1 - \[Lambda]]) // FunctionExpand $$\frac{2^{-\lambda } \Gamma \left(\frac{1}{2}-\lambda \right)}{\sqrt{\pi }}$$ Another check involves extracting several moments which gives identical results. Here is for the first moment: D[mgf, {\[Lambda], 1}] /. \[Lambda] -> 0 // FunctionExpand // FullSimplify D[Gamma[1 - \[Lambda]/(1/2)]/((1/2)^\[Lambda] Gamma[1 - \[Lambda]]), {\[Lambda], 1}] /. \[Lambda] -> 0 Both give $\gamma +\log (2)$ (where $\gamma$ is Euler's constant). For the 17th moment: D[mgf, {\[Lambda], 17}] /. \[Lambda] -> 0 // N D[Gamma[1 - \[Lambda]/(1/2)]/((1/2)^\[Lambda] Gamma[1 - \[Lambda]]), {\[Lambda], 17}] /. \[Lambda] -> 0 // N Both give 3.71979*10^19. There might be some simple way to insert $\sigma$ into the limiting pdf but I haven't played with that yet.
Distribution with a given moment generating function
There is an explicit density for $S_n$ when $\sigma=1/2$ and a limiting density of $$\frac{e^{-\frac{z}{2}-\frac{e^{-z}}{2}}}{\sqrt{2 \pi }}$$ (And there might be a general density for other values of
Distribution with a given moment generating function There is an explicit density for $S_n$ when $\sigma=1/2$ and a limiting density of $$\frac{e^{-\frac{z}{2}-\frac{e^{-z}}{2}}}{\sqrt{2 \pi }}$$ (And there might be a general density for other values of $\sigma$.) I have to confess ignorance of what extreme value distribution has the above density. It's similar to a Gumbel distribution not quite. This is done with a brute force approach where the pdf of $\sum_{i=1}^n Y_i$ is found followed by the density of $S_n=\sum_{i=1}^n Y_i - \log(n)$ (again, just for $\sigma=1/2$). Then the limit of the density of $S_n$ is found along with the limiting moment generating function. First, the distribution of $Y_i$ (using Mathematica throughout). pdf[j_, y_] := Simplify[PDF[TransformedDistribution[-Log[1 - x], x \[Distributed] BetaDistribution[1 - 1/2, j /2]], y] // TrigToExp, Assumptions -> y > 0] So the pdf for $Y_1$ and $Y_2$ are pdf[1, y1] $$\frac{1}{\pi \sqrt{e^{y_1}-1}}$$ pdf[2, y2] $$\frac{e^{-\frac{y_2}{2}}}{2 \sqrt{e^{y_2}-1}}$$ The distribution of the sums of the $Y$'s are constructed sequentially: pdfSum[1] = pdf[1, y1] pdfSum[2] = Integrate[pdfSum[1] pdf[2, y2 - y1], {y1, 0, y2}, Assumptions -> y2 > 0] pdfSum[3] = Integrate[pdfSum[2] pdf[3, y3 - y2], {y2, 0, y3}, Assumptions -> y3 > 0] pdfSum[4] = Integrate[pdfSum[3] pdf[4, y4 - y3], {y3, 0, y4}, Assumptions -> y4 > 0] pdfSum[5] = Integrate[pdfSum[4] pdf[5, y5 - y4], {y4, 0, y5}, Assumptions -> y5 > 0] pdfSum[6] = Integrate[pdfSum[5] pdf[6, y6 - y5], {y5, 0, y6}, Assumptions -> y6 > 0] pdfSum[7] = Integrate[pdfSum[6] pdf[7, y7 - y6], {y6, 0, y7}, Assumptions -> y7 > 0] pdfSum[8] = Integrate[pdfSum[7] pdf[8, y8 - y7], {y7, 0, y8}, Assumptions -> y8 > 0] We see the pattern and the pdf for a general $n$ is $$\frac{\Gamma \left(\frac{n+1}{2}\right) \exp \left(\frac{1}{2} (-(n-1)) z\right) (\exp (z)-1)^{\frac{n-2}{2}}}{\sqrt{\pi } \Gamma \left(\frac{n}{2}\right)}$$ So the pdf for $S_n$ is that of the above but including the shift of $\log(n)$: pdfSn[n_] := Gamma[(1 + n)/2]/(Sqrt[\[Pi]] Gamma[n/2])* Exp[-(n - 1) (z + Log[n])/2] (-1 + Exp[z + Log[n]])^((n - 2)/2) Taking the limit of this function we have pdfS = Limit[pdfSn[n], n -> \[Infinity], Assumptions -> z \[Element] Reals] $$\frac{e^{-\frac{z}{2}-\frac{e^{-z}}{2}}}{\sqrt{2 \pi }}$$ The moment generating function associated with this pdf is mgf = Integrate[Exp[\[Lambda] z] pdfS, {z, -\[Infinity], \[Infinity]}, Assumptions -> Re[\[Lambda]] < 1/2] $$\frac{2^{-\lambda } \Gamma \left(\frac{1}{2}-\lambda \right)}{\sqrt{\pi }}$$ This doesn't look exactly like the mgf in the OP's question when $\sigma=1/2$ but Mathematica declares them identical with Gamma[1 - \[Lambda]/(1/2)]/((1/2)^\[Lambda] Gamma[1 - \[Lambda]]) // FunctionExpand $$\frac{2^{-\lambda } \Gamma \left(\frac{1}{2}-\lambda \right)}{\sqrt{\pi }}$$ Another check involves extracting several moments which gives identical results. Here is for the first moment: D[mgf, {\[Lambda], 1}] /. \[Lambda] -> 0 // FunctionExpand // FullSimplify D[Gamma[1 - \[Lambda]/(1/2)]/((1/2)^\[Lambda] Gamma[1 - \[Lambda]]), {\[Lambda], 1}] /. \[Lambda] -> 0 Both give $\gamma +\log (2)$ (where $\gamma$ is Euler's constant). For the 17th moment: D[mgf, {\[Lambda], 17}] /. \[Lambda] -> 0 // N D[Gamma[1 - \[Lambda]/(1/2)]/((1/2)^\[Lambda] Gamma[1 - \[Lambda]]), {\[Lambda], 17}] /. \[Lambda] -> 0 // N Both give 3.71979*10^19. There might be some simple way to insert $\sigma$ into the limiting pdf but I haven't played with that yet.
Distribution with a given moment generating function There is an explicit density for $S_n$ when $\sigma=1/2$ and a limiting density of $$\frac{e^{-\frac{z}{2}-\frac{e^{-z}}{2}}}{\sqrt{2 \pi }}$$ (And there might be a general density for other values of
33,095
Distribution with a given moment generating function
Solution for the case $\sigma = 1/k$ with $k \in \mathbb{N}$ The answer of JimB for the case of $\sigma = 1/2$ can be adjusted in order to get to an expression for the cases $\sigma = 1/k$ where $k$ is an integer with $k \geq 2$. In terms of $k$, the moment generating function is $$ M(\lambda)=\frac{k^\lambda\Gamma(1-k \lambda)}{ \Gamma(1-\lambda)} = \frac{k^\lambda\Gamma(-k \lambda)\cdot(-k\lambda)}{ \Gamma(-\lambda)\cdot(-\lambda)} = \frac{k^{\lambda+1}\Gamma(-k \lambda)}{ \Gamma(-\lambda)} $$ For the derivation of the end result we will be using Gauss's multiplication formula and the generalized Gumbel distribution. Gauss's multiplication formula With Gauss's multiplication formula, we can write a gamma function with a parameter $k\lambda$ in terms of gamma functions with parameter $\lambda$ $$\Gamma(k\lambda) = k^{k\lambda -\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} \prod_{j=0}^{k-1} \Gamma\left(\frac{j}{k} + \lambda \right)$$ And when we take the $j=0$ term in the product to the left hand side and inverse the parameter (use $-\lambda$ instead of $\lambda$) $$\frac{\Gamma(-k\lambda)}{\Gamma(-\lambda)} = k^{-k\lambda -\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} \prod_{j=1}^{k-1} \Gamma\left( \frac{j}{k} - \lambda \right)$$ If we substitute this into the moment generating function then $$M(\lambda) = k^{\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} \prod_{j=1}^{k-1} \left( \frac{1}{k}\right)^{\lambda} \Gamma\left(\frac{j}{k} - \lambda \right) $$ Generalized Gumbel distribution The expression in the product is like the generalized Gumbel distribution $$f(x) = \frac{b^a}{\Gamma(a)} e^{-(ax+be^{-x})}$$ with moment generating function $$M(\lambda;a,b) = \frac{1}{\Gamma(a)}b^\lambda\Gamma(a-\lambda)$$ A description of this generalized Gumbel distribution occurs in Ahuja, J. C., and Stanley W. Nash. "The generalized Gompertz-Verhulst family of distributions." Sankhyā: The Indian Journal of Statistics, Series A (1967): 141-156. Sum of generalized Gumbel distributions The term $$\prod_{j=1}^{k-1} \left( \frac{1}{k}\right)^{\lambda} \Gamma\left(\frac{j}{k} - \lambda \right)$$ relates to a product of moment generating functions of the generalized Gumbel distribution with $a = j/k$ and $b=\frac{1}{k}$. This product of moment generating functions of the gumbel distribution will involve a constant based on a product of gamma functions which we can simplify with the multiplication formula $$\prod_{j=1}^{k-1} {\Gamma(j/k+z)} = (2\pi)^{\frac{ k-1}{2}} k^{1/2-kz} \frac{\Gamma(kz)}{\Gamma(z)} $$ setting $z=0$ $$\prod_{j=1}^{k-1} {\Gamma(j/k)} = (2\pi)^{\frac{ k-1}{2}} k^{1/2}$$ And the inverse $$\prod_{j=1}^{k-1} \frac{1} {\Gamma(j/k)} = (2\pi)^{\frac{1-k}{2}} k^{-1/2}$$ this equals $1/k$ times the constant $k^{\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} $ that we have in the moment generating function that we are looking for. So we can write $$ M(\lambda)=\frac{k^\lambda\Gamma(1-k \lambda)}{ \Gamma(1-\lambda)} = \frac{1}{k} \prod_{j=1}^{k-1} \frac{1} {\Gamma(j/k)} \left( \frac{1}{k}\right)^{\lambda} \Gamma\left(\frac{j}{k} - \lambda \right) $$ The product on the right-hand side is the product of the moment generating function of generalized Gumbel distributions with $a = j/k$ and $b=\frac{1}{k}$. The factor $1/k$ relates to a translation with a factor $-\log(k)$.
Distribution with a given moment generating function
Solution for the case $\sigma = 1/k$ with $k \in \mathbb{N}$ The answer of JimB for the case of $\sigma = 1/2$ can be adjusted in order to get to an expression for the cases $\sigma = 1/k$ where $k$ i
Distribution with a given moment generating function Solution for the case $\sigma = 1/k$ with $k \in \mathbb{N}$ The answer of JimB for the case of $\sigma = 1/2$ can be adjusted in order to get to an expression for the cases $\sigma = 1/k$ where $k$ is an integer with $k \geq 2$. In terms of $k$, the moment generating function is $$ M(\lambda)=\frac{k^\lambda\Gamma(1-k \lambda)}{ \Gamma(1-\lambda)} = \frac{k^\lambda\Gamma(-k \lambda)\cdot(-k\lambda)}{ \Gamma(-\lambda)\cdot(-\lambda)} = \frac{k^{\lambda+1}\Gamma(-k \lambda)}{ \Gamma(-\lambda)} $$ For the derivation of the end result we will be using Gauss's multiplication formula and the generalized Gumbel distribution. Gauss's multiplication formula With Gauss's multiplication formula, we can write a gamma function with a parameter $k\lambda$ in terms of gamma functions with parameter $\lambda$ $$\Gamma(k\lambda) = k^{k\lambda -\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} \prod_{j=0}^{k-1} \Gamma\left(\frac{j}{k} + \lambda \right)$$ And when we take the $j=0$ term in the product to the left hand side and inverse the parameter (use $-\lambda$ instead of $\lambda$) $$\frac{\Gamma(-k\lambda)}{\Gamma(-\lambda)} = k^{-k\lambda -\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} \prod_{j=1}^{k-1} \Gamma\left( \frac{j}{k} - \lambda \right)$$ If we substitute this into the moment generating function then $$M(\lambda) = k^{\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} \prod_{j=1}^{k-1} \left( \frac{1}{k}\right)^{\lambda} \Gamma\left(\frac{j}{k} - \lambda \right) $$ Generalized Gumbel distribution The expression in the product is like the generalized Gumbel distribution $$f(x) = \frac{b^a}{\Gamma(a)} e^{-(ax+be^{-x})}$$ with moment generating function $$M(\lambda;a,b) = \frac{1}{\Gamma(a)}b^\lambda\Gamma(a-\lambda)$$ A description of this generalized Gumbel distribution occurs in Ahuja, J. C., and Stanley W. Nash. "The generalized Gompertz-Verhulst family of distributions." Sankhyā: The Indian Journal of Statistics, Series A (1967): 141-156. Sum of generalized Gumbel distributions The term $$\prod_{j=1}^{k-1} \left( \frac{1}{k}\right)^{\lambda} \Gamma\left(\frac{j}{k} - \lambda \right)$$ relates to a product of moment generating functions of the generalized Gumbel distribution with $a = j/k$ and $b=\frac{1}{k}$. This product of moment generating functions of the gumbel distribution will involve a constant based on a product of gamma functions which we can simplify with the multiplication formula $$\prod_{j=1}^{k-1} {\Gamma(j/k+z)} = (2\pi)^{\frac{ k-1}{2}} k^{1/2-kz} \frac{\Gamma(kz)}{\Gamma(z)} $$ setting $z=0$ $$\prod_{j=1}^{k-1} {\Gamma(j/k)} = (2\pi)^{\frac{ k-1}{2}} k^{1/2}$$ And the inverse $$\prod_{j=1}^{k-1} \frac{1} {\Gamma(j/k)} = (2\pi)^{\frac{1-k}{2}} k^{-1/2}$$ this equals $1/k$ times the constant $k^{\frac{1}{2}} (2\pi)^{\frac{1-k}{2}} $ that we have in the moment generating function that we are looking for. So we can write $$ M(\lambda)=\frac{k^\lambda\Gamma(1-k \lambda)}{ \Gamma(1-\lambda)} = \frac{1}{k} \prod_{j=1}^{k-1} \frac{1} {\Gamma(j/k)} \left( \frac{1}{k}\right)^{\lambda} \Gamma\left(\frac{j}{k} - \lambda \right) $$ The product on the right-hand side is the product of the moment generating function of generalized Gumbel distributions with $a = j/k$ and $b=\frac{1}{k}$. The factor $1/k$ relates to a translation with a factor $-\log(k)$.
Distribution with a given moment generating function Solution for the case $\sigma = 1/k$ with $k \in \mathbb{N}$ The answer of JimB for the case of $\sigma = 1/2$ can be adjusted in order to get to an expression for the cases $\sigma = 1/k$ where $k$ i
33,096
Receptive field of neurons in LeNet
If you think about a convolutional net as an instance of a standard MLP, you can figure out the receptive fields in exactly the same way as the example you linked. Recall that a convolutional layer is essentially a shorthand for a layer with many repeated patterns, as in this image (from this answer, originally from here): Each of the "destination pixels" of that image corresponds to a neuron whose inputs are the blue square in the source image. Depending on your network architecture the convolutions may not exactly correspond to pixels like that, but it's the same idea. The weights used as inputs for all of those convolutional neurons are tied, but that's irrelevant to what you're thinking about here. Pooling neurons can be thought of in the same way, combining the receptive fields of each of their inputs.
Receptive field of neurons in LeNet
If you think about a convolutional net as an instance of a standard MLP, you can figure out the receptive fields in exactly the same way as the example you linked. Recall that a convolutional layer is
Receptive field of neurons in LeNet If you think about a convolutional net as an instance of a standard MLP, you can figure out the receptive fields in exactly the same way as the example you linked. Recall that a convolutional layer is essentially a shorthand for a layer with many repeated patterns, as in this image (from this answer, originally from here): Each of the "destination pixels" of that image corresponds to a neuron whose inputs are the blue square in the source image. Depending on your network architecture the convolutions may not exactly correspond to pixels like that, but it's the same idea. The weights used as inputs for all of those convolutional neurons are tied, but that's irrelevant to what you're thinking about here. Pooling neurons can be thought of in the same way, combining the receptive fields of each of their inputs.
Receptive field of neurons in LeNet If you think about a convolutional net as an instance of a standard MLP, you can figure out the receptive fields in exactly the same way as the example you linked. Recall that a convolutional layer is
33,097
Receptive field of neurons in LeNet
In Faster-rcnn, the effective receptive field can be calculated as follow (VGG16): Img-> Conv1(3)->Conv1(3)->Pool1(2) ==> Conv2(3)->Conv2(3)->Pool2(2) ==> Conv3(3)->Conv3(3)->Conv3(3)->Pool3(2) ==> Conv4(3)->Conv4(3)->Conv4(3)->Pool4(2) ==> Conv5(3)->Conv5(3)->Conv5(3) ====> a 3 * 3 window in feature map. Lets take one dimension for simplicity. If we derive back from size 3, the original receptive field: 1). in the beginning of Conv5: 3 + 2 + 2 + 2 = 9 2). in the beginning of Conv4: 9 * 2 + 2 + 2 + 2 = 24 3). in the beginning of Conv3: 24 * 2 + 2 + 2 + 2 = 54 4). in the beginning of Conv2: 54 * 2 + 2 + 2 = 112 5). in the beginning of Conv1 (original input): 112 * 2 + 2 + 2 = 228
Receptive field of neurons in LeNet
In Faster-rcnn, the effective receptive field can be calculated as follow (VGG16): Img-> Conv1(3)->Conv1(3)->Pool1(2) ==> Conv2(3)->Conv2(3)->Pool2(2) ==> Conv3(3)->Conv3(3)->Conv3(3)->Pool3(2) ==> Co
Receptive field of neurons in LeNet In Faster-rcnn, the effective receptive field can be calculated as follow (VGG16): Img-> Conv1(3)->Conv1(3)->Pool1(2) ==> Conv2(3)->Conv2(3)->Pool2(2) ==> Conv3(3)->Conv3(3)->Conv3(3)->Pool3(2) ==> Conv4(3)->Conv4(3)->Conv4(3)->Pool4(2) ==> Conv5(3)->Conv5(3)->Conv5(3) ====> a 3 * 3 window in feature map. Lets take one dimension for simplicity. If we derive back from size 3, the original receptive field: 1). in the beginning of Conv5: 3 + 2 + 2 + 2 = 9 2). in the beginning of Conv4: 9 * 2 + 2 + 2 + 2 = 24 3). in the beginning of Conv3: 24 * 2 + 2 + 2 + 2 = 54 4). in the beginning of Conv2: 54 * 2 + 2 + 2 = 112 5). in the beginning of Conv1 (original input): 112 * 2 + 2 + 2 = 228
Receptive field of neurons in LeNet In Faster-rcnn, the effective receptive field can be calculated as follow (VGG16): Img-> Conv1(3)->Conv1(3)->Pool1(2) ==> Conv2(3)->Conv2(3)->Pool2(2) ==> Conv3(3)->Conv3(3)->Conv3(3)->Pool3(2) ==> Co
33,098
R seasonal time series
Are you doing the regression on the data after you've removed the trend? You have a positive trend, and your seasonal signature is likely masked in your regression (variance due to trend, or error, is larger than due to month), unless you've accounted for the trend in Yvar... Also, I'm not terribly confident with time series, but shouldn't each observation be assigned a month, and your regression look something like this? lm(Yvar ~ Time + Month) Apologies if that makes no sense... Does regression make the most sense here?
R seasonal time series
Are you doing the regression on the data after you've removed the trend? You have a positive trend, and your seasonal signature is likely masked in your regression (variance due to trend, or error, is
R seasonal time series Are you doing the regression on the data after you've removed the trend? You have a positive trend, and your seasonal signature is likely masked in your regression (variance due to trend, or error, is larger than due to month), unless you've accounted for the trend in Yvar... Also, I'm not terribly confident with time series, but shouldn't each observation be assigned a month, and your regression look something like this? lm(Yvar ~ Time + Month) Apologies if that makes no sense... Does regression make the most sense here?
R seasonal time series Are you doing the regression on the data after you've removed the trend? You have a positive trend, and your seasonal signature is likely masked in your regression (variance due to trend, or error, is
33,099
R seasonal time series
In your graphical depiction of the time series, it is obvious that "trend"--a linear component in time--is the singlemost substantial contributor to the realization. We would comment that the most important aspect of this time series is the stable rise each month. After that, I would comment that the seasonal variation is miniscule by comparison. It is not surprising, therefore, with monthly measures taken over 6 years (a total of only 72 observations) the linear regression model fails to have the precision to identify any of the 11 month-contrasts as statistically significant. It is furthermore not surprising that the time effect does achieve statistical significance, because it is the same approximately consistent linear increase occurring over all 72 observations, conditional upon their seasonal effect. The lack of statistical significance for any of the 11 month contrasts does not mean that there are no seasonal effects. In fact, if you were to use a regression model to determine whether there is any seasonality, the appropriate test is the nested 11 degree of freedom test which simultaneously assesses the statistical significance of each month contrast. You would obtain such a test by conducting an ANOVA, likelihood ratio test, or robust Wald test. For instance: library(lmtest) model.mt <- lm(outcome ~ time + month) model.t <- lm(outcome ~ time) aov(model.mt, model.t) lrtest(model.mt, model.t) library(sandwich) ## autoregressive consistent robust standard errors waldtest(lrtest, lmtest, vcov.=function(x)vcovHAC(x))
R seasonal time series
In your graphical depiction of the time series, it is obvious that "trend"--a linear component in time--is the singlemost substantial contributor to the realization. We would comment that the most imp
R seasonal time series In your graphical depiction of the time series, it is obvious that "trend"--a linear component in time--is the singlemost substantial contributor to the realization. We would comment that the most important aspect of this time series is the stable rise each month. After that, I would comment that the seasonal variation is miniscule by comparison. It is not surprising, therefore, with monthly measures taken over 6 years (a total of only 72 observations) the linear regression model fails to have the precision to identify any of the 11 month-contrasts as statistically significant. It is furthermore not surprising that the time effect does achieve statistical significance, because it is the same approximately consistent linear increase occurring over all 72 observations, conditional upon their seasonal effect. The lack of statistical significance for any of the 11 month contrasts does not mean that there are no seasonal effects. In fact, if you were to use a regression model to determine whether there is any seasonality, the appropriate test is the nested 11 degree of freedom test which simultaneously assesses the statistical significance of each month contrast. You would obtain such a test by conducting an ANOVA, likelihood ratio test, or robust Wald test. For instance: library(lmtest) model.mt <- lm(outcome ~ time + month) model.t <- lm(outcome ~ time) aov(model.mt, model.t) lrtest(model.mt, model.t) library(sandwich) ## autoregressive consistent robust standard errors waldtest(lrtest, lmtest, vcov.=function(x)vcovHAC(x))
R seasonal time series In your graphical depiction of the time series, it is obvious that "trend"--a linear component in time--is the singlemost substantial contributor to the realization. We would comment that the most imp
33,100
R seasonal time series
I don't know if it's your case, but that happened to me when I started analyzing time series in R and the issue was that I hadn't correctly stated the time series period when creating the time series object to decompose it. There is a parameter in the time series function that lets you specify its frequency. Doing so, it correctly decomposes its seasonal trends.
R seasonal time series
I don't know if it's your case, but that happened to me when I started analyzing time series in R and the issue was that I hadn't correctly stated the time series period when creating the time series
R seasonal time series I don't know if it's your case, but that happened to me when I started analyzing time series in R and the issue was that I hadn't correctly stated the time series period when creating the time series object to decompose it. There is a parameter in the time series function that lets you specify its frequency. Doing so, it correctly decomposes its seasonal trends.
R seasonal time series I don't know if it's your case, but that happened to me when I started analyzing time series in R and the issue was that I hadn't correctly stated the time series period when creating the time series