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
52,301
What is collinearity and how does it differ from multicollinearity?
There are indeed slight inconsistencies in the usage of the term, depending who you ask. The most common distinction I've seen (and I tend to use), is that we have collinearity if $\det(X^T X)=0$, and multicollinearity if $\det(X^T X)\approx 0$. The latter obviously includes the former, which is why we also say "perfec...
What is collinearity and how does it differ from multicollinearity?
There are indeed slight inconsistencies in the usage of the term, depending who you ask. The most common distinction I've seen (and I tend to use), is that we have collinearity if $\det(X^T X)=0$, and
What is collinearity and how does it differ from multicollinearity? There are indeed slight inconsistencies in the usage of the term, depending who you ask. The most common distinction I've seen (and I tend to use), is that we have collinearity if $\det(X^T X)=0$, and multicollinearity if $\det(X^T X)\approx 0$. The la...
What is collinearity and how does it differ from multicollinearity? There are indeed slight inconsistencies in the usage of the term, depending who you ask. The most common distinction I've seen (and I tend to use), is that we have collinearity if $\det(X^T X)=0$, and
52,302
Is the inference from a parametric test valid when the population distribution is not normal?
I need to correct a number of mistaken or partly misplaced ideas in the question first (as well as some that aren't in the question but are commonly seen and may be indirectly influencing the way you ask your question), but I will return to the main issue. The answer you link to says: The t-test assumes that the means...
Is the inference from a parametric test valid when the population distribution is not normal?
I need to correct a number of mistaken or partly misplaced ideas in the question first (as well as some that aren't in the question but are commonly seen and may be indirectly influencing the way you
Is the inference from a parametric test valid when the population distribution is not normal? I need to correct a number of mistaken or partly misplaced ideas in the question first (as well as some that aren't in the question but are commonly seen and may be indirectly influencing the way you ask your question), but I ...
Is the inference from a parametric test valid when the population distribution is not normal? I need to correct a number of mistaken or partly misplaced ideas in the question first (as well as some that aren't in the question but are commonly seen and may be indirectly influencing the way you
52,303
Is the inference from a parametric test valid when the population distribution is not normal?
It depends on the degree and type of non-normality. Even with relatively small sample sizes the test is conservative with skewed distributions but not strictly "valid" since the actual p is lower than the nominal p (if you use p=0.05 as a cutoff you will reject a true null hypothesis less than 0.05 of the time. If your...
Is the inference from a parametric test valid when the population distribution is not normal?
It depends on the degree and type of non-normality. Even with relatively small sample sizes the test is conservative with skewed distributions but not strictly "valid" since the actual p is lower than
Is the inference from a parametric test valid when the population distribution is not normal? It depends on the degree and type of non-normality. Even with relatively small sample sizes the test is conservative with skewed distributions but not strictly "valid" since the actual p is lower than the nominal p (if you use...
Is the inference from a parametric test valid when the population distribution is not normal? It depends on the degree and type of non-normality. Even with relatively small sample sizes the test is conservative with skewed distributions but not strictly "valid" since the actual p is lower than
52,304
Random forest variance
Two thoughts. RF are often split until purity. This often means that there are many terminal nodes, each with a single observation. The final splits leading up to these nodes may not generalize very well because there are so few observations to work with at that depth of the tree. So you may get more generalizable tr...
Random forest variance
Two thoughts. RF are often split until purity. This often means that there are many terminal nodes, each with a single observation. The final splits leading up to these nodes may not generalize very
Random forest variance Two thoughts. RF are often split until purity. This often means that there are many terminal nodes, each with a single observation. The final splits leading up to these nodes may not generalize very well because there are so few observations to work with at that depth of the tree. So you may ge...
Random forest variance Two thoughts. RF are often split until purity. This often means that there are many terminal nodes, each with a single observation. The final splits leading up to these nodes may not generalize very
52,305
Random forest variance
I mean more of a variance reduction, i.e. predictable result. I increased the number of trees, but it didn't help. Due to the central limit theorem, and due to the fact Random Forests predictions are obtained through averaging, increasing the number of trees should help. The default in R is 500L, set this as high as y...
Random forest variance
I mean more of a variance reduction, i.e. predictable result. I increased the number of trees, but it didn't help. Due to the central limit theorem, and due to the fact Random Forests predictions are
Random forest variance I mean more of a variance reduction, i.e. predictable result. I increased the number of trees, but it didn't help. Due to the central limit theorem, and due to the fact Random Forests predictions are obtained through averaging, increasing the number of trees should help. The default in R is 500L...
Random forest variance I mean more of a variance reduction, i.e. predictable result. I increased the number of trees, but it didn't help. Due to the central limit theorem, and due to the fact Random Forests predictions are
52,306
Random forest variance
Adding to what users said, if you average many uncorrelated or little correlated variable you get a reduction in variance. Define $X=\sum_{i}^{B}T_i$ where $T_i$ is a single decision tree, B number of decision tree. $Var(X)=\frac{1}{B^2}\sum_i\sum_jcov(X_i,X_j)=\frac{1}{B^2} \sum_{i} ( \sum_{i\neq j} Cov(X_i,X_j)+Var(X...
Random forest variance
Adding to what users said, if you average many uncorrelated or little correlated variable you get a reduction in variance. Define $X=\sum_{i}^{B}T_i$ where $T_i$ is a single decision tree, B number of
Random forest variance Adding to what users said, if you average many uncorrelated or little correlated variable you get a reduction in variance. Define $X=\sum_{i}^{B}T_i$ where $T_i$ is a single decision tree, B number of decision tree. $Var(X)=\frac{1}{B^2}\sum_i\sum_jcov(X_i,X_j)=\frac{1}{B^2} \sum_{i} ( \sum_{i\ne...
Random forest variance Adding to what users said, if you average many uncorrelated or little correlated variable you get a reduction in variance. Define $X=\sum_{i}^{B}T_i$ where $T_i$ is a single decision tree, B number of
52,307
Any theory on how to split the data?
This may not be quite what you asked, but one major theoretical point of caution when splitting the data is that you shouldn't put a set of correlated observations (i.e. correlated even after conditioning on your features) into both training and the test set. You need to take some stand on what in some sense is an inde...
Any theory on how to split the data?
This may not be quite what you asked, but one major theoretical point of caution when splitting the data is that you shouldn't put a set of correlated observations (i.e. correlated even after conditio
Any theory on how to split the data? This may not be quite what you asked, but one major theoretical point of caution when splitting the data is that you shouldn't put a set of correlated observations (i.e. correlated even after conditioning on your features) into both training and the test set. You need to take some s...
Any theory on how to split the data? This may not be quite what you asked, but one major theoretical point of caution when splitting the data is that you shouldn't put a set of correlated observations (i.e. correlated even after conditio
52,308
Any theory on how to split the data?
Summary: there are known guidelines (at least for some situations) for required sample sizes - but IMHO they cannot easily be converted into a "split into such-and-such fractions" rule of thumb. While in k-fold cross validation the choice of k often doesn't matter much there are additional coniderations for single sp...
Any theory on how to split the data?
Summary: there are known guidelines (at least for some situations) for required sample sizes - but IMHO they cannot easily be converted into a "split into such-and-such fractions" rule of thumb. Whi
Any theory on how to split the data? Summary: there are known guidelines (at least for some situations) for required sample sizes - but IMHO they cannot easily be converted into a "split into such-and-such fractions" rule of thumb. While in k-fold cross validation the choice of k often doesn't matter much there are a...
Any theory on how to split the data? Summary: there are known guidelines (at least for some situations) for required sample sizes - but IMHO they cannot easily be converted into a "split into such-and-such fractions" rule of thumb. Whi
52,309
Any theory on how to split the data?
I don't have a theory based response, but my allocation of data usually depends on how much data I have and how well my model fits that data. If you have a bunch of data, you can probably be pretty liberal in how much you set aside for validation and testing. If you are limited, that is where model fit comes in. Ima...
Any theory on how to split the data?
I don't have a theory based response, but my allocation of data usually depends on how much data I have and how well my model fits that data. If you have a bunch of data, you can probably be pretty l
Any theory on how to split the data? I don't have a theory based response, but my allocation of data usually depends on how much data I have and how well my model fits that data. If you have a bunch of data, you can probably be pretty liberal in how much you set aside for validation and testing. If you are limited, t...
Any theory on how to split the data? I don't have a theory based response, but my allocation of data usually depends on how much data I have and how well my model fits that data. If you have a bunch of data, you can probably be pretty l
52,310
Any theory on how to split the data?
To add to other comments I think there is no rule gainst seeing this percentage as a hyper(or maybe better to say hyper-hyper) parameter. The set up that I can think of is dividing your data by two at first. Let's say put 10% of your data aside (yeah ! it's percentage again) and then for the rest of your data slice it ...
Any theory on how to split the data?
To add to other comments I think there is no rule gainst seeing this percentage as a hyper(or maybe better to say hyper-hyper) parameter. The set up that I can think of is dividing your data by two at
Any theory on how to split the data? To add to other comments I think there is no rule gainst seeing this percentage as a hyper(or maybe better to say hyper-hyper) parameter. The set up that I can think of is dividing your data by two at first. Let's say put 10% of your data aside (yeah ! it's percentage again) and the...
Any theory on how to split the data? To add to other comments I think there is no rule gainst seeing this percentage as a hyper(or maybe better to say hyper-hyper) parameter. The set up that I can think of is dividing your data by two at
52,311
circular reasoning?
It's not terrible but it's not great, either. Ideally, we'd prefer that the network be able to sort out what is/isn't important given the presence of the other variables. On the other hand, a large number of irrelevant features can make that a challenging fitting & regularization task, so it's hard to fault you for tak...
circular reasoning?
It's not terrible but it's not great, either. Ideally, we'd prefer that the network be able to sort out what is/isn't important given the presence of the other variables. On the other hand, a large nu
circular reasoning? It's not terrible but it's not great, either. Ideally, we'd prefer that the network be able to sort out what is/isn't important given the presence of the other variables. On the other hand, a large number of irrelevant features can make that a challenging fitting & regularization task, so it's hard ...
circular reasoning? It's not terrible but it's not great, either. Ideally, we'd prefer that the network be able to sort out what is/isn't important given the presence of the other variables. On the other hand, a large nu
52,312
circular reasoning?
It's related to circular reasoning. Variables chosen because they are associated with the outcome will likely continue to show (with an alternate approach) that they are associated with the outcome. It's very important to cross-validate. Choose predictors based on a subset ("training set") of the data, and test thei...
circular reasoning?
It's related to circular reasoning. Variables chosen because they are associated with the outcome will likely continue to show (with an alternate approach) that they are associated with the outcome.
circular reasoning? It's related to circular reasoning. Variables chosen because they are associated with the outcome will likely continue to show (with an alternate approach) that they are associated with the outcome. It's very important to cross-validate. Choose predictors based on a subset ("training set") of the...
circular reasoning? It's related to circular reasoning. Variables chosen because they are associated with the outcome will likely continue to show (with an alternate approach) that they are associated with the outcome.
52,313
circular reasoning?
Your ad hoc selection method is guaranteed to inflate false-positive error rate due to overfitting. Philosophically, I'm not sure whether this is formally a kind of "circular reasoning"--practically this is like debating the sex of angels, to quote Miguel Hernan. A 0.01 significance level with 1500 comparisons reason...
circular reasoning?
Your ad hoc selection method is guaranteed to inflate false-positive error rate due to overfitting. Philosophically, I'm not sure whether this is formally a kind of "circular reasoning"--practically
circular reasoning? Your ad hoc selection method is guaranteed to inflate false-positive error rate due to overfitting. Philosophically, I'm not sure whether this is formally a kind of "circular reasoning"--practically this is like debating the sex of angels, to quote Miguel Hernan. A 0.01 significance level with 150...
circular reasoning? Your ad hoc selection method is guaranteed to inflate false-positive error rate due to overfitting. Philosophically, I'm not sure whether this is formally a kind of "circular reasoning"--practically
52,314
Loss functions for regression proof
I would like to explain the way I understood it, explaining each and every step on the way. Assumptions: $g(x,t)$ is a function of x and t. $p(x,t)$ is a joint distribution over $x$ and $t$. Basic formulas: $$\mathbb{E}_t[g|x] = \int_t{g(x,t)p(t|x)\mathop{dt}} \ (\mathbb{E}_t[g|x] \text{ is a function of $x$ and cons...
Loss functions for regression proof
I would like to explain the way I understood it, explaining each and every step on the way. Assumptions: $g(x,t)$ is a function of x and t. $p(x,t)$ is a joint distribution over $x$ and $t$. Basic f
Loss functions for regression proof I would like to explain the way I understood it, explaining each and every step on the way. Assumptions: $g(x,t)$ is a function of x and t. $p(x,t)$ is a joint distribution over $x$ and $t$. Basic formulas: $$\mathbb{E}_t[g|x] = \int_t{g(x,t)p(t|x)\mathop{dt}} \ (\mathbb{E}_t[g|x] ...
Loss functions for regression proof I would like to explain the way I understood it, explaining each and every step on the way. Assumptions: $g(x,t)$ is a function of x and t. $p(x,t)$ is a joint distribution over $x$ and $t$. Basic f
52,315
Loss functions for regression proof
This proof is easier if you iterate expectations. You want to show that $\mathbb{E}(y|x)$ is in a sense the best predictor of $t$, so you want to show that $$ \mathbb{E}[(y(x) - t)^2] \ge \mathbb{E}[\{\mathbb{E}(t \vert x) - t\}^2] $$ for any $y(x)$. It's easier to first consider $\mathbb{E}[(y(x) - t)^2 \vert x]$. If ...
Loss functions for regression proof
This proof is easier if you iterate expectations. You want to show that $\mathbb{E}(y|x)$ is in a sense the best predictor of $t$, so you want to show that $$ \mathbb{E}[(y(x) - t)^2] \ge \mathbb{E}[\
Loss functions for regression proof This proof is easier if you iterate expectations. You want to show that $\mathbb{E}(y|x)$ is in a sense the best predictor of $t$, so you want to show that $$ \mathbb{E}[(y(x) - t)^2] \ge \mathbb{E}[\{\mathbb{E}(t \vert x) - t\}^2] $$ for any $y(x)$. It's easier to first consider $\m...
Loss functions for regression proof This proof is easier if you iterate expectations. You want to show that $\mathbb{E}(y|x)$ is in a sense the best predictor of $t$, so you want to show that $$ \mathbb{E}[(y(x) - t)^2] \ge \mathbb{E}[\
52,316
What does "mixing" mean in sampling?
When people say "mixing" in the context of Markov chain Monte Carlo (MCMC), they are (knowingly or unknowingly) referring to the "mixing time" of the Markov chain. Intuitively, mixing time for a Markov chain is the number of steps required of the Markov chain to come close to the stationary distribution (or in the worl...
What does "mixing" mean in sampling?
When people say "mixing" in the context of Markov chain Monte Carlo (MCMC), they are (knowingly or unknowingly) referring to the "mixing time" of the Markov chain. Intuitively, mixing time for a Marko
What does "mixing" mean in sampling? When people say "mixing" in the context of Markov chain Monte Carlo (MCMC), they are (knowingly or unknowingly) referring to the "mixing time" of the Markov chain. Intuitively, mixing time for a Markov chain is the number of steps required of the Markov chain to come close to the st...
What does "mixing" mean in sampling? When people say "mixing" in the context of Markov chain Monte Carlo (MCMC), they are (knowingly or unknowingly) referring to the "mixing time" of the Markov chain. Intuitively, mixing time for a Marko
52,317
What does "mixing" mean in sampling?
Well, if I remember correctly what little I ever knew about ergodic theory, mixing implies ergodic, and ergodic means that time averages and space averages are the same, which is the justification for sampling over a sequence of random samples. So one would like to know that one's sampling scheme is mixing. I suppose t...
What does "mixing" mean in sampling?
Well, if I remember correctly what little I ever knew about ergodic theory, mixing implies ergodic, and ergodic means that time averages and space averages are the same, which is the justification for
What does "mixing" mean in sampling? Well, if I remember correctly what little I ever knew about ergodic theory, mixing implies ergodic, and ergodic means that time averages and space averages are the same, which is the justification for sampling over a sequence of random samples. So one would like to know that one's s...
What does "mixing" mean in sampling? Well, if I remember correctly what little I ever knew about ergodic theory, mixing implies ergodic, and ergodic means that time averages and space averages are the same, which is the justification for
52,318
Can odds ratios be negative?
It cannot be negative. However, the (often natural) logarithm of it can be. Usually, an odds ratio is actually derived on the log-transformed scale (where confidence intervals derived based on log-odds ratio $\pm 1.96 \times $ SE work better) and estimate & confidence intervals are the transformed onto the odds ratio s...
Can odds ratios be negative?
It cannot be negative. However, the (often natural) logarithm of it can be. Usually, an odds ratio is actually derived on the log-transformed scale (where confidence intervals derived based on log-odd
Can odds ratios be negative? It cannot be negative. However, the (often natural) logarithm of it can be. Usually, an odds ratio is actually derived on the log-transformed scale (where confidence intervals derived based on log-odds ratio $\pm 1.96 \times $ SE work better) and estimate & confidence intervals are the tran...
Can odds ratios be negative? It cannot be negative. However, the (often natural) logarithm of it can be. Usually, an odds ratio is actually derived on the log-transformed scale (where confidence intervals derived based on log-odd
52,319
Can odds ratios be negative?
It simply can not be negative. Perhaps you read somewhere about negative values of logarithm of odds rato or the logit function defined as $\ln(p)$ where $p$ is $\frac{OR}{1+OR}$
Can odds ratios be negative?
It simply can not be negative. Perhaps you read somewhere about negative values of logarithm of odds rato or the logit function defined as $\ln(p)$ where $p$ is $\frac{OR}{1+OR}$
Can odds ratios be negative? It simply can not be negative. Perhaps you read somewhere about negative values of logarithm of odds rato or the logit function defined as $\ln(p)$ where $p$ is $\frac{OR}{1+OR}$
Can odds ratios be negative? It simply can not be negative. Perhaps you read somewhere about negative values of logarithm of odds rato or the logit function defined as $\ln(p)$ where $p$ is $\frac{OR}{1+OR}$
52,320
Residuals analysis: interpretation of a scatter plot
No, this does not look good. You appear to have a problem with heteroscedasticity as there is increasing variance of residuals with increasing predicted values. Constant variance is an important condition for OLS regression in order to perform valid inference. This might be resolved by log-transforming the response var...
Residuals analysis: interpretation of a scatter plot
No, this does not look good. You appear to have a problem with heteroscedasticity as there is increasing variance of residuals with increasing predicted values. Constant variance is an important condi
Residuals analysis: interpretation of a scatter plot No, this does not look good. You appear to have a problem with heteroscedasticity as there is increasing variance of residuals with increasing predicted values. Constant variance is an important condition for OLS regression in order to perform valid inference. This m...
Residuals analysis: interpretation of a scatter plot No, this does not look good. You appear to have a problem with heteroscedasticity as there is increasing variance of residuals with increasing predicted values. Constant variance is an important condi
52,321
Residuals analysis: interpretation of a scatter plot
Visually at first it seemed to me that your residuals look like they were heteroskedastic (non-constant variance), autocorrelated (not independent), and non-Normally distributed. Those are actually issues that could be resolved anyway. It turns out that you tested your residuals, and they appear to have done ok on all...
Residuals analysis: interpretation of a scatter plot
Visually at first it seemed to me that your residuals look like they were heteroskedastic (non-constant variance), autocorrelated (not independent), and non-Normally distributed. Those are actually i
Residuals analysis: interpretation of a scatter plot Visually at first it seemed to me that your residuals look like they were heteroskedastic (non-constant variance), autocorrelated (not independent), and non-Normally distributed. Those are actually issues that could be resolved anyway. It turns out that you tested y...
Residuals analysis: interpretation of a scatter plot Visually at first it seemed to me that your residuals look like they were heteroskedastic (non-constant variance), autocorrelated (not independent), and non-Normally distributed. Those are actually i
52,322
Should I use an average to summarize ordinal data?
This is largely an issue for you to decide based on your theoretical assumptions about the data and what lies behind them. When you calculate an arithmetic average, you are assuming that the intervals are reasonably similar. (That is, you are implicitly stating that $3-2 = 2-1$ and $3-1 = 2\times (3-2)$.) If you bel...
Should I use an average to summarize ordinal data?
This is largely an issue for you to decide based on your theoretical assumptions about the data and what lies behind them. When you calculate an arithmetic average, you are assuming that the interval
Should I use an average to summarize ordinal data? This is largely an issue for you to decide based on your theoretical assumptions about the data and what lies behind them. When you calculate an arithmetic average, you are assuming that the intervals are reasonably similar. (That is, you are implicitly stating that ...
Should I use an average to summarize ordinal data? This is largely an issue for you to decide based on your theoretical assumptions about the data and what lies behind them. When you calculate an arithmetic average, you are assuming that the interval
52,323
Should I use an average to summarize ordinal data?
It is often the case with discrete data that the mean is non-discrete. That doesn't mean that it isn't a worthwhile statistic to report. A value of 1.6 could be interpreted as easy for most, but intermediate for some - pretty much what you see in your table. If you want integers, you can calculate the median, which is...
Should I use an average to summarize ordinal data?
It is often the case with discrete data that the mean is non-discrete. That doesn't mean that it isn't a worthwhile statistic to report. A value of 1.6 could be interpreted as easy for most, but inter
Should I use an average to summarize ordinal data? It is often the case with discrete data that the mean is non-discrete. That doesn't mean that it isn't a worthwhile statistic to report. A value of 1.6 could be interpreted as easy for most, but intermediate for some - pretty much what you see in your table. If you wa...
Should I use an average to summarize ordinal data? It is often the case with discrete data that the mean is non-discrete. That doesn't mean that it isn't a worthwhile statistic to report. A value of 1.6 could be interpreted as easy for most, but inter
52,324
Should I use an average to summarize ordinal data?
You state that you "need to use the words that are 'mainly' marked as 2." I'd argue that you need to define what 'mainly' actually means to you. One way is to take the mean, as you indicate intuitively makes sense to you. If you do, then, indeed, if the mean is: 1.5 ≤ mean < 2.5. Then you might interpret it as 'mainly'...
Should I use an average to summarize ordinal data?
You state that you "need to use the words that are 'mainly' marked as 2." I'd argue that you need to define what 'mainly' actually means to you. One way is to take the mean, as you indicate intuitivel
Should I use an average to summarize ordinal data? You state that you "need to use the words that are 'mainly' marked as 2." I'd argue that you need to define what 'mainly' actually means to you. One way is to take the mean, as you indicate intuitively makes sense to you. If you do, then, indeed, if the mean is: 1.5 ≤ ...
Should I use an average to summarize ordinal data? You state that you "need to use the words that are 'mainly' marked as 2." I'd argue that you need to define what 'mainly' actually means to you. One way is to take the mean, as you indicate intuitivel
52,325
Should I use an average to summarize ordinal data?
I think you have a few options depending on what you care about. You can go with the mean and see if it falls within some range of 2. This would be like averaging your votes. The advantage here is that you can check on how balanced people's votes are. If you care more about how the votes land with at least 1/2 voting m...
Should I use an average to summarize ordinal data?
I think you have a few options depending on what you care about. You can go with the mean and see if it falls within some range of 2. This would be like averaging your votes. The advantage here is tha
Should I use an average to summarize ordinal data? I think you have a few options depending on what you care about. You can go with the mean and see if it falls within some range of 2. This would be like averaging your votes. The advantage here is that you can check on how balanced people's votes are. If you care more ...
Should I use an average to summarize ordinal data? I think you have a few options depending on what you care about. You can go with the mean and see if it falls within some range of 2. This would be like averaging your votes. The advantage here is tha
52,326
How can I calculate $E\left(\prod_{i=1}^{n}\frac{X_i}{X_{(n)}}\right)$ where $X_1,\ldots,X_n$ are i.i.d $U(0,\theta)$?
Short answer: it is the same as $\text{E}[\prod_{i=1}^{n-1} Y_i]$ with the factors $Y_i\sim U(0,1)$. If they are all independent (i.e. if $X_1,\ldots,X_n$ are sampled independently), this becomes $2^{1-n}$. Longer answer: this is really a question about uniform order statistics. If the $X_i$ are independent and uniform...
How can I calculate $E\left(\prod_{i=1}^{n}\frac{X_i}{X_{(n)}}\right)$ where $X_1,\ldots,X_n$ are i.
Short answer: it is the same as $\text{E}[\prod_{i=1}^{n-1} Y_i]$ with the factors $Y_i\sim U(0,1)$. If they are all independent (i.e. if $X_1,\ldots,X_n$ are sampled independently), this becomes $2^{
How can I calculate $E\left(\prod_{i=1}^{n}\frac{X_i}{X_{(n)}}\right)$ where $X_1,\ldots,X_n$ are i.i.d $U(0,\theta)$? Short answer: it is the same as $\text{E}[\prod_{i=1}^{n-1} Y_i]$ with the factors $Y_i\sim U(0,1)$. If they are all independent (i.e. if $X_1,\ldots,X_n$ are sampled independently), this becomes $2^{1...
How can I calculate $E\left(\prod_{i=1}^{n}\frac{X_i}{X_{(n)}}\right)$ where $X_1,\ldots,X_n$ are i. Short answer: it is the same as $\text{E}[\prod_{i=1}^{n-1} Y_i]$ with the factors $Y_i\sim U(0,1)$. If they are all independent (i.e. if $X_1,\ldots,X_n$ are sampled independently), this becomes $2^{
52,327
Linear probability model, dummy variables and the same standard errors on all estimates
Recall that the standard errors are the diagonal elements of the matrix $$ \hat\sigma^2(X'X)^{-1} $$ As pointed out by @repmat, this result requires that each group is of equal size, i.e., that $$\sum_iG_{ji}=c$$ for $j=1,\ldots,J$. In that case, you can easily check that $$ X'X=n \begin{pmatrix} 1&1/J&\cdots&\cdots&...
Linear probability model, dummy variables and the same standard errors on all estimates
Recall that the standard errors are the diagonal elements of the matrix $$ \hat\sigma^2(X'X)^{-1} $$ As pointed out by @repmat, this result requires that each group is of equal size, i.e., that $$\su
Linear probability model, dummy variables and the same standard errors on all estimates Recall that the standard errors are the diagonal elements of the matrix $$ \hat\sigma^2(X'X)^{-1} $$ As pointed out by @repmat, this result requires that each group is of equal size, i.e., that $$\sum_iG_{ji}=c$$ for $j=1,\ldots,J$...
Linear probability model, dummy variables and the same standard errors on all estimates Recall that the standard errors are the diagonal elements of the matrix $$ \hat\sigma^2(X'X)^{-1} $$ As pointed out by @repmat, this result requires that each group is of equal size, i.e., that $$\su
52,328
Linear probability model, dummy variables and the same standard errors on all estimates
This will happen if, and only if, the two (or more variables) have the same variance, or in other words that all groups are equally large (in terms of 1's). The nature of $y$ does not matter. Here is an example from R: set.seed(42) year1 <- data.frame(rep(1, 333)) year2 <- data.frame(rep(2, 333)) year3 <- data.frame(r...
Linear probability model, dummy variables and the same standard errors on all estimates
This will happen if, and only if, the two (or more variables) have the same variance, or in other words that all groups are equally large (in terms of 1's). The nature of $y$ does not matter. Here is
Linear probability model, dummy variables and the same standard errors on all estimates This will happen if, and only if, the two (or more variables) have the same variance, or in other words that all groups are equally large (in terms of 1's). The nature of $y$ does not matter. Here is an example from R: set.seed(42)...
Linear probability model, dummy variables and the same standard errors on all estimates This will happen if, and only if, the two (or more variables) have the same variance, or in other words that all groups are equally large (in terms of 1's). The nature of $y$ does not matter. Here is
52,329
Linear probability model, dummy variables and the same standard errors on all estimates
You could ask yourself the question 'Why would I expect one of them to be much larger than the others?'. I do not think you are doing anything wrong as far as specifying your model matrix is concerned. I do wonder though whether using linear regression for an outcome which is binary is a good thing. Most people would u...
Linear probability model, dummy variables and the same standard errors on all estimates
You could ask yourself the question 'Why would I expect one of them to be much larger than the others?'. I do not think you are doing anything wrong as far as specifying your model matrix is concerned
Linear probability model, dummy variables and the same standard errors on all estimates You could ask yourself the question 'Why would I expect one of them to be much larger than the others?'. I do not think you are doing anything wrong as far as specifying your model matrix is concerned. I do wonder though whether usi...
Linear probability model, dummy variables and the same standard errors on all estimates You could ask yourself the question 'Why would I expect one of them to be much larger than the others?'. I do not think you are doing anything wrong as far as specifying your model matrix is concerned
52,330
Replicating a linear regression example from Hastie, Tibshirani and Friedman
As they say in the text: We fit a linear model to the log of prostate-specific antigen, lpsa, after first standardizing the predictors to have unit variance. We randomly split the dataset into a training set of size 67 and a test set of size 30. We applied least squares estimation to the training set, producin...
Replicating a linear regression example from Hastie, Tibshirani and Friedman
As they say in the text: We fit a linear model to the log of prostate-specific antigen, lpsa, after first standardizing the predictors to have unit variance. We randomly split the dataset into a
Replicating a linear regression example from Hastie, Tibshirani and Friedman As they say in the text: We fit a linear model to the log of prostate-specific antigen, lpsa, after first standardizing the predictors to have unit variance. We randomly split the dataset into a training set of size 67 and a test set of...
Replicating a linear regression example from Hastie, Tibshirani and Friedman As they say in the text: We fit a linear model to the log of prostate-specific antigen, lpsa, after first standardizing the predictors to have unit variance. We randomly split the dataset into a
52,331
Replicating a linear regression example from Hastie, Tibshirani and Friedman
When I standardize the predictors (i.e. subtract mean and divide by standard deviation), and then do standard OLS on observations marked as belonging to the training set, I get: 2.464932922123745 0.679528141237975 0.263053065732544 -0.141464833536172 0.210146557221827 0.305200597125098 -0.28849277245...
Replicating a linear regression example from Hastie, Tibshirani and Friedman
When I standardize the predictors (i.e. subtract mean and divide by standard deviation), and then do standard OLS on observations marked as belonging to the training set, I get: 2.464932922123745
Replicating a linear regression example from Hastie, Tibshirani and Friedman When I standardize the predictors (i.e. subtract mean and divide by standard deviation), and then do standard OLS on observations marked as belonging to the training set, I get: 2.464932922123745 0.679528141237975 0.263053065732544 ...
Replicating a linear regression example from Hastie, Tibshirani and Friedman When I standardize the predictors (i.e. subtract mean and divide by standard deviation), and then do standard OLS on observations marked as belonging to the training set, I get: 2.464932922123745
52,332
Downsampling vs upsampling on the significance of the predictors in logistic regression
NEVER use downsampling to make a method work. If the method is any good it will work under imbalance. Removal of samples is not scientific. Logistic regression works well under extreme imbalance. Also (1) logistic regression is not a classification method, (2) make sure you use proper accuracy scoring rules, and (3...
Downsampling vs upsampling on the significance of the predictors in logistic regression
NEVER use downsampling to make a method work. If the method is any good it will work under imbalance. Removal of samples is not scientific. Logistic regression works well under extreme imbalance.
Downsampling vs upsampling on the significance of the predictors in logistic regression NEVER use downsampling to make a method work. If the method is any good it will work under imbalance. Removal of samples is not scientific. Logistic regression works well under extreme imbalance. Also (1) logistic regression is ...
Downsampling vs upsampling on the significance of the predictors in logistic regression NEVER use downsampling to make a method work. If the method is any good it will work under imbalance. Removal of samples is not scientific. Logistic regression works well under extreme imbalance.
52,333
Downsampling vs upsampling on the significance of the predictors in logistic regression
Yes upsampling is better if your machine can handle the bigger dataset to train especially if you're testing for statistically significant associations in your model. Due to the fact that more samples = more statistical power and lower standard error estimate which is why your results are the way they are.
Downsampling vs upsampling on the significance of the predictors in logistic regression
Yes upsampling is better if your machine can handle the bigger dataset to train especially if you're testing for statistically significant associations in your model. Due to the fact that more samples
Downsampling vs upsampling on the significance of the predictors in logistic regression Yes upsampling is better if your machine can handle the bigger dataset to train especially if you're testing for statistically significant associations in your model. Due to the fact that more samples = more statistical power and lo...
Downsampling vs upsampling on the significance of the predictors in logistic regression Yes upsampling is better if your machine can handle the bigger dataset to train especially if you're testing for statistically significant associations in your model. Due to the fact that more samples
52,334
Where in Elements of Statistical Learning does it talk of a "trick" to deal with categorical variables for binary classification?
It is mentioned in Section 9.2.4 under Categorical Predictors. Here is a basic example of the "trick" and why it's important. Suppose you have a binary response $y$ with values $\{\text{Yes}, \text{No}\}$ and a categorical variable $x$ with levels $\{A, B, C, D, E\}$. When splitting on $x$ at a given node, you have $1...
Where in Elements of Statistical Learning does it talk of a "trick" to deal with categorical variabl
It is mentioned in Section 9.2.4 under Categorical Predictors. Here is a basic example of the "trick" and why it's important. Suppose you have a binary response $y$ with values $\{\text{Yes}, \text{No
Where in Elements of Statistical Learning does it talk of a "trick" to deal with categorical variables for binary classification? It is mentioned in Section 9.2.4 under Categorical Predictors. Here is a basic example of the "trick" and why it's important. Suppose you have a binary response $y$ with values $\{\text{Yes}...
Where in Elements of Statistical Learning does it talk of a "trick" to deal with categorical variabl It is mentioned in Section 9.2.4 under Categorical Predictors. Here is a basic example of the "trick" and why it's important. Suppose you have a binary response $y$ with values $\{\text{Yes}, \text{No
52,335
Naive Ridge Regression in R?
First, very simply, I don't think your call to solve looks right, this is what I would expect solve(t(X) %*% X + lambda.diag, t(X) %*% y) Your code seems to be explicitly calculating a matrix inverse and then multiplying. This is mathematically correct, but computationally incorrect. It is always better to solve the...
Naive Ridge Regression in R?
First, very simply, I don't think your call to solve looks right, this is what I would expect solve(t(X) %*% X + lambda.diag, t(X) %*% y) Your code seems to be explicitly calculating a matrix inverse
Naive Ridge Regression in R? First, very simply, I don't think your call to solve looks right, this is what I would expect solve(t(X) %*% X + lambda.diag, t(X) %*% y) Your code seems to be explicitly calculating a matrix inverse and then multiplying. This is mathematically correct, but computationally incorrect. It ...
Naive Ridge Regression in R? First, very simply, I don't think your call to solve looks right, this is what I would expect solve(t(X) %*% X + lambda.diag, t(X) %*% y) Your code seems to be explicitly calculating a matrix inverse
52,336
Naive Ridge Regression in R?
Try to type lm.ridge in your R console. You will see the code for the function, and it does standardize the input. Try to standardize the input to your function and compare the results. If you read the documentation you can also see: If an intercept is present in the model, its coefficient is not penalized. (If you wa...
Naive Ridge Regression in R?
Try to type lm.ridge in your R console. You will see the code for the function, and it does standardize the input. Try to standardize the input to your function and compare the results. If you read th
Naive Ridge Regression in R? Try to type lm.ridge in your R console. You will see the code for the function, and it does standardize the input. Try to standardize the input to your function and compare the results. If you read the documentation you can also see: If an intercept is present in the model, its coefficient...
Naive Ridge Regression in R? Try to type lm.ridge in your R console. You will see the code for the function, and it does standardize the input. Try to standardize the input to your function and compare the results. If you read th
52,337
Naive Ridge Regression in R?
Not a complete answer here, but some relevant things for those that will try to implement Ridge regression by themselves and compare their results to lm.ridge. lm.ridge uses SVD to estimate the coefficients. It is pretty straightforward to implement Relevant explanation on how to do that is in the upvoted comment from...
Naive Ridge Regression in R?
Not a complete answer here, but some relevant things for those that will try to implement Ridge regression by themselves and compare their results to lm.ridge. lm.ridge uses SVD to estimate the coeff
Naive Ridge Regression in R? Not a complete answer here, but some relevant things for those that will try to implement Ridge regression by themselves and compare their results to lm.ridge. lm.ridge uses SVD to estimate the coefficients. It is pretty straightforward to implement Relevant explanation on how to do that i...
Naive Ridge Regression in R? Not a complete answer here, but some relevant things for those that will try to implement Ridge regression by themselves and compare their results to lm.ridge. lm.ridge uses SVD to estimate the coeff
52,338
Residuals in regression should not be correlated with another variable
This is based on the approach that there exists a set of explanatory variables (EV) whose variability captures everything in the variability of the dependent variable bar "random, unpredictable noise". As the link itself says clearly, "The idea is that the deterministic portion of your model is so good at explaining (...
Residuals in regression should not be correlated with another variable
This is based on the approach that there exists a set of explanatory variables (EV) whose variability captures everything in the variability of the dependent variable bar "random, unpredictable noise"
Residuals in regression should not be correlated with another variable This is based on the approach that there exists a set of explanatory variables (EV) whose variability captures everything in the variability of the dependent variable bar "random, unpredictable noise". As the link itself says clearly, "The idea is ...
Residuals in regression should not be correlated with another variable This is based on the approach that there exists a set of explanatory variables (EV) whose variability captures everything in the variability of the dependent variable bar "random, unpredictable noise"
52,339
Residuals in regression should not be correlated with another variable
Your residuals should be normal noise. If they have another structure you might have a problem like omitted-variable bias. You should then be able to predict the residuals by using the omitted variable(s). If you reestimate your model and now include the variable(s) you omitted before, then your residuals should be nor...
Residuals in regression should not be correlated with another variable
Your residuals should be normal noise. If they have another structure you might have a problem like omitted-variable bias. You should then be able to predict the residuals by using the omitted variabl
Residuals in regression should not be correlated with another variable Your residuals should be normal noise. If they have another structure you might have a problem like omitted-variable bias. You should then be able to predict the residuals by using the omitted variable(s). If you reestimate your model and now includ...
Residuals in regression should not be correlated with another variable Your residuals should be normal noise. If they have another structure you might have a problem like omitted-variable bias. You should then be able to predict the residuals by using the omitted variabl
52,340
Residuals in regression should not be correlated with another variable
Another way to think about it is by analogy. Box, Hunter & Hunter (in their "Statistics for Experimenters" which is highly recommended) uses the following analogy with chemistry and (drinking) water purification. To purify the water, we pass it through some sort of filter to remove impurities. How do we test if there...
Residuals in regression should not be correlated with another variable
Another way to think about it is by analogy. Box, Hunter & Hunter (in their "Statistics for Experimenters" which is highly recommended) uses the following analogy with chemistry and (drinking) water
Residuals in regression should not be correlated with another variable Another way to think about it is by analogy. Box, Hunter & Hunter (in their "Statistics for Experimenters" which is highly recommended) uses the following analogy with chemistry and (drinking) water purification. To purify the water, we pass it th...
Residuals in regression should not be correlated with another variable Another way to think about it is by analogy. Box, Hunter & Hunter (in their "Statistics for Experimenters" which is highly recommended) uses the following analogy with chemistry and (drinking) water
52,341
What is the difference between multimodal and multivariate?
Put very simply, "multi-modal" refers to a dataset (variable) in which there is more than one mode, whereas "multi-variate" refers to a dataset in which there is more than one variable. Here is a simple demonstration, coded with R: set.seed(5104) x1mm = c(rnorm(50, mean=-2), rnorm(50, mean=2)) x1um = rnorm(100, mea...
What is the difference between multimodal and multivariate?
Put very simply, "multi-modal" refers to a dataset (variable) in which there is more than one mode, whereas "multi-variate" refers to a dataset in which there is more than one variable. Here is a si
What is the difference between multimodal and multivariate? Put very simply, "multi-modal" refers to a dataset (variable) in which there is more than one mode, whereas "multi-variate" refers to a dataset in which there is more than one variable. Here is a simple demonstration, coded with R: set.seed(5104) x1mm = c(...
What is the difference between multimodal and multivariate? Put very simply, "multi-modal" refers to a dataset (variable) in which there is more than one mode, whereas "multi-variate" refers to a dataset in which there is more than one variable. Here is a si
52,342
What is the difference between multimodal and multivariate?
Multivariate refers to cases where you have more than one outcome variable (not levels). In cases where you have just one outcome variable, one speaks of an univariate problem. But as @gung already said, in practice and sometimes even in textbooks these terms get a little blurry and often refer to cases where you have ...
What is the difference between multimodal and multivariate?
Multivariate refers to cases where you have more than one outcome variable (not levels). In cases where you have just one outcome variable, one speaks of an univariate problem. But as @gung already sa
What is the difference between multimodal and multivariate? Multivariate refers to cases where you have more than one outcome variable (not levels). In cases where you have just one outcome variable, one speaks of an univariate problem. But as @gung already said, in practice and sometimes even in textbooks these terms ...
What is the difference between multimodal and multivariate? Multivariate refers to cases where you have more than one outcome variable (not levels). In cases where you have just one outcome variable, one speaks of an univariate problem. But as @gung already sa
52,343
Why is there a need for a 'sampling distribution' to find confidence intervals?
1. Goal of using confidence intervals As you correctly stated, the rationale behind confidence intervals is to get an idea about the value of some unknown parameter, in your case the 'mean' weight of a basket of apples. One way to find out is to weight each and every existing basket, and then compute the average. Ob...
Why is there a need for a 'sampling distribution' to find confidence intervals?
1. Goal of using confidence intervals As you correctly stated, the rationale behind confidence intervals is to get an idea about the value of some unknown parameter, in your case the 'mean' weight of
Why is there a need for a 'sampling distribution' to find confidence intervals? 1. Goal of using confidence intervals As you correctly stated, the rationale behind confidence intervals is to get an idea about the value of some unknown parameter, in your case the 'mean' weight of a basket of apples. One way to find out...
Why is there a need for a 'sampling distribution' to find confidence intervals? 1. Goal of using confidence intervals As you correctly stated, the rationale behind confidence intervals is to get an idea about the value of some unknown parameter, in your case the 'mean' weight of
52,344
Why is there a need for a 'sampling distribution' to find confidence intervals?
First we need to establish the population parameter or what is it that we want to estimate: Example: You want to know the average weight of a Californian. (This is the population parameter you are looking for) Now if you want the correct answer you need to measure the weight of every single Californian and get the aver...
Why is there a need for a 'sampling distribution' to find confidence intervals?
First we need to establish the population parameter or what is it that we want to estimate: Example: You want to know the average weight of a Californian. (This is the population parameter you are loo
Why is there a need for a 'sampling distribution' to find confidence intervals? First we need to establish the population parameter or what is it that we want to estimate: Example: You want to know the average weight of a Californian. (This is the population parameter you are looking for) Now if you want the correct an...
Why is there a need for a 'sampling distribution' to find confidence intervals? First we need to establish the population parameter or what is it that we want to estimate: Example: You want to know the average weight of a Californian. (This is the population parameter you are loo
52,345
How to use cross-validation with regularization?
You generally do have infinitely many to choose from. There are two approaches to resolving this difficulty. You can attempt to be very creative and work out mathematics for estimating the full path of models as $\lambda$ varies. This is only possible in some cases, but when it is, it is a powerful method indeed. Fo...
How to use cross-validation with regularization?
You generally do have infinitely many to choose from. There are two approaches to resolving this difficulty. You can attempt to be very creative and work out mathematics for estimating the full path
How to use cross-validation with regularization? You generally do have infinitely many to choose from. There are two approaches to resolving this difficulty. You can attempt to be very creative and work out mathematics for estimating the full path of models as $\lambda$ varies. This is only possible in some cases, bu...
How to use cross-validation with regularization? You generally do have infinitely many to choose from. There are two approaches to resolving this difficulty. You can attempt to be very creative and work out mathematics for estimating the full path
52,346
How to use cross-validation with regularization?
The procedure for cross-validated regularization parameter selection is the following : Discretize your lambdas : $\lambda_0, \lambda_1, ..., \lambda_n$ (for example you may choose $\lambda = 10^{-3}, 3 \times 10^{-3}, 10^-2, ..., 10^3$, but this is up to you. Divide your dataset into $n$ subsamples, where $n$ is the...
How to use cross-validation with regularization?
The procedure for cross-validated regularization parameter selection is the following : Discretize your lambdas : $\lambda_0, \lambda_1, ..., \lambda_n$ (for example you may choose $\lambda = 10^{-3
How to use cross-validation with regularization? The procedure for cross-validated regularization parameter selection is the following : Discretize your lambdas : $\lambda_0, \lambda_1, ..., \lambda_n$ (for example you may choose $\lambda = 10^{-3}, 3 \times 10^{-3}, 10^-2, ..., 10^3$, but this is up to you. Divide y...
How to use cross-validation with regularization? The procedure for cross-validated regularization parameter selection is the following : Discretize your lambdas : $\lambda_0, \lambda_1, ..., \lambda_n$ (for example you may choose $\lambda = 10^{-3
52,347
How to use cross-validation with regularization?
(Training Error and Test Error) versus (Model Complexity/Capacity) form a U-shaped relationship. In learning a model, there are 2 goals: Find the optimum on the model complexity axis where the U curve starts to go up again. This happens for the Test Error curve, even though the Training Error curve continues to go dow...
How to use cross-validation with regularization?
(Training Error and Test Error) versus (Model Complexity/Capacity) form a U-shaped relationship. In learning a model, there are 2 goals: Find the optimum on the model complexity axis where the U curv
How to use cross-validation with regularization? (Training Error and Test Error) versus (Model Complexity/Capacity) form a U-shaped relationship. In learning a model, there are 2 goals: Find the optimum on the model complexity axis where the U curve starts to go up again. This happens for the Test Error curve, even th...
How to use cross-validation with regularization? (Training Error and Test Error) versus (Model Complexity/Capacity) form a U-shaped relationship. In learning a model, there are 2 goals: Find the optimum on the model complexity axis where the U curv
52,348
Monte Carlo integration with imposed variance
The problem is that without knowing exactly what $\theta$ is, we cannot know the variance of its Monte-Carlo estimator. The solution is to estimate that variance and hope the estimate is sufficiently close to the truth. The very simplest form of Monte-Carlo estimation surrounds the graph of the integrand, $f(x) = e^{...
Monte Carlo integration with imposed variance
The problem is that without knowing exactly what $\theta$ is, we cannot know the variance of its Monte-Carlo estimator. The solution is to estimate that variance and hope the estimate is sufficiently
Monte Carlo integration with imposed variance The problem is that without knowing exactly what $\theta$ is, we cannot know the variance of its Monte-Carlo estimator. The solution is to estimate that variance and hope the estimate is sufficiently close to the truth. The very simplest form of Monte-Carlo estimation sur...
Monte Carlo integration with imposed variance The problem is that without knowing exactly what $\theta$ is, we cannot know the variance of its Monte-Carlo estimator. The solution is to estimate that variance and hope the estimate is sufficiently
52,349
Monte Carlo integration with imposed variance
Implement an estimator using Monte Carlo integration of $$\theta=\int\limits_0^1e^{-x^2}(1-x)dx$$ While you can use a $\mathcal{U}([0,1])$ distribution for your Monte Carlo experiment, the fact that both $$x \longrightarrow \exp\{-x^2\}\quad \text{and}\quad x \longrightarrow (1-x)$$ are decreasing functions suggest ...
Monte Carlo integration with imposed variance
Implement an estimator using Monte Carlo integration of $$\theta=\int\limits_0^1e^{-x^2}(1-x)dx$$ While you can use a $\mathcal{U}([0,1])$ distribution for your Monte Carlo experiment, the fact tha
Monte Carlo integration with imposed variance Implement an estimator using Monte Carlo integration of $$\theta=\int\limits_0^1e^{-x^2}(1-x)dx$$ While you can use a $\mathcal{U}([0,1])$ distribution for your Monte Carlo experiment, the fact that both $$x \longrightarrow \exp\{-x^2\}\quad \text{and}\quad x \longrighta...
Monte Carlo integration with imposed variance Implement an estimator using Monte Carlo integration of $$\theta=\int\limits_0^1e^{-x^2}(1-x)dx$$ While you can use a $\mathcal{U}([0,1])$ distribution for your Monte Carlo experiment, the fact tha
52,350
Monte Carlo integration with imposed variance
It's not clear whether "write the variance of estimator" means to write the equation or the results of the execution. If the latter is the case then all you need to do is to run your code at different $n$ and show how the variance shrinks with $n$. If the former is the case, then you have to show the equation for the v...
Monte Carlo integration with imposed variance
It's not clear whether "write the variance of estimator" means to write the equation or the results of the execution. If the latter is the case then all you need to do is to run your code at different
Monte Carlo integration with imposed variance It's not clear whether "write the variance of estimator" means to write the equation or the results of the execution. If the latter is the case then all you need to do is to run your code at different $n$ and show how the variance shrinks with $n$. If the former is the case...
Monte Carlo integration with imposed variance It's not clear whether "write the variance of estimator" means to write the equation or the results of the execution. If the latter is the case then all you need to do is to run your code at different
52,351
Goodness of fit chi-square test for a number of PCA components
Goodness of fit cannot be meaningfully computed for PCA. The principal function is doing something strange here. Function principal() is part of the psych package that implements factor analysis, and is designed to implement PCA in a manner mimicking factor analysis. In factor analysis, goodness of fit can be meaningfu...
Goodness of fit chi-square test for a number of PCA components
Goodness of fit cannot be meaningfully computed for PCA. The principal function is doing something strange here. Function principal() is part of the psych package that implements factor analysis, and
Goodness of fit chi-square test for a number of PCA components Goodness of fit cannot be meaningfully computed for PCA. The principal function is doing something strange here. Function principal() is part of the psych package that implements factor analysis, and is designed to implement PCA in a manner mimicking factor...
Goodness of fit chi-square test for a number of PCA components Goodness of fit cannot be meaningfully computed for PCA. The principal function is doing something strange here. Function principal() is part of the psych package that implements factor analysis, and
52,352
Goodness of fit chi-square test for a number of PCA components
Thank you for your comments. I have removed the pseudo MLE chi square from the print function for principal because it clearly leads to confusion. I have added the root mean square off diagonal residual because this is probably a more useful estimate of goodness of fit. I have retained the fit of the model to the of...
Goodness of fit chi-square test for a number of PCA components
Thank you for your comments. I have removed the pseudo MLE chi square from the print function for principal because it clearly leads to confusion. I have added the root mean square off diagonal resid
Goodness of fit chi-square test for a number of PCA components Thank you for your comments. I have removed the pseudo MLE chi square from the print function for principal because it clearly leads to confusion. I have added the root mean square off diagonal residual because this is probably a more useful estimate of go...
Goodness of fit chi-square test for a number of PCA components Thank you for your comments. I have removed the pseudo MLE chi square from the print function for principal because it clearly leads to confusion. I have added the root mean square off diagonal resid
52,353
MCMC chain getting stuck
In step 4, you don't have to reject the proposal $x,\theta$ every time its new likelihood is lower; if you do so, you are doing a sort of optimization instead of sampling from the posterior distribution. Instead, if the proposal is worse then you still accept it with an acceptance probability $a$. With pure Gibbs samp...
MCMC chain getting stuck
In step 4, you don't have to reject the proposal $x,\theta$ every time its new likelihood is lower; if you do so, you are doing a sort of optimization instead of sampling from the posterior distributi
MCMC chain getting stuck In step 4, you don't have to reject the proposal $x,\theta$ every time its new likelihood is lower; if you do so, you are doing a sort of optimization instead of sampling from the posterior distribution. Instead, if the proposal is worse then you still accept it with an acceptance probability ...
MCMC chain getting stuck In step 4, you don't have to reject the proposal $x,\theta$ every time its new likelihood is lower; if you do so, you are doing a sort of optimization instead of sampling from the posterior distributi
52,354
MCMC chain getting stuck
Here is an R code in the univariate case for the above Metropolis-within-Gibbs approach drafted by @alberto. No indication of the chain getting stuck: the acceptance rate for the $x$ component is close to 50%. First, I picked some pseudo-values to run the algorithm: #observation from N(x,1) y=3.081927 #latent x from t(...
MCMC chain getting stuck
Here is an R code in the univariate case for the above Metropolis-within-Gibbs approach drafted by @alberto. No indication of the chain getting stuck: the acceptance rate for the $x$ component is clos
MCMC chain getting stuck Here is an R code in the univariate case for the above Metropolis-within-Gibbs approach drafted by @alberto. No indication of the chain getting stuck: the acceptance rate for the $x$ component is close to 50%. First, I picked some pseudo-values to run the algorithm: #observation from N(x,1) y=3...
MCMC chain getting stuck Here is an R code in the univariate case for the above Metropolis-within-Gibbs approach drafted by @alberto. No indication of the chain getting stuck: the acceptance rate for the $x$ component is clos
52,355
Smaller standard errors *after* multiple imputation?
Have I certainly done something wrong ? No, smaller standard errors are not unusual when using multiple imputation due to the larger sample size compared to the complete cases, as Jonathan Bartlett says in his answer. The extent to which they may be smaller will depend on how many auxiliary variables are used in the im...
Smaller standard errors *after* multiple imputation?
Have I certainly done something wrong ? No, smaller standard errors are not unusual when using multiple imputation due to the larger sample size compared to the complete cases, as Jonathan Bartlett sa
Smaller standard errors *after* multiple imputation? Have I certainly done something wrong ? No, smaller standard errors are not unusual when using multiple imputation due to the larger sample size compared to the complete cases, as Jonathan Bartlett says in his answer. The extent to which they may be smaller will depe...
Smaller standard errors *after* multiple imputation? Have I certainly done something wrong ? No, smaller standard errors are not unusual when using multiple imputation due to the larger sample size compared to the complete cases, as Jonathan Bartlett sa
52,356
Smaller standard errors *after* multiple imputation?
Yes it is certainly possible. If the variables other than Y and X1 are predictive of the X1 variable which you are imputing, multiple imputation will allow you to extract this information and use it to gain information about your target parameters (a regression of Y on X1) from those with X1 missing. e.g. suppose X2 is...
Smaller standard errors *after* multiple imputation?
Yes it is certainly possible. If the variables other than Y and X1 are predictive of the X1 variable which you are imputing, multiple imputation will allow you to extract this information and use it t
Smaller standard errors *after* multiple imputation? Yes it is certainly possible. If the variables other than Y and X1 are predictive of the X1 variable which you are imputing, multiple imputation will allow you to extract this information and use it to gain information about your target parameters (a regression of Y ...
Smaller standard errors *after* multiple imputation? Yes it is certainly possible. If the variables other than Y and X1 are predictive of the X1 variable which you are imputing, multiple imputation will allow you to extract this information and use it t
52,357
Smaller standard errors *after* multiple imputation?
I think this could happen, even if you did nothing wrong. If the imputation process is very strong, then the added N will have more effect than the added variation. If you compare multiple imputation to single imputation, I think the SEs have to be bigger in MI. (That's just my intuition).
Smaller standard errors *after* multiple imputation?
I think this could happen, even if you did nothing wrong. If the imputation process is very strong, then the added N will have more effect than the added variation. If you compare multiple imputation
Smaller standard errors *after* multiple imputation? I think this could happen, even if you did nothing wrong. If the imputation process is very strong, then the added N will have more effect than the added variation. If you compare multiple imputation to single imputation, I think the SEs have to be bigger in MI. (T...
Smaller standard errors *after* multiple imputation? I think this could happen, even if you did nothing wrong. If the imputation process is very strong, then the added N will have more effect than the added variation. If you compare multiple imputation
52,358
How does caret handle factors?
The difference is how the formula method for each of these functions handles factors. The individual tree methods you mention do not convert factors to dummy variables. This is not the traditional way formulas work in R but it makes a lot of sense for these mods (and a few others). train is deigned to be more general ...
How does caret handle factors?
The difference is how the formula method for each of these functions handles factors. The individual tree methods you mention do not convert factors to dummy variables. This is not the traditional way
How does caret handle factors? The difference is how the formula method for each of these functions handles factors. The individual tree methods you mention do not convert factors to dummy variables. This is not the traditional way formulas work in R but it makes a lot of sense for these mods (and a few others). train...
How does caret handle factors? The difference is how the formula method for each of these functions handles factors. The individual tree methods you mention do not convert factors to dummy variables. This is not the traditional way
52,359
Independence and orthogonality
In order to speak about orthogonality you need to define an inner product first. If we consider random variables with finite second moment, covariance can be shown to be an inner product. In this case two random variables are orthogonal if and only if they are uncorrelated: $$ 0 = \text{cov}(X, Y) = \mathbb{E}[X Y] - \...
Independence and orthogonality
In order to speak about orthogonality you need to define an inner product first. If we consider random variables with finite second moment, covariance can be shown to be an inner product. In this case
Independence and orthogonality In order to speak about orthogonality you need to define an inner product first. If we consider random variables with finite second moment, covariance can be shown to be an inner product. In this case two random variables are orthogonal if and only if they are uncorrelated: $$ 0 = \text{c...
Independence and orthogonality In order to speak about orthogonality you need to define an inner product first. If we consider random variables with finite second moment, covariance can be shown to be an inner product. In this case
52,360
Independence and orthogonality
From a geometric perspective 2 vectors are orthogonal if they are perpendicular to one another.
Independence and orthogonality
From a geometric perspective 2 vectors are orthogonal if they are perpendicular to one another.
Independence and orthogonality From a geometric perspective 2 vectors are orthogonal if they are perpendicular to one another.
Independence and orthogonality From a geometric perspective 2 vectors are orthogonal if they are perpendicular to one another.
52,361
Which property of count data make mean-variance dependency?
I propose that substantial insight into this question is afforded by viewing counts as sums of simple (happened vs. did not happen) events. That suffices to create a relationship between variance and expectation which in common situations amounts to a direct proportion. Most counts are obtained in a context where num...
Which property of count data make mean-variance dependency?
I propose that substantial insight into this question is afforded by viewing counts as sums of simple (happened vs. did not happen) events. That suffices to create a relationship between variance and
Which property of count data make mean-variance dependency? I propose that substantial insight into this question is afforded by viewing counts as sums of simple (happened vs. did not happen) events. That suffices to create a relationship between variance and expectation which in common situations amounts to a direct ...
Which property of count data make mean-variance dependency? I propose that substantial insight into this question is afforded by viewing counts as sums of simple (happened vs. did not happen) events. That suffices to create a relationship between variance and
52,362
Which property of count data make mean-variance dependency?
First of all, it's not necessary to transform count data because there are Poisson and Negative Binomial models that allow the variance to depend on the mean. Second, the dependency of variance on mean is not restricted to count data. I think it happens because the variation among experimental units happens on a "relat...
Which property of count data make mean-variance dependency?
First of all, it's not necessary to transform count data because there are Poisson and Negative Binomial models that allow the variance to depend on the mean. Second, the dependency of variance on mea
Which property of count data make mean-variance dependency? First of all, it's not necessary to transform count data because there are Poisson and Negative Binomial models that allow the variance to depend on the mean. Second, the dependency of variance on mean is not restricted to count data. I think it happens becaus...
Which property of count data make mean-variance dependency? First of all, it's not necessary to transform count data because there are Poisson and Negative Binomial models that allow the variance to depend on the mean. Second, the dependency of variance on mea
52,363
A critical proof or counterexample regarding independence
It seems likely that you could fairly easily construct a counter-example by assigning the negative roots of $Y^2$ to $Y$ for $X\leq1$ and to the positive roots for $X > 1$. Y <- rnorm(1000)^2 X <- rnorm(1000)^2 sy[X1] <- sqrt(Y[X1]) sy[X <= 1] <- -sqrt(Y[X <= 1]) plot(sx, sy) cor(sx, sy) [1] 0.6537367 png() plot(X, Y...
A critical proof or counterexample regarding independence
It seems likely that you could fairly easily construct a counter-example by assigning the negative roots of $Y^2$ to $Y$ for $X\leq1$ and to the positive roots for $X > 1$. Y <- rnorm(1000)^2 X <- rno
A critical proof or counterexample regarding independence It seems likely that you could fairly easily construct a counter-example by assigning the negative roots of $Y^2$ to $Y$ for $X\leq1$ and to the positive roots for $X > 1$. Y <- rnorm(1000)^2 X <- rnorm(1000)^2 sy[X1] <- sqrt(Y[X1]) sy[X <= 1] <- -sqrt(Y[X <= 1]...
A critical proof or counterexample regarding independence It seems likely that you could fairly easily construct a counter-example by assigning the negative roots of $Y^2$ to $Y$ for $X\leq1$ and to the positive roots for $X > 1$. Y <- rnorm(1000)^2 X <- rno
52,364
A critical proof or counterexample regarding independence
The construction of a very general set of counterexamples illuminates this issue. The underlying idea is that although $X^2$ and $Y^2$ might be independent, a choice of two square roots is available for every nonzero value taken on by these variables. By making those choices dependent, we create a counterexample where...
A critical proof or counterexample regarding independence
The construction of a very general set of counterexamples illuminates this issue. The underlying idea is that although $X^2$ and $Y^2$ might be independent, a choice of two square roots is available
A critical proof or counterexample regarding independence The construction of a very general set of counterexamples illuminates this issue. The underlying idea is that although $X^2$ and $Y^2$ might be independent, a choice of two square roots is available for every nonzero value taken on by these variables. By making...
A critical proof or counterexample regarding independence The construction of a very general set of counterexamples illuminates this issue. The underlying idea is that although $X^2$ and $Y^2$ might be independent, a choice of two square roots is available
52,365
A critical proof or counterexample regarding independence
Let $X$ be the random variable with $P(X=1)=P(X=-1)=\frac12$ and let $Y=-X$. Then $X^2$ and $Y^2$ are independent but $X$ and $Y$ are not.
A critical proof or counterexample regarding independence
Let $X$ be the random variable with $P(X=1)=P(X=-1)=\frac12$ and let $Y=-X$. Then $X^2$ and $Y^2$ are independent but $X$ and $Y$ are not.
A critical proof or counterexample regarding independence Let $X$ be the random variable with $P(X=1)=P(X=-1)=\frac12$ and let $Y=-X$. Then $X^2$ and $Y^2$ are independent but $X$ and $Y$ are not.
A critical proof or counterexample regarding independence Let $X$ be the random variable with $P(X=1)=P(X=-1)=\frac12$ and let $Y=-X$. Then $X^2$ and $Y^2$ are independent but $X$ and $Y$ are not.
52,366
Simulating Multinomial Logit Data with R
It is really simple to generate multinomial logit regression data. All you need to keep in mind are the normalizing assumptions. # covariate matrix mX = matrix(rnorm(1000), 200, 5) # coefficients for each choice vCoef1 = rep(0, 5) vCoef2 = rnorm(5) vCoef3 = rnorm(5) # vector of probabilities vProb = cbind(exp(mX%*%vC...
Simulating Multinomial Logit Data with R
It is really simple to generate multinomial logit regression data. All you need to keep in mind are the normalizing assumptions. # covariate matrix mX = matrix(rnorm(1000), 200, 5) # coefficients for
Simulating Multinomial Logit Data with R It is really simple to generate multinomial logit regression data. All you need to keep in mind are the normalizing assumptions. # covariate matrix mX = matrix(rnorm(1000), 200, 5) # coefficients for each choice vCoef1 = rep(0, 5) vCoef2 = rnorm(5) vCoef3 = rnorm(5) # vector o...
Simulating Multinomial Logit Data with R It is really simple to generate multinomial logit regression data. All you need to keep in mind are the normalizing assumptions. # covariate matrix mX = matrix(rnorm(1000), 200, 5) # coefficients for
52,367
Simulating Multinomial Logit Data with R
In this model with $k$ variables and $d$ categories, let $x = (1,x_1, x_2,\ldots, x_k)$ be one data point including a constant $1$ for the intercept. There are $d-1$ column vectors $\beta_2, \beta_3, \ldots, \beta_d,$ each of length $k+1,$ that give the relative chances of each category in the ratios $$p_1:p_2:\cdots:...
Simulating Multinomial Logit Data with R
In this model with $k$ variables and $d$ categories, let $x = (1,x_1, x_2,\ldots, x_k)$ be one data point including a constant $1$ for the intercept. There are $d-1$ column vectors $\beta_2, \beta_3,
Simulating Multinomial Logit Data with R In this model with $k$ variables and $d$ categories, let $x = (1,x_1, x_2,\ldots, x_k)$ be one data point including a constant $1$ for the intercept. There are $d-1$ column vectors $\beta_2, \beta_3, \ldots, \beta_d,$ each of length $k+1,$ that give the relative chances of each...
Simulating Multinomial Logit Data with R In this model with $k$ variables and $d$ categories, let $x = (1,x_1, x_2,\ldots, x_k)$ be one data point including a constant $1$ for the intercept. There are $d-1$ column vectors $\beta_2, \beta_3,
52,368
Simulating Multinomial Logit Data with R
#Genarating 500 random numbers with zero mean x = rnorm(500,0) #Assigning the values of beta1 and beta2 Beta1 = 2 Beta2 = .5 #Calculation of denominator for probability calculation Denominator= 1+exp(Beta1*x)+exp(Beta2*x) #Calculating the matrix of probabilities for three choices vProb = cbind(1/Denominator, exp(x*Beta...
Simulating Multinomial Logit Data with R
#Genarating 500 random numbers with zero mean x = rnorm(500,0) #Assigning the values of beta1 and beta2 Beta1 = 2 Beta2 = .5 #Calculation of denominator for probability calculation Denominator= 1+exp(
Simulating Multinomial Logit Data with R #Genarating 500 random numbers with zero mean x = rnorm(500,0) #Assigning the values of beta1 and beta2 Beta1 = 2 Beta2 = .5 #Calculation of denominator for probability calculation Denominator= 1+exp(Beta1*x)+exp(Beta2*x) #Calculating the matrix of probabilities for three choice...
Simulating Multinomial Logit Data with R #Genarating 500 random numbers with zero mean x = rnorm(500,0) #Assigning the values of beta1 and beta2 Beta1 = 2 Beta2 = .5 #Calculation of denominator for probability calculation Denominator= 1+exp(
52,369
Simulating Multinomial Logit Data with R
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. This wikibooks link describes generating multinomial o...
Simulating Multinomial Logit Data with R
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Simulating Multinomial Logit Data with R Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. This wikibook...
Simulating Multinomial Logit Data with R Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
52,370
Weibull distribution from given mean
You could either (a) choose your mean and one other quantity (scale, shape), and solve for the two in terms of the available parameters or (b) reparameterize the Weibull to be in terms of the mean and one of the other parameters (essentially doing something like "(a)" for all possible choices of means). (a) will be rel...
Weibull distribution from given mean
You could either (a) choose your mean and one other quantity (scale, shape), and solve for the two in terms of the available parameters or (b) reparameterize the Weibull to be in terms of the mean and
Weibull distribution from given mean You could either (a) choose your mean and one other quantity (scale, shape), and solve for the two in terms of the available parameters or (b) reparameterize the Weibull to be in terms of the mean and one of the other parameters (essentially doing something like "(a)" for all possib...
Weibull distribution from given mean You could either (a) choose your mean and one other quantity (scale, shape), and solve for the two in terms of the available parameters or (b) reparameterize the Weibull to be in terms of the mean and
52,371
Weibull distribution from given mean
For simplicity, let's use the Weibull defined as the density whose distribution is: $$ \large F(x) = 1 - e^{-{\left(\frac{x}{\theta}\right)^\tau}} $$ Here $\theta$ is the scale and $\tau$ is the shape. This distribution has mean:$\;\theta\cdot\Gamma\left(1 + \frac{1}{\tau}\right)$ Which means (no pun intended) that the...
Weibull distribution from given mean
For simplicity, let's use the Weibull defined as the density whose distribution is: $$ \large F(x) = 1 - e^{-{\left(\frac{x}{\theta}\right)^\tau}} $$ Here $\theta$ is the scale and $\tau$ is the shape
Weibull distribution from given mean For simplicity, let's use the Weibull defined as the density whose distribution is: $$ \large F(x) = 1 - e^{-{\left(\frac{x}{\theta}\right)^\tau}} $$ Here $\theta$ is the scale and $\tau$ is the shape. This distribution has mean:$\;\theta\cdot\Gamma\left(1 + \frac{1}{\tau}\right)$ W...
Weibull distribution from given mean For simplicity, let's use the Weibull defined as the density whose distribution is: $$ \large F(x) = 1 - e^{-{\left(\frac{x}{\theta}\right)^\tau}} $$ Here $\theta$ is the scale and $\tau$ is the shape
52,372
Weibull distribution from given mean
What do you mean by "mean parameter"? Does it "location parameter"? Does your model look like this? Then also you get the same CDF as explained in here. Just replace 'x' by '(x-γ)'. Where 'γ' is the location parameter. Then proceed as before.
Weibull distribution from given mean
What do you mean by "mean parameter"? Does it "location parameter"? Does your model look like this? Then also you get the same CDF as explained in here. Just replace 'x' by '(x-γ)'. Where 'γ' is the l
Weibull distribution from given mean What do you mean by "mean parameter"? Does it "location parameter"? Does your model look like this? Then also you get the same CDF as explained in here. Just replace 'x' by '(x-γ)'. Where 'γ' is the location parameter. Then proceed as before.
Weibull distribution from given mean What do you mean by "mean parameter"? Does it "location parameter"? Does your model look like this? Then also you get the same CDF as explained in here. Just replace 'x' by '(x-γ)'. Where 'γ' is the l
52,373
Weibull distribution from given mean
Brute-force search can find these parameters easily. Here's my code (R): # Find the parameters of a Weibull distribution with a given mean and sd library(nloptr) objective_mean = 8.4 objective_sd = 3.8 objective = function(weibull_params) { scale = weibull_params[1] shape = weibull_params[2] weibull_mean = scale...
Weibull distribution from given mean
Brute-force search can find these parameters easily. Here's my code (R): # Find the parameters of a Weibull distribution with a given mean and sd library(nloptr) objective_mean = 8.4 objective_sd = 3
Weibull distribution from given mean Brute-force search can find these parameters easily. Here's my code (R): # Find the parameters of a Weibull distribution with a given mean and sd library(nloptr) objective_mean = 8.4 objective_sd = 3.8 objective = function(weibull_params) { scale = weibull_params[1] shape = wei...
Weibull distribution from given mean Brute-force search can find these parameters easily. Here's my code (R): # Find the parameters of a Weibull distribution with a given mean and sd library(nloptr) objective_mean = 8.4 objective_sd = 3
52,374
Which equal correlations of three random variables are possible? [duplicate]
Let $X_1$, $X_2$, $X_3$ be three random variables with common pairwise correlation coefficient $\rho$, that is $\mbox{corr}(X_i, X_j)= \rho$ for $i \neq j$ with $|\rho|\leq 1$. So, the correlation matrix of $X = (X_1, X_2, X_3)$ is $$ \left( \begin{array}{ccc} 1 & \rho & \rho \\ \rho & 1 & \rho \\ \rho & \rho & 1...
Which equal correlations of three random variables are possible? [duplicate]
Let $X_1$, $X_2$, $X_3$ be three random variables with common pairwise correlation coefficient $\rho$, that is $\mbox{corr}(X_i, X_j)= \rho$ for $i \neq j$ with $|\rho|\leq 1$. So, the correlation mat
Which equal correlations of three random variables are possible? [duplicate] Let $X_1$, $X_2$, $X_3$ be three random variables with common pairwise correlation coefficient $\rho$, that is $\mbox{corr}(X_i, X_j)= \rho$ for $i \neq j$ with $|\rho|\leq 1$. So, the correlation matrix of $X = (X_1, X_2, X_3)$ is $$ \left( \...
Which equal correlations of three random variables are possible? [duplicate] Let $X_1$, $X_2$, $X_3$ be three random variables with common pairwise correlation coefficient $\rho$, that is $\mbox{corr}(X_i, X_j)= \rho$ for $i \neq j$ with $|\rho|\leq 1$. So, the correlation mat
52,375
Which equal correlations of three random variables are possible? [duplicate]
Just a side note for the otherwise correct answers already given (+1 both). The correlation/covariance matrix described is compound symmetric. This has some rather important theoretical implication on how one interpreters a model; in particular one would assume that the co-variance of the variables examined can be perf...
Which equal correlations of three random variables are possible? [duplicate]
Just a side note for the otherwise correct answers already given (+1 both). The correlation/covariance matrix described is compound symmetric. This has some rather important theoretical implication on
Which equal correlations of three random variables are possible? [duplicate] Just a side note for the otherwise correct answers already given (+1 both). The correlation/covariance matrix described is compound symmetric. This has some rather important theoretical implication on how one interpreters a model; in particula...
Which equal correlations of three random variables are possible? [duplicate] Just a side note for the otherwise correct answers already given (+1 both). The correlation/covariance matrix described is compound symmetric. This has some rather important theoretical implication on
52,376
Any algorithms better than polynomial regression
Looks like a time series with very strong (and fairly regular) seasonality. If you use R, you might want to look at function stl(), or fit a basic structural model (an easy entry point function is StructTS(), otherwise there are several packages which afford you more generality and better control of the model you want ...
Any algorithms better than polynomial regression
Looks like a time series with very strong (and fairly regular) seasonality. If you use R, you might want to look at function stl(), or fit a basic structural model (an easy entry point function is Str
Any algorithms better than polynomial regression Looks like a time series with very strong (and fairly regular) seasonality. If you use R, you might want to look at function stl(), or fit a basic structural model (an easy entry point function is StructTS(), otherwise there are several packages which afford you more gen...
Any algorithms better than polynomial regression Looks like a time series with very strong (and fairly regular) seasonality. If you use R, you might want to look at function stl(), or fit a basic structural model (an easy entry point function is Str
52,377
Any algorithms better than polynomial regression
The answer is ARIMA models with Intervention Detection enabled. Intervention Detection will suggest level shifts/local time trends/seasonal pulses and pulses which are needed to aid the efficient identification/ robust identification of the ARIMA structure reflecting auto-regressive memory. Please post your data in col...
Any algorithms better than polynomial regression
The answer is ARIMA models with Intervention Detection enabled. Intervention Detection will suggest level shifts/local time trends/seasonal pulses and pulses which are needed to aid the efficient iden
Any algorithms better than polynomial regression The answer is ARIMA models with Intervention Detection enabled. Intervention Detection will suggest level shifts/local time trends/seasonal pulses and pulses which are needed to aid the efficient identification/ robust identification of the ARIMA structure reflecting aut...
Any algorithms better than polynomial regression The answer is ARIMA models with Intervention Detection enabled. Intervention Detection will suggest level shifts/local time trends/seasonal pulses and pulses which are needed to aid the efficient iden
52,378
Any algorithms better than polynomial regression
Think you have your answer. But would add that it may be useful to log your data. Then consider doing regular (d) and/or seasonal (D) differencing. The resultant series should be much easier to model. I'm not confident d/D is necessary, but some form of transformation likely is necessary. Hard to tell from graph, but ...
Any algorithms better than polynomial regression
Think you have your answer. But would add that it may be useful to log your data. Then consider doing regular (d) and/or seasonal (D) differencing. The resultant series should be much easier to model
Any algorithms better than polynomial regression Think you have your answer. But would add that it may be useful to log your data. Then consider doing regular (d) and/or seasonal (D) differencing. The resultant series should be much easier to model. I'm not confident d/D is necessary, but some form of transformation l...
Any algorithms better than polynomial regression Think you have your answer. But would add that it may be useful to log your data. Then consider doing regular (d) and/or seasonal (D) differencing. The resultant series should be much easier to model
52,379
How to extract dependence on a single variable when independent variables are correlated?
Aksakal's answer is correct. By controlling for all variables in a regression, you "keep them constant" and you are able to identify the partial correlation between your regressor of interest. Let me give you an example to make this clearer. First, let us create some correlated $X$s. ex <- rnorm(1000) x1 <- 5*ex + r...
How to extract dependence on a single variable when independent variables are correlated?
Aksakal's answer is correct. By controlling for all variables in a regression, you "keep them constant" and you are able to identify the partial correlation between your regressor of interest. Let me
How to extract dependence on a single variable when independent variables are correlated? Aksakal's answer is correct. By controlling for all variables in a regression, you "keep them constant" and you are able to identify the partial correlation between your regressor of interest. Let me give you an example to make th...
How to extract dependence on a single variable when independent variables are correlated? Aksakal's answer is correct. By controlling for all variables in a regression, you "keep them constant" and you are able to identify the partial correlation between your regressor of interest. Let me
52,380
How to extract dependence on a single variable when independent variables are correlated?
Regress Y on Xs, beta of X2 will be what you are looking for. UPDATE: I'll add to my answer based on the discussion after my original post. Consider $y=f(x_1,x_2,x_3)$, an arbitrary smooth function. It seems that you are looking for the sensitivity of $y$ to $x_2$. This is captured by the partial derivative $\partial y...
How to extract dependence on a single variable when independent variables are correlated?
Regress Y on Xs, beta of X2 will be what you are looking for. UPDATE: I'll add to my answer based on the discussion after my original post. Consider $y=f(x_1,x_2,x_3)$, an arbitrary smooth function. I
How to extract dependence on a single variable when independent variables are correlated? Regress Y on Xs, beta of X2 will be what you are looking for. UPDATE: I'll add to my answer based on the discussion after my original post. Consider $y=f(x_1,x_2,x_3)$, an arbitrary smooth function. It seems that you are looking f...
How to extract dependence on a single variable when independent variables are correlated? Regress Y on Xs, beta of X2 will be what you are looking for. UPDATE: I'll add to my answer based on the discussion after my original post. Consider $y=f(x_1,x_2,x_3)$, an arbitrary smooth function. I
52,381
How to extract dependence on a single variable when independent variables are correlated?
Primary to your concern should be whether the model of $Y$ given all $X$ is correct. If it is correct, the $\beta$ of $X_2$ is the effect coefficient you are looking for. Take into account that there may be non-linear trends on any $X$ with $Y$, $Y$ may not be normal (in which case you need a large sample), and there m...
How to extract dependence on a single variable when independent variables are correlated?
Primary to your concern should be whether the model of $Y$ given all $X$ is correct. If it is correct, the $\beta$ of $X_2$ is the effect coefficient you are looking for. Take into account that there
How to extract dependence on a single variable when independent variables are correlated? Primary to your concern should be whether the model of $Y$ given all $X$ is correct. If it is correct, the $\beta$ of $X_2$ is the effect coefficient you are looking for. Take into account that there may be non-linear trends on an...
How to extract dependence on a single variable when independent variables are correlated? Primary to your concern should be whether the model of $Y$ given all $X$ is correct. If it is correct, the $\beta$ of $X_2$ is the effect coefficient you are looking for. Take into account that there
52,382
Q-Value Less than P-Value
Yes, this is possible, if the proportion of null hypotheses (which is estimated by the qvalue package based on your p-value distribution) is small and your test is powerful. Here's an example. Let's say you're testing 1000 hypotheses, and let's say 200 (20%) are actually null- this proportion is called $\pi_0$. Assume ...
Q-Value Less than P-Value
Yes, this is possible, if the proportion of null hypotheses (which is estimated by the qvalue package based on your p-value distribution) is small and your test is powerful. Here's an example. Let's s
Q-Value Less than P-Value Yes, this is possible, if the proportion of null hypotheses (which is estimated by the qvalue package based on your p-value distribution) is small and your test is powerful. Here's an example. Let's say you're testing 1000 hypotheses, and let's say 200 (20%) are actually null- this proportion ...
Q-Value Less than P-Value Yes, this is possible, if the proportion of null hypotheses (which is estimated by the qvalue package based on your p-value distribution) is small and your test is powerful. Here's an example. Let's s
52,383
Q-Value Less than P-Value
You do not compute the false discovery rate, you control the false discovery rate. Family-wise error rate methods (e.g. Bonferroni, Holm-Sidák, etc.) attempt to control the probability of making a false rejection of H$_{0}$ while assuming that all null hypotheses are true. False discovery rate methods attempt to contro...
Q-Value Less than P-Value
You do not compute the false discovery rate, you control the false discovery rate. Family-wise error rate methods (e.g. Bonferroni, Holm-Sidák, etc.) attempt to control the probability of making a fal
Q-Value Less than P-Value You do not compute the false discovery rate, you control the false discovery rate. Family-wise error rate methods (e.g. Bonferroni, Holm-Sidák, etc.) attempt to control the probability of making a false rejection of H$_{0}$ while assuming that all null hypotheses are true. False discovery rate...
Q-Value Less than P-Value You do not compute the false discovery rate, you control the false discovery rate. Family-wise error rate methods (e.g. Bonferroni, Holm-Sidák, etc.) attempt to control the probability of making a fal
52,384
Does R have post hoc tests robust to unequal sample sizes/population variances?
Robustness would not come from the package used to do post hoc tests. It would come from the model upon which they are based. If you were to use, for example, nlme::gls() to model the data, that would allow for unequal variances and accommodate unbalanced data. Then, following that up with multcomp::glht() or lsmeans:...
Does R have post hoc tests robust to unequal sample sizes/population variances?
Robustness would not come from the package used to do post hoc tests. It would come from the model upon which they are based. If you were to use, for example, nlme::gls() to model the data, that woul
Does R have post hoc tests robust to unequal sample sizes/population variances? Robustness would not come from the package used to do post hoc tests. It would come from the model upon which they are based. If you were to use, for example, nlme::gls() to model the data, that would allow for unequal variances and accomm...
Does R have post hoc tests robust to unequal sample sizes/population variances? Robustness would not come from the package used to do post hoc tests. It would come from the model upon which they are based. If you were to use, for example, nlme::gls() to model the data, that woul
52,385
Does R have post hoc tests robust to unequal sample sizes/population variances?
It's not been added to R, because no one thought it was important enough to add to R. SPSS seems to have taken a scattergun approach to post hoc tests - they've just kept adding them. Stuff that appears in (say) SPSS is based on marketing, rather than need. SPSS thinks that they can say "We have more post hoc tests tha...
Does R have post hoc tests robust to unequal sample sizes/population variances?
It's not been added to R, because no one thought it was important enough to add to R. SPSS seems to have taken a scattergun approach to post hoc tests - they've just kept adding them. Stuff that appea
Does R have post hoc tests robust to unequal sample sizes/population variances? It's not been added to R, because no one thought it was important enough to add to R. SPSS seems to have taken a scattergun approach to post hoc tests - they've just kept adding them. Stuff that appears in (say) SPSS is based on marketing, ...
Does R have post hoc tests robust to unequal sample sizes/population variances? It's not been added to R, because no one thought it was important enough to add to R. SPSS seems to have taken a scattergun approach to post hoc tests - they've just kept adding them. Stuff that appea
52,386
Does R have post hoc tests robust to unequal sample sizes/population variances?
'DTK' package in R has Dunnett’s Modified Tukey-Kramer Pairwise Multiple Comparison Test.
Does R have post hoc tests robust to unequal sample sizes/population variances?
'DTK' package in R has Dunnett’s Modified Tukey-Kramer Pairwise Multiple Comparison Test.
Does R have post hoc tests robust to unequal sample sizes/population variances? 'DTK' package in R has Dunnett’s Modified Tukey-Kramer Pairwise Multiple Comparison Test.
Does R have post hoc tests robust to unequal sample sizes/population variances? 'DTK' package in R has Dunnett’s Modified Tukey-Kramer Pairwise Multiple Comparison Test.
52,387
Good references for time series?
I don't know of a single time series book that is as comprehensive as Elements of Statistical Learning. However, here's a list of a few books that i've found helpful: Free online. More of a forecasting focus, but definitely a good starting point. The slides under resources are also helpful: Hyndman, R. J., & Athanasop...
Good references for time series?
I don't know of a single time series book that is as comprehensive as Elements of Statistical Learning. However, here's a list of a few books that i've found helpful: Free online. More of a forecastin
Good references for time series? I don't know of a single time series book that is as comprehensive as Elements of Statistical Learning. However, here's a list of a few books that i've found helpful: Free online. More of a forecasting focus, but definitely a good starting point. The slides under resources are also help...
Good references for time series? I don't know of a single time series book that is as comprehensive as Elements of Statistical Learning. However, here's a list of a few books that i've found helpful: Free online. More of a forecastin
52,388
Good references for time series?
Brockwell and Davis wrote two excellent time series books. Both cover a great deal of material and the writing is very clear. The first book is more introductory, and the second one has a more mathematical development. http://www.amazon.com/Introduction-Forecasting-Springer-Texts-Statistics/dp/0387953515/ http://www.a...
Good references for time series?
Brockwell and Davis wrote two excellent time series books. Both cover a great deal of material and the writing is very clear. The first book is more introductory, and the second one has a more mathema
Good references for time series? Brockwell and Davis wrote two excellent time series books. Both cover a great deal of material and the writing is very clear. The first book is more introductory, and the second one has a more mathematical development. http://www.amazon.com/Introduction-Forecasting-Springer-Texts-Stati...
Good references for time series? Brockwell and Davis wrote two excellent time series books. Both cover a great deal of material and the writing is very clear. The first book is more introductory, and the second one has a more mathema
52,389
Good references for time series?
I don't know about the 'ESL' or machine learning, but what about good ol' Tsay? Some parts you mentioned are included, some not (e.g. Kalman filter): Analysis of Financial Time Series by Ruey S. Tsay When it comes to times series with applications and an easy-to-understand way of explaining he is my Tom Cruise, my to...
Good references for time series?
I don't know about the 'ESL' or machine learning, but what about good ol' Tsay? Some parts you mentioned are included, some not (e.g. Kalman filter): Analysis of Financial Time Series by Ruey S. Tsay
Good references for time series? I don't know about the 'ESL' or machine learning, but what about good ol' Tsay? Some parts you mentioned are included, some not (e.g. Kalman filter): Analysis of Financial Time Series by Ruey S. Tsay When it comes to times series with applications and an easy-to-understand way of expl...
Good references for time series? I don't know about the 'ESL' or machine learning, but what about good ol' Tsay? Some parts you mentioned are included, some not (e.g. Kalman filter): Analysis of Financial Time Series by Ruey S. Tsay
52,390
Good references for time series?
ESL is not for time series in my opinion. Tsay's book in addition to Cowpertwait's intro level book are the best combination.
Good references for time series?
ESL is not for time series in my opinion. Tsay's book in addition to Cowpertwait's intro level book are the best combination.
Good references for time series? ESL is not for time series in my opinion. Tsay's book in addition to Cowpertwait's intro level book are the best combination.
Good references for time series? ESL is not for time series in my opinion. Tsay's book in addition to Cowpertwait's intro level book are the best combination.
52,391
Good references for time series?
Have a look at James D. Hamilton. Time Series Analysis. Princeton Univ. Press, Princeton, N.J, 1994. It is very thorough. I'm not sure about neural networks and "all" exponential smoothing, but the rest is in there.
Good references for time series?
Have a look at James D. Hamilton. Time Series Analysis. Princeton Univ. Press, Princeton, N.J, 1994. It is very thorough. I'm not sure about neural networks and "all" exponential smoothing, but the
Good references for time series? Have a look at James D. Hamilton. Time Series Analysis. Princeton Univ. Press, Princeton, N.J, 1994. It is very thorough. I'm not sure about neural networks and "all" exponential smoothing, but the rest is in there.
Good references for time series? Have a look at James D. Hamilton. Time Series Analysis. Princeton Univ. Press, Princeton, N.J, 1994. It is very thorough. I'm not sure about neural networks and "all" exponential smoothing, but the
52,392
Good references for time series?
Here is a good list of books on time series analysis. Note that there is a lot of difference amongst books that cater to people of different backgrounds (economists/engineers/statisticians). hth
Good references for time series?
Here is a good list of books on time series analysis. Note that there is a lot of difference amongst books that cater to people of different backgrounds (economists/engineers/statisticians). hth
Good references for time series? Here is a good list of books on time series analysis. Note that there is a lot of difference amongst books that cater to people of different backgrounds (economists/engineers/statisticians). hth
Good references for time series? Here is a good list of books on time series analysis. Note that there is a lot of difference amongst books that cater to people of different backgrounds (economists/engineers/statisticians). hth
52,393
Why such a poor result from sparse PCA R package?
nsprcomp computes the scores matrix Z (rst$x in your example) as $Z=XW$, where $X$ is the data matrix (prod in your example) and $W$ is the matrix of principal axes (rst$rotation in your example). This is in accordance with standard PCA and the predict.prcomp interface. However, non-negative sparse PCA usually results ...
Why such a poor result from sparse PCA R package?
nsprcomp computes the scores matrix Z (rst$x in your example) as $Z=XW$, where $X$ is the data matrix (prod in your example) and $W$ is the matrix of principal axes (rst$rotation in your example). Thi
Why such a poor result from sparse PCA R package? nsprcomp computes the scores matrix Z (rst$x in your example) as $Z=XW$, where $X$ is the data matrix (prod in your example) and $W$ is the matrix of principal axes (rst$rotation in your example). This is in accordance with standard PCA and the predict.prcomp interface....
Why such a poor result from sparse PCA R package? nsprcomp computes the scores matrix Z (rst$x in your example) as $Z=XW$, where $X$ is the data matrix (prod in your example) and $W$ is the matrix of principal axes (rst$rotation in your example). Thi
52,394
Why such a poor result from sparse PCA R package?
Your code looks OK for the reconstruction, but this does not seem to be appropriate when the argument nneg=TRUE ("a logical value indicating whether the principal axes should be constrained to the non-negative orthant"). When this argument is set to FALSE, then the reconstruction works in the typical way: rst.f = nsprc...
Why such a poor result from sparse PCA R package?
Your code looks OK for the reconstruction, but this does not seem to be appropriate when the argument nneg=TRUE ("a logical value indicating whether the principal axes should be constrained to the non
Why such a poor result from sparse PCA R package? Your code looks OK for the reconstruction, but this does not seem to be appropriate when the argument nneg=TRUE ("a logical value indicating whether the principal axes should be constrained to the non-negative orthant"). When this argument is set to FALSE, then the reco...
Why such a poor result from sparse PCA R package? Your code looks OK for the reconstruction, but this does not seem to be appropriate when the argument nneg=TRUE ("a logical value indicating whether the principal axes should be constrained to the non
52,395
Postive correlation but negative coefficient in regression [duplicate]
The interpretation of the post.count coefficient is that it gives the relationship with the response variable, all other factors being held constant. What can be happening is that the marginal effect of post.count is being taken up by one or more of the other variables (let's say building.count for definiteness). As bu...
Postive correlation but negative coefficient in regression [duplicate]
The interpretation of the post.count coefficient is that it gives the relationship with the response variable, all other factors being held constant. What can be happening is that the marginal effect
Postive correlation but negative coefficient in regression [duplicate] The interpretation of the post.count coefficient is that it gives the relationship with the response variable, all other factors being held constant. What can be happening is that the marginal effect of post.count is being taken up by one or more of...
Postive correlation but negative coefficient in regression [duplicate] The interpretation of the post.count coefficient is that it gives the relationship with the response variable, all other factors being held constant. What can be happening is that the marginal effect
52,396
Postive correlation but negative coefficient in regression [duplicate]
That is a possible and common error. The regression gives coefficients while controlling for the other variables. Simple correlation coefficients do not control for the other variables and,therefore, can give false relationships. See the chart below from a previous thread for a visual. Variables are negative correlate...
Postive correlation but negative coefficient in regression [duplicate]
That is a possible and common error. The regression gives coefficients while controlling for the other variables. Simple correlation coefficients do not control for the other variables and,therefore,
Postive correlation but negative coefficient in regression [duplicate] That is a possible and common error. The regression gives coefficients while controlling for the other variables. Simple correlation coefficients do not control for the other variables and,therefore, can give false relationships. See the chart belo...
Postive correlation but negative coefficient in regression [duplicate] That is a possible and common error. The regression gives coefficients while controlling for the other variables. Simple correlation coefficients do not control for the other variables and,therefore,
52,397
SVM has relatively low classification rate for high-dimensional data even though 2-D projections show they are separable
I didn't see anything wrong with the results you had. As others pointed out already, you are facing a typical $P \gg N$ situation, where the number of predictors, i.e., features, is much greater than the number of instances. In this situation, SVM is generally a good choice, as its maximum margin property gives some gu...
SVM has relatively low classification rate for high-dimensional data even though 2-D projections sho
I didn't see anything wrong with the results you had. As others pointed out already, you are facing a typical $P \gg N$ situation, where the number of predictors, i.e., features, is much greater than
SVM has relatively low classification rate for high-dimensional data even though 2-D projections show they are separable I didn't see anything wrong with the results you had. As others pointed out already, you are facing a typical $P \gg N$ situation, where the number of predictors, i.e., features, is much greater than...
SVM has relatively low classification rate for high-dimensional data even though 2-D projections sho I didn't see anything wrong with the results you had. As others pointed out already, you are facing a typical $P \gg N$ situation, where the number of predictors, i.e., features, is much greater than
52,398
SVM has relatively low classification rate for high-dimensional data even though 2-D projections show they are separable
From Gaussian Processes for Machine Learning by Rasmussen: In a feature space of dimension $N$, if $N > n$ then there will always be a separating hyperplane. However this hyperplane may not give rise to good generalization performance, especially if some of the labels are incorrect. That is, if you have more dimensio...
SVM has relatively low classification rate for high-dimensional data even though 2-D projections sho
From Gaussian Processes for Machine Learning by Rasmussen: In a feature space of dimension $N$, if $N > n$ then there will always be a separating hyperplane. However this hyperplane may not give rise
SVM has relatively low classification rate for high-dimensional data even though 2-D projections show they are separable From Gaussian Processes for Machine Learning by Rasmussen: In a feature space of dimension $N$, if $N > n$ then there will always be a separating hyperplane. However this hyperplane may not give ris...
SVM has relatively low classification rate for high-dimensional data even though 2-D projections sho From Gaussian Processes for Machine Learning by Rasmussen: In a feature space of dimension $N$, if $N > n$ then there will always be a separating hyperplane. However this hyperplane may not give rise
52,399
SVM has relatively low classification rate for high-dimensional data even though 2-D projections show they are separable
When there are more features than patterns, a linear kernel is generally a good idea as the other answers suggest (+1), however the really important thing to do then is to set the regularisation parameter (C) carefully (using e.g. cross-validation). It is largely the regularisation of support vector machines that give...
SVM has relatively low classification rate for high-dimensional data even though 2-D projections sho
When there are more features than patterns, a linear kernel is generally a good idea as the other answers suggest (+1), however the really important thing to do then is to set the regularisation param
SVM has relatively low classification rate for high-dimensional data even though 2-D projections show they are separable When there are more features than patterns, a linear kernel is generally a good idea as the other answers suggest (+1), however the really important thing to do then is to set the regularisation para...
SVM has relatively low classification rate for high-dimensional data even though 2-D projections sho When there are more features than patterns, a linear kernel is generally a good idea as the other answers suggest (+1), however the really important thing to do then is to set the regularisation param
52,400
Confidence bands in case of fitting ARIMA in R?
Use acf from the stats package (or Acf from the forecast package) with ci.type="ma". Note that some people use the simpler approximation all the time - it's just to give an idea what models might be worth considering so accuracy isn't so important. Bartlett's approximation (the one you quote from Wikipedia) is only rel...
Confidence bands in case of fitting ARIMA in R?
Use acf from the stats package (or Acf from the forecast package) with ci.type="ma". Note that some people use the simpler approximation all the time - it's just to give an idea what models might be w
Confidence bands in case of fitting ARIMA in R? Use acf from the stats package (or Acf from the forecast package) with ci.type="ma". Note that some people use the simpler approximation all the time - it's just to give an idea what models might be worth considering so accuracy isn't so important. Bartlett's approximatio...
Confidence bands in case of fitting ARIMA in R? Use acf from the stats package (or Acf from the forecast package) with ci.type="ma". Note that some people use the simpler approximation all the time - it's just to give an idea what models might be w