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
26,701
Optimal number of components in a Gaussian mixture
Just some extension to Dikran Marsupial's comment (cross-validation). The main idea is to split your data into training and validation sets in some way, try different number of components and select the best based on the corresponding training and validation likelihood values. The likelihood for GMM is just $p(x|\pi,\mu,\Sigma)=\sum_K\pi_kN(x|\mu_k,\Sigma_k)$ by definition, where $K$ is the number of components (clusters) and $\pi$,$\mu$,$\Sigma$ are model parameters. By changing the value of $K$ you can plot the GMM likelihood for training and validation sets like the following. In this example it should be obvious that the optimal number of components is around 20. There's nice video about this on Coursera, and it's where I got the above picture from. Another commonly used the method is the Bayesian information criterion (BIC): $$BIC = -2\log(L)+K\log(n)$$ where $L$ is the likelihood, K the number of parameters and $n$ the number of data points. It can be understood as adding a penalty for the number of parameters to the log likelihood.
Optimal number of components in a Gaussian mixture
Just some extension to Dikran Marsupial's comment (cross-validation). The main idea is to split your data into training and validation sets in some way, try different number of components and select t
Optimal number of components in a Gaussian mixture Just some extension to Dikran Marsupial's comment (cross-validation). The main idea is to split your data into training and validation sets in some way, try different number of components and select the best based on the corresponding training and validation likelihood values. The likelihood for GMM is just $p(x|\pi,\mu,\Sigma)=\sum_K\pi_kN(x|\mu_k,\Sigma_k)$ by definition, where $K$ is the number of components (clusters) and $\pi$,$\mu$,$\Sigma$ are model parameters. By changing the value of $K$ you can plot the GMM likelihood for training and validation sets like the following. In this example it should be obvious that the optimal number of components is around 20. There's nice video about this on Coursera, and it's where I got the above picture from. Another commonly used the method is the Bayesian information criterion (BIC): $$BIC = -2\log(L)+K\log(n)$$ where $L$ is the likelihood, K the number of parameters and $n$ the number of data points. It can be understood as adding a penalty for the number of parameters to the log likelihood.
Optimal number of components in a Gaussian mixture Just some extension to Dikran Marsupial's comment (cross-validation). The main idea is to split your data into training and validation sets in some way, try different number of components and select t
26,702
Hypothesis testing on the inverse covariance matrix
Beran and Srivastava (1985, Annals of Statistics) had a paper where they proposed a general bootstrap approach to apply a rotation to the covariance matrix that make it match the distribution under the null. @cardinal's point about existence of such a matrix is highly relevant here though. You need to be able to come up with at least some sort of approximation for a matrix that satisfies the constraints you impose under the null. Chen, Variyath and Bovas had a paper on adjusted empirical likelihood where they demonstrated how it can be used to test a rather weird structure on the covariance matrix. I think this paper eventually came out in CJS.
Hypothesis testing on the inverse covariance matrix
Beran and Srivastava (1985, Annals of Statistics) had a paper where they proposed a general bootstrap approach to apply a rotation to the covariance matrix that make it match the distribution under th
Hypothesis testing on the inverse covariance matrix Beran and Srivastava (1985, Annals of Statistics) had a paper where they proposed a general bootstrap approach to apply a rotation to the covariance matrix that make it match the distribution under the null. @cardinal's point about existence of such a matrix is highly relevant here though. You need to be able to come up with at least some sort of approximation for a matrix that satisfies the constraints you impose under the null. Chen, Variyath and Bovas had a paper on adjusted empirical likelihood where they demonstrated how it can be used to test a rather weird structure on the covariance matrix. I think this paper eventually came out in CJS.
Hypothesis testing on the inverse covariance matrix Beran and Srivastava (1985, Annals of Statistics) had a paper where they proposed a general bootstrap approach to apply a rotation to the covariance matrix that make it match the distribution under th
26,703
Gini coefficient and error bounds
One problem will be that with this small sample size and a complex statistic (gini coefficient) the probability distribution of your statistic will certainly not be approximately normal, so the "standard error" may be misleading if you intend to use it to create confidence intervals or hypothesis testing relying on normality. I would have thought a percentile bootstrap would be a better method, and simpler to implement. For example: > library(reldist) # just for the gini() function > library(boot) # for the boot() function > x <- c(1,2,2,3,4,99) > gini(x) [1] 0.7462462 # check get same result as in your question > y <- boot(x, gini, 500) > quantile(y$t, probs=c(0.025, 0.975)) 2.5% 97.5% 0.6353158 0.7717868 > plot(density(y$t)) I haven't attached the plot generated by the end but it shows that the confidence interval is very assymetric, so using a method like +/- 1.96*se for a confidence interval will be misleading. I'm not a fan of jackknife methods for confidence intervals mainly for this reason; jackknife was invented as a bias reduction technique for point estimates, whereas confidence intervals are intrinsic to the whole idea of the bootstrap.
Gini coefficient and error bounds
One problem will be that with this small sample size and a complex statistic (gini coefficient) the probability distribution of your statistic will certainly not be approximately normal, so the "stand
Gini coefficient and error bounds One problem will be that with this small sample size and a complex statistic (gini coefficient) the probability distribution of your statistic will certainly not be approximately normal, so the "standard error" may be misleading if you intend to use it to create confidence intervals or hypothesis testing relying on normality. I would have thought a percentile bootstrap would be a better method, and simpler to implement. For example: > library(reldist) # just for the gini() function > library(boot) # for the boot() function > x <- c(1,2,2,3,4,99) > gini(x) [1] 0.7462462 # check get same result as in your question > y <- boot(x, gini, 500) > quantile(y$t, probs=c(0.025, 0.975)) 2.5% 97.5% 0.6353158 0.7717868 > plot(density(y$t)) I haven't attached the plot generated by the end but it shows that the confidence interval is very assymetric, so using a method like +/- 1.96*se for a confidence interval will be misleading. I'm not a fan of jackknife methods for confidence intervals mainly for this reason; jackknife was invented as a bias reduction technique for point estimates, whereas confidence intervals are intrinsic to the whole idea of the bootstrap.
Gini coefficient and error bounds One problem will be that with this small sample size and a complex statistic (gini coefficient) the probability distribution of your statistic will certainly not be approximately normal, so the "stand
26,704
Advice For Graduate Students in Statistics
I recently finished my PhD, and I have some thoughts in regard to writing papers. I have to mention that I worked in the Dutch system where we have 4 years to complete our PhD, and I got a normal salary, competetive with industry starting salaries. The norm in the Dutch system is to write around 4 papers in those 4 years. How many paper one can write also depends on the structure of your contract. If you have to follow many courses, or be a teaching assistent to get money, or have just 3 years, the number of papers is lower. I did not write a traditional thesis, I used my papers as is and wrote an introduction and summary. I like this "collection of papers" approach because you focus on writing papers, not on a phd thesis that is probably not going to be read alot (at least for most of us :)). For a further career in science publications are important. In terms of which journals to publish, I would say those you like reading yourself. Reaching an audience that shares your interest can get you citations. In terms of impact factor I would go for the highest IF that is still relevant for your field. I would also defintely consider open access journals such as those from the EGU. In this anyone, also from africa, can read your work without making some publisher rich...
Advice For Graduate Students in Statistics
I recently finished my PhD, and I have some thoughts in regard to writing papers. I have to mention that I worked in the Dutch system where we have 4 years to complete our PhD, and I got a normal sala
Advice For Graduate Students in Statistics I recently finished my PhD, and I have some thoughts in regard to writing papers. I have to mention that I worked in the Dutch system where we have 4 years to complete our PhD, and I got a normal salary, competetive with industry starting salaries. The norm in the Dutch system is to write around 4 papers in those 4 years. How many paper one can write also depends on the structure of your contract. If you have to follow many courses, or be a teaching assistent to get money, or have just 3 years, the number of papers is lower. I did not write a traditional thesis, I used my papers as is and wrote an introduction and summary. I like this "collection of papers" approach because you focus on writing papers, not on a phd thesis that is probably not going to be read alot (at least for most of us :)). For a further career in science publications are important. In terms of which journals to publish, I would say those you like reading yourself. Reaching an audience that shares your interest can get you citations. In terms of impact factor I would go for the highest IF that is still relevant for your field. I would also defintely consider open access journals such as those from the EGU. In this anyone, also from africa, can read your work without making some publisher rich...
Advice For Graduate Students in Statistics I recently finished my PhD, and I have some thoughts in regard to writing papers. I have to mention that I worked in the Dutch system where we have 4 years to complete our PhD, and I got a normal sala
26,705
Distribution of the difference of two independent uniform variables, truncated at 0
Check p. 18 of Probability Distributions as Program Variables, by Dimitrios Milios. He has discussed the problem in an fairly detailed manner.
Distribution of the difference of two independent uniform variables, truncated at 0
Check p. 18 of Probability Distributions as Program Variables, by Dimitrios Milios. He has discussed the problem in an fairly detailed manner.
Distribution of the difference of two independent uniform variables, truncated at 0 Check p. 18 of Probability Distributions as Program Variables, by Dimitrios Milios. He has discussed the problem in an fairly detailed manner.
Distribution of the difference of two independent uniform variables, truncated at 0 Check p. 18 of Probability Distributions as Program Variables, by Dimitrios Milios. He has discussed the problem in an fairly detailed manner.
26,706
Why do people use the term "weight of evidence" and how does it differ from "pointwise mutual information"?
Even though they look similar, they are quite different things. Let's start with the major differences. $h$ is something different in PMI and in WOE Notice the term $p(h)$ in PMI. This implies that $h$ is a random variable of which you can compute the probability. For a Bayesian, that's no problem, but if you do not believe that hypotheses can have a probability a priori you cannot even write PMI for hypothesis and evidence. In WOE, $h$ is a parameter of the distribution and the expressions are always defined. PMI is symmetric, WOE is not Trivially, $pmi(e,h) = pmi(h,e)$. However, $w(h:e) = \log p(h|e)/p(h|\bar{e})$ need not be defined because of the term $\bar{e}$. Even when it is, it is in general not equal to $w(e:h)$. Other than that, WOE and PMI have similarities. The weight of evidence says how much the evidence speaks in favor of a hypothesis. If it is 0, it means that it neither speaks for nor against. The higher it is, the more it validates hypothesis $h$, and the lower it is, the more it validates $\bar{h}$. Mutual information quantifies how the occurrence of an event ($e$ or $h$) says something about the occurrence of the other event. If it is 0, the events are independent and the occurrence of one says nothing about the other. The higher it is the more often they co-occur, and the lower it is the more they are mutually exclusive. What about the cases where the hypothesis $h$ is also a random variable and both options are valid? For example in communiction over a binary noisy channel, the hypothesis is $h$ the emitted signal to decode and the evidence is the received signal. Say that the probability of flipping is $1/1000$, so if you receive a $1$, the WOE for $1$ is $\log 0.999/0.001 = 6.90$. The PMI, on the other hand, depends on the proability of emitting a $1$. You can verify that when the probability of emitting a $1$ tends to 0, the PMI tends to $6.90$, while it tends to $0$ when the probability of emitting a $1$ tends to $1$. This paradoxical behavior illustrates two things: None of them is suitable to make a guess about the emission. If the probability of emitting a $1$ drops below $1/1000$, the most likely emission is $0$ even when receiving a $1$. However, for small probabilities of emitting a $1$ both WOE and PMI are close to $6.90$. PMI is a gain of (Shannon's) information over the realization of the hypothesis, if the hypothesis is almost sure, then no information is gained. WOE is an update of our prior odds, which does not depend on the value of those odds.
Why do people use the term "weight of evidence" and how does it differ from "pointwise mutual inform
Even though they look similar, they are quite different things. Let's start with the major differences. $h$ is something different in PMI and in WOE Notice the term $p(h)$ in PMI. This implies that $
Why do people use the term "weight of evidence" and how does it differ from "pointwise mutual information"? Even though they look similar, they are quite different things. Let's start with the major differences. $h$ is something different in PMI and in WOE Notice the term $p(h)$ in PMI. This implies that $h$ is a random variable of which you can compute the probability. For a Bayesian, that's no problem, but if you do not believe that hypotheses can have a probability a priori you cannot even write PMI for hypothesis and evidence. In WOE, $h$ is a parameter of the distribution and the expressions are always defined. PMI is symmetric, WOE is not Trivially, $pmi(e,h) = pmi(h,e)$. However, $w(h:e) = \log p(h|e)/p(h|\bar{e})$ need not be defined because of the term $\bar{e}$. Even when it is, it is in general not equal to $w(e:h)$. Other than that, WOE and PMI have similarities. The weight of evidence says how much the evidence speaks in favor of a hypothesis. If it is 0, it means that it neither speaks for nor against. The higher it is, the more it validates hypothesis $h$, and the lower it is, the more it validates $\bar{h}$. Mutual information quantifies how the occurrence of an event ($e$ or $h$) says something about the occurrence of the other event. If it is 0, the events are independent and the occurrence of one says nothing about the other. The higher it is the more often they co-occur, and the lower it is the more they are mutually exclusive. What about the cases where the hypothesis $h$ is also a random variable and both options are valid? For example in communiction over a binary noisy channel, the hypothesis is $h$ the emitted signal to decode and the evidence is the received signal. Say that the probability of flipping is $1/1000$, so if you receive a $1$, the WOE for $1$ is $\log 0.999/0.001 = 6.90$. The PMI, on the other hand, depends on the proability of emitting a $1$. You can verify that when the probability of emitting a $1$ tends to 0, the PMI tends to $6.90$, while it tends to $0$ when the probability of emitting a $1$ tends to $1$. This paradoxical behavior illustrates two things: None of them is suitable to make a guess about the emission. If the probability of emitting a $1$ drops below $1/1000$, the most likely emission is $0$ even when receiving a $1$. However, for small probabilities of emitting a $1$ both WOE and PMI are close to $6.90$. PMI is a gain of (Shannon's) information over the realization of the hypothesis, if the hypothesis is almost sure, then no information is gained. WOE is an update of our prior odds, which does not depend on the value of those odds.
Why do people use the term "weight of evidence" and how does it differ from "pointwise mutual inform Even though they look similar, they are quite different things. Let's start with the major differences. $h$ is something different in PMI and in WOE Notice the term $p(h)$ in PMI. This implies that $
26,707
Is sample mean the "best" estimation of distribution mean in some sense?
The answer to your second question is yes: The sample mean is a minimum contrast estimator when your function $l_0$ is $(x-u)^2$, when x and u are real numbers, or $(x-u)'(x-u)$, when x and u are column vectors. This follows from least-squares theory or differential calculus. A minimum contrast estimator is, under certain technical conditions, both consistent and asymptotically normal. For the sample mean, this already follows from the LLN and the central limit theorem. I don't know that minimum contrast estimators are "optimal" in any way. What's nice about minimum contrast estimators is that many robust estimators (e.g. the median, Huber estimators, sample quantiles) fall into this family, and we can conclude that they are consistent and asymptotically normal just by applying the general theorem for minimum contrast estimators, so long as we check some technical conditions (though often this is much difficult than it sounds). One notion of optimality that you don't mention in your question is efficiency which, roughly speaking, is about how large a sample you need to get an estimate of a certain quality. See http://en.wikipedia.org/wiki/Efficiency_(statistics)#Asymptotic_efficiency for a comparison of the efficiency of mean and median (mean is more efficient, but the median is more robust to outliers). For the third question, without some restriction on the set of functions f over which you are finding the argmin, I don't think the sample mean will be optimal. For any distribution P, you can fix f to be a constant that ignores the $x_i$'s and minimizes the loss for the particular P. Sample mean can't beat that. Minimax optimality is a weaker condition than the one you give: instead of asking that $f^*$ be the best function for any $P$ in a class, you can ask that $f^*$ have the best worst-case performance. That is, between the argmin and the expectation, put in a $\max_{P\in F}$. Bayesian optimality is another approach: put a prior distribution on $P\in F$, and take the expectation over $P$ as well as the sample from $P$.
Is sample mean the "best" estimation of distribution mean in some sense?
The answer to your second question is yes: The sample mean is a minimum contrast estimator when your function $l_0$ is $(x-u)^2$, when x and u are real numbers, or $(x-u)'(x-u)$, when x and u are colu
Is sample mean the "best" estimation of distribution mean in some sense? The answer to your second question is yes: The sample mean is a minimum contrast estimator when your function $l_0$ is $(x-u)^2$, when x and u are real numbers, or $(x-u)'(x-u)$, when x and u are column vectors. This follows from least-squares theory or differential calculus. A minimum contrast estimator is, under certain technical conditions, both consistent and asymptotically normal. For the sample mean, this already follows from the LLN and the central limit theorem. I don't know that minimum contrast estimators are "optimal" in any way. What's nice about minimum contrast estimators is that many robust estimators (e.g. the median, Huber estimators, sample quantiles) fall into this family, and we can conclude that they are consistent and asymptotically normal just by applying the general theorem for minimum contrast estimators, so long as we check some technical conditions (though often this is much difficult than it sounds). One notion of optimality that you don't mention in your question is efficiency which, roughly speaking, is about how large a sample you need to get an estimate of a certain quality. See http://en.wikipedia.org/wiki/Efficiency_(statistics)#Asymptotic_efficiency for a comparison of the efficiency of mean and median (mean is more efficient, but the median is more robust to outliers). For the third question, without some restriction on the set of functions f over which you are finding the argmin, I don't think the sample mean will be optimal. For any distribution P, you can fix f to be a constant that ignores the $x_i$'s and minimizes the loss for the particular P. Sample mean can't beat that. Minimax optimality is a weaker condition than the one you give: instead of asking that $f^*$ be the best function for any $P$ in a class, you can ask that $f^*$ have the best worst-case performance. That is, between the argmin and the expectation, put in a $\max_{P\in F}$. Bayesian optimality is another approach: put a prior distribution on $P\in F$, and take the expectation over $P$ as well as the sample from $P$.
Is sample mean the "best" estimation of distribution mean in some sense? The answer to your second question is yes: The sample mean is a minimum contrast estimator when your function $l_0$ is $(x-u)^2$, when x and u are real numbers, or $(x-u)'(x-u)$, when x and u are colu
26,708
Adjusted vs. unadjusted effects in regression
Since based on the comments "Yes" isn't long enough to be an answer: Yes. When a regression reports an unadjusted estimate, it's just a regression of X on Y with no other covariates. An adjusted estimate is the same regression of X on Y in the presence of at least one covariate.
Adjusted vs. unadjusted effects in regression
Since based on the comments "Yes" isn't long enough to be an answer: Yes. When a regression reports an unadjusted estimate, it's just a regression of X on Y with no other covariates. An adjusted estim
Adjusted vs. unadjusted effects in regression Since based on the comments "Yes" isn't long enough to be an answer: Yes. When a regression reports an unadjusted estimate, it's just a regression of X on Y with no other covariates. An adjusted estimate is the same regression of X on Y in the presence of at least one covariate.
Adjusted vs. unadjusted effects in regression Since based on the comments "Yes" isn't long enough to be an answer: Yes. When a regression reports an unadjusted estimate, it's just a regression of X on Y with no other covariates. An adjusted estim
26,709
Adjusted vs. unadjusted effects in regression
Crude estimate is obtained when you are considering the effect of only one independent (predictor) variable, i.e your equation consists of only one independent variable. When you include more independent variables in the analysis (confounder variables) you will get what is called and adjusted estimate, which takes into account the effect due to all the additional independent variables included in the analysis.
Adjusted vs. unadjusted effects in regression
Crude estimate is obtained when you are considering the effect of only one independent (predictor) variable, i.e your equation consists of only one independent variable. When you include more independ
Adjusted vs. unadjusted effects in regression Crude estimate is obtained when you are considering the effect of only one independent (predictor) variable, i.e your equation consists of only one independent variable. When you include more independent variables in the analysis (confounder variables) you will get what is called and adjusted estimate, which takes into account the effect due to all the additional independent variables included in the analysis.
Adjusted vs. unadjusted effects in regression Crude estimate is obtained when you are considering the effect of only one independent (predictor) variable, i.e your equation consists of only one independent variable. When you include more independ
26,710
Adjusted vs. unadjusted effects in regression
All above is true, I just want to add that the adjusted is when you consider multiple covariants or independent variables (for example: X1, X2, X3, X4), set them all constant at their 'Mean Value' except one Independent variable (X1) to capture the relationship between this one independent variable and the dependent variable (X1 and Y).
Adjusted vs. unadjusted effects in regression
All above is true, I just want to add that the adjusted is when you consider multiple covariants or independent variables (for example: X1, X2, X3, X4), set them all constant at their 'Mean Value' exc
Adjusted vs. unadjusted effects in regression All above is true, I just want to add that the adjusted is when you consider multiple covariants or independent variables (for example: X1, X2, X3, X4), set them all constant at their 'Mean Value' except one Independent variable (X1) to capture the relationship between this one independent variable and the dependent variable (X1 and Y).
Adjusted vs. unadjusted effects in regression All above is true, I just want to add that the adjusted is when you consider multiple covariants or independent variables (for example: X1, X2, X3, X4), set them all constant at their 'Mean Value' exc
26,711
Designing a test for a psychic who says he can influence dice rolls
I would recommend analyzing this in the following way: Count each role in which George successfully predicts the outcome as a success, and every other one as a failure. Then, you easily calculate a probability of success for George, and a 95% or 99% confidence interval. Does he claim he can predict the outcome "twice as well" as randomly rolling the dice? Then: H0: p >= 1/3 H1: p < 1/3 (assuming a 6-sided die). From there, it's pretty straightforward to do the hypothesis test. Also, you can calculate the power a priori pretty easily (even in something like Excel). Pick a number of rolls (like 10), and then make a table with the possible successes as rows (0-10). Then, for each success, calculate the probability he'll have that many successes (if he were to be just guessing, which is what we're assuming he is doing). Also, for each value, determine if it would lead to a rejection or acceptance of the null. Then, to find the power, you can simply add up all the probabilities where the null would be rejected.
Designing a test for a psychic who says he can influence dice rolls
I would recommend analyzing this in the following way: Count each role in which George successfully predicts the outcome as a success, and every other one as a failure. Then, you easily calculate a p
Designing a test for a psychic who says he can influence dice rolls I would recommend analyzing this in the following way: Count each role in which George successfully predicts the outcome as a success, and every other one as a failure. Then, you easily calculate a probability of success for George, and a 95% or 99% confidence interval. Does he claim he can predict the outcome "twice as well" as randomly rolling the dice? Then: H0: p >= 1/3 H1: p < 1/3 (assuming a 6-sided die). From there, it's pretty straightforward to do the hypothesis test. Also, you can calculate the power a priori pretty easily (even in something like Excel). Pick a number of rolls (like 10), and then make a table with the possible successes as rows (0-10). Then, for each success, calculate the probability he'll have that many successes (if he were to be just guessing, which is what we're assuming he is doing). Also, for each value, determine if it would lead to a rejection or acceptance of the null. Then, to find the power, you can simply add up all the probabilities where the null would be rejected.
Designing a test for a psychic who says he can influence dice rolls I would recommend analyzing this in the following way: Count each role in which George successfully predicts the outcome as a success, and every other one as a failure. Then, you easily calculate a p
26,712
Designing a test for a psychic who says he can influence dice rolls
A D20 will require more rolls for the same significance level for George succeeding for sure if you need to run the chi-square test. I don't think you need to run the full chis-square test though. You just need to check whether the dice rolls the "chosen" number more often than chance. I would just use the cdf of the binomial to calculate the p-value of rolling the chosen number more often than chance with $\theta=\frac{1}{6}$ as the binomial parameter for D6. I think it is easy to determine the number $X$ based upon the p-value you need for George succeeding. I am not even sure you need Z sessions. Why not just run one session for each side of the die. Does randomizing the chosen side even matter for the hypotheses you are interested in?
Designing a test for a psychic who says he can influence dice rolls
A D20 will require more rolls for the same significance level for George succeeding for sure if you need to run the chi-square test. I don't think you need to run the full chis-square test though. You
Designing a test for a psychic who says he can influence dice rolls A D20 will require more rolls for the same significance level for George succeeding for sure if you need to run the chi-square test. I don't think you need to run the full chis-square test though. You just need to check whether the dice rolls the "chosen" number more often than chance. I would just use the cdf of the binomial to calculate the p-value of rolling the chosen number more often than chance with $\theta=\frac{1}{6}$ as the binomial parameter for D6. I think it is easy to determine the number $X$ based upon the p-value you need for George succeeding. I am not even sure you need Z sessions. Why not just run one session for each side of the die. Does randomizing the chosen side even matter for the hypotheses you are interested in?
Designing a test for a psychic who says he can influence dice rolls A D20 will require more rolls for the same significance level for George succeeding for sure if you need to run the chi-square test. I don't think you need to run the full chis-square test though. You
26,713
Cluster Analysis followed by Discriminant Analysis
I don't know of any papers on this. I've used this approach, for descriptive purposes. DFA provides a nice way to summarize group differences and dimensionality with respect to the original variables. One might more easily just profile the groups on the original variables, however, this loses the inherently multivariate nature of the clustering problem. DFA allows you to describe the groups while keeping the multivariate character of the problem intact. So, it can assist with the interpretation of the clusters, where that is a goal. This is particularly ideal when there is a close relationship between your clustering method and your classification method--e.g., DFA and Ward's method. You are right about the testing problem. I published a paper using the Cluster Analysis with DFA follow-up to describe the clustering solution. I presented the DFA results with no test statistics. A reviewer took issue with that. I conceded and put the test statistics and p values in there, with the disclaimer that these p-values should not be interpreted in the traditional manner.
Cluster Analysis followed by Discriminant Analysis
I don't know of any papers on this. I've used this approach, for descriptive purposes. DFA provides a nice way to summarize group differences and dimensionality with respect to the original variable
Cluster Analysis followed by Discriminant Analysis I don't know of any papers on this. I've used this approach, for descriptive purposes. DFA provides a nice way to summarize group differences and dimensionality with respect to the original variables. One might more easily just profile the groups on the original variables, however, this loses the inherently multivariate nature of the clustering problem. DFA allows you to describe the groups while keeping the multivariate character of the problem intact. So, it can assist with the interpretation of the clusters, where that is a goal. This is particularly ideal when there is a close relationship between your clustering method and your classification method--e.g., DFA and Ward's method. You are right about the testing problem. I published a paper using the Cluster Analysis with DFA follow-up to describe the clustering solution. I presented the DFA results with no test statistics. A reviewer took issue with that. I conceded and put the test statistics and p values in there, with the disclaimer that these p-values should not be interpreted in the traditional manner.
Cluster Analysis followed by Discriminant Analysis I don't know of any papers on this. I've used this approach, for descriptive purposes. DFA provides a nice way to summarize group differences and dimensionality with respect to the original variable
26,714
Relationship between overfitting and robustness to outliers
How does a model become "robust to outliers"? It does so by acknowledging their presence in the specification of the model, by using a noise model that contains outliers. In probabilistic modeling, this may be achieved by assuming some kind of fat-tailed noise distribution. From an optimization perspective, the same thing can be achieved by using an "outlier-robust cost function" (such as the Huber loss function). Note that there is an equivalence between these two worlds, e.g., whereas L2 norm error minimization corresponds to the assumption of Gaussian noise, L1 norm error minimization (which is more robust to outliers) corresponds to the assumption of Laplacian noise. To summarize, robustness to outliers has nothing to do with the model of the process itself; it depends only on the correctness of the noise model. How does a model become "robust to overfitting"? Overfitting is a symptom of model mismatch: the process model is too flexible and the noise model is incorrect. If we knew exactly what level of measurement noise to expect, even a very flexible model would not overfit. In practice, robustness to overfitting is achieved by using a flexible model class but biasing the model towards simpler explanations by means of regularization (using a prior over the parameters or, equivalently, an L1/L2 regularization term). What's the relation of the two properties? Use a flexible model class without appropriate parameter priors or regularization and assume a fat-tailed noise distribution or a robust loss function, and you have an inference procedure that is robust to outliers but not to overfitting. Use an appropriate regularization term but usual L2 error minimization, and you have a method that is robust to overfitting but not to outliers. The two properties are orthogonal to each other, since they relate to different components of the assumed statistical model: robustness to outliers depends on the correctness of the noise model / error loss function, whereas robustness to overfitting depends on the correctness of the parameter priors / regularization term.
Relationship between overfitting and robustness to outliers
How does a model become "robust to outliers"? It does so by acknowledging their presence in the specification of the model, by using a noise model that contains outliers. In probabilistic modeling, th
Relationship between overfitting and robustness to outliers How does a model become "robust to outliers"? It does so by acknowledging their presence in the specification of the model, by using a noise model that contains outliers. In probabilistic modeling, this may be achieved by assuming some kind of fat-tailed noise distribution. From an optimization perspective, the same thing can be achieved by using an "outlier-robust cost function" (such as the Huber loss function). Note that there is an equivalence between these two worlds, e.g., whereas L2 norm error minimization corresponds to the assumption of Gaussian noise, L1 norm error minimization (which is more robust to outliers) corresponds to the assumption of Laplacian noise. To summarize, robustness to outliers has nothing to do with the model of the process itself; it depends only on the correctness of the noise model. How does a model become "robust to overfitting"? Overfitting is a symptom of model mismatch: the process model is too flexible and the noise model is incorrect. If we knew exactly what level of measurement noise to expect, even a very flexible model would not overfit. In practice, robustness to overfitting is achieved by using a flexible model class but biasing the model towards simpler explanations by means of regularization (using a prior over the parameters or, equivalently, an L1/L2 regularization term). What's the relation of the two properties? Use a flexible model class without appropriate parameter priors or regularization and assume a fat-tailed noise distribution or a robust loss function, and you have an inference procedure that is robust to outliers but not to overfitting. Use an appropriate regularization term but usual L2 error minimization, and you have a method that is robust to overfitting but not to outliers. The two properties are orthogonal to each other, since they relate to different components of the assumed statistical model: robustness to outliers depends on the correctness of the noise model / error loss function, whereas robustness to overfitting depends on the correctness of the parameter priors / regularization term.
Relationship between overfitting and robustness to outliers How does a model become "robust to outliers"? It does so by acknowledging their presence in the specification of the model, by using a noise model that contains outliers. In probabilistic modeling, th
26,715
Relationship between overfitting and robustness to outliers
Interesting questions posed. I will address the two questions for the use case of statistical classifiers in order to demarcate the analysis to a model domain we can oversee. Before embarking onto an elaborate answer I do want to discuss the definition of Robustness. Different definitions have been given for the concept of robustness. One can discuss model robustness - as opposed to outcome robustness. Model robustness means that your general model outcome - and hence the distribution of its predictions - that they are less sensitive or even insensitive to an increasing amount of extreme values in the training set. Outcome robustness, on the other hand, refers to the (in)sensitivity to increasing noise levels in the input variables with respect to one specific predicted outcome. I assume that you address model robustness in your questions. To address the first question, we need to make a distinction between classifiers that use a global or local distance measure to model (probability of) class dependency, and distribution-free classifiers. Discriminant analysis, k-nearest neighbor classifier, neural networks, support vector machines - they all calculate some sort of distance between parameter vectors and the input vector provided. They all use some sort of distance measure. It should be added that nonlinear neural networks and SVMs use nonlinearity to globally bend and stretch the concept of distance (neural networks are universal approximators, as proved and published by Hornik in 1989). 'Distribution-free' classifiers ID3/C4.5 decision trees, CART, the histogram classifier, the multinomial classifier - these classifiers do not apply any distance measure. They are so-called nonparametric in their way of working. This having said, they are based on count distributions - hence the binomial distribution and the multinomial distribution, and nonparametric classifiers are governed by the statistics of these distributions. However, as the only thing that matters is whether the observed value of an input variable occurs in a specific bin/interval or not, they are by nature insensitive to extreme observations. This holds when the intervals of input variable bins to the leftmost and rightmost side are open. So these classifiers are certainly model robust. Noise characteristics and outliers Extreme values are one kind of noise. A scatter around a zero mean is the most common kind of noise that occurs in practice. This image illustrates scatter noise (left) and salt-and-pepper noise (right). Your robustness questions relate to the right-hand kind of noise. Analysis We can combine the true value of classifier input $i$, $z(i)$ with scatter noise $\epsilon$, and an outlier offset $e$ as $ x(i) = z(i) + \epsilon + e \cdot \delta(\alpha) $ with $\delta(\alpha)$ the Kronecker delta function governed by the parameter $\alpha$. The parametrized delta-function determines whether the outlier offset is being added, or not. The probability $P(\delta(\alpha)=1) \ll 1$, whereas the zero-mean scatter is always present. If for example $P(\delta(\alpha)=1) = \frac{1}{2}$, we do not speak of outliers anymore - they become common noise additive offsets. Note also that distance is intrinsic to the definition of the concept outlier. The observed class labels themselves in a training set cannot be subject to outliers, as follows from the required notion of distance. Distance based classifiers generally use the L2-norm $\mid \mid {\bf x} \mid \mid_2$ to calculate degree of fit. This norm is well-chosen for scatter noise. When it comes to extreme values (outliers), their influence increases with the power of $2$, and of course with $P(\delta(\alpha)=1)$. As nonparametric classifiers use different criteria to select the optimal set of parameters, they are insensitive to extreme value noise like salt-and-pepper. Again, the type of classifier determines the robustness to outliers. Overfitting The issue with overfitting occurs when classifiers become 'too rich' in parameters. In that situation learning triggers that all kinds of small loops around wrongly labeled cases in the training set are being made. Once the classifier is applied to a (new) test set, a poor model performance is seen. Such overgeneralization loops tend to include points pushed just across class boundaries by scatter noise $\epsilon$. It is highly unlikely that an outlier value, which has no similar neighboring points, is included in such a loop. This because of the locally rigid nature of (distance-based) classifiers - and because closely grouped points can push or pull a decision boundary, which one observation in its own cannot do. Overfitting generally happens between classes because the decision boundaries of any given classifier become too flexible. Decision boundaries are generally drawn in more crowded parts of the input variable space - not in the vicinity of lonely outliers per se. Having analyzed robustness for distance based and nonparametric classifiers, a relation can be made with the possibility of overfitting. Model robustness to extreme observations is expected to be better for nonparametric classifiers than for distance-based classifiers. There is a risk of overfitting because of extreme observations in distance-based classifiers, whereas that is hardly the case for (robust) nonparametric classifiers. For distance-based classifiers, outliers will either pull or push the decision boundaries, see the discussion of noise characteristics above. Discriminant analysis, for example, is prone to non-normally distributed data - to data with extreme observations. Neural networks can just end up in saturation, close to $0$ or $1$ (for sigmoid activation functions). Also support vector machines with sigmoid functions are less sensitive to extreme values, but they still employ a (local) distance measure. The most robust classifiers with respect to outliers are the nonparametric ones - decision trees, the histogram classifier and the multinomial classifier. A final note on overfitting Applying ID3 for building a decision tree will overgeneralize model building if there is no stopping criterion. The deeper subtrees from ID3 will begin fitting the training data - the fewer the observations in a subtree the higher the chance of overfitting. Restricting the parameter space prevents overgeneralization. Overgeneralization is in distance based classifiers also prevented by restricting the parameter space, i.e. the number of hidden nodes/layers or the regularization parameter $C$ in an SVM. Answers to your questions So the answer to your first question is generally no. Robustness to outliers is orthogonal to whether a type of classifier is prone to overfitting. The exception to this conclusion is if an outlier lies 'lightyears' away and it completely dominates the distance function. In that really rare case, robustness will deteriorate by that extreme observation. As to your second question. Classifiers with well-restricted parameter spaces tend to generalize better from their training set to a test set. The fraction of extreme observations in the training set determines whether the distance based classifiers be led astray during training. For non-parametric classifiers, the fraction of extreme observations can be much larger before model performance begins to decay. Hence, nonparametric classifiers are much more robust to outliers. Also for your second question, it's the underlying assumptions of a classifier that determine whether it's sensitive to outliers - not how strongly its parameter space is regularized. It remains a power-struggle between classifier flexibility whether one lonely outlier 'lightyears away' can chiefly determine the distance function used during training. Hence, I argue a generally 'no' to your second question.
Relationship between overfitting and robustness to outliers
Interesting questions posed. I will address the two questions for the use case of statistical classifiers in order to demarcate the analysis to a model domain we can oversee. Before embarking onto an
Relationship between overfitting and robustness to outliers Interesting questions posed. I will address the two questions for the use case of statistical classifiers in order to demarcate the analysis to a model domain we can oversee. Before embarking onto an elaborate answer I do want to discuss the definition of Robustness. Different definitions have been given for the concept of robustness. One can discuss model robustness - as opposed to outcome robustness. Model robustness means that your general model outcome - and hence the distribution of its predictions - that they are less sensitive or even insensitive to an increasing amount of extreme values in the training set. Outcome robustness, on the other hand, refers to the (in)sensitivity to increasing noise levels in the input variables with respect to one specific predicted outcome. I assume that you address model robustness in your questions. To address the first question, we need to make a distinction between classifiers that use a global or local distance measure to model (probability of) class dependency, and distribution-free classifiers. Discriminant analysis, k-nearest neighbor classifier, neural networks, support vector machines - they all calculate some sort of distance between parameter vectors and the input vector provided. They all use some sort of distance measure. It should be added that nonlinear neural networks and SVMs use nonlinearity to globally bend and stretch the concept of distance (neural networks are universal approximators, as proved and published by Hornik in 1989). 'Distribution-free' classifiers ID3/C4.5 decision trees, CART, the histogram classifier, the multinomial classifier - these classifiers do not apply any distance measure. They are so-called nonparametric in their way of working. This having said, they are based on count distributions - hence the binomial distribution and the multinomial distribution, and nonparametric classifiers are governed by the statistics of these distributions. However, as the only thing that matters is whether the observed value of an input variable occurs in a specific bin/interval or not, they are by nature insensitive to extreme observations. This holds when the intervals of input variable bins to the leftmost and rightmost side are open. So these classifiers are certainly model robust. Noise characteristics and outliers Extreme values are one kind of noise. A scatter around a zero mean is the most common kind of noise that occurs in practice. This image illustrates scatter noise (left) and salt-and-pepper noise (right). Your robustness questions relate to the right-hand kind of noise. Analysis We can combine the true value of classifier input $i$, $z(i)$ with scatter noise $\epsilon$, and an outlier offset $e$ as $ x(i) = z(i) + \epsilon + e \cdot \delta(\alpha) $ with $\delta(\alpha)$ the Kronecker delta function governed by the parameter $\alpha$. The parametrized delta-function determines whether the outlier offset is being added, or not. The probability $P(\delta(\alpha)=1) \ll 1$, whereas the zero-mean scatter is always present. If for example $P(\delta(\alpha)=1) = \frac{1}{2}$, we do not speak of outliers anymore - they become common noise additive offsets. Note also that distance is intrinsic to the definition of the concept outlier. The observed class labels themselves in a training set cannot be subject to outliers, as follows from the required notion of distance. Distance based classifiers generally use the L2-norm $\mid \mid {\bf x} \mid \mid_2$ to calculate degree of fit. This norm is well-chosen for scatter noise. When it comes to extreme values (outliers), their influence increases with the power of $2$, and of course with $P(\delta(\alpha)=1)$. As nonparametric classifiers use different criteria to select the optimal set of parameters, they are insensitive to extreme value noise like salt-and-pepper. Again, the type of classifier determines the robustness to outliers. Overfitting The issue with overfitting occurs when classifiers become 'too rich' in parameters. In that situation learning triggers that all kinds of small loops around wrongly labeled cases in the training set are being made. Once the classifier is applied to a (new) test set, a poor model performance is seen. Such overgeneralization loops tend to include points pushed just across class boundaries by scatter noise $\epsilon$. It is highly unlikely that an outlier value, which has no similar neighboring points, is included in such a loop. This because of the locally rigid nature of (distance-based) classifiers - and because closely grouped points can push or pull a decision boundary, which one observation in its own cannot do. Overfitting generally happens between classes because the decision boundaries of any given classifier become too flexible. Decision boundaries are generally drawn in more crowded parts of the input variable space - not in the vicinity of lonely outliers per se. Having analyzed robustness for distance based and nonparametric classifiers, a relation can be made with the possibility of overfitting. Model robustness to extreme observations is expected to be better for nonparametric classifiers than for distance-based classifiers. There is a risk of overfitting because of extreme observations in distance-based classifiers, whereas that is hardly the case for (robust) nonparametric classifiers. For distance-based classifiers, outliers will either pull or push the decision boundaries, see the discussion of noise characteristics above. Discriminant analysis, for example, is prone to non-normally distributed data - to data with extreme observations. Neural networks can just end up in saturation, close to $0$ or $1$ (for sigmoid activation functions). Also support vector machines with sigmoid functions are less sensitive to extreme values, but they still employ a (local) distance measure. The most robust classifiers with respect to outliers are the nonparametric ones - decision trees, the histogram classifier and the multinomial classifier. A final note on overfitting Applying ID3 for building a decision tree will overgeneralize model building if there is no stopping criterion. The deeper subtrees from ID3 will begin fitting the training data - the fewer the observations in a subtree the higher the chance of overfitting. Restricting the parameter space prevents overgeneralization. Overgeneralization is in distance based classifiers also prevented by restricting the parameter space, i.e. the number of hidden nodes/layers or the regularization parameter $C$ in an SVM. Answers to your questions So the answer to your first question is generally no. Robustness to outliers is orthogonal to whether a type of classifier is prone to overfitting. The exception to this conclusion is if an outlier lies 'lightyears' away and it completely dominates the distance function. In that really rare case, robustness will deteriorate by that extreme observation. As to your second question. Classifiers with well-restricted parameter spaces tend to generalize better from their training set to a test set. The fraction of extreme observations in the training set determines whether the distance based classifiers be led astray during training. For non-parametric classifiers, the fraction of extreme observations can be much larger before model performance begins to decay. Hence, nonparametric classifiers are much more robust to outliers. Also for your second question, it's the underlying assumptions of a classifier that determine whether it's sensitive to outliers - not how strongly its parameter space is regularized. It remains a power-struggle between classifier flexibility whether one lonely outlier 'lightyears away' can chiefly determine the distance function used during training. Hence, I argue a generally 'no' to your second question.
Relationship between overfitting and robustness to outliers Interesting questions posed. I will address the two questions for the use case of statistical classifiers in order to demarcate the analysis to a model domain we can oversee. Before embarking onto an
26,716
Relationship between overfitting and robustness to outliers
There is a lot of things to influence the outliers, if the model is overfitting then it will learn specific details of data including noise data points like outliers. But it's not necessarily that if model not robust to outliers then it's overfitting, there is models is sensitive to outliers.
Relationship between overfitting and robustness to outliers
There is a lot of things to influence the outliers, if the model is overfitting then it will learn specific details of data including noise data points like outliers. But it's not necessarily that if
Relationship between overfitting and robustness to outliers There is a lot of things to influence the outliers, if the model is overfitting then it will learn specific details of data including noise data points like outliers. But it's not necessarily that if model not robust to outliers then it's overfitting, there is models is sensitive to outliers.
Relationship between overfitting and robustness to outliers There is a lot of things to influence the outliers, if the model is overfitting then it will learn specific details of data including noise data points like outliers. But it's not necessarily that if
26,717
Relationship between overfitting and robustness to outliers
Per Wikipedia on contraposition to quote: In logic and mathematics, contraposition refers to the inference of going from a conditional statement into its logically equivalent contrapositive, and an associated proof method known as proof by contraposition.[1] The contrapositive of a statement has its antecedent and consequent inverted and flipped. For instance, the contrapositive of the conditional statement "If it is raining, then I wear my coat" is the statement "If I don't wear my coat, then it isn't raining."...The law of contraposition says that a conditional statement is true if, and only if, its contrapositive is true.[3] So, on the slightly reworded question: Is a model that does not overfit easily than one that does, necessarily implied more robustness to outliers, the contraposition is, as 'not more' is 'equal or less': Does equal or less robustness necessarily follow from a model that overfits easily than one that does not? To assist in the answer, take the case of Least Absolute Deviation regression which is known for its robustness. It also curious in the case of estimation of single parameter, it reduces to a median estimate as opposed to the mean (which is highly susceptible to outliers as it incorporates all the data). So, the mean can be viewed as 'overfitting' but in samples, the mean and median can be close due to a balancing of large positives and negative values. Per the 'if and only if standard' placed on the veracity of the councontrapositive, necessarily less robustness does not follow from a model that overfits easily than one that does not, so my answer is no.
Relationship between overfitting and robustness to outliers
Per Wikipedia on contraposition to quote: In logic and mathematics, contraposition refers to the inference of going from a conditional statement into its logically equivalent contrapositive, and an a
Relationship between overfitting and robustness to outliers Per Wikipedia on contraposition to quote: In logic and mathematics, contraposition refers to the inference of going from a conditional statement into its logically equivalent contrapositive, and an associated proof method known as proof by contraposition.[1] The contrapositive of a statement has its antecedent and consequent inverted and flipped. For instance, the contrapositive of the conditional statement "If it is raining, then I wear my coat" is the statement "If I don't wear my coat, then it isn't raining."...The law of contraposition says that a conditional statement is true if, and only if, its contrapositive is true.[3] So, on the slightly reworded question: Is a model that does not overfit easily than one that does, necessarily implied more robustness to outliers, the contraposition is, as 'not more' is 'equal or less': Does equal or less robustness necessarily follow from a model that overfits easily than one that does not? To assist in the answer, take the case of Least Absolute Deviation regression which is known for its robustness. It also curious in the case of estimation of single parameter, it reduces to a median estimate as opposed to the mean (which is highly susceptible to outliers as it incorporates all the data). So, the mean can be viewed as 'overfitting' but in samples, the mean and median can be close due to a balancing of large positives and negative values. Per the 'if and only if standard' placed on the veracity of the councontrapositive, necessarily less robustness does not follow from a model that overfits easily than one that does not, so my answer is no.
Relationship between overfitting and robustness to outliers Per Wikipedia on contraposition to quote: In logic and mathematics, contraposition refers to the inference of going from a conditional statement into its logically equivalent contrapositive, and an a
26,718
Wikipedia's text about the Clopper-Pearson interval for binomial proportions
There are multiple concepts blended together into that statement on Wikipedia. Let's first tackle the statement "the intervals may not be the smallest possible" Then look at the different issue "cases where we know the population size" Point 1 the intervals may not be the smallest possible It is correct that the intervals are not efficient (too conservative). But for different reasons. The Clopper-Pearson interval contains those values of $p$ for which an hypothesis test at a certain $\alpha$ level would pass (not reject the null). (this is how confidence intervals work) The problem with the binomial distribution is in this last part "an hypothesis test at a certain $\alpha$". As the outcome variable is discrete and so will be the p-values associated with those outcomes. Say you wish to test for a coin flipping proces the hypothesis p=0.5 (with a confidence interval you do this for all values of p) with a level $\alpha=0.01$ and you flip eight times then the observations, if the hypothesis would be true would be distributed as 0 1 2 3 4 5 6 7 8 0.004 0.032 0.109 0.219 0.273 0.219 0.109 0.032 0.004 The values 1 untill 7 would make you not reject the hypothesis at this preset 1% level. But this acceptance (ie. the not rejection) would occur 99.2% of the time and not 99% (if p=0.5 would be true). So this means that the confidence interval will be conservative. It will be containing the actual parameter value more often than stated. The Clopper-Pearson interval will guarantee that the interval contains the parameter at least $x$ percent of the time, but it will not need to be exactly that percentage. This relates to the further text on wikipedia For example, the true coverage rate of a 95% Clopper–Pearson interval may be well above 95%, depending on n and θ. Thus the interval may be wider than it needs to be to achieve 95% confidence Point 2 cases where we know the population size This refers to sampling from a population with a (known) fixed size. E.g. sampling with replacement from a vase with $n$ balls, out of which a proportion $p$ has a certain characteristic (say red). Obviously, this proportion needs to be a multiple of $1/n$. There can only be an integer number of red balls in the vase. Say you have a vase with ten balls and wish to predict how many are red by sampling it. Then it makes no sense to speak of the proportion of number of red balls is between 0.35 and 0.65 (equivalent to 'the number of red balls in the vase is between 3.5 and 6.5'). So there are two issues that make the Clopper-Pearson interval not the smallest possible. This may have been inconveniently mixed together on Wikipedia or not spelled out very clearly. The first point actually only tells that the interval is not efficient; it may have a higher true coverage rate. But there is no solution to make the interval smaller. Except when we use prior knowledge and can use Bayesian intervals. The second point is a bit weird. It is not a typical situation to sample small populations with replacement. I believe that it may have been used as an argument for the inefficiency of the intervals, while instead the first point was meant/supposed to be used. Written by StackExchangeStrike
Wikipedia's text about the Clopper-Pearson interval for binomial proportions
There are multiple concepts blended together into that statement on Wikipedia. Let's first tackle the statement "the intervals may not be the smallest possible" Then look at the different issue "cas
Wikipedia's text about the Clopper-Pearson interval for binomial proportions There are multiple concepts blended together into that statement on Wikipedia. Let's first tackle the statement "the intervals may not be the smallest possible" Then look at the different issue "cases where we know the population size" Point 1 the intervals may not be the smallest possible It is correct that the intervals are not efficient (too conservative). But for different reasons. The Clopper-Pearson interval contains those values of $p$ for which an hypothesis test at a certain $\alpha$ level would pass (not reject the null). (this is how confidence intervals work) The problem with the binomial distribution is in this last part "an hypothesis test at a certain $\alpha$". As the outcome variable is discrete and so will be the p-values associated with those outcomes. Say you wish to test for a coin flipping proces the hypothesis p=0.5 (with a confidence interval you do this for all values of p) with a level $\alpha=0.01$ and you flip eight times then the observations, if the hypothesis would be true would be distributed as 0 1 2 3 4 5 6 7 8 0.004 0.032 0.109 0.219 0.273 0.219 0.109 0.032 0.004 The values 1 untill 7 would make you not reject the hypothesis at this preset 1% level. But this acceptance (ie. the not rejection) would occur 99.2% of the time and not 99% (if p=0.5 would be true). So this means that the confidence interval will be conservative. It will be containing the actual parameter value more often than stated. The Clopper-Pearson interval will guarantee that the interval contains the parameter at least $x$ percent of the time, but it will not need to be exactly that percentage. This relates to the further text on wikipedia For example, the true coverage rate of a 95% Clopper–Pearson interval may be well above 95%, depending on n and θ. Thus the interval may be wider than it needs to be to achieve 95% confidence Point 2 cases where we know the population size This refers to sampling from a population with a (known) fixed size. E.g. sampling with replacement from a vase with $n$ balls, out of which a proportion $p$ has a certain characteristic (say red). Obviously, this proportion needs to be a multiple of $1/n$. There can only be an integer number of red balls in the vase. Say you have a vase with ten balls and wish to predict how many are red by sampling it. Then it makes no sense to speak of the proportion of number of red balls is between 0.35 and 0.65 (equivalent to 'the number of red balls in the vase is between 3.5 and 6.5'). So there are two issues that make the Clopper-Pearson interval not the smallest possible. This may have been inconveniently mixed together on Wikipedia or not spelled out very clearly. The first point actually only tells that the interval is not efficient; it may have a higher true coverage rate. But there is no solution to make the interval smaller. Except when we use prior knowledge and can use Bayesian intervals. The second point is a bit weird. It is not a typical situation to sample small populations with replacement. I believe that it may have been used as an argument for the inefficiency of the intervals, while instead the first point was meant/supposed to be used. Written by StackExchangeStrike
Wikipedia's text about the Clopper-Pearson interval for binomial proportions There are multiple concepts blended together into that statement on Wikipedia. Let's first tackle the statement "the intervals may not be the smallest possible" Then look at the different issue "cas
26,719
Recreating figure 3.6 from Elements of Statistical Learning
There are probably some numbers wrong in the caption in the graph and/or the rendering of the graph. An interesting anomaly is this graph on the version of chapter 3 on Tibshirani's website: http://statweb.stanford.edu/~tibs/book/ The links are incomplete but based on the preface seems to be the 2nd edition. It can be that this graph is based on only the error for a single coefficient which may cause large discrepancies. Code In the code below we reproduce the graph of the forward stepwise method for varying degrees of correlation (the book uses 0.85) and we scale them according to the variance for the full model, which we compute as $\sigma^2 (X^TX)^{-1}$. library(MASS) ### function to do stepforward regression ### adding variables with best increase in RSS stepforward <- function(Y,X, intercept) { kl <- length(X[1,]) ### number of columns inset <- c() outset <- 1:kl best_RSS <- sum(Y^2) ### outer loop increasing subset size for (k in 1:kl) { beststep_RSS <- best_RSS ### RSS to beat beststep_par <- 0 ### inner looping trying all variables that can be added for (par in outset) { ### create a subset to test step_set <- c(inset,par) step_data <- data.frame(Y=Y,X=X[,step_set]) ### perform model with subset if (intercept) { step_mod <- lm(Y ~ . + 1, data = step_data) } else { step_mod <- lm(Y ~ . + 0, data = step_data) } step_RSS <- sum(step_mod$residuals^2) ### compare if it is an improvement if (step_RSS <= beststep_RSS) { beststep_RSS <- step_RSS beststep_par <- par } } bestRSS <- beststep_RSS inset <- c(inset,beststep_par) outset[-which(outset == beststep_par)] } return(inset) } get_error <- function(X = NULL, beta = NULL, intercept = 0) { ### 31 random X variables, standard normal if (is.null(X)) { X <- mvrnorm(300,rep(0,31), M) } ### 10 random beta coefficients 21 zero coefficients if (is.null(beta)) { beta <- c(rnorm(10,0,0.4^0.5),rep(0,21)) } ### Y with added noise Y <- (X %*% beta) + rnorm(length(X[,1]),0,6.25^0.5) ### get step order step_order <- stepforward(Y,X, intercept) ### error computation l <- 10 error <- matrix(rep(0,31*31),31) ### this variable will store error for 31 submodel sizes for (l in 1:31) { ### subdata Z <- X[,step_order[1:l]] sub_data <- data.frame(Y=Y,Z=Z) ### compute model if (intercept) { sub_mod <- lm(Y ~ . + 1, data = sub_data) } else { sub_mod <- lm(Y ~ . + 0, data = sub_data) } ### compute error in coefficients coef <- rep(0,31) if (intercept) { coef[step_order[1:l]] <- sub_mod$coefficients[-1] } else { coef[step_order[1:l]] <- sub_mod$coefficients[] } error[l,] <- (coef - beta) } return(error) } ### storing results in this matrix and vector corrMSE <- matrix(rep(0,10*31),10) corr_err <- rep(0,10) for (k_corr in 1:10) { corr <- seq(0.05,0.95,0.1)[k_corr] ### correlation matrix for X M <- matrix(rep(corr,31^2),31) for (i in 1:31) { M[i,i] = 1 } ### perform 50 times the model set.seed(1) X <- mvrnorm(300,rep(1,31), M) beta <- c(rnorm(10,0,0.4^0.5),rep(0,21)) nrep <- 50 me <- replicate(nrep,get_error(X,beta, intercept = 1)) ### this line uses fixed X and beta ###me <- replicate(nrep,get_error(beta = beta, intercept = 1)) ### this line uses random X and fixed beta ###me <- replicate(nrep,get_error(intercept = 1)) ### random X and beta each replicate ### storage for error statistics per coefficient and per k mean_error <- matrix(rep(0,31^2),31) mean_MSE <- matrix(rep(0,31^2),31) mean_var <- matrix(rep(0,31^2),31) ### compute error statistics ### MSE, and bias + variance for each coefficient seperately ### k relates to the subset size ### i refers to the coefficient ### averaging is done over the multiple simulations for (i in 1:31) { mean_error[i,] <- sapply(1:31, FUN = function(k) mean(me[k,i,])) mean_MSE[i,] <- sapply(1:31, FUN = function(k) mean(me[k,i,]^2)) mean_var[i,] <- mean_MSE[i,] - mean_error[i,]^2 } ### store results from the loop plotset <- 1:31 corrMSE[k_corr,] <- colMeans(mean_MSE[plotset,]) corr_err[k_corr] <- mean((6.25)*diag(solve(t(X[,1:31]) %*% (X[,1:31])))) } ### plotting curves layout(matrix(1)) plot(-10,-10, ylim = c(0,4), xlim = c(1,31), type = "l", lwd = 2, xlab = "Subset size k", ylab = expression((MSE)/(sigma^2 *diag(X^T*X)^-1)), main = "mean square error of parameters \n normalized", xaxs = "i", yaxs = "i") for (i in c(1,3,5,7,9,10)) { lines(1:31,corrMSE[i,]*1/corr_err[i], col = hsv(0.5+i/20,0.5,0.75-i/20)) } col <- c(1,3,5,7,9,10) legend(31,4, c(expression(rho == 0.05),expression(rho == 0.25), expression(rho == 0.45),expression(rho == 0.65), expression(rho == 0.85),expression(rho == 0.95)), xjust = 1, col = hsv(0.5+col/20,0.5,0.75-col/20), lty = 1)
Recreating figure 3.6 from Elements of Statistical Learning
There are probably some numbers wrong in the caption in the graph and/or the rendering of the graph. An interesting anomaly is this graph on the version of chapter 3 on Tibshirani's website: http://st
Recreating figure 3.6 from Elements of Statistical Learning There are probably some numbers wrong in the caption in the graph and/or the rendering of the graph. An interesting anomaly is this graph on the version of chapter 3 on Tibshirani's website: http://statweb.stanford.edu/~tibs/book/ The links are incomplete but based on the preface seems to be the 2nd edition. It can be that this graph is based on only the error for a single coefficient which may cause large discrepancies. Code In the code below we reproduce the graph of the forward stepwise method for varying degrees of correlation (the book uses 0.85) and we scale them according to the variance for the full model, which we compute as $\sigma^2 (X^TX)^{-1}$. library(MASS) ### function to do stepforward regression ### adding variables with best increase in RSS stepforward <- function(Y,X, intercept) { kl <- length(X[1,]) ### number of columns inset <- c() outset <- 1:kl best_RSS <- sum(Y^2) ### outer loop increasing subset size for (k in 1:kl) { beststep_RSS <- best_RSS ### RSS to beat beststep_par <- 0 ### inner looping trying all variables that can be added for (par in outset) { ### create a subset to test step_set <- c(inset,par) step_data <- data.frame(Y=Y,X=X[,step_set]) ### perform model with subset if (intercept) { step_mod <- lm(Y ~ . + 1, data = step_data) } else { step_mod <- lm(Y ~ . + 0, data = step_data) } step_RSS <- sum(step_mod$residuals^2) ### compare if it is an improvement if (step_RSS <= beststep_RSS) { beststep_RSS <- step_RSS beststep_par <- par } } bestRSS <- beststep_RSS inset <- c(inset,beststep_par) outset[-which(outset == beststep_par)] } return(inset) } get_error <- function(X = NULL, beta = NULL, intercept = 0) { ### 31 random X variables, standard normal if (is.null(X)) { X <- mvrnorm(300,rep(0,31), M) } ### 10 random beta coefficients 21 zero coefficients if (is.null(beta)) { beta <- c(rnorm(10,0,0.4^0.5),rep(0,21)) } ### Y with added noise Y <- (X %*% beta) + rnorm(length(X[,1]),0,6.25^0.5) ### get step order step_order <- stepforward(Y,X, intercept) ### error computation l <- 10 error <- matrix(rep(0,31*31),31) ### this variable will store error for 31 submodel sizes for (l in 1:31) { ### subdata Z <- X[,step_order[1:l]] sub_data <- data.frame(Y=Y,Z=Z) ### compute model if (intercept) { sub_mod <- lm(Y ~ . + 1, data = sub_data) } else { sub_mod <- lm(Y ~ . + 0, data = sub_data) } ### compute error in coefficients coef <- rep(0,31) if (intercept) { coef[step_order[1:l]] <- sub_mod$coefficients[-1] } else { coef[step_order[1:l]] <- sub_mod$coefficients[] } error[l,] <- (coef - beta) } return(error) } ### storing results in this matrix and vector corrMSE <- matrix(rep(0,10*31),10) corr_err <- rep(0,10) for (k_corr in 1:10) { corr <- seq(0.05,0.95,0.1)[k_corr] ### correlation matrix for X M <- matrix(rep(corr,31^2),31) for (i in 1:31) { M[i,i] = 1 } ### perform 50 times the model set.seed(1) X <- mvrnorm(300,rep(1,31), M) beta <- c(rnorm(10,0,0.4^0.5),rep(0,21)) nrep <- 50 me <- replicate(nrep,get_error(X,beta, intercept = 1)) ### this line uses fixed X and beta ###me <- replicate(nrep,get_error(beta = beta, intercept = 1)) ### this line uses random X and fixed beta ###me <- replicate(nrep,get_error(intercept = 1)) ### random X and beta each replicate ### storage for error statistics per coefficient and per k mean_error <- matrix(rep(0,31^2),31) mean_MSE <- matrix(rep(0,31^2),31) mean_var <- matrix(rep(0,31^2),31) ### compute error statistics ### MSE, and bias + variance for each coefficient seperately ### k relates to the subset size ### i refers to the coefficient ### averaging is done over the multiple simulations for (i in 1:31) { mean_error[i,] <- sapply(1:31, FUN = function(k) mean(me[k,i,])) mean_MSE[i,] <- sapply(1:31, FUN = function(k) mean(me[k,i,]^2)) mean_var[i,] <- mean_MSE[i,] - mean_error[i,]^2 } ### store results from the loop plotset <- 1:31 corrMSE[k_corr,] <- colMeans(mean_MSE[plotset,]) corr_err[k_corr] <- mean((6.25)*diag(solve(t(X[,1:31]) %*% (X[,1:31])))) } ### plotting curves layout(matrix(1)) plot(-10,-10, ylim = c(0,4), xlim = c(1,31), type = "l", lwd = 2, xlab = "Subset size k", ylab = expression((MSE)/(sigma^2 *diag(X^T*X)^-1)), main = "mean square error of parameters \n normalized", xaxs = "i", yaxs = "i") for (i in c(1,3,5,7,9,10)) { lines(1:31,corrMSE[i,]*1/corr_err[i], col = hsv(0.5+i/20,0.5,0.75-i/20)) } col <- c(1,3,5,7,9,10) legend(31,4, c(expression(rho == 0.05),expression(rho == 0.25), expression(rho == 0.45),expression(rho == 0.65), expression(rho == 0.85),expression(rho == 0.95)), xjust = 1, col = hsv(0.5+col/20,0.5,0.75-col/20), lty = 1)
Recreating figure 3.6 from Elements of Statistical Learning There are probably some numbers wrong in the caption in the graph and/or the rendering of the graph. An interesting anomaly is this graph on the version of chapter 3 on Tibshirani's website: http://st
26,720
Is the only difference between conditional generative models and discriminative models the complexity of the modeled distribution?
In machine learning, the terms "generative" and "discriminative" are sometimes conflated with "unsupervised" and "supervised". Someone only reading deep learning papers may also come to believe that generative models "generate" images, text, or audio and discriminative models assign labels. But this is not how these terms were defined and used before GANs and VAEs came along. A generative model assigns a joint probability distribution to all variables involved, even if we ultimately only care about a conditional or marginal distribution. Classical examples of generative models include the naive Bayes classifier and latent Dirichlet allocation. Naive Bayes is supervised and is usually applied to very simple data, so data complexity does not matter at all. And neither of these models was designed to generate inputs. In fact, their conditional independence assumptions makes them do a poor job of it. A discriminative or conditional model assigns a conditional probability to one set of variables given another set of variables. Discriminative models are sometimes trained in an unsupervised manner, see discriminative clustering. More general terms encompassing both are "probabilistic model" or "statistical model", which can refer to any collection of probability distributions. We use "generative" and "discriminative" to quickly communicate some general properties of a probabilistic model. Other specifiers include "parametric", "nonparametric" and "graphical". The more recent phrase "conditional generative" suggests that we are conditioning on a variable, as in discriminative modeling, but that we are also modeling distributions which are not actually of interest at test time, as in generative modeling. E.g., when training a conditional GAN to generate images $x$ from noise $z$ and a label $c$, $p(x, z \mid c)$, we probably only care about $p(x \mid c)$ at test time. But to be consistent with the definitions of "generative" and "discriminative", I propose the complexity or type of data should not matter when deciding whether something is "conditionally generative" or not. Using these definitions, we would assign labels as follows: discriminative discriminative, since the type of data or distribution does not matter discriminative, since you are only conditionally modeling variables of interest conditional generative, since you model auxiliary variables; the loss you use to train a model does not matter discriminative, the complexity or type of data, or the way you train your model(s) does not matter conditional generative I'll point to a note by Minka (2005) and a paper by Bishop & Lasserre (2007) which provide more precise if narrower definitions and a unified view of generative and discriminative models which may clear things up further. Finally, note that the term "model" is overloaded and can refer both to a family of distributions and to an instance of such a family. For example, the "trained model" $p_{\theta}$ with particular parameter values is an instance of a parametric model, $\{ p_\theta : \theta \in \mathbb{R}^N \}$. To make things even more confusing, machine learning terminology conflates models with fitting procedures. Note that VAEs and GANs (and nonlinear ICA and some others) are referring to essentially the same model (if you assume very small $\sigma$), $$\mathcal{N}(z; 0, I)\mathcal{N}(x; f_\theta(z); \sigma^2 I),$$ yet we often talk about them as different "models" because they are optimized differently.
Is the only difference between conditional generative models and discriminative models the complexit
In machine learning, the terms "generative" and "discriminative" are sometimes conflated with "unsupervised" and "supervised". Someone only reading deep learning papers may also come to believe that g
Is the only difference between conditional generative models and discriminative models the complexity of the modeled distribution? In machine learning, the terms "generative" and "discriminative" are sometimes conflated with "unsupervised" and "supervised". Someone only reading deep learning papers may also come to believe that generative models "generate" images, text, or audio and discriminative models assign labels. But this is not how these terms were defined and used before GANs and VAEs came along. A generative model assigns a joint probability distribution to all variables involved, even if we ultimately only care about a conditional or marginal distribution. Classical examples of generative models include the naive Bayes classifier and latent Dirichlet allocation. Naive Bayes is supervised and is usually applied to very simple data, so data complexity does not matter at all. And neither of these models was designed to generate inputs. In fact, their conditional independence assumptions makes them do a poor job of it. A discriminative or conditional model assigns a conditional probability to one set of variables given another set of variables. Discriminative models are sometimes trained in an unsupervised manner, see discriminative clustering. More general terms encompassing both are "probabilistic model" or "statistical model", which can refer to any collection of probability distributions. We use "generative" and "discriminative" to quickly communicate some general properties of a probabilistic model. Other specifiers include "parametric", "nonparametric" and "graphical". The more recent phrase "conditional generative" suggests that we are conditioning on a variable, as in discriminative modeling, but that we are also modeling distributions which are not actually of interest at test time, as in generative modeling. E.g., when training a conditional GAN to generate images $x$ from noise $z$ and a label $c$, $p(x, z \mid c)$, we probably only care about $p(x \mid c)$ at test time. But to be consistent with the definitions of "generative" and "discriminative", I propose the complexity or type of data should not matter when deciding whether something is "conditionally generative" or not. Using these definitions, we would assign labels as follows: discriminative discriminative, since the type of data or distribution does not matter discriminative, since you are only conditionally modeling variables of interest conditional generative, since you model auxiliary variables; the loss you use to train a model does not matter discriminative, the complexity or type of data, or the way you train your model(s) does not matter conditional generative I'll point to a note by Minka (2005) and a paper by Bishop & Lasserre (2007) which provide more precise if narrower definitions and a unified view of generative and discriminative models which may clear things up further. Finally, note that the term "model" is overloaded and can refer both to a family of distributions and to an instance of such a family. For example, the "trained model" $p_{\theta}$ with particular parameter values is an instance of a parametric model, $\{ p_\theta : \theta \in \mathbb{R}^N \}$. To make things even more confusing, machine learning terminology conflates models with fitting procedures. Note that VAEs and GANs (and nonlinear ICA and some others) are referring to essentially the same model (if you assume very small $\sigma$), $$\mathcal{N}(z; 0, I)\mathcal{N}(x; f_\theta(z); \sigma^2 I),$$ yet we often talk about them as different "models" because they are optimized differently.
Is the only difference between conditional generative models and discriminative models the complexit In machine learning, the terms "generative" and "discriminative" are sometimes conflated with "unsupervised" and "supervised". Someone only reading deep learning papers may also come to believe that g
26,721
An intuitive understanding of each fold of a nested cross validation for parameter/model tuning
Your understanding sounds good to me with the possible exception that what you call "run" in my field is called either fold (as in 5-fold cross validation) if the test data is meant or "surrogate model" if we're talking about the model. Yes, the outer folds can return different hyperparameter sets and/or parameters (coefficients). This is valid in the sense that this is allowed to happen. It is invalid in the sense that this means the optimization (done with the help of the inner folds) is not stable, so you have not actually found "the" [global] optimum. For the overall model, you're supposed to run the inner cross validation again on the whole data set. I.e., you optimize/auto-tune your hyperparameters on the training set (now the whole data set) just the same as you did during the outer cross validation. Update: longer explanation See also Nested cross validation for model selection and How to build the final model and tune probability threshold after nested cross-validation? Are you saying that to get the "the [global] optimum" you need to run your entire dataset on all the combinations of c's, gamma's, kernels etc? No. In my experience the problem is not that the search space is not explored in detail (all possible combinations) but rather that our measurement of the resulting model performance is subject to uncertainty. Many optimization strategies coming from numerical optimization implicitly assume that there is negligible noise on the target functional. I.e. the functional is basically a smooth, continuous function of the hyperparameters. Depending on the figure of merit you optimize and the number of cases you have, this assumption may or may not be met. If you do have considerable noise on the estimate of the figure of merit but do not take this into account (i.e. the "select the best one" strategy you mention), your observed "optimum" is subject to noise. In addition, the noise (variance uncertainty) on the performance estimate increases with model complexity. In this situation, naive "select be best observed performance" can also lead to a bias towards too complex models. See e.g. Cawley, G. C. & Talbot, N. L. C.: On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation, Journal of Machine Learning Research, 11, 2079-2107 (2010). How does this get incorporated into the nested cross validation procedure or the final results of the analysis? Hastie, T. and Tibshirani, R. and Friedman, J. The Elements of Statistical Learning; Data mining, Inference andPrediction Springer Verlag, New York, 2009 in chapter 7.10 say: Often a “one-standard error” rule is used with cross-validation, in which we choose the most par- simonious model whose error is no more than one standard error above the error of the best model. Which I find a good heuristic (I take the additional precaution to estimate both variance uncertainty due to the limited numebr of cases as well as due to model instability - the Elements of Statistical Learning do not discuss this in their cross validation chapter). So your understanding: I'm confused because my understanding is that you can't just run your analysis hundreds/thousands of times with different parameters/kernels and select the best one is correct. However, your understanding (and nested CV is supposed to mitigate the associated issues). may or may not be correct: nested CV does not make the hyperparameter optimization any more successful, but it can provide an honest estimate of the performance that can be achieved with that particular optimization strategy. In other words: it guards against overoptimism about the achieved performance, but it does not improve this performance. The final model: The outer split of the nested CV is basically an ordinary CV for validation/verification. It splits the availabel data set into training and testing subsets, and then builds a so-called surrogate model using the training set. During this training, you happen to do another (the inner) CV, whose performance estimates you use to fix/optimize the hyperparameters. But seen from the outer CV, this is just part of the model training. The model training on the whole data set should just do the same the model training of the cross validation did. Otherwise the surrogate models and their performance estimates would not be a good surrogate for the model trained on the whole data (and that is really the purpose of the surrogate models). Thus: run the auto-tuning of hyperparameters on the whole data set just as you do during cross validation. Same hyperparameter combinations to consider, same strategy for selecting the optimum. In short: same training algorithm, just slightly different data (1/k additional cases).
An intuitive understanding of each fold of a nested cross validation for parameter/model tuning
Your understanding sounds good to me with the possible exception that what you call "run" in my field is called either fold (as in 5-fold cross validation) if the test data is meant or "surrogate mode
An intuitive understanding of each fold of a nested cross validation for parameter/model tuning Your understanding sounds good to me with the possible exception that what you call "run" in my field is called either fold (as in 5-fold cross validation) if the test data is meant or "surrogate model" if we're talking about the model. Yes, the outer folds can return different hyperparameter sets and/or parameters (coefficients). This is valid in the sense that this is allowed to happen. It is invalid in the sense that this means the optimization (done with the help of the inner folds) is not stable, so you have not actually found "the" [global] optimum. For the overall model, you're supposed to run the inner cross validation again on the whole data set. I.e., you optimize/auto-tune your hyperparameters on the training set (now the whole data set) just the same as you did during the outer cross validation. Update: longer explanation See also Nested cross validation for model selection and How to build the final model and tune probability threshold after nested cross-validation? Are you saying that to get the "the [global] optimum" you need to run your entire dataset on all the combinations of c's, gamma's, kernels etc? No. In my experience the problem is not that the search space is not explored in detail (all possible combinations) but rather that our measurement of the resulting model performance is subject to uncertainty. Many optimization strategies coming from numerical optimization implicitly assume that there is negligible noise on the target functional. I.e. the functional is basically a smooth, continuous function of the hyperparameters. Depending on the figure of merit you optimize and the number of cases you have, this assumption may or may not be met. If you do have considerable noise on the estimate of the figure of merit but do not take this into account (i.e. the "select the best one" strategy you mention), your observed "optimum" is subject to noise. In addition, the noise (variance uncertainty) on the performance estimate increases with model complexity. In this situation, naive "select be best observed performance" can also lead to a bias towards too complex models. See e.g. Cawley, G. C. & Talbot, N. L. C.: On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation, Journal of Machine Learning Research, 11, 2079-2107 (2010). How does this get incorporated into the nested cross validation procedure or the final results of the analysis? Hastie, T. and Tibshirani, R. and Friedman, J. The Elements of Statistical Learning; Data mining, Inference andPrediction Springer Verlag, New York, 2009 in chapter 7.10 say: Often a “one-standard error” rule is used with cross-validation, in which we choose the most par- simonious model whose error is no more than one standard error above the error of the best model. Which I find a good heuristic (I take the additional precaution to estimate both variance uncertainty due to the limited numebr of cases as well as due to model instability - the Elements of Statistical Learning do not discuss this in their cross validation chapter). So your understanding: I'm confused because my understanding is that you can't just run your analysis hundreds/thousands of times with different parameters/kernels and select the best one is correct. However, your understanding (and nested CV is supposed to mitigate the associated issues). may or may not be correct: nested CV does not make the hyperparameter optimization any more successful, but it can provide an honest estimate of the performance that can be achieved with that particular optimization strategy. In other words: it guards against overoptimism about the achieved performance, but it does not improve this performance. The final model: The outer split of the nested CV is basically an ordinary CV for validation/verification. It splits the availabel data set into training and testing subsets, and then builds a so-called surrogate model using the training set. During this training, you happen to do another (the inner) CV, whose performance estimates you use to fix/optimize the hyperparameters. But seen from the outer CV, this is just part of the model training. The model training on the whole data set should just do the same the model training of the cross validation did. Otherwise the surrogate models and their performance estimates would not be a good surrogate for the model trained on the whole data (and that is really the purpose of the surrogate models). Thus: run the auto-tuning of hyperparameters on the whole data set just as you do during cross validation. Same hyperparameter combinations to consider, same strategy for selecting the optimum. In short: same training algorithm, just slightly different data (1/k additional cases).
An intuitive understanding of each fold of a nested cross validation for parameter/model tuning Your understanding sounds good to me with the possible exception that what you call "run" in my field is called either fold (as in 5-fold cross validation) if the test data is meant or "surrogate mode
26,722
Interpret zero-inflated negative binomial regression
a) Here https://rpubs.com/kaz_yos/pscl-2 is a nice example of how to interpret the results of a ZINB model. b) Obviusly you have to present both blocks. Note: ZINB regression model two separate processes so they produce two sets of coefficients: one for the count part of the model and the other for the logistic part of the model. A common way of interpreting logistic regression models is to exponentiate the coefficients, which places the coefficients in an odds-ratio scale. With zero-inflated models the logistic part of the model predicts non-occurrence of the outcome. Here you can fins another example https://stats.idre.ucla.edu/other/dae/.
Interpret zero-inflated negative binomial regression
a) Here https://rpubs.com/kaz_yos/pscl-2 is a nice example of how to interpret the results of a ZINB model. b) Obviusly you have to present both blocks. Note: ZINB regression model two separate proce
Interpret zero-inflated negative binomial regression a) Here https://rpubs.com/kaz_yos/pscl-2 is a nice example of how to interpret the results of a ZINB model. b) Obviusly you have to present both blocks. Note: ZINB regression model two separate processes so they produce two sets of coefficients: one for the count part of the model and the other for the logistic part of the model. A common way of interpreting logistic regression models is to exponentiate the coefficients, which places the coefficients in an odds-ratio scale. With zero-inflated models the logistic part of the model predicts non-occurrence of the outcome. Here you can fins another example https://stats.idre.ucla.edu/other/dae/.
Interpret zero-inflated negative binomial regression a) Here https://rpubs.com/kaz_yos/pscl-2 is a nice example of how to interpret the results of a ZINB model. b) Obviusly you have to present both blocks. Note: ZINB regression model two separate proce
26,723
3 related questions about DDD (TD, triple-diff) estimators
You're right. In this 2011 slideshow, equation (4), slide 6, shows the missing term. As you mention it, the interpretation to keep in mind is that a triple difference is a difference between two differences in differences. You're right to mention that the estimation requires you to omit a reference category for your time, state and age group fixed effects (to avoid collinearity). However, the choice of the reference category should not matter for the estimator of the triple-difference term. Note that you can write directly your dummies as interactions between time periods, states, and age groups, see the equation in Pischke's lecture notes (bottom of p.16). One way to frame the identification assumption is the following. In standard DiD, you would like your two groups to have evolved in a similar way if treatment had not existed. In triple difference, you would like the gap between your treated stated and your states to evolve similarly over time for older and younger individuals, in the absence of the treatment. You could also frame it switching states and age groups. The way you would empirically test this would first be to eyeball the trends before treatment happened (if you have data before it happens). In a DiD case, you would just plot the treated and control average for each year before treatment. In the triple difference case, you could do the same with four lines or, more conveniently, you could plot gaps between treated and control states, for each age group and year, and check whether they are parallel.
3 related questions about DDD (TD, triple-diff) estimators
You're right. In this 2011 slideshow, equation (4), slide 6, shows the missing term. As you mention it, the interpretation to keep in mind is that a triple difference is a difference between two diffe
3 related questions about DDD (TD, triple-diff) estimators You're right. In this 2011 slideshow, equation (4), slide 6, shows the missing term. As you mention it, the interpretation to keep in mind is that a triple difference is a difference between two differences in differences. You're right to mention that the estimation requires you to omit a reference category for your time, state and age group fixed effects (to avoid collinearity). However, the choice of the reference category should not matter for the estimator of the triple-difference term. Note that you can write directly your dummies as interactions between time periods, states, and age groups, see the equation in Pischke's lecture notes (bottom of p.16). One way to frame the identification assumption is the following. In standard DiD, you would like your two groups to have evolved in a similar way if treatment had not existed. In triple difference, you would like the gap between your treated stated and your states to evolve similarly over time for older and younger individuals, in the absence of the treatment. You could also frame it switching states and age groups. The way you would empirically test this would first be to eyeball the trends before treatment happened (if you have data before it happens). In a DiD case, you would just plot the treated and control average for each year before treatment. In the triple difference case, you could do the same with four lines or, more conveniently, you could plot gaps between treated and control states, for each age group and year, and check whether they are parallel.
3 related questions about DDD (TD, triple-diff) estimators You're right. In this 2011 slideshow, equation (4), slide 6, shows the missing term. As you mention it, the interpretation to keep in mind is that a triple difference is a difference between two diffe
26,724
Is the Shapiro Wilk test W an effect size?
As you know, $W$ is a test statistic. In most cases (all consistent tests), a test statistic is not a suitable effect estimator as the statistic reflects the sample size whereas the effect estimator shall be independent of it. Just think of an asymptotic test to test zero mean under the central limit theorem: The approximate distribution is the same for all $n$, so the test statistic contains even all the information about the sample size. That makes the test statistic unsuitable as effect estimater. For $W$, it is similar (although the approximate distribution depends on the sample size as well). The lower bound for $W$ is $\frac{a_1^2n}{(n-1)}$, where $a_1$ depends on is the expectation for the smallest order statistic. So no, it is no suitable effect estimator at all. In fact, I think you are not yet sure what you are looking for as the term "effect" is a bit more difficult than in the usual parametric world of one-dimensional parameters. Here, the raw effect of a.s. not being normally distributed is infinite dimensional: Each measurable subset of $\mathbb{R}$ can have a different probability from the normal distribution model. For a one-dimensional effect, you need to weight it somehow and be aware of the consequences of various weights to your intended application. This way you would decide if e.g. a certain bimodal distribution with Gaussian tails is more normal than a certain unimodal distribution with heavy tails. In fact trading the tail behaviour against the non-tail behaviour might be the most relevant question to invent a suitable effect. Then, if will be much easier to find an estimator for this particular effect.
Is the Shapiro Wilk test W an effect size?
As you know, $W$ is a test statistic. In most cases (all consistent tests), a test statistic is not a suitable effect estimator as the statistic reflects the sample size whereas the effect estimator s
Is the Shapiro Wilk test W an effect size? As you know, $W$ is a test statistic. In most cases (all consistent tests), a test statistic is not a suitable effect estimator as the statistic reflects the sample size whereas the effect estimator shall be independent of it. Just think of an asymptotic test to test zero mean under the central limit theorem: The approximate distribution is the same for all $n$, so the test statistic contains even all the information about the sample size. That makes the test statistic unsuitable as effect estimater. For $W$, it is similar (although the approximate distribution depends on the sample size as well). The lower bound for $W$ is $\frac{a_1^2n}{(n-1)}$, where $a_1$ depends on is the expectation for the smallest order statistic. So no, it is no suitable effect estimator at all. In fact, I think you are not yet sure what you are looking for as the term "effect" is a bit more difficult than in the usual parametric world of one-dimensional parameters. Here, the raw effect of a.s. not being normally distributed is infinite dimensional: Each measurable subset of $\mathbb{R}$ can have a different probability from the normal distribution model. For a one-dimensional effect, you need to weight it somehow and be aware of the consequences of various weights to your intended application. This way you would decide if e.g. a certain bimodal distribution with Gaussian tails is more normal than a certain unimodal distribution with heavy tails. In fact trading the tail behaviour against the non-tail behaviour might be the most relevant question to invent a suitable effect. Then, if will be much easier to find an estimator for this particular effect.
Is the Shapiro Wilk test W an effect size? As you know, $W$ is a test statistic. In most cases (all consistent tests), a test statistic is not a suitable effect estimator as the statistic reflects the sample size whereas the effect estimator s
26,725
Choosing a Generative Models for time series data
I think using generative model from deep learning will not lead you anywhere with the time series economic data you are considering, and GAN will probably be the worst generative model for your application. What you are considering is to be able to sample from $p(x_{t+1}|x_{1...t})$, which should be captured by LSTM or AR models you used. The key here is that the probability is a conditional probability, while the generative models are unconditional probability $p(x)$. For example, most generative model takes as input some relatively meaningless latent variable value, so you cannot even make a model that takes $x_{1..t}$ as your input. What I would suggest is to simply assume an AR(1) type process, and takes $x_t$ as input to a simple multilayer perceptron to predict $x_{t+1}$. This is kind of like a model with complexity in between your AR linear model and LSTM, but the multilayer perceptron can capture more nonlinear dependency than AR linear model and has less variance and is easier to train than LSTM. You mentioned you failed in using AR and LSTM model. Using LSTM is usually hard with high variance data for economic data and can quickly overfit into some unknown region. If you still want to try it, one suggestion is to assume a normal distribution of all your variables, and uses LSTM to output the mean and variance of model prediction.
Choosing a Generative Models for time series data
I think using generative model from deep learning will not lead you anywhere with the time series economic data you are considering, and GAN will probably be the worst generative model for your applic
Choosing a Generative Models for time series data I think using generative model from deep learning will not lead you anywhere with the time series economic data you are considering, and GAN will probably be the worst generative model for your application. What you are considering is to be able to sample from $p(x_{t+1}|x_{1...t})$, which should be captured by LSTM or AR models you used. The key here is that the probability is a conditional probability, while the generative models are unconditional probability $p(x)$. For example, most generative model takes as input some relatively meaningless latent variable value, so you cannot even make a model that takes $x_{1..t}$ as your input. What I would suggest is to simply assume an AR(1) type process, and takes $x_t$ as input to a simple multilayer perceptron to predict $x_{t+1}$. This is kind of like a model with complexity in between your AR linear model and LSTM, but the multilayer perceptron can capture more nonlinear dependency than AR linear model and has less variance and is easier to train than LSTM. You mentioned you failed in using AR and LSTM model. Using LSTM is usually hard with high variance data for economic data and can quickly overfit into some unknown region. If you still want to try it, one suggestion is to assume a normal distribution of all your variables, and uses LSTM to output the mean and variance of model prediction.
Choosing a Generative Models for time series data I think using generative model from deep learning will not lead you anywhere with the time series economic data you are considering, and GAN will probably be the worst generative model for your applic
26,726
Mathematical definition of Infill Asymptotics
The definition of infill asymptotics is not particularly useful (technically, if the domain stays fixed and sample size rises, that is infill asymptotics. But consider the case where you sample on a transect from 0 to 1, taking one sample in 0,1/2, another sample in 1/2,3/4, another in the interval 3/4, 7/8, etc. You will be able to say a lot about the values at 1, but won't be able to say much else.) To get typical result in infill asymptotics, you need a design with properties such as: for all subregions of area $\epsilon$, for any $\epsilon>0$, the probability of a sample occurring in the subregion approaches 1 as $n\rightarrow\infty$. Such a sample is dense in the domain. Sometimes the infill is not given explicitly, only a design is given. For instance, in the paper by Lahiri (On Inconsistency of Estimators Based on Spatial Data under Infill Asymptotics), he describes a design that is essentially a 'jittered' grid (some randomness as the small level, but generally based on sampling in hyper rectangular subregions) that is asymptotically dense in the fixed domain. He obtains the result (common for infill problems) that most variogram parameters are estimated inconsistently. Lahiri, Lee and Cressie (On asymptotic distribution and asymptotic efficiency of least squared estimators of spatial variogram parameters, J.StatPlanInf 2002, vol. 103, pp. 65-85) similarly consider infill grids that become systematically more closely spaced, again, yielding a dense sample. (The general result for dense samples is that since infill asymptotics really is a single realization of a spatial process, the only parameter of the (super population) true variogram that can be consistently estimated is the slope at zero, but predictions are increasingly good.)
Mathematical definition of Infill Asymptotics
The definition of infill asymptotics is not particularly useful (technically, if the domain stays fixed and sample size rises, that is infill asymptotics. But consider the case where you sample on a
Mathematical definition of Infill Asymptotics The definition of infill asymptotics is not particularly useful (technically, if the domain stays fixed and sample size rises, that is infill asymptotics. But consider the case where you sample on a transect from 0 to 1, taking one sample in 0,1/2, another sample in 1/2,3/4, another in the interval 3/4, 7/8, etc. You will be able to say a lot about the values at 1, but won't be able to say much else.) To get typical result in infill asymptotics, you need a design with properties such as: for all subregions of area $\epsilon$, for any $\epsilon>0$, the probability of a sample occurring in the subregion approaches 1 as $n\rightarrow\infty$. Such a sample is dense in the domain. Sometimes the infill is not given explicitly, only a design is given. For instance, in the paper by Lahiri (On Inconsistency of Estimators Based on Spatial Data under Infill Asymptotics), he describes a design that is essentially a 'jittered' grid (some randomness as the small level, but generally based on sampling in hyper rectangular subregions) that is asymptotically dense in the fixed domain. He obtains the result (common for infill problems) that most variogram parameters are estimated inconsistently. Lahiri, Lee and Cressie (On asymptotic distribution and asymptotic efficiency of least squared estimators of spatial variogram parameters, J.StatPlanInf 2002, vol. 103, pp. 65-85) similarly consider infill grids that become systematically more closely spaced, again, yielding a dense sample. (The general result for dense samples is that since infill asymptotics really is a single realization of a spatial process, the only parameter of the (super population) true variogram that can be consistently estimated is the slope at zero, but predictions are increasingly good.)
Mathematical definition of Infill Asymptotics The definition of infill asymptotics is not particularly useful (technically, if the domain stays fixed and sample size rises, that is infill asymptotics. But consider the case where you sample on a
26,727
Mathematical definition of Infill Asymptotics
Let's start with a definition of Latin Hypercube sampling, just to make things perfectly clear and establish a notation. Then we can define infill asymptotics. LHS Latin Hypercube Sampling of a box $\mathcal{B}=[l_1,u_1)\times [l_2,u_2)\times \cdots [l_d,u_d) \subset \mathbb{R}^d$ proceeds by dividing each dimension into $N \ge 1$ parts of equal lengths $\delta_i(N) = (u_i-l_i)/N$, thereby partitioning it into $N^d$ cells $$c_N(i_1,i_2,\ldots, i_d) = [l_1 + i_1\delta_1(N), l_1 + (i_1+1)\delta_1(N))\times \cdots [l_d + i_d\delta_d(N), l_d + (i_d+1)\delta_d(N)),$$ where $0 \le i_j \lt N$ for each index $j$. Sampling occurs by first selecting $N$ such cells $S=\{c_N(i_1^1, \ldots, i_d^1), \ldots, c_N(i_1^N, \ldots, i_d^N)\}$ uniformly, independently, and without replacement from the collection of all such cells in such a way that $$\{i_j^1, i_j^2, \ldots, i_j^N\}=\{1, 2, \ldots, N\},\ j=1, 2, \ldots, d.$$ (This is the $d$-dimensional generalization of the $2$-dimensional situation where "there is only one sample in each row and each column.") Each of the $N$ cells in $S$ is then sampled at a location chosen uniformly and independently among all points in the cell, producing a set of $N$ ordered pairs $$X(N)=\{(Z_1^N,Y_1^N), \ldots, (Z_N^N,Y_N^N)\}$$ of (location, observation) values. Infill Asymptotics Presumably, some procedure $t_N$ is applied to each Latin Hypercube sample $X(N)$ of size $N$ of a fixed box $\mathcal{B}$, yielding an estimate $t_N(X(N))$ for each $N$. This results in a sequence $$t_1(X(1)), t_2(X(2)), \ldots, t_N(X(N)), \ldots$$ of random variables. Infill asymptotics refers to the behavior of this sequence as $N$ grows without bound.
Mathematical definition of Infill Asymptotics
Let's start with a definition of Latin Hypercube sampling, just to make things perfectly clear and establish a notation. Then we can define infill asymptotics. LHS Latin Hypercube Sampling of a box $
Mathematical definition of Infill Asymptotics Let's start with a definition of Latin Hypercube sampling, just to make things perfectly clear and establish a notation. Then we can define infill asymptotics. LHS Latin Hypercube Sampling of a box $\mathcal{B}=[l_1,u_1)\times [l_2,u_2)\times \cdots [l_d,u_d) \subset \mathbb{R}^d$ proceeds by dividing each dimension into $N \ge 1$ parts of equal lengths $\delta_i(N) = (u_i-l_i)/N$, thereby partitioning it into $N^d$ cells $$c_N(i_1,i_2,\ldots, i_d) = [l_1 + i_1\delta_1(N), l_1 + (i_1+1)\delta_1(N))\times \cdots [l_d + i_d\delta_d(N), l_d + (i_d+1)\delta_d(N)),$$ where $0 \le i_j \lt N$ for each index $j$. Sampling occurs by first selecting $N$ such cells $S=\{c_N(i_1^1, \ldots, i_d^1), \ldots, c_N(i_1^N, \ldots, i_d^N)\}$ uniformly, independently, and without replacement from the collection of all such cells in such a way that $$\{i_j^1, i_j^2, \ldots, i_j^N\}=\{1, 2, \ldots, N\},\ j=1, 2, \ldots, d.$$ (This is the $d$-dimensional generalization of the $2$-dimensional situation where "there is only one sample in each row and each column.") Each of the $N$ cells in $S$ is then sampled at a location chosen uniformly and independently among all points in the cell, producing a set of $N$ ordered pairs $$X(N)=\{(Z_1^N,Y_1^N), \ldots, (Z_N^N,Y_N^N)\}$$ of (location, observation) values. Infill Asymptotics Presumably, some procedure $t_N$ is applied to each Latin Hypercube sample $X(N)$ of size $N$ of a fixed box $\mathcal{B}$, yielding an estimate $t_N(X(N))$ for each $N$. This results in a sequence $$t_1(X(1)), t_2(X(2)), \ldots, t_N(X(N)), \ldots$$ of random variables. Infill asymptotics refers to the behavior of this sequence as $N$ grows without bound.
Mathematical definition of Infill Asymptotics Let's start with a definition of Latin Hypercube sampling, just to make things perfectly clear and establish a notation. Then we can define infill asymptotics. LHS Latin Hypercube Sampling of a box $
26,728
Are interactions only useful in the context of regression?
Interactions are needed explicitly in regression models because the formula does not include any interactions per se. More precisely, a regression model will always be linear in its input, whereas an interaction $X_i * X_j$ is a nonlinear combination of the features. The simplest way to see this is through the XOR-Problem, a regression model without any interactions cannot solve this, as it requires a nonlinear combination. KNNs and SVMs on the other hand (and many other models also) are universal function approximators. This means, that they cannot only combine their inputs in a linear fashion, but also in any possible non-linear way. That is given enough layers or a suitable kernel, they can basically "create" their own interactions, exactly as they need them. If you know or expect specific interactions to be important, though, you can still use them as an input to guide the models in the right direction. Similarly, tree-based models can be interpreted as only consisting of interactions. Basically, a split in a tree-based model creates a specific interaction with all previous variables. So for deciding which interactions to use, for sufficiently "high-power" models (i.e. those which are universal function approximators), you don't need them and you can let the model do its own magic. For other models it depends. There are some techniques available to guide the decision, like CHAID or step-wise regression. CHAID also works with a large number of features, for step-wise regression it may get lost in the number of possible interactions. Given that if you have $N$ features, there are $2^N$ possible interactions (counting not only two-way but also higher order interactions).
Are interactions only useful in the context of regression?
Interactions are needed explicitly in regression models because the formula does not include any interactions per se. More precisely, a regression model will always be linear in its input, whereas an
Are interactions only useful in the context of regression? Interactions are needed explicitly in regression models because the formula does not include any interactions per se. More precisely, a regression model will always be linear in its input, whereas an interaction $X_i * X_j$ is a nonlinear combination of the features. The simplest way to see this is through the XOR-Problem, a regression model without any interactions cannot solve this, as it requires a nonlinear combination. KNNs and SVMs on the other hand (and many other models also) are universal function approximators. This means, that they cannot only combine their inputs in a linear fashion, but also in any possible non-linear way. That is given enough layers or a suitable kernel, they can basically "create" their own interactions, exactly as they need them. If you know or expect specific interactions to be important, though, you can still use them as an input to guide the models in the right direction. Similarly, tree-based models can be interpreted as only consisting of interactions. Basically, a split in a tree-based model creates a specific interaction with all previous variables. So for deciding which interactions to use, for sufficiently "high-power" models (i.e. those which are universal function approximators), you don't need them and you can let the model do its own magic. For other models it depends. There are some techniques available to guide the decision, like CHAID or step-wise regression. CHAID also works with a large number of features, for step-wise regression it may get lost in the number of possible interactions. Given that if you have $N$ features, there are $2^N$ possible interactions (counting not only two-way but also higher order interactions).
Are interactions only useful in the context of regression? Interactions are needed explicitly in regression models because the formula does not include any interactions per se. More precisely, a regression model will always be linear in its input, whereas an
26,729
Are interactions only useful in the context of regression?
No. In fact, you can think SVM with polynomial kernel is adding all the (high order) interactions between all features. For example, if we have two features $(x_1,x_2)$, SVM with 2nd order polynomial is doing $(x_1^2,x_2^2,x_1x_2)$. SVM is called Kernel Trick, because it is implicitly doing polynomial basis expansion with a lot less computational complexity. Think about 10th order polynomial expansion on 10 features, manually expand it will have $10^{10}$ columns. But using kernel trick, we can easily do it. So, not only interaction has been widely used in other models. In adding to interaction, other models trying to more with feature engineering. Instead of multiplication of two columns, more complicated features are derived.
Are interactions only useful in the context of regression?
No. In fact, you can think SVM with polynomial kernel is adding all the (high order) interactions between all features. For example, if we have two features $(x_1,x_2)$, SVM with 2nd order polynomial
Are interactions only useful in the context of regression? No. In fact, you can think SVM with polynomial kernel is adding all the (high order) interactions between all features. For example, if we have two features $(x_1,x_2)$, SVM with 2nd order polynomial is doing $(x_1^2,x_2^2,x_1x_2)$. SVM is called Kernel Trick, because it is implicitly doing polynomial basis expansion with a lot less computational complexity. Think about 10th order polynomial expansion on 10 features, manually expand it will have $10^{10}$ columns. But using kernel trick, we can easily do it. So, not only interaction has been widely used in other models. In adding to interaction, other models trying to more with feature engineering. Instead of multiplication of two columns, more complicated features are derived.
Are interactions only useful in the context of regression? No. In fact, you can think SVM with polynomial kernel is adding all the (high order) interactions between all features. For example, if we have two features $(x_1,x_2)$, SVM with 2nd order polynomial
26,730
Are interactions only useful in the context of regression?
Interactions that improve adjusted R-squared, BIC for likelihood regression (alternatively AICc and others), VIF, and the F-statistic of ANOVA, the latter without individual parameters that are judged non-contributory using their partial probabilities. Also very important, but not asked, is that reparameterization can markedly improve both the effect of individual variables and their interactions. However, BIC, AIC, and other likelihood quality measurements are not valid for comparing different repareterizations leaving adjusted R-squared, VIF, and the F-statistic of ANOVA for such purposes.
Are interactions only useful in the context of regression?
Interactions that improve adjusted R-squared, BIC for likelihood regression (alternatively AICc and others), VIF, and the F-statistic of ANOVA, the latter without individual parameters that are judged
Are interactions only useful in the context of regression? Interactions that improve adjusted R-squared, BIC for likelihood regression (alternatively AICc and others), VIF, and the F-statistic of ANOVA, the latter without individual parameters that are judged non-contributory using their partial probabilities. Also very important, but not asked, is that reparameterization can markedly improve both the effect of individual variables and their interactions. However, BIC, AIC, and other likelihood quality measurements are not valid for comparing different repareterizations leaving adjusted R-squared, VIF, and the F-statistic of ANOVA for such purposes.
Are interactions only useful in the context of regression? Interactions that improve adjusted R-squared, BIC for likelihood regression (alternatively AICc and others), VIF, and the F-statistic of ANOVA, the latter without individual parameters that are judged
26,731
Cannot make this autoencoder network function properly (with convolutional and maxpool layers)
You might gain more insight by visualizing the weights instead of just the reconstructions. I had a similar problem when my biases were misconfigured. Everything below is written based on my experiences writing my own learning library. You can see the code here on Github http://github.com/josephcatrambone/aij. Here is a screenshot of my program when there are no biases. This is after only maybe ten epochs since I'm in a hurry to finish this writeup: The weight update is done by these operations: weights.add_i(positiveProduct.subtract(negativeProduct).elementMultiply(learningRate / (float) batchSize)); //visibleBias.add_i(batch.subtract(negativeVisibleProbabilities).meanRow().elementMultiply(learningRate)); //hiddenBias.add_i(positiveHiddenProbabilities.subtract(negativeHiddenProbabilities).meanRow().elementMultiply(learningRate)); If I uncomment the visible bias code, I get this result: If I screw up the sign of the visible bias code (subtracting instead of adding): visibleBias.subtract_i(batch.subtract(negativeVisibleProbabilities).meanRow().elementMultiply(learningRate)); I get this image: Which snowballs and eventually reaches something like what you have above. Check the signage of your error functions.
Cannot make this autoencoder network function properly (with convolutional and maxpool layers)
You might gain more insight by visualizing the weights instead of just the reconstructions. I had a similar problem when my biases were misconfigured. Everything below is written based on my experie
Cannot make this autoencoder network function properly (with convolutional and maxpool layers) You might gain more insight by visualizing the weights instead of just the reconstructions. I had a similar problem when my biases were misconfigured. Everything below is written based on my experiences writing my own learning library. You can see the code here on Github http://github.com/josephcatrambone/aij. Here is a screenshot of my program when there are no biases. This is after only maybe ten epochs since I'm in a hurry to finish this writeup: The weight update is done by these operations: weights.add_i(positiveProduct.subtract(negativeProduct).elementMultiply(learningRate / (float) batchSize)); //visibleBias.add_i(batch.subtract(negativeVisibleProbabilities).meanRow().elementMultiply(learningRate)); //hiddenBias.add_i(positiveHiddenProbabilities.subtract(negativeHiddenProbabilities).meanRow().elementMultiply(learningRate)); If I uncomment the visible bias code, I get this result: If I screw up the sign of the visible bias code (subtracting instead of adding): visibleBias.subtract_i(batch.subtract(negativeVisibleProbabilities).meanRow().elementMultiply(learningRate)); I get this image: Which snowballs and eventually reaches something like what you have above. Check the signage of your error functions.
Cannot make this autoencoder network function properly (with convolutional and maxpool layers) You might gain more insight by visualizing the weights instead of just the reconstructions. I had a similar problem when my biases were misconfigured. Everything below is written based on my experie
26,732
What is the mathematical definition of location / scale / shape parameters?
It is often true that these correspond to (some function of) the first, second and third moment as noted by @GuðmundurEinarsson. However, there are exceptions: For example for a Cauchy distribution Evans, Hastings, and Peacock (2000) call the first parameter a location parameter, but it represents the median instead of the mean. The mean is not even defined for a Cauchy distribution. A more encompasing but less precise description would be: the location parameter shifts the entire distribution left or right The scale parameter compresses or stretches the entire distribution the shape parameter changes the shape of the distribution in some other way. Merran Evans, Nicholas Hastings, and Brian Peacock (2000) Statistical Distributions, third edition. Wiley.
What is the mathematical definition of location / scale / shape parameters?
It is often true that these correspond to (some function of) the first, second and third moment as noted by @GuðmundurEinarsson. However, there are exceptions: For example for a Cauchy distribution Ev
What is the mathematical definition of location / scale / shape parameters? It is often true that these correspond to (some function of) the first, second and third moment as noted by @GuðmundurEinarsson. However, there are exceptions: For example for a Cauchy distribution Evans, Hastings, and Peacock (2000) call the first parameter a location parameter, but it represents the median instead of the mean. The mean is not even defined for a Cauchy distribution. A more encompasing but less precise description would be: the location parameter shifts the entire distribution left or right The scale parameter compresses or stretches the entire distribution the shape parameter changes the shape of the distribution in some other way. Merran Evans, Nicholas Hastings, and Brian Peacock (2000) Statistical Distributions, third edition. Wiley.
What is the mathematical definition of location / scale / shape parameters? It is often true that these correspond to (some function of) the first, second and third moment as noted by @GuðmundurEinarsson. However, there are exceptions: For example for a Cauchy distribution Ev
26,733
Prediction intervals for kNN regression
You've got two options, I think. Bootstrap Generate 100 synthetic data-sets by sampling with replacement from the original data-set. Run the knn regression over each new data-set and sort the point predictions. The confidence interval is just the distance between the 5th and 95th point prediction. Pseudo-Residuals Basically you either use a pooled variance estimator (if you have multiple observations at the same $x$) or pseudo-residuals to get an estimate of the variance. Assuming homoskedastic and normal error you can use the t-distribution such that: $ \bar y_i \pm t(h,\alpha) \frac{\sigma}{\sqrt{n_i}}$ Where $\bar y$ is the average predicted, $h = \frac{n-2}{n}$ is the degrees of freedome of the t-distribution and $n_i$ is the number of points in the neighborhood. You can read more about it here
Prediction intervals for kNN regression
You've got two options, I think. Bootstrap Generate 100 synthetic data-sets by sampling with replacement from the original data-set. Run the knn regression over each new data-set and sort the point
Prediction intervals for kNN regression You've got two options, I think. Bootstrap Generate 100 synthetic data-sets by sampling with replacement from the original data-set. Run the knn regression over each new data-set and sort the point predictions. The confidence interval is just the distance between the 5th and 95th point prediction. Pseudo-Residuals Basically you either use a pooled variance estimator (if you have multiple observations at the same $x$) or pseudo-residuals to get an estimate of the variance. Assuming homoskedastic and normal error you can use the t-distribution such that: $ \bar y_i \pm t(h,\alpha) \frac{\sigma}{\sqrt{n_i}}$ Where $\bar y$ is the average predicted, $h = \frac{n-2}{n}$ is the degrees of freedome of the t-distribution and $n_i$ is the number of points in the neighborhood. You can read more about it here
Prediction intervals for kNN regression You've got two options, I think. Bootstrap Generate 100 synthetic data-sets by sampling with replacement from the original data-set. Run the knn regression over each new data-set and sort the point
26,734
How many distributions are in the GLM?
As you indicate, the qualification for using a distribution in a GLM is that it be of the exponential family (note: this is not the same thing as the exponential distribution! Although the exponential distribution, as a gamma distribution, is itself part of the exponential family). The five distributions you list are all of this family, and more importantly, are VERY common distributions, so they are used as examples and explanations. As Zhanxiong notes, the uniform distribution (with unknown bounds) is a classic example of a non-exponential family distribution. shf8888 is confusing the general uniform distribution, on any interval, with a Uniform(0, 1). The Uniform(0,1) distribution is a special case of the beta distribution, which is an exponential family. Other non-exponential family distributions are mixture models and the t distribution. You have the definition of the exponential family correct, and the canonical parameter is very important for using GLM. Still, I've always found it somewhat easier to understand the exponential family by writing it as: $$f(x; \theta) = a(\theta)g(x)\exp\left[b(\theta)R(x)\right]$$ There is a more general way to write this, with a vector $\boldsymbol{\theta}$ instead of a scalar $\theta$; but the one-dimensional case explains a lot. Specifically, you must be able to factor your density's non-exponentiated part into two functions, one of unknown parameter $\theta$ but not observed data $x$ and one of $x$ and not $\theta$; and the same for the exponentiated part. It may be hard to see how, e.g., the binomial distribution can be written this way; but with some algebraic juggling, it becomes clear eventually. We use the exponential family because it makes a lot of things much easier: for instance, finding sufficient statistics and testing hypotheses. In GLM, the canonical parameter is often used for finding a link function. Finally, a related illustration of why statisticians prefer to use the exponential family in just about every case is trying to do any classical statistical inference on, say, a Uniform($\theta_1$, $\theta_2$) distribution where both $\theta_1$ and $\theta_2$ are unknown. It's not impossible, but it's much more complicated and involved than doing the same for exponential family distributions.
How many distributions are in the GLM?
As you indicate, the qualification for using a distribution in a GLM is that it be of the exponential family (note: this is not the same thing as the exponential distribution! Although the exponential
How many distributions are in the GLM? As you indicate, the qualification for using a distribution in a GLM is that it be of the exponential family (note: this is not the same thing as the exponential distribution! Although the exponential distribution, as a gamma distribution, is itself part of the exponential family). The five distributions you list are all of this family, and more importantly, are VERY common distributions, so they are used as examples and explanations. As Zhanxiong notes, the uniform distribution (with unknown bounds) is a classic example of a non-exponential family distribution. shf8888 is confusing the general uniform distribution, on any interval, with a Uniform(0, 1). The Uniform(0,1) distribution is a special case of the beta distribution, which is an exponential family. Other non-exponential family distributions are mixture models and the t distribution. You have the definition of the exponential family correct, and the canonical parameter is very important for using GLM. Still, I've always found it somewhat easier to understand the exponential family by writing it as: $$f(x; \theta) = a(\theta)g(x)\exp\left[b(\theta)R(x)\right]$$ There is a more general way to write this, with a vector $\boldsymbol{\theta}$ instead of a scalar $\theta$; but the one-dimensional case explains a lot. Specifically, you must be able to factor your density's non-exponentiated part into two functions, one of unknown parameter $\theta$ but not observed data $x$ and one of $x$ and not $\theta$; and the same for the exponentiated part. It may be hard to see how, e.g., the binomial distribution can be written this way; but with some algebraic juggling, it becomes clear eventually. We use the exponential family because it makes a lot of things much easier: for instance, finding sufficient statistics and testing hypotheses. In GLM, the canonical parameter is often used for finding a link function. Finally, a related illustration of why statisticians prefer to use the exponential family in just about every case is trying to do any classical statistical inference on, say, a Uniform($\theta_1$, $\theta_2$) distribution where both $\theta_1$ and $\theta_2$ are unknown. It's not impossible, but it's much more complicated and involved than doing the same for exponential family distributions.
How many distributions are in the GLM? As you indicate, the qualification for using a distribution in a GLM is that it be of the exponential family (note: this is not the same thing as the exponential distribution! Although the exponential
26,735
What is the correct way to determine which features most contributed to the prediction of a given input vector?
There is a way using the regression coefficients only, you can understand which features most contribute to the prediction of a given input vector. However you will have to standardize and scale each variable first (i.e. subtract the mean and divide by the standard deviation). Then refitting your model with the standardized & scaled data, the feature with the largest regression coefficient will be the feature that contributes the most to future predictions. The regression coefficients are comparable after scaling because we have made the units of the features irrelevant, thus a one unit increase in feature $X_1$ corresponds to jumping 1 standard deviation of the unscaled feature.
What is the correct way to determine which features most contributed to the prediction of a given in
There is a way using the regression coefficients only, you can understand which features most contribute to the prediction of a given input vector. However you will have to standardize and scale each
What is the correct way to determine which features most contributed to the prediction of a given input vector? There is a way using the regression coefficients only, you can understand which features most contribute to the prediction of a given input vector. However you will have to standardize and scale each variable first (i.e. subtract the mean and divide by the standard deviation). Then refitting your model with the standardized & scaled data, the feature with the largest regression coefficient will be the feature that contributes the most to future predictions. The regression coefficients are comparable after scaling because we have made the units of the features irrelevant, thus a one unit increase in feature $X_1$ corresponds to jumping 1 standard deviation of the unscaled feature.
What is the correct way to determine which features most contributed to the prediction of a given in There is a way using the regression coefficients only, you can understand which features most contribute to the prediction of a given input vector. However you will have to standardize and scale each
26,736
What is the correct way to determine which features most contributed to the prediction of a given input vector?
One method that I like to use to see which feature contribute to a specific prediction is to reset all features to their mean one by one and then see how the prediction changes. I picked up on this method from this page. But I'll explain with an example of my own as well. Say for example we have a model that predicts if a day is a good day to wear shorts based on some weather information, let's say temperature, wind and rain. and let's say we're using a method that gives us class probabilities. Now we have a day where the model is predicting 50/50 for a given day, but we wan't to know what is causing this. So we will go through each of the features, reset them to their mean (or 0) and see what the model predicts now. Say for temperature we have 20 °C, but the mean temperature is 10 °C. If we re-predict the model with the temperature for this day set to the mean of 10 °C, but keeping rain and wind at the same values, the prediction ends up being 80% for no shorts. Clearly temperature has a big effect! Now we can do the same for the other variables. The wind speed is slightly above average, and by resetting wind to the mean and keeping the others equal, the prediction only changes a little to 55% for shorts. Seems temperature is a bigger deal. Now rain is a bit of odd one, since rain is already on the mean. so resetting to the mean obviously would have no effect. But we still want to know if rain is influencing the prediction, so what we can do instead is set the rain to 0. And lo and behold, once we set rain to 0, the model predicts 75% for shorts. Again a pretty big effect. By going through each feature and and setting them to their mean or 0 we were able to identify at a prediction level which features were important. Wind and temperature both had a large effect in either direction, whilst the wind had a much smaller effect. Now why did we reset rain to 0? Doing this for temperature or wind would have been weird, since for these 0 is a value that barely ever happens and holds little significance, but for rain 0 is both relatively frequent and it means something specific, a dry day. Meaning it's sensible to reset to 0. So you really have to look at a feature by feature basis what makes sense.
What is the correct way to determine which features most contributed to the prediction of a given in
One method that I like to use to see which feature contribute to a specific prediction is to reset all features to their mean one by one and then see how the prediction changes. I picked up on this me
What is the correct way to determine which features most contributed to the prediction of a given input vector? One method that I like to use to see which feature contribute to a specific prediction is to reset all features to their mean one by one and then see how the prediction changes. I picked up on this method from this page. But I'll explain with an example of my own as well. Say for example we have a model that predicts if a day is a good day to wear shorts based on some weather information, let's say temperature, wind and rain. and let's say we're using a method that gives us class probabilities. Now we have a day where the model is predicting 50/50 for a given day, but we wan't to know what is causing this. So we will go through each of the features, reset them to their mean (or 0) and see what the model predicts now. Say for temperature we have 20 °C, but the mean temperature is 10 °C. If we re-predict the model with the temperature for this day set to the mean of 10 °C, but keeping rain and wind at the same values, the prediction ends up being 80% for no shorts. Clearly temperature has a big effect! Now we can do the same for the other variables. The wind speed is slightly above average, and by resetting wind to the mean and keeping the others equal, the prediction only changes a little to 55% for shorts. Seems temperature is a bigger deal. Now rain is a bit of odd one, since rain is already on the mean. so resetting to the mean obviously would have no effect. But we still want to know if rain is influencing the prediction, so what we can do instead is set the rain to 0. And lo and behold, once we set rain to 0, the model predicts 75% for shorts. Again a pretty big effect. By going through each feature and and setting them to their mean or 0 we were able to identify at a prediction level which features were important. Wind and temperature both had a large effect in either direction, whilst the wind had a much smaller effect. Now why did we reset rain to 0? Doing this for temperature or wind would have been weird, since for these 0 is a value that barely ever happens and holds little significance, but for rain 0 is both relatively frequent and it means something specific, a dry day. Meaning it's sensible to reset to 0. So you really have to look at a feature by feature basis what makes sense.
What is the correct way to determine which features most contributed to the prediction of a given in One method that I like to use to see which feature contribute to a specific prediction is to reset all features to their mean one by one and then see how the prediction changes. I picked up on this me
26,737
How to test if "previous state" has influence on "subsequent state" in R
My best try: ...usage of transition matrices suggested by @AndyW is probably not the solution I am looking for (based on @Tim's comment). So I've tried a different approach. I found this link which deals with how to do logistic regression where response variable y and a predictor variable x are both binary. According to example I should create 2 × 2 table based on my data: gold (yes) gold (no) silver (yes) 2 7 silver (no) 14 34 How I extracted the values: And construct a model: response <- cbind(yes = c(2, 14), no = c(7, 34)) mine.logistic <- glm(response ~ as.factor(c(0,1)), family = binomial(link=logit)) summary(mine.logistic) # Coefficients: # Estimate Std. Error z value Pr(>|z|) # (Intercept) -1.2528 0.8018 -1.562 0.118 # as.factor(c(0, 1))1 0.3655 0.8624 0.424 0.672 Is it a good solution? Does the p-value (0.673) mean that presence of silver no not increase the probability of finding gold?
How to test if "previous state" has influence on "subsequent state" in R
My best try: ...usage of transition matrices suggested by @AndyW is probably not the solution I am looking for (based on @Tim's comment). So I've tried a different approach. I found this link which de
How to test if "previous state" has influence on "subsequent state" in R My best try: ...usage of transition matrices suggested by @AndyW is probably not the solution I am looking for (based on @Tim's comment). So I've tried a different approach. I found this link which deals with how to do logistic regression where response variable y and a predictor variable x are both binary. According to example I should create 2 × 2 table based on my data: gold (yes) gold (no) silver (yes) 2 7 silver (no) 14 34 How I extracted the values: And construct a model: response <- cbind(yes = c(2, 14), no = c(7, 34)) mine.logistic <- glm(response ~ as.factor(c(0,1)), family = binomial(link=logit)) summary(mine.logistic) # Coefficients: # Estimate Std. Error z value Pr(>|z|) # (Intercept) -1.2528 0.8018 -1.562 0.118 # as.factor(c(0, 1))1 0.3655 0.8624 0.424 0.672 Is it a good solution? Does the p-value (0.673) mean that presence of silver no not increase the probability of finding gold?
How to test if "previous state" has influence on "subsequent state" in R My best try: ...usage of transition matrices suggested by @AndyW is probably not the solution I am looking for (based on @Tim's comment). So I've tried a different approach. I found this link which de
26,738
calculation threshold for minimum risk classifier?
For a cost matrix $$L= \begin{bmatrix} 0 & 0.5 \\ 1 & 0 \end{bmatrix} \begin{matrix} c_1 \\ c_2 \end{matrix} \;\text{prediction} \\ \hspace{-1.9cm} \begin{matrix} c_1 & c_2 \end{matrix} \\ \hspace{-1.9cm}\text{truth}$$ the loss of predicting class $c_1$ when the truth is class $c_2$ is $L_{12} = 0.5$, and the cost of predicting class $c_2$ when the truth is class $c_1$ is $L_{21} = 1$. There is no cost for correct predictions, $L_{11} = L_{22} = 0$. The conditional risk $R$ for predicting either class $k$ is then $$ \begin{align} R(c_1|x) &= L_{11} \Pr (c_1|x) + L_{12} \Pr (c_2|x) = L_{12} \Pr (c_2|x) \\ R(c_2|x) &= L_{22} \Pr (c_2|x) + L_{21} \Pr (c_1|x) = L_{21} \Pr (c_1|x) \end{align} $$ For a reference see these notes on page 15. In order to minimize the risk/loss you predict $c_1$ if the cost from the mistake of doing so (that's the loss of the wrong prediction times the posterior probability that the prediction is wrong $L_{12} \Pr (c_2|x)$) is smaller than the cost of wrongfully predicting the alternative, $$ \begin{align} L_{12} \Pr (c_2|x) &< L_{21} \Pr (c_1|x) \\ L_{12} \Pr (x|c_2) \Pr (c_2) &< L_{21} \Pr (x|c_1) \Pr (c_1) \\ \frac{L_{12} \Pr (c_2)}{L_{21} \Pr (c_1)} &< \frac{\Pr (x|c_1)}{ \Pr (x|c_2)} \end{align} $$ where the second line uses Bayes' rule $\Pr (c_2|x) \propto \Pr (x|c_2) \Pr (c_2)$. Given equal prior probabilities $\Pr (c_1) = \Pr (c_2) = 0.5$ you get $$\frac{1}{2} < \frac{\Pr (x|c_1)}{ \Pr (x|c_2)}$$ so you choose to classify an observation as $c_1$ is the likelihood ratio exceeds this threshold. Now it is not clear to me whether you wanted to know the "best threshold" in terms of the likelihood ratios or in terms of the attribute $x$. The answer changes according to the cost function. Using the Gaussian in the inequality with $\sigma_1 = \sigma_2 = \sigma$ and $\mu_1 = 0$, $\mu_2 = 1$, $$ \begin{align} \frac{1}{2} &< \frac{\frac{1}{\sqrt{2\pi}\sigma}\exp \left[ -\frac{1}{2\sigma^2}(x-\mu_1)^2 \right]}{\frac{1}{\sqrt{2\pi}\sigma}\exp \left[ -\frac{1}{2\sigma^2}(x-\mu_2)^2 \right]} \\ \log \left(\frac{1}{2}\right) &< \log \left(\frac{1}{\sqrt{2\pi}\sigma}\right) -\frac{1}{2\sigma^2}(x-0)^2 - \left[ \log \left(\frac{1}{\sqrt{2\pi}\sigma}\right) -\frac{1}{2\sigma^2}(x-1)^2 \right] \\ \log \left(\frac{1}{2}\right) &< -\frac{x^2}{2\sigma^2} + \frac{x^2}{2\sigma^2} - \frac{2x}{2\sigma^2} + \frac{1}{2\sigma^2} \\ \frac{x}{\sigma^2} &< \frac{1}{2\sigma^2} - \log \left(\frac{1}{2}\right) \\ x &< \frac{1}{2} - \log \left(\frac{1}{2}\right) \sigma^2 \end{align} $$ so a prediction threshold in terms of $x$ as you search for can only be achieved if the losses from false predictions are the same, i.e. $L_{12} = L_{21}$ because only then can you have $\log \left( \frac{L_{12}}{L_{21}} \right) = \log (1) = 0$ and you get the $x_0 < \frac{1}{2}$.
calculation threshold for minimum risk classifier?
For a cost matrix $$L= \begin{bmatrix} 0 & 0.5 \\ 1 & 0 \end{bmatrix} \begin{matrix} c_1 \\ c_2 \end{matrix} \;\text{prediction} \\ \hspace{-1.9cm} \begin{matrix} c_1 & c_2 \end{matrix} \\ \hspace{-
calculation threshold for minimum risk classifier? For a cost matrix $$L= \begin{bmatrix} 0 & 0.5 \\ 1 & 0 \end{bmatrix} \begin{matrix} c_1 \\ c_2 \end{matrix} \;\text{prediction} \\ \hspace{-1.9cm} \begin{matrix} c_1 & c_2 \end{matrix} \\ \hspace{-1.9cm}\text{truth}$$ the loss of predicting class $c_1$ when the truth is class $c_2$ is $L_{12} = 0.5$, and the cost of predicting class $c_2$ when the truth is class $c_1$ is $L_{21} = 1$. There is no cost for correct predictions, $L_{11} = L_{22} = 0$. The conditional risk $R$ for predicting either class $k$ is then $$ \begin{align} R(c_1|x) &= L_{11} \Pr (c_1|x) + L_{12} \Pr (c_2|x) = L_{12} \Pr (c_2|x) \\ R(c_2|x) &= L_{22} \Pr (c_2|x) + L_{21} \Pr (c_1|x) = L_{21} \Pr (c_1|x) \end{align} $$ For a reference see these notes on page 15. In order to minimize the risk/loss you predict $c_1$ if the cost from the mistake of doing so (that's the loss of the wrong prediction times the posterior probability that the prediction is wrong $L_{12} \Pr (c_2|x)$) is smaller than the cost of wrongfully predicting the alternative, $$ \begin{align} L_{12} \Pr (c_2|x) &< L_{21} \Pr (c_1|x) \\ L_{12} \Pr (x|c_2) \Pr (c_2) &< L_{21} \Pr (x|c_1) \Pr (c_1) \\ \frac{L_{12} \Pr (c_2)}{L_{21} \Pr (c_1)} &< \frac{\Pr (x|c_1)}{ \Pr (x|c_2)} \end{align} $$ where the second line uses Bayes' rule $\Pr (c_2|x) \propto \Pr (x|c_2) \Pr (c_2)$. Given equal prior probabilities $\Pr (c_1) = \Pr (c_2) = 0.5$ you get $$\frac{1}{2} < \frac{\Pr (x|c_1)}{ \Pr (x|c_2)}$$ so you choose to classify an observation as $c_1$ is the likelihood ratio exceeds this threshold. Now it is not clear to me whether you wanted to know the "best threshold" in terms of the likelihood ratios or in terms of the attribute $x$. The answer changes according to the cost function. Using the Gaussian in the inequality with $\sigma_1 = \sigma_2 = \sigma$ and $\mu_1 = 0$, $\mu_2 = 1$, $$ \begin{align} \frac{1}{2} &< \frac{\frac{1}{\sqrt{2\pi}\sigma}\exp \left[ -\frac{1}{2\sigma^2}(x-\mu_1)^2 \right]}{\frac{1}{\sqrt{2\pi}\sigma}\exp \left[ -\frac{1}{2\sigma^2}(x-\mu_2)^2 \right]} \\ \log \left(\frac{1}{2}\right) &< \log \left(\frac{1}{\sqrt{2\pi}\sigma}\right) -\frac{1}{2\sigma^2}(x-0)^2 - \left[ \log \left(\frac{1}{\sqrt{2\pi}\sigma}\right) -\frac{1}{2\sigma^2}(x-1)^2 \right] \\ \log \left(\frac{1}{2}\right) &< -\frac{x^2}{2\sigma^2} + \frac{x^2}{2\sigma^2} - \frac{2x}{2\sigma^2} + \frac{1}{2\sigma^2} \\ \frac{x}{\sigma^2} &< \frac{1}{2\sigma^2} - \log \left(\frac{1}{2}\right) \\ x &< \frac{1}{2} - \log \left(\frac{1}{2}\right) \sigma^2 \end{align} $$ so a prediction threshold in terms of $x$ as you search for can only be achieved if the losses from false predictions are the same, i.e. $L_{12} = L_{21}$ because only then can you have $\log \left( \frac{L_{12}}{L_{21}} \right) = \log (1) = 0$ and you get the $x_0 < \frac{1}{2}$.
calculation threshold for minimum risk classifier? For a cost matrix $$L= \begin{bmatrix} 0 & 0.5 \\ 1 & 0 \end{bmatrix} \begin{matrix} c_1 \\ c_2 \end{matrix} \;\text{prediction} \\ \hspace{-1.9cm} \begin{matrix} c_1 & c_2 \end{matrix} \\ \hspace{-
26,739
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable
In a case like yours, where you have a relatively simple, but "non-standard" generative model that you'd like to estimate parameters for, my first thought would be to use a Bayesian inference program like Stan. The description you've given would translate very cleanly to a Stan model. Some example R code, using RStan (the R interface to Stan). library(rstan) model_code <- " data { int<lower=0> n; // number of observations real y[n]; real x[n]; } parameters { real mu; // I've assumed mu is to be fit. // Move this to the data section if you know the value of mu. real<lower=0> a; real<lower=0> b; } transformed parameters { real sigma[n]; for (i in 1:n) { sigma[i] <- a + b * fabs(x[i]); } } model { y ~ normal(mu, sigma); } " # Let's generate some test data with known parameters mu <- 0 a <- 2 b <- 1 n <- 30 x <- runif(n, -3, 3) sigma <- a + b * abs(x) y <- rnorm(n, mu, sigma) # And now let's fit our model to those "observations" fit <- stan(model_code=model_code, data=list(n=n, x=x, y=y)) print(fit, pars=c("a", "b", "mu"), digits=1) You'll get output that looks something like this (although your random numbers will probably be different to mine): Inference for Stan model: model_code. 4 chains, each with iter=2000; warmup=1000; thin=1; post-warmup draws per chain=1000, total post-warmup draws=4000. mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhat a 2.3 0 0.7 1.2 1.8 2.2 2.8 3.9 1091 1 b 0.9 0 0.5 0.1 0.6 0.9 1.2 1.9 1194 1 mu 0.1 0 0.6 -1.1 -0.3 0.1 0.5 1.4 1262 1 Samples were drawn using NUTS(diag_e) at Thu Jan 22 14:26:16 2015. For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1). The model has converged well (Rhat=1), and the effective sample size (n_eff) is reasonably large in all cases, so on a technical level the model is well-behaved. The best estimates of $a$, $b$ and $\mu$ (in the mean column) are also fairly close to what was provided.
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable
In a case like yours, where you have a relatively simple, but "non-standard" generative model that you'd like to estimate parameters for, my first thought would be to use a Bayesian inference program
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable In a case like yours, where you have a relatively simple, but "non-standard" generative model that you'd like to estimate parameters for, my first thought would be to use a Bayesian inference program like Stan. The description you've given would translate very cleanly to a Stan model. Some example R code, using RStan (the R interface to Stan). library(rstan) model_code <- " data { int<lower=0> n; // number of observations real y[n]; real x[n]; } parameters { real mu; // I've assumed mu is to be fit. // Move this to the data section if you know the value of mu. real<lower=0> a; real<lower=0> b; } transformed parameters { real sigma[n]; for (i in 1:n) { sigma[i] <- a + b * fabs(x[i]); } } model { y ~ normal(mu, sigma); } " # Let's generate some test data with known parameters mu <- 0 a <- 2 b <- 1 n <- 30 x <- runif(n, -3, 3) sigma <- a + b * abs(x) y <- rnorm(n, mu, sigma) # And now let's fit our model to those "observations" fit <- stan(model_code=model_code, data=list(n=n, x=x, y=y)) print(fit, pars=c("a", "b", "mu"), digits=1) You'll get output that looks something like this (although your random numbers will probably be different to mine): Inference for Stan model: model_code. 4 chains, each with iter=2000; warmup=1000; thin=1; post-warmup draws per chain=1000, total post-warmup draws=4000. mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhat a 2.3 0 0.7 1.2 1.8 2.2 2.8 3.9 1091 1 b 0.9 0 0.5 0.1 0.6 0.9 1.2 1.9 1194 1 mu 0.1 0 0.6 -1.1 -0.3 0.1 0.5 1.4 1262 1 Samples were drawn using NUTS(diag_e) at Thu Jan 22 14:26:16 2015. For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1). The model has converged well (Rhat=1), and the effective sample size (n_eff) is reasonably large in all cases, so on a technical level the model is well-behaved. The best estimates of $a$, $b$ and $\mu$ (in the mean column) are also fairly close to what was provided.
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable In a case like yours, where you have a relatively simple, but "non-standard" generative model that you'd like to estimate parameters for, my first thought would be to use a Bayesian inference program
26,740
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable
You cannot expect closed formulas, but you can still write down the likelihood function and maximize it numerically. Your model is $$ \newcommand{\dist}{\sim} Y \dist N(\mu, a|x|+b) $$ Then the loglikelihoodfunction (apart from a term not depending on parameters) becomes $$ l(\mu, a, b) = -\sum \ln(a|x_i|+b) -\frac12\sum\left(\frac{y_i-\mu}{a|x_i|+b}\right)^2 $$ and that is easy to program and give to a numerical optimizer. In R, we can do make_lik <- function(x,y){ x <- abs(x) function(par) { mu <- par[1];a <- par[2]; b <- par[3] axpb <- a*x+b -sum(log(axpb)) -0.5*sum( ((y-mu)/axpb)^2 ) } } Then simulate some data: > x <- rep(c(2,4,6,8),10) > x [1] 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 [39] 6 8 > a <- 1 > b<- 3 > sigma <- a*x+b > mu <- 10 > y <- rnorm(40,mu, sd=sigma) Then make the loglikelihood function: > lik <- make_lik(x,y) > lik(c(10,1,3)) [1] -99.53438 Then optimize it: > optim(c(9.5,1.2,3.1),fn=function(par)-lik(par)) $par [1] 9.275943 1.043019 2.392660 $value [1] 99.12962 $counts function gradient 136 NA $convergence [1] 0 $message NULL
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable
You cannot expect closed formulas, but you can still write down the likelihood function and maximize it numerically. Your model is $$ \newcommand{\dist}{\sim} Y \dist N(\mu, a|x|+b) $$ Then the logli
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable You cannot expect closed formulas, but you can still write down the likelihood function and maximize it numerically. Your model is $$ \newcommand{\dist}{\sim} Y \dist N(\mu, a|x|+b) $$ Then the loglikelihoodfunction (apart from a term not depending on parameters) becomes $$ l(\mu, a, b) = -\sum \ln(a|x_i|+b) -\frac12\sum\left(\frac{y_i-\mu}{a|x_i|+b}\right)^2 $$ and that is easy to program and give to a numerical optimizer. In R, we can do make_lik <- function(x,y){ x <- abs(x) function(par) { mu <- par[1];a <- par[2]; b <- par[3] axpb <- a*x+b -sum(log(axpb)) -0.5*sum( ((y-mu)/axpb)^2 ) } } Then simulate some data: > x <- rep(c(2,4,6,8),10) > x [1] 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 [39] 6 8 > a <- 1 > b<- 3 > sigma <- a*x+b > mu <- 10 > y <- rnorm(40,mu, sd=sigma) Then make the loglikelihood function: > lik <- make_lik(x,y) > lik(c(10,1,3)) [1] -99.53438 Then optimize it: > optim(c(9.5,1.2,3.1),fn=function(par)-lik(par)) $par [1] 9.275943 1.043019 2.392660 $value [1] 99.12962 $counts function gradient 136 NA $convergence [1] 0 $message NULL
Estimate The Rate At Which Standard Deviation Scales With An Independent Variable You cannot expect closed formulas, but you can still write down the likelihood function and maximize it numerically. Your model is $$ \newcommand{\dist}{\sim} Y \dist N(\mu, a|x|+b) $$ Then the logli
26,741
Hypothesis Testing and the Scientific Method
These issues have been known for a long time, it started in education research, psychology and has since spread to even physics. There is no one in particular to blame and apparently nothing can stop it. We are quite in danger of sending highly trained and highly intelligent young men out into the world with tables of erroneous numbers under their arms, and with a dense fog in the place where their brains ought to be. In this century, of course, they will be working on guided missiles and advising the medical profession on the control of disease, and there is no limit to the extent to which they could impede every sort of national effort. Fisher, R N (1958). "The Nature of Probability". Centennial Review 2: 261–274. The usual application of statistics in psychology consists of testing a "null hypothesis" that the investigator hopes is false. For example, he tests the hypothesis that the ex perimental group is the same as the control group even though he has done his best to make them perform differently.Then a "significant" difference is obtained which shows that the data do not agree with the hypothesis tested. The experimenter is then pleased because he has shown that a hypothesis he didn't believe, isn't true. Having found a "significant difference," the more important next step should not be neglected. Namely, formulate a hypothesis that the scientist does believe and show that the data do not differ significantly from it. This is an indica tion that the newer hypothesis may be regarded as true. A definite scientific advance has been achieved. MATHEMATICAL SOLUTIONS FOR PSYCHOLOGICAL PROBLEMS. HAROLD GULLIKSEN. American Scientist,Vol. 47, No. 2 (JUNE 1959), pp. 178-201 The major point of this paper is that the test of significance does not provide the information concerning psychological phenomena characteristically attributed to it; and that, furthermore, a great deal of mischief has been associated with its use. What will be said in this paper is hardly original. It is, in a certain sense, what "everybody knows." To say it "out loud" is, as it were, to assume the role of the child who pointed out that the emperor was really outfitted only in his underwear. Little of that which is contained in this paper is not already available in the literature, and the literature will be cited. THE TEST OF SIGNIFICANCE IN PSYCHOLOGICAL RESEARCH. DAVID BAKAN. Psychological Bulletin. VOL. 66, No. 6. DECEMBER 1966. The puzzle, sufficiently striking (when clearly discerned) to be entitled to the designation “paradox,” is the follow- ing: In the physical sciences, the usual result of an improvement in experimental design, instrumentation, or numerical mass of data, is to increase the difficulty of the “observational hurdle” which the physical theory of interest must successfully surmount; whereas, in psychology and some of the allied behavior sciences, the usual effect of such improvement in experimental precision is to provide an easier hurdle for the theory to surmount. Hence what we would normally think of as improve- ments in our experimental method tend (when predictions materialize) to yieldstronger corroboration of the theory in physics, since to remain unrefuted the theory must have survived a more difficult test; by contrast, such experimental improvement in psychology typically results in a weaker corroboration of the theory, since it has now been required to survive a more lenient test. THEORY-TESTING IN PSYCHOLOGY AND PHYSICS: A METHODOLOGICAL PARADOX. PAUL E. MEEHL. Philosophy of Science, 1967, Vol. 34, 103–115.
Hypothesis Testing and the Scientific Method
These issues have been known for a long time, it started in education research, psychology and has since spread to even physics. There is no one in particular to blame and apparently nothing can stop
Hypothesis Testing and the Scientific Method These issues have been known for a long time, it started in education research, psychology and has since spread to even physics. There is no one in particular to blame and apparently nothing can stop it. We are quite in danger of sending highly trained and highly intelligent young men out into the world with tables of erroneous numbers under their arms, and with a dense fog in the place where their brains ought to be. In this century, of course, they will be working on guided missiles and advising the medical profession on the control of disease, and there is no limit to the extent to which they could impede every sort of national effort. Fisher, R N (1958). "The Nature of Probability". Centennial Review 2: 261–274. The usual application of statistics in psychology consists of testing a "null hypothesis" that the investigator hopes is false. For example, he tests the hypothesis that the ex perimental group is the same as the control group even though he has done his best to make them perform differently.Then a "significant" difference is obtained which shows that the data do not agree with the hypothesis tested. The experimenter is then pleased because he has shown that a hypothesis he didn't believe, isn't true. Having found a "significant difference," the more important next step should not be neglected. Namely, formulate a hypothesis that the scientist does believe and show that the data do not differ significantly from it. This is an indica tion that the newer hypothesis may be regarded as true. A definite scientific advance has been achieved. MATHEMATICAL SOLUTIONS FOR PSYCHOLOGICAL PROBLEMS. HAROLD GULLIKSEN. American Scientist,Vol. 47, No. 2 (JUNE 1959), pp. 178-201 The major point of this paper is that the test of significance does not provide the information concerning psychological phenomena characteristically attributed to it; and that, furthermore, a great deal of mischief has been associated with its use. What will be said in this paper is hardly original. It is, in a certain sense, what "everybody knows." To say it "out loud" is, as it were, to assume the role of the child who pointed out that the emperor was really outfitted only in his underwear. Little of that which is contained in this paper is not already available in the literature, and the literature will be cited. THE TEST OF SIGNIFICANCE IN PSYCHOLOGICAL RESEARCH. DAVID BAKAN. Psychological Bulletin. VOL. 66, No. 6. DECEMBER 1966. The puzzle, sufficiently striking (when clearly discerned) to be entitled to the designation “paradox,” is the follow- ing: In the physical sciences, the usual result of an improvement in experimental design, instrumentation, or numerical mass of data, is to increase the difficulty of the “observational hurdle” which the physical theory of interest must successfully surmount; whereas, in psychology and some of the allied behavior sciences, the usual effect of such improvement in experimental precision is to provide an easier hurdle for the theory to surmount. Hence what we would normally think of as improve- ments in our experimental method tend (when predictions materialize) to yieldstronger corroboration of the theory in physics, since to remain unrefuted the theory must have survived a more difficult test; by contrast, such experimental improvement in psychology typically results in a weaker corroboration of the theory, since it has now been required to survive a more lenient test. THEORY-TESTING IN PSYCHOLOGY AND PHYSICS: A METHODOLOGICAL PARADOX. PAUL E. MEEHL. Philosophy of Science, 1967, Vol. 34, 103–115.
Hypothesis Testing and the Scientific Method These issues have been known for a long time, it started in education research, psychology and has since spread to even physics. There is no one in particular to blame and apparently nothing can stop
26,742
References and Best practices for setting seeds in pseudo-Random Number Generation
For what it's worth, this is based on experience and not on mathematical analysis: I think that unless you're doing cryptography, where subtle patterns can be very bad, which seed you set doesn't make a difference, as long as you use accepted good PRNGs like Mersenne Twister and not old ones like linear congruential generators. As far as I know, there is no way that you can tell what random number will come out from a given seed without actually running the PRNG (assuming it's a decent one), otherwise you would just take that new algorithm and use that as your random number generator. Another perspective: do you think that any subtle patterns in your Monte-Carlo simulation are likely to be of a larger magnitude than all the measurement error, confounding, and error introduces by other modeling assumptions? I would just use one random seed at the beginning for reproducibility, and not set one before each call, unless I'm doing debugging, where I need to make sure two different algorithms produce the same result for the exact same input data. Disclaimer: if you simulating nuclear reactors or missile control systems or weather forecasting, best to consult domain experts, I take no responsibility in that case.
References and Best practices for setting seeds in pseudo-Random Number Generation
For what it's worth, this is based on experience and not on mathematical analysis: I think that unless you're doing cryptography, where subtle patterns can be very bad, which seed you set doesn't make
References and Best practices for setting seeds in pseudo-Random Number Generation For what it's worth, this is based on experience and not on mathematical analysis: I think that unless you're doing cryptography, where subtle patterns can be very bad, which seed you set doesn't make a difference, as long as you use accepted good PRNGs like Mersenne Twister and not old ones like linear congruential generators. As far as I know, there is no way that you can tell what random number will come out from a given seed without actually running the PRNG (assuming it's a decent one), otherwise you would just take that new algorithm and use that as your random number generator. Another perspective: do you think that any subtle patterns in your Monte-Carlo simulation are likely to be of a larger magnitude than all the measurement error, confounding, and error introduces by other modeling assumptions? I would just use one random seed at the beginning for reproducibility, and not set one before each call, unless I'm doing debugging, where I need to make sure two different algorithms produce the same result for the exact same input data. Disclaimer: if you simulating nuclear reactors or missile control systems or weather forecasting, best to consult domain experts, I take no responsibility in that case.
References and Best practices for setting seeds in pseudo-Random Number Generation For what it's worth, this is based on experience and not on mathematical analysis: I think that unless you're doing cryptography, where subtle patterns can be very bad, which seed you set doesn't make
26,743
What is the mathematical difference between using a un-informative prior and a frequentist approach?
Even with a non-informative prior, Bayesian inference is different from frequentist approaches. For example, consider estimating the probability $\theta$ that a coin will turn up heads. Take a uniform prior on $\theta$. If we observe a single flip, and it is heads, the Bayesian predictive probability that the next flip will be heads is 2/3. A maximum-likelihood approach would say the probability is 1. If you want the derivation of this result, read Bayesian inference, entropy, and the multinomial distribution. I have written several papers on exactly this topic. If you want more examples, check out: Pathologies of Orthodox Statistics, Inferring a Gaussian distribution and Bayesian inference of a uniform distribution.
What is the mathematical difference between using a un-informative prior and a frequentist approach?
Even with a non-informative prior, Bayesian inference is different from frequentist approaches. For example, consider estimating the probability $\theta$ that a coin will turn up heads. Take a unifo
What is the mathematical difference between using a un-informative prior and a frequentist approach? Even with a non-informative prior, Bayesian inference is different from frequentist approaches. For example, consider estimating the probability $\theta$ that a coin will turn up heads. Take a uniform prior on $\theta$. If we observe a single flip, and it is heads, the Bayesian predictive probability that the next flip will be heads is 2/3. A maximum-likelihood approach would say the probability is 1. If you want the derivation of this result, read Bayesian inference, entropy, and the multinomial distribution. I have written several papers on exactly this topic. If you want more examples, check out: Pathologies of Orthodox Statistics, Inferring a Gaussian distribution and Bayesian inference of a uniform distribution.
What is the mathematical difference between using a un-informative prior and a frequentist approach? Even with a non-informative prior, Bayesian inference is different from frequentist approaches. For example, consider estimating the probability $\theta$ that a coin will turn up heads. Take a unifo
26,744
What is the mathematical difference between using a un-informative prior and a frequentist approach?
It's for methodological purists who cannot bear to use boring 'ol frequentist stats with all their "horrible" inconsistencies (forget the fact that uninformative priors are often improper!). Seriously, though: An uninformed Bayesian posterior distribution will look an awful lot like a normalized likelihood function, whereas a frequentist would report the usual confidence interval. Since frequentist inference does not obey the likelihood "principle", the two answers may be quite different.
What is the mathematical difference between using a un-informative prior and a frequentist approach?
It's for methodological purists who cannot bear to use boring 'ol frequentist stats with all their "horrible" inconsistencies (forget the fact that uninformative priors are often improper!). Seriously
What is the mathematical difference between using a un-informative prior and a frequentist approach? It's for methodological purists who cannot bear to use boring 'ol frequentist stats with all their "horrible" inconsistencies (forget the fact that uninformative priors are often improper!). Seriously, though: An uninformed Bayesian posterior distribution will look an awful lot like a normalized likelihood function, whereas a frequentist would report the usual confidence interval. Since frequentist inference does not obey the likelihood "principle", the two answers may be quite different.
What is the mathematical difference between using a un-informative prior and a frequentist approach? It's for methodological purists who cannot bear to use boring 'ol frequentist stats with all their "horrible" inconsistencies (forget the fact that uninformative priors are often improper!). Seriously
26,745
When is a proper scoring rule a better estimate of generalization in a classification setting?
Think of this as a comparison between the $t$-test/Wilcoxon test and the Mood median test. The median test uses optimum classification (above or below the median for a continuous variable) so that it only loses $\frac{1}{\pi}$ of the information in the sample. Dichotomization at a point different from the median will lose much more information. Using an improper scoring rule such as proportion classified "correctly" is at most $\frac{2}{\pi}$ or about $\frac{2}{3}$ efficient. This results in selection of the wrong features and finding a model that is bogus.
When is a proper scoring rule a better estimate of generalization in a classification setting?
Think of this as a comparison between the $t$-test/Wilcoxon test and the Mood median test. The median test uses optimum classification (above or below the median for a continuous variable) so that it
When is a proper scoring rule a better estimate of generalization in a classification setting? Think of this as a comparison between the $t$-test/Wilcoxon test and the Mood median test. The median test uses optimum classification (above or below the median for a continuous variable) so that it only loses $\frac{1}{\pi}$ of the information in the sample. Dichotomization at a point different from the median will lose much more information. Using an improper scoring rule such as proportion classified "correctly" is at most $\frac{2}{\pi}$ or about $\frac{2}{3}$ efficient. This results in selection of the wrong features and finding a model that is bogus.
When is a proper scoring rule a better estimate of generalization in a classification setting? Think of this as a comparison between the $t$-test/Wilcoxon test and the Mood median test. The median test uses optimum classification (above or below the median for a continuous variable) so that it
26,746
Probability of intersection from multiple sampling of the same population
Compute the chances recursively. Let $p_s(x)$ be the probability that exactly $x$ values, $0 \le x \le k$, are selected in all $s\ge 1$ independent draws of $k$ items (without replacement) from a population of $n \ge k \gt 0$ members. (Let's hold $n$ and $k$ fixed for the duration of the analysis so they don't have to be mentioned explicitly.) Let $p_s(x\mid y)$ be the probability that if exactly $y$ values are selected in the first $s-1$ draws, then $x \le y$ of them are selected in the last draw. Then because there are $\binom{y}{x}$ subsets of $x$ elements of those $y$ elements, and $\binom{n-y}{k-x}$ subsets of the remaining $k-x$ elements are separately selected out of the other $n-y$ members of the population, $$p_s(x\mid y) = \frac{\binom{y}{x}\binom{n-y}{k-x}}{ \binom{n}{k}}.$$ The law of total probability asserts $$p_s(x) = \sum_{y=x}^k p_s(x\mid y) p_{s-1}(y).$$ For $s=1$, it's a certainty that $x=k$: this is the starting distribution. The total computation needed to obtain the full distribution up through $s$ repetitions is $O(k^2 s)$. Not only is that reasonably quick, the algorithm is easy. One pitfall awaiting the unwary programmer is that these probabilities can become extremely small and underflow floating-point calculations. The following R implementation avoids this by computing the values of $\log(p_s(x))$ in columns $1, 2, \ldots, s$ of an array. lp <- function(s, n, k) { P <- matrix(NA, nrow=k+1, ncol=s, dimnames=list(0:k, 1:s)) P[, 1] <- c(rep(-Inf, k), 0) for (u in 2:s) for (i in 0:k) { q <- P[i:k+1, u-1] + lchoose(i:k, i) + lchoose(n-(i:k), k-i) - lchoose(n, k) q.0 <- max(q, na.rm=TRUE) P[i+1, u] <- q.0 + log(sum(exp(q - q.0))) } return(P) } p <- function(...) zapsmall(exp(lp(...))) The answer to the question is obtained by letting $s=5,$ $n=10000=10^4$, and $k=100=10^2$. The output is a $101\times 5$ array, but most of the numbers are so small we may focus on very small $x$. Here are the first four rows corresponding to $x=0,1,2,3$: p(5, 1e4, 1e2)[1:4, ] The output is 1 2 3 4 5 0 0 0.3641945 0.9900484 0.9999 0.999999 1 0 0.3715891 0.0099034 0.0001 0.000001 2 0 0.1857756 0.0000481 0.0000 0.000000 3 0 0.0606681 0.0000002 0.0000 0.000000 Values of $x$ label the rows while values of $s$ label the columns. Column 5 shows the chance that one element appears in all five samples is minuscule (about one in a million) and there's essentially no chance that two or more elements appear in all five samples. If you would like to see just how small these chances are, look at their logarithms. Base 10 is convenient and we don't need many digits: u <- lp(5, 1e4, 1e2)[, 5] signif(-u[-1] / log(10), 3) The output tells us how many zeros there are after the decimal point: 1 2 3 4 5 6 7 8 9 10 ... 97 98 99 100 6.0 12.3 18.8 25.5 32.3 39.2 46.2 53.2 60.4 67.6 ... 917.0 933.0 949.0 967.0 Numbers in the top row are values of $x$. For instance, the chance of exactly three values showing up in all five samples is found by computing exp(u[4]), giving $0.000\,000\,000\,000\,000\,000\,1434419\ldots$ and indeed this has $18$ zeros before the first significant digit. As a check, the last value $967.0$ is a rounded version of $967.26$. $\binom{10000}{100}^{-4}$ (which counts the chances that the first sample reappears in the next four samples) equals $10^{-967.26}.$
Probability of intersection from multiple sampling of the same population
Compute the chances recursively. Let $p_s(x)$ be the probability that exactly $x$ values, $0 \le x \le k$, are selected in all $s\ge 1$ independent draws of $k$ items (without replacement) from a popu
Probability of intersection from multiple sampling of the same population Compute the chances recursively. Let $p_s(x)$ be the probability that exactly $x$ values, $0 \le x \le k$, are selected in all $s\ge 1$ independent draws of $k$ items (without replacement) from a population of $n \ge k \gt 0$ members. (Let's hold $n$ and $k$ fixed for the duration of the analysis so they don't have to be mentioned explicitly.) Let $p_s(x\mid y)$ be the probability that if exactly $y$ values are selected in the first $s-1$ draws, then $x \le y$ of them are selected in the last draw. Then because there are $\binom{y}{x}$ subsets of $x$ elements of those $y$ elements, and $\binom{n-y}{k-x}$ subsets of the remaining $k-x$ elements are separately selected out of the other $n-y$ members of the population, $$p_s(x\mid y) = \frac{\binom{y}{x}\binom{n-y}{k-x}}{ \binom{n}{k}}.$$ The law of total probability asserts $$p_s(x) = \sum_{y=x}^k p_s(x\mid y) p_{s-1}(y).$$ For $s=1$, it's a certainty that $x=k$: this is the starting distribution. The total computation needed to obtain the full distribution up through $s$ repetitions is $O(k^2 s)$. Not only is that reasonably quick, the algorithm is easy. One pitfall awaiting the unwary programmer is that these probabilities can become extremely small and underflow floating-point calculations. The following R implementation avoids this by computing the values of $\log(p_s(x))$ in columns $1, 2, \ldots, s$ of an array. lp <- function(s, n, k) { P <- matrix(NA, nrow=k+1, ncol=s, dimnames=list(0:k, 1:s)) P[, 1] <- c(rep(-Inf, k), 0) for (u in 2:s) for (i in 0:k) { q <- P[i:k+1, u-1] + lchoose(i:k, i) + lchoose(n-(i:k), k-i) - lchoose(n, k) q.0 <- max(q, na.rm=TRUE) P[i+1, u] <- q.0 + log(sum(exp(q - q.0))) } return(P) } p <- function(...) zapsmall(exp(lp(...))) The answer to the question is obtained by letting $s=5,$ $n=10000=10^4$, and $k=100=10^2$. The output is a $101\times 5$ array, but most of the numbers are so small we may focus on very small $x$. Here are the first four rows corresponding to $x=0,1,2,3$: p(5, 1e4, 1e2)[1:4, ] The output is 1 2 3 4 5 0 0 0.3641945 0.9900484 0.9999 0.999999 1 0 0.3715891 0.0099034 0.0001 0.000001 2 0 0.1857756 0.0000481 0.0000 0.000000 3 0 0.0606681 0.0000002 0.0000 0.000000 Values of $x$ label the rows while values of $s$ label the columns. Column 5 shows the chance that one element appears in all five samples is minuscule (about one in a million) and there's essentially no chance that two or more elements appear in all five samples. If you would like to see just how small these chances are, look at their logarithms. Base 10 is convenient and we don't need many digits: u <- lp(5, 1e4, 1e2)[, 5] signif(-u[-1] / log(10), 3) The output tells us how many zeros there are after the decimal point: 1 2 3 4 5 6 7 8 9 10 ... 97 98 99 100 6.0 12.3 18.8 25.5 32.3 39.2 46.2 53.2 60.4 67.6 ... 917.0 933.0 949.0 967.0 Numbers in the top row are values of $x$. For instance, the chance of exactly three values showing up in all five samples is found by computing exp(u[4]), giving $0.000\,000\,000\,000\,000\,000\,1434419\ldots$ and indeed this has $18$ zeros before the first significant digit. As a check, the last value $967.0$ is a rounded version of $967.26$. $\binom{10000}{100}^{-4}$ (which counts the chances that the first sample reappears in the next four samples) equals $10^{-967.26}.$
Probability of intersection from multiple sampling of the same population Compute the chances recursively. Let $p_s(x)$ be the probability that exactly $x$ values, $0 \le x \le k$, are selected in all $s\ge 1$ independent draws of $k$ items (without replacement) from a popu
26,747
Probability of intersection from multiple sampling of the same population
I just ran into a similar problem and, even though I also don't know if this is the correct solution, approached it like this: You are interested in the occurrence of $X$ items in 5 samples á $100$ items of $10,000$ items total. You could think of an urn with $X$ white balls and $10,000-X$ black balls. $100$ balls are taken out and $p_h$ is the probability that you have all $X$ white balls in your set. If you do this $5$ times (independently), I would multiply it: $p = {p_h}^5$. I could even think of one step further and wrap it around the binomial distribution: If you have a coin which comes up head with probability $p_h$ (the probability that you have all items in your set) and you toss it $5$ times, what is the probability of getting $5$ heads? $p = {5\choose 5}{p_h}^5 (1-{p_h})^{5-5} = {p_h}^5$.
Probability of intersection from multiple sampling of the same population
I just ran into a similar problem and, even though I also don't know if this is the correct solution, approached it like this: You are interested in the occurrence of $X$ items in 5 samples á $100$ it
Probability of intersection from multiple sampling of the same population I just ran into a similar problem and, even though I also don't know if this is the correct solution, approached it like this: You are interested in the occurrence of $X$ items in 5 samples á $100$ items of $10,000$ items total. You could think of an urn with $X$ white balls and $10,000-X$ black balls. $100$ balls are taken out and $p_h$ is the probability that you have all $X$ white balls in your set. If you do this $5$ times (independently), I would multiply it: $p = {p_h}^5$. I could even think of one step further and wrap it around the binomial distribution: If you have a coin which comes up head with probability $p_h$ (the probability that you have all items in your set) and you toss it $5$ times, what is the probability of getting $5$ heads? $p = {5\choose 5}{p_h}^5 (1-{p_h})^{5-5} = {p_h}^5$.
Probability of intersection from multiple sampling of the same population I just ran into a similar problem and, even though I also don't know if this is the correct solution, approached it like this: You are interested in the occurrence of $X$ items in 5 samples á $100$ it
26,748
Probability of intersection from multiple sampling of the same population
What is the probability that $X$ number of items appear in all 5 random samplings? Building on what Hans said, you want to always get the same $X$ ids in each sample of 100 and 100-$X$ ids from among the remaining 10000-$X$. The probability of doing so for a given sample is given by the hypergeometric function for $X$ successes in a draw of 100 from a population of 10000 with $X$ possible success states: $P = \frac{{X \choose X}{10000-X \choose 100-X}}{10000 \choose 100}$. For 5 samples, you would take $P^5$. However, that we presuppose knowing the $X$ ids that are shared, and there are $10000 \choose X$ ways to select those $X$ ids. So your final answer would be ${10000 \choose X} P^5$.
Probability of intersection from multiple sampling of the same population
What is the probability that $X$ number of items appear in all 5 random samplings? Building on what Hans said, you want to always get the same $X$ ids in each sample of 100 and 100-$X$ ids from among
Probability of intersection from multiple sampling of the same population What is the probability that $X$ number of items appear in all 5 random samplings? Building on what Hans said, you want to always get the same $X$ ids in each sample of 100 and 100-$X$ ids from among the remaining 10000-$X$. The probability of doing so for a given sample is given by the hypergeometric function for $X$ successes in a draw of 100 from a population of 10000 with $X$ possible success states: $P = \frac{{X \choose X}{10000-X \choose 100-X}}{10000 \choose 100}$. For 5 samples, you would take $P^5$. However, that we presuppose knowing the $X$ ids that are shared, and there are $10000 \choose X$ ways to select those $X$ ids. So your final answer would be ${10000 \choose X} P^5$.
Probability of intersection from multiple sampling of the same population What is the probability that $X$ number of items appear in all 5 random samplings? Building on what Hans said, you want to always get the same $X$ ids in each sample of 100 and 100-$X$ ids from among
26,749
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were lost to follow-up?
I think this is an instrumentation case. You want a missing X, not a missing Y. Y~X But X is frequently missing or mismeasured. X~Z and Z does not impact Y- except through X. Then you can run: X~Z Y~Predicted(X) And require some adjustment for the standard errors. You also may want to look at the Heckmann 2 step procedure if you have a lot of sample attrition. http://en.wikipedia.org/wiki/Heckman_correction
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were
I think this is an instrumentation case. You want a missing X, not a missing Y. Y~X But X is frequently missing or mismeasured. X~Z and Z does not impact Y- except through X. Then you can run: X~Z
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were lost to follow-up? I think this is an instrumentation case. You want a missing X, not a missing Y. Y~X But X is frequently missing or mismeasured. X~Z and Z does not impact Y- except through X. Then you can run: X~Z Y~Predicted(X) And require some adjustment for the standard errors. You also may want to look at the Heckmann 2 step procedure if you have a lot of sample attrition. http://en.wikipedia.org/wiki/Heckman_correction
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were I think this is an instrumentation case. You want a missing X, not a missing Y. Y~X But X is frequently missing or mismeasured. X~Z and Z does not impact Y- except through X. Then you can run: X~Z
26,750
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were lost to follow-up?
I would argue that neither is most appropriate. Imputation is generally not appropriate when data are not MAR or MCAR and data rarely occur that way. When imputing your $X$ values, that may be a reasonable assumption to make, but certainly not for your $Y$ data. Dropping all of the missing data from your data causes your parameters to become biased (if the data are not MCAR, see above) and significantly reduces the precision of your estimates. This is a "complete-case" analysis and is inadvisable. I would suggest reviewing the survival analysis methods out there. These are methods designed to analyze your data given that some of your $Y$ outcomes are unobserved due to censoring. There are models that will take this into account if you can identify which observations are censored.
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were
I would argue that neither is most appropriate. Imputation is generally not appropriate when data are not MAR or MCAR and data rarely occur that way. When imputing your $X$ values, that may be a reas
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were lost to follow-up? I would argue that neither is most appropriate. Imputation is generally not appropriate when data are not MAR or MCAR and data rarely occur that way. When imputing your $X$ values, that may be a reasonable assumption to make, but certainly not for your $Y$ data. Dropping all of the missing data from your data causes your parameters to become biased (if the data are not MCAR, see above) and significantly reduces the precision of your estimates. This is a "complete-case" analysis and is inadvisable. I would suggest reviewing the survival analysis methods out there. These are methods designed to analyze your data given that some of your $Y$ outcomes are unobserved due to censoring. There are models that will take this into account if you can identify which observations are censored.
In a longitudinal study, should I impute the outcome Y, measured at time 2, for individuals who were I would argue that neither is most appropriate. Imputation is generally not appropriate when data are not MAR or MCAR and data rarely occur that way. When imputing your $X$ values, that may be a reas
26,751
What is the difference between entropy and deviance?
They are same. It's a nomenclature difference among authors. Gini is different though. Using your notation it would be $1 - \sum p_i^2$.
What is the difference between entropy and deviance?
They are same. It's a nomenclature difference among authors. Gini is different though. Using your notation it would be $1 - \sum p_i^2$.
What is the difference between entropy and deviance? They are same. It's a nomenclature difference among authors. Gini is different though. Using your notation it would be $1 - \sum p_i^2$.
What is the difference between entropy and deviance? They are same. It's a nomenclature difference among authors. Gini is different though. Using your notation it would be $1 - \sum p_i^2$.
26,752
Good, useful and characteristic experiments for (optimal) statistical design of experiments
This is a work in progress, and it is meant to answer my own question. (Not complete yet) Common types of Optimal NIST provides (link) the following definitions for the types of Optimal Design of experiments. A-Optimality [A] criterion is A-optimality, which seeks to minimize the trace of the inverse of the information matrix. This criterion results in minimizing the average variance of the parameter estimates based on a pre-specified model. The fundamental assumption then is that average variance of the prior model describes overall variance of the actual system. D-Optimality [Another] criterion is D-optimality, which seeks to maximize |X'X|, the determinant of the information matrix X'X of the design. This criterion results in minimizing the generalized variance of the parameter estimates based on a pre-specified model. The fundamental assumption then is that the generalized variance of the prior model describes overall variance of the actual system. G-Optimality A third criterion is G-optimality, which seeks to minimize the maximum prediction variance, i.e., minimize max. [$d=x'(X'X)^{-1}x$], over a specified set of design points. Like $H_{\infty}$ control this minimizes the maximum error given the prior model. V-Optimality A fourth criterion is V-optimality, which seeks to minimize the average prediction variance over a specified set of design points. Requirements and ... NIST says that the requirements include: An a-priori appropriate analytic model A discrete set of samples points as candidates elements of the DOE Working Here are "textbook" statistical analyses. DOE should apply to them, and if there is a healthy connection between "textbook statistics" and "statistical design of experiment" then they should be relevant for the answer of this question. http://www.itl.nist.gov/div898/handbook/eda/section3/4plot.htm The NIST case studies include: Normal random numbers Uniform random numbers Random walk (running sum of shifted uniform random) Josephson junction cryothermometry (discretized uniform random) Beam deflections (periodic with noise) Fitler transmittance (autocorrelation polluted measurements) Standard resistor (linear with additive noise, violates stationarity and autocorrelation) Heat flow (well behaved process, stationary, in control)
Good, useful and characteristic experiments for (optimal) statistical design of experiments
This is a work in progress, and it is meant to answer my own question. (Not complete yet) Common types of Optimal NIST provides (link) the following definitions for the types of Optimal Design of exp
Good, useful and characteristic experiments for (optimal) statistical design of experiments This is a work in progress, and it is meant to answer my own question. (Not complete yet) Common types of Optimal NIST provides (link) the following definitions for the types of Optimal Design of experiments. A-Optimality [A] criterion is A-optimality, which seeks to minimize the trace of the inverse of the information matrix. This criterion results in minimizing the average variance of the parameter estimates based on a pre-specified model. The fundamental assumption then is that average variance of the prior model describes overall variance of the actual system. D-Optimality [Another] criterion is D-optimality, which seeks to maximize |X'X|, the determinant of the information matrix X'X of the design. This criterion results in minimizing the generalized variance of the parameter estimates based on a pre-specified model. The fundamental assumption then is that the generalized variance of the prior model describes overall variance of the actual system. G-Optimality A third criterion is G-optimality, which seeks to minimize the maximum prediction variance, i.e., minimize max. [$d=x'(X'X)^{-1}x$], over a specified set of design points. Like $H_{\infty}$ control this minimizes the maximum error given the prior model. V-Optimality A fourth criterion is V-optimality, which seeks to minimize the average prediction variance over a specified set of design points. Requirements and ... NIST says that the requirements include: An a-priori appropriate analytic model A discrete set of samples points as candidates elements of the DOE Working Here are "textbook" statistical analyses. DOE should apply to them, and if there is a healthy connection between "textbook statistics" and "statistical design of experiment" then they should be relevant for the answer of this question. http://www.itl.nist.gov/div898/handbook/eda/section3/4plot.htm The NIST case studies include: Normal random numbers Uniform random numbers Random walk (running sum of shifted uniform random) Josephson junction cryothermometry (discretized uniform random) Beam deflections (periodic with noise) Fitler transmittance (autocorrelation polluted measurements) Standard resistor (linear with additive noise, violates stationarity and autocorrelation) Heat flow (well behaved process, stationary, in control)
Good, useful and characteristic experiments for (optimal) statistical design of experiments This is a work in progress, and it is meant to answer my own question. (Not complete yet) Common types of Optimal NIST provides (link) the following definitions for the types of Optimal Design of exp
26,753
Fitting a gaussian mixture model using stochastic gradient descent
Assuming that mus[d] is $\mu_j$, j.sigma is $\Sigma_j$, and G(x)/M(x) indeed computes the posterior probability of component $j$ given the data $x$, $$p(j \mid x) = \frac{\rho_j \mathcal{N}_x(\mu_j, \Sigma_j)}{\sum_k \rho_k \mathcal{N}_x(\mu_k, \Sigma_k)},$$ the gradient itself seems correct to me. But here are some things that I noticed that might help you to find your problem: I would expect the access to the mean, the covariance, and the calculation of the posterior to all involve either j or d, whichever variable represents the component for which you want to compute the gradient in your code. If you tell us what j and d stand for, we might be able to tell you more. If G(x)/M(x) accesses j.Sigma to compute the posterior, your code might not compute what you think it does. It might be better to first compute all the gradients of all the parameters, and then perform the update. Stochastic gradient descent is usually not the first choice to optimize mixtures of Gaussians. Most often, expectation maximization (EM) is used (see, for example, Bishop, 2007). Even if you don't use EM, you might want to consider BFGS or L-BFGS (implemented in scipy.optimize) before using SGD. And even if you stick to SGD, you should consider using multiple data points ("batches") at a time to estimate the gradient, or at least including a momentum term. Briefly looking at Toscano and McMurray's paper, my guess is that they chose to use SGD because they were interested in modeling speech acquisition in a biologically more plausible way, rather than obtaining the best possible fit, and doing this online (that is, one data point at a time). If you don't need this, my advice would be to use EM. (I just realized you specifically asked for online learning, so the only viable option for you might be to add the momentum term to speed things up a bit.) The way you chose to compute the gradient is quite inefficient, which will further slow down learning. You might not have seen reasonable results because it takes forever before the algorithm converges to something interesting. Here is a slightly better way to calculate the gradient: sigmaInv = inv(j.sigma) dSigma = G(x)/M(x) * 0.5 * (-sigmaInv + numpy.sum(sigmaInv.dot(x - mus[d]) * x)) There are still ways to further improve the computation of the gradient. For example, we still get a valid ascent (although not a steepest ascent) direction if we multiple the gradient by a positive definite matrix (such as $\Sigma_j$, which would simplify the gradient a bit). It might also work better if we used a different parametrization of the covariance, such as Cholesky factors, and computed the gradients of those instead.
Fitting a gaussian mixture model using stochastic gradient descent
Assuming that mus[d] is $\mu_j$, j.sigma is $\Sigma_j$, and G(x)/M(x) indeed computes the posterior probability of component $j$ given the data $x$, $$p(j \mid x) = \frac{\rho_j \mathcal{N}_x(\mu_j, \
Fitting a gaussian mixture model using stochastic gradient descent Assuming that mus[d] is $\mu_j$, j.sigma is $\Sigma_j$, and G(x)/M(x) indeed computes the posterior probability of component $j$ given the data $x$, $$p(j \mid x) = \frac{\rho_j \mathcal{N}_x(\mu_j, \Sigma_j)}{\sum_k \rho_k \mathcal{N}_x(\mu_k, \Sigma_k)},$$ the gradient itself seems correct to me. But here are some things that I noticed that might help you to find your problem: I would expect the access to the mean, the covariance, and the calculation of the posterior to all involve either j or d, whichever variable represents the component for which you want to compute the gradient in your code. If you tell us what j and d stand for, we might be able to tell you more. If G(x)/M(x) accesses j.Sigma to compute the posterior, your code might not compute what you think it does. It might be better to first compute all the gradients of all the parameters, and then perform the update. Stochastic gradient descent is usually not the first choice to optimize mixtures of Gaussians. Most often, expectation maximization (EM) is used (see, for example, Bishop, 2007). Even if you don't use EM, you might want to consider BFGS or L-BFGS (implemented in scipy.optimize) before using SGD. And even if you stick to SGD, you should consider using multiple data points ("batches") at a time to estimate the gradient, or at least including a momentum term. Briefly looking at Toscano and McMurray's paper, my guess is that they chose to use SGD because they were interested in modeling speech acquisition in a biologically more plausible way, rather than obtaining the best possible fit, and doing this online (that is, one data point at a time). If you don't need this, my advice would be to use EM. (I just realized you specifically asked for online learning, so the only viable option for you might be to add the momentum term to speed things up a bit.) The way you chose to compute the gradient is quite inefficient, which will further slow down learning. You might not have seen reasonable results because it takes forever before the algorithm converges to something interesting. Here is a slightly better way to calculate the gradient: sigmaInv = inv(j.sigma) dSigma = G(x)/M(x) * 0.5 * (-sigmaInv + numpy.sum(sigmaInv.dot(x - mus[d]) * x)) There are still ways to further improve the computation of the gradient. For example, we still get a valid ascent (although not a steepest ascent) direction if we multiple the gradient by a positive definite matrix (such as $\Sigma_j$, which would simplify the gradient a bit). It might also work better if we used a different parametrization of the covariance, such as Cholesky factors, and computed the gradients of those instead.
Fitting a gaussian mixture model using stochastic gradient descent Assuming that mus[d] is $\mu_j$, j.sigma is $\Sigma_j$, and G(x)/M(x) indeed computes the posterior probability of component $j$ given the data $x$, $$p(j \mid x) = \frac{\rho_j \mathcal{N}_x(\mu_j, \
26,754
Choice of path weights in SEM conceptual models for identical & fraternal twins using openMx
To answer your 2 points: 1) Yes, exactly--the starting value is merely dictating where the algorithm will start the optimization process. Most software packages actually determine their own starting value by default, and the user needs to try inputting different values only when problems occur during estimation. From my experience, most plausible starting values will do, and will not change the final model on which the algorithm converges. 2) The value 0.6 is the starting value not for the intercept of T1 and T2 (path between "one" and T1 & T2), but it is instead the starting value for the factor loadings linking each latent variable (A, C, E) to their indicator T1 or T2. This is indicated by the fact that the path goes from=c("A1","C1","E1"), to="bmi1" in the first case, and from=c("A2","C2","E2"), to="bmi2" in the second case. As for the specific value "0.6": I could not find in the documentation where they mention taking this value based on the monozygotic twins subgroup; and actually, these parameter estimates (factor loadings for the 3 latent variables) cannot be directly computed from the sample, since by definition, these latent variables are unobserved (they are latent). As I mention in point #1, rarely will the choice between two plausible values affect the parameter estimates of the converged model, so my guess is that they simply chose one of many plausible values for these factor loadings as starting values. Whether this value does come from the estimated covariance between bmi1 and bmi2 in the monozygotic-twin subgroup only should be irrelevant, since any plausible starting values should lead the algorithm to converge upon the same final values, perhaps with some differences in computation time. (And my advice to convince yourself is: try it! Try several starting values and compare the parameter estimates of the converged models.) As a general note, I will point out that the choice of starting values for any parameter estimate becomes VERY important if the argument free is set to FALSE, because the starting value will effectively become the value of the parameter estimate in the final model (it will not be estimated; it is fixed before estimation).
Choice of path weights in SEM conceptual models for identical & fraternal twins using openMx
To answer your 2 points: 1) Yes, exactly--the starting value is merely dictating where the algorithm will start the optimization process. Most software packages actually determine their own starting v
Choice of path weights in SEM conceptual models for identical & fraternal twins using openMx To answer your 2 points: 1) Yes, exactly--the starting value is merely dictating where the algorithm will start the optimization process. Most software packages actually determine their own starting value by default, and the user needs to try inputting different values only when problems occur during estimation. From my experience, most plausible starting values will do, and will not change the final model on which the algorithm converges. 2) The value 0.6 is the starting value not for the intercept of T1 and T2 (path between "one" and T1 & T2), but it is instead the starting value for the factor loadings linking each latent variable (A, C, E) to their indicator T1 or T2. This is indicated by the fact that the path goes from=c("A1","C1","E1"), to="bmi1" in the first case, and from=c("A2","C2","E2"), to="bmi2" in the second case. As for the specific value "0.6": I could not find in the documentation where they mention taking this value based on the monozygotic twins subgroup; and actually, these parameter estimates (factor loadings for the 3 latent variables) cannot be directly computed from the sample, since by definition, these latent variables are unobserved (they are latent). As I mention in point #1, rarely will the choice between two plausible values affect the parameter estimates of the converged model, so my guess is that they simply chose one of many plausible values for these factor loadings as starting values. Whether this value does come from the estimated covariance between bmi1 and bmi2 in the monozygotic-twin subgroup only should be irrelevant, since any plausible starting values should lead the algorithm to converge upon the same final values, perhaps with some differences in computation time. (And my advice to convince yourself is: try it! Try several starting values and compare the parameter estimates of the converged models.) As a general note, I will point out that the choice of starting values for any parameter estimate becomes VERY important if the argument free is set to FALSE, because the starting value will effectively become the value of the parameter estimate in the final model (it will not be estimated; it is fixed before estimation).
Choice of path weights in SEM conceptual models for identical & fraternal twins using openMx To answer your 2 points: 1) Yes, exactly--the starting value is merely dictating where the algorithm will start the optimization process. Most software packages actually determine their own starting v
26,755
Forecasting of highly correlated time series
The AR, MA, and ARMA models are examples of univariate time series models. Each of these models has a multivariate counterpart: Vector Autogression (VAR), Vector Moving Average (VMA), and Vector Autoregressive Moving Average (VARMA), respectively. VAR might be the simplest to reason about if you are more familiar with linear regression. An AR(p) model regresses a time series against its p lags. Correspondingly, a VAR(p) model is a series of regressions, such that each series is regressed against its p lags and the p lags of all the other variables. After performing the regressions, you can calculate residuals from each series and evaluate how correlated the residuals are. As with univariate models, stationarity is also an important issue for multivariate models. This leads to models like the Vector Error Correction Model (VECM), which allows for variables to have share a stable long-term trend with short-term deviations.
Forecasting of highly correlated time series
The AR, MA, and ARMA models are examples of univariate time series models. Each of these models has a multivariate counterpart: Vector Autogression (VAR), Vector Moving Average (VMA), and Vector Autor
Forecasting of highly correlated time series The AR, MA, and ARMA models are examples of univariate time series models. Each of these models has a multivariate counterpart: Vector Autogression (VAR), Vector Moving Average (VMA), and Vector Autoregressive Moving Average (VARMA), respectively. VAR might be the simplest to reason about if you are more familiar with linear regression. An AR(p) model regresses a time series against its p lags. Correspondingly, a VAR(p) model is a series of regressions, such that each series is regressed against its p lags and the p lags of all the other variables. After performing the regressions, you can calculate residuals from each series and evaluate how correlated the residuals are. As with univariate models, stationarity is also an important issue for multivariate models. This leads to models like the Vector Error Correction Model (VECM), which allows for variables to have share a stable long-term trend with short-term deviations.
Forecasting of highly correlated time series The AR, MA, and ARMA models are examples of univariate time series models. Each of these models has a multivariate counterpart: Vector Autogression (VAR), Vector Moving Average (VMA), and Vector Autor
26,756
How to deal with death in disease-free survival analysis?
My interpretation of disease free survival is that the only event is diagnose of return of the disease. Any other event be it patient withdrawal from the study, lost to follow-up for any other reason or death is a censored event because at that time the defined "event" had not occurred and there is no way for it to either occur or for the investigator to ever find out if it occurred. You should not remove patients that died. That creates potential bias. With survival the whole idea of censoring is to use the incomplete observations and not create bias that could occur if you threw out the incomplete observation. In comparing treatments I find in agreement with Peter's remarks I have seen it done (and have done myself) analyses of time to recurrence (where death by other causes are censored) and all cause mortality. Death by disease specific cause is another way such data can be analyzed.
How to deal with death in disease-free survival analysis?
My interpretation of disease free survival is that the only event is diagnose of return of the disease. Any other event be it patient withdrawal from the study, lost to follow-up for any other reason
How to deal with death in disease-free survival analysis? My interpretation of disease free survival is that the only event is diagnose of return of the disease. Any other event be it patient withdrawal from the study, lost to follow-up for any other reason or death is a censored event because at that time the defined "event" had not occurred and there is no way for it to either occur or for the investigator to ever find out if it occurred. You should not remove patients that died. That creates potential bias. With survival the whole idea of censoring is to use the incomplete observations and not create bias that could occur if you threw out the incomplete observation. In comparing treatments I find in agreement with Peter's remarks I have seen it done (and have done myself) analyses of time to recurrence (where death by other causes are censored) and all cause mortality. Death by disease specific cause is another way such data can be analyzed.
How to deal with death in disease-free survival analysis? My interpretation of disease free survival is that the only event is diagnose of return of the disease. Any other event be it patient withdrawal from the study, lost to follow-up for any other reason
26,757
Gaussian Like distribution with higher order moments
If you start with a "sufficient" statistic $T(x)$ then you can define an infinite number of distributions. Namely, for every measurable function $h(\cdot)$ against an arbitrary measure $\text{d}\lambda$ over your sampling space, $$ f(x|\theta) = \exp\left\{ \theta\cdot T(x)-\tau(\theta) \right\} \,h(x) $$ is a density from an exponential family and, for every $n$ and an iid sample $(x_1,\ldots,x_n)$ from this density, the statistic $$ \sum_{i=1}^n T(x_i) $$ is sufficient. For instance, for any measurable function $h$, you can define a density by $$ h(x)\,\exp\{-(x-\mu)^2/\sigma^2\} \Big/ \int_{\mathbb{R}} h(y)\,\exp\{-(y-\mu)^2/\sigma^2\} \,\text{d}\lambda(y) $$ which means that $T(x)=(x,x^2)$ is also sufficient for this distribution. Hence, any pair $(h,T)$ defines an exponential family, which means your question has no answer.
Gaussian Like distribution with higher order moments
If you start with a "sufficient" statistic $T(x)$ then you can define an infinite number of distributions. Namely, for every measurable function $h(\cdot)$ against an arbitrary measure $\text{d}\lambd
Gaussian Like distribution with higher order moments If you start with a "sufficient" statistic $T(x)$ then you can define an infinite number of distributions. Namely, for every measurable function $h(\cdot)$ against an arbitrary measure $\text{d}\lambda$ over your sampling space, $$ f(x|\theta) = \exp\left\{ \theta\cdot T(x)-\tau(\theta) \right\} \,h(x) $$ is a density from an exponential family and, for every $n$ and an iid sample $(x_1,\ldots,x_n)$ from this density, the statistic $$ \sum_{i=1}^n T(x_i) $$ is sufficient. For instance, for any measurable function $h$, you can define a density by $$ h(x)\,\exp\{-(x-\mu)^2/\sigma^2\} \Big/ \int_{\mathbb{R}} h(y)\,\exp\{-(y-\mu)^2/\sigma^2\} \,\text{d}\lambda(y) $$ which means that $T(x)=(x,x^2)$ is also sufficient for this distribution. Hence, any pair $(h,T)$ defines an exponential family, which means your question has no answer.
Gaussian Like distribution with higher order moments If you start with a "sufficient" statistic $T(x)$ then you can define an infinite number of distributions. Namely, for every measurable function $h(\cdot)$ against an arbitrary measure $\text{d}\lambd
26,758
Sparsity-inducing regularization for stochastic matrices
A general method for creating sparse solutions is via MAP estimation with a zero mean normal prior with an unknown variance. $$p(x_i|\sigma_i^2)\sim N(0,\sigma_i^2)$$ If you then assign a prior to $\sigma_i^2$ which has a mode at zero then the posterior mode is usually sparse. The $L_1$ arises from this approach by taking an exponential mixing distribution. $$p(\sigma_i^2|\lambda)\sim Expo\left(\frac{\lambda^2}{2}\right)$$ Then you get $$\log[p(x_i|\lambda)]=-\lambda | x_i|+\log\left[\frac{\lambda}{2}\right]$$ Some alternatives are the generalised double pareto, half cauchy, inverted beta. In some sense these are better than lasso because they do not shrink large values. In fact I'm pretty sure the generalised double pareto can be written as a mixture of exponentials. That is we write $\lambda=\lambda_i$ and then place a gamma prior $p(\lambda_i|\alpha\beta)$. We get: $$p(x_i|\alpha\beta)=\frac{\alpha}{2\beta}\left(1+\frac{|x_i|}{\beta}\right)^{-(\alpha+1)}$$ Note that I have included normalising constants, as they help choose good global parameters. Now if we apply the range restriction then we have a more complicated problem, as we need to renormalise over the simplex. Another generic feature of sparsity inducing penalties is that they are not differentiable at zero. Usually this is because the left and right limits are of opposite sign. This is based on the brilliant work by Nicolas Polson and James Scott on variance mean mixture representations which they use to develop TIRLS - a massive extension of least squares to a very large class of loss-penalty combinations. As an alternative you could use a prior which is defined on the simplex, but has modes in the marginal distributions at zero. One example is the dirichlet distribution with all parameters between 0 and 1. The implied penalty would look like: $$-\sum_{i=1}^{n-1}(a_i-1)\log(x_i) - (a_n-1)\log(1-\sum_{i=1}^{n-1}x_i)$$ Where $0<a_i<1$. However you would need to be careful in optimising numerically as the penalty has singularities. A more robust estimation process is to use the posterior mean. Although you lose exact sparseness you will get many posterior means that are close to zero.p
Sparsity-inducing regularization for stochastic matrices
A general method for creating sparse solutions is via MAP estimation with a zero mean normal prior with an unknown variance. $$p(x_i|\sigma_i^2)\sim N(0,\sigma_i^2)$$ If you then assign a prior to $\s
Sparsity-inducing regularization for stochastic matrices A general method for creating sparse solutions is via MAP estimation with a zero mean normal prior with an unknown variance. $$p(x_i|\sigma_i^2)\sim N(0,\sigma_i^2)$$ If you then assign a prior to $\sigma_i^2$ which has a mode at zero then the posterior mode is usually sparse. The $L_1$ arises from this approach by taking an exponential mixing distribution. $$p(\sigma_i^2|\lambda)\sim Expo\left(\frac{\lambda^2}{2}\right)$$ Then you get $$\log[p(x_i|\lambda)]=-\lambda | x_i|+\log\left[\frac{\lambda}{2}\right]$$ Some alternatives are the generalised double pareto, half cauchy, inverted beta. In some sense these are better than lasso because they do not shrink large values. In fact I'm pretty sure the generalised double pareto can be written as a mixture of exponentials. That is we write $\lambda=\lambda_i$ and then place a gamma prior $p(\lambda_i|\alpha\beta)$. We get: $$p(x_i|\alpha\beta)=\frac{\alpha}{2\beta}\left(1+\frac{|x_i|}{\beta}\right)^{-(\alpha+1)}$$ Note that I have included normalising constants, as they help choose good global parameters. Now if we apply the range restriction then we have a more complicated problem, as we need to renormalise over the simplex. Another generic feature of sparsity inducing penalties is that they are not differentiable at zero. Usually this is because the left and right limits are of opposite sign. This is based on the brilliant work by Nicolas Polson and James Scott on variance mean mixture representations which they use to develop TIRLS - a massive extension of least squares to a very large class of loss-penalty combinations. As an alternative you could use a prior which is defined on the simplex, but has modes in the marginal distributions at zero. One example is the dirichlet distribution with all parameters between 0 and 1. The implied penalty would look like: $$-\sum_{i=1}^{n-1}(a_i-1)\log(x_i) - (a_n-1)\log(1-\sum_{i=1}^{n-1}x_i)$$ Where $0<a_i<1$. However you would need to be careful in optimising numerically as the penalty has singularities. A more robust estimation process is to use the posterior mean. Although you lose exact sparseness you will get many posterior means that are close to zero.p
Sparsity-inducing regularization for stochastic matrices A general method for creating sparse solutions is via MAP estimation with a zero mean normal prior with an unknown variance. $$p(x_i|\sigma_i^2)\sim N(0,\sigma_i^2)$$ If you then assign a prior to $\s
26,759
Sparsity-inducing regularization for stochastic matrices
Two options: Use an $L_0$ penalty on $\vec x$. The obvious drawback is that this is nonconvex and hence difficult to optimize. Reparameterize, $x_i = \frac{\exp(w_i)}{\sum_j \exp(w_j)}$ and use a penalty on the new (natural) parameter vector, $\|\vec w\|$. This will encourage events to be equally probable unless there is a good reason for them not to be.
Sparsity-inducing regularization for stochastic matrices
Two options: Use an $L_0$ penalty on $\vec x$. The obvious drawback is that this is nonconvex and hence difficult to optimize. Reparameterize, $x_i = \frac{\exp(w_i)}{\sum_j \exp(w_j)}$ and use a pe
Sparsity-inducing regularization for stochastic matrices Two options: Use an $L_0$ penalty on $\vec x$. The obvious drawback is that this is nonconvex and hence difficult to optimize. Reparameterize, $x_i = \frac{\exp(w_i)}{\sum_j \exp(w_j)}$ and use a penalty on the new (natural) parameter vector, $\|\vec w\|$. This will encourage events to be equally probable unless there is a good reason for them not to be.
Sparsity-inducing regularization for stochastic matrices Two options: Use an $L_0$ penalty on $\vec x$. The obvious drawback is that this is nonconvex and hence difficult to optimize. Reparameterize, $x_i = \frac{\exp(w_i)}{\sum_j \exp(w_j)}$ and use a pe
26,760
Sparsity-inducing regularization for stochastic matrices
The premise of the question is only partly correct. While it is true that the $L_1$-norm is just a constant under the constraint, the constraint optimization problem might very well have a sparse solution. However, the solution is unaffected by the choice of $\lambda$, so either there is a sparse solution or not. Another question is how to actually find the solution. A standard quadratic optimizer under linear constraints can, of course, be used, but popular coordinate descent algorithms cannot be used out-of-the-box. One suggestion could be to optimize under a positivity contraint only, for different $\lambda$'s, and then renormalize the solution to have $L_1$-norm 1. A coordinate descent algorithm should, I believe, be easily modifiable to compute the solution under a positivity constraint.
Sparsity-inducing regularization for stochastic matrices
The premise of the question is only partly correct. While it is true that the $L_1$-norm is just a constant under the constraint, the constraint optimization problem might very well have a sparse solu
Sparsity-inducing regularization for stochastic matrices The premise of the question is only partly correct. While it is true that the $L_1$-norm is just a constant under the constraint, the constraint optimization problem might very well have a sparse solution. However, the solution is unaffected by the choice of $\lambda$, so either there is a sparse solution or not. Another question is how to actually find the solution. A standard quadratic optimizer under linear constraints can, of course, be used, but popular coordinate descent algorithms cannot be used out-of-the-box. One suggestion could be to optimize under a positivity contraint only, for different $\lambda$'s, and then renormalize the solution to have $L_1$-norm 1. A coordinate descent algorithm should, I believe, be easily modifiable to compute the solution under a positivity constraint.
Sparsity-inducing regularization for stochastic matrices The premise of the question is only partly correct. While it is true that the $L_1$-norm is just a constant under the constraint, the constraint optimization problem might very well have a sparse solu
26,761
Sparsity-inducing regularization for stochastic matrices
I can think up three methods. Bayesian method: introducing a zero-mean prior distribution and use type II likelihood to estimate the parameters and hyper parameters. Use $\Vert\cdot\Vert_{\infty}$ as regularization instead. This is not differentiable though. You can use a high-order norm to approximate it. Use $-\sum_{i=1}\log x_i$. In fact, the first and the third methods are the same.
Sparsity-inducing regularization for stochastic matrices
I can think up three methods. Bayesian method: introducing a zero-mean prior distribution and use type II likelihood to estimate the parameters and hyper parameters. Use $\Vert\cdot\Vert_{\infty}$ as
Sparsity-inducing regularization for stochastic matrices I can think up three methods. Bayesian method: introducing a zero-mean prior distribution and use type II likelihood to estimate the parameters and hyper parameters. Use $\Vert\cdot\Vert_{\infty}$ as regularization instead. This is not differentiable though. You can use a high-order norm to approximate it. Use $-\sum_{i=1}\log x_i$. In fact, the first and the third methods are the same.
Sparsity-inducing regularization for stochastic matrices I can think up three methods. Bayesian method: introducing a zero-mean prior distribution and use type II likelihood to estimate the parameters and hyper parameters. Use $\Vert\cdot\Vert_{\infty}$ as
26,762
Test for proportions and binary classifier
So I'm deriving this from first principles, and am thus not certain it is correct. Here's my thoughts: EDIT: This was not quite right before. I have updated it. Let's let $\alpha$ denote the expected difference between the actual number of true positives $d_1$ and the number output by the binary classifier which we'll call $\hat{d_1}$. You can measure this with by running your classifier on a set with known labels. Subtract the number of actual positives from the number of positives produced by the classifier, and then divide by $N$ to get $\alpha$. So, a point estimate for the actual ratio of defective parts is given by: $\hat{\frac{d_1}{N_1}} = \frac{d_1 + \alpha * N_1}{N_1}$. That is, the observed number of defective parts, less the expected number of false positives, plus the expected number of false negatives. Similarly, $\hat{\frac{d_2}{N_2}} = \frac{d_2 + \alpha * N_2}{N_2}$ So, now let's do a prop test. In the standard prop test, we first compute the pooled ratio used as the null value: $p= \frac{p_1*N_1 + p_2*N_2}{N_1 + N_2}$. So here, we put in our point estimates of $\hat{\frac{d_1}{N_1}}$ and $\hat{\frac{d_2}{N_2}}$ to get: $p= \frac{d_1 + d_2 + \alpha * (N_1 + N_2)}{N_1 + N_2}$ And then standard error is just the usual: $\sqrt{p*(1-p)*(\frac{1}{N_1} + \frac{1}{N_2})}$ And the test statistic is the same: $z = \frac{\frac{d_1}{N_1} - \frac{d_2}{N_2}}{se}$ Some thoughts on interpretation: The model can produce imaginary values for standard error. This will happen when $p < 0$, which will be the case when the number of errors we expect the classifiers to produce exceeds the number we observed. For example, suppose that we expect our classifier to produce an average of 5 positives even when given a sample containing no positives. If we observe 4 positives, then it's as though there is no signal: Our result is indistinguishable from the noise produced by the classifier. In this case, we should not reject the null hypothesis, I think. Another way to think about this is that, if the number of defective parts is within the margin of error for the classifier then of course we cannot tell whether there is a difference: we can't even tell whether any parts are defective! Incorporating errors in the estimation of $\alpha$: I thought about this some more, and I think there are several ways you could do this, but essentially you want to get an estimate of the distribution of $\alpha$. Ideally you would do this buy repeating your procedure for getting the estimate of $\alpha$ on a representative sample of the data sets you intend to use this method on. If this is not possible, you could bootstrap on a single dataset by drawing samples from it, although this is not ideal unless your single datset is representative of all the sets you care about. Suppose that we want to compute a confidence interval with a confidence of $h$. Empirically compute the $\frac{h}{2}$ confidence interval over $\alpha$ using the bootstrapped distribution. Plug each end point into the process above, using it as a (very conservative or very liberal) point estimate for $\alpha$ and find the $\frac{h}{2}$ confidence interval for the estimate of the difference in proportions using the prop test. Suppose that we get intervals ($low_l, low_r)$ and $(high_l, high_r)$ as the intervals for the lower and higher values of $\alpha$. Then the interval $(high_l,low_r)$ (which contains both of the earlier intervals) should be a (1-h)*100 % CI for the difference in proportions... I think... Note: In the above I assumed a 1 sided test. You divide h by 2 to account for the fact that you are testing two independent hypotheses ($\alpha$ being in the interval you think and the test statistic being a significant difference). If you want to do a two-tailed test, divide by 4 instead.
Test for proportions and binary classifier
So I'm deriving this from first principles, and am thus not certain it is correct. Here's my thoughts: EDIT: This was not quite right before. I have updated it. Let's let $\alpha$ denote the expected
Test for proportions and binary classifier So I'm deriving this from first principles, and am thus not certain it is correct. Here's my thoughts: EDIT: This was not quite right before. I have updated it. Let's let $\alpha$ denote the expected difference between the actual number of true positives $d_1$ and the number output by the binary classifier which we'll call $\hat{d_1}$. You can measure this with by running your classifier on a set with known labels. Subtract the number of actual positives from the number of positives produced by the classifier, and then divide by $N$ to get $\alpha$. So, a point estimate for the actual ratio of defective parts is given by: $\hat{\frac{d_1}{N_1}} = \frac{d_1 + \alpha * N_1}{N_1}$. That is, the observed number of defective parts, less the expected number of false positives, plus the expected number of false negatives. Similarly, $\hat{\frac{d_2}{N_2}} = \frac{d_2 + \alpha * N_2}{N_2}$ So, now let's do a prop test. In the standard prop test, we first compute the pooled ratio used as the null value: $p= \frac{p_1*N_1 + p_2*N_2}{N_1 + N_2}$. So here, we put in our point estimates of $\hat{\frac{d_1}{N_1}}$ and $\hat{\frac{d_2}{N_2}}$ to get: $p= \frac{d_1 + d_2 + \alpha * (N_1 + N_2)}{N_1 + N_2}$ And then standard error is just the usual: $\sqrt{p*(1-p)*(\frac{1}{N_1} + \frac{1}{N_2})}$ And the test statistic is the same: $z = \frac{\frac{d_1}{N_1} - \frac{d_2}{N_2}}{se}$ Some thoughts on interpretation: The model can produce imaginary values for standard error. This will happen when $p < 0$, which will be the case when the number of errors we expect the classifiers to produce exceeds the number we observed. For example, suppose that we expect our classifier to produce an average of 5 positives even when given a sample containing no positives. If we observe 4 positives, then it's as though there is no signal: Our result is indistinguishable from the noise produced by the classifier. In this case, we should not reject the null hypothesis, I think. Another way to think about this is that, if the number of defective parts is within the margin of error for the classifier then of course we cannot tell whether there is a difference: we can't even tell whether any parts are defective! Incorporating errors in the estimation of $\alpha$: I thought about this some more, and I think there are several ways you could do this, but essentially you want to get an estimate of the distribution of $\alpha$. Ideally you would do this buy repeating your procedure for getting the estimate of $\alpha$ on a representative sample of the data sets you intend to use this method on. If this is not possible, you could bootstrap on a single dataset by drawing samples from it, although this is not ideal unless your single datset is representative of all the sets you care about. Suppose that we want to compute a confidence interval with a confidence of $h$. Empirically compute the $\frac{h}{2}$ confidence interval over $\alpha$ using the bootstrapped distribution. Plug each end point into the process above, using it as a (very conservative or very liberal) point estimate for $\alpha$ and find the $\frac{h}{2}$ confidence interval for the estimate of the difference in proportions using the prop test. Suppose that we get intervals ($low_l, low_r)$ and $(high_l, high_r)$ as the intervals for the lower and higher values of $\alpha$. Then the interval $(high_l,low_r)$ (which contains both of the earlier intervals) should be a (1-h)*100 % CI for the difference in proportions... I think... Note: In the above I assumed a 1 sided test. You divide h by 2 to account for the fact that you are testing two independent hypotheses ($\alpha$ being in the interval you think and the test statistic being a significant difference). If you want to do a two-tailed test, divide by 4 instead.
Test for proportions and binary classifier So I'm deriving this from first principles, and am thus not certain it is correct. Here's my thoughts: EDIT: This was not quite right before. I have updated it. Let's let $\alpha$ denote the expected
26,763
Dealing with very large time-series datasets
@tdc. All and many more issues which you have mentioned here regarding the analysis of neuroscience data including: Dimensionality reduction, Within/between subjects classification, signal-to-noise ratio, etc. etc. are being handle by the EEGLAB toolbox, which were specifically designed for handling those kind of neuroscience data : EEGLAB is an interactive Matlab toolbox for processing continuous and event-related EEG, MEG and other electrophysiological data incorporating independent component analysis (ICA), time/frequency analysis, artifact rejection, event-related statistics, and several useful modes of visualization of the averaged and single-trial data. Thus, with regard to your question "What is the most likely strategy to succeed, without spending endless amounts of researcher time" I would like to encourage you to watch the EEGLAB on line workshop , and to continue from there... Update: for more ML stuff take a look on the (new) BCILAB model
Dealing with very large time-series datasets
@tdc. All and many more issues which you have mentioned here regarding the analysis of neuroscience data including: Dimensionality reduction, Within/between subjects classification, signal-to-noise ra
Dealing with very large time-series datasets @tdc. All and many more issues which you have mentioned here regarding the analysis of neuroscience data including: Dimensionality reduction, Within/between subjects classification, signal-to-noise ratio, etc. etc. are being handle by the EEGLAB toolbox, which were specifically designed for handling those kind of neuroscience data : EEGLAB is an interactive Matlab toolbox for processing continuous and event-related EEG, MEG and other electrophysiological data incorporating independent component analysis (ICA), time/frequency analysis, artifact rejection, event-related statistics, and several useful modes of visualization of the averaged and single-trial data. Thus, with regard to your question "What is the most likely strategy to succeed, without spending endless amounts of researcher time" I would like to encourage you to watch the EEGLAB on line workshop , and to continue from there... Update: for more ML stuff take a look on the (new) BCILAB model
Dealing with very large time-series datasets @tdc. All and many more issues which you have mentioned here regarding the analysis of neuroscience data including: Dimensionality reduction, Within/between subjects classification, signal-to-noise ra
26,764
Softmax regression bias and prior probabilities for unequal classes
As far as I'm aware, the justification for softmax bias initialization is a bit hand-wavy. Recall softmax regression is maximum (log) likelihood estimation for $W,\textbf{b}$, with the model being the following: $$ \DeclareMathOperator{cat}{Cat} \newcommand{\norm}[1]{\left\| #1 \right\|} \newcommand{vsigma}{{\boldsymbol\sigma}} \newcommand{vx}{{\textbf{x}}} \newcommand{vb}{{\textbf{b}}} \newcommand{vz}{{\textbf{z}}} y\sim\cat(\vsigma(W\vx+\vb)); \;\;\;\sigma_i(\vz)=\frac{\exp z_i}{\sum_j\exp z_j}. $$ With bias initialization our intention is to find a good value $\vb$ with which $p(\vx, y|W,\vb)\propto p( y|W,\vb,\vx) $ starts out high. Under the assumption that we initialize $W$ with small near-0 values and that $y$ is a label in $[K]$, $W\vx\approx 0$ so: $$ \log p( y|W,\vb,\vx)=\sum_{k=1}^K1_{y=k}\log \sigma_k(W\vx + \vb)\approx\log\sigma_y(\vb) $$ Adding up the log-probabilities for all assumed-independent examples $\{(\vx_i,y_i)\}_{i=1}^n$, a good initialization for $\vb$ would minimize the total approximate data log likelihood: $$ \newcommand{vc}{{\textbf{c}}} \sum_{i=1}^n\log\sigma_{y_i}(\vb)=\sum_{i=1}^nb_{y_i}-n\log\sum_{k=1}^K\exp b_k$$ The gradient of the above wrt $\vb$ is $\vc-n\vsigma(\vb)$, with $\vc\in\mathbb{N}^K$ the vector of counts of each class. The function above is also concave, see the question here about smooth max for a proof. The two facts above imply a maximum is available whenever $\vsigma(\vb)=\vc/n$. This, in turn, suggests a viable initialization for the $i$-th term $b_i$ of the bias $\vb$ is indeed $\log p_i$, the proportion of $i$-labelled examples in the training set (aka the marginal statistics). You might see that you can add any constant to $\vb$ and achieve another likelihood-maximizing bias as well; however, a large scale would get in the way of learning $W$. The relationship with the logistic bias is not coincidental --- this tutorial discusses the similarity.
Softmax regression bias and prior probabilities for unequal classes
As far as I'm aware, the justification for softmax bias initialization is a bit hand-wavy. Recall softmax regression is maximum (log) likelihood estimation for $W,\textbf{b}$, with the model being the
Softmax regression bias and prior probabilities for unequal classes As far as I'm aware, the justification for softmax bias initialization is a bit hand-wavy. Recall softmax regression is maximum (log) likelihood estimation for $W,\textbf{b}$, with the model being the following: $$ \DeclareMathOperator{cat}{Cat} \newcommand{\norm}[1]{\left\| #1 \right\|} \newcommand{vsigma}{{\boldsymbol\sigma}} \newcommand{vx}{{\textbf{x}}} \newcommand{vb}{{\textbf{b}}} \newcommand{vz}{{\textbf{z}}} y\sim\cat(\vsigma(W\vx+\vb)); \;\;\;\sigma_i(\vz)=\frac{\exp z_i}{\sum_j\exp z_j}. $$ With bias initialization our intention is to find a good value $\vb$ with which $p(\vx, y|W,\vb)\propto p( y|W,\vb,\vx) $ starts out high. Under the assumption that we initialize $W$ with small near-0 values and that $y$ is a label in $[K]$, $W\vx\approx 0$ so: $$ \log p( y|W,\vb,\vx)=\sum_{k=1}^K1_{y=k}\log \sigma_k(W\vx + \vb)\approx\log\sigma_y(\vb) $$ Adding up the log-probabilities for all assumed-independent examples $\{(\vx_i,y_i)\}_{i=1}^n$, a good initialization for $\vb$ would minimize the total approximate data log likelihood: $$ \newcommand{vc}{{\textbf{c}}} \sum_{i=1}^n\log\sigma_{y_i}(\vb)=\sum_{i=1}^nb_{y_i}-n\log\sum_{k=1}^K\exp b_k$$ The gradient of the above wrt $\vb$ is $\vc-n\vsigma(\vb)$, with $\vc\in\mathbb{N}^K$ the vector of counts of each class. The function above is also concave, see the question here about smooth max for a proof. The two facts above imply a maximum is available whenever $\vsigma(\vb)=\vc/n$. This, in turn, suggests a viable initialization for the $i$-th term $b_i$ of the bias $\vb$ is indeed $\log p_i$, the proportion of $i$-labelled examples in the training set (aka the marginal statistics). You might see that you can add any constant to $\vb$ and achieve another likelihood-maximizing bias as well; however, a large scale would get in the way of learning $W$. The relationship with the logistic bias is not coincidental --- this tutorial discusses the similarity.
Softmax regression bias and prior probabilities for unequal classes As far as I'm aware, the justification for softmax bias initialization is a bit hand-wavy. Recall softmax regression is maximum (log) likelihood estimation for $W,\textbf{b}$, with the model being the
26,765
vcovHC, vcovHAC, NeweyWest – which function to use?
The "sandwich" in question is two pieces of bread defined by the expected information enclosing a meat defined by the observed information. See my comments here and here. For a linear regression, the estimating equation is: $$ U(\beta) = \mathbf{X}^T\left(Y - \mathbf{X}^T\beta\right) $$ The expected information (bread) is: $$ A = \frac{\partial U(\beta)}{\partial \beta} = -(\mathbf{X}^T\mathbf{X}) $$ The observed information (meat) is: $$ B = E(U(\beta)U(\beta)^T) = \mathbf{X}^T(Y-\mathbf{X}^T\beta)(Y-\mathbf{X}^T\beta)^T\mathbf{X} $$ Note the inner term is a diagonal of constant residuals when the homoscedasticity, independent data assumption is met, then the sandwich covariance estimator which is given by $A^{-1}BA^{-1}$ is the usual linear regression covariance matrix $\sigma^2 \left(\mathbf{X}^T\mathbf{X}\right)^{-1}$ where $\sigma^2$ is the variance of the residuals. However, that's rather strict. You get a considerably broader class of estimators by relaxing the assumptions involved around the $n \times n$ residual matrix: $$R = (Y-\mathbf{X}^T\beta)(Y-\mathbf{X}^T\beta)$$. The "HC0" vcovHC estimator is consistent even when the data are not independent. So I will not say that we "assume" the residuals are independent, but I will say that we use "a working independent covariance structure". Then the matrix $R$ is replaced by a diagonal of the residuals $$R_{ii} = (Y_i - \beta \mathbf{X}_{I.})^2, \quad 0\text{ elsewhere}$$ This estimator works really well except under small samples (<40 is often purported). The HC1-3 are various finite sample corrections. HC3 is generally the best performing. However if there are autoregressive effects, the off-diagonal entries of $T$ are non-zero, so a scaled covariance matrix is produced based on commonly used autoregressive structures. This is the rationale for the "vcovHAC". Here, very flexible and general methods are produced to estimate the autoregressive effect: the details may be beyond the scope of your question. The "meatHAC" function is the general workhorse: the default method is Andrews'. Newey-West is a special case of the general autoregressive error estimator. These methods solve one of two problems: 1. at what rate does correlation decay between "adjacent" observations and 2. what is a reasonable distance between two observations? These If you have balanced panel data, this covariance estimator is overkill. You should use gee from the gee package instead specifying the covariance structure to AR-1 or similar. As for which to use, it depends on the nature of the data analysis and the scientific question. I would not advise fitting all the types and picking the one that looks best, as it is a multiple testing issue. As I alluded to earlier, the vcovHC estimator is consistent even in the presence of an autoregressive effect, so you can use and justify a "working independence correlation model" in a variety of circumstances.
vcovHC, vcovHAC, NeweyWest – which function to use?
The "sandwich" in question is two pieces of bread defined by the expected information enclosing a meat defined by the observed information. See my comments here and here. For a linear regression, the
vcovHC, vcovHAC, NeweyWest – which function to use? The "sandwich" in question is two pieces of bread defined by the expected information enclosing a meat defined by the observed information. See my comments here and here. For a linear regression, the estimating equation is: $$ U(\beta) = \mathbf{X}^T\left(Y - \mathbf{X}^T\beta\right) $$ The expected information (bread) is: $$ A = \frac{\partial U(\beta)}{\partial \beta} = -(\mathbf{X}^T\mathbf{X}) $$ The observed information (meat) is: $$ B = E(U(\beta)U(\beta)^T) = \mathbf{X}^T(Y-\mathbf{X}^T\beta)(Y-\mathbf{X}^T\beta)^T\mathbf{X} $$ Note the inner term is a diagonal of constant residuals when the homoscedasticity, independent data assumption is met, then the sandwich covariance estimator which is given by $A^{-1}BA^{-1}$ is the usual linear regression covariance matrix $\sigma^2 \left(\mathbf{X}^T\mathbf{X}\right)^{-1}$ where $\sigma^2$ is the variance of the residuals. However, that's rather strict. You get a considerably broader class of estimators by relaxing the assumptions involved around the $n \times n$ residual matrix: $$R = (Y-\mathbf{X}^T\beta)(Y-\mathbf{X}^T\beta)$$. The "HC0" vcovHC estimator is consistent even when the data are not independent. So I will not say that we "assume" the residuals are independent, but I will say that we use "a working independent covariance structure". Then the matrix $R$ is replaced by a diagonal of the residuals $$R_{ii} = (Y_i - \beta \mathbf{X}_{I.})^2, \quad 0\text{ elsewhere}$$ This estimator works really well except under small samples (<40 is often purported). The HC1-3 are various finite sample corrections. HC3 is generally the best performing. However if there are autoregressive effects, the off-diagonal entries of $T$ are non-zero, so a scaled covariance matrix is produced based on commonly used autoregressive structures. This is the rationale for the "vcovHAC". Here, very flexible and general methods are produced to estimate the autoregressive effect: the details may be beyond the scope of your question. The "meatHAC" function is the general workhorse: the default method is Andrews'. Newey-West is a special case of the general autoregressive error estimator. These methods solve one of two problems: 1. at what rate does correlation decay between "adjacent" observations and 2. what is a reasonable distance between two observations? These If you have balanced panel data, this covariance estimator is overkill. You should use gee from the gee package instead specifying the covariance structure to AR-1 or similar. As for which to use, it depends on the nature of the data analysis and the scientific question. I would not advise fitting all the types and picking the one that looks best, as it is a multiple testing issue. As I alluded to earlier, the vcovHC estimator is consistent even in the presence of an autoregressive effect, so you can use and justify a "working independence correlation model" in a variety of circumstances.
vcovHC, vcovHAC, NeweyWest – which function to use? The "sandwich" in question is two pieces of bread defined by the expected information enclosing a meat defined by the observed information. See my comments here and here. For a linear regression, the
26,766
Are there any libraries available for CART-like methods using sparse predictors & responses?
I'd like to see a benchmark of their sparse implementation against a modern CART implementations used in rf's. That paper is quite old in terms of advances in this area and I would be surprised if it still provided significant speed up. Part of the reason is that using a clever sorting algorithm like Quicksort in split searching can provide near O(n) performance for near constant features (including sparse ones). Fast implementations also track when a feature has become constant within a branch of a tree and should no longer be examined. Dense feature representations provide fast look ups in a cpu cache friendly fashion so you'd need a really clever sparse representation to win out in cpu cycles. This is discussed here, here, here. I actually implemented a sparse data representation of data at one point in my rf package CloudForest but found it to be slower then a dense representation of the data and abandoned it though it did provide some memory advantages. My recommendation would be to try scikit learn or cloudforest built in boosting stuff and see if it is fast enough. Both can be extended with custom boosting criteria if you want to do something non standard. (I actually wrote cloudforest originally to work with large, highly dimensional genetic data sets which are very similar to what you are describing).
Are there any libraries available for CART-like methods using sparse predictors & responses?
I'd like to see a benchmark of their sparse implementation against a modern CART implementations used in rf's. That paper is quite old in terms of advances in this area and I would be surprised if it
Are there any libraries available for CART-like methods using sparse predictors & responses? I'd like to see a benchmark of their sparse implementation against a modern CART implementations used in rf's. That paper is quite old in terms of advances in this area and I would be surprised if it still provided significant speed up. Part of the reason is that using a clever sorting algorithm like Quicksort in split searching can provide near O(n) performance for near constant features (including sparse ones). Fast implementations also track when a feature has become constant within a branch of a tree and should no longer be examined. Dense feature representations provide fast look ups in a cpu cache friendly fashion so you'd need a really clever sparse representation to win out in cpu cycles. This is discussed here, here, here. I actually implemented a sparse data representation of data at one point in my rf package CloudForest but found it to be slower then a dense representation of the data and abandoned it though it did provide some memory advantages. My recommendation would be to try scikit learn or cloudforest built in boosting stuff and see if it is fast enough. Both can be extended with custom boosting criteria if you want to do something non standard. (I actually wrote cloudforest originally to work with large, highly dimensional genetic data sets which are very similar to what you are describing).
Are there any libraries available for CART-like methods using sparse predictors & responses? I'd like to see a benchmark of their sparse implementation against a modern CART implementations used in rf's. That paper is quite old in terms of advances in this area and I would be surprised if it
26,767
Are there any libraries available for CART-like methods using sparse predictors & responses?
Probably there is a little chance for any code which would take advantage of that -- you would rather need to write something on your own. However, the other option is to transform your data to reduce the size of your data removing redundant information. It is hard to tell how without the information about your data, but maybe you can merge some features which you know does not overlap, PCA parts of it or change representation of some descriptors? Also, if you say your response is sparse as well, maybe it is reasonable to downsample objects with 0 in response?
Are there any libraries available for CART-like methods using sparse predictors & responses?
Probably there is a little chance for any code which would take advantage of that -- you would rather need to write something on your own. However, the other option is to transform your data to reduce
Are there any libraries available for CART-like methods using sparse predictors & responses? Probably there is a little chance for any code which would take advantage of that -- you would rather need to write something on your own. However, the other option is to transform your data to reduce the size of your data removing redundant information. It is hard to tell how without the information about your data, but maybe you can merge some features which you know does not overlap, PCA parts of it or change representation of some descriptors? Also, if you say your response is sparse as well, maybe it is reasonable to downsample objects with 0 in response?
Are there any libraries available for CART-like methods using sparse predictors & responses? Probably there is a little chance for any code which would take advantage of that -- you would rather need to write something on your own. However, the other option is to transform your data to reduce
26,768
Are there any libraries available for CART-like methods using sparse predictors & responses?
Have you looked at the caret package in R? It provides an interface that makes it easier to use a variety of models, including some for recursive partitioning such as rpart, ctree and ctree2.
Are there any libraries available for CART-like methods using sparse predictors & responses?
Have you looked at the caret package in R? It provides an interface that makes it easier to use a variety of models, including some for recursive partitioning such as rpart, ctree and ctree2.
Are there any libraries available for CART-like methods using sparse predictors & responses? Have you looked at the caret package in R? It provides an interface that makes it easier to use a variety of models, including some for recursive partitioning such as rpart, ctree and ctree2.
Are there any libraries available for CART-like methods using sparse predictors & responses? Have you looked at the caret package in R? It provides an interface that makes it easier to use a variety of models, including some for recursive partitioning such as rpart, ctree and ctree2.
26,769
How to quantify redundancy of features?
This sounds like a problem of feature selection, if this is the case, I think you want to compute the mutual information between all subsets of features and the classification output. The subset with the highest mutual information will be the set of features that contains the most 'information' about the resulting classification of the record. If you only have 3 features, you can compute all possible subsets in a reasonable amount of time, if your feature set grows larger, you'll have to approximate this (typically using a greedy approach: take feature with the highest MI at each step).
How to quantify redundancy of features?
This sounds like a problem of feature selection, if this is the case, I think you want to compute the mutual information between all subsets of features and the classification output. The subset with
How to quantify redundancy of features? This sounds like a problem of feature selection, if this is the case, I think you want to compute the mutual information between all subsets of features and the classification output. The subset with the highest mutual information will be the set of features that contains the most 'information' about the resulting classification of the record. If you only have 3 features, you can compute all possible subsets in a reasonable amount of time, if your feature set grows larger, you'll have to approximate this (typically using a greedy approach: take feature with the highest MI at each step).
How to quantify redundancy of features? This sounds like a problem of feature selection, if this is the case, I think you want to compute the mutual information between all subsets of features and the classification output. The subset with
26,770
Documented/reproducible examples of successful real-world applications of econometric methods?
As mentioned in the comments, travel demand forecasts often use inputs from discrete choice models (multinomial logit, nested logit, mixed logit, etc) to assist in the development of behavioral mode choice or route assignment in their travel demand forecasts. DCM certainly has many applications outside travel demand forecasting, but it has been used in the transportation industry for 30+ years so there should be lots of good examples. As for reproducible examples: Biogeme is an open source piece of software that is optimized for estimating logit models. The website provides the data, code, and a paper write up describing their methods. travelR is a project to make travel demand forecasts with R. There was a presentation at useR! 2010 about the project, abstract here and slides here. There is also a webinar coming up in a few weeks regarding R and travel demand forecasting that I'll find the link to and update here for those interested. Transportation Review Board Conference has made a list of all papers available online this year. I don't have a specific paper to link to, but there are several committee's worth of papers regarding the application of choice models in the transportation context.
Documented/reproducible examples of successful real-world applications of econometric methods?
As mentioned in the comments, travel demand forecasts often use inputs from discrete choice models (multinomial logit, nested logit, mixed logit, etc) to assist in the development of behavioral mode c
Documented/reproducible examples of successful real-world applications of econometric methods? As mentioned in the comments, travel demand forecasts often use inputs from discrete choice models (multinomial logit, nested logit, mixed logit, etc) to assist in the development of behavioral mode choice or route assignment in their travel demand forecasts. DCM certainly has many applications outside travel demand forecasting, but it has been used in the transportation industry for 30+ years so there should be lots of good examples. As for reproducible examples: Biogeme is an open source piece of software that is optimized for estimating logit models. The website provides the data, code, and a paper write up describing their methods. travelR is a project to make travel demand forecasts with R. There was a presentation at useR! 2010 about the project, abstract here and slides here. There is also a webinar coming up in a few weeks regarding R and travel demand forecasting that I'll find the link to and update here for those interested. Transportation Review Board Conference has made a list of all papers available online this year. I don't have a specific paper to link to, but there are several committee's worth of papers regarding the application of choice models in the transportation context.
Documented/reproducible examples of successful real-world applications of econometric methods? As mentioned in the comments, travel demand forecasts often use inputs from discrete choice models (multinomial logit, nested logit, mixed logit, etc) to assist in the development of behavioral mode c
26,771
What is the difference between summary() and loadings() for princomp() object in R?
The first output is the correct and most useful one. Calling loadings() on your object just returns a summary where the SS are always equal to 1, hence the % variance is just the SS loadings divided by the number of variables. It makes sense only when using Factor Analysis (like in factanal). I never use princomp or its SVD-based alternative (prcomp), and I prefer the FactoMineR or ade4 package which are by far more powerful! About your second question, the summary() function just returns the SD for each component (pc.cr$sdev in your case), and the rest of the table seems to be computed afterwards (through the print or show method, I didn't investigate this in details). > getS3method("summary","princomp") function (object, loadings = FALSE, cutoff = 0.1, ...) { object$cutoff <- cutoff object$print.loadings <- loadings class(object) <- "summary.princomp" object } <environment: namespace:stats> What princomp() itself does may be viewed using getAnywhere("princomp.default").
What is the difference between summary() and loadings() for princomp() object in R?
The first output is the correct and most useful one. Calling loadings() on your object just returns a summary where the SS are always equal to 1, hence the % variance is just the SS loadings divided b
What is the difference between summary() and loadings() for princomp() object in R? The first output is the correct and most useful one. Calling loadings() on your object just returns a summary where the SS are always equal to 1, hence the % variance is just the SS loadings divided by the number of variables. It makes sense only when using Factor Analysis (like in factanal). I never use princomp or its SVD-based alternative (prcomp), and I prefer the FactoMineR or ade4 package which are by far more powerful! About your second question, the summary() function just returns the SD for each component (pc.cr$sdev in your case), and the rest of the table seems to be computed afterwards (through the print or show method, I didn't investigate this in details). > getS3method("summary","princomp") function (object, loadings = FALSE, cutoff = 0.1, ...) { object$cutoff <- cutoff object$print.loadings <- loadings class(object) <- "summary.princomp" object } <environment: namespace:stats> What princomp() itself does may be viewed using getAnywhere("princomp.default").
What is the difference between summary() and loadings() for princomp() object in R? The first output is the correct and most useful one. Calling loadings() on your object just returns a summary where the SS are always equal to 1, hence the % variance is just the SS loadings divided b
26,772
Relation between Gaussian Processes and Gaussian Markov Random Fields
Lots of questions here, lots of upvotes, but no answers yet. So, I'll offer a partial response. At a high level, I view GMRFs as structural modeling driven. The focus is on "neighborhood" interactions. Only enumerated relationships are parameterized, for instance: two variable covariance - Dempster, A. P. (1972). Covariance selection. Biometrics, 157-175. (read beyond misleading abstract, method shown iteratively adds complexity to precision matrices) four neighbor and eight neighbor lattice models - see early 2000's computer vision literature. broader neighborhoods defined by filters - Zhu, Song Chun, Yingnian Wu, and David Mumford. "Filters, random fields and maximum entropy (FRAME): Towards a unified theory for texture modeling." International Journal of Computer Vision 27 (1998): 107-126. my paper where "neighborhoods" are defined by stock market portfolios - Keane, Kevin R. "Portfolio Variance Constraints." ICPRAM. 2019. The important thing to emphasize is that in Dempster; Zhu, Wu and Mumford; and my paper, construction of the precision matrix is iterative and additive, where additional constraints (Lagrange multipliers) are imposed subsequent to a simpler model being rejected. The simplest multivariate Gaussian structure is a diagonal precision matrix (all variables are independent). Note that all multivariate Gaussian distributions may be translated, rotated and scaled to an independent standard normal multivariate distribution (matrix operations similar to SVD result in the identity matrix for a precision matrix). To maintain application domain context (original coordinates), the Gaussian graphical model literature in general does not entertain rotation and scaling to a computationally simpler representation. In contrast, GPs are data driven. All variable interactions are parameterized. While typically regularized (or built with a prior), the model is a full multivariate Gaussian model eventually driven by observed data as additional observations are available. My personal preference is to start from a full model, as it seems a high hurdle to impose structural constraints on the precision matrix of phenomenon you are learning about through data acquisition. If you know the truth, you don't need a model; and if you don't know the truth, don't impose restrictive structure on your exploration. This rant is further discussed in my paper with Corso - Keane, Kevin R., and Jason J. Corso. "The Wrong Tool for Inference." (2018), section (2.1) discusses a graphical model "fail" when arguably much structural information was known. The full model outperformed the graphical model in this instance. Lastly, I found this presentation a useful overview of fitting Gaussian processes to data. There is a discussion of "doing classification with GP".
Relation between Gaussian Processes and Gaussian Markov Random Fields
Lots of questions here, lots of upvotes, but no answers yet. So, I'll offer a partial response. At a high level, I view GMRFs as structural modeling driven. The focus is on "neighborhood" interactions
Relation between Gaussian Processes and Gaussian Markov Random Fields Lots of questions here, lots of upvotes, but no answers yet. So, I'll offer a partial response. At a high level, I view GMRFs as structural modeling driven. The focus is on "neighborhood" interactions. Only enumerated relationships are parameterized, for instance: two variable covariance - Dempster, A. P. (1972). Covariance selection. Biometrics, 157-175. (read beyond misleading abstract, method shown iteratively adds complexity to precision matrices) four neighbor and eight neighbor lattice models - see early 2000's computer vision literature. broader neighborhoods defined by filters - Zhu, Song Chun, Yingnian Wu, and David Mumford. "Filters, random fields and maximum entropy (FRAME): Towards a unified theory for texture modeling." International Journal of Computer Vision 27 (1998): 107-126. my paper where "neighborhoods" are defined by stock market portfolios - Keane, Kevin R. "Portfolio Variance Constraints." ICPRAM. 2019. The important thing to emphasize is that in Dempster; Zhu, Wu and Mumford; and my paper, construction of the precision matrix is iterative and additive, where additional constraints (Lagrange multipliers) are imposed subsequent to a simpler model being rejected. The simplest multivariate Gaussian structure is a diagonal precision matrix (all variables are independent). Note that all multivariate Gaussian distributions may be translated, rotated and scaled to an independent standard normal multivariate distribution (matrix operations similar to SVD result in the identity matrix for a precision matrix). To maintain application domain context (original coordinates), the Gaussian graphical model literature in general does not entertain rotation and scaling to a computationally simpler representation. In contrast, GPs are data driven. All variable interactions are parameterized. While typically regularized (or built with a prior), the model is a full multivariate Gaussian model eventually driven by observed data as additional observations are available. My personal preference is to start from a full model, as it seems a high hurdle to impose structural constraints on the precision matrix of phenomenon you are learning about through data acquisition. If you know the truth, you don't need a model; and if you don't know the truth, don't impose restrictive structure on your exploration. This rant is further discussed in my paper with Corso - Keane, Kevin R., and Jason J. Corso. "The Wrong Tool for Inference." (2018), section (2.1) discusses a graphical model "fail" when arguably much structural information was known. The full model outperformed the graphical model in this instance. Lastly, I found this presentation a useful overview of fitting Gaussian processes to data. There is a discussion of "doing classification with GP".
Relation between Gaussian Processes and Gaussian Markov Random Fields Lots of questions here, lots of upvotes, but no answers yet. So, I'll offer a partial response. At a high level, I view GMRFs as structural modeling driven. The focus is on "neighborhood" interactions
26,773
Which theorem in Cover's 1965 paper is actually referred to as Cover's Theorem?
History of the quote Probably the quote is not originally by Thomas Cover. It occurred in a textbook from 1994 (and later editions) from Simon Haykin (Neural Networks: A Comprehensive Foundation) in section 5.2 Cover's theorem on the separability of patterns. Haykin used the typesetting of a quote, but was more like paraphrasing: The underlying justification is found in Cover’s theorem on the separability of patterns, which, in qualitative terms, may be stated as follows (Cover, 1965): A complex pattern-classification problem, cast in a high-dimensional space nonlinearly, is more likely to be linearly separable than in a low-dimensional space, provided that the space is not densely populated It may have been copied from there into other works. It is amazing that at some point it got changed into an actual quote and many articles simply copy it as being a quote. This proves once again that many people are actually not checking their original sources and are just copying others. Relationship with Cover's article It seems to be a bit unclear what Cover's theorem exactly is. The first theorem in the paper, which Cover calls the Function-Counting Theorem is about linear separability of points n points in d-dimensional space. In section III of the paper extensions are made to non-linear separability by viewing points in m-dimensional space being mapped to d-dimensional space. The particular quote might refer to that section of the paper and equation 19 In general, for $r$th-order polynomial separating surfaces, the number $L_m(r)$ of separable truth functions of $m$ variables is bounded above by $$L_m(r) \leq C\left(2m ,{m+r \choose m} \right)$$ So the more $m$ variables (which means casting into a higher dimensional space), the easier it becomes to separate the points.
Which theorem in Cover's 1965 paper is actually referred to as Cover's Theorem?
History of the quote Probably the quote is not originally by Thomas Cover. It occurred in a textbook from 1994 (and later editions) from Simon Haykin (Neural Networks: A Comprehensive Foundation) in s
Which theorem in Cover's 1965 paper is actually referred to as Cover's Theorem? History of the quote Probably the quote is not originally by Thomas Cover. It occurred in a textbook from 1994 (and later editions) from Simon Haykin (Neural Networks: A Comprehensive Foundation) in section 5.2 Cover's theorem on the separability of patterns. Haykin used the typesetting of a quote, but was more like paraphrasing: The underlying justification is found in Cover’s theorem on the separability of patterns, which, in qualitative terms, may be stated as follows (Cover, 1965): A complex pattern-classification problem, cast in a high-dimensional space nonlinearly, is more likely to be linearly separable than in a low-dimensional space, provided that the space is not densely populated It may have been copied from there into other works. It is amazing that at some point it got changed into an actual quote and many articles simply copy it as being a quote. This proves once again that many people are actually not checking their original sources and are just copying others. Relationship with Cover's article It seems to be a bit unclear what Cover's theorem exactly is. The first theorem in the paper, which Cover calls the Function-Counting Theorem is about linear separability of points n points in d-dimensional space. In section III of the paper extensions are made to non-linear separability by viewing points in m-dimensional space being mapped to d-dimensional space. The particular quote might refer to that section of the paper and equation 19 In general, for $r$th-order polynomial separating surfaces, the number $L_m(r)$ of separable truth functions of $m$ variables is bounded above by $$L_m(r) \leq C\left(2m ,{m+r \choose m} \right)$$ So the more $m$ variables (which means casting into a higher dimensional space), the easier it becomes to separate the points.
Which theorem in Cover's 1965 paper is actually referred to as Cover's Theorem? History of the quote Probably the quote is not originally by Thomas Cover. It occurred in a textbook from 1994 (and later editions) from Simon Haykin (Neural Networks: A Comprehensive Foundation) in s
26,774
What's the difference between Time Series Regression and Forecasting?
In principle what you have said captures the difference. But may be people refer TS Forecasting as TS Regression because technically, TS forecasting involves TS regression. Another point (concerning your second bullet point) is that every TS regression is not necessarily used for predicting. It may simply be for understanding the relationship between two variables. Consider a very naive example: $$C_t = \beta_0+\beta_1Y_t + \epsilon_t$$ where $C_t$ is consumption, $Y_t$ is income. In the above example, an economist may simply be interested in estimating, $\beta_1$ which is the marginal propensity to consume. In theory, the same model can be used for predicting $C_{t+h}$ given $Y_{t+h}$. But it is the practice (rather than theory) that is more interesting and complicated. Let me mention just 2 differences between TS regression and forecasting that one experiences in practice: Take above equation. At a given time, you are likely to have published figures for $Y_{t+h}$ but not $C_{t+h}$. This is where first practical different in TS Regression: Choice of Variables. Forecasting requires leading indicators, i.e. those explanatory variables that are available before the the response variable value is known. Here there is less interest discovering whether the given explanatory variable explains the response variable. Interest is more in how well it can predict the response variable. For example, for forecasting $C_t$ you may want to use volume of credit card transactions. We know that it is obviously going to explain $C_t$ (so not of interest to an economist) but very helpful in forecasting if the data is available in advance. Diagnostics: In TS regression the diagnostics of regression output usually involves checking for significance of explanatory variables - to ensure how well it explains changes in response variables. In forecasting it may not be so important (Rob Hyndman has given some example somewhere in his blog, I don't remember, however, exact topic). Another example is $R^2$ - important in forecasting, but not as much in general regression. There are many more (frankly, I have been thinking of posting this question for a list of separate diagnostic list for regression and forecasting). I am sure others here can give some more interesting inputs.
What's the difference between Time Series Regression and Forecasting?
In principle what you have said captures the difference. But may be people refer TS Forecasting as TS Regression because technically, TS forecasting involves TS regression. Another point (concerning y
What's the difference between Time Series Regression and Forecasting? In principle what you have said captures the difference. But may be people refer TS Forecasting as TS Regression because technically, TS forecasting involves TS regression. Another point (concerning your second bullet point) is that every TS regression is not necessarily used for predicting. It may simply be for understanding the relationship between two variables. Consider a very naive example: $$C_t = \beta_0+\beta_1Y_t + \epsilon_t$$ where $C_t$ is consumption, $Y_t$ is income. In the above example, an economist may simply be interested in estimating, $\beta_1$ which is the marginal propensity to consume. In theory, the same model can be used for predicting $C_{t+h}$ given $Y_{t+h}$. But it is the practice (rather than theory) that is more interesting and complicated. Let me mention just 2 differences between TS regression and forecasting that one experiences in practice: Take above equation. At a given time, you are likely to have published figures for $Y_{t+h}$ but not $C_{t+h}$. This is where first practical different in TS Regression: Choice of Variables. Forecasting requires leading indicators, i.e. those explanatory variables that are available before the the response variable value is known. Here there is less interest discovering whether the given explanatory variable explains the response variable. Interest is more in how well it can predict the response variable. For example, for forecasting $C_t$ you may want to use volume of credit card transactions. We know that it is obviously going to explain $C_t$ (so not of interest to an economist) but very helpful in forecasting if the data is available in advance. Diagnostics: In TS regression the diagnostics of regression output usually involves checking for significance of explanatory variables - to ensure how well it explains changes in response variables. In forecasting it may not be so important (Rob Hyndman has given some example somewhere in his blog, I don't remember, however, exact topic). Another example is $R^2$ - important in forecasting, but not as much in general regression. There are many more (frankly, I have been thinking of posting this question for a list of separate diagnostic list for regression and forecasting). I am sure others here can give some more interesting inputs.
What's the difference between Time Series Regression and Forecasting? In principle what you have said captures the difference. But may be people refer TS Forecasting as TS Regression because technically, TS forecasting involves TS regression. Another point (concerning y
26,775
What's the difference between Time Series Regression and Forecasting?
Time Series Forecasting (to my way of thinking ) purely uses the past of the endogenous series as the basis of the model (ARIMA or Box-Jenkins) . Time Series Regression also uses causal (exogenous)series and their lags in addition to the history of the endogenous series. These models are generally called Transfer Functions or Dynamic Regression Models or more frequently SARMAX models https://autobox.com/pdfs/SARMAX.pdf. Both approaches are best employed while detecting and incorporating latent deterministic structure such as pulses, level shifts and local time trends and possible transient effects of parameters or model error variance over time.. Please see http://www.autobox.com/pdfs/regvsbox-old.pdf which I wrote a number of years ago to provide more details/contrasts on "Regression vs Box_Jenkins"
What's the difference between Time Series Regression and Forecasting?
Time Series Forecasting (to my way of thinking ) purely uses the past of the endogenous series as the basis of the model (ARIMA or Box-Jenkins) . Time Series Regression also uses causal (exogenous)se
What's the difference between Time Series Regression and Forecasting? Time Series Forecasting (to my way of thinking ) purely uses the past of the endogenous series as the basis of the model (ARIMA or Box-Jenkins) . Time Series Regression also uses causal (exogenous)series and their lags in addition to the history of the endogenous series. These models are generally called Transfer Functions or Dynamic Regression Models or more frequently SARMAX models https://autobox.com/pdfs/SARMAX.pdf. Both approaches are best employed while detecting and incorporating latent deterministic structure such as pulses, level shifts and local time trends and possible transient effects of parameters or model error variance over time.. Please see http://www.autobox.com/pdfs/regvsbox-old.pdf which I wrote a number of years ago to provide more details/contrasts on "Regression vs Box_Jenkins"
What's the difference between Time Series Regression and Forecasting? Time Series Forecasting (to my way of thinking ) purely uses the past of the endogenous series as the basis of the model (ARIMA or Box-Jenkins) . Time Series Regression also uses causal (exogenous)se
26,776
What's the difference between Time Series Regression and Forecasting?
Well, regression is about estimating/fitting a model and the concept expands beyond time series data. A model is fit to establish the relationship between the endogenous and exogenous variables. Forecasting/Prediction of the endogenous variable is one use case of a fitted model, but not all fitted models are good for forecasting purposes.
What's the difference between Time Series Regression and Forecasting?
Well, regression is about estimating/fitting a model and the concept expands beyond time series data. A model is fit to establish the relationship between the endogenous and exogenous variables. Forec
What's the difference between Time Series Regression and Forecasting? Well, regression is about estimating/fitting a model and the concept expands beyond time series data. A model is fit to establish the relationship between the endogenous and exogenous variables. Forecasting/Prediction of the endogenous variable is one use case of a fitted model, but not all fitted models are good for forecasting purposes.
What's the difference between Time Series Regression and Forecasting? Well, regression is about estimating/fitting a model and the concept expands beyond time series data. A model is fit to establish the relationship between the endogenous and exogenous variables. Forec
26,777
proportional hazards model with fixed interval censoring = cloglog GLM with fixed effect of time?
This particular situation is explained in Section 3.3.2 of Tutz and Schmid, Modeling Discrete Time-to-Event Data, Springer, 2016, adapted slightly below. Say that there is an underlying continuous-time proportional hazards (PH) model, but failures are only coded within intervals of time, e.g. the event is coded as happening at $T=t$ if is occurs within $[t-1,t)$. Then with covariate vector $x$ and regression coefficients $\beta$ the discrete hazard $\lambda(t|x)=P(T=t|T\ge t,x)$ can be written as $$ \lambda(t|x)= 1- \exp(-\exp (\gamma_{0t}+ x^T \beta)),$$ where the fixed time coefficient $\gamma_{0t}=\log (\Lambda_0(t)-\Lambda_0(t-1))$ and $\Lambda_0(t)$ is the cumulative baseline hazard function of the underlying continuous-time PH process. This is the form of a complementary log-log (Gompertz) model, as so nicely described here. This is called a "grouped proportional hazards model." How many "computational/technical difficulties" are avoided, however, isn't so clear. Unlike a continuous-time Cox model, in which the baseline hazard effectively disappears from the maximum-partial-likelihood calculations, this fixed-time-effect discrete approach requires estimation of the baseline hazard (as parameterized in $\gamma_{0t}$) at each interval end-point along with estimation of the regression coefficient values. That's not a big problem with the type of panel data envisioned in this question. Except for the link function, it's not different from standard discrete-time survival models that use logistic regression for panel data with time modeled as a fixed effect. "Computational/technical difficulties" arise with this approach when each individual has her own interval-censoring times, as in Finkelstein's original adaptation of PH models to interval censoring (Biometrics 42: 845-854, 1986). This occurs e.g. with modeling of disease progression in cancer, when between-visit progression is detected at clinical appointment times that aren't uniform among patients. In that situation with $N$ patients you might need to estimate as many as $2N$ nuisance values of a baseline hazard function (one for both ends of each patient's event-containing interval) in addition to the regression coefficient values of primary interest. That's why tools like those in the icenReg package can be needed.
proportional hazards model with fixed interval censoring = cloglog GLM with fixed effect of time?
This particular situation is explained in Section 3.3.2 of Tutz and Schmid, Modeling Discrete Time-to-Event Data, Springer, 2016, adapted slightly below. Say that there is an underlying continuous-tim
proportional hazards model with fixed interval censoring = cloglog GLM with fixed effect of time? This particular situation is explained in Section 3.3.2 of Tutz and Schmid, Modeling Discrete Time-to-Event Data, Springer, 2016, adapted slightly below. Say that there is an underlying continuous-time proportional hazards (PH) model, but failures are only coded within intervals of time, e.g. the event is coded as happening at $T=t$ if is occurs within $[t-1,t)$. Then with covariate vector $x$ and regression coefficients $\beta$ the discrete hazard $\lambda(t|x)=P(T=t|T\ge t,x)$ can be written as $$ \lambda(t|x)= 1- \exp(-\exp (\gamma_{0t}+ x^T \beta)),$$ where the fixed time coefficient $\gamma_{0t}=\log (\Lambda_0(t)-\Lambda_0(t-1))$ and $\Lambda_0(t)$ is the cumulative baseline hazard function of the underlying continuous-time PH process. This is the form of a complementary log-log (Gompertz) model, as so nicely described here. This is called a "grouped proportional hazards model." How many "computational/technical difficulties" are avoided, however, isn't so clear. Unlike a continuous-time Cox model, in which the baseline hazard effectively disappears from the maximum-partial-likelihood calculations, this fixed-time-effect discrete approach requires estimation of the baseline hazard (as parameterized in $\gamma_{0t}$) at each interval end-point along with estimation of the regression coefficient values. That's not a big problem with the type of panel data envisioned in this question. Except for the link function, it's not different from standard discrete-time survival models that use logistic regression for panel data with time modeled as a fixed effect. "Computational/technical difficulties" arise with this approach when each individual has her own interval-censoring times, as in Finkelstein's original adaptation of PH models to interval censoring (Biometrics 42: 845-854, 1986). This occurs e.g. with modeling of disease progression in cancer, when between-visit progression is detected at clinical appointment times that aren't uniform among patients. In that situation with $N$ patients you might need to estimate as many as $2N$ nuisance values of a baseline hazard function (one for both ends of each patient's event-containing interval) in addition to the regression coefficient values of primary interest. That's why tools like those in the icenReg package can be needed.
proportional hazards model with fixed interval censoring = cloglog GLM with fixed effect of time? This particular situation is explained in Section 3.3.2 of Tutz and Schmid, Modeling Discrete Time-to-Event Data, Springer, 2016, adapted slightly below. Say that there is an underlying continuous-tim
26,778
Is MLE of $\theta$ asymptotically normal when $(X,Y)\sim e^{-(x/\theta+\theta y)}\mathbf1_{x,y>0}$?
A direct proof for asymptotic normality: The log-likelihood here is $$L = -\frac {n \bar x}{\theta} - \theta n \bar y$$ The first and second derivatives are $$\frac {\partial L}{\partial \theta } = \frac {n \bar x}{\theta^2} - n\bar y,\;\;\;\frac {\partial^2 L}{\partial \theta^2 } = -\frac {2n \bar x}{\theta^3} $$ The MLE $\hat \theta_n$ satisfies $$\frac {\partial L(\hat \theta_n)}{\partial \theta }=0$$ Applying a mean value expansion around the true value $\theta_0 $ we have $$\frac {\partial L(\hat \theta_n)}{\partial \theta } = \frac {\partial L(\theta_0)}{\partial \theta } + \frac {\partial^2 L(\tilde \theta_n)}{\partial \theta^2 }(\hat \theta_n - \theta_0) =0$$ for some $\tilde \theta_n$ in between $\hat \theta_n$ and $\theta_0$. Re-arranging we have, $$(\hat \theta_n - \theta_0) = -\left(\frac {\partial^2 L(\tilde \theta_n)}{\partial \theta^2 }\right)^{-1}\frac {\partial L(\theta_0)}{\partial \theta }$$ But in our single-parameter case, the inverse is just the reciprocal, so, inserting also the specific expressions of the derivatives, $$(\hat \theta_n - \theta_0) = \frac {\tilde \theta^3_n}{2n\bar x}\left(\frac {n \bar x}{\theta^2_0} - n\bar y\right)$$ $$\implies \sqrt{n}(\hat \theta_n - \theta_0) = \frac {\tilde \theta^3_n}{2\bar x \theta_0^2}\sqrt{n}\cdot\left(\bar x - \theta_0^2\bar y \right)$$ $$\implies \sqrt{n}(\hat \theta_n - \theta_0) = \frac {\tilde \theta^3_n}{2\bar x \theta_0^2}\cdot\left (n^{-1/2}\sum_{i=1}^n(x_i-\theta_0^2 y_i)\right)$$ The variance of the sum is $$\text{Var}\left(\sum_{i=1}^n(x_i-\theta_0^2 y_i)\right) = 2n\theta_0^2 $$ Manipulating the expression we can write, using $S_n$ for the sum of the i.i.d. elements, $$\sqrt{n}(\hat \theta_n - \theta_0) = \left(\frac {\tilde \theta^3_n}{\sqrt{2}\bar x \theta_0}\right)\cdot\frac {\sum_{i=1}^n(x_i-\theta_0^2 y_i)}{\sqrt{n}\sqrt{2}\theta_0} $$ $$\sqrt{n}(\hat \theta_n - \theta_0) = \left(\frac {\tilde \theta^3_n}{\sqrt{2}\bar x \theta_0}\right)\cdot\frac {S_n}{\sqrt{\text{Var}(S_n)}}$$ More over, we have that $E(x_i-\theta_0^2 y_i) = 0$, so $E(S_n)=0$. So we have the subject matter of a classical CLT, and one can verify that the Lindeberg condition is satisfied. It follows that $$\frac {S_n}{\sqrt{\text{Var}(S_n)}} \to_d N(0,1)$$ Due to the consistency of the estimator, we also have $$\left(\frac {\tilde \theta^3_n}{\sqrt{2}\bar x \theta_0}\right) \to_p \frac{\theta_0}{\sqrt{2}}$$ and by Slutsky's Theorem we arrive at $$\sqrt{n}(\hat \theta_n - \theta_0) \to_d N (0, \theta_0^2/2)$$ Nice. Double the information, half the variance (compared to the case where we would estimate $\theta_0$ based on a sample from a single random variable). PS: The fact that in the above expressions $\theta_0$ appears in the denominator, points towards @whuber's comment that MLE's asymptotic normality needs the unknown parameter to be away from the boundary of the parameter space (in our case, away from zero).
Is MLE of $\theta$ asymptotically normal when $(X,Y)\sim e^{-(x/\theta+\theta y)}\mathbf1_{x,y>0}$?
A direct proof for asymptotic normality: The log-likelihood here is $$L = -\frac {n \bar x}{\theta} - \theta n \bar y$$ The first and second derivatives are $$\frac {\partial L}{\partial \theta } = \f
Is MLE of $\theta$ asymptotically normal when $(X,Y)\sim e^{-(x/\theta+\theta y)}\mathbf1_{x,y>0}$? A direct proof for asymptotic normality: The log-likelihood here is $$L = -\frac {n \bar x}{\theta} - \theta n \bar y$$ The first and second derivatives are $$\frac {\partial L}{\partial \theta } = \frac {n \bar x}{\theta^2} - n\bar y,\;\;\;\frac {\partial^2 L}{\partial \theta^2 } = -\frac {2n \bar x}{\theta^3} $$ The MLE $\hat \theta_n$ satisfies $$\frac {\partial L(\hat \theta_n)}{\partial \theta }=0$$ Applying a mean value expansion around the true value $\theta_0 $ we have $$\frac {\partial L(\hat \theta_n)}{\partial \theta } = \frac {\partial L(\theta_0)}{\partial \theta } + \frac {\partial^2 L(\tilde \theta_n)}{\partial \theta^2 }(\hat \theta_n - \theta_0) =0$$ for some $\tilde \theta_n$ in between $\hat \theta_n$ and $\theta_0$. Re-arranging we have, $$(\hat \theta_n - \theta_0) = -\left(\frac {\partial^2 L(\tilde \theta_n)}{\partial \theta^2 }\right)^{-1}\frac {\partial L(\theta_0)}{\partial \theta }$$ But in our single-parameter case, the inverse is just the reciprocal, so, inserting also the specific expressions of the derivatives, $$(\hat \theta_n - \theta_0) = \frac {\tilde \theta^3_n}{2n\bar x}\left(\frac {n \bar x}{\theta^2_0} - n\bar y\right)$$ $$\implies \sqrt{n}(\hat \theta_n - \theta_0) = \frac {\tilde \theta^3_n}{2\bar x \theta_0^2}\sqrt{n}\cdot\left(\bar x - \theta_0^2\bar y \right)$$ $$\implies \sqrt{n}(\hat \theta_n - \theta_0) = \frac {\tilde \theta^3_n}{2\bar x \theta_0^2}\cdot\left (n^{-1/2}\sum_{i=1}^n(x_i-\theta_0^2 y_i)\right)$$ The variance of the sum is $$\text{Var}\left(\sum_{i=1}^n(x_i-\theta_0^2 y_i)\right) = 2n\theta_0^2 $$ Manipulating the expression we can write, using $S_n$ for the sum of the i.i.d. elements, $$\sqrt{n}(\hat \theta_n - \theta_0) = \left(\frac {\tilde \theta^3_n}{\sqrt{2}\bar x \theta_0}\right)\cdot\frac {\sum_{i=1}^n(x_i-\theta_0^2 y_i)}{\sqrt{n}\sqrt{2}\theta_0} $$ $$\sqrt{n}(\hat \theta_n - \theta_0) = \left(\frac {\tilde \theta^3_n}{\sqrt{2}\bar x \theta_0}\right)\cdot\frac {S_n}{\sqrt{\text{Var}(S_n)}}$$ More over, we have that $E(x_i-\theta_0^2 y_i) = 0$, so $E(S_n)=0$. So we have the subject matter of a classical CLT, and one can verify that the Lindeberg condition is satisfied. It follows that $$\frac {S_n}{\sqrt{\text{Var}(S_n)}} \to_d N(0,1)$$ Due to the consistency of the estimator, we also have $$\left(\frac {\tilde \theta^3_n}{\sqrt{2}\bar x \theta_0}\right) \to_p \frac{\theta_0}{\sqrt{2}}$$ and by Slutsky's Theorem we arrive at $$\sqrt{n}(\hat \theta_n - \theta_0) \to_d N (0, \theta_0^2/2)$$ Nice. Double the information, half the variance (compared to the case where we would estimate $\theta_0$ based on a sample from a single random variable). PS: The fact that in the above expressions $\theta_0$ appears in the denominator, points towards @whuber's comment that MLE's asymptotic normality needs the unknown parameter to be away from the boundary of the parameter space (in our case, away from zero).
Is MLE of $\theta$ asymptotically normal when $(X,Y)\sim e^{-(x/\theta+\theta y)}\mathbf1_{x,y>0}$? A direct proof for asymptotic normality: The log-likelihood here is $$L = -\frac {n \bar x}{\theta} - \theta n \bar y$$ The first and second derivatives are $$\frac {\partial L}{\partial \theta } = \f
26,779
Repeated measures anova: lm vs lmer
Strange, when I use your last model, I find a perfect match, not a close match: Fixed effects: Estimate Std. Error df t value Pr(>|t|) (Intercept) 3.91221 0.07242 99.00001 54.025 <2e-16 *** X1c 0.03277 0.05006 99.00000 0.655 0.514 X2c -0.04836 0.04644 99.00000 -1.042 0.300 X3c 0.04248 0.05009 99.00001 0.848 0.398 X1c:X2c 0.08370 0.08747 98.99998 0.957 0.341 X1c:X3c -0.07025 0.08895 98.99994 -0.790 0.432 X2c:X3c -0.02957 0.09616 99.00000 -0.308 0.759 X1c:X2c:X3c -8.14099 0.17507 99.00003 -46.502 <2e-16 ***
Repeated measures anova: lm vs lmer
Strange, when I use your last model, I find a perfect match, not a close match: Fixed effects: Estimate Std. Error df t value Pr(>|t|) (Intercept) 3.91221 0.07242 99.00001 5
Repeated measures anova: lm vs lmer Strange, when I use your last model, I find a perfect match, not a close match: Fixed effects: Estimate Std. Error df t value Pr(>|t|) (Intercept) 3.91221 0.07242 99.00001 54.025 <2e-16 *** X1c 0.03277 0.05006 99.00000 0.655 0.514 X2c -0.04836 0.04644 99.00000 -1.042 0.300 X3c 0.04248 0.05009 99.00001 0.848 0.398 X1c:X2c 0.08370 0.08747 98.99998 0.957 0.341 X1c:X3c -0.07025 0.08895 98.99994 -0.790 0.432 X2c:X3c -0.02957 0.09616 99.00000 -0.308 0.759 X1c:X2c:X3c -8.14099 0.17507 99.00003 -46.502 <2e-16 ***
Repeated measures anova: lm vs lmer Strange, when I use your last model, I find a perfect match, not a close match: Fixed effects: Estimate Std. Error df t value Pr(>|t|) (Intercept) 3.91221 0.07242 99.00001 5
26,780
How to pick length-scale bounds for RBC kernels in Gaussian Process Regression?
When "fitting" a GP with a certain kernel to a dataset, what we're essentially trying to do is to infer the most suitable values of the hyperparameters (of which the lengthscale is an important one), given the data. This usually takes the form of an optimisation problem, where we try to maximise the probability of observing the data, given the model (or, more precisely, maximise the log marginal likelihood). As GPs are very flexible models, this optimisation can be quite tricky if it is not set up properly, and this includes the viable search space. I believe the behaviour you're observing is due to the optimiser (L-BFGS-B) being initialised in (relatively) flat areas of the search space, and thus getting "stuck" there. By increasing the bounds of the search space, you are making it more likely that the lengthscale is initialised at a large value, which we can anticipate causes quite a flat log marginal likelihood function (a GP with an RBF kernel will "encode" asymptotically linear functions as $l \rightarrow \infty$). I'm not sure why the optimiser isn't failing in the case of the $10^3$ lengthscale upper bound, but you can see the predictions are flat, which suggests it has returned a nonsensically large lengthscale. I would recommend reading section 3 of this article by Michael Betancourt to understand this problem in a little more detail, but a quick explanation is that suitable lengthscale bounds depend on the support of your function. Though it does depend on the parametrisation (I believe Sklearn uses a fairly standard one), the RBF kernel is unable to "distinguish properly between" (in the context of changes to the opimisation objective) lengthscales shorter than the minimum spacing in your data, and larger than the maximum spacing of your data. As a starting point, I would recommend placing an upper bound on $l$ equal to the maximum spacing between any two points in your dataset, and a lower bound equal to the larger of either the minimum spacing between any two points or some small-ish value (say 1e-3; to prevent the minimum spacing being zero in the case of duplicate observations). Note that I don't think the above holds precisely for kernels with anisotropic lengthscales (that is, "ARD" kernels with multiple different lengthscales), but is nevertheless a useful starting point.
How to pick length-scale bounds for RBC kernels in Gaussian Process Regression?
When "fitting" a GP with a certain kernel to a dataset, what we're essentially trying to do is to infer the most suitable values of the hyperparameters (of which the lengthscale is an important one),
How to pick length-scale bounds for RBC kernels in Gaussian Process Regression? When "fitting" a GP with a certain kernel to a dataset, what we're essentially trying to do is to infer the most suitable values of the hyperparameters (of which the lengthscale is an important one), given the data. This usually takes the form of an optimisation problem, where we try to maximise the probability of observing the data, given the model (or, more precisely, maximise the log marginal likelihood). As GPs are very flexible models, this optimisation can be quite tricky if it is not set up properly, and this includes the viable search space. I believe the behaviour you're observing is due to the optimiser (L-BFGS-B) being initialised in (relatively) flat areas of the search space, and thus getting "stuck" there. By increasing the bounds of the search space, you are making it more likely that the lengthscale is initialised at a large value, which we can anticipate causes quite a flat log marginal likelihood function (a GP with an RBF kernel will "encode" asymptotically linear functions as $l \rightarrow \infty$). I'm not sure why the optimiser isn't failing in the case of the $10^3$ lengthscale upper bound, but you can see the predictions are flat, which suggests it has returned a nonsensically large lengthscale. I would recommend reading section 3 of this article by Michael Betancourt to understand this problem in a little more detail, but a quick explanation is that suitable lengthscale bounds depend on the support of your function. Though it does depend on the parametrisation (I believe Sklearn uses a fairly standard one), the RBF kernel is unable to "distinguish properly between" (in the context of changes to the opimisation objective) lengthscales shorter than the minimum spacing in your data, and larger than the maximum spacing of your data. As a starting point, I would recommend placing an upper bound on $l$ equal to the maximum spacing between any two points in your dataset, and a lower bound equal to the larger of either the minimum spacing between any two points or some small-ish value (say 1e-3; to prevent the minimum spacing being zero in the case of duplicate observations). Note that I don't think the above holds precisely for kernels with anisotropic lengthscales (that is, "ARD" kernels with multiple different lengthscales), but is nevertheless a useful starting point.
How to pick length-scale bounds for RBC kernels in Gaussian Process Regression? When "fitting" a GP with a certain kernel to a dataset, what we're essentially trying to do is to infer the most suitable values of the hyperparameters (of which the lengthscale is an important one),
26,781
How is the confidence interval built when executing the Wilcoxon.test in R?
I just want to estimate the median of the population with a confidence interval using a non-parametric method. Note that the interval generated for the signed rank test is for the population version of the one-sample Hodges-Lehmann statistic (the pseudomedian), not the median. Under the assumption of symmetry (which is necessary under the null for the signed rank test, but not necessarily required under the alternative, which is what you're calculating a confidence interval under), the two population quantities will coincide. You may be happy to make that somewhat stronger assumption, but keep in mind that it's quite possible for the sample median to fall outside the CI this generates. How is the confidence interval shown above related to the Wilcoxon signed rank test? It's the set of values for the pseudomedian that would not be rejected by a signed rank statistic. You can actually find the limits that way; this is a pretty general way to arrive at confidence intervals for statistics you don't have a simpler way to do it for. There's a specific way to find the limits for the signed rank test that doesn't need you to do that, but you can use search methods to get there quite quickly with this general approach. The more specific approach for the signed rank test is based on a symmetric pair of order statistics of the Walsh averages (averages of each $(i,j)$ pair $\frac{1}{2}(X_i+X_j)$, for $i \leq j$ ... i.e. including each point averaged with itself). The signed rank statistic is the number of positive $W$s. Then if we label those averages $W_k, k=1, 2, ..., m$ where $m=n(n+1)/2$, the corresponding interval will be the symmetric pair of order $(W_{(k)},W_{(m+1-k)})$ with $k$ chosen as small as possible but still leads to endpoints in the non-rejection region of the test. (This pdf outlines that in some detail.)
How is the confidence interval built when executing the Wilcoxon.test in R?
I just want to estimate the median of the population with a confidence interval using a non-parametric method. Note that the interval generated for the signed rank test is for the population version
How is the confidence interval built when executing the Wilcoxon.test in R? I just want to estimate the median of the population with a confidence interval using a non-parametric method. Note that the interval generated for the signed rank test is for the population version of the one-sample Hodges-Lehmann statistic (the pseudomedian), not the median. Under the assumption of symmetry (which is necessary under the null for the signed rank test, but not necessarily required under the alternative, which is what you're calculating a confidence interval under), the two population quantities will coincide. You may be happy to make that somewhat stronger assumption, but keep in mind that it's quite possible for the sample median to fall outside the CI this generates. How is the confidence interval shown above related to the Wilcoxon signed rank test? It's the set of values for the pseudomedian that would not be rejected by a signed rank statistic. You can actually find the limits that way; this is a pretty general way to arrive at confidence intervals for statistics you don't have a simpler way to do it for. There's a specific way to find the limits for the signed rank test that doesn't need you to do that, but you can use search methods to get there quite quickly with this general approach. The more specific approach for the signed rank test is based on a symmetric pair of order statistics of the Walsh averages (averages of each $(i,j)$ pair $\frac{1}{2}(X_i+X_j)$, for $i \leq j$ ... i.e. including each point averaged with itself). The signed rank statistic is the number of positive $W$s. Then if we label those averages $W_k, k=1, 2, ..., m$ where $m=n(n+1)/2$, the corresponding interval will be the symmetric pair of order $(W_{(k)},W_{(m+1-k)})$ with $k$ chosen as small as possible but still leads to endpoints in the non-rejection region of the test. (This pdf outlines that in some detail.)
How is the confidence interval built when executing the Wilcoxon.test in R? I just want to estimate the median of the population with a confidence interval using a non-parametric method. Note that the interval generated for the signed rank test is for the population version
26,782
How to select landmarks of Kernel to run SVM
M is the number of data points, not the number of features. So we take all our (training) data, and for each (xi,yi), we get a landmark. Notice that in the combined minimisation term, each fi is combined with its matching yi, so the minimisation takes account of which landmarks should be positive and which should be negative. In the video each red dot AND each blue dot should be a landmark.
How to select landmarks of Kernel to run SVM
M is the number of data points, not the number of features. So we take all our (training) data, and for each (xi,yi), we get a landmark. Notice that in the combined minimisation term, each fi is comb
How to select landmarks of Kernel to run SVM M is the number of data points, not the number of features. So we take all our (training) data, and for each (xi,yi), we get a landmark. Notice that in the combined minimisation term, each fi is combined with its matching yi, so the minimisation takes account of which landmarks should be positive and which should be negative. In the video each red dot AND each blue dot should be a landmark.
How to select landmarks of Kernel to run SVM M is the number of data points, not the number of features. So we take all our (training) data, and for each (xi,yi), we get a landmark. Notice that in the combined minimisation term, each fi is comb
26,783
How to select landmarks of Kernel to run SVM
Obviously very late, but as Andrew's answer mentions, each $f^{(i)}$ is paired with the same label as $x^{(i)}$. That is, if $x^{(i)}$ is paired with a corresponding label of $1$, then $f^{(i)}$ will also be paired with $1$. For this reason, if we only utilize the features $x^{(i)}$ with corresponding labels of $1$ (i.e. positive features), we'd end up with a transformed dataset in which each of the features $f^{(i)}$ have corresponding label of $1$. Training an SVM on this transformed dataset would therefore yield an SVM that could constantly predict $1$, and obtain a cost of $0$ each time, which obviously isn't very helpful at all. This is all to say we need to pick both positive and negative feature as landmarks, otherwise we could end up with a transformed dataset so skewed that it becomes impossible to train an SVM with a reasonable test set performance on said transformed dataset. Hope this helps.
How to select landmarks of Kernel to run SVM
Obviously very late, but as Andrew's answer mentions, each $f^{(i)}$ is paired with the same label as $x^{(i)}$. That is, if $x^{(i)}$ is paired with a corresponding label of $1$, then $f^{(i)}$ will
How to select landmarks of Kernel to run SVM Obviously very late, but as Andrew's answer mentions, each $f^{(i)}$ is paired with the same label as $x^{(i)}$. That is, if $x^{(i)}$ is paired with a corresponding label of $1$, then $f^{(i)}$ will also be paired with $1$. For this reason, if we only utilize the features $x^{(i)}$ with corresponding labels of $1$ (i.e. positive features), we'd end up with a transformed dataset in which each of the features $f^{(i)}$ have corresponding label of $1$. Training an SVM on this transformed dataset would therefore yield an SVM that could constantly predict $1$, and obtain a cost of $0$ each time, which obviously isn't very helpful at all. This is all to say we need to pick both positive and negative feature as landmarks, otherwise we could end up with a transformed dataset so skewed that it becomes impossible to train an SVM with a reasonable test set performance on said transformed dataset. Hope this helps.
How to select landmarks of Kernel to run SVM Obviously very late, but as Andrew's answer mentions, each $f^{(i)}$ is paired with the same label as $x^{(i)}$. That is, if $x^{(i)}$ is paired with a corresponding label of $1$, then $f^{(i)}$ will
26,784
Will there ever be an unhappy Tribble in Oz?
Edit: I seem to have mixed up the idea of positive probability and probability 1. The statement proved here is much weaker than I was hoping. Intuitively, the answer is 0. It's not hard to prove that Any given Tribble, with positive probability, eventually gets a mate. But I think this might not be enough to imply that with positive probability, every tribble eventually gets a mate, per Zeno's paradox. Here's a proof of the quoted statement. First, let's replace the problem with a simpler alternative formulation as follows. There is a stack that starts empty. A computer draws random variates in sequence independently and uniformly from [0, 1]. Each time a value is drawn, the stack changes. If the stack is empty, or the top item on the stack has a greater value, then a new item is added with the new value. (A bullet slower than the last bullet or a Tribble slower than the last Tribble has been created.) Otherwise, the top item is removed. (The bullets or Tribbles collide.) (This formulation doesn't include the event of a bullet or Tribble faster than the previous one being created but then being destroyed before it hits the previous one, but such an event leaves the stack the same, so it's of no consequence.) I want to prove that any given item, with positive probability, is eventually removed from the stack. We may assume without loss of generality that the value $1$ is never drawn, since the probability of this ever happening is 0. Let $I_0$ be an existing item and $v_0$ its value. Let $k$ be the number of items above $I_0$, and $v_1,\; v_2,\; …,\; v_k$ their values in order, with $v_k$ being the value of the current top item. If the next $k + 1$ values to be drawn land in, respectively, the interval $(v_k, 1)$, the interval $(v_{k-1}, 1)$, and so on until $(v_0, 1)$, then $I_0$ and all the items above it will be removed. The probability of this event is $(1 - v_k)(1 - v_{k-1})\cdots(1 - v_0)$, which is a finite product of positive numbers, so it's positive.
Will there ever be an unhappy Tribble in Oz?
Edit: I seem to have mixed up the idea of positive probability and probability 1. The statement proved here is much weaker than I was hoping. Intuitively, the answer is 0. It's not hard to prove that
Will there ever be an unhappy Tribble in Oz? Edit: I seem to have mixed up the idea of positive probability and probability 1. The statement proved here is much weaker than I was hoping. Intuitively, the answer is 0. It's not hard to prove that Any given Tribble, with positive probability, eventually gets a mate. But I think this might not be enough to imply that with positive probability, every tribble eventually gets a mate, per Zeno's paradox. Here's a proof of the quoted statement. First, let's replace the problem with a simpler alternative formulation as follows. There is a stack that starts empty. A computer draws random variates in sequence independently and uniformly from [0, 1]. Each time a value is drawn, the stack changes. If the stack is empty, or the top item on the stack has a greater value, then a new item is added with the new value. (A bullet slower than the last bullet or a Tribble slower than the last Tribble has been created.) Otherwise, the top item is removed. (The bullets or Tribbles collide.) (This formulation doesn't include the event of a bullet or Tribble faster than the previous one being created but then being destroyed before it hits the previous one, but such an event leaves the stack the same, so it's of no consequence.) I want to prove that any given item, with positive probability, is eventually removed from the stack. We may assume without loss of generality that the value $1$ is never drawn, since the probability of this ever happening is 0. Let $I_0$ be an existing item and $v_0$ its value. Let $k$ be the number of items above $I_0$, and $v_1,\; v_2,\; …,\; v_k$ their values in order, with $v_k$ being the value of the current top item. If the next $k + 1$ values to be drawn land in, respectively, the interval $(v_k, 1)$, the interval $(v_{k-1}, 1)$, and so on until $(v_0, 1)$, then $I_0$ and all the items above it will be removed. The probability of this event is $(1 - v_k)(1 - v_{k-1})\cdots(1 - v_0)$, which is a finite product of positive numbers, so it's positive.
Will there ever be an unhappy Tribble in Oz? Edit: I seem to have mixed up the idea of positive probability and probability 1. The statement proved here is much weaker than I was hoping. Intuitively, the answer is 0. It's not hard to prove that
26,785
Nonstationary solutions for stationary ARMA equations
Terminology being used in the question is not quite correct. You're mixing up the model (or equations) and solution to the model. It does not make sense to speak of an equation (in this case, a system of stochastic difference equations) being stationary or non-stationary. Stationarity, of lack thereof, is a property of a solution. An equation can have stationary or non-stationary solutions. What you have found are two solutions, one stationary and one non-stationary, to the AR(1) equation when AR parameter $|\phi| \neq 1 $. (If $|\phi| > 1$, substitute $-t$ for $t$ in your example.) In contrast, when $|\phi| = 1$, there are only non-stationary solutions. The answer to your question is, yes, this generalizes to the AR(p) case. The AR(p) equation(s) $$ \Phi(L)X_t = \epsilon_t, \; t = \cdots -1, 0, 1, \cdots $$ has both stationary and non-stationary solutions if the polynomial $\Phi(z^{-p})$ has no roots on the unit circle and all roots are real. For example, suppose the AR(2) model $$ X_t = \phi_1 X_{t-1} + \phi_2 X_{t-2} + \epsilon_t $$ has a stationary solution $(X_t)$ and $z^2 - \phi_1 z - \phi_2$ has two real roots $a$ and $b$, then $$ X_t + a^t + b^{t-1} $$ is a non-stationary solution. Notice setting $\phi_2 = 0$ and considering $z - \phi_1 = 0$ recovers your AR(1) example.
Nonstationary solutions for stationary ARMA equations
Terminology being used in the question is not quite correct. You're mixing up the model (or equations) and solution to the model. It does not make sense to speak of an equation (in this case, a syste
Nonstationary solutions for stationary ARMA equations Terminology being used in the question is not quite correct. You're mixing up the model (or equations) and solution to the model. It does not make sense to speak of an equation (in this case, a system of stochastic difference equations) being stationary or non-stationary. Stationarity, of lack thereof, is a property of a solution. An equation can have stationary or non-stationary solutions. What you have found are two solutions, one stationary and one non-stationary, to the AR(1) equation when AR parameter $|\phi| \neq 1 $. (If $|\phi| > 1$, substitute $-t$ for $t$ in your example.) In contrast, when $|\phi| = 1$, there are only non-stationary solutions. The answer to your question is, yes, this generalizes to the AR(p) case. The AR(p) equation(s) $$ \Phi(L)X_t = \epsilon_t, \; t = \cdots -1, 0, 1, \cdots $$ has both stationary and non-stationary solutions if the polynomial $\Phi(z^{-p})$ has no roots on the unit circle and all roots are real. For example, suppose the AR(2) model $$ X_t = \phi_1 X_{t-1} + \phi_2 X_{t-2} + \epsilon_t $$ has a stationary solution $(X_t)$ and $z^2 - \phi_1 z - \phi_2$ has two real roots $a$ and $b$, then $$ X_t + a^t + b^{t-1} $$ is a non-stationary solution. Notice setting $\phi_2 = 0$ and considering $z - \phi_1 = 0$ recovers your AR(1) example.
Nonstationary solutions for stationary ARMA equations Terminology being used in the question is not quite correct. You're mixing up the model (or equations) and solution to the model. It does not make sense to speak of an equation (in this case, a syste
26,786
Nonstationary solutions for stationary ARMA equations
You are correct that $Y_t = X_t + \varphi^t$ is a non-stationary solution to the $\text{AR}(1)$ equation. Thus, contra your terminology, it is not a "stationary equation" and it is not "damaged" by having a non-stationary solution. The non-stationary solution is simply a non-stationary model that is a form of $\text{AR}(1)$ process, consistent with the recursive equations. There are also non-stationary solutions to the $\text{AR}(p)$ equations.
Nonstationary solutions for stationary ARMA equations
You are correct that $Y_t = X_t + \varphi^t$ is a non-stationary solution to the $\text{AR}(1)$ equation. Thus, contra your terminology, it is not a "stationary equation" and it is not "damaged" by h
Nonstationary solutions for stationary ARMA equations You are correct that $Y_t = X_t + \varphi^t$ is a non-stationary solution to the $\text{AR}(1)$ equation. Thus, contra your terminology, it is not a "stationary equation" and it is not "damaged" by having a non-stationary solution. The non-stationary solution is simply a non-stationary model that is a form of $\text{AR}(1)$ process, consistent with the recursive equations. There are also non-stationary solutions to the $\text{AR}(p)$ equations.
Nonstationary solutions for stationary ARMA equations You are correct that $Y_t = X_t + \varphi^t$ is a non-stationary solution to the $\text{AR}(1)$ equation. Thus, contra your terminology, it is not a "stationary equation" and it is not "damaged" by h
26,787
Nonstationary solutions for stationary ARMA equations
If you let your process go on, then you'll notice how the term $\varphi^t$ disappears: $$\lim_{t\to\infty}\varphi^t=0$$ So, $$E[Y_t]=E[X_t]+E[\varphi^t]=_{t\to\infty}0$$ this is despite the right hand side having being dependent on finite $t$. So the answer to your question is that your process $Y_t$ is not non-stationary. Hence, it doesn't serve as a counter-example. Additional thoughts. You formulated your question in terms of solutions of the stochastic processes. Look at what is the solution of the AR(1) process. For instance, if you forecast $\tau$ steps ahead you get: $$X_{t+\tau}=\varphi^\tau (X_t+\sum_{s=1}^\tau \varepsilon_{t+s}\varphi^{-s})$$ You can see how it simply collapses to the noise around zero as $\tau$ grows, no matter what was the initial $X_t$. When you add your $\varphi^\tau$ term it also disappears, so the stable solution is the same: noise around zero: $$X_{t+\tau}+\varphi^\tau=\varphi^\tau (X_t+\sum_{s=1}^\tau \varepsilon_{t+s}\varphi^{-s}+\varphi^s)$$
Nonstationary solutions for stationary ARMA equations
If you let your process go on, then you'll notice how the term $\varphi^t$ disappears: $$\lim_{t\to\infty}\varphi^t=0$$ So, $$E[Y_t]=E[X_t]+E[\varphi^t]=_{t\to\infty}0$$ this is despite the right hand
Nonstationary solutions for stationary ARMA equations If you let your process go on, then you'll notice how the term $\varphi^t$ disappears: $$\lim_{t\to\infty}\varphi^t=0$$ So, $$E[Y_t]=E[X_t]+E[\varphi^t]=_{t\to\infty}0$$ this is despite the right hand side having being dependent on finite $t$. So the answer to your question is that your process $Y_t$ is not non-stationary. Hence, it doesn't serve as a counter-example. Additional thoughts. You formulated your question in terms of solutions of the stochastic processes. Look at what is the solution of the AR(1) process. For instance, if you forecast $\tau$ steps ahead you get: $$X_{t+\tau}=\varphi^\tau (X_t+\sum_{s=1}^\tau \varepsilon_{t+s}\varphi^{-s})$$ You can see how it simply collapses to the noise around zero as $\tau$ grows, no matter what was the initial $X_t$. When you add your $\varphi^\tau$ term it also disappears, so the stable solution is the same: noise around zero: $$X_{t+\tau}+\varphi^\tau=\varphi^\tau (X_t+\sum_{s=1}^\tau \varepsilon_{t+s}\varphi^{-s}+\varphi^s)$$
Nonstationary solutions for stationary ARMA equations If you let your process go on, then you'll notice how the term $\varphi^t$ disappears: $$\lim_{t\to\infty}\varphi^t=0$$ So, $$E[Y_t]=E[X_t]+E[\varphi^t]=_{t\to\infty}0$$ this is despite the right hand
26,788
How to kernelize a simple perceptron?
We can construct a "kernel perceptron" by taking the standard perceptron and replacing the inner product $X^\intercal X=\left<X,X\right>$ with the equivalent (due to the "kernel-trick") form K(X,X). This works since we have that the inner product is a map $<\cdot,\cdot>:\mathbb{R}^p\times\mathbb{R}^p\to\mathbb{R}$, which has identical properties to the kernel function $k:\mathbb{R}^p\times\mathbb{R}^p\to\mathbb{R}$. As in the case of the common Gaussian radial basis function kernel (RBF): $$ K(x_i,x_j)=\exp\left(-\frac{{\left|\left|x_i-x_j\right|\right|}^2}{2\sigma^2}\right) $$ As mentioned in the Wikipedia page on the kernel perceptron, we select a subset of size $M$ of the inputs and use a linear combination of them to produce our output, $$ f(x) = \sum\limits_i^M \alpha_i y_i K(x,x_i) $$ If you've seen the support vector machine (SVM), you'll notice the identical dual. To select the subset of size $M$ to use, we optimize over $\alpha_i$, which represent whether sample $i$ is a support/basis vector of our solution. In the optimization of the $\alpha_i$ we include the weights $\omega_i$ of the original perceptron optimization. As to your question about not having to compute the projection, you're correct, your input data matrix $X$ is still 2-dimensional. In the computation of the output we replaced a dot product with the kernel function, and this is where the 'implicit' calculation in the feature space occurs.
How to kernelize a simple perceptron?
We can construct a "kernel perceptron" by taking the standard perceptron and replacing the inner product $X^\intercal X=\left<X,X\right>$ with the equivalent (due to the "kernel-trick") form K(X,X). T
How to kernelize a simple perceptron? We can construct a "kernel perceptron" by taking the standard perceptron and replacing the inner product $X^\intercal X=\left<X,X\right>$ with the equivalent (due to the "kernel-trick") form K(X,X). This works since we have that the inner product is a map $<\cdot,\cdot>:\mathbb{R}^p\times\mathbb{R}^p\to\mathbb{R}$, which has identical properties to the kernel function $k:\mathbb{R}^p\times\mathbb{R}^p\to\mathbb{R}$. As in the case of the common Gaussian radial basis function kernel (RBF): $$ K(x_i,x_j)=\exp\left(-\frac{{\left|\left|x_i-x_j\right|\right|}^2}{2\sigma^2}\right) $$ As mentioned in the Wikipedia page on the kernel perceptron, we select a subset of size $M$ of the inputs and use a linear combination of them to produce our output, $$ f(x) = \sum\limits_i^M \alpha_i y_i K(x,x_i) $$ If you've seen the support vector machine (SVM), you'll notice the identical dual. To select the subset of size $M$ to use, we optimize over $\alpha_i$, which represent whether sample $i$ is a support/basis vector of our solution. In the optimization of the $\alpha_i$ we include the weights $\omega_i$ of the original perceptron optimization. As to your question about not having to compute the projection, you're correct, your input data matrix $X$ is still 2-dimensional. In the computation of the output we replaced a dot product with the kernel function, and this is where the 'implicit' calculation in the feature space occurs.
How to kernelize a simple perceptron? We can construct a "kernel perceptron" by taking the standard perceptron and replacing the inner product $X^\intercal X=\left<X,X\right>$ with the equivalent (due to the "kernel-trick") form K(X,X). T
26,789
How to calculate the probability of the outcome of this convoluted dice rolling mechanic?
I'll have to tackle this in stages as time permits. I expect someone will give a complete (and probably simpler) approach before I finish. First, let's look at botches. I'm going to ignore some of your notation and call the number of dice $n$. If no die rolled are greater than or equal to T, and at least one die is 1, then it is a botch First consider $P(\text{no dice }\geq T) = (\frac{T-1}{10})^n$ Now consider $P(\text{no } 1| \text{no dice }\geq T) = (\frac{T-2}{T-1})^n$ So $P(\text{botch}) = [1- (\frac{T-2}{T-1})^n]\cdot (\frac{T-1}{10})^n$ $\hspace{2cm} = \frac{(T-1)^n-(T-2)^n}{10^n}$ (assuming I didn't make any errors) Second, the distribution of the number of individual-die successes after subtraction can be tackled by the method at this post. However, you seem to be after $P(\text{at least one success in total})$ (i.e. the overall roll succeeds) which I think may be amenable to relatively more simple-minded approaches (though they may well involve more work in the end). I'll look at that next edit.
How to calculate the probability of the outcome of this convoluted dice rolling mechanic?
I'll have to tackle this in stages as time permits. I expect someone will give a complete (and probably simpler) approach before I finish. First, let's look at botches. I'm going to ignore some of yo
How to calculate the probability of the outcome of this convoluted dice rolling mechanic? I'll have to tackle this in stages as time permits. I expect someone will give a complete (and probably simpler) approach before I finish. First, let's look at botches. I'm going to ignore some of your notation and call the number of dice $n$. If no die rolled are greater than or equal to T, and at least one die is 1, then it is a botch First consider $P(\text{no dice }\geq T) = (\frac{T-1}{10})^n$ Now consider $P(\text{no } 1| \text{no dice }\geq T) = (\frac{T-2}{T-1})^n$ So $P(\text{botch}) = [1- (\frac{T-2}{T-1})^n]\cdot (\frac{T-1}{10})^n$ $\hspace{2cm} = \frac{(T-1)^n-(T-2)^n}{10^n}$ (assuming I didn't make any errors) Second, the distribution of the number of individual-die successes after subtraction can be tackled by the method at this post. However, you seem to be after $P(\text{at least one success in total})$ (i.e. the overall roll succeeds) which I think may be amenable to relatively more simple-minded approaches (though they may well involve more work in the end). I'll look at that next edit.
How to calculate the probability of the outcome of this convoluted dice rolling mechanic? I'll have to tackle this in stages as time permits. I expect someone will give a complete (and probably simpler) approach before I finish. First, let's look at botches. I'm going to ignore some of yo
26,790
Word embedding algorithms in terms of performance
There's been some work recently on dynamically assigning word2vec (skip gram) dimension using Boltzmann machines. Check out this paper: "Infinite dimensional word embeddings" -Nalsnick, Ravi The basic idea is to let your training set dictate the dimensionality of your word2vec model, which is penalized by a regularization term that's related to the dimension size. The above paper does this for words, and I'd be curious to see how well this performs with phrases.
Word embedding algorithms in terms of performance
There's been some work recently on dynamically assigning word2vec (skip gram) dimension using Boltzmann machines. Check out this paper: "Infinite dimensional word embeddings" -Nalsnick, Ravi The basic
Word embedding algorithms in terms of performance There's been some work recently on dynamically assigning word2vec (skip gram) dimension using Boltzmann machines. Check out this paper: "Infinite dimensional word embeddings" -Nalsnick, Ravi The basic idea is to let your training set dictate the dimensionality of your word2vec model, which is penalized by a regularization term that's related to the dimension size. The above paper does this for words, and I'd be curious to see how well this performs with phrases.
Word embedding algorithms in terms of performance There's been some work recently on dynamically assigning word2vec (skip gram) dimension using Boltzmann machines. Check out this paper: "Infinite dimensional word embeddings" -Nalsnick, Ravi The basic
26,791
Visualizing PCA in R: data points, eigenvectors, projections, confidence ellipse
There is not much to answer here. You seem to have had some problems with your script that are by now fixed. There is currently nothing wrong with your visualization and in fact I find it a very nice and adequate illustration. To answer your remaining questions: The slopes of your principal axes will always be $1$ and $-1$ for a standardized two-dimensional dataset (i.e. if you are working with a correlation matrix), as @whuber said in the comments. See my answer here: Does a correlation matrix of two variables always have the same eigenvectors? The ellipse that you plotted (according to my understanding of the source code of stat_ellipse()) is a 95% coverage ellipse assuming multivariate normal distribution. This is a reasonable choice. Note that if you want a different coverage, you can change it via level input parameter, but 95% is pretty standard and okay.
Visualizing PCA in R: data points, eigenvectors, projections, confidence ellipse
There is not much to answer here. You seem to have had some problems with your script that are by now fixed. There is currently nothing wrong with your visualization and in fact I find it a very nice
Visualizing PCA in R: data points, eigenvectors, projections, confidence ellipse There is not much to answer here. You seem to have had some problems with your script that are by now fixed. There is currently nothing wrong with your visualization and in fact I find it a very nice and adequate illustration. To answer your remaining questions: The slopes of your principal axes will always be $1$ and $-1$ for a standardized two-dimensional dataset (i.e. if you are working with a correlation matrix), as @whuber said in the comments. See my answer here: Does a correlation matrix of two variables always have the same eigenvectors? The ellipse that you plotted (according to my understanding of the source code of stat_ellipse()) is a 95% coverage ellipse assuming multivariate normal distribution. This is a reasonable choice. Note that if you want a different coverage, you can change it via level input parameter, but 95% is pretty standard and okay.
Visualizing PCA in R: data points, eigenvectors, projections, confidence ellipse There is not much to answer here. You seem to have had some problems with your script that are by now fixed. There is currently nothing wrong with your visualization and in fact I find it a very nice
26,792
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$?
Before proving something of interest, notice that $X_i >0$ almost surely for all $i$ is not a necessary condition for both statements to make sense, which the deterministic sequence $(-1, -1, 1, 1, 1, \dots)$ illustrates. Moreover, the statement is indeed false in general, as the following deterministic sequence proves: $(0, 1, 1, \dots)$. Now, suppose $X_i >0$ almost surely for all $i$, then the statement is true by the following argument: Define $$S_n = \frac{1}{n}\sum_{i=1}^n\log(X_i).$$ By contuity of $x\mapsto \log(x)$, $\log(X_n)\to\log(X)$ almost surely. Thus, $S_n \to\log(X)$ almost surely by a result for Cesaro means also proven in the comments above. Thus, by continuity of $x\mapsto \exp(x)$, $$\left(\prod_{i=1}^nX_i\right)^{1/n}\to X,$$ almost surely.
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel
Before proving something of interest, notice that $X_i >0$ almost surely for all $i$ is not a necessary condition for both statements to make sense, which the deterministic sequence $(-1, -1, 1, 1, 1,
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$? Before proving something of interest, notice that $X_i >0$ almost surely for all $i$ is not a necessary condition for both statements to make sense, which the deterministic sequence $(-1, -1, 1, 1, 1, \dots)$ illustrates. Moreover, the statement is indeed false in general, as the following deterministic sequence proves: $(0, 1, 1, \dots)$. Now, suppose $X_i >0$ almost surely for all $i$, then the statement is true by the following argument: Define $$S_n = \frac{1}{n}\sum_{i=1}^n\log(X_i).$$ By contuity of $x\mapsto \log(x)$, $\log(X_n)\to\log(X)$ almost surely. Thus, $S_n \to\log(X)$ almost surely by a result for Cesaro means also proven in the comments above. Thus, by continuity of $x\mapsto \exp(x)$, $$\left(\prod_{i=1}^nX_i\right)^{1/n}\to X,$$ almost surely.
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel Before proving something of interest, notice that $X_i >0$ almost surely for all $i$ is not a necessary condition for both statements to make sense, which the deterministic sequence $(-1, -1, 1, 1, 1,
26,793
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$?
This claim is false. I give proof by providing a counterexample. Suppose the random sequence $X_i$ is defined as follows: \begin{align} Z_i &\sim N(0,1/i), iid, \; \forall i \in \mathbb{N} \\ X_i &= 1_{\{i \neq 1\}} + 1_{\{i \neq 1\}}Z_i, \; i \in \mathbb{N} \end{align} Clearly, $X_i$ is (1) degenerate and (2) converges almost surely to $X=1$ as $i \longrightarrow \infty$ by Chebyshev's strong law of large numbers. (To see this, rewrite $Z_i = i^{-0.5}Z$ for $Z \sim N(0,1)$.) However, since $X_1 = 0$, $\Pi_{i=1}^nX_i = 0, \; \forall n \in \mathbb{N}$. Consequently, $(\Pi_{i=1}^nX_i)^{1/n} = 0, \forall n \in \mathbb{N}$, so it will in the limit trivially converge to $0$, that is $lim_{n\longrightarrow \infty}(\Pi_{i=1}^nX_i)^{1/n} = 0$. $\square$
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel
This claim is false. I give proof by providing a counterexample. Suppose the random sequence $X_i$ is defined as follows: \begin{align} Z_i &\sim N(0,1/i), iid, \; \forall i \in \mathbb{N} \\ X_i &= 1
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$? This claim is false. I give proof by providing a counterexample. Suppose the random sequence $X_i$ is defined as follows: \begin{align} Z_i &\sim N(0,1/i), iid, \; \forall i \in \mathbb{N} \\ X_i &= 1_{\{i \neq 1\}} + 1_{\{i \neq 1\}}Z_i, \; i \in \mathbb{N} \end{align} Clearly, $X_i$ is (1) degenerate and (2) converges almost surely to $X=1$ as $i \longrightarrow \infty$ by Chebyshev's strong law of large numbers. (To see this, rewrite $Z_i = i^{-0.5}Z$ for $Z \sim N(0,1)$.) However, since $X_1 = 0$, $\Pi_{i=1}^nX_i = 0, \; \forall n \in \mathbb{N}$. Consequently, $(\Pi_{i=1}^nX_i)^{1/n} = 0, \forall n \in \mathbb{N}$, so it will in the limit trivially converge to $0$, that is $lim_{n\longrightarrow \infty}(\Pi_{i=1}^nX_i)^{1/n} = 0$. $\square$
$X_n$ $\,{\buildrel a.s. \over \rightarrow}\,$ $X$, then $(\prod_{i=1}^{n}X_i)^{1/n}$ $\,{\buildrel This claim is false. I give proof by providing a counterexample. Suppose the random sequence $X_i$ is defined as follows: \begin{align} Z_i &\sim N(0,1/i), iid, \; \forall i \in \mathbb{N} \\ X_i &= 1
26,794
Examples of misapplication of Bayes theorem
Yep. I was hired as a statistical consultant recently to scrutinize a particular(ly awful) article whose authors managed to make themselves look even worse in a letter to the editor using Bayes' theorem. They began with a miscalculated positive predictive value from their article (PPV = 95% supposedly). They basically disregarded a critical letter about this by Ricci (2004) that tried (and failed) to tell them how they should've calculated it (he suggested 82.3%). Then they found a biostats textbook (Elston & Johnson, 1994) and misquoted it. We bought the book and checked, but in retrospect, this was just as unnecessary as I suspected. Get a load of this mess (from Barsness et al.'s reply letter to the editor): Bayes' theorem1 generally states that a low prevalence of a particular disease (NAT) strengthens the positive predictive value of a positive test (rib fracture) to define the disease state (victim of NAT)...According to Bayes' theorem,1 the probability of an event is defined by the following equation: $$\rm P=\frac{P(S/D_1)}{P(S/D_1)+P(S/D_2)}$$ P is the probability of a true event (victim of NAT), P(S/D1) is the probability of a positive test (PPV of a rib fracture to predict NAT) and P(S/D2) is the posterior probability of a positive test (prevalence of NAT). Substituting our data, the probability that a rib fracture is a true event $[p = 95/(95 + 1.6)]$ is 98.3 percent. Using the aforementioned lower PPV calculation of 82.3 percent, the probability of a true event is 98.1 percent. See anything odd coherent here? I sure don't... This is Bayes' theorem as Elston and Johnson (1994) apply it to an example of hemophilia heredity: $$\rm P(D_1|S)=\frac{P(D_1)P(S|D_1)}{P(D_1)P(S|D_1)+P(D_2)P(S|D_2)}$$ The discrepancies speak for themselves, but here's a quote from their discussion of the example: The fact that she had one son who is unaffected decreases the probability that she inherited the hemophilia gene, and hence the probability that her second son will be affected. Where Barsness and colleagues got the idea that low prevalence strengthens PPV, I do not know, but they sure weren't paying attention to their own textbook of choice. They don't seem to understand that PPV is the probability of a "true event" (D1) given a rib fracture (S). Thus, in a poetically complete demonstration of "garbage in, garbage out", they input their PPV as numerator and denominator, add the prevalence to the denominator, and get a higher PPV. It's a shame they didn't realize they could continue this circularly ad nauseum: $$p_1 = 95/(95 + 1.6)=98.3\rightarrow p_2 = 98.3/(98.3 + 1.6)=98.4\rightarrow\dots$$ Though 98.4 is actually $\lim_{k\rightarrow\infty} p_k(p_{k-1},1.6)$; i.e., any PPV could be converted to 98.4 with prevalence = 1.6 if their version of the equation were correct by applying it iteratively. When using their prevalence info and some reasonable estimates of sensitivity and specificity from other studies on the topic, the PPV turns out to be much lower (maybe as low as 3%). The funny thing is that I wouldn't have even thought to use Bayes' theorem if they hadn't tried to use it to strengthen their case. It's clearly not going to work out that way given a prevalence of 1.6%. References · Barsness, K. A., Cha, E. S., Bensard, D. D., Calkins, C. M., Partrick, D. A., Karrer, F. M., & Strain, J. D. (2003). The positive predictive value of rib fractures as an indicator of nonaccidental trauma in children. Journal of Trauma-Injury, Infection, and Critical Care, 54(6), 1107–1110. · Elston, R. C., & Johnson, W. D. (1994). Essentials of biostatistics (2nd ed.). Philadelphia: F.A. Davis Company. · Ricci, L. R. (2004). Letters to the Editor. Journal of Trauma-Injury, Infection, and Critical Care, 56(3), 721.
Examples of misapplication of Bayes theorem
Yep. I was hired as a statistical consultant recently to scrutinize a particular(ly awful) article whose authors managed to make themselves look even worse in a letter to the editor using Bayes' theor
Examples of misapplication of Bayes theorem Yep. I was hired as a statistical consultant recently to scrutinize a particular(ly awful) article whose authors managed to make themselves look even worse in a letter to the editor using Bayes' theorem. They began with a miscalculated positive predictive value from their article (PPV = 95% supposedly). They basically disregarded a critical letter about this by Ricci (2004) that tried (and failed) to tell them how they should've calculated it (he suggested 82.3%). Then they found a biostats textbook (Elston & Johnson, 1994) and misquoted it. We bought the book and checked, but in retrospect, this was just as unnecessary as I suspected. Get a load of this mess (from Barsness et al.'s reply letter to the editor): Bayes' theorem1 generally states that a low prevalence of a particular disease (NAT) strengthens the positive predictive value of a positive test (rib fracture) to define the disease state (victim of NAT)...According to Bayes' theorem,1 the probability of an event is defined by the following equation: $$\rm P=\frac{P(S/D_1)}{P(S/D_1)+P(S/D_2)}$$ P is the probability of a true event (victim of NAT), P(S/D1) is the probability of a positive test (PPV of a rib fracture to predict NAT) and P(S/D2) is the posterior probability of a positive test (prevalence of NAT). Substituting our data, the probability that a rib fracture is a true event $[p = 95/(95 + 1.6)]$ is 98.3 percent. Using the aforementioned lower PPV calculation of 82.3 percent, the probability of a true event is 98.1 percent. See anything odd coherent here? I sure don't... This is Bayes' theorem as Elston and Johnson (1994) apply it to an example of hemophilia heredity: $$\rm P(D_1|S)=\frac{P(D_1)P(S|D_1)}{P(D_1)P(S|D_1)+P(D_2)P(S|D_2)}$$ The discrepancies speak for themselves, but here's a quote from their discussion of the example: The fact that she had one son who is unaffected decreases the probability that she inherited the hemophilia gene, and hence the probability that her second son will be affected. Where Barsness and colleagues got the idea that low prevalence strengthens PPV, I do not know, but they sure weren't paying attention to their own textbook of choice. They don't seem to understand that PPV is the probability of a "true event" (D1) given a rib fracture (S). Thus, in a poetically complete demonstration of "garbage in, garbage out", they input their PPV as numerator and denominator, add the prevalence to the denominator, and get a higher PPV. It's a shame they didn't realize they could continue this circularly ad nauseum: $$p_1 = 95/(95 + 1.6)=98.3\rightarrow p_2 = 98.3/(98.3 + 1.6)=98.4\rightarrow\dots$$ Though 98.4 is actually $\lim_{k\rightarrow\infty} p_k(p_{k-1},1.6)$; i.e., any PPV could be converted to 98.4 with prevalence = 1.6 if their version of the equation were correct by applying it iteratively. When using their prevalence info and some reasonable estimates of sensitivity and specificity from other studies on the topic, the PPV turns out to be much lower (maybe as low as 3%). The funny thing is that I wouldn't have even thought to use Bayes' theorem if they hadn't tried to use it to strengthen their case. It's clearly not going to work out that way given a prevalence of 1.6%. References · Barsness, K. A., Cha, E. S., Bensard, D. D., Calkins, C. M., Partrick, D. A., Karrer, F. M., & Strain, J. D. (2003). The positive predictive value of rib fractures as an indicator of nonaccidental trauma in children. Journal of Trauma-Injury, Infection, and Critical Care, 54(6), 1107–1110. · Elston, R. C., & Johnson, W. D. (1994). Essentials of biostatistics (2nd ed.). Philadelphia: F.A. Davis Company. · Ricci, L. R. (2004). Letters to the Editor. Journal of Trauma-Injury, Infection, and Critical Care, 56(3), 721.
Examples of misapplication of Bayes theorem Yep. I was hired as a statistical consultant recently to scrutinize a particular(ly awful) article whose authors managed to make themselves look even worse in a letter to the editor using Bayes' theor
26,795
Outlier detection in beta distributions
A more systematic way to deal with this problem would be to use an explicit mixture model, with a specification of the distribution of the 'outliers'. A simple form would be to use a mixture of a beta distribution (for the points you're interested in) and a uniform distribution (for the 'outliers'). By modelling the data as a mixture distribution you could get estimates of $\alpha$ and $\beta$ that automatically take into account the fact that some of the points may be outliers. To solve this problem using a mixture model, let $\phi$ be the probability of an 'outlier' and assume you have IID values $X_1, ..., X_n \sim \phi \cdot \text{U}(0, 1) + (1- \phi) \cdot \text{Beta}(\alpha, \beta)$. The likelihood function for the observed data is: $$L_\boldsymbol{x}(\alpha, \beta, \phi) = \prod_{i=1}^n \left( \phi + (1 - \phi) \frac{\Gamma (\alpha + \beta)}{\Gamma(\alpha) \Gamma(\beta)} x_i^{\alpha - 1} (1-x_i)^{\beta - 1} \right).$$ You could proceed from here using either classical MLE or Bayesian estimation. Either will require numerical techniques. Having estimated the three parameters in the model, you would then have an estimate of $\alpha$ and $\beta$ that automatically incorporates the possibility of outliers. You would also have an estimate of the proportion of outliers from the mixture model.
Outlier detection in beta distributions
A more systematic way to deal with this problem would be to use an explicit mixture model, with a specification of the distribution of the 'outliers'. A simple form would be to use a mixture of a bet
Outlier detection in beta distributions A more systematic way to deal with this problem would be to use an explicit mixture model, with a specification of the distribution of the 'outliers'. A simple form would be to use a mixture of a beta distribution (for the points you're interested in) and a uniform distribution (for the 'outliers'). By modelling the data as a mixture distribution you could get estimates of $\alpha$ and $\beta$ that automatically take into account the fact that some of the points may be outliers. To solve this problem using a mixture model, let $\phi$ be the probability of an 'outlier' and assume you have IID values $X_1, ..., X_n \sim \phi \cdot \text{U}(0, 1) + (1- \phi) \cdot \text{Beta}(\alpha, \beta)$. The likelihood function for the observed data is: $$L_\boldsymbol{x}(\alpha, \beta, \phi) = \prod_{i=1}^n \left( \phi + (1 - \phi) \frac{\Gamma (\alpha + \beta)}{\Gamma(\alpha) \Gamma(\beta)} x_i^{\alpha - 1} (1-x_i)^{\beta - 1} \right).$$ You could proceed from here using either classical MLE or Bayesian estimation. Either will require numerical techniques. Having estimated the three parameters in the model, you would then have an estimate of $\alpha$ and $\beta$ that automatically incorporates the possibility of outliers. You would also have an estimate of the proportion of outliers from the mixture model.
Outlier detection in beta distributions A more systematic way to deal with this problem would be to use an explicit mixture model, with a specification of the distribution of the 'outliers'. A simple form would be to use a mixture of a bet
26,796
What if probabilities are not equal in the ".632 Rule?"
The question asks about the limiting behavior of $$= 1 - \prod_{i=1}^n(1 - F_i)\tag{1}$$ as $n$ grows and the $F_i$ uniformly shrink in such a way that (a) all are non-negative and (b) they sum to unity. (These follow from the construction of the $F_i$ and the axioms of probability.) By definition, this product is the exponential of its logarithm: $$\prod_{i=1}^n(1 - F_i) = \exp\left(\sum_{i=1}^n\log\left(1-F_i\right)\right).$$ Taylor's Theorem (with the Lagrange form of the remainder), applied to $\log$, establishes that $$\log\left(1-F_i\right) = -F_i - \frac{1}{2}\phi_i^2 \ge -F_i - \frac{1}{2}F_i^2$$ for some $\phi_i$ in the interval $[0, F_i]$. In other words, these logarithms equal $-F_i$ up to terms that are some at most $1/2$ times $F_i^2$. But when $n$ is large enough to assure that all the $F_i$ are smaller than some given $\epsilon\gt 0$ (a condition assured by the uniform shrinkage of the $F_i$), then (b) implies $n\epsilon \gt \sum F_i = 1$ and therefore $$\sum_{i=1}^n F_i^2 \le \sum_{i=1}^n \epsilon^2 \lt \sum_{i=1}^n \left(\frac{1}{n}\right)^2 =\frac{1}{n}.$$ Consequently $$-1 = -\sum_{i=1}^n F_i \ge \sum_{i=1}^n\log\left(1-F_i\right) \ge -\sum_{i=1}^n F_i - \frac{1}{2}\frac{1}{n} = -1 - \frac{1}{2n}$$ squeezes the logarithm between two sequences converging to $-1$. Since $\exp$ is continuous, the product $\prod_{i=1}^n(1 - F_i)$ converges to the exponential of this limit, $\exp(-1)$. Consequently $$\lim_{n\to\infty} \left(1 - \prod_{i=1}^n(1 - F_i)\right) = 1 - \exp(-1) \approx 0.632,$$ QED. A closer look at this analysis establishes that the error in this approximation (which will always be a lower bound) is no greater in size than $$\left(\exp\left((n/2)\max(F_i^2)\right) - 1\right)\exp(-1).$$ For instance, the division of a standard Normal distribution into $n=400$ slices between $-4$ and $4$ produces a maximum $F_i$ near the mode $0$, where it will approximately equal the area of a rectangle there, $\exp(-1/2)/50 \approx 0.012$. The foregoing bound establishes the value of formula $(1)$ will be within $0.011$ of its limiting value. The actual error is an order of magnitude less, $0.001041$. Here's the calculation in R (which we can trust because none of the $f_i$ is truly small relative to $1$): f <- diff(pnorm(seq(-4, 4, length.out=401))) # The normal "slices". f <- f / sum(f) # Make them sum to unity. exp(-1) - prod(1 - f) # Compute the error. Indeed, 1 - prod(1-f) is $0.6331615\ldots$ whereas $1-\exp(-1)$ is $0.6321206\ldots$.
What if probabilities are not equal in the ".632 Rule?"
The question asks about the limiting behavior of $$= 1 - \prod_{i=1}^n(1 - F_i)\tag{1}$$ as $n$ grows and the $F_i$ uniformly shrink in such a way that (a) all are non-negative and (b) they sum to uni
What if probabilities are not equal in the ".632 Rule?" The question asks about the limiting behavior of $$= 1 - \prod_{i=1}^n(1 - F_i)\tag{1}$$ as $n$ grows and the $F_i$ uniformly shrink in such a way that (a) all are non-negative and (b) they sum to unity. (These follow from the construction of the $F_i$ and the axioms of probability.) By definition, this product is the exponential of its logarithm: $$\prod_{i=1}^n(1 - F_i) = \exp\left(\sum_{i=1}^n\log\left(1-F_i\right)\right).$$ Taylor's Theorem (with the Lagrange form of the remainder), applied to $\log$, establishes that $$\log\left(1-F_i\right) = -F_i - \frac{1}{2}\phi_i^2 \ge -F_i - \frac{1}{2}F_i^2$$ for some $\phi_i$ in the interval $[0, F_i]$. In other words, these logarithms equal $-F_i$ up to terms that are some at most $1/2$ times $F_i^2$. But when $n$ is large enough to assure that all the $F_i$ are smaller than some given $\epsilon\gt 0$ (a condition assured by the uniform shrinkage of the $F_i$), then (b) implies $n\epsilon \gt \sum F_i = 1$ and therefore $$\sum_{i=1}^n F_i^2 \le \sum_{i=1}^n \epsilon^2 \lt \sum_{i=1}^n \left(\frac{1}{n}\right)^2 =\frac{1}{n}.$$ Consequently $$-1 = -\sum_{i=1}^n F_i \ge \sum_{i=1}^n\log\left(1-F_i\right) \ge -\sum_{i=1}^n F_i - \frac{1}{2}\frac{1}{n} = -1 - \frac{1}{2n}$$ squeezes the logarithm between two sequences converging to $-1$. Since $\exp$ is continuous, the product $\prod_{i=1}^n(1 - F_i)$ converges to the exponential of this limit, $\exp(-1)$. Consequently $$\lim_{n\to\infty} \left(1 - \prod_{i=1}^n(1 - F_i)\right) = 1 - \exp(-1) \approx 0.632,$$ QED. A closer look at this analysis establishes that the error in this approximation (which will always be a lower bound) is no greater in size than $$\left(\exp\left((n/2)\max(F_i^2)\right) - 1\right)\exp(-1).$$ For instance, the division of a standard Normal distribution into $n=400$ slices between $-4$ and $4$ produces a maximum $F_i$ near the mode $0$, where it will approximately equal the area of a rectangle there, $\exp(-1/2)/50 \approx 0.012$. The foregoing bound establishes the value of formula $(1)$ will be within $0.011$ of its limiting value. The actual error is an order of magnitude less, $0.001041$. Here's the calculation in R (which we can trust because none of the $f_i$ is truly small relative to $1$): f <- diff(pnorm(seq(-4, 4, length.out=401))) # The normal "slices". f <- f / sum(f) # Make them sum to unity. exp(-1) - prod(1 - f) # Compute the error. Indeed, 1 - prod(1-f) is $0.6331615\ldots$ whereas $1-\exp(-1)$ is $0.6321206\ldots$.
What if probabilities are not equal in the ".632 Rule?" The question asks about the limiting behavior of $$= 1 - \prod_{i=1}^n(1 - F_i)\tag{1}$$ as $n$ grows and the $F_i$ uniformly shrink in such a way that (a) all are non-negative and (b) they sum to uni
26,797
P value for interaction term in mixed effects models using lme4
I don't see too much to say here. I think you have done a good job. There are several ways that people have discussed to test effects and get p-values for complicated mixed effects models. There is a good overview here. The best is to use computationally intensive methods (bootstrapping or Bayesian methods), but this is more advanced for most people. The second best (and best convenient) method is to use a likelihood ratio test. That is what anova() (technically ?anova.merMod()) is doing. It is important to only use a likelihood ratio test of models that were fit with the full maximum likelihood, rather than restricted maximum likelihood (REML). On the other hand, for your final model, and for interpretation, you want to use REML. This is confusing for many people. In your output, we see that you fit your models with REML (this is because the option is set to TRUE by default in lmer(). That would mean that your test is invalid, however, because this is such a common mistake, anova.merMod() contains a refit argument which by default is set to TRUE, and you didn't change it. So the foresight of the package developers has saved you there. Regarding your strategy for unpacking the interaction, what you did is fine. Just bear in mind that the interaction uses all the data for its test. It is possible to have a significant interaction but have neither of the stratified tests be significant, which confuses some people. (It doesn't seem to have happened to you, though.)
P value for interaction term in mixed effects models using lme4
I don't see too much to say here. I think you have done a good job. There are several ways that people have discussed to test effects and get p-values for complicated mixed effects models. There i
P value for interaction term in mixed effects models using lme4 I don't see too much to say here. I think you have done a good job. There are several ways that people have discussed to test effects and get p-values for complicated mixed effects models. There is a good overview here. The best is to use computationally intensive methods (bootstrapping or Bayesian methods), but this is more advanced for most people. The second best (and best convenient) method is to use a likelihood ratio test. That is what anova() (technically ?anova.merMod()) is doing. It is important to only use a likelihood ratio test of models that were fit with the full maximum likelihood, rather than restricted maximum likelihood (REML). On the other hand, for your final model, and for interpretation, you want to use REML. This is confusing for many people. In your output, we see that you fit your models with REML (this is because the option is set to TRUE by default in lmer(). That would mean that your test is invalid, however, because this is such a common mistake, anova.merMod() contains a refit argument which by default is set to TRUE, and you didn't change it. So the foresight of the package developers has saved you there. Regarding your strategy for unpacking the interaction, what you did is fine. Just bear in mind that the interaction uses all the data for its test. It is possible to have a significant interaction but have neither of the stratified tests be significant, which confuses some people. (It doesn't seem to have happened to you, though.)
P value for interaction term in mixed effects models using lme4 I don't see too much to say here. I think you have done a good job. There are several ways that people have discussed to test effects and get p-values for complicated mixed effects models. There i
26,798
P value for interaction term in mixed effects models using lme4
I am a novice myself, and follow the advices from Zuur et al.. I use lme from the nlme package instead of lme4 when I need to add a hierarchical error structure to an otherwise linear model. My response might be way off. Two comments: (1) I am not sure it makes sense to test condition in the subset when appropriate==1 only. If you want to obtain p-values for the main effects, you can use Anova from the 'car' package: require(car) Anova(M,type="III")# type III Sum of Squares. M was fitted using method=REML If you want to resolve the interaction, you can run paired comparisons directly (?) or do what you did but on both subsets (i.e. also with the subset where appropriate==0). (2) You might want to select your error structure first instead of assuming (1 | subject) + (1 | target) is the best error structure. From what you wrote, I gather that condition is a within subject factor, while appropriate is either a between-subject or a between-target factor. You might want to add slopes for within-subject and/or within-target factors, for example: dv ~ condition + appropriate + (1+condition | subject) + (1 | target) adds a random slope for the within-subject factor condition. No slopes are needed for between-subjects/targets factors. Cheers
P value for interaction term in mixed effects models using lme4
I am a novice myself, and follow the advices from Zuur et al.. I use lme from the nlme package instead of lme4 when I need to add a hierarchical error structure to an otherwise linear model. My respon
P value for interaction term in mixed effects models using lme4 I am a novice myself, and follow the advices from Zuur et al.. I use lme from the nlme package instead of lme4 when I need to add a hierarchical error structure to an otherwise linear model. My response might be way off. Two comments: (1) I am not sure it makes sense to test condition in the subset when appropriate==1 only. If you want to obtain p-values for the main effects, you can use Anova from the 'car' package: require(car) Anova(M,type="III")# type III Sum of Squares. M was fitted using method=REML If you want to resolve the interaction, you can run paired comparisons directly (?) or do what you did but on both subsets (i.e. also with the subset where appropriate==0). (2) You might want to select your error structure first instead of assuming (1 | subject) + (1 | target) is the best error structure. From what you wrote, I gather that condition is a within subject factor, while appropriate is either a between-subject or a between-target factor. You might want to add slopes for within-subject and/or within-target factors, for example: dv ~ condition + appropriate + (1+condition | subject) + (1 | target) adds a random slope for the within-subject factor condition. No slopes are needed for between-subjects/targets factors. Cheers
P value for interaction term in mixed effects models using lme4 I am a novice myself, and follow the advices from Zuur et al.. I use lme from the nlme package instead of lme4 when I need to add a hierarchical error structure to an otherwise linear model. My respon
26,799
Clarification in information geometry
My comments are so long, I am putting them in as an answer. I think the question is more philosophical than mathematical at this point. Namely, what do you mean by a space, and in this case, a manifold? The typical definition of a manifold does not involve an embedding into an affine space. This is the 'modern' (150 year old?) approach. For example, to Gauss, a manifold was a manifold with a specific embedding into a specific affine space ($R^n$). If one has a manifold with an embedding in a specific $R^n$, then the tangent space (at any point of the manifold) is isomorphic to a specific subspace of the tangent space to $R^n$ at that point. Note that the tangent space to $R^n$ at any point is identified with the 'same' $R^n$. I think the point is that in the Amari article, the space he refers to as $S^n$ comes with some 'natural' embedding in an affine space with coordinates the $\theta_{i}$ for which the $p_{\theta}$ can be considered as coordinates on the tangent space of $S^n$. I might add that it is only clear if the function $p$ is 'general' in some sense- for degenerate $p$, this will fail. For example if the function didn't involve all the variables $\theta_{i}$ . The main point is that this embedding of the manifold in a specific $R^n$, gives rise to a specific identification of the tangent space with the $p_{\theta}$. His next point is that because of the properties of $p$, he can map his manifold using the log function to another affine space in which the tangent space has a different identification in terms of the new coordinates (the logs and their derivatives). He then says that because of properties of his situation, the two manifolds are isomorphic and the map induces an isomorphism on the tangent spaces. That leads to an identification (i.e., isomorphism) of the two tangent spaces. The key idea is that the two tangent spaces are not the same sets, but are isomorphic (which is basically Greek for 'same') after the correct identification. For example, is the group of all permutations of $\{1,2,3\}$ the 'same' group as the group of all permutations of $\{a,b,c\}$? As a simple thought experiment, consider $R^{+}$, the positive reals mapping to $R$, all the reals under the map log. Pick your favorite real number $>0$ and consider what the map is on tangent spaces. Am I finally understanding your question? A caveat is in order, namely that differential geometry is not my main area of expertise. I think I've got it right, but feel free to criticize or still question this answer.
Clarification in information geometry
My comments are so long, I am putting them in as an answer. I think the question is more philosophical than mathematical at this point. Namely, what do you mean by a space, and in this case, a mani
Clarification in information geometry My comments are so long, I am putting them in as an answer. I think the question is more philosophical than mathematical at this point. Namely, what do you mean by a space, and in this case, a manifold? The typical definition of a manifold does not involve an embedding into an affine space. This is the 'modern' (150 year old?) approach. For example, to Gauss, a manifold was a manifold with a specific embedding into a specific affine space ($R^n$). If one has a manifold with an embedding in a specific $R^n$, then the tangent space (at any point of the manifold) is isomorphic to a specific subspace of the tangent space to $R^n$ at that point. Note that the tangent space to $R^n$ at any point is identified with the 'same' $R^n$. I think the point is that in the Amari article, the space he refers to as $S^n$ comes with some 'natural' embedding in an affine space with coordinates the $\theta_{i}$ for which the $p_{\theta}$ can be considered as coordinates on the tangent space of $S^n$. I might add that it is only clear if the function $p$ is 'general' in some sense- for degenerate $p$, this will fail. For example if the function didn't involve all the variables $\theta_{i}$ . The main point is that this embedding of the manifold in a specific $R^n$, gives rise to a specific identification of the tangent space with the $p_{\theta}$. His next point is that because of the properties of $p$, he can map his manifold using the log function to another affine space in which the tangent space has a different identification in terms of the new coordinates (the logs and their derivatives). He then says that because of properties of his situation, the two manifolds are isomorphic and the map induces an isomorphism on the tangent spaces. That leads to an identification (i.e., isomorphism) of the two tangent spaces. The key idea is that the two tangent spaces are not the same sets, but are isomorphic (which is basically Greek for 'same') after the correct identification. For example, is the group of all permutations of $\{1,2,3\}$ the 'same' group as the group of all permutations of $\{a,b,c\}$? As a simple thought experiment, consider $R^{+}$, the positive reals mapping to $R$, all the reals under the map log. Pick your favorite real number $>0$ and consider what the map is on tangent spaces. Am I finally understanding your question? A caveat is in order, namely that differential geometry is not my main area of expertise. I think I've got it right, but feel free to criticize or still question this answer.
Clarification in information geometry My comments are so long, I am putting them in as an answer. I think the question is more philosophical than mathematical at this point. Namely, what do you mean by a space, and in this case, a mani
26,800
Why is using cross-sectional data to infer / predict longitudinal changes a Bad Thing?
You partially answer your own question by asking for "longitudinal" changes. Cross-section data are called because they take a snap shot in time, literally a cross-section sliced out of a time-evolving society with its many relationship. Therefore, the best inference you can hope to do is under the assumption that whatever it is you are studying is time-invariant, or at least has concluded its evolution. On the other, the data you are looking for are longitudinal data or panel data for Economists. A good reference that explains mostly methods but also highlights two prominent examples from Economics is here. Example 2.1 has company investment rates. Section 3 is a little more theoretical but carries a lot of insight: a panel data model can be \begin{eqnarray} y_{i,t} = \alpha y_{i,t-1} + x_{i,t} \gamma + \eta_{i} + v_{i,t}. \end{eqnarray} Now, this type of model can capture state dependence, which is (next to unobserved heterogeneity) a common explanation for why people behave differently. Therefore, if you only observe people traveling at a given point in time, your $\alpha$ will be unidentified, meaning you are not aware on how much their travel yesterday has influenced their decision to travel again. Now, shut down time dependence for a moment but keep in mind that this equation may likely have been the true model. In a cross section model now, you would drop the subscript $t$ entirely because you only have data in one period. Therefore, you also have no possibility of accounting for the fact that each individual in your data set may have wildly different $\eta_{i}'s$, which will bias your regressions upward generally, at least when true model is dynamic. This is likely the reason of the overestimate, because of an unobserved individual effect (can be common, too), that you did not measure but that was reflected in your cross-section study. Now, enter panel data again. What we can do is subtract the mean over time of each variable which, given the mean of $\eta_i$ is constant over time, would eliminate this term. This transformation (others are possible) allows you to focus only on the dynamics (and in fact you'd lose any time-invariant regressors). Now, this is the main difference between cross-section and panel data. The fact that you can eliminate the time-invariant effect because you have that time variation allows you to remove certain biases that cross-section estimation doesn't allow you to detect. Therefore, before you contemplate a policy change such as a higher tax on traveling because you expect people to travel and you want more government revenue, it is more useful to have seen the phenomenon over a few years so you can be sure that you are not capturing unobserved heterogeneity in your sample which you interpret as a propensity to travel. To estimate these models, it is best to go through the reference. But beware: different assumptions about people's behavior will make different estimations procedures admissible or not. I hope this helps!
Why is using cross-sectional data to infer / predict longitudinal changes a Bad Thing?
You partially answer your own question by asking for "longitudinal" changes. Cross-section data are called because they take a snap shot in time, literally a cross-section sliced out of a time-evolvin
Why is using cross-sectional data to infer / predict longitudinal changes a Bad Thing? You partially answer your own question by asking for "longitudinal" changes. Cross-section data are called because they take a snap shot in time, literally a cross-section sliced out of a time-evolving society with its many relationship. Therefore, the best inference you can hope to do is under the assumption that whatever it is you are studying is time-invariant, or at least has concluded its evolution. On the other, the data you are looking for are longitudinal data or panel data for Economists. A good reference that explains mostly methods but also highlights two prominent examples from Economics is here. Example 2.1 has company investment rates. Section 3 is a little more theoretical but carries a lot of insight: a panel data model can be \begin{eqnarray} y_{i,t} = \alpha y_{i,t-1} + x_{i,t} \gamma + \eta_{i} + v_{i,t}. \end{eqnarray} Now, this type of model can capture state dependence, which is (next to unobserved heterogeneity) a common explanation for why people behave differently. Therefore, if you only observe people traveling at a given point in time, your $\alpha$ will be unidentified, meaning you are not aware on how much their travel yesterday has influenced their decision to travel again. Now, shut down time dependence for a moment but keep in mind that this equation may likely have been the true model. In a cross section model now, you would drop the subscript $t$ entirely because you only have data in one period. Therefore, you also have no possibility of accounting for the fact that each individual in your data set may have wildly different $\eta_{i}'s$, which will bias your regressions upward generally, at least when true model is dynamic. This is likely the reason of the overestimate, because of an unobserved individual effect (can be common, too), that you did not measure but that was reflected in your cross-section study. Now, enter panel data again. What we can do is subtract the mean over time of each variable which, given the mean of $\eta_i$ is constant over time, would eliminate this term. This transformation (others are possible) allows you to focus only on the dynamics (and in fact you'd lose any time-invariant regressors). Now, this is the main difference between cross-section and panel data. The fact that you can eliminate the time-invariant effect because you have that time variation allows you to remove certain biases that cross-section estimation doesn't allow you to detect. Therefore, before you contemplate a policy change such as a higher tax on traveling because you expect people to travel and you want more government revenue, it is more useful to have seen the phenomenon over a few years so you can be sure that you are not capturing unobserved heterogeneity in your sample which you interpret as a propensity to travel. To estimate these models, it is best to go through the reference. But beware: different assumptions about people's behavior will make different estimations procedures admissible or not. I hope this helps!
Why is using cross-sectional data to infer / predict longitudinal changes a Bad Thing? You partially answer your own question by asking for "longitudinal" changes. Cross-section data are called because they take a snap shot in time, literally a cross-section sliced out of a time-evolvin