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
43,601
Location test under a bounded non-stationarity?
Ok, I've thought of two possible ways to answer to this problem using Bayesian analysis. I will assume $\sigma$ to be known throughout this answer. First start with a "baby" case, where $n=2$ (or alternatively, only using the last two observations as a first approximation). You would usually start this by assuming a "flat" prior for $\mu$, just proportion to 1. But you have additional information, so we just restrict the prior to conform to this. So the prior is: $$f(\mu_1,\mu_2|\gamma) \propto I_{|\mu_1-\mu_2|\leq\gamma}$$ (the improper prior should be fine, because you are dealing with normal RVs, and you aren't dividing them) Combining this prior with the likelihood, and integrating out $\mu_1$ gives (Writing $\phi(x)$ as standard normal pdf and $\Phi(x)$ as standard normal cdf): $$f(\mu_2 | X_1,X_2,\sigma,\gamma) \propto \phi\big(\frac{\mu_2-X_2}{\sigma}\big) \Bigg[\Phi\Big(\frac{\mu_2-X_1+\gamma}{\sigma}\Big)-\Phi\Big(\frac{\mu_2-X_1-\gamma}{\sigma}\Big)\Bigg]$$ So in order to calculate the "p-value" for the hypothesis, we need to take $Pr(\mu_2 > 0 |X_1,X_2,\sigma,\gamma)=P$. This is given by the ratio of two integrals of the posterior: $$P=\frac{\int_{-\frac{X_2}{\sigma}}^{\infty}\phi\big(y\big) \Bigg[\Phi\Big(y+\frac{X_2-X_1+\gamma}{\sigma}\Big)-\Phi\Big(y+\frac{X_2-X_1-\gamma}{\sigma}\Big)\Bigg]dy}{\int_{-\infty}^{\infty}\phi\big(z\big) \Bigg[\Phi\Big(z+\frac{X_2-X_1+\gamma}{\sigma}\Big)-\Phi\Big(z+\frac{X_2-X_1-\gamma}{\sigma}\Big)\Bigg]dz}$$ It is beyond my abilities to do either of these integrals exactly, and even if it was possible, you probably would learn anything intuitive about the problem (except that the integral was friggin hard! you'd think it could be derived using something to do with convolutions, but I couldn't work it out). So I would just numerically evaluate these two integrals. For the whole data set, you will almost surely need some kind of numerical technique, or analytic approximation. This is a rather quick numerical technique. Okay, so it basically goes like this: if you knew $\mu_1$, then you could generate a sample of the remaining $\mu_i$ values sequentially, using the uniform distribution $(\mu_{i}|\mu_{i-1}) \sim U(\mu_{i-1}-\gamma,\mu_{i-1}+\gamma)$. An obvious way to sample $\mu_1$ is from a gaussian with large variance $\mu_1 \sim N(0,\delta^2)$ ("large" meaning relative to your data, say $\delta\approx 10\sigma$). Use the notation $\mu_{i}^{(b)}$ for the $b$th sample of means $b=1,\dots,B$. Now you calculate the total likelihood for each iteration. This will be used as a weight: $$w^{(b)}=\prod_{i=1}^{n} \phi \Big(\frac{\mu_{i}^{(b)}-X_i}{\sigma}\Big)$$ Then you take a "weighted probability" of the alternative hypothesis: $$\hat{P}=\frac{\sum_{b=1}^{B}w^{(b)} I(\mu_{n}^{(b)}>0)}{\sum_{b=1}^{B}w^{(b)}}$$ If $P$ is too big (in either case), then you reject the null hypothesis. A standard value would be $P>0.95$.
Location test under a bounded non-stationarity?
Ok, I've thought of two possible ways to answer to this problem using Bayesian analysis. I will assume $\sigma$ to be known throughout this answer. First start with a "baby" case, where $n=2$ (or al
Location test under a bounded non-stationarity? Ok, I've thought of two possible ways to answer to this problem using Bayesian analysis. I will assume $\sigma$ to be known throughout this answer. First start with a "baby" case, where $n=2$ (or alternatively, only using the last two observations as a first approximation). You would usually start this by assuming a "flat" prior for $\mu$, just proportion to 1. But you have additional information, so we just restrict the prior to conform to this. So the prior is: $$f(\mu_1,\mu_2|\gamma) \propto I_{|\mu_1-\mu_2|\leq\gamma}$$ (the improper prior should be fine, because you are dealing with normal RVs, and you aren't dividing them) Combining this prior with the likelihood, and integrating out $\mu_1$ gives (Writing $\phi(x)$ as standard normal pdf and $\Phi(x)$ as standard normal cdf): $$f(\mu_2 | X_1,X_2,\sigma,\gamma) \propto \phi\big(\frac{\mu_2-X_2}{\sigma}\big) \Bigg[\Phi\Big(\frac{\mu_2-X_1+\gamma}{\sigma}\Big)-\Phi\Big(\frac{\mu_2-X_1-\gamma}{\sigma}\Big)\Bigg]$$ So in order to calculate the "p-value" for the hypothesis, we need to take $Pr(\mu_2 > 0 |X_1,X_2,\sigma,\gamma)=P$. This is given by the ratio of two integrals of the posterior: $$P=\frac{\int_{-\frac{X_2}{\sigma}}^{\infty}\phi\big(y\big) \Bigg[\Phi\Big(y+\frac{X_2-X_1+\gamma}{\sigma}\Big)-\Phi\Big(y+\frac{X_2-X_1-\gamma}{\sigma}\Big)\Bigg]dy}{\int_{-\infty}^{\infty}\phi\big(z\big) \Bigg[\Phi\Big(z+\frac{X_2-X_1+\gamma}{\sigma}\Big)-\Phi\Big(z+\frac{X_2-X_1-\gamma}{\sigma}\Big)\Bigg]dz}$$ It is beyond my abilities to do either of these integrals exactly, and even if it was possible, you probably would learn anything intuitive about the problem (except that the integral was friggin hard! you'd think it could be derived using something to do with convolutions, but I couldn't work it out). So I would just numerically evaluate these two integrals. For the whole data set, you will almost surely need some kind of numerical technique, or analytic approximation. This is a rather quick numerical technique. Okay, so it basically goes like this: if you knew $\mu_1$, then you could generate a sample of the remaining $\mu_i$ values sequentially, using the uniform distribution $(\mu_{i}|\mu_{i-1}) \sim U(\mu_{i-1}-\gamma,\mu_{i-1}+\gamma)$. An obvious way to sample $\mu_1$ is from a gaussian with large variance $\mu_1 \sim N(0,\delta^2)$ ("large" meaning relative to your data, say $\delta\approx 10\sigma$). Use the notation $\mu_{i}^{(b)}$ for the $b$th sample of means $b=1,\dots,B$. Now you calculate the total likelihood for each iteration. This will be used as a weight: $$w^{(b)}=\prod_{i=1}^{n} \phi \Big(\frac{\mu_{i}^{(b)}-X_i}{\sigma}\Big)$$ Then you take a "weighted probability" of the alternative hypothesis: $$\hat{P}=\frac{\sum_{b=1}^{B}w^{(b)} I(\mu_{n}^{(b)}>0)}{\sum_{b=1}^{B}w^{(b)}}$$ If $P$ is too big (in either case), then you reject the null hypothesis. A standard value would be $P>0.95$.
Location test under a bounded non-stationarity? Ok, I've thought of two possible ways to answer to this problem using Bayesian analysis. I will assume $\sigma$ to be known throughout this answer. First start with a "baby" case, where $n=2$ (or al
43,602
cforest and randomForest classification prediction error
Could it be your value for the mtry parameter in cforest? With it set to 8, you're using bagging. Set it to mtry=3 and see how it compares to the randomForest algorithm
cforest and randomForest classification prediction error
Could it be your value for the mtry parameter in cforest? With it set to 8, you're using bagging. Set it to mtry=3 and see how it compares to the randomForest algorithm
cforest and randomForest classification prediction error Could it be your value for the mtry parameter in cforest? With it set to 8, you're using bagging. Set it to mtry=3 and see how it compares to the randomForest algorithm
cforest and randomForest classification prediction error Could it be your value for the mtry parameter in cforest? With it set to 8, you're using bagging. Set it to mtry=3 and see how it compares to the randomForest algorithm
43,603
cforest and randomForest classification prediction error
There are differences in implementations of randomForest and cforest, mainly in how predictions are computed from the forests. The differences are discussed in http://www.jstatsoft.org/v50/i11/paper which provides a framework for comparing errors in survival forests.
cforest and randomForest classification prediction error
There are differences in implementations of randomForest and cforest, mainly in how predictions are computed from the forests. The differences are discussed in http://www.jstatsoft.org/v50/i11/paper
cforest and randomForest classification prediction error There are differences in implementations of randomForest and cforest, mainly in how predictions are computed from the forests. The differences are discussed in http://www.jstatsoft.org/v50/i11/paper which provides a framework for comparing errors in survival forests.
cforest and randomForest classification prediction error There are differences in implementations of randomForest and cforest, mainly in how predictions are computed from the forests. The differences are discussed in http://www.jstatsoft.org/v50/i11/paper
43,604
Conducting planned comparisons in mixed model using lmer
It sounds like you basically have a problem of model choice. I think this is best treated as a decision problem. You want to act as if the final model you select is the true model, so that you can make conclusions about your data. So in decision theory, you need to specify a loss function, which says how you are going to rank each model, and a set of alternative models which you are going to decide between. See here and here for a decision theoretical approach to hypothesis testing in inference. And here is one which uses a decision theory approach to choose a model. It sounds like you want to use the p-value as your loss function (because that's how you want to compare the models). So if this is your criterion, then you pick the model with the smallest p-value. But the criterion needs to apply to something which the models have in common, an "obvious" choice based on a statistic which measures how well the model fits the data. One example is the sum of squared errors for predicting a new set of observations which were not included in the model fitting (based on the idea that a "good" model should reproduce the data it is supposed to be describing). So, what you can do is, for each model: 1) randomly split your data into two parts, a "model part" big enough for your model, and a "test" part to check predictions (which particular partition should not matter if the model is a good model). The "model" set is usually larger than the "test" set (at least 10 times larger, depending on how much data you have) 2) Fit the model to the "model data", and then use it to predict the "test" data. 3) Calculate the sum of squared error for prediction in the "test" data. 4) repeat 1-3 as many times as you feel necessary for your data (just in case you did a "bad" or "unlucky" partition), and take the average of the sum of squared error value in step 3). It does seem as though you have already defined a class of alternative models that you are willing to consider. Just a side note: Any procedure that you use to select the model, should go into step 1, including "automatic" model selection procedures. This way you properly account for the "multiple comparisons" that the automatic procedure does. Unfortunately, you need to have an alternative (maybe one is "foward selection" one is "forward stepwise" one is "backward selection", etc.). To "keep things fair" you could keep the same set of partitions for all models.
Conducting planned comparisons in mixed model using lmer
It sounds like you basically have a problem of model choice. I think this is best treated as a decision problem. You want to act as if the final model you select is the true model, so that you can m
Conducting planned comparisons in mixed model using lmer It sounds like you basically have a problem of model choice. I think this is best treated as a decision problem. You want to act as if the final model you select is the true model, so that you can make conclusions about your data. So in decision theory, you need to specify a loss function, which says how you are going to rank each model, and a set of alternative models which you are going to decide between. See here and here for a decision theoretical approach to hypothesis testing in inference. And here is one which uses a decision theory approach to choose a model. It sounds like you want to use the p-value as your loss function (because that's how you want to compare the models). So if this is your criterion, then you pick the model with the smallest p-value. But the criterion needs to apply to something which the models have in common, an "obvious" choice based on a statistic which measures how well the model fits the data. One example is the sum of squared errors for predicting a new set of observations which were not included in the model fitting (based on the idea that a "good" model should reproduce the data it is supposed to be describing). So, what you can do is, for each model: 1) randomly split your data into two parts, a "model part" big enough for your model, and a "test" part to check predictions (which particular partition should not matter if the model is a good model). The "model" set is usually larger than the "test" set (at least 10 times larger, depending on how much data you have) 2) Fit the model to the "model data", and then use it to predict the "test" data. 3) Calculate the sum of squared error for prediction in the "test" data. 4) repeat 1-3 as many times as you feel necessary for your data (just in case you did a "bad" or "unlucky" partition), and take the average of the sum of squared error value in step 3). It does seem as though you have already defined a class of alternative models that you are willing to consider. Just a side note: Any procedure that you use to select the model, should go into step 1, including "automatic" model selection procedures. This way you properly account for the "multiple comparisons" that the automatic procedure does. Unfortunately, you need to have an alternative (maybe one is "foward selection" one is "forward stepwise" one is "backward selection", etc.). To "keep things fair" you could keep the same set of partitions for all models.
Conducting planned comparisons in mixed model using lmer It sounds like you basically have a problem of model choice. I think this is best treated as a decision problem. You want to act as if the final model you select is the true model, so that you can m
43,605
Comparing model fits across a set of nonlinear regression models
For each participant, compute the cross-validated (leave one out) prediction error per functional form and assign the participant the form with the smallest one. That should do something to keep the overfitting under control. That approach ignores higher level problem structure: the population has groups that are assumed to share a functional form, so data from one participant with the a particular form is potentially useful for estimating the parameters of another with the same form. But it's a start, if not a finish, for the analysis.
Comparing model fits across a set of nonlinear regression models
For each participant, compute the cross-validated (leave one out) prediction error per functional form and assign the participant the form with the smallest one. That should do something to keep the
Comparing model fits across a set of nonlinear regression models For each participant, compute the cross-validated (leave one out) prediction error per functional form and assign the participant the form with the smallest one. That should do something to keep the overfitting under control. That approach ignores higher level problem structure: the population has groups that are assumed to share a functional form, so data from one participant with the a particular form is potentially useful for estimating the parameters of another with the same form. But it's a start, if not a finish, for the analysis.
Comparing model fits across a set of nonlinear regression models For each participant, compute the cross-validated (leave one out) prediction error per functional form and assign the participant the form with the smallest one. That should do something to keep the
43,606
Posterior consistency for scale-mixture shrinkage priors in low dimension?
Based on your reference I believe that you are estimating the vector $\boldsymbol{\beta}$ of size $p_n$ with a posterior distribution based on the observation of the vector $\mathbf{Y}$ of size $n$ in the model $$\mathbf{Y} = \mathbf{X} \boldsymbol{\beta} + \boldsymbol{\epsilon}$$ where $\mathbf{X}$ is a fixed regression matrix $n \times p_n$ matrix. The components $\beta_i$ from the vector $\boldsymbol{\beta}$ have a prior distribution that follows the model that you described. If you have a fixed $p$ then consistency seems guaranteed by a Bayesian law of large numbers, or consistency of likelihood/posterior for an i.i.d sample (When do posteriors converge to a point mass?). Or maybe I am missing something? Say we use some fixed $p$ while letting $n$ increase, then the Bayesian posterior density $f(\boldsymbol{\beta}|\mathbf{Y})$ will concentrate near the true $\boldsymbol{\beta}$ (if the prior is not zero). The same is true when $p$ is not fixed, but still with a finite upper bound. We can consider all $p$'s below the bound together while letting $n \to \infty$ and if they are all individually consistent, then we will also have consistency when we change $p$ while letting $n$ increase.
Posterior consistency for scale-mixture shrinkage priors in low dimension?
Based on your reference I believe that you are estimating the vector $\boldsymbol{\beta}$ of size $p_n$ with a posterior distribution based on the observation of the vector $\mathbf{Y}$ of size $n$ in
Posterior consistency for scale-mixture shrinkage priors in low dimension? Based on your reference I believe that you are estimating the vector $\boldsymbol{\beta}$ of size $p_n$ with a posterior distribution based on the observation of the vector $\mathbf{Y}$ of size $n$ in the model $$\mathbf{Y} = \mathbf{X} \boldsymbol{\beta} + \boldsymbol{\epsilon}$$ where $\mathbf{X}$ is a fixed regression matrix $n \times p_n$ matrix. The components $\beta_i$ from the vector $\boldsymbol{\beta}$ have a prior distribution that follows the model that you described. If you have a fixed $p$ then consistency seems guaranteed by a Bayesian law of large numbers, or consistency of likelihood/posterior for an i.i.d sample (When do posteriors converge to a point mass?). Or maybe I am missing something? Say we use some fixed $p$ while letting $n$ increase, then the Bayesian posterior density $f(\boldsymbol{\beta}|\mathbf{Y})$ will concentrate near the true $\boldsymbol{\beta}$ (if the prior is not zero). The same is true when $p$ is not fixed, but still with a finite upper bound. We can consider all $p$'s below the bound together while letting $n \to \infty$ and if they are all individually consistent, then we will also have consistency when we change $p$ while letting $n$ increase.
Posterior consistency for scale-mixture shrinkage priors in low dimension? Based on your reference I believe that you are estimating the vector $\boldsymbol{\beta}$ of size $p_n$ with a posterior distribution based on the observation of the vector $\mathbf{Y}$ of size $n$ in
43,607
z-score VS min-max normalization
The answer to your specific question about why z-score normalisation handles outliers better is largely to do with how standard deviations are calculated in the first place. If there are outliers, then the effect that the deviation from the mean related to those outliers will have on the final statistic (i.e, the standard deviation; the same value that will be used to normalise the feature) will be mitigated by the rest of the deviations within that same feature. In short, standard deviation is an aggregated calculation so individual values will carry less weight with the more observations there are. Conversely with min-max scaling where the values used to normalise the data will literally be the outliers themselves (assuming there are outliers of course). No aggregating, no averaging, just take the minimum value, take the maximum value and normalise all the observations in the feature relative to those values. If those minimum and maximum values happen to be outliers then you can see how they will impact the resulting normalisation. As far as I can see, how important this difference is will probably depend on the model that the data is being preprocessed for, and the question of "why those outliers would be kept in the data in the first place" is also valid, but maybe that's another discussion entirely. Anyway, Hope this helps.
z-score VS min-max normalization
The answer to your specific question about why z-score normalisation handles outliers better is largely to do with how standard deviations are calculated in the first place. If there are outliers, the
z-score VS min-max normalization The answer to your specific question about why z-score normalisation handles outliers better is largely to do with how standard deviations are calculated in the first place. If there are outliers, then the effect that the deviation from the mean related to those outliers will have on the final statistic (i.e, the standard deviation; the same value that will be used to normalise the feature) will be mitigated by the rest of the deviations within that same feature. In short, standard deviation is an aggregated calculation so individual values will carry less weight with the more observations there are. Conversely with min-max scaling where the values used to normalise the data will literally be the outliers themselves (assuming there are outliers of course). No aggregating, no averaging, just take the minimum value, take the maximum value and normalise all the observations in the feature relative to those values. If those minimum and maximum values happen to be outliers then you can see how they will impact the resulting normalisation. As far as I can see, how important this difference is will probably depend on the model that the data is being preprocessed for, and the question of "why those outliers would be kept in the data in the first place" is also valid, but maybe that's another discussion entirely. Anyway, Hope this helps.
z-score VS min-max normalization The answer to your specific question about why z-score normalisation handles outliers better is largely to do with how standard deviations are calculated in the first place. If there are outliers, the
43,608
PyMC3 implementation of Bayesian MMM: poor posterior inference
UPDATE: I tried your dataset and did get the similar result. However, I noticed that the estimate for the noise (the variance of the error term) is relatively large. It indicates that the noise explains the most of the variation of this particular dataset, according to our model. At least, I got a different outcome for another dataset with the same model (see below). If you choose a different prior for the noise (e.g. a uniform distribution with a smaller upper bound), then you might get a result with a more significant deviation (could cause problems, though). I had the same issue: the predicted value only has a negligible deviation from the intercept. However, I managed to solve the problem when I transfer the 'observed' to an array, as follows: y_hat = pm.Normal('y_hat', mu= tau + sum(computations), sigma=noise, observed=df.y.values ) Here is the posterior for my data. It was literally a straight line like your plot. (I did not include a time trend). I would not say it does a great job (at least we have some deviations here). Maybe my dataset is not big enough. Perhaps, you could try to run a simple distributed lag model to check if there is a strong relationship between your dependent variable and explanatory variables.
PyMC3 implementation of Bayesian MMM: poor posterior inference
UPDATE: I tried your dataset and did get the similar result. However, I noticed that the estimate for the noise (the variance of the error term) is relatively large. It indicates that the noise explai
PyMC3 implementation of Bayesian MMM: poor posterior inference UPDATE: I tried your dataset and did get the similar result. However, I noticed that the estimate for the noise (the variance of the error term) is relatively large. It indicates that the noise explains the most of the variation of this particular dataset, according to our model. At least, I got a different outcome for another dataset with the same model (see below). If you choose a different prior for the noise (e.g. a uniform distribution with a smaller upper bound), then you might get a result with a more significant deviation (could cause problems, though). I had the same issue: the predicted value only has a negligible deviation from the intercept. However, I managed to solve the problem when I transfer the 'observed' to an array, as follows: y_hat = pm.Normal('y_hat', mu= tau + sum(computations), sigma=noise, observed=df.y.values ) Here is the posterior for my data. It was literally a straight line like your plot. (I did not include a time trend). I would not say it does a great job (at least we have some deviations here). Maybe my dataset is not big enough. Perhaps, you could try to run a simple distributed lag model to check if there is a strong relationship between your dependent variable and explanatory variables.
PyMC3 implementation of Bayesian MMM: poor posterior inference UPDATE: I tried your dataset and did get the similar result. However, I noticed that the estimate for the noise (the variance of the error term) is relatively large. It indicates that the noise explai
43,609
Probabilities arising from permutations
For arbitrary distributions $D$ and $E$ and for the permutation class of descending numbers, the algorithm I presented returns $n$ with the probability— $\int_{-\infty}^{\infty} (\frac{F_E(z)^{n-1}}{(n-1)!} - \frac{F_E(z)^n}{n!}) dF_D(z)$ if $n \ge 1$, and 0 otherwise, Where $F_D$ and $F_E$ are distribution functions of $D$ and $E$ (note that if $D$ has a density function $f_D$, then $dF_D(z) = f_D(z) dz$). For this result, I was inspired by Theorem 2.1 given in chapter 4 of Non-Uniform Random Variate Generation. See also Forsythe 1972. That leaves the question of what probabilities arise with arbitrary distributions (not just uniform) under arbitrary permutation classes (not just numbers in descending order). EDIT (Nov. 5): Whenever $D = E$ (not just if $D$ is uniform), then $n$ is odd with probability $1-\exp(-1)$.
Probabilities arising from permutations
For arbitrary distributions $D$ and $E$ and for the permutation class of descending numbers, the algorithm I presented returns $n$ with the probability— $\int_{-\infty}^{\infty} (\frac{F_E(z)^{n-1}}{
Probabilities arising from permutations For arbitrary distributions $D$ and $E$ and for the permutation class of descending numbers, the algorithm I presented returns $n$ with the probability— $\int_{-\infty}^{\infty} (\frac{F_E(z)^{n-1}}{(n-1)!} - \frac{F_E(z)^n}{n!}) dF_D(z)$ if $n \ge 1$, and 0 otherwise, Where $F_D$ and $F_E$ are distribution functions of $D$ and $E$ (note that if $D$ has a density function $f_D$, then $dF_D(z) = f_D(z) dz$). For this result, I was inspired by Theorem 2.1 given in chapter 4 of Non-Uniform Random Variate Generation. See also Forsythe 1972. That leaves the question of what probabilities arise with arbitrary distributions (not just uniform) under arbitrary permutation classes (not just numbers in descending order). EDIT (Nov. 5): Whenever $D = E$ (not just if $D$ is uniform), then $n$ is odd with probability $1-\exp(-1)$.
Probabilities arising from permutations For arbitrary distributions $D$ and $E$ and for the permutation class of descending numbers, the algorithm I presented returns $n$ with the probability— $\int_{-\infty}^{\infty} (\frac{F_E(z)^{n-1}}{
43,610
Error “system is computationally singular” when running cox.zph for a Cox Model
I just had this problem, and solved it. Hopefully this will help you: I had deleted one small group from my data set, based on a covariate with three levels. However, that covariate had been set to a factor with three levels. I noticed that there were NA’s showing up for that one level. When I recast the covariate as two levels, the error went away. This might apply to other things with factor levels in R.
Error “system is computationally singular” when running cox.zph for a Cox Model
I just had this problem, and solved it. Hopefully this will help you: I had deleted one small group from my data set, based on a covariate with three levels. However, that covariate had been set to a
Error “system is computationally singular” when running cox.zph for a Cox Model I just had this problem, and solved it. Hopefully this will help you: I had deleted one small group from my data set, based on a covariate with three levels. However, that covariate had been set to a factor with three levels. I noticed that there were NA’s showing up for that one level. When I recast the covariate as two levels, the error went away. This might apply to other things with factor levels in R.
Error “system is computationally singular” when running cox.zph for a Cox Model I just had this problem, and solved it. Hopefully this will help you: I had deleted one small group from my data set, based on a covariate with three levels. However, that covariate had been set to a
43,611
Improve precision/recall for class imbalance?
It's clear that your models are suffering from the imbalance in your data, which is a thing you'll need to fix. Now, on to your questions: Any other feature engineering techniques i can do to improve predicting class 0? [have tried different things on text like TFIDF, Hashing Trick, selectKBest, SVD(), and maxAbsScaler() on all features] These are all valid preprocessing steps, but no feature engineering step can help you fix your real problem (i.e. class imbalance). They help in dealing with other issues such as high-dimensionslity, overfitting, etc. Any other algorithms i should try? [have only tried random forest classifier] Tree-based algorithms are usually the most suited in dealing with imbalanced data. You could try some of the popular tree-boosting algorithms that are very popular these days (e.g. XGBoost, LightGBM, Catboost) Is low recall a big deal? Depending on what you're aiming for... What strikes me as important isn't the value of recall that is low but its difference to that of class 0. A dropoff from 98% to 66% is a massive difference and should be dealt with. Mostly have been just "plugging and playing" ... anything obvious i am missing? would applying over-sampling help? If so, how can that be done in python / sklearn? Yes over-sampling is the first thing you should do! This can be done in Python through imbalanced-learn, which offers a large variety of under and over-samplers. This will play well, as long as you swap sklearn.pipeline.Pipeline with imblearn.pipeline.Pipeline. Just note that this step will have to be done after converting your text to vectors (i.e. after CountVectorizer or TFIDF).
Improve precision/recall for class imbalance?
It's clear that your models are suffering from the imbalance in your data, which is a thing you'll need to fix. Now, on to your questions: Any other feature engineering techniques i can do to improve
Improve precision/recall for class imbalance? It's clear that your models are suffering from the imbalance in your data, which is a thing you'll need to fix. Now, on to your questions: Any other feature engineering techniques i can do to improve predicting class 0? [have tried different things on text like TFIDF, Hashing Trick, selectKBest, SVD(), and maxAbsScaler() on all features] These are all valid preprocessing steps, but no feature engineering step can help you fix your real problem (i.e. class imbalance). They help in dealing with other issues such as high-dimensionslity, overfitting, etc. Any other algorithms i should try? [have only tried random forest classifier] Tree-based algorithms are usually the most suited in dealing with imbalanced data. You could try some of the popular tree-boosting algorithms that are very popular these days (e.g. XGBoost, LightGBM, Catboost) Is low recall a big deal? Depending on what you're aiming for... What strikes me as important isn't the value of recall that is low but its difference to that of class 0. A dropoff from 98% to 66% is a massive difference and should be dealt with. Mostly have been just "plugging and playing" ... anything obvious i am missing? would applying over-sampling help? If so, how can that be done in python / sklearn? Yes over-sampling is the first thing you should do! This can be done in Python through imbalanced-learn, which offers a large variety of under and over-samplers. This will play well, as long as you swap sklearn.pipeline.Pipeline with imblearn.pipeline.Pipeline. Just note that this step will have to be done after converting your text to vectors (i.e. after CountVectorizer or TFIDF).
Improve precision/recall for class imbalance? It's clear that your models are suffering from the imbalance in your data, which is a thing you'll need to fix. Now, on to your questions: Any other feature engineering techniques i can do to improve
43,612
Standard Error of the cumulative value for time series
1) One could estimate a model for each of the ten separately and then estimate the parameters globally across all 10 items leading to an F test. Do this for each time step. 2) You can use Monte Carlo techniques (boostrapping) to obtain density functions for the next k periods and then simply sum the pseudo observations over time to get the probability density function of the sum and then mark of probability limits. This is a backdoor way to create the distribition of the sum or correlated values. I have implemented this in AUTOBOX, a piece of software that I helped to develop 3) By examining the coefficients in the identified models for each NOT in the sum of the forecasts.
Standard Error of the cumulative value for time series
1) One could estimate a model for each of the ten separately and then estimate the parameters globally across all 10 items leading to an F test. Do this for each time step. 2) You can use Monte Carlo
Standard Error of the cumulative value for time series 1) One could estimate a model for each of the ten separately and then estimate the parameters globally across all 10 items leading to an F test. Do this for each time step. 2) You can use Monte Carlo techniques (boostrapping) to obtain density functions for the next k periods and then simply sum the pseudo observations over time to get the probability density function of the sum and then mark of probability limits. This is a backdoor way to create the distribition of the sum or correlated values. I have implemented this in AUTOBOX, a piece of software that I helped to develop 3) By examining the coefficients in the identified models for each NOT in the sum of the forecasts.
Standard Error of the cumulative value for time series 1) One could estimate a model for each of the ten separately and then estimate the parameters globally across all 10 items leading to an F test. Do this for each time step. 2) You can use Monte Carlo
43,613
Standard Error of the cumulative value for time series
1) You can not use a bunch of pair-wise t-tests because this will massively increase the likelihood of a type 1 error. You need to perform a 2-step procedure to avoid this: Step 1. If your null hypothesis is that all the means are equal, and the alternative is that the means are not equal, first use a 1-Way ANOVA Test (similar to an F-test). Step 2. If you reject the null, then you need to know which means are different and by how much. For this, you can use a Post-Hoc procedure for pair-wise comparisons. I would suggest Tukey's HSD, Bonferroni, or Mann-Whitney u test. All of these essentially to a something like a t-test but against a different distribution which avoids inflating the Type 1 errors. The Mann-Whitney u test is a non-parametric test so maybe more robust. 2) As suggested by IrishStat, Bootstrap is the way to go here as the sample size is small. If you looking for CI on the errors, you may need bias-corrected and accelerated bootstrap interval as the distribution may be skewed. 3) Create another test statistics called the difference in cumulative values, and bootstrap this statistic for inference.
Standard Error of the cumulative value for time series
1) You can not use a bunch of pair-wise t-tests because this will massively increase the likelihood of a type 1 error. You need to perform a 2-step procedure to avoid this: Step 1. If your null hypoth
Standard Error of the cumulative value for time series 1) You can not use a bunch of pair-wise t-tests because this will massively increase the likelihood of a type 1 error. You need to perform a 2-step procedure to avoid this: Step 1. If your null hypothesis is that all the means are equal, and the alternative is that the means are not equal, first use a 1-Way ANOVA Test (similar to an F-test). Step 2. If you reject the null, then you need to know which means are different and by how much. For this, you can use a Post-Hoc procedure for pair-wise comparisons. I would suggest Tukey's HSD, Bonferroni, or Mann-Whitney u test. All of these essentially to a something like a t-test but against a different distribution which avoids inflating the Type 1 errors. The Mann-Whitney u test is a non-parametric test so maybe more robust. 2) As suggested by IrishStat, Bootstrap is the way to go here as the sample size is small. If you looking for CI on the errors, you may need bias-corrected and accelerated bootstrap interval as the distribution may be skewed. 3) Create another test statistics called the difference in cumulative values, and bootstrap this statistic for inference.
Standard Error of the cumulative value for time series 1) You can not use a bunch of pair-wise t-tests because this will massively increase the likelihood of a type 1 error. You need to perform a 2-step procedure to avoid this: Step 1. If your null hypoth
43,614
How to predict routes using clustering data
Because of my low reputation I'll use this reply as a comment. Fitting a curve over the points of the blue course isn't enough? There are a lot of methods out there, one of them being the classic spline. You can also try your own heuristic. I'll give some that came in mind. Depending on the number of points you could create a graph in which the coordinates are the nodes and the vertices have cost measured by the euclidean distance (or any other distance method) between the coordinates. Then, you use some graph theory algorithm to take the minimum cost spanning tree of this graph. It will be like, given the route from the other ships, the optimal one. Another method would be based on the KNN. Take the origin point of the ship. Then take the N (arbitrary value) points and do the mean. From this next point, do the process of finding the next one from the N closest points. For this you will have to create some rule to discard coordinates, so you don't move back. Hope it give you some more ideas. Please comment back if you like me to throw more, as I would like to discuss this in more detail
How to predict routes using clustering data
Because of my low reputation I'll use this reply as a comment. Fitting a curve over the points of the blue course isn't enough? There are a lot of methods out there, one of them being the classic spl
How to predict routes using clustering data Because of my low reputation I'll use this reply as a comment. Fitting a curve over the points of the blue course isn't enough? There are a lot of methods out there, one of them being the classic spline. You can also try your own heuristic. I'll give some that came in mind. Depending on the number of points you could create a graph in which the coordinates are the nodes and the vertices have cost measured by the euclidean distance (or any other distance method) between the coordinates. Then, you use some graph theory algorithm to take the minimum cost spanning tree of this graph. It will be like, given the route from the other ships, the optimal one. Another method would be based on the KNN. Take the origin point of the ship. Then take the N (arbitrary value) points and do the mean. From this next point, do the process of finding the next one from the N closest points. For this you will have to create some rule to discard coordinates, so you don't move back. Hope it give you some more ideas. Please comment back if you like me to throw more, as I would like to discuss this in more detail
How to predict routes using clustering data Because of my low reputation I'll use this reply as a comment. Fitting a curve over the points of the blue course isn't enough? There are a lot of methods out there, one of them being the classic spl
43,615
Intuition: What is the difference between linear factor models and regular linear regression?
The difference lies not in the equations but in what they are used for. Whereas in linear regression X is an observed known value, in a linear factor model X is itself a random variable. The linear factor model is a statement about the joint distribution of X, Y and Z. Furthermore, linear factor models are often used to describe time series, for example it could relate a time series Y_t to another time series X_t that in turn is described by another stochastic process.
Intuition: What is the difference between linear factor models and regular linear regression?
The difference lies not in the equations but in what they are used for. Whereas in linear regression X is an observed known value, in a linear factor model X is itself a random variable. The linear fa
Intuition: What is the difference between linear factor models and regular linear regression? The difference lies not in the equations but in what they are used for. Whereas in linear regression X is an observed known value, in a linear factor model X is itself a random variable. The linear factor model is a statement about the joint distribution of X, Y and Z. Furthermore, linear factor models are often used to describe time series, for example it could relate a time series Y_t to another time series X_t that in turn is described by another stochastic process.
Intuition: What is the difference between linear factor models and regular linear regression? The difference lies not in the equations but in what they are used for. Whereas in linear regression X is an observed known value, in a linear factor model X is itself a random variable. The linear fa
43,616
Expected value of a "logistic uniform" multivariate
A couple of thoughts on this problem which might be of interest: your predictor can be interpreted as the Bayes classifier for a Gaussian mixture model. For example, if you take $r \in \mathbf{R}^d, Q \succ 0$, then \begin{align} y_j(x) &= \frac{\omega_j \mathcal{N} \left( x | \mu_j, Q^{-1} \right)}{\sum_{k=1}^n \omega_k \mathcal{N} \left( x | \mu_k, Q^{-1} \right)} \\ \text{where} \quad\omega_k &= \exp \left( b_k + \frac{1}{2} |a_k + r|_{Q^{-1}}^2 \right) \\ \mu_k &= Q^{-1} \left( a_k + r \right). \end{align} Your quantity of interest can be expressed as "given a uniform sample from the hypercube, what is the probability that it came from the $j^{\text{th}}$ component of this GMM?". This naturally suggests a simple importance sampling scheme which puts most of its mass near the $j^{\text{th}}$ mode, e.g. \begin{align} q_j (x) = \alpha_0 \cdot \mathbb{I} \left[ x \in [0,1]^d \right] + \alpha_1 \cdot \mathcal{N} \left( x | \mu_j, \gamma \cdot Q^{-1} \right) \end{align} where $(\alpha_0, \alpha_1, \gamma)$ are tunable parameters. One could also consider importance distributions based on the full $n$-component mixture, e.g. \begin{align} q^n (x) = \alpha_0 \cdot \mathbb{I} \left[ x \in [0,1]^d \right] + \sum_{k = 1}^n \alpha_k \mathcal{N} \left( x | \mu_k, \gamma \cdot Q^{-1} \right), \end{align} which induces additional tuning parameters, which has its costs and benefits. Of course, there is the complication of setting $(r, Q)$ as well. My guess is that if one can set $(r, Q)$ such that the support of the implied GMM overlaps well with the hypercube as a whole (by some measure), this will give well-behaved weights for a derived importance sampling scheme. My suspicion here is that if one can find a good way of setting $(r, Q)$, then life is not too hard: one can use the above construction to parametrise a family of importance densities, and then apply standard adaptive importance sampling techniques, possibly also using some extra variance reduction tricks like QMC / stratification and control variates to sweeten the deal. I hope this is at least somewhat useful. I am a little frustrated that I lack intuition for how to set $(r, Q)$ automatically, as once that is done, the problem is relatively friendly. One idea would be to try to tune $(r, Q)$ such that \begin{align} \sum_{k = 1}^K w_k \textbf{Var}_{\mathcal{N} \left( x | \mu_k, Q^{-1} \right)} \left( y_j (x) \cdot \mathbb{I} \left[ x \in [0,1]^d \right] \right) \end{align} is minimal, though it should be emphasised that this is just a heuristic.
Expected value of a "logistic uniform" multivariate
A couple of thoughts on this problem which might be of interest: your predictor can be interpreted as the Bayes classifier for a Gaussian mixture model. For example, if you take $r \in \mathbf{R}^d, Q
Expected value of a "logistic uniform" multivariate A couple of thoughts on this problem which might be of interest: your predictor can be interpreted as the Bayes classifier for a Gaussian mixture model. For example, if you take $r \in \mathbf{R}^d, Q \succ 0$, then \begin{align} y_j(x) &= \frac{\omega_j \mathcal{N} \left( x | \mu_j, Q^{-1} \right)}{\sum_{k=1}^n \omega_k \mathcal{N} \left( x | \mu_k, Q^{-1} \right)} \\ \text{where} \quad\omega_k &= \exp \left( b_k + \frac{1}{2} |a_k + r|_{Q^{-1}}^2 \right) \\ \mu_k &= Q^{-1} \left( a_k + r \right). \end{align} Your quantity of interest can be expressed as "given a uniform sample from the hypercube, what is the probability that it came from the $j^{\text{th}}$ component of this GMM?". This naturally suggests a simple importance sampling scheme which puts most of its mass near the $j^{\text{th}}$ mode, e.g. \begin{align} q_j (x) = \alpha_0 \cdot \mathbb{I} \left[ x \in [0,1]^d \right] + \alpha_1 \cdot \mathcal{N} \left( x | \mu_j, \gamma \cdot Q^{-1} \right) \end{align} where $(\alpha_0, \alpha_1, \gamma)$ are tunable parameters. One could also consider importance distributions based on the full $n$-component mixture, e.g. \begin{align} q^n (x) = \alpha_0 \cdot \mathbb{I} \left[ x \in [0,1]^d \right] + \sum_{k = 1}^n \alpha_k \mathcal{N} \left( x | \mu_k, \gamma \cdot Q^{-1} \right), \end{align} which induces additional tuning parameters, which has its costs and benefits. Of course, there is the complication of setting $(r, Q)$ as well. My guess is that if one can set $(r, Q)$ such that the support of the implied GMM overlaps well with the hypercube as a whole (by some measure), this will give well-behaved weights for a derived importance sampling scheme. My suspicion here is that if one can find a good way of setting $(r, Q)$, then life is not too hard: one can use the above construction to parametrise a family of importance densities, and then apply standard adaptive importance sampling techniques, possibly also using some extra variance reduction tricks like QMC / stratification and control variates to sweeten the deal. I hope this is at least somewhat useful. I am a little frustrated that I lack intuition for how to set $(r, Q)$ automatically, as once that is done, the problem is relatively friendly. One idea would be to try to tune $(r, Q)$ such that \begin{align} \sum_{k = 1}^K w_k \textbf{Var}_{\mathcal{N} \left( x | \mu_k, Q^{-1} \right)} \left( y_j (x) \cdot \mathbb{I} \left[ x \in [0,1]^d \right] \right) \end{align} is minimal, though it should be emphasised that this is just a heuristic.
Expected value of a "logistic uniform" multivariate A couple of thoughts on this problem which might be of interest: your predictor can be interpreted as the Bayes classifier for a Gaussian mixture model. For example, if you take $r \in \mathbf{R}^d, Q
43,617
Expectation Maximization intuitive explanation
Essentially you want to hill climb by differentiating $p(w,r)$ with respect to $w$ and $r$ and adjust $w$ and $r$ by some small constant amount with sign corresponding to the largest increase in gradient and then repeat until you reach a maxima. Since you're choosing $w$ and $r$ randomly and you haven't told us how $p(w,r)$ behaves you might not be able to find the global maximum though depending on the shape of the 2d surface. If the surface does have local minima and maxima, you'd want to reduce this localisation error by initialising multiple random pairs of points at the start of this algorithm then choosing the best amongst the trials.
Expectation Maximization intuitive explanation
Essentially you want to hill climb by differentiating $p(w,r)$ with respect to $w$ and $r$ and adjust $w$ and $r$ by some small constant amount with sign corresponding to the largest increase in gradi
Expectation Maximization intuitive explanation Essentially you want to hill climb by differentiating $p(w,r)$ with respect to $w$ and $r$ and adjust $w$ and $r$ by some small constant amount with sign corresponding to the largest increase in gradient and then repeat until you reach a maxima. Since you're choosing $w$ and $r$ randomly and you haven't told us how $p(w,r)$ behaves you might not be able to find the global maximum though depending on the shape of the 2d surface. If the surface does have local minima and maxima, you'd want to reduce this localisation error by initialising multiple random pairs of points at the start of this algorithm then choosing the best amongst the trials.
Expectation Maximization intuitive explanation Essentially you want to hill climb by differentiating $p(w,r)$ with respect to $w$ and $r$ and adjust $w$ and $r$ by some small constant amount with sign corresponding to the largest increase in gradi
43,618
How to model an "order-invariant" function by neural networks
The easiest way would be to train a fully connected neural network on randomly ordered inputs, ideally on all permutations. EDIT: Alternatively, if you ask for a design of a network that is order invariant, you can do the following: You would need to do a 1D convolutional neural network, where the stride size is equal to the array length of each individual X. You can then stride over the network and assess each X. In the case you present, I assume each X is scalar, so the stride size would be 1. However, the disadvantage of this approach is, that each Xn would only be considered by itself, independently of all other X. The convolutional layer will have filters that are equally applied to all X, but the different X are not conneted with each other. Have a look at this example.
How to model an "order-invariant" function by neural networks
The easiest way would be to train a fully connected neural network on randomly ordered inputs, ideally on all permutations. EDIT: Alternatively, if you ask for a design of a network that is order inva
How to model an "order-invariant" function by neural networks The easiest way would be to train a fully connected neural network on randomly ordered inputs, ideally on all permutations. EDIT: Alternatively, if you ask for a design of a network that is order invariant, you can do the following: You would need to do a 1D convolutional neural network, where the stride size is equal to the array length of each individual X. You can then stride over the network and assess each X. In the case you present, I assume each X is scalar, so the stride size would be 1. However, the disadvantage of this approach is, that each Xn would only be considered by itself, independently of all other X. The convolutional layer will have filters that are equally applied to all X, but the different X are not conneted with each other. Have a look at this example.
How to model an "order-invariant" function by neural networks The easiest way would be to train a fully connected neural network on randomly ordered inputs, ideally on all permutations. EDIT: Alternatively, if you ask for a design of a network that is order inva
43,619
How to model an "order-invariant" function by neural networks
This constraint has got to be the same as equal weights on all variables, or that in fact you're dealing with one variable. There's really only one variable in the model.
How to model an "order-invariant" function by neural networks
This constraint has got to be the same as equal weights on all variables, or that in fact you're dealing with one variable. There's really only one variable in the model.
How to model an "order-invariant" function by neural networks This constraint has got to be the same as equal weights on all variables, or that in fact you're dealing with one variable. There's really only one variable in the model.
How to model an "order-invariant" function by neural networks This constraint has got to be the same as equal weights on all variables, or that in fact you're dealing with one variable. There's really only one variable in the model.
43,620
Seasonal ARIMA Modelling in R [closed]
You can "force" seasonality by setting D=1 or adding regressors. If you think there is more complex seasonality you may consider using Fourier terms? See this link complex seasonality Hyndman
Seasonal ARIMA Modelling in R [closed]
You can "force" seasonality by setting D=1 or adding regressors. If you think there is more complex seasonality you may consider using Fourier terms? See this link complex seasonality Hyndman
Seasonal ARIMA Modelling in R [closed] You can "force" seasonality by setting D=1 or adding regressors. If you think there is more complex seasonality you may consider using Fourier terms? See this link complex seasonality Hyndman
Seasonal ARIMA Modelling in R [closed] You can "force" seasonality by setting D=1 or adding regressors. If you think there is more complex seasonality you may consider using Fourier terms? See this link complex seasonality Hyndman
43,621
Seasonal ARIMA Modelling in R [closed]
Try to use this command rather the one you are using for getting the parameters of ARIMA. arima1 = auto.arima(data.train, trace=FALSE, test="kpss", ic="aic", stepwise=FALSE, approximation=FALSE) Sometimes using these commands gives the best model.
Seasonal ARIMA Modelling in R [closed]
Try to use this command rather the one you are using for getting the parameters of ARIMA. arima1 = auto.arima(data.train, trace=FALSE, test="kpss", ic="aic", stepwise=FALSE, appro
Seasonal ARIMA Modelling in R [closed] Try to use this command rather the one you are using for getting the parameters of ARIMA. arima1 = auto.arima(data.train, trace=FALSE, test="kpss", ic="aic", stepwise=FALSE, approximation=FALSE) Sometimes using these commands gives the best model.
Seasonal ARIMA Modelling in R [closed] Try to use this command rather the one you are using for getting the parameters of ARIMA. arima1 = auto.arima(data.train, trace=FALSE, test="kpss", ic="aic", stepwise=FALSE, appro
43,622
Seasonal ARIMA Modelling in R [closed]
your data suggests the following model with . The actual , fit and forecast is here . The data suggests a level shift (visually obvious) and two statically significant seasonal indicators (April and September )and a few anomalies (6). I used R to do the analysis. Unfortunately auto.arima makes some critical assumptions about model form i.e. no level shifts and no seasonal pulses/indicators and of course no anomalies . It is always good to read the fine print. The fact that there are only two months of the year that exhibit "seasonality" goes to explain why auto.arima delivered a model that had a "seasonal component somehow missing". Even a broken clock is right twice a day and in this case the clock was "nearly right" insofar as that there is no substantive auto-projective seasonal component/effect just a deterministic component/effect for the months of April and September. 6 period out forecast ...
Seasonal ARIMA Modelling in R [closed]
your data suggests the following model with . The actual , fit and forecast is here . The data suggests a level shift (visually obvious) and two statically significant seasonal indicators (April and
Seasonal ARIMA Modelling in R [closed] your data suggests the following model with . The actual , fit and forecast is here . The data suggests a level shift (visually obvious) and two statically significant seasonal indicators (April and September )and a few anomalies (6). I used R to do the analysis. Unfortunately auto.arima makes some critical assumptions about model form i.e. no level shifts and no seasonal pulses/indicators and of course no anomalies . It is always good to read the fine print. The fact that there are only two months of the year that exhibit "seasonality" goes to explain why auto.arima delivered a model that had a "seasonal component somehow missing". Even a broken clock is right twice a day and in this case the clock was "nearly right" insofar as that there is no substantive auto-projective seasonal component/effect just a deterministic component/effect for the months of April and September. 6 period out forecast ...
Seasonal ARIMA Modelling in R [closed] your data suggests the following model with . The actual , fit and forecast is here . The data suggests a level shift (visually obvious) and two statically significant seasonal indicators (April and
43,623
Seasonal ARIMA Modelling in R [closed]
maybe you can force the function auto.arima() to return the seasonal model by using like this auto.arima(database,seasonal=T)
Seasonal ARIMA Modelling in R [closed]
maybe you can force the function auto.arima() to return the seasonal model by using like this auto.arima(database,seasonal=T)
Seasonal ARIMA Modelling in R [closed] maybe you can force the function auto.arima() to return the seasonal model by using like this auto.arima(database,seasonal=T)
Seasonal ARIMA Modelling in R [closed] maybe you can force the function auto.arima() to return the seasonal model by using like this auto.arima(database,seasonal=T)
43,624
Multi-label classification: Predict product category
Since you have ~800 categories as the classification variable, in my understanding, the accuracy of the classification can be increased by better models than ridge regression model alone. Neural networks with multi layers can be more adept and also you can build an ensemble of models to arrive at the final classification. The text data can also be used to group together based on association metrics to arrive at a class variable based on association of text. Another variable can be the clustered variable containing products which can be clustered together. These two pieces of information can help the final model delineate the products much better before assigning them to a particular category. Hope it helps and all the best :)
Multi-label classification: Predict product category
Since you have ~800 categories as the classification variable, in my understanding, the accuracy of the classification can be increased by better models than ridge regression model alone. Neural netwo
Multi-label classification: Predict product category Since you have ~800 categories as the classification variable, in my understanding, the accuracy of the classification can be increased by better models than ridge regression model alone. Neural networks with multi layers can be more adept and also you can build an ensemble of models to arrive at the final classification. The text data can also be used to group together based on association metrics to arrive at a class variable based on association of text. Another variable can be the clustered variable containing products which can be clustered together. These two pieces of information can help the final model delineate the products much better before assigning them to a particular category. Hope it helps and all the best :)
Multi-label classification: Predict product category Since you have ~800 categories as the classification variable, in my understanding, the accuracy of the classification can be increased by better models than ridge regression model alone. Neural netwo
43,625
Does bias in statistics and machine learning mean the same thing?
Yes, they mean the same thing. This free chapter covers bias and variance of estimators: http://www.deeplearningbook.org/contents/ml.html Please see section 5.4, which has a good explanation of what they are.
Does bias in statistics and machine learning mean the same thing?
Yes, they mean the same thing. This free chapter covers bias and variance of estimators: http://www.deeplearningbook.org/contents/ml.html Please see section 5.4, which has a good explanation of what t
Does bias in statistics and machine learning mean the same thing? Yes, they mean the same thing. This free chapter covers bias and variance of estimators: http://www.deeplearningbook.org/contents/ml.html Please see section 5.4, which has a good explanation of what they are.
Does bias in statistics and machine learning mean the same thing? Yes, they mean the same thing. This free chapter covers bias and variance of estimators: http://www.deeplearningbook.org/contents/ml.html Please see section 5.4, which has a good explanation of what t
43,626
Does bias in statistics and machine learning mean the same thing?
No, they don't. But they're similar. In ML the learning bias is the set of wrong assumptions that a model makes to fit a dataset. That can be thought of as a measure of how well the model fits the training dataset. On the other hand, the regular statistic bias is mathematically defined as the average of the absolute error of an estimator. If this number is zero the estimator (or model) is unbidden, if it is positive then the estimator is positive biased, which means the on average the estimation (or predictions) will be always higher than the true value. They're different because a model can have learning bias (it doesn't fit perfectly the data set) but it is unbiased (the average absolute error is equal to zero, or very close to zero). For a more detailed explanation read this paper: http://www.cems.uwe.ac.uk/~irjohnso/coursenotes/uqc832/tr-bias.pdf
Does bias in statistics and machine learning mean the same thing?
No, they don't. But they're similar. In ML the learning bias is the set of wrong assumptions that a model makes to fit a dataset. That can be thought of as a measure of how well the model fits the tra
Does bias in statistics and machine learning mean the same thing? No, they don't. But they're similar. In ML the learning bias is the set of wrong assumptions that a model makes to fit a dataset. That can be thought of as a measure of how well the model fits the training dataset. On the other hand, the regular statistic bias is mathematically defined as the average of the absolute error of an estimator. If this number is zero the estimator (or model) is unbidden, if it is positive then the estimator is positive biased, which means the on average the estimation (or predictions) will be always higher than the true value. They're different because a model can have learning bias (it doesn't fit perfectly the data set) but it is unbiased (the average absolute error is equal to zero, or very close to zero). For a more detailed explanation read this paper: http://www.cems.uwe.ac.uk/~irjohnso/coursenotes/uqc832/tr-bias.pdf
Does bias in statistics and machine learning mean the same thing? No, they don't. But they're similar. In ML the learning bias is the set of wrong assumptions that a model makes to fit a dataset. That can be thought of as a measure of how well the model fits the tra
43,627
Linear model with hidden variable
You already have this: $$ \quad \frac{1}{b} (y - a) = \frac{1}{d}(z - c) $$ So let's go one step further and solve it for $y$: $$ \quad y = \frac{b}{d}(z - c) - a = \frac{b}{d} \cdot z - \frac{b}{d} \cdot c + a $$ This means you can find $(a - \frac{b}{d}\cdot c)$ and the ratio $b/d$ by regressing $y$ on $z$. Similarly if you regress $z$ on $y$ you can find $(c - \frac{d}{b} \cdot a)$ and the ratio $d/b$. Unfortunately you cannot infer anything about $a$ and $c$ because the two equations $a - \frac{b}{d}\cdot c$ and $c - \frac{d}{b} \cdot a$ are essentially equivalent (so you have one equation with two unknown parameters). You can also not tell what the value of $x$ is because even though you may know the ratio $b/d$ (or its inverse), there are infinitely many values for $b$ and $d$ that can satisfy that ratio.
Linear model with hidden variable
You already have this: $$ \quad \frac{1}{b} (y - a) = \frac{1}{d}(z - c) $$ So let's go one step further and solve it for $y$: $$ \quad y = \frac{b}{d}(z - c) - a = \frac{b}{d} \cdot z - \frac{b}{d} \
Linear model with hidden variable You already have this: $$ \quad \frac{1}{b} (y - a) = \frac{1}{d}(z - c) $$ So let's go one step further and solve it for $y$: $$ \quad y = \frac{b}{d}(z - c) - a = \frac{b}{d} \cdot z - \frac{b}{d} \cdot c + a $$ This means you can find $(a - \frac{b}{d}\cdot c)$ and the ratio $b/d$ by regressing $y$ on $z$. Similarly if you regress $z$ on $y$ you can find $(c - \frac{d}{b} \cdot a)$ and the ratio $d/b$. Unfortunately you cannot infer anything about $a$ and $c$ because the two equations $a - \frac{b}{d}\cdot c$ and $c - \frac{d}{b} \cdot a$ are essentially equivalent (so you have one equation with two unknown parameters). You can also not tell what the value of $x$ is because even though you may know the ratio $b/d$ (or its inverse), there are infinitely many values for $b$ and $d$ that can satisfy that ratio.
Linear model with hidden variable You already have this: $$ \quad \frac{1}{b} (y - a) = \frac{1}{d}(z - c) $$ So let's go one step further and solve it for $y$: $$ \quad y = \frac{b}{d}(z - c) - a = \frac{b}{d} \cdot z - \frac{b}{d} \
43,628
Linear model with hidden variable
This is an old question, but when it popped up in the timeline I thought it would be a nice example of working with latent variables using Bayesian inference in stan: library(rstan) library(tidyverse) a1 = 5 a2 = 10 b1 = 2 b2 = 3 e1 = .5 e2 = .7 n = 1000 x = rnorm(n) y1 = a1 + b1 * x + rnorm(n, 0, e1) y2 = a2 + b2 * x + rnorm(n, 0, e2) data = data.frame(y1, y2) code = ' data { int n; real y1[n]; real y2[n]; } parameters { real a1; real a2; real<lower=0> b1; // Make slopes positive real<lower=0> b2; real<lower=0> e1; real<lower=0> e2; real x[n]; } model{ x ~ normal(0, 1); // Enforce a distribution on x for(i in 1:n){ y1[i] ~ normal(a1 + x[i]*b1, e1); y2[i] ~ normal(a2 + x[i]*b2, e2); } } ' stan_data = list( n = n, y1 = y1, y2 = y2 ) model = stan_model(model_code = code) approx_model = vb(model, data = stan_data) # Quick result using variational bayes summary(approx_model, pars = c('a1', 'a2', 'b1', 'b2', 'e1', 'e2'))$summary %>% round(digits = 2) ## mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff khat ## a1 5.00 NaN 0.02 4.96 4.99 5.00 5.02 5.04 NaN 3.98 ## a2 9.99 NaN 0.03 9.93 9.97 9.99 10.01 10.06 NaN 3.99 ## b1 1.82 NaN 0.02 1.78 1.81 1.82 1.83 1.85 NaN 3.99 ## b2 2.72 NaN 0.03 2.67 2.71 2.73 2.74 2.78 NaN 3.99 ## e1 0.51 NaN 0.01 0.49 0.50 0.51 0.52 0.53 NaN 3.99 ## e2 0.77 NaN 0.02 0.73 0.76 0.77 0.78 0.80 NaN 3.98 # More precise, slower result using MCMC # mcmc_model = sampling(model, chains = 2, cores = 2) # summary(mcmc_model, pars = c('a1', 'a2', 'b1', 'b2', 'e1', 'e2'))$summary # Estimated values of x xhat = summary(approx_model)$summary %>% data.frame() %>% rownames_to_column('parameter') %>% filter(str_detect(parameter, 'x')) plot(x, xhat$mean, xlab = 'True value', ylab = 'Estimated value')
Linear model with hidden variable
This is an old question, but when it popped up in the timeline I thought it would be a nice example of working with latent variables using Bayesian inference in stan: library(rstan) library(tidyverse)
Linear model with hidden variable This is an old question, but when it popped up in the timeline I thought it would be a nice example of working with latent variables using Bayesian inference in stan: library(rstan) library(tidyverse) a1 = 5 a2 = 10 b1 = 2 b2 = 3 e1 = .5 e2 = .7 n = 1000 x = rnorm(n) y1 = a1 + b1 * x + rnorm(n, 0, e1) y2 = a2 + b2 * x + rnorm(n, 0, e2) data = data.frame(y1, y2) code = ' data { int n; real y1[n]; real y2[n]; } parameters { real a1; real a2; real<lower=0> b1; // Make slopes positive real<lower=0> b2; real<lower=0> e1; real<lower=0> e2; real x[n]; } model{ x ~ normal(0, 1); // Enforce a distribution on x for(i in 1:n){ y1[i] ~ normal(a1 + x[i]*b1, e1); y2[i] ~ normal(a2 + x[i]*b2, e2); } } ' stan_data = list( n = n, y1 = y1, y2 = y2 ) model = stan_model(model_code = code) approx_model = vb(model, data = stan_data) # Quick result using variational bayes summary(approx_model, pars = c('a1', 'a2', 'b1', 'b2', 'e1', 'e2'))$summary %>% round(digits = 2) ## mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff khat ## a1 5.00 NaN 0.02 4.96 4.99 5.00 5.02 5.04 NaN 3.98 ## a2 9.99 NaN 0.03 9.93 9.97 9.99 10.01 10.06 NaN 3.99 ## b1 1.82 NaN 0.02 1.78 1.81 1.82 1.83 1.85 NaN 3.99 ## b2 2.72 NaN 0.03 2.67 2.71 2.73 2.74 2.78 NaN 3.99 ## e1 0.51 NaN 0.01 0.49 0.50 0.51 0.52 0.53 NaN 3.99 ## e2 0.77 NaN 0.02 0.73 0.76 0.77 0.78 0.80 NaN 3.98 # More precise, slower result using MCMC # mcmc_model = sampling(model, chains = 2, cores = 2) # summary(mcmc_model, pars = c('a1', 'a2', 'b1', 'b2', 'e1', 'e2'))$summary # Estimated values of x xhat = summary(approx_model)$summary %>% data.frame() %>% rownames_to_column('parameter') %>% filter(str_detect(parameter, 'x')) plot(x, xhat$mean, xlab = 'True value', ylab = 'Estimated value')
Linear model with hidden variable This is an old question, but when it popped up in the timeline I thought it would be a nice example of working with latent variables using Bayesian inference in stan: library(rstan) library(tidyverse)
43,629
Adding a magnitude penalty to a GAM
An interesting question. This not an answer, but a few rambling thoughts at the moment. It sounds like you want to penalize a functional of the parameters, ie, your penalty on $\Delta \eta$ is implicitly a function $g(\beta_{11}, \beta_{12}, \dotsc, \beta_{21}, \beta_{22}, \dotsc, )$ of the parameters in the basis expansion of the smoothed fits $f_1(z) = \beta_1B_1(z) + \beta_2B_2(z) + \dotsc$. Though mgcv has a L2-penalty (smooth.construct.re.smooth.spec) as a smoother, this applies to columns of the (possibly-augmented) design matrix, whereas you would need it to apply to the current basis expansion of the covariates. I'm wonder if there might not be an iterative procedure in which you somehow approximate the total variation smoothness penalty $\int f''(x)^2dx$ through some combination of rotating the response and the design matrix, and weighting the L2 penalty after doing your own basis expansion? EG,you want to solve $$ argmin_{\beta} \lVert Y - B(X) \beta \rVert_2^2 + \lambda p(\beta) $$ which you approximate with $$ argmin_{\beta} \lVert Q(Y - B(X)) \beta \rVert_2^2 + \lambda \lVert D \beta \rVert_2^2 $$ for some arbitrary matrix $Q$ and diagonal matrix $D$?
Adding a magnitude penalty to a GAM
An interesting question. This not an answer, but a few rambling thoughts at the moment. It sounds like you want to penalize a functional of the parameters, ie, your penalty on $\Delta \eta$ is implic
Adding a magnitude penalty to a GAM An interesting question. This not an answer, but a few rambling thoughts at the moment. It sounds like you want to penalize a functional of the parameters, ie, your penalty on $\Delta \eta$ is implicitly a function $g(\beta_{11}, \beta_{12}, \dotsc, \beta_{21}, \beta_{22}, \dotsc, )$ of the parameters in the basis expansion of the smoothed fits $f_1(z) = \beta_1B_1(z) + \beta_2B_2(z) + \dotsc$. Though mgcv has a L2-penalty (smooth.construct.re.smooth.spec) as a smoother, this applies to columns of the (possibly-augmented) design matrix, whereas you would need it to apply to the current basis expansion of the covariates. I'm wonder if there might not be an iterative procedure in which you somehow approximate the total variation smoothness penalty $\int f''(x)^2dx$ through some combination of rotating the response and the design matrix, and weighting the L2 penalty after doing your own basis expansion? EG,you want to solve $$ argmin_{\beta} \lVert Y - B(X) \beta \rVert_2^2 + \lambda p(\beta) $$ which you approximate with $$ argmin_{\beta} \lVert Q(Y - B(X)) \beta \rVert_2^2 + \lambda \lVert D \beta \rVert_2^2 $$ for some arbitrary matrix $Q$ and diagonal matrix $D$?
Adding a magnitude penalty to a GAM An interesting question. This not an answer, but a few rambling thoughts at the moment. It sounds like you want to penalize a functional of the parameters, ie, your penalty on $\Delta \eta$ is implic
43,630
Deep Learning vs Structured Learning
Here is a nice summary of the differences: And you can refer to this lecture: Statistical and Algorithmic Foundations of Deep Learning for more details.
Deep Learning vs Structured Learning
Here is a nice summary of the differences: And you can refer to this lecture: Statistical and Algorithmic Foundations of Deep Learning for more details.
Deep Learning vs Structured Learning Here is a nice summary of the differences: And you can refer to this lecture: Statistical and Algorithmic Foundations of Deep Learning for more details.
Deep Learning vs Structured Learning Here is a nice summary of the differences: And you can refer to this lecture: Statistical and Algorithmic Foundations of Deep Learning for more details.
43,631
Prove that $t_{n-1, \alpha/2}$ is strictly decreasing in $n$
This looks like a good opportunity to discuss important relationships among the Student $t$ distributions. The analysis needed to demonstrate them is elementary, requiring only the basic concepts of differential Calculus, and with the right strategy can be reduced to a simple algebraic calculation. There is a classic set of plots comparing the density functions (right panel of the figure) and the distribution functions (left panel) of Student $t$ variables as their parameter $\nu$ is varied: Although these cannot show the full extents of the graphs, which go from $-\infty$ to $\infty,$ the curves do suggest that when $\nu^\prime \gt \nu \gt 0,$ All these densities are symmetric around $0;$ The density for $\nu$ is lower near $0$ than the density for $\nu^\prime;$ The density for $\nu$ is higher asymptotically than the density for $\nu^\prime$ (that is, the distribution with small parameter $\nu$ has heavier tails); and There is just one positive number (depending on $\nu$ and $\nu^\prime$) where the density functions for $\nu^\prime$ and $\nu$ cross. All but the last claim are straightforward (and obvious) to prove, so let's get to the heart of the matter: a study of how two Student $t$ densities relate to one another for positive arguments $x.$ (Claim (1) justifies the focus on positive values.) The worry is that two different Student $t$ densities might wiggle around each other several times as their argument $x$ grows large, alternating between which has the larger density. Intuitively that shouldn't be the case, but how to prove it? The following analysis is motivated by a focus on simplifying away the obstacles. What would these obstacles be? Consider the expression for the distribution function, $$F(t;\nu) = \int_{-\infty}^t f(x,\nu)\,\mathrm{d}x = \frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\left(\frac{\nu}{2}\right)} \int_{-\infty}^t \left(1 + \frac{x^2}{\nu}\right)^{-(\nu+1)/2}\,\mathrm{d}x.$$ This is required to define the critical point $t_\nu(\alpha/2)$ as given in the question. From left to right we are confronted in turn with the apparent need to analyze (1) a ratio of Gamma functions, (2) an integral, (3) a fractional power, and (4) a reciprocal quadratic function. The strategy of comparing two distributions, starting with the obvious equalities $F(0,\nu)=1/2=F(0,\nu^\prime)$ and $\lim_{t\to \infty} F(t,\nu) = 1 = \lim_{t\to\infty}F(t,\nu^\prime),$ can eliminate the first obstacle. Comparing the density functions avoids dealing directly with the integral. To deal with the powers, let's compare the densities by taking the logarithm of their ratios. The log is positive when the numerator exceeds the denominator and negative otherwise. Although this introduces the logarithm as a new complication, by differentiating it we are reduced to a manageable rational function. To this end, for $x\ge 0$ define $$h(x,\nu^\prime,\nu) = \log\left(\frac{f(x,\nu^\prime)}{f(x,\nu)}\right) = \log(f(x,\nu^\prime)) - \log(f(x,\nu)).$$ See the left panel of the next figure for a plot of $h.$ This is a typical shape of the graph, no matter what $\nu^\prime \gt \nu$ might be. Claim (2) is that $h(0,\nu^\prime,\nu)\gt 0$ while claim (3) is that $h(x,\nu^\prime,\nu)\lt 0$ for all sufficiently large $x.$ Our concern is what happens at intermediate values $x$ where $h$ drops from its maximum down to negative values. The right panel plots the derivative of $h.$ I will prove that the derivative has exactly one zero at $x=1.$ Because the simplification strategy is a good one, this is an easy calculation based on computing the logarithmic derivative of $f(x,\nu):$ $$\frac{\mathrm{d}\log f(x,\nu)}{\mathrm{d}x} = -\frac{(\nu+1)x}{\nu + x^2}.$$ Consequently $$\frac{\mathrm{d}h(x,\nu^\prime,\nu)}{\mathrm{d}x} = \frac{(\nu+1)x}{\nu + x^2} - \frac{(\nu^\prime+1)x}{\nu^\prime + x^2} = \frac{(\nu^\prime-\nu)}{(\nu+x^2)(\nu^\prime+x^2)}\,x\,(1-x^2).$$ Since $\nu,$ $\nu^\prime,$ and $x^2$ are all positive, this is a continuous function for all $x\ge 0.$ It can cross zero, then, only where $x(1-x^2)=0.$ The only solution for $0\lt x \lt \infty$ is $x=1,$ as claimed. Let's unroll the implications. $h$ increases from $x=0$ (where it is positive) to $x=1$ and thereafter decreases, eventually becoming negative (which is a restatement of Claim (3)). Therefore Claim (4) holds: any two different Student $t$ densities cross at exactly one positive number (potentially depending on those two densities, of course). Consequently the distribution function $t \to F(t,\nu^\prime)$ rises more steeply from its value of $1/2$ at $t=0$ compared to $t\to F(t,\nu)$ and can never cross that graph: the two graphs eventually converge as $t\to \infty,$ where they both squeeze up to a height of $1.$ Thus, for any $0\lt p \lt 1,$ the middle portion $p$ of the probability distribution with $\nu^\prime$ degrees of freedom is strictly contained within the middle portion $p$ of the distribution with $\nu\lt \nu^\prime$ degrees of freedom. The last conclusion is equivalent to saying $t_\nu((1-p)/2)$ is a strictly decreasing function of $\nu$, QED.
Prove that $t_{n-1, \alpha/2}$ is strictly decreasing in $n$
This looks like a good opportunity to discuss important relationships among the Student $t$ distributions. The analysis needed to demonstrate them is elementary, requiring only the basic concepts of
Prove that $t_{n-1, \alpha/2}$ is strictly decreasing in $n$ This looks like a good opportunity to discuss important relationships among the Student $t$ distributions. The analysis needed to demonstrate them is elementary, requiring only the basic concepts of differential Calculus, and with the right strategy can be reduced to a simple algebraic calculation. There is a classic set of plots comparing the density functions (right panel of the figure) and the distribution functions (left panel) of Student $t$ variables as their parameter $\nu$ is varied: Although these cannot show the full extents of the graphs, which go from $-\infty$ to $\infty,$ the curves do suggest that when $\nu^\prime \gt \nu \gt 0,$ All these densities are symmetric around $0;$ The density for $\nu$ is lower near $0$ than the density for $\nu^\prime;$ The density for $\nu$ is higher asymptotically than the density for $\nu^\prime$ (that is, the distribution with small parameter $\nu$ has heavier tails); and There is just one positive number (depending on $\nu$ and $\nu^\prime$) where the density functions for $\nu^\prime$ and $\nu$ cross. All but the last claim are straightforward (and obvious) to prove, so let's get to the heart of the matter: a study of how two Student $t$ densities relate to one another for positive arguments $x.$ (Claim (1) justifies the focus on positive values.) The worry is that two different Student $t$ densities might wiggle around each other several times as their argument $x$ grows large, alternating between which has the larger density. Intuitively that shouldn't be the case, but how to prove it? The following analysis is motivated by a focus on simplifying away the obstacles. What would these obstacles be? Consider the expression for the distribution function, $$F(t;\nu) = \int_{-\infty}^t f(x,\nu)\,\mathrm{d}x = \frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\left(\frac{\nu}{2}\right)} \int_{-\infty}^t \left(1 + \frac{x^2}{\nu}\right)^{-(\nu+1)/2}\,\mathrm{d}x.$$ This is required to define the critical point $t_\nu(\alpha/2)$ as given in the question. From left to right we are confronted in turn with the apparent need to analyze (1) a ratio of Gamma functions, (2) an integral, (3) a fractional power, and (4) a reciprocal quadratic function. The strategy of comparing two distributions, starting with the obvious equalities $F(0,\nu)=1/2=F(0,\nu^\prime)$ and $\lim_{t\to \infty} F(t,\nu) = 1 = \lim_{t\to\infty}F(t,\nu^\prime),$ can eliminate the first obstacle. Comparing the density functions avoids dealing directly with the integral. To deal with the powers, let's compare the densities by taking the logarithm of their ratios. The log is positive when the numerator exceeds the denominator and negative otherwise. Although this introduces the logarithm as a new complication, by differentiating it we are reduced to a manageable rational function. To this end, for $x\ge 0$ define $$h(x,\nu^\prime,\nu) = \log\left(\frac{f(x,\nu^\prime)}{f(x,\nu)}\right) = \log(f(x,\nu^\prime)) - \log(f(x,\nu)).$$ See the left panel of the next figure for a plot of $h.$ This is a typical shape of the graph, no matter what $\nu^\prime \gt \nu$ might be. Claim (2) is that $h(0,\nu^\prime,\nu)\gt 0$ while claim (3) is that $h(x,\nu^\prime,\nu)\lt 0$ for all sufficiently large $x.$ Our concern is what happens at intermediate values $x$ where $h$ drops from its maximum down to negative values. The right panel plots the derivative of $h.$ I will prove that the derivative has exactly one zero at $x=1.$ Because the simplification strategy is a good one, this is an easy calculation based on computing the logarithmic derivative of $f(x,\nu):$ $$\frac{\mathrm{d}\log f(x,\nu)}{\mathrm{d}x} = -\frac{(\nu+1)x}{\nu + x^2}.$$ Consequently $$\frac{\mathrm{d}h(x,\nu^\prime,\nu)}{\mathrm{d}x} = \frac{(\nu+1)x}{\nu + x^2} - \frac{(\nu^\prime+1)x}{\nu^\prime + x^2} = \frac{(\nu^\prime-\nu)}{(\nu+x^2)(\nu^\prime+x^2)}\,x\,(1-x^2).$$ Since $\nu,$ $\nu^\prime,$ and $x^2$ are all positive, this is a continuous function for all $x\ge 0.$ It can cross zero, then, only where $x(1-x^2)=0.$ The only solution for $0\lt x \lt \infty$ is $x=1,$ as claimed. Let's unroll the implications. $h$ increases from $x=0$ (where it is positive) to $x=1$ and thereafter decreases, eventually becoming negative (which is a restatement of Claim (3)). Therefore Claim (4) holds: any two different Student $t$ densities cross at exactly one positive number (potentially depending on those two densities, of course). Consequently the distribution function $t \to F(t,\nu^\prime)$ rises more steeply from its value of $1/2$ at $t=0$ compared to $t\to F(t,\nu)$ and can never cross that graph: the two graphs eventually converge as $t\to \infty,$ where they both squeeze up to a height of $1.$ Thus, for any $0\lt p \lt 1,$ the middle portion $p$ of the probability distribution with $\nu^\prime$ degrees of freedom is strictly contained within the middle portion $p$ of the distribution with $\nu\lt \nu^\prime$ degrees of freedom. The last conclusion is equivalent to saying $t_\nu((1-p)/2)$ is a strictly decreasing function of $\nu$, QED.
Prove that $t_{n-1, \alpha/2}$ is strictly decreasing in $n$ This looks like a good opportunity to discuss important relationships among the Student $t$ distributions. The analysis needed to demonstrate them is elementary, requiring only the basic concepts of
43,632
What's the added value of SD line over regression line when examining association between 2 variables?
The SD line is a didactical and visual aid to help seeing the relation for the slope of the regular regression line. $$\text {slope regression } = r_{xy} \, \frac {\sigma_y}{\sigma_x} = r_{xy} \, \text {slope SD line} $$ The SD line shows how x and y are varying and this can give a more or less steep or flat line depending on the ratio $ \frac {\sigma_y}{\sigma_x}$. The regression line will be always with a smaller slope than the SD line(You might relate this to regression to the mean). By how much smaller will depend on the correlation. The SD line will help to see and get this view/interpretation of the regression line. The higher $R^2$ the more the model explains the variance in the data, and the closer the regression line will be to the SD line. The image below may illustrate how that SD line helps/works. For data with $\sigma_x = \sigma_y = 1$ but with different correlations the SD line and the regression line are drawn. Note that the regression line is closer to te SD line for larger correlations (but still always with a smaller slope). # random data set.seed(1) x <- rnorm(100,0,1) y <- rnorm(100,0,1) #normalizing x <- (x-mean(x))/sd(x) y <- (y-mean(y))/sd(y) #making x and y uncorrelated x <- x-cor(x,y)*y cor(x,y) x <- x/sd(x) # plotting cases with sd_x=sd_y=1 and different correlations for (rho in c(0.1,0.3,0.5,0.7)) { b <- sqrt(1/(1-rho^2)-1) z <- (y+b*x)/sqrt(1+b^2) plot(x,z, xlim = c(-5,5),ylim=c(-5,5), pch=21,col=1,bg=1,cex=0.7 ) title(bquote(rho == .(rho)),line = 1) lines(c(-10,10),c(-10,10),lty=2) lines(c(-10,10),c(-10,10)*rho) if (rho == 0.1) { legend(-5,5,c("sd line","regression line"),lty=c(2,1),cex=0.9) } } Similar descriptions http://www.jerrydallal.com/LHSP/regeff.htm https://books.google.ch/books?id=fW_9BV5Wpf8C&pg=PA18 Statistical Models: Theory and Practice by David A. Freedman Related Is the average of betas from Y ~ X and X ~ Y valid?
What's the added value of SD line over regression line when examining association between 2 variable
The SD line is a didactical and visual aid to help seeing the relation for the slope of the regular regression line. $$\text {slope regression } = r_{xy} \, \frac {\sigma_y}{\sigma_x} = r_{xy} \, \te
What's the added value of SD line over regression line when examining association between 2 variables? The SD line is a didactical and visual aid to help seeing the relation for the slope of the regular regression line. $$\text {slope regression } = r_{xy} \, \frac {\sigma_y}{\sigma_x} = r_{xy} \, \text {slope SD line} $$ The SD line shows how x and y are varying and this can give a more or less steep or flat line depending on the ratio $ \frac {\sigma_y}{\sigma_x}$. The regression line will be always with a smaller slope than the SD line(You might relate this to regression to the mean). By how much smaller will depend on the correlation. The SD line will help to see and get this view/interpretation of the regression line. The higher $R^2$ the more the model explains the variance in the data, and the closer the regression line will be to the SD line. The image below may illustrate how that SD line helps/works. For data with $\sigma_x = \sigma_y = 1$ but with different correlations the SD line and the regression line are drawn. Note that the regression line is closer to te SD line for larger correlations (but still always with a smaller slope). # random data set.seed(1) x <- rnorm(100,0,1) y <- rnorm(100,0,1) #normalizing x <- (x-mean(x))/sd(x) y <- (y-mean(y))/sd(y) #making x and y uncorrelated x <- x-cor(x,y)*y cor(x,y) x <- x/sd(x) # plotting cases with sd_x=sd_y=1 and different correlations for (rho in c(0.1,0.3,0.5,0.7)) { b <- sqrt(1/(1-rho^2)-1) z <- (y+b*x)/sqrt(1+b^2) plot(x,z, xlim = c(-5,5),ylim=c(-5,5), pch=21,col=1,bg=1,cex=0.7 ) title(bquote(rho == .(rho)),line = 1) lines(c(-10,10),c(-10,10),lty=2) lines(c(-10,10),c(-10,10)*rho) if (rho == 0.1) { legend(-5,5,c("sd line","regression line"),lty=c(2,1),cex=0.9) } } Similar descriptions http://www.jerrydallal.com/LHSP/regeff.htm https://books.google.ch/books?id=fW_9BV5Wpf8C&pg=PA18 Statistical Models: Theory and Practice by David A. Freedman Related Is the average of betas from Y ~ X and X ~ Y valid?
What's the added value of SD line over regression line when examining association between 2 variable The SD line is a didactical and visual aid to help seeing the relation for the slope of the regular regression line. $$\text {slope regression } = r_{xy} \, \frac {\sigma_y}{\sigma_x} = r_{xy} \, \te
43,633
Circular statistics for showing the directional mean lies outside a specified region of a duty cycle
Thoughts on my proposed method (original question) In my proposed approach, computing the mean singing direction via bootstrapped CI's had an issue. In this formualtion, I did not include the expected observations that would happen under a null hypothesis (the bird is singing randomly with no avoidance behaviour). Hence, I could not work this into a null hypothsis rejection test. Additionally, I now believe that using the bootstrapped values closest to the observed mean for the calculation of my CI's didn't really make much statistical sense. As I had difficulty in finding a way to formulate a testable null hypothesis based around the mean singing direction, I oped to instead focus on the expected vs observed singing overlap with the avoidance region of the playback track. A better approach This analysis is now done and published (paper here, section 2.4.2 and figure 4) Focusing on proportion of singing overlap, as opposed to mean singing direction: Each song has a start and end time, so songs are comprised of their start time, and duration: I did a non-parametric bootstrap on the singing data (sampling with replacement, to make 10,000 new datasets. In each bootstrap, I calculate the proportion of singing time which overlaps with the region-to-avoid (regions of the playback with noise in this case). This gives me: a) a bootstrapped mean singing overlap with the avoidance region, and 2) confidence intervals for this mean. I then set a null hypothesis, where if the bird was singing in a random uniform manner (with respect to the playback track cycles), the amount of song overlap would be equal to the proportion of the track that is occupied by the region-to-avoid. So the $H_0$ for song overlap is $p$ If the bootstrapped confidence intervals for the bootstrapped song overlap were lower than the null hypothesis ($< p$), then I considered this as a rejection of the $H_0$, and support for the $H_1$ that the individual is actively trying to reduce song overlap with the region-to-avoid. For more context, below I've pasted a figure from the paper, so you can see what our data looked like.
Circular statistics for showing the directional mean lies outside a specified region of a duty cycle
Thoughts on my proposed method (original question) In my proposed approach, computing the mean singing direction via bootstrapped CI's had an issue. In this formualtion, I did not include the expecte
Circular statistics for showing the directional mean lies outside a specified region of a duty cycle Thoughts on my proposed method (original question) In my proposed approach, computing the mean singing direction via bootstrapped CI's had an issue. In this formualtion, I did not include the expected observations that would happen under a null hypothesis (the bird is singing randomly with no avoidance behaviour). Hence, I could not work this into a null hypothsis rejection test. Additionally, I now believe that using the bootstrapped values closest to the observed mean for the calculation of my CI's didn't really make much statistical sense. As I had difficulty in finding a way to formulate a testable null hypothesis based around the mean singing direction, I oped to instead focus on the expected vs observed singing overlap with the avoidance region of the playback track. A better approach This analysis is now done and published (paper here, section 2.4.2 and figure 4) Focusing on proportion of singing overlap, as opposed to mean singing direction: Each song has a start and end time, so songs are comprised of their start time, and duration: I did a non-parametric bootstrap on the singing data (sampling with replacement, to make 10,000 new datasets. In each bootstrap, I calculate the proportion of singing time which overlaps with the region-to-avoid (regions of the playback with noise in this case). This gives me: a) a bootstrapped mean singing overlap with the avoidance region, and 2) confidence intervals for this mean. I then set a null hypothesis, where if the bird was singing in a random uniform manner (with respect to the playback track cycles), the amount of song overlap would be equal to the proportion of the track that is occupied by the region-to-avoid. So the $H_0$ for song overlap is $p$ If the bootstrapped confidence intervals for the bootstrapped song overlap were lower than the null hypothesis ($< p$), then I considered this as a rejection of the $H_0$, and support for the $H_1$ that the individual is actively trying to reduce song overlap with the region-to-avoid. For more context, below I've pasted a figure from the paper, so you can see what our data looked like.
Circular statistics for showing the directional mean lies outside a specified region of a duty cycle Thoughts on my proposed method (original question) In my proposed approach, computing the mean singing direction via bootstrapped CI's had an issue. In this formualtion, I did not include the expecte
43,634
Model selection between parametric nonparametric methods
You shouldn't generally use AIC to choose between parametric and nonparametric models. Parametric and nonparametric models have different modeling assumptions. The traditional AIC is based on a function of the likelihood. Likelihoods of parametric and nonparametric models are not always comparable. An alternative that in theory can naturally compare parametric and nonparametric is a generalized degrees of freedom based criteria. See Ye's paper or Huang and Chen's paper for geostatistical data
Model selection between parametric nonparametric methods
You shouldn't generally use AIC to choose between parametric and nonparametric models. Parametric and nonparametric models have different modeling assumptions. The traditional AIC is based on a functi
Model selection between parametric nonparametric methods You shouldn't generally use AIC to choose between parametric and nonparametric models. Parametric and nonparametric models have different modeling assumptions. The traditional AIC is based on a function of the likelihood. Likelihoods of parametric and nonparametric models are not always comparable. An alternative that in theory can naturally compare parametric and nonparametric is a generalized degrees of freedom based criteria. See Ye's paper or Huang and Chen's paper for geostatistical data
Model selection between parametric nonparametric methods You shouldn't generally use AIC to choose between parametric and nonparametric models. Parametric and nonparametric models have different modeling assumptions. The traditional AIC is based on a functi
43,635
Micro vs weighted F1 score
Micro f1 is based on global precision and recall. It treats each test case equally and doesn't give advantages to small classes. I think it's more suitable. This article "Macro- and micro-averaged evaluation measures" from Vincent Van Asch in U of Antwerp explains many different kinds of f1 scores.
Micro vs weighted F1 score
Micro f1 is based on global precision and recall. It treats each test case equally and doesn't give advantages to small classes. I think it's more suitable. This article "Macro- and micro-averaged eva
Micro vs weighted F1 score Micro f1 is based on global precision and recall. It treats each test case equally and doesn't give advantages to small classes. I think it's more suitable. This article "Macro- and micro-averaged evaluation measures" from Vincent Van Asch in U of Antwerp explains many different kinds of f1 scores.
Micro vs weighted F1 score Micro f1 is based on global precision and recall. It treats each test case equally and doesn't give advantages to small classes. I think it's more suitable. This article "Macro- and micro-averaged eva
43,636
Training LSTM a sequence one item at a time
Train it one character at a time. It shouldn't diverge unless the characters are the same and have different ideal-outputs. In that case consider using one-hot vectors instead of scalar vectors. Meaning if a, b, and c are your characters then if a is the character 1, 0, 0 is the input.
Training LSTM a sequence one item at a time
Train it one character at a time. It shouldn't diverge unless the characters are the same and have different ideal-outputs. In that case consider using one-hot vectors instead of scalar vectors. Meani
Training LSTM a sequence one item at a time Train it one character at a time. It shouldn't diverge unless the characters are the same and have different ideal-outputs. In that case consider using one-hot vectors instead of scalar vectors. Meaning if a, b, and c are your characters then if a is the character 1, 0, 0 is the input.
Training LSTM a sequence one item at a time Train it one character at a time. It shouldn't diverge unless the characters are the same and have different ideal-outputs. In that case consider using one-hot vectors instead of scalar vectors. Meani
43,637
Fastest way to solve Bayes estimator problem
Found a quicker way: We want to minimize $$r(\delta):=E\left(\frac{c\sqrt \theta - \delta}{c\sqrt \theta}\right)^2=E\left(\frac{c^2\theta - 2c\sqrt \theta \delta+\delta ^2}{c^2 \theta}\right)$$ under the posterior distribution. For the no-data problem we get $$ r(\delta) = 1 - \delta 2c^{-1} E\theta^{-1/2} + \delta^2 c^{-2} E\theta^{-1}, $$ which is minimized at $$ \delta = c\frac{E\theta^{-1/2}}{E \theta^{-1}}. $$ For a gamma distributed random variable, $X\sim Gamma(a,b)$, we have, for parameter values such that the integral exists: $$EX^{-c} = \frac{b^a}{\Gamma(a)}\int x^{a-1-c}e^{-bx}=\frac{b^a\Gamma(a-c)}{b^{a-c}\Gamma(a)}.$$ Since the posterior is also gamma, viz. $$p(\theta \mid \mathbf y)\propto \theta^{\alpha + n/2}e^{-\theta (\beta + \sum_i y_i^2 / 2)},$$ the required moments follow directly from this and gives $\delta(\mathbf y).$
Fastest way to solve Bayes estimator problem
Found a quicker way: We want to minimize $$r(\delta):=E\left(\frac{c\sqrt \theta - \delta}{c\sqrt \theta}\right)^2=E\left(\frac{c^2\theta - 2c\sqrt \theta \delta+\delta ^2}{c^2 \theta}\right)$$ unde
Fastest way to solve Bayes estimator problem Found a quicker way: We want to minimize $$r(\delta):=E\left(\frac{c\sqrt \theta - \delta}{c\sqrt \theta}\right)^2=E\left(\frac{c^2\theta - 2c\sqrt \theta \delta+\delta ^2}{c^2 \theta}\right)$$ under the posterior distribution. For the no-data problem we get $$ r(\delta) = 1 - \delta 2c^{-1} E\theta^{-1/2} + \delta^2 c^{-2} E\theta^{-1}, $$ which is minimized at $$ \delta = c\frac{E\theta^{-1/2}}{E \theta^{-1}}. $$ For a gamma distributed random variable, $X\sim Gamma(a,b)$, we have, for parameter values such that the integral exists: $$EX^{-c} = \frac{b^a}{\Gamma(a)}\int x^{a-1-c}e^{-bx}=\frac{b^a\Gamma(a-c)}{b^{a-c}\Gamma(a)}.$$ Since the posterior is also gamma, viz. $$p(\theta \mid \mathbf y)\propto \theta^{\alpha + n/2}e^{-\theta (\beta + \sum_i y_i^2 / 2)},$$ the required moments follow directly from this and gives $\delta(\mathbf y).$
Fastest way to solve Bayes estimator problem Found a quicker way: We want to minimize $$r(\delta):=E\left(\frac{c\sqrt \theta - \delta}{c\sqrt \theta}\right)^2=E\left(\frac{c^2\theta - 2c\sqrt \theta \delta+\delta ^2}{c^2 \theta}\right)$$ unde
43,638
R: Model selection with categorical variables using leaps and glmnet
regsubsets (a function in the leaps package that also performs exhaustive model searches) can accept categorical variables that are not split out into dummy variables and, thus, treats them as groups of variables that are either all part of a model or not. For example, if Year has levels 2013, 2014 and Treatment has levels C,N,O I can run the following statement: > search_output<-regsubsets(y~Year+Treatment,data=stats_df, method="exhaustive") Output: Subset selection object Call: regsubsets.formula(mu_ln ~ Year + Treatment, data = SS_stats_df, nbest = 1, method = "exhaustive") 3 Variables (and intercept) Forced in Forced out Year2014 FALSE FALSE TreatmentN FALSE FALSE TreatmentO FALSE FALSE 1 subsets of each size up to 3 Selection Algorithm: exhaustive > summary(search_output)$which (Intercept) Year2014 TreatmentN TreatmentO 1 TRUE FALSE TRUE FALSE 2 TRUE FALSE TRUE TRUE 3 TRUE TRUE TRUE TRUE When faced with this same problem I found this post very helpful (my answer here is essentially an abbreviated version of the pertinent portion): http://rstudio-pubs-static.s3.amazonaws.com/2897_9220b21cfc0c43a396ff9abf122bb351.html And for recoding or converting to factors or renaming factors these posts are helpful: https://stackoverflow.com/questions/5372896/recoding-variables-with-r http://www.cookbook-r.com/Manipulating_data/Recoding_data/
R: Model selection with categorical variables using leaps and glmnet
regsubsets (a function in the leaps package that also performs exhaustive model searches) can accept categorical variables that are not split out into dummy variables and, thus, treats them as groups
R: Model selection with categorical variables using leaps and glmnet regsubsets (a function in the leaps package that also performs exhaustive model searches) can accept categorical variables that are not split out into dummy variables and, thus, treats them as groups of variables that are either all part of a model or not. For example, if Year has levels 2013, 2014 and Treatment has levels C,N,O I can run the following statement: > search_output<-regsubsets(y~Year+Treatment,data=stats_df, method="exhaustive") Output: Subset selection object Call: regsubsets.formula(mu_ln ~ Year + Treatment, data = SS_stats_df, nbest = 1, method = "exhaustive") 3 Variables (and intercept) Forced in Forced out Year2014 FALSE FALSE TreatmentN FALSE FALSE TreatmentO FALSE FALSE 1 subsets of each size up to 3 Selection Algorithm: exhaustive > summary(search_output)$which (Intercept) Year2014 TreatmentN TreatmentO 1 TRUE FALSE TRUE FALSE 2 TRUE FALSE TRUE TRUE 3 TRUE TRUE TRUE TRUE When faced with this same problem I found this post very helpful (my answer here is essentially an abbreviated version of the pertinent portion): http://rstudio-pubs-static.s3.amazonaws.com/2897_9220b21cfc0c43a396ff9abf122bb351.html And for recoding or converting to factors or renaming factors these posts are helpful: https://stackoverflow.com/questions/5372896/recoding-variables-with-r http://www.cookbook-r.com/Manipulating_data/Recoding_data/
R: Model selection with categorical variables using leaps and glmnet regsubsets (a function in the leaps package that also performs exhaustive model searches) can accept categorical variables that are not split out into dummy variables and, thus, treats them as groups
43,639
Forecasting daily visits using ARIMA with external regressors
An answer without testing/p-values, but with roughly estimating confidence intervals: Adding twice the s.e. (Standard error) on your coefficients should give you approximately 95%-confidence intervals for each one. From that perspective, the 95%-confidence interval for Sunday is roughly speaking between -1800 and -1100, which is far away from the Zero influence assumed for Saturdays. Extending the Argument you see, that Sunday is quite far away from all other days, whereas Mon, Tue, Wed, Thur are quite close together.
Forecasting daily visits using ARIMA with external regressors
An answer without testing/p-values, but with roughly estimating confidence intervals: Adding twice the s.e. (Standard error) on your coefficients should give you approximately 95%-confidence intervals
Forecasting daily visits using ARIMA with external regressors An answer without testing/p-values, but with roughly estimating confidence intervals: Adding twice the s.e. (Standard error) on your coefficients should give you approximately 95%-confidence intervals for each one. From that perspective, the 95%-confidence interval for Sunday is roughly speaking between -1800 and -1100, which is far away from the Zero influence assumed for Saturdays. Extending the Argument you see, that Sunday is quite far away from all other days, whereas Mon, Tue, Wed, Thur are quite close together.
Forecasting daily visits using ARIMA with external regressors An answer without testing/p-values, but with roughly estimating confidence intervals: Adding twice the s.e. (Standard error) on your coefficients should give you approximately 95%-confidence intervals
43,640
How to test causation in econometrics?
I want to suggest reading an interview with Angus Deaton, the most recent Nobel Laureate in economics, for a frank assessment of the issues raised by the OPs "channel" question regarding their "test and comparison"...here's the link: https://medium.com/@timothyogden/experimental-conversations-angus-deaton-b2f768dffd57#.jr9a1ea8w And here's a quote: People turned to RCTs (random control trials) because they got tired of all the arguments over observational studies about exogeneity and instruments and sample selectivity and all the rest of it. But all of those problems come back in somewhat different forms in RCTs. So I don’t see a difference in terms of quality of evidence or usefulness. There are bad studies of all sorts. Deaton's point is an honest assessment of the difficulties of untangling ("testing and comparing") confounded information. It is also a point that has been made by many others in other contexts. For instance, the excellent Cosima Shalizi, in a paper critiquing the social network analyses of James Fowler and Nicholas Christakis (http://smr.sagepub.com/content/40/2/211.abstract), notes that several processes analyzed by social theorists are generically confounded: Homophily, or the formation of social ties due to matching individual traits; social contagion, also known as social influence; and the causal effect of an individual’s covariates on his or her behavior or other measurable responses. Similarly in studies of aging, it has been noted that the challenges associated with untangling the confounding effects of age, cohort, and temporal period effects are virtually insuperable. Econometrics is no different in this regard. The metrics or "channels" may have changed, but the difficulties of reliably and accurately decomposing confounding effects related to education, health, poverty, status, wealth, income, etc., remain. The irony of Deaton's point throughout the interview is that RCTs -- the naively imagined "magic bullet" and gold standard for many -- are not able to resolve the problems. As one poster to this thread noted, at that point, "theory" becomes your best guide. Of course, multiple, widely differing theories can all provide an adequate fit to the same data.
How to test causation in econometrics?
I want to suggest reading an interview with Angus Deaton, the most recent Nobel Laureate in economics, for a frank assessment of the issues raised by the OPs "channel" question regarding their "test a
How to test causation in econometrics? I want to suggest reading an interview with Angus Deaton, the most recent Nobel Laureate in economics, for a frank assessment of the issues raised by the OPs "channel" question regarding their "test and comparison"...here's the link: https://medium.com/@timothyogden/experimental-conversations-angus-deaton-b2f768dffd57#.jr9a1ea8w And here's a quote: People turned to RCTs (random control trials) because they got tired of all the arguments over observational studies about exogeneity and instruments and sample selectivity and all the rest of it. But all of those problems come back in somewhat different forms in RCTs. So I don’t see a difference in terms of quality of evidence or usefulness. There are bad studies of all sorts. Deaton's point is an honest assessment of the difficulties of untangling ("testing and comparing") confounded information. It is also a point that has been made by many others in other contexts. For instance, the excellent Cosima Shalizi, in a paper critiquing the social network analyses of James Fowler and Nicholas Christakis (http://smr.sagepub.com/content/40/2/211.abstract), notes that several processes analyzed by social theorists are generically confounded: Homophily, or the formation of social ties due to matching individual traits; social contagion, also known as social influence; and the causal effect of an individual’s covariates on his or her behavior or other measurable responses. Similarly in studies of aging, it has been noted that the challenges associated with untangling the confounding effects of age, cohort, and temporal period effects are virtually insuperable. Econometrics is no different in this regard. The metrics or "channels" may have changed, but the difficulties of reliably and accurately decomposing confounding effects related to education, health, poverty, status, wealth, income, etc., remain. The irony of Deaton's point throughout the interview is that RCTs -- the naively imagined "magic bullet" and gold standard for many -- are not able to resolve the problems. As one poster to this thread noted, at that point, "theory" becomes your best guide. Of course, multiple, widely differing theories can all provide an adequate fit to the same data.
How to test causation in econometrics? I want to suggest reading an interview with Angus Deaton, the most recent Nobel Laureate in economics, for a frank assessment of the issues raised by the OPs "channel" question regarding their "test a
43,641
How to test causation in econometrics?
If you have a regression model $y=b_0+b_1 x_1 +b_2 x_2 + e$, then $\sigma^2_y=b_1^2\sigma^2_{x_1}+b_2^2\sigma^2_{x_2}+b_1b_2\sigma_{x_1,x_2}+b_1\sigma^2_e$. In this regard you could see $\sigma^2_{x_1}\beta^2_1$ as the part of variance $\sigma^2_y$ channeled through variable $x_1$, IF the covariance $\sigma_{x_1,x_2}$ between your variables is low. It's an analogy to a spectral density, but in spectral analysis your waves are oethogonal. In econometrics your variables are rarely orthogonal. However, you try not to have multi collinearity, so this way to separate the channels still has some meaning.
How to test causation in econometrics?
If you have a regression model $y=b_0+b_1 x_1 +b_2 x_2 + e$, then $\sigma^2_y=b_1^2\sigma^2_{x_1}+b_2^2\sigma^2_{x_2}+b_1b_2\sigma_{x_1,x_2}+b_1\sigma^2_e$. In this regard you could see $\sigma^2_{x_1
How to test causation in econometrics? If you have a regression model $y=b_0+b_1 x_1 +b_2 x_2 + e$, then $\sigma^2_y=b_1^2\sigma^2_{x_1}+b_2^2\sigma^2_{x_2}+b_1b_2\sigma_{x_1,x_2}+b_1\sigma^2_e$. In this regard you could see $\sigma^2_{x_1}\beta^2_1$ as the part of variance $\sigma^2_y$ channeled through variable $x_1$, IF the covariance $\sigma_{x_1,x_2}$ between your variables is low. It's an analogy to a spectral density, but in spectral analysis your waves are oethogonal. In econometrics your variables are rarely orthogonal. However, you try not to have multi collinearity, so this way to separate the channels still has some meaning.
How to test causation in econometrics? If you have a regression model $y=b_0+b_1 x_1 +b_2 x_2 + e$, then $\sigma^2_y=b_1^2\sigma^2_{x_1}+b_2^2\sigma^2_{x_2}+b_1b_2\sigma_{x_1,x_2}+b_1\sigma^2_e$. In this regard you could see $\sigma^2_{x_1
43,642
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix?
Instruction how you can compute sums of squares SSt, SSb, SSw out of matrix of distances (euclidean) between cases (data points) without having at hand the cases x variables dataset. You don't need to know the centroids' coordinates (the group means) - they pass invisibly "on the background": euclidean geometry laws allow so. Let $\bf D$ be the N x N matrix of squared euclidean distances between the cases, and $G$ is the N x 1 column of group labels (k groups). Create binary dummy variables, aka N x k design matrix: $\mathbf G=design(G)$. [I'll accompany the formulas with example data shared with this answer. The code is SPSS Matrix session syntax, almost a pseudocode-easy to understand.] This is the raw data X (p=2 variables, columns), with N=6 cases: n(1)=3, n(2)=2, n(3)=1 V1 V2 Group 2.06 7.73 1 .67 5.27 1 6.62 9.36 1 3.16 5.23 2 7.66 1.27 2 5.59 9.83 3 ------------------------------------ comp X= {2.06, 7.73; .67, 5.27; 6.62, 9.36; 3.16, 5.23; 7.66, 1.27; 5.59, 9.83}. comp g= {1;1;1;2;2;3}. !seuclid(X%D). /*This function to compute squared euclidean distances is taken from my web-page, it is techically more convenient here than to call regular SPSS command to do it print D. D .0000 7.9837 23.4505 7.4600 73.0916 16.8709 7.9837 .0000 52.1306 6.2017 64.8601 45.0000 23.4505 52.1306 .0000 29.0285 66.5297 1.2818 7.4600 6.2017 29.0285 .0000 35.9316 27.0649 73.0916 64.8601 66.5297 35.9316 .0000 77.5585 16.8709 45.0000 1.2818 27.0649 77.5585 .0000 comp G= design(g). print G. G 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 comp Nt= nrow(G). comp n= csum(G). print Nt. /*This is total N print n. /*Group frequencies Nt 6 n 3 2 1 Quick method. Use if you want just the above three scalars. As mentioned in here or here, the sum of squared deviations from centroid is equal to the sum of pairwise squared Euclidean distances divided by the number of points. Then follows: Total sum-of-squares (of deviations from grand centroid): $SS_t= \frac{\sum \bf D}{2N}$, where $\sum$ is the sum in the entire matrix. Pooled within-group sum-of-squares (of deviations from group centroids): $SS_w= \sum \frac{diag(\bf G'DG)}{2\bf n'}$, where $\bf n$ is the k-length row vector of within-group frequencies, i.e. column sums in $\bf G$. Without the summation $\sum$ you have the k-length column vector: $SS_w$ in each group. Between-group sum-of-squares is, of course, $SS_b=SS_t-SS_w$. comp SSt= msum(D)/(2*Nt). print SSt. SSt 89.07401667 comp SSw= diag(t(G)*D*G)/(2*t(n)). print SSw. /*By groups SSw 27.85493333 17.96580000 .00000000 comp SSw= csum(SSw). print SSw. /*And summed (pooled SSw) SSw 45.82073333 comp SSb= SSt-SSw. print SSb. SSb 43.25328333 Slower method. Use if you will need also to know some multivariate properties of the data, such as eigenvalues of the principal directions spanned by the data cloud (needed, for example, in multidimensional scaling). Convert $\bf D$ into its double-centered matrix $\bf S$, explained here and here. As noted in the 2nd link, one of its properties is that $trace(\mathbf S)=trace(\mathbf {T})=SS_t$, and (first nonzero) eigenvalues of $\bf S$ are the same as of $\bf T$ - the scatter matrix of the original (or implied, hypothetical) cases x variables data. comp rmean= (rsum(D)/ncol(D))*make(1,ncol(D),1). comp S= (rmean+t(rmean)-D-msum(D)/ncol(D)**2)/2. print S. S 6.63045 6.58188 -1.46444 .96961 -14.15579 1.43828 6.58188 14.51701 -11.86120 5.54205 -6.09675 -8.68299 -1.46444 -11.86120 13.89118 -6.18427 -7.24447 12.86320 .96961 5.54205 -6.18427 2.76878 2.49338 -5.58955 -14.15579 -6.09675 -7.24447 2.49338 38.14958 -13.14595 1.43828 -8.68299 12.86320 -5.58955 -13.14595 13.11701 comp SSt= trace(S). print SSt. SSt 89.07401667 Of course, you can do likewise the double centration also on each group distance submatrix; the traces of the $\bf S$s will be each group's SSwithin, which summation yields pooled $SS_w$. If you need to compute matrix $\bf C$ of squared euclidean distances between group centroids, compute these ingredients: $\bf E= G'DG$; $\mathbf Q= \frac{diag(\bf E)n^2}{2}$, (n is a row vector and diag is a column); $\bf F=n'n$. Then $\bf C= (E-\frac{Q+Q'}{F})/F$. comp E= t(G)*D*G. print E. E 167.1296 247.1716 63.1527 247.1716 71.8632 104.6234 63.1527 104.6234 .0000 comp Q= (diag(E)*n&**2)/2. print Q. Q 752.0832 334.2592 83.5648 323.3844 143.7264 35.9316 .0000 .0000 .0000 comp F= sscp(n). print F. F 9.0000 6.0000 3.0000 6.0000 4.0000 2.0000 3.0000 2.0000 1.0000 comp C= (E-(Q+t(Q))/F)/F. print C. C .0000 22.9274 11.7659 22.9274 .0000 43.3288 11.7659 43.3288 .0000 Of course, $SS_b$ - if you still don't know it - can be obviously obtained from it (within group frequency is the weight). Bonus instructions. How to compute SSt, SSb, SSw when you do have the original N cases x p variables data X. Many ways are possible. One of the most efficient (fast) matrix way with data of typical size is as follows. Matrix of group means (centroids), k groups x p variables: $\bf M= \frac{G'X}{n'[1]}$, where $[1]$ is the p-length row of ones; $\bf n$ is a row defined earlier; $\bf G$ also see above; $\bf X$ is the data with columns (variables) centered about their grand means. Total scatter matrix $\bf T=X'X$, and $SS_t= trace(\mathbf T)$. Between-group scatter matrix $\bf B=(GM)'(GM)$, and $SS_b= trace(\mathbf B)$. Pooled within-group scatter matrix $\bf W=T-B$, and $SS_w= trace(\mathbf W)= SS_t-SS_b$. X with columns centered -2.2333 1.2817 -3.6233 -1.1783 2.3267 2.9117 -1.1333 -1.2183 3.3667 -5.1783 1.2967 3.3817 comp M= (t(G)*X)/(t(n)*make(1,ncol(X),1)). print M. M -1.1767 1.0050 1.1167 -3.1983 1.2967 3.3817 comp Tot= sscp(X). /*T scatter matrix print Tot. print trace(Tot). Tot 37.8299 -3.4865 -3.4865 51.2441 TRACE(Tot) 89.07401667 comp GM= G*M. comp B= sscp(GM). /*B scatter matrix print B. print trace(B). B 8.3289 -6.3057 -6.3057 34.9244 TRACE(B) 43.25328333 comp W= Tot-B. /*W scatter matrix print W. print trace(W). W 29.5011 2.8192 2.8192 16.3197 TRACE(W) 45.82073333 (If you do not center $\bf X$ initially, $\bf W=T-B$ persists, and gives the same $\bf W$ as before, however $\bf M$, $\bf T$, and $\bf B$ matrices will be different from what before.)
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix?
Instruction how you can compute sums of squares SSt, SSb, SSw out of matrix of distances (euclidean) between cases (data points) without having at hand the cases x variables dataset. You don't need to
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix? Instruction how you can compute sums of squares SSt, SSb, SSw out of matrix of distances (euclidean) between cases (data points) without having at hand the cases x variables dataset. You don't need to know the centroids' coordinates (the group means) - they pass invisibly "on the background": euclidean geometry laws allow so. Let $\bf D$ be the N x N matrix of squared euclidean distances between the cases, and $G$ is the N x 1 column of group labels (k groups). Create binary dummy variables, aka N x k design matrix: $\mathbf G=design(G)$. [I'll accompany the formulas with example data shared with this answer. The code is SPSS Matrix session syntax, almost a pseudocode-easy to understand.] This is the raw data X (p=2 variables, columns), with N=6 cases: n(1)=3, n(2)=2, n(3)=1 V1 V2 Group 2.06 7.73 1 .67 5.27 1 6.62 9.36 1 3.16 5.23 2 7.66 1.27 2 5.59 9.83 3 ------------------------------------ comp X= {2.06, 7.73; .67, 5.27; 6.62, 9.36; 3.16, 5.23; 7.66, 1.27; 5.59, 9.83}. comp g= {1;1;1;2;2;3}. !seuclid(X%D). /*This function to compute squared euclidean distances is taken from my web-page, it is techically more convenient here than to call regular SPSS command to do it print D. D .0000 7.9837 23.4505 7.4600 73.0916 16.8709 7.9837 .0000 52.1306 6.2017 64.8601 45.0000 23.4505 52.1306 .0000 29.0285 66.5297 1.2818 7.4600 6.2017 29.0285 .0000 35.9316 27.0649 73.0916 64.8601 66.5297 35.9316 .0000 77.5585 16.8709 45.0000 1.2818 27.0649 77.5585 .0000 comp G= design(g). print G. G 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 comp Nt= nrow(G). comp n= csum(G). print Nt. /*This is total N print n. /*Group frequencies Nt 6 n 3 2 1 Quick method. Use if you want just the above three scalars. As mentioned in here or here, the sum of squared deviations from centroid is equal to the sum of pairwise squared Euclidean distances divided by the number of points. Then follows: Total sum-of-squares (of deviations from grand centroid): $SS_t= \frac{\sum \bf D}{2N}$, where $\sum$ is the sum in the entire matrix. Pooled within-group sum-of-squares (of deviations from group centroids): $SS_w= \sum \frac{diag(\bf G'DG)}{2\bf n'}$, where $\bf n$ is the k-length row vector of within-group frequencies, i.e. column sums in $\bf G$. Without the summation $\sum$ you have the k-length column vector: $SS_w$ in each group. Between-group sum-of-squares is, of course, $SS_b=SS_t-SS_w$. comp SSt= msum(D)/(2*Nt). print SSt. SSt 89.07401667 comp SSw= diag(t(G)*D*G)/(2*t(n)). print SSw. /*By groups SSw 27.85493333 17.96580000 .00000000 comp SSw= csum(SSw). print SSw. /*And summed (pooled SSw) SSw 45.82073333 comp SSb= SSt-SSw. print SSb. SSb 43.25328333 Slower method. Use if you will need also to know some multivariate properties of the data, such as eigenvalues of the principal directions spanned by the data cloud (needed, for example, in multidimensional scaling). Convert $\bf D$ into its double-centered matrix $\bf S$, explained here and here. As noted in the 2nd link, one of its properties is that $trace(\mathbf S)=trace(\mathbf {T})=SS_t$, and (first nonzero) eigenvalues of $\bf S$ are the same as of $\bf T$ - the scatter matrix of the original (or implied, hypothetical) cases x variables data. comp rmean= (rsum(D)/ncol(D))*make(1,ncol(D),1). comp S= (rmean+t(rmean)-D-msum(D)/ncol(D)**2)/2. print S. S 6.63045 6.58188 -1.46444 .96961 -14.15579 1.43828 6.58188 14.51701 -11.86120 5.54205 -6.09675 -8.68299 -1.46444 -11.86120 13.89118 -6.18427 -7.24447 12.86320 .96961 5.54205 -6.18427 2.76878 2.49338 -5.58955 -14.15579 -6.09675 -7.24447 2.49338 38.14958 -13.14595 1.43828 -8.68299 12.86320 -5.58955 -13.14595 13.11701 comp SSt= trace(S). print SSt. SSt 89.07401667 Of course, you can do likewise the double centration also on each group distance submatrix; the traces of the $\bf S$s will be each group's SSwithin, which summation yields pooled $SS_w$. If you need to compute matrix $\bf C$ of squared euclidean distances between group centroids, compute these ingredients: $\bf E= G'DG$; $\mathbf Q= \frac{diag(\bf E)n^2}{2}$, (n is a row vector and diag is a column); $\bf F=n'n$. Then $\bf C= (E-\frac{Q+Q'}{F})/F$. comp E= t(G)*D*G. print E. E 167.1296 247.1716 63.1527 247.1716 71.8632 104.6234 63.1527 104.6234 .0000 comp Q= (diag(E)*n&**2)/2. print Q. Q 752.0832 334.2592 83.5648 323.3844 143.7264 35.9316 .0000 .0000 .0000 comp F= sscp(n). print F. F 9.0000 6.0000 3.0000 6.0000 4.0000 2.0000 3.0000 2.0000 1.0000 comp C= (E-(Q+t(Q))/F)/F. print C. C .0000 22.9274 11.7659 22.9274 .0000 43.3288 11.7659 43.3288 .0000 Of course, $SS_b$ - if you still don't know it - can be obviously obtained from it (within group frequency is the weight). Bonus instructions. How to compute SSt, SSb, SSw when you do have the original N cases x p variables data X. Many ways are possible. One of the most efficient (fast) matrix way with data of typical size is as follows. Matrix of group means (centroids), k groups x p variables: $\bf M= \frac{G'X}{n'[1]}$, where $[1]$ is the p-length row of ones; $\bf n$ is a row defined earlier; $\bf G$ also see above; $\bf X$ is the data with columns (variables) centered about their grand means. Total scatter matrix $\bf T=X'X$, and $SS_t= trace(\mathbf T)$. Between-group scatter matrix $\bf B=(GM)'(GM)$, and $SS_b= trace(\mathbf B)$. Pooled within-group scatter matrix $\bf W=T-B$, and $SS_w= trace(\mathbf W)= SS_t-SS_b$. X with columns centered -2.2333 1.2817 -3.6233 -1.1783 2.3267 2.9117 -1.1333 -1.2183 3.3667 -5.1783 1.2967 3.3817 comp M= (t(G)*X)/(t(n)*make(1,ncol(X),1)). print M. M -1.1767 1.0050 1.1167 -3.1983 1.2967 3.3817 comp Tot= sscp(X). /*T scatter matrix print Tot. print trace(Tot). Tot 37.8299 -3.4865 -3.4865 51.2441 TRACE(Tot) 89.07401667 comp GM= G*M. comp B= sscp(GM). /*B scatter matrix print B. print trace(B). B 8.3289 -6.3057 -6.3057 34.9244 TRACE(B) 43.25328333 comp W= Tot-B. /*W scatter matrix print W. print trace(W). W 29.5011 2.8192 2.8192 16.3197 TRACE(W) 45.82073333 (If you do not center $\bf X$ initially, $\bf W=T-B$ persists, and gives the same $\bf W$ as before, however $\bf M$, $\bf T$, and $\bf B$ matrices will be different from what before.)
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix? Instruction how you can compute sums of squares SSt, SSb, SSw out of matrix of distances (euclidean) between cases (data points) without having at hand the cases x variables dataset. You don't need to
43,643
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix?
Sum of squares is closely tied to Euclidean distance. Hamming (on bits) is a special case, as it is the same as Euclidean (on bits), but you cannot conclude from an arbitrary distance matrix what the SSQ etc. are. Recall how the sum-of-squares are usually defined, compared to Euclidean distance: $$ SSQ(A,B) = \sum_{a\in A} \sum_{b\in B} \sum_i (a_i-b_i)^2 \\ = \sum_{a\in A} \sum_{b\in B} d^2_{\text{Euclidean}}(a, b) $$ So if your distance matrix stores Euclidean distances (or squared Euclidean), then you can use that second line to compute SSQ. If you have a different distance function, the result will usually be wrong (unless you use a different definition of "sum of squares" than the usual one; I believe you could use the second line, but this may cause trouble in other situations such as k-means).
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix?
Sum of squares is closely tied to Euclidean distance. Hamming (on bits) is a special case, as it is the same as Euclidean (on bits), but you cannot conclude from an arbitrary distance matrix what the
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix? Sum of squares is closely tied to Euclidean distance. Hamming (on bits) is a special case, as it is the same as Euclidean (on bits), but you cannot conclude from an arbitrary distance matrix what the SSQ etc. are. Recall how the sum-of-squares are usually defined, compared to Euclidean distance: $$ SSQ(A,B) = \sum_{a\in A} \sum_{b\in B} \sum_i (a_i-b_i)^2 \\ = \sum_{a\in A} \sum_{b\in B} d^2_{\text{Euclidean}}(a, b) $$ So if your distance matrix stores Euclidean distances (or squared Euclidean), then you can use that second line to compute SSQ. If you have a different distance function, the result will usually be wrong (unless you use a different definition of "sum of squares" than the usual one; I believe you could use the second line, but this may cause trouble in other situations such as k-means).
Sums-of-Squares (total, between, within): how to compute them from a Distance Matrix? Sum of squares is closely tied to Euclidean distance. Hamming (on bits) is a special case, as it is the same as Euclidean (on bits), but you cannot conclude from an arbitrary distance matrix what the
43,644
Multinomial logistic regression assumptions
The key assumption in the MNL is that the errors are independently and identically distributed with a Gumbel extreme value distribution. The problem with testing this assumption is that it is made a priori. In standard regression you fit the least-squares curve, and measure the residual error. In a logit model, you assume that the error is already in the measurement of the point, and compute a likelihood function from that assumption. An important assumption is that the sample be exogenous. If it is choice-based, there are corrections that need to be employed. As far as assumptions on the model itself, Train describes three: Systematic, and non-random, taste variation. Proportional substitution among alternatives (a consequence of the IIA property). No serial correlation in the error term (panel data). The first assumption you mostly just have to defend in the context of your problem. The third is largely the same, because the error terms are purely random. The second is testable to a certain extent, however. If you specify a nested logit model, and it turns out that the inter-nest substitution pattern is entirely flexible ($\lambda = 1$) then you could have used the MNL model, and the IIA assumption is valid. But remember that the log-likelihood function for the nested logit model has local maxima, so you should make sure that you get $\lambda =1$ consistently. As far as doing any of this in SPSS, I can't help you other than suggest you use the mlogit package in R instead. Sorry.
Multinomial logistic regression assumptions
The key assumption in the MNL is that the errors are independently and identically distributed with a Gumbel extreme value distribution. The problem with testing this assumption is that it is made a p
Multinomial logistic regression assumptions The key assumption in the MNL is that the errors are independently and identically distributed with a Gumbel extreme value distribution. The problem with testing this assumption is that it is made a priori. In standard regression you fit the least-squares curve, and measure the residual error. In a logit model, you assume that the error is already in the measurement of the point, and compute a likelihood function from that assumption. An important assumption is that the sample be exogenous. If it is choice-based, there are corrections that need to be employed. As far as assumptions on the model itself, Train describes three: Systematic, and non-random, taste variation. Proportional substitution among alternatives (a consequence of the IIA property). No serial correlation in the error term (panel data). The first assumption you mostly just have to defend in the context of your problem. The third is largely the same, because the error terms are purely random. The second is testable to a certain extent, however. If you specify a nested logit model, and it turns out that the inter-nest substitution pattern is entirely flexible ($\lambda = 1$) then you could have used the MNL model, and the IIA assumption is valid. But remember that the log-likelihood function for the nested logit model has local maxima, so you should make sure that you get $\lambda =1$ consistently. As far as doing any of this in SPSS, I can't help you other than suggest you use the mlogit package in R instead. Sorry.
Multinomial logistic regression assumptions The key assumption in the MNL is that the errors are independently and identically distributed with a Gumbel extreme value distribution. The problem with testing this assumption is that it is made a p
43,645
Multinomial logistic regression assumptions
Assumptions: Outcome follows a categorical distribution (http://en.wikipedia.org/wiki/Categorical_distribution), which is linked to the covariates via a link function as in ordinary logistic regression Independence of observational units Linear relation between covariates and (link-transformed) expectation of the outcome For assumption 1 to be fulfilled, the categories of your outcome need to be exclusive (non-overlapping) and exhaustive (covering all possible forms the outcome can take). I don't really know if there are any proper statistical tests for assumption 2. For time-series data there is a test of autocorrelation called Durbin-Watson test. For other forms of correlated data, I think you would rather make that decision based on theoretical considerations (e.g., if your data come are derived from a cluster-sampling procedure, you would expect the data within clusters to be correlated). As for assumption 3, in binary logistic regression you can plot binned residuals against estimated probabilities to see if the average residual is around 0 over the entire range of estimated probabilities. I suppose this can be generalized to multinomial regression by making (k-1) such plots instead for the different categories of an outcome with k categories. EDIT: Concerning alternative models: Assumption 1 is fairly straightforward to fulfill. You might run into trouble because you have to estimate a large number of parameters (k-1 different sets of intercepts and slope parameters). In such a case, you could for example collapse the outcome into a binary outcome and do a simple logistic regression. If assumption 2 is violated, you could use a mixed model, which allows you to specify a dependence structure- As for assumption 3, you could transform variables of which you suspect that they have a non-linear effect. A common transformation is for example to include age squared in health-related outcomes.
Multinomial logistic regression assumptions
Assumptions: Outcome follows a categorical distribution (http://en.wikipedia.org/wiki/Categorical_distribution), which is linked to the covariates via a link function as in ordinary logistic regressi
Multinomial logistic regression assumptions Assumptions: Outcome follows a categorical distribution (http://en.wikipedia.org/wiki/Categorical_distribution), which is linked to the covariates via a link function as in ordinary logistic regression Independence of observational units Linear relation between covariates and (link-transformed) expectation of the outcome For assumption 1 to be fulfilled, the categories of your outcome need to be exclusive (non-overlapping) and exhaustive (covering all possible forms the outcome can take). I don't really know if there are any proper statistical tests for assumption 2. For time-series data there is a test of autocorrelation called Durbin-Watson test. For other forms of correlated data, I think you would rather make that decision based on theoretical considerations (e.g., if your data come are derived from a cluster-sampling procedure, you would expect the data within clusters to be correlated). As for assumption 3, in binary logistic regression you can plot binned residuals against estimated probabilities to see if the average residual is around 0 over the entire range of estimated probabilities. I suppose this can be generalized to multinomial regression by making (k-1) such plots instead for the different categories of an outcome with k categories. EDIT: Concerning alternative models: Assumption 1 is fairly straightforward to fulfill. You might run into trouble because you have to estimate a large number of parameters (k-1 different sets of intercepts and slope parameters). In such a case, you could for example collapse the outcome into a binary outcome and do a simple logistic regression. If assumption 2 is violated, you could use a mixed model, which allows you to specify a dependence structure- As for assumption 3, you could transform variables of which you suspect that they have a non-linear effect. A common transformation is for example to include age squared in health-related outcomes.
Multinomial logistic regression assumptions Assumptions: Outcome follows a categorical distribution (http://en.wikipedia.org/wiki/Categorical_distribution), which is linked to the covariates via a link function as in ordinary logistic regressi
43,646
Multinomial logistic regression assumptions
One of the most important practical assumptions of multinomial logistic is that the number of observations in the smallest frequency category of $Y$ is large, for example 10 times the number of parameters from the right hand side of the model.
Multinomial logistic regression assumptions
One of the most important practical assumptions of multinomial logistic is that the number of observations in the smallest frequency category of $Y$ is large, for example 10 times the number of parame
Multinomial logistic regression assumptions One of the most important practical assumptions of multinomial logistic is that the number of observations in the smallest frequency category of $Y$ is large, for example 10 times the number of parameters from the right hand side of the model.
Multinomial logistic regression assumptions One of the most important practical assumptions of multinomial logistic is that the number of observations in the smallest frequency category of $Y$ is large, for example 10 times the number of parame
43,647
Multinomial logistic regression assumptions
@h_bauer has provided a good answer. Let me add a small complementary point: You can also test for a curvilinear relationship by adding curvilinear terms and performing a nested model test. For example, imagine you have $X_1$ as an explanatory variable, but you aren't sure whether the relationship between it and the link transformed expectation is a straight line. You could form a new model by adding $X_1^2$, and $X_1^3$, and then test to see if your new model fits better than your original model. Another assumption of generalized linear models, like the multinomial logistic, is that the link function is correct. Strictly speaking, multinomial logistic regression uses only the logit link, but there are other multinomial model possibilities, such as the multinomial probit. Many people (somewhat sloppily) refer to any such model as "logistic" meaning only that the response variable is categorical, but the term really only properly refers to the logit link. For more on links, it may help you to read my answer here: Difference between logit and probit models. Regarding addressing violations of these assumptions, it is mostly self-explanatory. If the observations are not independent, you can add the relevant fixed or random effects to make them so. If the relationship with a predictor is not linear, you can add transformed variables so that it is linear in the augmented predictor space. If the link is not appropriate, you can change it, etc. In general, multinomial logistic regression does not make very constraining assumptions.
Multinomial logistic regression assumptions
@h_bauer has provided a good answer. Let me add a small complementary point: You can also test for a curvilinear relationship by adding curvilinear terms and performing a nested model test. For exa
Multinomial logistic regression assumptions @h_bauer has provided a good answer. Let me add a small complementary point: You can also test for a curvilinear relationship by adding curvilinear terms and performing a nested model test. For example, imagine you have $X_1$ as an explanatory variable, but you aren't sure whether the relationship between it and the link transformed expectation is a straight line. You could form a new model by adding $X_1^2$, and $X_1^3$, and then test to see if your new model fits better than your original model. Another assumption of generalized linear models, like the multinomial logistic, is that the link function is correct. Strictly speaking, multinomial logistic regression uses only the logit link, but there are other multinomial model possibilities, such as the multinomial probit. Many people (somewhat sloppily) refer to any such model as "logistic" meaning only that the response variable is categorical, but the term really only properly refers to the logit link. For more on links, it may help you to read my answer here: Difference between logit and probit models. Regarding addressing violations of these assumptions, it is mostly self-explanatory. If the observations are not independent, you can add the relevant fixed or random effects to make them so. If the relationship with a predictor is not linear, you can add transformed variables so that it is linear in the augmented predictor space. If the link is not appropriate, you can change it, etc. In general, multinomial logistic regression does not make very constraining assumptions.
Multinomial logistic regression assumptions @h_bauer has provided a good answer. Let me add a small complementary point: You can also test for a curvilinear relationship by adding curvilinear terms and performing a nested model test. For exa
43,648
Multinomial logistic regression assumptions
gmacfarlane has been very clear. But to be more precise, and I assume you perform a cross section analysis, the core assumption is the IIA (independence of irrelevant alternatives). You can not force your data fit into the IIA assumption, you should test it and hope for it to be satisfied. SPSS could not handle the test until 2010 for sure. R of course does it, but it might me easier for you to migrate to Stata and implement the IIA tests provided by the mlogit postestimation commands. If the IIA does not holds, mixed multinomial logit or nested logit are reasonable alternatives. The first one can be estimated within the gllamm, the second with the far more parsimonious nlogit command.
Multinomial logistic regression assumptions
gmacfarlane has been very clear. But to be more precise, and I assume you perform a cross section analysis, the core assumption is the IIA (independence of irrelevant alternatives). You can not force
Multinomial logistic regression assumptions gmacfarlane has been very clear. But to be more precise, and I assume you perform a cross section analysis, the core assumption is the IIA (independence of irrelevant alternatives). You can not force your data fit into the IIA assumption, you should test it and hope for it to be satisfied. SPSS could not handle the test until 2010 for sure. R of course does it, but it might me easier for you to migrate to Stata and implement the IIA tests provided by the mlogit postestimation commands. If the IIA does not holds, mixed multinomial logit or nested logit are reasonable alternatives. The first one can be estimated within the gllamm, the second with the far more parsimonious nlogit command.
Multinomial logistic regression assumptions gmacfarlane has been very clear. But to be more precise, and I assume you perform a cross section analysis, the core assumption is the IIA (independence of irrelevant alternatives). You can not force
43,649
Are log-linear models exponential models?
It is hard to say what is "usually referred to" without more context, as terminology is not well standardized across fields. In the most common statistical context, I would say "log-linear model" refers to a Poisson GLM that is applied to a multi-way contingency table and presented in a special form. This is the way Agresti uses the term in his Categorical Data Anaysis, for example (Google book search). I have an R-based example of using a log-linear model here: $χ^2$ of multidimensional data.
Are log-linear models exponential models?
It is hard to say what is "usually referred to" without more context, as terminology is not well standardized across fields. In the most common statistical context, I would say "log-linear model" re
Are log-linear models exponential models? It is hard to say what is "usually referred to" without more context, as terminology is not well standardized across fields. In the most common statistical context, I would say "log-linear model" refers to a Poisson GLM that is applied to a multi-way contingency table and presented in a special form. This is the way Agresti uses the term in his Categorical Data Anaysis, for example (Google book search). I have an R-based example of using a log-linear model here: $χ^2$ of multidimensional data.
Are log-linear models exponential models? It is hard to say what is "usually referred to" without more context, as terminology is not well standardized across fields. In the most common statistical context, I would say "log-linear model" re
43,650
Are log-linear models exponential models?
They are different, but it's a bit ambiguous without extra context. Log-linear models usually refer to an OLS linear model with logged response, or sometimes a GLM with a Normal family, log link function. The Normal distribution is in the exponential family. If you actually have an exponential response, you would use a GLM with Gamma family, but this typically uses the inverse link, not a log. Also in the exponential family.
Are log-linear models exponential models?
They are different, but it's a bit ambiguous without extra context. Log-linear models usually refer to an OLS linear model with logged response, or sometimes a GLM with a Normal family, log link func
Are log-linear models exponential models? They are different, but it's a bit ambiguous without extra context. Log-linear models usually refer to an OLS linear model with logged response, or sometimes a GLM with a Normal family, log link function. The Normal distribution is in the exponential family. If you actually have an exponential response, you would use a GLM with Gamma family, but this typically uses the inverse link, not a log. Also in the exponential family.
Are log-linear models exponential models? They are different, but it's a bit ambiguous without extra context. Log-linear models usually refer to an OLS linear model with logged response, or sometimes a GLM with a Normal family, log link func
43,651
Reference for the idea that a simpler model can be used when the range of data values is smaller
I think that this is not a reference-able concept, it's just about relative error. What you call "range of data values" is usually called "scale", and you would just say that a certain theory is enough descriptive for this scale. In the example of the rock, $F=-mg$ is enough to describe the dynamics of the rock, in the sense that the error you make by the theory is smaller than the typical measurement error. In this particular case, is called linearisation, and is typical when you have non lineal equations of motion and you want to use them in a small neighbourhood. In statistics, I would see an equivalent in error measures that contain a cost for the amount of parameters of the model (Akaike or Bayesian Information Criteria, for example). You measure the error you make for models with a different amount of parameters, and at some point the error reduction that you make for adding a new parameter would not be enough to compensate the cost you predefined; be careful with those though, since the definition of the cost is crucial.
Reference for the idea that a simpler model can be used when the range of data values is smaller
I think that this is not a reference-able concept, it's just about relative error. What you call "range of data values" is usually called "scale", and you would just say that a certain theory is enoug
Reference for the idea that a simpler model can be used when the range of data values is smaller I think that this is not a reference-able concept, it's just about relative error. What you call "range of data values" is usually called "scale", and you would just say that a certain theory is enough descriptive for this scale. In the example of the rock, $F=-mg$ is enough to describe the dynamics of the rock, in the sense that the error you make by the theory is smaller than the typical measurement error. In this particular case, is called linearisation, and is typical when you have non lineal equations of motion and you want to use them in a small neighbourhood. In statistics, I would see an equivalent in error measures that contain a cost for the amount of parameters of the model (Akaike or Bayesian Information Criteria, for example). You measure the error you make for models with a different amount of parameters, and at some point the error reduction that you make for adding a new parameter would not be enough to compensate the cost you predefined; be careful with those though, since the definition of the cost is crucial.
Reference for the idea that a simpler model can be used when the range of data values is smaller I think that this is not a reference-able concept, it's just about relative error. What you call "range of data values" is usually called "scale", and you would just say that a certain theory is enoug
43,652
Credit Risk and Concentration
In regulatory environment there are actually three parameters tied to credit risk: 1) Exposure at default (EAD) which means nominal amount of money your institution is at risk to lose. You could add unused credit limits /lines there if you want. 2) Loss given default (LGD) which means 1-recovery rate. Recovery rate depends on collateral etc.. 3) Probability of default (PD) which is historical or modeled probability for making default. Of course you must also define what default is.. Expected loss (EL) at money units is following: EL=PD*EAD*LGD If you have parameter estimates then you can easily calculate reserves needed to cover expected losses from defaults. For extra reserves safeguarding against unexpected losses you need to have some idea of prob. dist. of losses. I have seen constructs where LGD is function of PD, such that higher PD will lead to smaller recovery rate. EL=PD*EAD*LGD(PD) If you assume independence between these terms you can just get LGD and EAD numbers from your own financial data and model PD separately.
Credit Risk and Concentration
In regulatory environment there are actually three parameters tied to credit risk: 1) Exposure at default (EAD) which means nominal amount of money your institution is at risk to lose. You could add
Credit Risk and Concentration In regulatory environment there are actually three parameters tied to credit risk: 1) Exposure at default (EAD) which means nominal amount of money your institution is at risk to lose. You could add unused credit limits /lines there if you want. 2) Loss given default (LGD) which means 1-recovery rate. Recovery rate depends on collateral etc.. 3) Probability of default (PD) which is historical or modeled probability for making default. Of course you must also define what default is.. Expected loss (EL) at money units is following: EL=PD*EAD*LGD If you have parameter estimates then you can easily calculate reserves needed to cover expected losses from defaults. For extra reserves safeguarding against unexpected losses you need to have some idea of prob. dist. of losses. I have seen constructs where LGD is function of PD, such that higher PD will lead to smaller recovery rate. EL=PD*EAD*LGD(PD) If you assume independence between these terms you can just get LGD and EAD numbers from your own financial data and model PD separately.
Credit Risk and Concentration In regulatory environment there are actually three parameters tied to credit risk: 1) Exposure at default (EAD) which means nominal amount of money your institution is at risk to lose. You could add
43,653
Credit Risk and Concentration
It is possible to reflect the concentration credit risk in terms of Economic Capital using a modification of the Vasicek VaR model. The Vasicek model is the key model for credit risk under the Basel II framework and it assumes that the credit risk exposures are uniform. Nevertheless, it is possible to modify it by applying a Monte Carlo method that randomly samples k exposures on the portfolio according to the expected default rate k/n. By repeating this procedure, one obtains a loss distribution with concentration. The following code does this job. #------------------------------------------------------------------------------- #Number of iterations used in Monte Carlo N_iter <- 10000 #1000000 # Number of exposures N <- 150 # Probability of Default PD_Portfolio <- 0.05 LGD_Portfolio <- 0.6 #Creates a dummie sequence of Exposures at Default set.seed(123) u <- seq(1,N,1) u1 <- pnorm(rnorm(u)) EAD<- 10^3/min(u1)*u1 #Correlation Factor (should be changed according to the class of exposures) R <- 0.03*(1-exp(-35*PD))/(1-exp(-35))+0.16*(1-(1-exp(-35*PD))/(1-exp(-35))) max_loss_R <- function(PD,s) { return(pnorm( R^(-0.5)*(sqrt(1-R)*qnorm(s)-qnorm(PD)) )) } # Tabulates the possible loss values S_range <- seq(0,1,1/N) N2 <- N+1 loss_tabulation <- cbind(0:N,S_range,max_loss_R(PD_Portfolio,S_range)) loss_tabulation_df <- as.data.frame(loss_tabulation) colnames(loss_tabulation_df)<- c("#Defaults(D)","%Defaults(D/N)","#Defaults<=D") #Random sample of a uniform distribution vec_N_Defaults <- rep(0,N_iter) Loss <- rep(0,N_iter) for(i in 1:N_iter){ y <- runif(1) vec_N_Defaults[i] <- LGD_Portfolio*which(abs(loss_tabulation_df[,3]-y)==min(abs(loss_tabulation_df[,3]-y))) Loss[i] <- LGD_Portfolio*sum(EAD[sample(1:N,vec_N_Defaults[i],replace=F)]) } vec_N_Defaults2 <- sort(vec_N_Defaults,decreasing=TRUE) Loss2 <- sort(Loss,decreasing=TRUE) #Estimates the Economic Capital factor K for the portfolio with no concentration K_granular <- quantile(vec_N_Defaults2,0.999)/N #Estimates the Economic Capital factor K for the portfolio with concentration K_concentration <- quantile(Loss2,0.999)/sum(EAD) ```
Credit Risk and Concentration
It is possible to reflect the concentration credit risk in terms of Economic Capital using a modification of the Vasicek VaR model. The Vasicek model is the key model for credit risk under the Basel I
Credit Risk and Concentration It is possible to reflect the concentration credit risk in terms of Economic Capital using a modification of the Vasicek VaR model. The Vasicek model is the key model for credit risk under the Basel II framework and it assumes that the credit risk exposures are uniform. Nevertheless, it is possible to modify it by applying a Monte Carlo method that randomly samples k exposures on the portfolio according to the expected default rate k/n. By repeating this procedure, one obtains a loss distribution with concentration. The following code does this job. #------------------------------------------------------------------------------- #Number of iterations used in Monte Carlo N_iter <- 10000 #1000000 # Number of exposures N <- 150 # Probability of Default PD_Portfolio <- 0.05 LGD_Portfolio <- 0.6 #Creates a dummie sequence of Exposures at Default set.seed(123) u <- seq(1,N,1) u1 <- pnorm(rnorm(u)) EAD<- 10^3/min(u1)*u1 #Correlation Factor (should be changed according to the class of exposures) R <- 0.03*(1-exp(-35*PD))/(1-exp(-35))+0.16*(1-(1-exp(-35*PD))/(1-exp(-35))) max_loss_R <- function(PD,s) { return(pnorm( R^(-0.5)*(sqrt(1-R)*qnorm(s)-qnorm(PD)) )) } # Tabulates the possible loss values S_range <- seq(0,1,1/N) N2 <- N+1 loss_tabulation <- cbind(0:N,S_range,max_loss_R(PD_Portfolio,S_range)) loss_tabulation_df <- as.data.frame(loss_tabulation) colnames(loss_tabulation_df)<- c("#Defaults(D)","%Defaults(D/N)","#Defaults<=D") #Random sample of a uniform distribution vec_N_Defaults <- rep(0,N_iter) Loss <- rep(0,N_iter) for(i in 1:N_iter){ y <- runif(1) vec_N_Defaults[i] <- LGD_Portfolio*which(abs(loss_tabulation_df[,3]-y)==min(abs(loss_tabulation_df[,3]-y))) Loss[i] <- LGD_Portfolio*sum(EAD[sample(1:N,vec_N_Defaults[i],replace=F)]) } vec_N_Defaults2 <- sort(vec_N_Defaults,decreasing=TRUE) Loss2 <- sort(Loss,decreasing=TRUE) #Estimates the Economic Capital factor K for the portfolio with no concentration K_granular <- quantile(vec_N_Defaults2,0.999)/N #Estimates the Economic Capital factor K for the portfolio with concentration K_concentration <- quantile(Loss2,0.999)/sum(EAD) ```
Credit Risk and Concentration It is possible to reflect the concentration credit risk in terms of Economic Capital using a modification of the Vasicek VaR model. The Vasicek model is the key model for credit risk under the Basel I
43,654
Credit Risk and Concentration
Going by your comment: if you have a group of people with the same credit rating, and a total amount of X that you want to loan out, it is less risky to loan it to more people (where each person takes a smaller loan.) There are many ways to get to this result, but my favourite is through the Kelly criterion. Even though the expected value (in terms of arithmetic expectation) is the same, you want to avoid the case where there's a small probability of a large drop in wealth. You should instead aim for the case where there's a large probability of a small drop in wealth. The reason is that wealth compounds: it takes you just as long to go from 10 to 100 as it does from 100 to 1000. A drop from 100 down to 50 (even if unlikely) hurts that process much more than a drop from 100 to 95 (even if rather likely.) For more details, the book The Kelly Capital Growth Investment Criterion is awesome.
Credit Risk and Concentration
Going by your comment: if you have a group of people with the same credit rating, and a total amount of X that you want to loan out, it is less risky to loan it to more people (where each person takes
Credit Risk and Concentration Going by your comment: if you have a group of people with the same credit rating, and a total amount of X that you want to loan out, it is less risky to loan it to more people (where each person takes a smaller loan.) There are many ways to get to this result, but my favourite is through the Kelly criterion. Even though the expected value (in terms of arithmetic expectation) is the same, you want to avoid the case where there's a small probability of a large drop in wealth. You should instead aim for the case where there's a large probability of a small drop in wealth. The reason is that wealth compounds: it takes you just as long to go from 10 to 100 as it does from 100 to 1000. A drop from 100 down to 50 (even if unlikely) hurts that process much more than a drop from 100 to 95 (even if rather likely.) For more details, the book The Kelly Capital Growth Investment Criterion is awesome.
Credit Risk and Concentration Going by your comment: if you have a group of people with the same credit rating, and a total amount of X that you want to loan out, it is less risky to loan it to more people (where each person takes
43,655
Johansen test conditions and Breusch-Godfrey LM test
For your first question, yes, you need to have uncorrelated residuals. In general, your need to determine the lag order of the VAR THEN your perform a cointegration test. This means that there must be no residual autocorrelation in your VAR model (if there still is, you need to increase the lag order. Which lag order to increase to will depend on your information criteria such as AIC, BIC, etc.). Once the VAR lag order is selected, you perform the cointegration test (assuming normally distributed residuals of course). Also note that the Johansen test statistic converges very slowly (even a sample size of 300 is considered to be small) hence the test result may not be reliable. For your second question, there are only some general rules. Some may use lag of 12 since one may have yearly data. There may be other general rules btu I was taught to choose the maximum PACF. I have also heard of performing different LM tests with different lag then choose the one with the highest adjusted R-squared or the lowest AIC or SC.
Johansen test conditions and Breusch-Godfrey LM test
For your first question, yes, you need to have uncorrelated residuals. In general, your need to determine the lag order of the VAR THEN your perform a cointegration test. This means that there must be
Johansen test conditions and Breusch-Godfrey LM test For your first question, yes, you need to have uncorrelated residuals. In general, your need to determine the lag order of the VAR THEN your perform a cointegration test. This means that there must be no residual autocorrelation in your VAR model (if there still is, you need to increase the lag order. Which lag order to increase to will depend on your information criteria such as AIC, BIC, etc.). Once the VAR lag order is selected, you perform the cointegration test (assuming normally distributed residuals of course). Also note that the Johansen test statistic converges very slowly (even a sample size of 300 is considered to be small) hence the test result may not be reliable. For your second question, there are only some general rules. Some may use lag of 12 since one may have yearly data. There may be other general rules btu I was taught to choose the maximum PACF. I have also heard of performing different LM tests with different lag then choose the one with the highest adjusted R-squared or the lowest AIC or SC.
Johansen test conditions and Breusch-Godfrey LM test For your first question, yes, you need to have uncorrelated residuals. In general, your need to determine the lag order of the VAR THEN your perform a cointegration test. This means that there must be
43,656
Are estimates of regression coefficients uncorrelated?
This is an important consideration in designing experiments, where it can be desirable to have no (or very little) correlation among the estimates $\hat a$ and $\hat b$. Such lack of correlation can be achieved by controlling the values of the $X_i$. To analyze the effects of the $X_i$ on the estimates, the values $(1,X_i)$ (which are row vectors of length $2$) are assembled vertically into a matrix $X$, the design matrix, having as many rows as there are data and (obviously) two columns. The corresponding $Y_i$ are assembled into one long (column) vector $y$. In these terms, writing $\beta = (a,b)^\prime$ for the assembled coefficients, the model is $$\mathbb{E}(Y) = X \cdot \beta$$ The $Y_i$ are (usually) assumed to be independent random variables whose variances are a constant $\sigma^2$ for some unknown $\sigma \gt 0$. The dependent observations $y$ are taken to be one realization of the vector-valued random variable $Y$. The OLS solution is $$\hat\beta = \left(X^\prime X\right)^{-1} X^\prime y,$$ assuming this matrix inverse exists. Thus, using basic properties of matrix multiplication and covariance, $$\text{Cov}(\hat\beta) = \text{Cov}\left(\left(X^\prime X\right)^{-1} X^\prime Y\right) = \left(\left(X^\prime X\right)^{-1} X^\prime\sigma^2 X \left( X^\prime X \right)^{-1\prime} \right) = \sigma^2 \left(X^\prime X\right)^{-1}. $$ The matrix $\left(X^\prime X\right)^{-1}$ has just two rows and two columns, corresponding to the model parameters $(a,b)$. The correlation of $\hat a$ with $\hat b$ is proportional to the off-diagonal elements of $(X^\prime X)^{-1},$ which by Cramer's Rule are proportional to the dot product of the two columns of $X$. Since one of the columns is all $1$s, whose dot product with the other column (consisting of the $X_i$) is their sum, we find $\hat a$ and $\hat b$ are uncorrelated if and only the sum (or equivalently the mean) of the $X_i$ is zero. This orthogonality condition frequently is achieved by recentering the $X_i$ (by subtracting their mean from each). Although this will not alter the estimated slope $\hat b$, it does change the estimated intercept $\hat a$. Whether or not that is important depends on the application. Tthis analysis applies to multiple regression: the design matrix will have $p+1$ columns for $p$ independent variables (an additional column consists of $1$s) and $\beta$ will be a vector of length $p+1$, but otherwise everything goes through as before. In conventional language, two columns of $X$ are called orthogonal when their dot product is zero. When one column of $X$ (say column $i$) is orthogonal to all the other columns, it is an easily demonstrated algebraic fact that all off-diagonal entries in row $i$ and column $i$ of $(X^\prime X)^{-1}$ are zero (that is, the $ij$ and $ji$ components for all $j\ne i$ are zero). Consequently, Two multiple regression coefficient estimates $\hat\beta_i$ and $\hat\beta_j$ are uncorrelated whenever either (or both) of the corresponding columns of the design matrix are orthogonal to all other columns. Many standard experimental designs consist of choosing values of the independent variables to make the columns mutually orthogonal. This "separates" the resulting estimates by guaranteeing--before any data are ever collected!--that the estimates will be uncorrelated. (When the responses have Normal distributions this implies the estimates will be independent, which greatly simplifies their interpretation.)
Are estimates of regression coefficients uncorrelated?
This is an important consideration in designing experiments, where it can be desirable to have no (or very little) correlation among the estimates $\hat a$ and $\hat b$. Such lack of correlation can
Are estimates of regression coefficients uncorrelated? This is an important consideration in designing experiments, where it can be desirable to have no (or very little) correlation among the estimates $\hat a$ and $\hat b$. Such lack of correlation can be achieved by controlling the values of the $X_i$. To analyze the effects of the $X_i$ on the estimates, the values $(1,X_i)$ (which are row vectors of length $2$) are assembled vertically into a matrix $X$, the design matrix, having as many rows as there are data and (obviously) two columns. The corresponding $Y_i$ are assembled into one long (column) vector $y$. In these terms, writing $\beta = (a,b)^\prime$ for the assembled coefficients, the model is $$\mathbb{E}(Y) = X \cdot \beta$$ The $Y_i$ are (usually) assumed to be independent random variables whose variances are a constant $\sigma^2$ for some unknown $\sigma \gt 0$. The dependent observations $y$ are taken to be one realization of the vector-valued random variable $Y$. The OLS solution is $$\hat\beta = \left(X^\prime X\right)^{-1} X^\prime y,$$ assuming this matrix inverse exists. Thus, using basic properties of matrix multiplication and covariance, $$\text{Cov}(\hat\beta) = \text{Cov}\left(\left(X^\prime X\right)^{-1} X^\prime Y\right) = \left(\left(X^\prime X\right)^{-1} X^\prime\sigma^2 X \left( X^\prime X \right)^{-1\prime} \right) = \sigma^2 \left(X^\prime X\right)^{-1}. $$ The matrix $\left(X^\prime X\right)^{-1}$ has just two rows and two columns, corresponding to the model parameters $(a,b)$. The correlation of $\hat a$ with $\hat b$ is proportional to the off-diagonal elements of $(X^\prime X)^{-1},$ which by Cramer's Rule are proportional to the dot product of the two columns of $X$. Since one of the columns is all $1$s, whose dot product with the other column (consisting of the $X_i$) is their sum, we find $\hat a$ and $\hat b$ are uncorrelated if and only the sum (or equivalently the mean) of the $X_i$ is zero. This orthogonality condition frequently is achieved by recentering the $X_i$ (by subtracting their mean from each). Although this will not alter the estimated slope $\hat b$, it does change the estimated intercept $\hat a$. Whether or not that is important depends on the application. Tthis analysis applies to multiple regression: the design matrix will have $p+1$ columns for $p$ independent variables (an additional column consists of $1$s) and $\beta$ will be a vector of length $p+1$, but otherwise everything goes through as before. In conventional language, two columns of $X$ are called orthogonal when their dot product is zero. When one column of $X$ (say column $i$) is orthogonal to all the other columns, it is an easily demonstrated algebraic fact that all off-diagonal entries in row $i$ and column $i$ of $(X^\prime X)^{-1}$ are zero (that is, the $ij$ and $ji$ components for all $j\ne i$ are zero). Consequently, Two multiple regression coefficient estimates $\hat\beta_i$ and $\hat\beta_j$ are uncorrelated whenever either (or both) of the corresponding columns of the design matrix are orthogonal to all other columns. Many standard experimental designs consist of choosing values of the independent variables to make the columns mutually orthogonal. This "separates" the resulting estimates by guaranteeing--before any data are ever collected!--that the estimates will be uncorrelated. (When the responses have Normal distributions this implies the estimates will be independent, which greatly simplifies their interpretation.)
Are estimates of regression coefficients uncorrelated? This is an important consideration in designing experiments, where it can be desirable to have no (or very little) correlation among the estimates $\hat a$ and $\hat b$. Such lack of correlation can
43,657
Reference with distributions with various properties
The most comprehensive collection of distributions and their properties that I know of are Johnson, Kotz, Balakrishnan: Continuous Univariate Distributions Volume 1 and 2; Kotz, Johnson, Balakrishnan: Continuous Multivariate Distributions; Johnson, Kemp, Kotz: Univariate Discrete Distributions; Johnson, Kotz, Balakrishnan: Multivariate Discrete Distributions; The books have a broad subject index. All books are from Wiley. Edit: Oh yes and then there also is the nice poster displaying properties and relationships between univariate distributions. http://www.math.wm.edu/~leemis/2008amstat.pdf This might be of further interest.
Reference with distributions with various properties
The most comprehensive collection of distributions and their properties that I know of are Johnson, Kotz, Balakrishnan: Continuous Univariate Distributions Volume 1 and 2; Kotz, Johnson, Balakrishna
Reference with distributions with various properties The most comprehensive collection of distributions and their properties that I know of are Johnson, Kotz, Balakrishnan: Continuous Univariate Distributions Volume 1 and 2; Kotz, Johnson, Balakrishnan: Continuous Multivariate Distributions; Johnson, Kemp, Kotz: Univariate Discrete Distributions; Johnson, Kotz, Balakrishnan: Multivariate Discrete Distributions; The books have a broad subject index. All books are from Wiley. Edit: Oh yes and then there also is the nice poster displaying properties and relationships between univariate distributions. http://www.math.wm.edu/~leemis/2008amstat.pdf This might be of further interest.
Reference with distributions with various properties The most comprehensive collection of distributions and their properties that I know of are Johnson, Kotz, Balakrishnan: Continuous Univariate Distributions Volume 1 and 2; Kotz, Johnson, Balakrishna
43,658
Reference with distributions with various properties
honestly, there are way too many distributions that I have no idea about. I do believe however that knowing them is not an asset, one must know how to use them. Anyway, back to your question, I always find this diagram quite informative and useful, it's like probability distributions cheatsheet. http://jonfwilkins.com/wp-content/uploads/2013/06/BaseImage.png
Reference with distributions with various properties
honestly, there are way too many distributions that I have no idea about. I do believe however that knowing them is not an asset, one must know how to use them. Anyway, back to your question, I alway
Reference with distributions with various properties honestly, there are way too many distributions that I have no idea about. I do believe however that knowing them is not an asset, one must know how to use them. Anyway, back to your question, I always find this diagram quite informative and useful, it's like probability distributions cheatsheet. http://jonfwilkins.com/wp-content/uploads/2013/06/BaseImage.png
Reference with distributions with various properties honestly, there are way too many distributions that I have no idea about. I do believe however that knowing them is not an asset, one must know how to use them. Anyway, back to your question, I alway
43,659
Reference with distributions with various properties
No book could cover all distributions, as it is always possible to invent new ones. But Statistical distributions by Catherine Forbes et al. is a concise book covering many of the more commonly used distributions while A primer on statistical distributions by N. Balakrishnan and V.B. Nezvorov is also fairly concise, but rather more mathematically oriented. The nearest approach to a treatise is the series started by N.L. Johnson and S. Kotz, being continued by A.W. Kemp and N. Balakrishnan, and currently published by John Wiley. This isn't a complete list even of surveys of distributions, but Googling your local Amazon site easily gets you other ideas.
Reference with distributions with various properties
No book could cover all distributions, as it is always possible to invent new ones. But Statistical distributions by Catherine Forbes et al. is a concise book covering many of the more commonly used
Reference with distributions with various properties No book could cover all distributions, as it is always possible to invent new ones. But Statistical distributions by Catherine Forbes et al. is a concise book covering many of the more commonly used distributions while A primer on statistical distributions by N. Balakrishnan and V.B. Nezvorov is also fairly concise, but rather more mathematically oriented. The nearest approach to a treatise is the series started by N.L. Johnson and S. Kotz, being continued by A.W. Kemp and N. Balakrishnan, and currently published by John Wiley. This isn't a complete list even of surveys of distributions, but Googling your local Amazon site easily gets you other ideas.
Reference with distributions with various properties No book could cover all distributions, as it is always possible to invent new ones. But Statistical distributions by Catherine Forbes et al. is a concise book covering many of the more commonly used
43,660
Reference with distributions with various properties
Merran Evans, Nicholas Hastings, Brian Peacock - Statistical distributions - John Wiley and Sons I have the second edition and the distributions are in simple alphabetical order (from Bernoulli to Wishart central distribution).
Reference with distributions with various properties
Merran Evans, Nicholas Hastings, Brian Peacock - Statistical distributions - John Wiley and Sons I have the second edition and the distributions are in simple alphabetical order (from Bernoulli to Wis
Reference with distributions with various properties Merran Evans, Nicholas Hastings, Brian Peacock - Statistical distributions - John Wiley and Sons I have the second edition and the distributions are in simple alphabetical order (from Bernoulli to Wishart central distribution).
Reference with distributions with various properties Merran Evans, Nicholas Hastings, Brian Peacock - Statistical distributions - John Wiley and Sons I have the second edition and the distributions are in simple alphabetical order (from Bernoulli to Wis
43,661
Reference with distributions with various properties
The Hand-book on Statistical Distributions for Experimentalists by Christian Walck at the University of Stockholm is pretty decent....and FREE!! It covers over 40 distributions from A to Z, with each distribution described with its formulas, moments, moment generating function, characteristic function, how to generate a random variate from this distribution, and much more. Very nice for a free pdf.
Reference with distributions with various properties
The Hand-book on Statistical Distributions for Experimentalists by Christian Walck at the University of Stockholm is pretty decent....and FREE!! It covers over 40 distributions from A to Z, with each
Reference with distributions with various properties The Hand-book on Statistical Distributions for Experimentalists by Christian Walck at the University of Stockholm is pretty decent....and FREE!! It covers over 40 distributions from A to Z, with each distribution described with its formulas, moments, moment generating function, characteristic function, how to generate a random variate from this distribution, and much more. Very nice for a free pdf.
Reference with distributions with various properties The Hand-book on Statistical Distributions for Experimentalists by Christian Walck at the University of Stockholm is pretty decent....and FREE!! It covers over 40 distributions from A to Z, with each
43,662
Reference with distributions with various properties
Ben Bolker's "Ecological Models and Data in R" has a section "bestiary of distributions" (pp 160-181) with descriptions of the properties and applications of many common and useful distributions. It is written at the level of a grad level course in ecology, so it is accessible to non-statisticians. Less dense than the Johnson, Kotz et al references in the answer by @Momo, but gives more practical details than a list or appendix might.
Reference with distributions with various properties
Ben Bolker's "Ecological Models and Data in R" has a section "bestiary of distributions" (pp 160-181) with descriptions of the properties and applications of many common and useful distributions. It
Reference with distributions with various properties Ben Bolker's "Ecological Models and Data in R" has a section "bestiary of distributions" (pp 160-181) with descriptions of the properties and applications of many common and useful distributions. It is written at the level of a grad level course in ecology, so it is accessible to non-statisticians. Less dense than the Johnson, Kotz et al references in the answer by @Momo, but gives more practical details than a list or appendix might.
Reference with distributions with various properties Ben Bolker's "Ecological Models and Data in R" has a section "bestiary of distributions" (pp 160-181) with descriptions of the properties and applications of many common and useful distributions. It
43,663
Reference with distributions with various properties
The Loss Models by Panjer, Wilmot and Klugman contains a good appendix regarding distribution pdf, their support and parameter estimation.
Reference with distributions with various properties
The Loss Models by Panjer, Wilmot and Klugman contains a good appendix regarding distribution pdf, their support and parameter estimation.
Reference with distributions with various properties The Loss Models by Panjer, Wilmot and Klugman contains a good appendix regarding distribution pdf, their support and parameter estimation.
Reference with distributions with various properties The Loss Models by Panjer, Wilmot and Klugman contains a good appendix regarding distribution pdf, their support and parameter estimation.
43,664
Reference with distributions with various properties
A study of bivariate distributions cannot be complete without a sound background knowledge of the univariate distributions, which would naturally form the marginal or conditional distributions. The two encyclopedic volumes by Johnson et al. (1994, 1995) are the most comprehensive texts to date on continuous univariate distributions. Monographs by Ord (1972) and Hastings and Peacock (1975) are worth mentioning, with the latter being a convenient handbook presenting graphs of densities and various relationships between distributions. Another useful compendium is by Patel et al. (1976); Chapters 3 and 4 of Manoukian (1986) present many distributions and relations between them. Extensive collections of illustrations of probability density functions (denoted by p.d.f. hereafter) may be found in Hirano et al. (1983) (105 graphs, each with typically about five curves shown, grouped in 25 families of distributions) and in Patil et al. (1984). This is from Chapter 0 of a book on continuous bivariate distributions, which provides an elementary introduction and basic details on properties of various univariate distributions. I remember I enjoyed reading Ord (1972) very much, but I can't now remember why.
Reference with distributions with various properties
A study of bivariate distributions cannot be complete without a sound background knowledge of the univariate distributions, which would naturally form the marginal or conditional distributions. The tw
Reference with distributions with various properties A study of bivariate distributions cannot be complete without a sound background knowledge of the univariate distributions, which would naturally form the marginal or conditional distributions. The two encyclopedic volumes by Johnson et al. (1994, 1995) are the most comprehensive texts to date on continuous univariate distributions. Monographs by Ord (1972) and Hastings and Peacock (1975) are worth mentioning, with the latter being a convenient handbook presenting graphs of densities and various relationships between distributions. Another useful compendium is by Patel et al. (1976); Chapters 3 and 4 of Manoukian (1986) present many distributions and relations between them. Extensive collections of illustrations of probability density functions (denoted by p.d.f. hereafter) may be found in Hirano et al. (1983) (105 graphs, each with typically about five curves shown, grouped in 25 families of distributions) and in Patil et al. (1984). This is from Chapter 0 of a book on continuous bivariate distributions, which provides an elementary introduction and basic details on properties of various univariate distributions. I remember I enjoyed reading Ord (1972) very much, but I can't now remember why.
Reference with distributions with various properties A study of bivariate distributions cannot be complete without a sound background knowledge of the univariate distributions, which would naturally form the marginal or conditional distributions. The tw
43,665
Reference with distributions with various properties
The series of books by Johnson, Kotz & Balakrishnan (edit: which Nick has also mentioned; the original books were by the first two authors) are probably the most comprehensive. You probably want to start with Continuous Univariate Distributions, Vols I and II. A couple more: Evans, Hastings & Peacock, Statistical Distributions Wimmer & Altmann, Thesaurus of univariate discrete probability distributions There's also many other books, sometimes for more specialized applications.
Reference with distributions with various properties
The series of books by Johnson, Kotz & Balakrishnan (edit: which Nick has also mentioned; the original books were by the first two authors) are probably the most comprehensive. You probably want to st
Reference with distributions with various properties The series of books by Johnson, Kotz & Balakrishnan (edit: which Nick has also mentioned; the original books were by the first two authors) are probably the most comprehensive. You probably want to start with Continuous Univariate Distributions, Vols I and II. A couple more: Evans, Hastings & Peacock, Statistical Distributions Wimmer & Altmann, Thesaurus of univariate discrete probability distributions There's also many other books, sometimes for more specialized applications.
Reference with distributions with various properties The series of books by Johnson, Kotz & Balakrishnan (edit: which Nick has also mentioned; the original books were by the first two authors) are probably the most comprehensive. You probably want to st
43,666
Test whether two rank orders differ
So if I understand you correctly, is the question you are trying to answer if there is a difference in the way individuals change across the two tests relative to one another? If so your null hypothesis would be the response of individuals is the same. You could test this using the actual values instead of their ranks and running a linear mixed model with random slopes and compare that with the model without the random slope: lm1<-lme(performance ~ test, random = ~ test | individual, data = data) lm2<- lme(performance ~ test, random = ~ 1 | individual, data = data) anova(lm2,lm1) If model lm1 gives a significant better fit it shows individuals differed in the way their performance changed across the two tests.
Test whether two rank orders differ
So if I understand you correctly, is the question you are trying to answer if there is a difference in the way individuals change across the two tests relative to one another? If so your null hypothes
Test whether two rank orders differ So if I understand you correctly, is the question you are trying to answer if there is a difference in the way individuals change across the two tests relative to one another? If so your null hypothesis would be the response of individuals is the same. You could test this using the actual values instead of their ranks and running a linear mixed model with random slopes and compare that with the model without the random slope: lm1<-lme(performance ~ test, random = ~ test | individual, data = data) lm2<- lme(performance ~ test, random = ~ 1 | individual, data = data) anova(lm2,lm1) If model lm1 gives a significant better fit it shows individuals differed in the way their performance changed across the two tests.
Test whether two rank orders differ So if I understand you correctly, is the question you are trying to answer if there is a difference in the way individuals change across the two tests relative to one another? If so your null hypothes
43,667
Test whether two rank orders differ
If I understood correctly, you want to test if a condition affects the score order of a population. I guess what you are looking for is the Friedman test or its generalization. On wikipedia : http://en.wikipedia.org/wiki/Friedman_test. I think the example with the judges and the wines looks very similar to your problem.
Test whether two rank orders differ
If I understood correctly, you want to test if a condition affects the score order of a population. I guess what you are looking for is the Friedman test or its generalization. On wikipedia : http://e
Test whether two rank orders differ If I understood correctly, you want to test if a condition affects the score order of a population. I guess what you are looking for is the Friedman test or its generalization. On wikipedia : http://en.wikipedia.org/wiki/Friedman_test. I think the example with the judges and the wines looks very similar to your problem.
Test whether two rank orders differ If I understood correctly, you want to test if a condition affects the score order of a population. I guess what you are looking for is the Friedman test or its generalization. On wikipedia : http://e
43,668
Test whether two rank orders differ
I think the wilcoxon signed-rank test will work in this situation. The null hypothesis is that the 2 sets of ranks are equal.
Test whether two rank orders differ
I think the wilcoxon signed-rank test will work in this situation. The null hypothesis is that the 2 sets of ranks are equal.
Test whether two rank orders differ I think the wilcoxon signed-rank test will work in this situation. The null hypothesis is that the 2 sets of ranks are equal.
Test whether two rank orders differ I think the wilcoxon signed-rank test will work in this situation. The null hypothesis is that the 2 sets of ranks are equal.
43,669
MANOVA with unequal sample sizes
As in ANOVA, when cells in a factorial MANOVA have different sample sizes, the sum of squares for effect plus error does not equal the total sum of squares. This causes tests of main effects and interactions to be correlated. SPSS offers and adjustment for unequal sample sizes in MANOVA. For further information have a look at: Tabachnick, B.G. and L.S. Fidell. 1996. Using Multivariate Statistics. Harper Collins College Publishers: New York.
MANOVA with unequal sample sizes
As in ANOVA, when cells in a factorial MANOVA have different sample sizes, the sum of squares for effect plus error does not equal the total sum of squares. This causes tests of main effects and inter
MANOVA with unequal sample sizes As in ANOVA, when cells in a factorial MANOVA have different sample sizes, the sum of squares for effect plus error does not equal the total sum of squares. This causes tests of main effects and interactions to be correlated. SPSS offers and adjustment for unequal sample sizes in MANOVA. For further information have a look at: Tabachnick, B.G. and L.S. Fidell. 1996. Using Multivariate Statistics. Harper Collins College Publishers: New York.
MANOVA with unequal sample sizes As in ANOVA, when cells in a factorial MANOVA have different sample sizes, the sum of squares for effect plus error does not equal the total sum of squares. This causes tests of main effects and inter
43,670
Geometric Interpretation of Softmax Regression
To start, I'll be referring to your blogpost on softmax regression. The analysis performed there is almost complete, all it needs is the following: when we want to predict a class during test time, we simply take the class with the highest probability. Say we want to see the decision region for class 1. It corresponds to taking intersections of the half-planes that correspond to class 1 in all the individual 1 vs. k cases. The resulting convex polyhedron will be the decision region for class 1. To reiterate, no external reading required: a softmax regression model returns $n$ weight vectors, one for every class. For a data point x, we assign it a class that corresponds to the largest value of the softmax output. It's clear to see that the maximal softmax output corresponds to the maximal value of the linear functions we get from the weight vectors - let's call them $f_1,\ldots,f_n$. To obtain the decision boundary for class $k$, we need to solve \begin{equation} f_k(x) = \max\{f_1(x),f_2(x),\ldots,f_n(x)\}, \end{equation} or, equivalently \begin{equation} f_k(x)>f_1(x) \cap f_k(x)>f_2(x) \cap \ldots \cap f_k(x)>f_n(x) \end{equation} Which corresponds to intersecting the solutions of each of the above equations (each one is a half-plane). Taking boundary of the resulting shape (which is, by the way, a convex polyhedron) is the decision boundary for class $k$. Hence, softmax partitions the space into n convex polyhedrons (some of which may be empty sets, though).
Geometric Interpretation of Softmax Regression
To start, I'll be referring to your blogpost on softmax regression. The analysis performed there is almost complete, all it needs is the following: when we want to predict a class during test time, we
Geometric Interpretation of Softmax Regression To start, I'll be referring to your blogpost on softmax regression. The analysis performed there is almost complete, all it needs is the following: when we want to predict a class during test time, we simply take the class with the highest probability. Say we want to see the decision region for class 1. It corresponds to taking intersections of the half-planes that correspond to class 1 in all the individual 1 vs. k cases. The resulting convex polyhedron will be the decision region for class 1. To reiterate, no external reading required: a softmax regression model returns $n$ weight vectors, one for every class. For a data point x, we assign it a class that corresponds to the largest value of the softmax output. It's clear to see that the maximal softmax output corresponds to the maximal value of the linear functions we get from the weight vectors - let's call them $f_1,\ldots,f_n$. To obtain the decision boundary for class $k$, we need to solve \begin{equation} f_k(x) = \max\{f_1(x),f_2(x),\ldots,f_n(x)\}, \end{equation} or, equivalently \begin{equation} f_k(x)>f_1(x) \cap f_k(x)>f_2(x) \cap \ldots \cap f_k(x)>f_n(x) \end{equation} Which corresponds to intersecting the solutions of each of the above equations (each one is a half-plane). Taking boundary of the resulting shape (which is, by the way, a convex polyhedron) is the decision boundary for class $k$. Hence, softmax partitions the space into n convex polyhedrons (some of which may be empty sets, though).
Geometric Interpretation of Softmax Regression To start, I'll be referring to your blogpost on softmax regression. The analysis performed there is almost complete, all it needs is the following: when we want to predict a class during test time, we
43,671
What does the residual higher level variance tell me?
It could be possible. If you code an east-west variable, a simple binary variable. Check it's correlation with your mode variable. If they are very highly correlated, then multicollinearity may be at play. i.e. your mode variable may in fact be explaining away the east west divide.
What does the residual higher level variance tell me?
It could be possible. If you code an east-west variable, a simple binary variable. Check it's correlation with your mode variable. If they are very highly correlated, then multicollinearity may be at
What does the residual higher level variance tell me? It could be possible. If you code an east-west variable, a simple binary variable. Check it's correlation with your mode variable. If they are very highly correlated, then multicollinearity may be at play. i.e. your mode variable may in fact be explaining away the east west divide.
What does the residual higher level variance tell me? It could be possible. If you code an east-west variable, a simple binary variable. Check it's correlation with your mode variable. If they are very highly correlated, then multicollinearity may be at
43,672
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets
To compare models you need to have replicates at each level of the predictor. This allows you to partition the SS(residual) into SS(lack of fit) plus SS(pure error). Ideally SS(LOF)->zero. You can test this using an F-test.(https://en.wikipedia.org/wiki/Lack-of-fit_sum_of_squares). If your models all have two parameters then that with lowest F will be the best choice. It may be that the theory you rest a model on is desirable or perhaps you are just interested in minimizing the SS(residual).The important thing is that you have replicates. Without them you cannot partition the SS(residual).
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets
To compare models you need to have replicates at each level of the predictor. This allows you to partition the SS(residual) into SS(lack of fit) plus SS(pure error). Ideally SS(LOF)->zero. You can
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets To compare models you need to have replicates at each level of the predictor. This allows you to partition the SS(residual) into SS(lack of fit) plus SS(pure error). Ideally SS(LOF)->zero. You can test this using an F-test.(https://en.wikipedia.org/wiki/Lack-of-fit_sum_of_squares). If your models all have two parameters then that with lowest F will be the best choice. It may be that the theory you rest a model on is desirable or perhaps you are just interested in minimizing the SS(residual).The important thing is that you have replicates. Without them you cannot partition the SS(residual).
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets To compare models you need to have replicates at each level of the predictor. This allows you to partition the SS(residual) into SS(lack of fit) plus SS(pure error). Ideally SS(LOF)->zero. You can
43,673
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets
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. You can check the following link http://www.graphpad.com/guides/prism/6/curve-fitting/index.htm?reg_interpreting_comparison_of_mod.htm
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets
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.
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets 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. You can check the following link http://www.graphpad.com/guides/prism/6/curve-fitting/index.htm?reg_interpreting_comparison_of_mod.htm
Comparing model fits or regression coefficients for nonlinear models fitted to different data sets 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.
43,674
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons)
In principle, there is nothing special about computing the required effect sizes for a network meta-analysis. Let's stick to Cohen's d here. So, for each study, you just compute the $d$ value, either using the raw means and SDs or via some appropriate transformation of some other statistic. As a simple example (what you numbered 1), we can compute $d = t \sqrt{1/n_1 + 1/n_2}$, where $t$ denotes the test statistic of an independent samples t-test comparing the two groups and $n_1$ and $n_2$ the two group sizes. One just has to be careful to get the sign of $d$ right, since authors may have computed the t-statistic with $\bar{x}_1 - \bar{x}_2$ or the other way around (hopefully the text makes it clear which group had the higher mean, so that there is no question about the sign). Lipsey and Wilson (2000) is indeed a very good reference for the kinds of transformations one can use to obtain those $d$ values based on various pieces of information. For each d value, you also need to code which two conditions are being compared. This can be done most easily by coding dummy variables (one for each condition) with $+1$ and $-1$. So, for example, for the 4 studies in your question above, your coding would be: trt1 trt2 trt3 ctrl study 1 +1 -1 0 0 study 2 +1 0 -1 0 study 3 0 +1 -1 0 study 4 +1 0 0 -1 Sometimes you will have studies with more than 2 conditions, for example a study that compared treatments 1 and 2 versus control. Here, you can compute two $d$ values (technically, you could compute 3, but one is redundant), such as treatment 1 versus control and treatment 2 versus control. Again, the computation of those two $d$ values can be done by any means necessary (no pun intended -- well, ok, maybe a slight pun was intended). The coding of the dummy variables above is again easy (you just have two rows for that study). You will also want to have a variable that codes the study factor (so that you know that those two $d$ values came from the same study). A bit more tricky is the fact that those two $d$ values are no longer statistically independent (since the information from the control group was used twice). So, in addition to computing the sampling variances for those two $d$ values, you also need to compute the covariance. Equations for all of that can be found in Chapter 19 by Gleser and Olkin in the Handbook of Research Synthesis and Meta-Analysis (2nd ed.) So, in the end, you will have the vector with the $d$ values, the corresponding coding of the contrasts via the dummy variables, and the corresponding variance-covariance matrix of the $d$ values. That variance-covariance matrix is diagonal if you have no studies with more than 2 conditions. If there are studies with more than 2 conditions, then you have a block-diagonal structure. That's the information you will need for the analysis. More on that can be found in the literature. A good reference would be Salanti et al. (2008).
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons)
In principle, there is nothing special about computing the required effect sizes for a network meta-analysis. Let's stick to Cohen's d here. So, for each study, you just compute the $d$ value, either
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons) In principle, there is nothing special about computing the required effect sizes for a network meta-analysis. Let's stick to Cohen's d here. So, for each study, you just compute the $d$ value, either using the raw means and SDs or via some appropriate transformation of some other statistic. As a simple example (what you numbered 1), we can compute $d = t \sqrt{1/n_1 + 1/n_2}$, where $t$ denotes the test statistic of an independent samples t-test comparing the two groups and $n_1$ and $n_2$ the two group sizes. One just has to be careful to get the sign of $d$ right, since authors may have computed the t-statistic with $\bar{x}_1 - \bar{x}_2$ or the other way around (hopefully the text makes it clear which group had the higher mean, so that there is no question about the sign). Lipsey and Wilson (2000) is indeed a very good reference for the kinds of transformations one can use to obtain those $d$ values based on various pieces of information. For each d value, you also need to code which two conditions are being compared. This can be done most easily by coding dummy variables (one for each condition) with $+1$ and $-1$. So, for example, for the 4 studies in your question above, your coding would be: trt1 trt2 trt3 ctrl study 1 +1 -1 0 0 study 2 +1 0 -1 0 study 3 0 +1 -1 0 study 4 +1 0 0 -1 Sometimes you will have studies with more than 2 conditions, for example a study that compared treatments 1 and 2 versus control. Here, you can compute two $d$ values (technically, you could compute 3, but one is redundant), such as treatment 1 versus control and treatment 2 versus control. Again, the computation of those two $d$ values can be done by any means necessary (no pun intended -- well, ok, maybe a slight pun was intended). The coding of the dummy variables above is again easy (you just have two rows for that study). You will also want to have a variable that codes the study factor (so that you know that those two $d$ values came from the same study). A bit more tricky is the fact that those two $d$ values are no longer statistically independent (since the information from the control group was used twice). So, in addition to computing the sampling variances for those two $d$ values, you also need to compute the covariance. Equations for all of that can be found in Chapter 19 by Gleser and Olkin in the Handbook of Research Synthesis and Meta-Analysis (2nd ed.) So, in the end, you will have the vector with the $d$ values, the corresponding coding of the contrasts via the dummy variables, and the corresponding variance-covariance matrix of the $d$ values. That variance-covariance matrix is diagonal if you have no studies with more than 2 conditions. If there are studies with more than 2 conditions, then you have a block-diagonal structure. That's the information you will need for the analysis. More on that can be found in the literature. A good reference would be Salanti et al. (2008).
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons) In principle, there is nothing special about computing the required effect sizes for a network meta-analysis. Let's stick to Cohen's d here. So, for each study, you just compute the $d$ value, either
43,675
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons)
All the meta-analytic models I have seen require the raw data but if someone is familiar with WinBugs, they might be able to help modify the code to fit your needs. There is a BUGS ListServ that Bayesians frequently post on. Maybe someone there can give you more guidance. Ahmed
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons)
All the meta-analytic models I have seen require the raw data but if someone is familiar with WinBugs, they might be able to help modify the code to fit your needs. There is a BUGS ListServ that Bayes
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons) All the meta-analytic models I have seen require the raw data but if someone is familiar with WinBugs, they might be able to help modify the code to fit your needs. There is a BUGS ListServ that Bayesians frequently post on. Maybe someone there can give you more guidance. Ahmed
Practical data collection tips for performing a network meta analysis (mixed treatment comparisons) All the meta-analytic models I have seen require the raw data but if someone is familiar with WinBugs, they might be able to help modify the code to fit your needs. There is a BUGS ListServ that Bayes
43,676
Average Structural Function Calculation
The original poster solved his own problem and posted the results on his blog.
Average Structural Function Calculation
The original poster solved his own problem and posted the results on his blog.
Average Structural Function Calculation The original poster solved his own problem and posted the results on his blog.
Average Structural Function Calculation The original poster solved his own problem and posted the results on his blog.
43,677
What could "directional mean" be in this context?
I think it is not exactly standard terminology, hence it can mean pretty much anything. However, I have found this article which seems to be in the same genre: http://www.plosgenetics.org/article/info%3Adoi%2F10.1371%2Fjournal.pgen.1002621 This makes me suspect that directional may have been used instead of conditional. But of course directional mean could just be mean, or absolute mean.
What could "directional mean" be in this context?
I think it is not exactly standard terminology, hence it can mean pretty much anything. However, I have found this article which seems to be in the same genre: http://www.plosgenetics.org/article/info
What could "directional mean" be in this context? I think it is not exactly standard terminology, hence it can mean pretty much anything. However, I have found this article which seems to be in the same genre: http://www.plosgenetics.org/article/info%3Adoi%2F10.1371%2Fjournal.pgen.1002621 This makes me suspect that directional may have been used instead of conditional. But of course directional mean could just be mean, or absolute mean.
What could "directional mean" be in this context? I think it is not exactly standard terminology, hence it can mean pretty much anything. However, I have found this article which seems to be in the same genre: http://www.plosgenetics.org/article/info
43,678
What is the correct way to determine the amount of difference between two proportions?
You can do a one-sided test but even if you do a two-sided test the side to which you exceed the threshold clearly tells you if you are better or worse. The standard hypothesis test only tells you that you are significantly better but not by the magnitude. To show that the magnitude is greater than a specified $\Delta$ requires a larger sample size. Instead of testing $p_1-p_2>0$ you test $p_1-p_2>\Delta$.
What is the correct way to determine the amount of difference between two proportions?
You can do a one-sided test but even if you do a two-sided test the side to which you exceed the threshold clearly tells you if you are better or worse. The standard hypothesis test only tells you tha
What is the correct way to determine the amount of difference between two proportions? You can do a one-sided test but even if you do a two-sided test the side to which you exceed the threshold clearly tells you if you are better or worse. The standard hypothesis test only tells you that you are significantly better but not by the magnitude. To show that the magnitude is greater than a specified $\Delta$ requires a larger sample size. Instead of testing $p_1-p_2>0$ you test $p_1-p_2>\Delta$.
What is the correct way to determine the amount of difference between two proportions? You can do a one-sided test but even if you do a two-sided test the side to which you exceed the threshold clearly tells you if you are better or worse. The standard hypothesis test only tells you tha
43,679
Bayesian and frequentist reasoning in plain English
Here is how I would explain the basic difference to my grandma: I have misplaced my phone somewhere in the home. I can use the phone locator on the base of the instrument to locate the phone and when I press the phone locator the phone starts beeping. Problem: Which area of my home should I search? Frequentist Reasoning I can hear the phone beeping. I also have a mental model which helps me identify the area from which the sound is coming. Therefore, upon hearing the beep, I infer the area of my home I must search to locate the phone. Bayesian Reasoning I can hear the phone beeping. Now, apart from a mental model which helps me identify the area from which the sound is coming from, I also know the locations where I have misplaced the phone in the past. So, I combine my inferences using the beeps and my prior information about the locations I have misplaced the phone in the past to identify an area I must search to locate the phone.
Bayesian and frequentist reasoning in plain English
Here is how I would explain the basic difference to my grandma: I have misplaced my phone somewhere in the home. I can use the phone locator on the base of the instrument to locate the phone and when
Bayesian and frequentist reasoning in plain English Here is how I would explain the basic difference to my grandma: I have misplaced my phone somewhere in the home. I can use the phone locator on the base of the instrument to locate the phone and when I press the phone locator the phone starts beeping. Problem: Which area of my home should I search? Frequentist Reasoning I can hear the phone beeping. I also have a mental model which helps me identify the area from which the sound is coming. Therefore, upon hearing the beep, I infer the area of my home I must search to locate the phone. Bayesian Reasoning I can hear the phone beeping. Now, apart from a mental model which helps me identify the area from which the sound is coming from, I also know the locations where I have misplaced the phone in the past. So, I combine my inferences using the beeps and my prior information about the locations I have misplaced the phone in the past to identify an area I must search to locate the phone.
Bayesian and frequentist reasoning in plain English Here is how I would explain the basic difference to my grandma: I have misplaced my phone somewhere in the home. I can use the phone locator on the base of the instrument to locate the phone and when
43,680
Bayesian and frequentist reasoning in plain English
Tongue firmly in cheek: A Bayesian defines a "probability" in exactly the same way that most non-statisticians do - namely an indication of the plausibility of a proposition or a situation. If you ask them a question about a particular proposition or situation, they will give you a direct answer assigning probabilities describing the plausibilities of the possible outcomes for the particular situation (and state their prior assumptions). A Frequentist is someone that believes probabilities represent long run frequencies with which events occur; if needs be, they will invent a fictitious population from which your particular situation could be considered a random sample so that they can meaningfully talk about long run frequencies. If you ask them a question about a particular situation, they will not give a direct answer, but instead make a statement about this (possibly imaginary) population. Many non-frequentist statisticians will be easily confused by the answer and interpret it as Bayesian probability about the particular situation. However, it is important to note that most Frequentist methods have a Bayesian equivalent that in most circumstances will give essentially the same result, the difference is largely a matter of philosophy, and in practice it is a matter of "horses for courses". As you may have guessed, I am a Bayesian and an engineer. ;o)
Bayesian and frequentist reasoning in plain English
Tongue firmly in cheek: A Bayesian defines a "probability" in exactly the same way that most non-statisticians do - namely an indication of the plausibility of a proposition or a situation. If you as
Bayesian and frequentist reasoning in plain English Tongue firmly in cheek: A Bayesian defines a "probability" in exactly the same way that most non-statisticians do - namely an indication of the plausibility of a proposition or a situation. If you ask them a question about a particular proposition or situation, they will give you a direct answer assigning probabilities describing the plausibilities of the possible outcomes for the particular situation (and state their prior assumptions). A Frequentist is someone that believes probabilities represent long run frequencies with which events occur; if needs be, they will invent a fictitious population from which your particular situation could be considered a random sample so that they can meaningfully talk about long run frequencies. If you ask them a question about a particular situation, they will not give a direct answer, but instead make a statement about this (possibly imaginary) population. Many non-frequentist statisticians will be easily confused by the answer and interpret it as Bayesian probability about the particular situation. However, it is important to note that most Frequentist methods have a Bayesian equivalent that in most circumstances will give essentially the same result, the difference is largely a matter of philosophy, and in practice it is a matter of "horses for courses". As you may have guessed, I am a Bayesian and an engineer. ;o)
Bayesian and frequentist reasoning in plain English Tongue firmly in cheek: A Bayesian defines a "probability" in exactly the same way that most non-statisticians do - namely an indication of the plausibility of a proposition or a situation. If you as
43,681
Bayesian and frequentist reasoning in plain English
Very crudely I would say that: Frequentist: Sampling is infinite and decision rules can be sharp. Data are a repeatable random sample - there is a frequency. Underlying parameters are fixed i.e. they remain constant during this repeatable sampling process. Bayesian: Unknown quantities are treated probabilistically and the state of the world can always be updated. Data are observed from the realised sample. Parameters are unknown and described probabilistically. It is the data which are fixed. There is a brilliant blog post which gives an indepth example of how a Bayesian and Frequentist would tackle the same problem. Why not answer the problem for yourself and then check? The problem (taken from Panos Ipeirotis' blog): You have a coin that when flipped ends up head with probability $p$ and ends up tail with probability $1-p$. (The value of $p$ is unknown.) Trying to estimate $p$, you flip the coin 100 times. It ends up head 71 times. Then you have to decide on the following event: "In the next two tosses we will get two heads in a row." Would you bet that the event will happen or that it will not happen?
Bayesian and frequentist reasoning in plain English
Very crudely I would say that: Frequentist: Sampling is infinite and decision rules can be sharp. Data are a repeatable random sample - there is a frequency. Underlying parameters are fixed i.e. they
Bayesian and frequentist reasoning in plain English Very crudely I would say that: Frequentist: Sampling is infinite and decision rules can be sharp. Data are a repeatable random sample - there is a frequency. Underlying parameters are fixed i.e. they remain constant during this repeatable sampling process. Bayesian: Unknown quantities are treated probabilistically and the state of the world can always be updated. Data are observed from the realised sample. Parameters are unknown and described probabilistically. It is the data which are fixed. There is a brilliant blog post which gives an indepth example of how a Bayesian and Frequentist would tackle the same problem. Why not answer the problem for yourself and then check? The problem (taken from Panos Ipeirotis' blog): You have a coin that when flipped ends up head with probability $p$ and ends up tail with probability $1-p$. (The value of $p$ is unknown.) Trying to estimate $p$, you flip the coin 100 times. It ends up head 71 times. Then you have to decide on the following event: "In the next two tosses we will get two heads in a row." Would you bet that the event will happen or that it will not happen?
Bayesian and frequentist reasoning in plain English Very crudely I would say that: Frequentist: Sampling is infinite and decision rules can be sharp. Data are a repeatable random sample - there is a frequency. Underlying parameters are fixed i.e. they
43,682
Bayesian and frequentist reasoning in plain English
Let us say a man rolls a six sided die and it has outcomes 1, 2, 3, 4, 5, or 6. Furthermore, he says that if it lands on a 3, he'll give you a free text book. Then informally: The Frequentist would say that each outcome has an equal 1 in 6 chance of occurring. She views probability as being derived from long run frequency distributions. The Bayesian however would say hang on a second, I know that man, he's David Blaine, a famous trickster! I have a feeling he's up to something. I'm going to say that there's only a 1% chance of it landing on a 3 BUT I'll re-evaluate that beliefe and change it the more times he rolls the die. If I see the other numbers come up equally often, then I'll iteratively increase the chance from 1% to something slightly higher, otherwise I'll reduce it even further. She views probability as degrees of belief in a proposition.
Bayesian and frequentist reasoning in plain English
Let us say a man rolls a six sided die and it has outcomes 1, 2, 3, 4, 5, or 6. Furthermore, he says that if it lands on a 3, he'll give you a free text book. Then informally: The Frequentist would sa
Bayesian and frequentist reasoning in plain English Let us say a man rolls a six sided die and it has outcomes 1, 2, 3, 4, 5, or 6. Furthermore, he says that if it lands on a 3, he'll give you a free text book. Then informally: The Frequentist would say that each outcome has an equal 1 in 6 chance of occurring. She views probability as being derived from long run frequency distributions. The Bayesian however would say hang on a second, I know that man, he's David Blaine, a famous trickster! I have a feeling he's up to something. I'm going to say that there's only a 1% chance of it landing on a 3 BUT I'll re-evaluate that beliefe and change it the more times he rolls the die. If I see the other numbers come up equally often, then I'll iteratively increase the chance from 1% to something slightly higher, otherwise I'll reduce it even further. She views probability as degrees of belief in a proposition.
Bayesian and frequentist reasoning in plain English Let us say a man rolls a six sided die and it has outcomes 1, 2, 3, 4, 5, or 6. Furthermore, he says that if it lands on a 3, he'll give you a free text book. Then informally: The Frequentist would sa
43,683
Bayesian and frequentist reasoning in plain English
Just a little bit of fun... A Bayesian is one who, vaguely expecting a horse, and catching a glimpse of a donkey, strongly believes he has seen a mule. From this site: http://www2.isye.gatech.edu/~brani/isyebayes/jokes.html and from the same site, a nice essay... "An Intuitive Explanation of Bayes' Theorem" http://yudkowsky.net/rational/bayes
Bayesian and frequentist reasoning in plain English
Just a little bit of fun... A Bayesian is one who, vaguely expecting a horse, and catching a glimpse of a donkey, strongly believes he has seen a mule. From this site: http://www2.isye.gatech.edu/~bra
Bayesian and frequentist reasoning in plain English Just a little bit of fun... A Bayesian is one who, vaguely expecting a horse, and catching a glimpse of a donkey, strongly believes he has seen a mule. From this site: http://www2.isye.gatech.edu/~brani/isyebayes/jokes.html and from the same site, a nice essay... "An Intuitive Explanation of Bayes' Theorem" http://yudkowsky.net/rational/bayes
Bayesian and frequentist reasoning in plain English Just a little bit of fun... A Bayesian is one who, vaguely expecting a horse, and catching a glimpse of a donkey, strongly believes he has seen a mule. From this site: http://www2.isye.gatech.edu/~bra
43,684
Bayesian and frequentist reasoning in plain English
The Bayesian is asked to make bets, which may include anything from which fly will crawl up a wall faster to which medicine will save most lives, or which prisoners should go to jail. He has a big box with a handle. He knows that if he puts absolutely everything he knows into the box, including his personal opinion, and turns the handle, it will make the best possible decision for him. The frequentist is asked to write reports. He has a big black book of rules. If the situation he is asked to make a report on is covered by his rulebook, he can follow the rules and write a report so carefully worded that it is wrong, at worst, one time in 100 (or one time in 20, or one time in whatever the specification for his report says). The frequentist knows (because he has written reports on it) that the Bayesian sometimes makes bets that, in the worst case, when his personal opinion is wrong, could turn out badly. The frequentist also knows (for the same reason) that if he bets against the Bayesian every time he differs from him, then, over the long run, he will lose.
Bayesian and frequentist reasoning in plain English
The Bayesian is asked to make bets, which may include anything from which fly will crawl up a wall faster to which medicine will save most lives, or which prisoners should go to jail. He has a big box
Bayesian and frequentist reasoning in plain English The Bayesian is asked to make bets, which may include anything from which fly will crawl up a wall faster to which medicine will save most lives, or which prisoners should go to jail. He has a big box with a handle. He knows that if he puts absolutely everything he knows into the box, including his personal opinion, and turns the handle, it will make the best possible decision for him. The frequentist is asked to write reports. He has a big black book of rules. If the situation he is asked to make a report on is covered by his rulebook, he can follow the rules and write a report so carefully worded that it is wrong, at worst, one time in 100 (or one time in 20, or one time in whatever the specification for his report says). The frequentist knows (because he has written reports on it) that the Bayesian sometimes makes bets that, in the worst case, when his personal opinion is wrong, could turn out badly. The frequentist also knows (for the same reason) that if he bets against the Bayesian every time he differs from him, then, over the long run, he will lose.
Bayesian and frequentist reasoning in plain English The Bayesian is asked to make bets, which may include anything from which fly will crawl up a wall faster to which medicine will save most lives, or which prisoners should go to jail. He has a big box
43,685
Bayesian and frequentist reasoning in plain English
In plain english, I would say that Bayesian and Frequentist reasoning are distinguished by two different ways of answering the question: What is probability? Most differences will essentially boil down to how each answers this question, for it basically defines the domain of valid applications of the theory. Now you can't really give either answer in terms of "plain english", without further generating more questions. For me the answer is (as you could probably guess) probability is logic my "non-plain english" reason for this is that the calculus of propositions is a special case of the calculus of probabilities, if we represent truth by $1$ and falsehood by $0$. Additionally, the calculus of probabilities can be derived from the calculus of propositions. This conforms with the "bayesian" reasoning most closely - although it also extends the bayesian reasoning in applications by providing principles to assign probabilities, in addition to principles to manipulate them. Of course, this leads to the follow up question "what is logic?" for me, the closest thing I could give as an answer to this question is "logic is the common sense judgements of a rational person, with a given set of assumptions" (what is a rational person? etc. etc.). Logic has all the same features that Bayesian reasoning has. For example, logic does not tell you what to assume or what is "absolutely true". It only tells you how the truth of one proposition is related to the truth of another one. You always have to supply a logical system with "axioms" for it to get started on the conclusions. They also has the same limitations in that you can get arbitrary results from contradictory axioms. But "axioms" are nothing but prior probabilities which have been set to $1$. For me, to reject Bayesian reasoning is to reject logic. For if you accept logic, then because Bayesian reasoning "logically flows from logic" (how's that for plain english :P ), you must also accept Bayesian reasoning. For the frequentist reasoning, we have the answer: probability is frequency although I'm not sure "frequency" is a plain english term in the way it is used here - perhaps "proportion" is a better word. I wanted to add into the frequentist answer that the probability of an event is thought to be a real, measurable (observable?) quantity, which exists independently of the person/object who is calculating it. But I couldn't do this in a "plain english" way. So perhaps a "plain english" version of one the difference could be that frequentist reasoning is an attempt at reasoning from "absolute" probabilities, whereas bayesian reasoning is an attempt at reasoning from "relative" probabilities. Another difference is that frequentist foundations are more vague in how you translate the real world problem into the abstract mathematics of the theory. A good example is the use of "random variables" in the theory - they have a precise definition in the abstract world of mathematics, but there is no unambiguous procedure one can use to decide if some observed quantity is or isn't a "random variable". The bayesian way of reasoning, the notion of a "random variable" is not necessary. A probability distribution is assigned to a quantity because it is unknown - which means that it cannot be deduced logically from the information we have. This provides at once a simple connection between the observable quantity and the theory - as "being unknown" is unambiguous. You can also see in the above example a further difference in these two ways of thinking - "random" vs "unknown". "randomness" is phrased in such a way that the "randomness" seems like it is a property of the actual quantity. Conversely, "being unknown" depends on which person you are asking about that quantity - hence it is a property of the statistician doing the analysis. This gives rise to the "objective" versus "subjective" adjectives often attached to each theory. It is easy to show that "randomness" cannot be a property of some standard examples, by simply asking two frequentists who are given different information about the same quantity to decide if its "random". One is the usual Bernoulli Urn: frequentist 1 is blindfolded while drawing, whereas frequentist 2 is standing over the urn, watching frequentist 1 draw the balls from the urn. If the declaration of "randomness" is a property of the balls in the urn, then it cannot depend on the different knowledge of frequentist 1 and 2 - and hence the two frequentist should give the same declaration of "random" or "not random".
Bayesian and frequentist reasoning in plain English
In plain english, I would say that Bayesian and Frequentist reasoning are distinguished by two different ways of answering the question: What is probability? Most differences will essentially boil dow
Bayesian and frequentist reasoning in plain English In plain english, I would say that Bayesian and Frequentist reasoning are distinguished by two different ways of answering the question: What is probability? Most differences will essentially boil down to how each answers this question, for it basically defines the domain of valid applications of the theory. Now you can't really give either answer in terms of "plain english", without further generating more questions. For me the answer is (as you could probably guess) probability is logic my "non-plain english" reason for this is that the calculus of propositions is a special case of the calculus of probabilities, if we represent truth by $1$ and falsehood by $0$. Additionally, the calculus of probabilities can be derived from the calculus of propositions. This conforms with the "bayesian" reasoning most closely - although it also extends the bayesian reasoning in applications by providing principles to assign probabilities, in addition to principles to manipulate them. Of course, this leads to the follow up question "what is logic?" for me, the closest thing I could give as an answer to this question is "logic is the common sense judgements of a rational person, with a given set of assumptions" (what is a rational person? etc. etc.). Logic has all the same features that Bayesian reasoning has. For example, logic does not tell you what to assume or what is "absolutely true". It only tells you how the truth of one proposition is related to the truth of another one. You always have to supply a logical system with "axioms" for it to get started on the conclusions. They also has the same limitations in that you can get arbitrary results from contradictory axioms. But "axioms" are nothing but prior probabilities which have been set to $1$. For me, to reject Bayesian reasoning is to reject logic. For if you accept logic, then because Bayesian reasoning "logically flows from logic" (how's that for plain english :P ), you must also accept Bayesian reasoning. For the frequentist reasoning, we have the answer: probability is frequency although I'm not sure "frequency" is a plain english term in the way it is used here - perhaps "proportion" is a better word. I wanted to add into the frequentist answer that the probability of an event is thought to be a real, measurable (observable?) quantity, which exists independently of the person/object who is calculating it. But I couldn't do this in a "plain english" way. So perhaps a "plain english" version of one the difference could be that frequentist reasoning is an attempt at reasoning from "absolute" probabilities, whereas bayesian reasoning is an attempt at reasoning from "relative" probabilities. Another difference is that frequentist foundations are more vague in how you translate the real world problem into the abstract mathematics of the theory. A good example is the use of "random variables" in the theory - they have a precise definition in the abstract world of mathematics, but there is no unambiguous procedure one can use to decide if some observed quantity is or isn't a "random variable". The bayesian way of reasoning, the notion of a "random variable" is not necessary. A probability distribution is assigned to a quantity because it is unknown - which means that it cannot be deduced logically from the information we have. This provides at once a simple connection between the observable quantity and the theory - as "being unknown" is unambiguous. You can also see in the above example a further difference in these two ways of thinking - "random" vs "unknown". "randomness" is phrased in such a way that the "randomness" seems like it is a property of the actual quantity. Conversely, "being unknown" depends on which person you are asking about that quantity - hence it is a property of the statistician doing the analysis. This gives rise to the "objective" versus "subjective" adjectives often attached to each theory. It is easy to show that "randomness" cannot be a property of some standard examples, by simply asking two frequentists who are given different information about the same quantity to decide if its "random". One is the usual Bernoulli Urn: frequentist 1 is blindfolded while drawing, whereas frequentist 2 is standing over the urn, watching frequentist 1 draw the balls from the urn. If the declaration of "randomness" is a property of the balls in the urn, then it cannot depend on the different knowledge of frequentist 1 and 2 - and hence the two frequentist should give the same declaration of "random" or "not random".
Bayesian and frequentist reasoning in plain English In plain english, I would say that Bayesian and Frequentist reasoning are distinguished by two different ways of answering the question: What is probability? Most differences will essentially boil dow
43,686
Bayesian and frequentist reasoning in plain English
In reality, I think much of the philosophy surrounding the issue is just grandstanding. That's not to dismiss the debate, but it is a word of caution. Sometimes, practical matters take priority - I'll give an example below. Also, you could just as easily argue that there are more than two approaches: Neyman-Pearson ('frequentist') Likelihood-based approaches Fully Bayesian A senior colleague recently reminded me that "many people in common language talk about frequentist and Bayesian. I think a more valid distinction is likelihood-based and frequentist. Both maximum likelihood and Bayesian methods adhere to the likelihood principle whereas frequentist methods don't." I'll start off with a very simple practical example: We have a patient. The patient is either healthy(H) or sick(S). We will perform a test on the patient, and the result will either be Positive(+) or Negative(-). If the patient is sick, they will always get a Positive result. We'll call this the correct(C) result and say that $$ P(+ | S ) = 1 $$ or $$ P(Correct | S) = 1 $$ If the patient is healthy, the test will be negative 95% of the time, but there will be some false positives. $$ P(- | H) = 0.95 $$ $$ P(+ | H) = 0.05 $$ In other works, the probability of the test being Correct, for Healthy people, is 95%. So, the test is either 100% accurate or 95% accurate, depending on whether the patient is healthy or sick. Taken together, this means the test is at least 95% accurate. So far so good. Those are the statements that would be make by a frequentist. Those statements are quite simple to understand and are true. There's no need to waffle about a 'frequentist interpretation'. But, things get interesting when you try to turn things around. Given the test result, what can you learn about the health of the patient? Given a negative test result, the patient is obviously healthy, as there are no false negatives. But we must also consider the case where the test is positive. Was the test positive because the patient was actually sick, or was it a false positive? This is where the frequentist and Bayesian diverge. Everybody will agree that this cannot be answered at the moment. The frequentist will refuse to answer. The Bayesian will be prepared to give you an answer, but you'll have to give the Bayesian a prior first - i.e. tell it what proportion of the patients are sick. To recap, the following statements are true: For healthy patients, the test is very accurate. For sick patients, the test is very accurate. If you are satisfied with statements such as that, then you are using frequentist interpretations. This might change from project to project, depending on what sort of problems you're looking at. But you might want to make different statements and answer the following question: For those patients that got a positive test result, how accurate is the test? This requires a prior and a Bayesian approach. Note also that this is the only question of interest to the doctor. The doctor will say "I know that the patients will either get a positive result or a negative result. I also now that the negative result means the patient is healthy and can be send home. The only patients that interest me now are those that got a positive result -- are they sick?." To summarize: In examples such as this, the Bayesian will agree with everything said by the frequentist. But the Bayesian will argue that the frequentist's statements, while true, are not very useful; and will argue that the useful questions can only be answered with a prior. A frequentist will consider each possible value of the parameter (H or S) in turn and ask "if the parameter is equal to this value, what is the probability of my test being correct?" A Bayesian will instead consider each possible observed value (+ or -) in turn and ask "If I imagine I have just observed that value, what does that tell me about the conditional probability of H-versus-S?"
Bayesian and frequentist reasoning in plain English
In reality, I think much of the philosophy surrounding the issue is just grandstanding. That's not to dismiss the debate, but it is a word of caution. Sometimes, practical matters take priority - I'
Bayesian and frequentist reasoning in plain English In reality, I think much of the philosophy surrounding the issue is just grandstanding. That's not to dismiss the debate, but it is a word of caution. Sometimes, practical matters take priority - I'll give an example below. Also, you could just as easily argue that there are more than two approaches: Neyman-Pearson ('frequentist') Likelihood-based approaches Fully Bayesian A senior colleague recently reminded me that "many people in common language talk about frequentist and Bayesian. I think a more valid distinction is likelihood-based and frequentist. Both maximum likelihood and Bayesian methods adhere to the likelihood principle whereas frequentist methods don't." I'll start off with a very simple practical example: We have a patient. The patient is either healthy(H) or sick(S). We will perform a test on the patient, and the result will either be Positive(+) or Negative(-). If the patient is sick, they will always get a Positive result. We'll call this the correct(C) result and say that $$ P(+ | S ) = 1 $$ or $$ P(Correct | S) = 1 $$ If the patient is healthy, the test will be negative 95% of the time, but there will be some false positives. $$ P(- | H) = 0.95 $$ $$ P(+ | H) = 0.05 $$ In other works, the probability of the test being Correct, for Healthy people, is 95%. So, the test is either 100% accurate or 95% accurate, depending on whether the patient is healthy or sick. Taken together, this means the test is at least 95% accurate. So far so good. Those are the statements that would be make by a frequentist. Those statements are quite simple to understand and are true. There's no need to waffle about a 'frequentist interpretation'. But, things get interesting when you try to turn things around. Given the test result, what can you learn about the health of the patient? Given a negative test result, the patient is obviously healthy, as there are no false negatives. But we must also consider the case where the test is positive. Was the test positive because the patient was actually sick, or was it a false positive? This is where the frequentist and Bayesian diverge. Everybody will agree that this cannot be answered at the moment. The frequentist will refuse to answer. The Bayesian will be prepared to give you an answer, but you'll have to give the Bayesian a prior first - i.e. tell it what proportion of the patients are sick. To recap, the following statements are true: For healthy patients, the test is very accurate. For sick patients, the test is very accurate. If you are satisfied with statements such as that, then you are using frequentist interpretations. This might change from project to project, depending on what sort of problems you're looking at. But you might want to make different statements and answer the following question: For those patients that got a positive test result, how accurate is the test? This requires a prior and a Bayesian approach. Note also that this is the only question of interest to the doctor. The doctor will say "I know that the patients will either get a positive result or a negative result. I also now that the negative result means the patient is healthy and can be send home. The only patients that interest me now are those that got a positive result -- are they sick?." To summarize: In examples such as this, the Bayesian will agree with everything said by the frequentist. But the Bayesian will argue that the frequentist's statements, while true, are not very useful; and will argue that the useful questions can only be answered with a prior. A frequentist will consider each possible value of the parameter (H or S) in turn and ask "if the parameter is equal to this value, what is the probability of my test being correct?" A Bayesian will instead consider each possible observed value (+ or -) in turn and ask "If I imagine I have just observed that value, what does that tell me about the conditional probability of H-versus-S?"
Bayesian and frequentist reasoning in plain English In reality, I think much of the philosophy surrounding the issue is just grandstanding. That's not to dismiss the debate, but it is a word of caution. Sometimes, practical matters take priority - I'
43,687
Bayesian and frequentist reasoning in plain English
Bayesian and frequentist statistics are compatible in that they can be understood as two limiting cases of assessing the probability of future events based on past events and an assumed model, if one admits that in the limit of a very large number of observations, no uncertainty about the system remains, and that in this sense a very large number of observations is equal to knowing the parameters of the model. Assume we have made some observations, e.g., outcome of 10 coin flips. In Bayesian statistics, you start from what you have observed and then you assess the probability of future observations or model parameters. In frequentist statistics, you start from an idea (hypothesis) of what is true by assuming scenarios of a large number of observations that have been made, e.g., coin is unbiased and gives 50% heads up, if you throw it many many times. Based on these scenarios of a large number of observations (=hypothesis), you assess the frequency of making observations like the one you did, i.e.,frequency of different outcomes of 10 coin flips. It is only then that you take your actual outcome, compare it to the frequency of possible outcomes, and decide whether the outcome belongs to those that are expected to occur with high frequency. If this is the case you conclude that the observation made does not contradict your scenarios (=hypothesis). Otherwise, you conclude that the observation made is incompatible with your scenarios, and you reject the hypothesis. Thus Bayesian statistics starts from what has been observed and assesses possible future outcomes. Frequentist statistics starts with an abstract experiment of what would be observed if one assumes something, and only then compares the outcomes of the abstract experiment with what was actually observed. Otherwise the two approaches are compatible. They both assess the probability of future observations based on some observations made or hypothesized. I started to write this up in a more formal way: Positioning Bayesian inference as a particular application of frequentist inference and vice versa. figshare. http://dx.doi.org/10.6084/m9.figshare.867707 The manuscript is new. If you happen to read it, and have comments, please let me know.
Bayesian and frequentist reasoning in plain English
Bayesian and frequentist statistics are compatible in that they can be understood as two limiting cases of assessing the probability of future events based on past events and an assumed model, if one
Bayesian and frequentist reasoning in plain English Bayesian and frequentist statistics are compatible in that they can be understood as two limiting cases of assessing the probability of future events based on past events and an assumed model, if one admits that in the limit of a very large number of observations, no uncertainty about the system remains, and that in this sense a very large number of observations is equal to knowing the parameters of the model. Assume we have made some observations, e.g., outcome of 10 coin flips. In Bayesian statistics, you start from what you have observed and then you assess the probability of future observations or model parameters. In frequentist statistics, you start from an idea (hypothesis) of what is true by assuming scenarios of a large number of observations that have been made, e.g., coin is unbiased and gives 50% heads up, if you throw it many many times. Based on these scenarios of a large number of observations (=hypothesis), you assess the frequency of making observations like the one you did, i.e.,frequency of different outcomes of 10 coin flips. It is only then that you take your actual outcome, compare it to the frequency of possible outcomes, and decide whether the outcome belongs to those that are expected to occur with high frequency. If this is the case you conclude that the observation made does not contradict your scenarios (=hypothesis). Otherwise, you conclude that the observation made is incompatible with your scenarios, and you reject the hypothesis. Thus Bayesian statistics starts from what has been observed and assesses possible future outcomes. Frequentist statistics starts with an abstract experiment of what would be observed if one assumes something, and only then compares the outcomes of the abstract experiment with what was actually observed. Otherwise the two approaches are compatible. They both assess the probability of future observations based on some observations made or hypothesized. I started to write this up in a more formal way: Positioning Bayesian inference as a particular application of frequentist inference and vice versa. figshare. http://dx.doi.org/10.6084/m9.figshare.867707 The manuscript is new. If you happen to read it, and have comments, please let me know.
Bayesian and frequentist reasoning in plain English Bayesian and frequentist statistics are compatible in that they can be understood as two limiting cases of assessing the probability of future events based on past events and an assumed model, if one
43,688
Bayesian and frequentist reasoning in plain English
I would say that they look at probability in different ways. The Bayesian is subjective and uses a priori beliefs to define a prior probability distribution on the possible values of the unknown parameters. So he relies on a theory of probability like deFinetti's. The frequentist see probability as something that has to do with a limiting frequency based on an observed proportion. This is in line with the theory of probability as developed by Kolmogorov and von Mises. A frequentist does parametric inference using just the likelihood function. A Bayesian takes that and multiplies to by a prior and normalizes it to get the posterior distribution that he uses for inference.
Bayesian and frequentist reasoning in plain English
I would say that they look at probability in different ways. The Bayesian is subjective and uses a priori beliefs to define a prior probability distribution on the possible values of the unknown para
Bayesian and frequentist reasoning in plain English I would say that they look at probability in different ways. The Bayesian is subjective and uses a priori beliefs to define a prior probability distribution on the possible values of the unknown parameters. So he relies on a theory of probability like deFinetti's. The frequentist see probability as something that has to do with a limiting frequency based on an observed proportion. This is in line with the theory of probability as developed by Kolmogorov and von Mises. A frequentist does parametric inference using just the likelihood function. A Bayesian takes that and multiplies to by a prior and normalizes it to get the posterior distribution that he uses for inference.
Bayesian and frequentist reasoning in plain English I would say that they look at probability in different ways. The Bayesian is subjective and uses a priori beliefs to define a prior probability distribution on the possible values of the unknown para
43,689
Bayesian and frequentist reasoning in plain English
The simplest and clearest explanation I've seen, from Larry Wasserman's notes on Statistical Machine Learning (with disclaimer: "at the risk of oversimplifying"): Frequentist versus Bayesian Methods In frequentist inference, probabilities are interpreted as long run frequencies. The goal is to create procedures with long run frequency guarantees. In Bayesian inference, probabilities are interpreted as subjective degrees of belief. The goal is to state and analyze your beliefs. What's tricky is that we work with two different interpretations of probability which can get philosophical. For example, if I say "this coin has a 1/2 probability of landing heads", what does that mean? The frequentist viewpoint is that if we performed many coin flips, then the counts ("frequencies") of heads divided by the total number of flips should more or less get closer and closer to 1/2. There is nothing subjective about this which can be viewed as a good thing, however we can't really perform infinite flips and in some cases we can't repeat the experiment at all, so an argument about limits or long run frequencies might be in some ways unsatisfactory. On the other hand, the Bayesian viewpoint is subjective, in that we view probability as some kind of "degree of belief", or "gambling odds" if we specifically use de Finetti's interpretation. For example, two people may come into the coin flipping experiment with different beliefs about what they believe about the coin (prior probability). After the experiment which has collected data/evidence and the people have updated their beliefs in accordance with Bayes' theorem, they leave with different ideas of what the posterior probability of the coin is, and both people can justify their beliefs as "logical"/"rational"/"coherent" (depending on the exact flavor of Bayesian interpretation). In practice, statisticians can use either kind of methods as long as they are careful with their assumptions and conclusions. Nowadays Bayesian methods are becoming increasingly popular with better computers and algorithms like MCMC. Also, in finite dimensional models, Bayesian inference may have same guarantees of consistency and rate of convergence as frequentist models. I don't think there is any way around really understanding Bayesian and frequentist reasoning without confronting (or at least acknowledging) the interpretations of probability.
Bayesian and frequentist reasoning in plain English
The simplest and clearest explanation I've seen, from Larry Wasserman's notes on Statistical Machine Learning (with disclaimer: "at the risk of oversimplifying"): Frequentist versus Bayesian Methods
Bayesian and frequentist reasoning in plain English The simplest and clearest explanation I've seen, from Larry Wasserman's notes on Statistical Machine Learning (with disclaimer: "at the risk of oversimplifying"): Frequentist versus Bayesian Methods In frequentist inference, probabilities are interpreted as long run frequencies. The goal is to create procedures with long run frequency guarantees. In Bayesian inference, probabilities are interpreted as subjective degrees of belief. The goal is to state and analyze your beliefs. What's tricky is that we work with two different interpretations of probability which can get philosophical. For example, if I say "this coin has a 1/2 probability of landing heads", what does that mean? The frequentist viewpoint is that if we performed many coin flips, then the counts ("frequencies") of heads divided by the total number of flips should more or less get closer and closer to 1/2. There is nothing subjective about this which can be viewed as a good thing, however we can't really perform infinite flips and in some cases we can't repeat the experiment at all, so an argument about limits or long run frequencies might be in some ways unsatisfactory. On the other hand, the Bayesian viewpoint is subjective, in that we view probability as some kind of "degree of belief", or "gambling odds" if we specifically use de Finetti's interpretation. For example, two people may come into the coin flipping experiment with different beliefs about what they believe about the coin (prior probability). After the experiment which has collected data/evidence and the people have updated their beliefs in accordance with Bayes' theorem, they leave with different ideas of what the posterior probability of the coin is, and both people can justify their beliefs as "logical"/"rational"/"coherent" (depending on the exact flavor of Bayesian interpretation). In practice, statisticians can use either kind of methods as long as they are careful with their assumptions and conclusions. Nowadays Bayesian methods are becoming increasingly popular with better computers and algorithms like MCMC. Also, in finite dimensional models, Bayesian inference may have same guarantees of consistency and rate of convergence as frequentist models. I don't think there is any way around really understanding Bayesian and frequentist reasoning without confronting (or at least acknowledging) the interpretations of probability.
Bayesian and frequentist reasoning in plain English The simplest and clearest explanation I've seen, from Larry Wasserman's notes on Statistical Machine Learning (with disclaimer: "at the risk of oversimplifying"): Frequentist versus Bayesian Methods
43,690
Bayesian and frequentist reasoning in plain English
I've attempted a side-by-side comparison of the two schools of thought here and have more background information here.
Bayesian and frequentist reasoning in plain English
I've attempted a side-by-side comparison of the two schools of thought here and have more background information here.
Bayesian and frequentist reasoning in plain English I've attempted a side-by-side comparison of the two schools of thought here and have more background information here.
Bayesian and frequentist reasoning in plain English I've attempted a side-by-side comparison of the two schools of thought here and have more background information here.
43,691
Bayesian and frequentist reasoning in plain English
The way I answer this question is that frequentists compare the data they see to what they expected. That is, they have a mental model on how frequent something should happen, and then see data and how often it did happen. i.e. how likely is the data they have seen given the model they chose. Bayesian people, on the other hand, combine their mental models. That is, they have a model based on their previous experiences that tells them what they think the data should look like, and then they combine this with the data they observe to settle upon some ``posterior'' belief. i.e., they find the probability the model they seek to choose is valid given the data they have observed.
Bayesian and frequentist reasoning in plain English
The way I answer this question is that frequentists compare the data they see to what they expected. That is, they have a mental model on how frequent something should happen, and then see data and ho
Bayesian and frequentist reasoning in plain English The way I answer this question is that frequentists compare the data they see to what they expected. That is, they have a mental model on how frequent something should happen, and then see data and how often it did happen. i.e. how likely is the data they have seen given the model they chose. Bayesian people, on the other hand, combine their mental models. That is, they have a model based on their previous experiences that tells them what they think the data should look like, and then they combine this with the data they observe to settle upon some ``posterior'' belief. i.e., they find the probability the model they seek to choose is valid given the data they have observed.
Bayesian and frequentist reasoning in plain English The way I answer this question is that frequentists compare the data they see to what they expected. That is, they have a mental model on how frequent something should happen, and then see data and ho
43,692
Bayesian and frequentist reasoning in plain English
In short plain English as follows: In Bayesian, parameters vary and data are fixed In Bayesian, $P(\theta|X)=\frac{P(X|\theta)P(\theta)}{P(X)}$ where $P(\theta|X)$ means parameters vary and data are fixed. In frequentist, parameters are fixed and data vary In frequentist, $P(\theta|X)=P(X|\theta)$ where $P(X|\theta)$ means parameters are fixed and data vary. References: https://stats.stackexchange.com/a/513020/103153 https://math.stackexchange.com/a/2126820/351322
Bayesian and frequentist reasoning in plain English
In short plain English as follows: In Bayesian, parameters vary and data are fixed In Bayesian, $P(\theta|X)=\frac{P(X|\theta)P(\theta)}{P(X)}$ where $P(\theta|X)$ means parameters vary and data are
Bayesian and frequentist reasoning in plain English In short plain English as follows: In Bayesian, parameters vary and data are fixed In Bayesian, $P(\theta|X)=\frac{P(X|\theta)P(\theta)}{P(X)}$ where $P(\theta|X)$ means parameters vary and data are fixed. In frequentist, parameters are fixed and data vary In frequentist, $P(\theta|X)=P(X|\theta)$ where $P(X|\theta)$ means parameters are fixed and data vary. References: https://stats.stackexchange.com/a/513020/103153 https://math.stackexchange.com/a/2126820/351322
Bayesian and frequentist reasoning in plain English In short plain English as follows: In Bayesian, parameters vary and data are fixed In Bayesian, $P(\theta|X)=\frac{P(X|\theta)P(\theta)}{P(X)}$ where $P(\theta|X)$ means parameters vary and data are
43,693
What R packages do you find most useful in your daily work?
Please see link: TOP 100 R PACKAGES FOR 2013 (JAN-MAY) http://www.r-statistics.com/2013/06/top-100-r-packages-for-2013-jan-may/
What R packages do you find most useful in your daily work?
Please see link: TOP 100 R PACKAGES FOR 2013 (JAN-MAY) http://www.r-statistics.com/2013/06/top-100-r-packages-for-2013-jan-may/
What R packages do you find most useful in your daily work? Please see link: TOP 100 R PACKAGES FOR 2013 (JAN-MAY) http://www.r-statistics.com/2013/06/top-100-r-packages-for-2013-jan-may/
What R packages do you find most useful in your daily work? Please see link: TOP 100 R PACKAGES FOR 2013 (JAN-MAY) http://www.r-statistics.com/2013/06/top-100-r-packages-for-2013-jan-may/
43,694
What R packages do you find most useful in your daily work?
I use plyr and ggplot2 the most on a daily basis. I also rely heavily on time series packages; most especially, the zoo package.
What R packages do you find most useful in your daily work?
I use plyr and ggplot2 the most on a daily basis. I also rely heavily on time series packages; most especially, the zoo package.
What R packages do you find most useful in your daily work? I use plyr and ggplot2 the most on a daily basis. I also rely heavily on time series packages; most especially, the zoo package.
What R packages do you find most useful in your daily work? I use plyr and ggplot2 the most on a daily basis. I also rely heavily on time series packages; most especially, the zoo package.
43,695
What R packages do you find most useful in your daily work?
In a narrow sense, R Core has a recommendation: the "recommended" packages. Everything else depends on your data analysis tasks at hand, and I'd recommend the Task Views at CRAN.
What R packages do you find most useful in your daily work?
In a narrow sense, R Core has a recommendation: the "recommended" packages. Everything else depends on your data analysis tasks at hand, and I'd recommend the Task Views at CRAN.
What R packages do you find most useful in your daily work? In a narrow sense, R Core has a recommendation: the "recommended" packages. Everything else depends on your data analysis tasks at hand, and I'd recommend the Task Views at CRAN.
What R packages do you find most useful in your daily work? In a narrow sense, R Core has a recommendation: the "recommended" packages. Everything else depends on your data analysis tasks at hand, and I'd recommend the Task Views at CRAN.
43,696
What R packages do you find most useful in your daily work?
I use the xtable package. The xtable package turns tables produced by R (in particular, the tables displaying the anova results) into LaTeX tables, to be included in an article.
What R packages do you find most useful in your daily work?
I use the xtable package. The xtable package turns tables produced by R (in particular, the tables displaying the anova results) into LaTeX tables, to be included in an article.
What R packages do you find most useful in your daily work? I use the xtable package. The xtable package turns tables produced by R (in particular, the tables displaying the anova results) into LaTeX tables, to be included in an article.
What R packages do you find most useful in your daily work? I use the xtable package. The xtable package turns tables produced by R (in particular, the tables displaying the anova results) into LaTeX tables, to be included in an article.
43,697
What R packages do you find most useful in your daily work?
multicore is quite nice for tool for making faster scripts faster. cacheSweave saves a lot of time when using Sweave.
What R packages do you find most useful in your daily work?
multicore is quite nice for tool for making faster scripts faster. cacheSweave saves a lot of time when using Sweave.
What R packages do you find most useful in your daily work? multicore is quite nice for tool for making faster scripts faster. cacheSweave saves a lot of time when using Sweave.
What R packages do you find most useful in your daily work? multicore is quite nice for tool for making faster scripts faster. cacheSweave saves a lot of time when using Sweave.
43,698
What R packages do you find most useful in your daily work?
ggplot2 - hands down best visualization for R. RMySQL/RSQLite/RODBC - for connecting to a databases sqldf - manipulate data.frames with SQL queries Hmisc/rms - packages from Frank Harrell containing convenient miscellaneous functions and nice functions for regression analyses. GenABEL - nice package for genome-wide association studies Rcmdr - a decent GUI for R if you need one. Also check out CRANtastic - this link has a list of the most popular R packages. Many on the top of the list have already been ment
What R packages do you find most useful in your daily work?
ggplot2 - hands down best visualization for R. RMySQL/RSQLite/RODBC - for connecting to a databases sqldf - manipulate data.frames with SQL queries Hmisc/rms - packages from Frank Harrell containing c
What R packages do you find most useful in your daily work? ggplot2 - hands down best visualization for R. RMySQL/RSQLite/RODBC - for connecting to a databases sqldf - manipulate data.frames with SQL queries Hmisc/rms - packages from Frank Harrell containing convenient miscellaneous functions and nice functions for regression analyses. GenABEL - nice package for genome-wide association studies Rcmdr - a decent GUI for R if you need one. Also check out CRANtastic - this link has a list of the most popular R packages. Many on the top of the list have already been ment
What R packages do you find most useful in your daily work? ggplot2 - hands down best visualization for R. RMySQL/RSQLite/RODBC - for connecting to a databases sqldf - manipulate data.frames with SQL queries Hmisc/rms - packages from Frank Harrell containing c
43,699
What R packages do you find most useful in your daily work?
data.table is my favorite now! Very look forward to the new version with the more wishlist implemented.
What R packages do you find most useful in your daily work?
data.table is my favorite now! Very look forward to the new version with the more wishlist implemented.
What R packages do you find most useful in your daily work? data.table is my favorite now! Very look forward to the new version with the more wishlist implemented.
What R packages do you find most useful in your daily work? data.table is my favorite now! Very look forward to the new version with the more wishlist implemented.
43,700
What R packages do you find most useful in your daily work?
Packages I often use are raster, sp, spatstat, vegan and splancs. I sometimes use ggplot2, tcltk and lattice.
What R packages do you find most useful in your daily work?
Packages I often use are raster, sp, spatstat, vegan and splancs. I sometimes use ggplot2, tcltk and lattice.
What R packages do you find most useful in your daily work? Packages I often use are raster, sp, spatstat, vegan and splancs. I sometimes use ggplot2, tcltk and lattice.
What R packages do you find most useful in your daily work? Packages I often use are raster, sp, spatstat, vegan and splancs. I sometimes use ggplot2, tcltk and lattice.