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
53,301
averaging after n trials of monte carlo simulation or not? which is better statistically?
Both procedures actually lead to the same answer from a probabilistic perspective, i.e., to the same distribution for the Monte Carlo estimator, since$$\frac{1}{10N}\sum_{i=1}^{10N} f(x_i)\sim\frac{1}{10}\sum_{j=1}^{10} \frac{1}{N}\sum_{k=1}^{N} f(x_{jk})$$ (meaning the two random variables have the same distribution) ...
averaging after n trials of monte carlo simulation or not? which is better statistically?
Both procedures actually lead to the same answer from a probabilistic perspective, i.e., to the same distribution for the Monte Carlo estimator, since$$\frac{1}{10N}\sum_{i=1}^{10N} f(x_i)\sim\frac{1}
averaging after n trials of monte carlo simulation or not? which is better statistically? Both procedures actually lead to the same answer from a probabilistic perspective, i.e., to the same distribution for the Monte Carlo estimator, since$$\frac{1}{10N}\sum_{i=1}^{10N} f(x_i)\sim\frac{1}{10}\sum_{j=1}^{10} \frac{1}{N...
averaging after n trials of monte carlo simulation or not? which is better statistically? Both procedures actually lead to the same answer from a probabilistic perspective, i.e., to the same distribution for the Monte Carlo estimator, since$$\frac{1}{10N}\sum_{i=1}^{10N} f(x_i)\sim\frac{1}
53,302
averaging after n trials of monte carlo simulation or not? which is better statistically?
I prefer to talk here and not in the ~comments~ because it seems to be a long writing. I am not a statistician on discipline :) but here are some proposal aspect for setting up your MC analysis... Number of Experiments OF course, the more experiments you try, the better, so, by far, the preferable Procedure would be t...
averaging after n trials of monte carlo simulation or not? which is better statistically?
I prefer to talk here and not in the ~comments~ because it seems to be a long writing. I am not a statistician on discipline :) but here are some proposal aspect for setting up your MC analysis... Nu
averaging after n trials of monte carlo simulation or not? which is better statistically? I prefer to talk here and not in the ~comments~ because it seems to be a long writing. I am not a statistician on discipline :) but here are some proposal aspect for setting up your MC analysis... Number of Experiments OF course,...
averaging after n trials of monte carlo simulation or not? which is better statistically? I prefer to talk here and not in the ~comments~ because it seems to be a long writing. I am not a statistician on discipline :) but here are some proposal aspect for setting up your MC analysis... Nu
53,303
Are there alternatives to the Bayesian update rule?
There are some alternatives, in fact, but they rely on using non-probabilistic methods. (The uniqueness of Bayes Law is implied by the uniqueness of a single probability measure, and the definition of joint probability - see this other answer for details) Dempster Shafer theory is an alternative, as are more complex fo...
Are there alternatives to the Bayesian update rule?
There are some alternatives, in fact, but they rely on using non-probabilistic methods. (The uniqueness of Bayes Law is implied by the uniqueness of a single probability measure, and the definition of
Are there alternatives to the Bayesian update rule? There are some alternatives, in fact, but they rely on using non-probabilistic methods. (The uniqueness of Bayes Law is implied by the uniqueness of a single probability measure, and the definition of joint probability - see this other answer for details) Dempster Sha...
Are there alternatives to the Bayesian update rule? There are some alternatives, in fact, but they rely on using non-probabilistic methods. (The uniqueness of Bayes Law is implied by the uniqueness of a single probability measure, and the definition of
53,304
Are there alternatives to the Bayesian update rule?
I'll add another perspective. In E. T. Jaynes incredible book Probability Theory: The Logic Of Science, he gives a rigorous treatment of an extension of Aristotelian logic to degrees of belief (Jaynes was a baysean to the core). That is, he explores a probability theory so that $P = 1$ and $P = 0$ correspond to True ...
Are there alternatives to the Bayesian update rule?
I'll add another perspective. In E. T. Jaynes incredible book Probability Theory: The Logic Of Science, he gives a rigorous treatment of an extension of Aristotelian logic to degrees of belief (Jayne
Are there alternatives to the Bayesian update rule? I'll add another perspective. In E. T. Jaynes incredible book Probability Theory: The Logic Of Science, he gives a rigorous treatment of an extension of Aristotelian logic to degrees of belief (Jaynes was a baysean to the core). That is, he explores a probability th...
Are there alternatives to the Bayesian update rule? I'll add another perspective. In E. T. Jaynes incredible book Probability Theory: The Logic Of Science, he gives a rigorous treatment of an extension of Aristotelian logic to degrees of belief (Jayne
53,305
Are there alternatives to the Bayesian update rule?
To my knowledge, if you assign a probability to your belief, the bayesian updating rule is the only way to act upon new datas in a consistent manner in line with probabilities. You might have two reasons to leave the bayesian framework : You don't want to assign probabilities to a belief. You don't have (or do...
Are there alternatives to the Bayesian update rule?
To my knowledge, if you assign a probability to your belief, the bayesian updating rule is the only way to act upon new datas in a consistent manner in line with probabilities. You might have two reas
Are there alternatives to the Bayesian update rule? To my knowledge, if you assign a probability to your belief, the bayesian updating rule is the only way to act upon new datas in a consistent manner in line with probabilities. You might have two reasons to leave the bayesian framework : You don't want to assign ...
Are there alternatives to the Bayesian update rule? To my knowledge, if you assign a probability to your belief, the bayesian updating rule is the only way to act upon new datas in a consistent manner in line with probabilities. You might have two reas
53,306
Comparing models in linear mixed effects regression in R
While you can compare model 1 and model 2, and choose among them by ordinary likelihood ratio tests or F tests (e.g. anova in R), you cannot compare model 1 with 3 or model 2 with 3 by likelihood ratio tests or F tests. Nor you can compare 1 vs 3 and 2 vs 3 by information criteria, as the response variables are on diff...
Comparing models in linear mixed effects regression in R
While you can compare model 1 and model 2, and choose among them by ordinary likelihood ratio tests or F tests (e.g. anova in R), you cannot compare model 1 with 3 or model 2 with 3 by likelihood rati
Comparing models in linear mixed effects regression in R While you can compare model 1 and model 2, and choose among them by ordinary likelihood ratio tests or F tests (e.g. anova in R), you cannot compare model 1 with 3 or model 2 with 3 by likelihood ratio tests or F tests. Nor you can compare 1 vs 3 and 2 vs 3 by in...
Comparing models in linear mixed effects regression in R While you can compare model 1 and model 2, and choose among them by ordinary likelihood ratio tests or F tests (e.g. anova in R), you cannot compare model 1 with 3 or model 2 with 3 by likelihood rati
53,307
Should the average prediction = the average value in regression?
For a linear model with an intercept term, yes. This is because the solution satisfies: $$ X^{t} X\beta = X^{t} y $$ This is a system of equations. The very first row in $X^{t}$ is all ones, so the first equation is: $$ \sum_i \sum_j x_{ij} \beta_j = \sum_i y_i $$ Which reads, sum of predictions equals sum of response...
Should the average prediction = the average value in regression?
For a linear model with an intercept term, yes. This is because the solution satisfies: $$ X^{t} X\beta = X^{t} y $$ This is a system of equations. The very first row in $X^{t}$ is all ones, so the f
Should the average prediction = the average value in regression? For a linear model with an intercept term, yes. This is because the solution satisfies: $$ X^{t} X\beta = X^{t} y $$ This is a system of equations. The very first row in $X^{t}$ is all ones, so the first equation is: $$ \sum_i \sum_j x_{ij} \beta_j = \su...
Should the average prediction = the average value in regression? For a linear model with an intercept term, yes. This is because the solution satisfies: $$ X^{t} X\beta = X^{t} y $$ This is a system of equations. The very first row in $X^{t}$ is all ones, so the f
53,308
What is Bartlett's theory?
I suspect what Fox et al 2005 refers to is Bartlett 1946 which is a more "general" form of the AR1-based variance estimator (Bartlett 1935). Bartlett 1946's estimator was later adapted for bivariate time series by Quenouille 1947 as a DoF estimator. Suppose $X$ and $Y$ are two time series of length $N$ where $\rho_{XX,...
What is Bartlett's theory?
I suspect what Fox et al 2005 refers to is Bartlett 1946 which is a more "general" form of the AR1-based variance estimator (Bartlett 1935). Bartlett 1946's estimator was later adapted for bivariate t
What is Bartlett's theory? I suspect what Fox et al 2005 refers to is Bartlett 1946 which is a more "general" form of the AR1-based variance estimator (Bartlett 1935). Bartlett 1946's estimator was later adapted for bivariate time series by Quenouille 1947 as a DoF estimator. Suppose $X$ and $Y$ are two time series of ...
What is Bartlett's theory? I suspect what Fox et al 2005 refers to is Bartlett 1946 which is a more "general" form of the AR1-based variance estimator (Bartlett 1935). Bartlett 1946's estimator was later adapted for bivariate t
53,309
What is Bartlett's theory?
In the supporting information for another paper from the same group, I found this elaboration: Because individual time points in the BOLD signal are not statistically independent, the degrees of freedom must be computed according to Bartlett’s theory, i.e., computing the integral across all time of the square of the a...
What is Bartlett's theory?
In the supporting information for another paper from the same group, I found this elaboration: Because individual time points in the BOLD signal are not statistically independent, the degrees of free
What is Bartlett's theory? In the supporting information for another paper from the same group, I found this elaboration: Because individual time points in the BOLD signal are not statistically independent, the degrees of freedom must be computed according to Bartlett’s theory, i.e., computing the integral across all ...
What is Bartlett's theory? In the supporting information for another paper from the same group, I found this elaboration: Because individual time points in the BOLD signal are not statistically independent, the degrees of free
53,310
What is Bartlett's theory?
Bartlett's theory here refers to results from this paper On the Theoretical Specification and Sampling Properties of Autocorrelated Time-Series. The main idea here is that if you have $n$ discrete time observations, the effective number of degrees of freedom needs to be less than n since the observations are not indep...
What is Bartlett's theory?
Bartlett's theory here refers to results from this paper On the Theoretical Specification and Sampling Properties of Autocorrelated Time-Series. The main idea here is that if you have $n$ discrete ti
What is Bartlett's theory? Bartlett's theory here refers to results from this paper On the Theoretical Specification and Sampling Properties of Autocorrelated Time-Series. The main idea here is that if you have $n$ discrete time observations, the effective number of degrees of freedom needs to be less than n since the...
What is Bartlett's theory? Bartlett's theory here refers to results from this paper On the Theoretical Specification and Sampling Properties of Autocorrelated Time-Series. The main idea here is that if you have $n$ discrete ti
53,311
Knn classifier for Online learning
KNN, as any other classifier, can be trained offline and then applied in online settings. But data generation distribution may change over time, so you'll have to handle so-called "Concept Drifts" (see http://en.wikipedia.org/wiki/Concept_drift). The simplest way to deal with it is to retrain the model over some fixed...
Knn classifier for Online learning
KNN, as any other classifier, can be trained offline and then applied in online settings. But data generation distribution may change over time, so you'll have to handle so-called "Concept Drifts" (s
Knn classifier for Online learning KNN, as any other classifier, can be trained offline and then applied in online settings. But data generation distribution may change over time, so you'll have to handle so-called "Concept Drifts" (see http://en.wikipedia.org/wiki/Concept_drift). The simplest way to deal with it is t...
Knn classifier for Online learning KNN, as any other classifier, can be trained offline and then applied in online settings. But data generation distribution may change over time, so you'll have to handle so-called "Concept Drifts" (s
53,312
Knn classifier for Online learning
KNN is essentially a special (extreme) case of the EM algorithm. Online variants for the EM have been developed (see for instance http://arxiv.org/pdf/0712.4273v3.pdf) and so the short answer to the question is yes
Knn classifier for Online learning
KNN is essentially a special (extreme) case of the EM algorithm. Online variants for the EM have been developed (see for instance http://arxiv.org/pdf/0712.4273v3.pdf) and so the short answer to the q
Knn classifier for Online learning KNN is essentially a special (extreme) case of the EM algorithm. Online variants for the EM have been developed (see for instance http://arxiv.org/pdf/0712.4273v3.pdf) and so the short answer to the question is yes
Knn classifier for Online learning KNN is essentially a special (extreme) case of the EM algorithm. Online variants for the EM have been developed (see for instance http://arxiv.org/pdf/0712.4273v3.pdf) and so the short answer to the q
53,313
How to simulate type I error and type II error
First, a conventional way to write a test of hypothesis is: $H_0: \mu=0$ and $H_1: \mu \ne 0$ or $H_1: \mu >0$ or $H_1: \mu <0$ based on the interest of the study. Let's define Type I error: Probability of rejecting null hypothesis when it is TRUE. Type II error: Probability of not rejecting null hypothesis when it...
How to simulate type I error and type II error
First, a conventional way to write a test of hypothesis is: $H_0: \mu=0$ and $H_1: \mu \ne 0$ or $H_1: \mu >0$ or $H_1: \mu <0$ based on the interest of the study. Let's define Type I error: Probabi
How to simulate type I error and type II error First, a conventional way to write a test of hypothesis is: $H_0: \mu=0$ and $H_1: \mu \ne 0$ or $H_1: \mu >0$ or $H_1: \mu <0$ based on the interest of the study. Let's define Type I error: Probability of rejecting null hypothesis when it is TRUE. Type II error: Proba...
How to simulate type I error and type II error First, a conventional way to write a test of hypothesis is: $H_0: \mu=0$ and $H_1: \mu \ne 0$ or $H_1: \mu >0$ or $H_1: \mu <0$ based on the interest of the study. Let's define Type I error: Probabi
53,314
How to simulate type I error and type II error
Just to replicate this post dwelling on a different iteration of the same idea - in this case how quickly an unscrupulous researcher could generate throw-away pseudo-science with significant p values, I landed on this page, and learned from the accepted answer (+1). It turns out the mean is $20$ as predicted; the media...
How to simulate type I error and type II error
Just to replicate this post dwelling on a different iteration of the same idea - in this case how quickly an unscrupulous researcher could generate throw-away pseudo-science with significant p values,
How to simulate type I error and type II error Just to replicate this post dwelling on a different iteration of the same idea - in this case how quickly an unscrupulous researcher could generate throw-away pseudo-science with significant p values, I landed on this page, and learned from the accepted answer (+1). It tur...
How to simulate type I error and type II error Just to replicate this post dwelling on a different iteration of the same idea - in this case how quickly an unscrupulous researcher could generate throw-away pseudo-science with significant p values,
53,315
Overdispersion in GLM with Gaussian distribution
how can I check for overdispersion with the Gaussian distribution and how can I correct for it? The Poisson and the binomial have a variance that's a fixed function of the mean. e.g. for a Poisson, $\text{Var}(X)=\mu$, so it's possible to have some count data which has $\text{Var}(X)>\mu$, i.e. more dispersed than wou...
Overdispersion in GLM with Gaussian distribution
how can I check for overdispersion with the Gaussian distribution and how can I correct for it? The Poisson and the binomial have a variance that's a fixed function of the mean. e.g. for a Poisson, $
Overdispersion in GLM with Gaussian distribution how can I check for overdispersion with the Gaussian distribution and how can I correct for it? The Poisson and the binomial have a variance that's a fixed function of the mean. e.g. for a Poisson, $\text{Var}(X)=\mu$, so it's possible to have some count data which has ...
Overdispersion in GLM with Gaussian distribution how can I check for overdispersion with the Gaussian distribution and how can I correct for it? The Poisson and the binomial have a variance that's a fixed function of the mean. e.g. for a Poisson, $
53,316
Doing multiple regression without intercept in R (without changing data dimensions)
The formula lm(formula = y ~ x1 + x2) will include an intercept by default. The formula lm(formula = y ~ x1 + x2 -1) or lm(formula = y ~ x1 + x2 +0) is how R estimates an OLS model without an intercept. The formula lm(formula = y-1 ~ x1 + x2) estimates a model against a dependent variable y with 1 subtracted from ...
Doing multiple regression without intercept in R (without changing data dimensions)
The formula lm(formula = y ~ x1 + x2) will include an intercept by default. The formula lm(formula = y ~ x1 + x2 -1) or lm(formula = y ~ x1 + x2 +0) is how R estimates an OLS model without an inte
Doing multiple regression without intercept in R (without changing data dimensions) The formula lm(formula = y ~ x1 + x2) will include an intercept by default. The formula lm(formula = y ~ x1 + x2 -1) or lm(formula = y ~ x1 + x2 +0) is how R estimates an OLS model without an intercept. The formula lm(formula = y-1 ...
Doing multiple regression without intercept in R (without changing data dimensions) The formula lm(formula = y ~ x1 + x2) will include an intercept by default. The formula lm(formula = y ~ x1 + x2 -1) or lm(formula = y ~ x1 + x2 +0) is how R estimates an OLS model without an inte
53,317
The fallacy of splitting data collection time into shorter intervals to reduce error
A constant rate of events per unit time is called a Poisson process when the outcomes in one time interval are independent of the outcomes in any other time interval. This independence assumption is usually valid and supported by physical considerations. When not, it can be tested. A Poisson process is characterized ...
The fallacy of splitting data collection time into shorter intervals to reduce error
A constant rate of events per unit time is called a Poisson process when the outcomes in one time interval are independent of the outcomes in any other time interval. This independence assumption is
The fallacy of splitting data collection time into shorter intervals to reduce error A constant rate of events per unit time is called a Poisson process when the outcomes in one time interval are independent of the outcomes in any other time interval. This independence assumption is usually valid and supported by phys...
The fallacy of splitting data collection time into shorter intervals to reduce error A constant rate of events per unit time is called a Poisson process when the outcomes in one time interval are independent of the outcomes in any other time interval. This independence assumption is
53,318
The fallacy of splitting data collection time into shorter intervals to reduce error
One easy way to see that this is that in both cases, when asked to predict the mean you're going to predict the same thing. If your rate is given by $f(x)$,your first four readings are equal to $$x_i =1/30 \int_{30i}^{30i + 30}f(x)dx$$ for $i \in \{0,1,2,3 \}$ and your other readings are $$y_j =1/10 \int_{10j}^{10j...
The fallacy of splitting data collection time into shorter intervals to reduce error
One easy way to see that this is that in both cases, when asked to predict the mean you're going to predict the same thing. If your rate is given by $f(x)$,your first four readings are equal to $$x_
The fallacy of splitting data collection time into shorter intervals to reduce error One easy way to see that this is that in both cases, when asked to predict the mean you're going to predict the same thing. If your rate is given by $f(x)$,your first four readings are equal to $$x_i =1/30 \int_{30i}^{30i + 30}f(x)dx...
The fallacy of splitting data collection time into shorter intervals to reduce error One easy way to see that this is that in both cases, when asked to predict the mean you're going to predict the same thing. If your rate is given by $f(x)$,your first four readings are equal to $$x_
53,319
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution
If you are looking to fit a log-logistic distribution to your data, it is fairly straightforward to do so. In the example below, I am using the function dllog to get at the density of the log-logistic for a given set of values of the shape and scale parameter, but it is no trouble to write the PDF code yourself as well...
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution
If you are looking to fit a log-logistic distribution to your data, it is fairly straightforward to do so. In the example below, I am using the function dllog to get at the density of the log-logistic
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution If you are looking to fit a log-logistic distribution to your data, it is fairly straightforward to do so. In the example below, I am using the function dllog to get at the density of the log-logistic for a given set of values of the shape and scal...
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution If you are looking to fit a log-logistic distribution to your data, it is fairly straightforward to do so. In the example below, I am using the function dllog to get at the density of the log-logistic
53,320
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution
I asked above for the parametrization, as in Actuarial Science (at least in the US) the loglogistic (Fisk) is usually parameterized: $$ \begin{align} f(x) &= \frac{\gamma\left(\frac{x}{\theta}\right)^\gamma}{x + \left[1 + \left(\frac{x}{\theta}\right)^\gamma\right]^2}\\ F(x) &= \frac{\left(\frac{x}{\theta}\right)^\gamm...
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution
I asked above for the parametrization, as in Actuarial Science (at least in the US) the loglogistic (Fisk) is usually parameterized: $$ \begin{align} f(x) &= \frac{\gamma\left(\frac{x}{\theta}\right)^
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution I asked above for the parametrization, as in Actuarial Science (at least in the US) the loglogistic (Fisk) is usually parameterized: $$ \begin{align} f(x) &= \frac{\gamma\left(\frac{x}{\theta}\right)^\gamma}{x + \left[1 + \left(\frac{x}{\theta}\rig...
Determine Maximum Likelihood Estimate (MLE) of loglogistic distribution I asked above for the parametrization, as in Actuarial Science (at least in the US) the loglogistic (Fisk) is usually parameterized: $$ \begin{align} f(x) &= \frac{\gamma\left(\frac{x}{\theta}\right)^
53,321
Time Series for each customer
As @forecaster notes: sure you can. Just separate your data by customer. However, you will need to consider a couple of things. For instance, you only have sales acts, no zeros, so you will need to think about how to fill in zeros. From when till when? Are there periods where zero filling makes no sense, because the pr...
Time Series for each customer
As @forecaster notes: sure you can. Just separate your data by customer. However, you will need to consider a couple of things. For instance, you only have sales acts, no zeros, so you will need to th
Time Series for each customer As @forecaster notes: sure you can. Just separate your data by customer. However, you will need to consider a couple of things. For instance, you only have sales acts, no zeros, so you will need to think about how to fill in zeros. From when till when? Are there periods where zero filling ...
Time Series for each customer As @forecaster notes: sure you can. Just separate your data by customer. However, you will need to consider a couple of things. For instance, you only have sales acts, no zeros, so you will need to th
53,322
Time Series for each customer
You could use separate time-series models on each customer, but you probably want to account for changes in sales of all customers when modeling each individual customer. The most obvious way is to simply run VAR on the n-dimensional variable. There's an issue of missing observations: not every customer may have sales ...
Time Series for each customer
You could use separate time-series models on each customer, but you probably want to account for changes in sales of all customers when modeling each individual customer. The most obvious way is to si
Time Series for each customer You could use separate time-series models on each customer, but you probably want to account for changes in sales of all customers when modeling each individual customer. The most obvious way is to simply run VAR on the n-dimensional variable. There's an issue of missing observations: not ...
Time Series for each customer You could use separate time-series models on each customer, but you probably want to account for changes in sales of all customers when modeling each individual customer. The most obvious way is to si
53,323
Time Series for each customer
Check out some of the Fader and Hardie work, e.g. http://www.statwizards.com/Help/ForecastWizard/WebHelp/Overview/Overview_of_Fader-Hardie_Probability_Models.htm This link seems to be to a commercial site, but Fader and Hardie published their models in standard academic journals such as Marketing Science. Usually the...
Time Series for each customer
Check out some of the Fader and Hardie work, e.g. http://www.statwizards.com/Help/ForecastWizard/WebHelp/Overview/Overview_of_Fader-Hardie_Probability_Models.htm This link seems to be to a commercial
Time Series for each customer Check out some of the Fader and Hardie work, e.g. http://www.statwizards.com/Help/ForecastWizard/WebHelp/Overview/Overview_of_Fader-Hardie_Probability_Models.htm This link seems to be to a commercial site, but Fader and Hardie published their models in standard academic journals such as M...
Time Series for each customer Check out some of the Fader and Hardie work, e.g. http://www.statwizards.com/Help/ForecastWizard/WebHelp/Overview/Overview_of_Fader-Hardie_Probability_Models.htm This link seems to be to a commercial
53,324
Time Series for each customer
This kind of data is referred to as Intermittent Demand as the interval between demand/spend is non-uniform i.e there are days without any spend. Good forecasting software can handle these kinds of problems.
Time Series for each customer
This kind of data is referred to as Intermittent Demand as the interval between demand/spend is non-uniform i.e there are days without any spend. Good forecasting software can handle these kinds of pr
Time Series for each customer This kind of data is referred to as Intermittent Demand as the interval between demand/spend is non-uniform i.e there are days without any spend. Good forecasting software can handle these kinds of problems.
Time Series for each customer This kind of data is referred to as Intermittent Demand as the interval between demand/spend is non-uniform i.e there are days without any spend. Good forecasting software can handle these kinds of pr
53,325
Complement naive bayes
Let's make this simple, and do a very contrived two class case: Let's say we have three documents with the following words: Doc 1: "Food" occurs twice, "Meat" occurs once, "Brain" occurs once Class of Doc 1: "Health" Doc 2: "Food" occurs once, "Meat" occurs once, "Kitchen" occurs 9 times, "Job" occurs 5 times. Class of...
Complement naive bayes
Let's make this simple, and do a very contrived two class case: Let's say we have three documents with the following words: Doc 1: "Food" occurs twice, "Meat" occurs once, "Brain" occurs once Class of
Complement naive bayes Let's make this simple, and do a very contrived two class case: Let's say we have three documents with the following words: Doc 1: "Food" occurs twice, "Meat" occurs once, "Brain" occurs once Class of Doc 1: "Health" Doc 2: "Food" occurs once, "Meat" occurs once, "Kitchen" occurs 9 times, "Job" o...
Complement naive bayes Let's make this simple, and do a very contrived two class case: Let's say we have three documents with the following words: Doc 1: "Food" occurs twice, "Meat" occurs once, "Brain" occurs once Class of
53,326
How do we interpret the coefficients of the random effects model?
For the sake of explanation, suppose you have a simple mixed model with a fixed treatment effect and a random subject effect. Suppose further that there are 3 treatment levels A, B, C, and 10 subjects. The mixed model is $$ \mathbf{y = X\boldsymbol \beta + Z \boldsymbol \gamma + \boldsymbol \epsilon} $$ where $X\boldsy...
How do we interpret the coefficients of the random effects model?
For the sake of explanation, suppose you have a simple mixed model with a fixed treatment effect and a random subject effect. Suppose further that there are 3 treatment levels A, B, C, and 10 subjects
How do we interpret the coefficients of the random effects model? For the sake of explanation, suppose you have a simple mixed model with a fixed treatment effect and a random subject effect. Suppose further that there are 3 treatment levels A, B, C, and 10 subjects. The mixed model is $$ \mathbf{y = X\boldsymbol \beta...
How do we interpret the coefficients of the random effects model? For the sake of explanation, suppose you have a simple mixed model with a fixed treatment effect and a random subject effect. Suppose further that there are 3 treatment levels A, B, C, and 10 subjects
53,327
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is nonnegative?
I thank user @guy for pointing out the mistake of my previous attempt. Instead of just deleting it, I will insert in its place a naive way to showcase what the 2nd Borel-Cantelli lemma tells us, using the case that @guy considers, a sequence of independent Bernoullis$(1/k)$. Consider the event $\{\prod_{i=m}^k X_i = 0\...
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is no
I thank user @guy for pointing out the mistake of my previous attempt. Instead of just deleting it, I will insert in its place a naive way to showcase what the 2nd Borel-Cantelli lemma tells us, using
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is nonnegative? I thank user @guy for pointing out the mistake of my previous attempt. Instead of just deleting it, I will insert in its place a naive way to showcase what the 2nd Borel-Cantelli lemma tells us, using the case...
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is no I thank user @guy for pointing out the mistake of my previous attempt. Instead of just deleting it, I will insert in its place a naive way to showcase what the 2nd Borel-Cantelli lemma tells us, using
53,328
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is nonnegative?
Unless I'm making an elementary mistake (entirely possible!), this does not hold, even for discrete random variables with finite support (contrary to another answer). Recall the second Borel-Cantelli Lemma Second Borel Cantelli Lemma: Let $A_1, A_2, \ldots$ be independent events. If $\sum_{i = 1} ^ \infty P(A_i) = \in...
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is no
Unless I'm making an elementary mistake (entirely possible!), this does not hold, even for discrete random variables with finite support (contrary to another answer). Recall the second Borel-Cantelli
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is nonnegative? Unless I'm making an elementary mistake (entirely possible!), this does not hold, even for discrete random variables with finite support (contrary to another answer). Recall the second Borel-Cantelli Lemma Se...
Does convergence in mean imply convergence almost surely if the limit is zero and the sequence is no Unless I'm making an elementary mistake (entirely possible!), this does not hold, even for discrete random variables with finite support (contrary to another answer). Recall the second Borel-Cantelli
53,329
Why does this logistic GAM fit so poorly?
You are ignoring the model intercept when evaluating the model fit. The plot method shows the fitted spline, but the model includes a parametric constant term, just like the intercept in a standard logistic regression model. Instead, predict from the fitted model using the predict() method for locations on a grid of lo...
Why does this logistic GAM fit so poorly?
You are ignoring the model intercept when evaluating the model fit. The plot method shows the fitted spline, but the model includes a parametric constant term, just like the intercept in a standard lo
Why does this logistic GAM fit so poorly? You are ignoring the model intercept when evaluating the model fit. The plot method shows the fitted spline, but the model includes a parametric constant term, just like the intercept in a standard logistic regression model. Instead, predict from the fitted model using the pred...
Why does this logistic GAM fit so poorly? You are ignoring the model intercept when evaluating the model fit. The plot method shows the fitted spline, but the model includes a parametric constant term, just like the intercept in a standard lo
53,330
Is it ok to use a random intercept model without testing for random slopes?
Models with mixed effects have 2 stochastic ingredients: Residual errors Random effects If you use a random slope and notice that the model performs better, it means that there is variability that was not properly captured by the residual errors, the random intercept, and fixed effects. Another direction that you can...
Is it ok to use a random intercept model without testing for random slopes?
Models with mixed effects have 2 stochastic ingredients: Residual errors Random effects If you use a random slope and notice that the model performs better, it means that there is variability that w
Is it ok to use a random intercept model without testing for random slopes? Models with mixed effects have 2 stochastic ingredients: Residual errors Random effects If you use a random slope and notice that the model performs better, it means that there is variability that was not properly captured by the residual err...
Is it ok to use a random intercept model without testing for random slopes? Models with mixed effects have 2 stochastic ingredients: Residual errors Random effects If you use a random slope and notice that the model performs better, it means that there is variability that w
53,331
Is it ok to use a random intercept model without testing for random slopes?
I would echo @East's advocacy for model exploration, but it was already stated very well. Per Barr et all (2013; full citation below), a failure to fit random slopes when present could result in an inflated Type-I error rate (incorrect rejections of the null hypothesis when the null hypothesis actually is true). So, ...
Is it ok to use a random intercept model without testing for random slopes?
I would echo @East's advocacy for model exploration, but it was already stated very well. Per Barr et all (2013; full citation below), a failure to fit random slopes when present could result in an i
Is it ok to use a random intercept model without testing for random slopes? I would echo @East's advocacy for model exploration, but it was already stated very well. Per Barr et all (2013; full citation below), a failure to fit random slopes when present could result in an inflated Type-I error rate (incorrect rejecti...
Is it ok to use a random intercept model without testing for random slopes? I would echo @East's advocacy for model exploration, but it was already stated very well. Per Barr et all (2013; full citation below), a failure to fit random slopes when present could result in an i
53,332
ROC for more than 2 outcome categories
Several ideas and references are discussed in: A simple generalization of the area under the ROC curve to multiple class classification problems. Multi-class ROC (a tutorial) (using "volumes" under ROC) Other approaches include computing macro-average ROC curves (average per class in a 1-vs-all fashion) micro-ave...
ROC for more than 2 outcome categories
Several ideas and references are discussed in: A simple generalization of the area under the ROC curve to multiple class classification problems. Multi-class ROC (a tutorial) (using "volumes" under
ROC for more than 2 outcome categories Several ideas and references are discussed in: A simple generalization of the area under the ROC curve to multiple class classification problems. Multi-class ROC (a tutorial) (using "volumes" under ROC) Other approaches include computing macro-average ROC curves (average per ...
ROC for more than 2 outcome categories Several ideas and references are discussed in: A simple generalization of the area under the ROC curve to multiple class classification problems. Multi-class ROC (a tutorial) (using "volumes" under
53,333
ROC for more than 2 outcome categories
One of the ideas is to use one-vs-all classifier. This answer gives move information about it, including some R code. Here's a plot from that answer
ROC for more than 2 outcome categories
One of the ideas is to use one-vs-all classifier. This answer gives move information about it, including some R code. Here's a plot from that answer
ROC for more than 2 outcome categories One of the ideas is to use one-vs-all classifier. This answer gives move information about it, including some R code. Here's a plot from that answer
ROC for more than 2 outcome categories One of the ideas is to use one-vs-all classifier. This answer gives move information about it, including some R code. Here's a plot from that answer
53,334
What is the p-value for paired t-test if the two set of data are identical?
If the two sets of data are identical because the variables are defined on a discrete set of values, then the assumptions of the t-test are false, since the random variables aren't even continuous. As such, any normal-theory calculation would not yield the correct p-values. I think the "correct" t-test p-value would b...
What is the p-value for paired t-test if the two set of data are identical?
If the two sets of data are identical because the variables are defined on a discrete set of values, then the assumptions of the t-test are false, since the random variables aren't even continuous. As
What is the p-value for paired t-test if the two set of data are identical? If the two sets of data are identical because the variables are defined on a discrete set of values, then the assumptions of the t-test are false, since the random variables aren't even continuous. As such, any normal-theory calculation would n...
What is the p-value for paired t-test if the two set of data are identical? If the two sets of data are identical because the variables are defined on a discrete set of values, then the assumptions of the t-test are false, since the random variables aren't even continuous. As
53,335
What is the p-value for paired t-test if the two set of data are identical?
The null hypothesis for a paired t-test is that the mean difference of your two paired samples is equal to zero. Considering you have identical values for each pair, the difference should always be equal to zero, thus failing to reject the null hypothesis. This would mean p-value = 1 or NaN (0/0), but this doesn't real...
What is the p-value for paired t-test if the two set of data are identical?
The null hypothesis for a paired t-test is that the mean difference of your two paired samples is equal to zero. Considering you have identical values for each pair, the difference should always be eq
What is the p-value for paired t-test if the two set of data are identical? The null hypothesis for a paired t-test is that the mean difference of your two paired samples is equal to zero. Considering you have identical values for each pair, the difference should always be equal to zero, thus failing to reject the null...
What is the p-value for paired t-test if the two set of data are identical? The null hypothesis for a paired t-test is that the mean difference of your two paired samples is equal to zero. Considering you have identical values for each pair, the difference should always be eq
53,336
Conditional variance - $Var(X + U | X) = Var(U)$?
Unless there's something missing, that looks right to me, but if you want to argue it fully you may want to insert a step or two. For example $\text{Var}(X + U | X) = \text{Var}(X|X) + \text{Var}(U|X)$ I think you should explain here that you're using $\text{Cov}(X,U|X)=0$ by expanding the variance into its three com...
Conditional variance - $Var(X + U | X) = Var(U)$?
Unless there's something missing, that looks right to me, but if you want to argue it fully you may want to insert a step or two. For example $\text{Var}(X + U | X) = \text{Var}(X|X) + \text{Var}(U|X
Conditional variance - $Var(X + U | X) = Var(U)$? Unless there's something missing, that looks right to me, but if you want to argue it fully you may want to insert a step or two. For example $\text{Var}(X + U | X) = \text{Var}(X|X) + \text{Var}(U|X)$ I think you should explain here that you're using $\text{Cov}(X,U|...
Conditional variance - $Var(X + U | X) = Var(U)$? Unless there's something missing, that looks right to me, but if you want to argue it fully you may want to insert a step or two. For example $\text{Var}(X + U | X) = \text{Var}(X|X) + \text{Var}(U|X
53,337
Conditional variance - $Var(X + U | X) = Var(U)$?
More remarkably, independence between $X$ and $U$ provides a regular system of conditional distributions of $X+U$ given $X$ by setting $${\cal L}(X+U \mid X=x) = \text{"law of $x+U$"}.$$ Then $Var(X+U \mid X)=Var(U)$ because $Var(x+U)=Var(U)$ for any $x$.
Conditional variance - $Var(X + U | X) = Var(U)$?
More remarkably, independence between $X$ and $U$ provides a regular system of conditional distributions of $X+U$ given $X$ by setting $${\cal L}(X+U \mid X=x) = \text{"law of $x+U$"}.$$ Then $Var(X
Conditional variance - $Var(X + U | X) = Var(U)$? More remarkably, independence between $X$ and $U$ provides a regular system of conditional distributions of $X+U$ given $X$ by setting $${\cal L}(X+U \mid X=x) = \text{"law of $x+U$"}.$$ Then $Var(X+U \mid X)=Var(U)$ because $Var(x+U)=Var(U)$ for any $x$.
Conditional variance - $Var(X + U | X) = Var(U)$? More remarkably, independence between $X$ and $U$ provides a regular system of conditional distributions of $X+U$ given $X$ by setting $${\cal L}(X+U \mid X=x) = \text{"law of $x+U$"}.$$ Then $Var(X
53,338
Conditional variance - $Var(X + U | X) = Var(U)$?
$Var(X+U|X)=Var(U|X)$ sounds absolutely logical: if the value of $X$ is known, then $X$ has conditional variance 0 (it is a certain variable), so the conditional variance of $(X+U)$ will be the conditional variance of $U$. Then, if $X$ and $U$ are independent the conditional variance of $U$ is simply the variance of $U...
Conditional variance - $Var(X + U | X) = Var(U)$?
$Var(X+U|X)=Var(U|X)$ sounds absolutely logical: if the value of $X$ is known, then $X$ has conditional variance 0 (it is a certain variable), so the conditional variance of $(X+U)$ will be the condit
Conditional variance - $Var(X + U | X) = Var(U)$? $Var(X+U|X)=Var(U|X)$ sounds absolutely logical: if the value of $X$ is known, then $X$ has conditional variance 0 (it is a certain variable), so the conditional variance of $(X+U)$ will be the conditional variance of $U$. Then, if $X$ and $U$ are independent the condit...
Conditional variance - $Var(X + U | X) = Var(U)$? $Var(X+U|X)=Var(U|X)$ sounds absolutely logical: if the value of $X$ is known, then $X$ has conditional variance 0 (it is a certain variable), so the conditional variance of $(X+U)$ will be the condit
53,339
Conditional variance - $Var(X + U | X) = Var(U)$?
I hope I'm adding/complementing sth, if not sorry for the excess of answers. $\text{Var}(X+U|X)= E((X+U-E(X+U|X))^2|X)=E((X+U-X-E(U))^2|X)$ $=E((U-E(U))^2|X)=E((U-E(U))^2)$, where the last equality holds because $X$ and $U$ are independent.
Conditional variance - $Var(X + U | X) = Var(U)$?
I hope I'm adding/complementing sth, if not sorry for the excess of answers. $\text{Var}(X+U|X)= E((X+U-E(X+U|X))^2|X)=E((X+U-X-E(U))^2|X)$ $=E((U-E(U))^2|X)=E((U-E(U))^2)$, where the last equality ho
Conditional variance - $Var(X + U | X) = Var(U)$? I hope I'm adding/complementing sth, if not sorry for the excess of answers. $\text{Var}(X+U|X)= E((X+U-E(X+U|X))^2|X)=E((X+U-X-E(U))^2|X)$ $=E((U-E(U))^2|X)=E((U-E(U))^2)$, where the last equality holds because $X$ and $U$ are independent.
Conditional variance - $Var(X + U | X) = Var(U)$? I hope I'm adding/complementing sth, if not sorry for the excess of answers. $\text{Var}(X+U|X)= E((X+U-E(X+U|X))^2|X)=E((X+U-X-E(U))^2|X)$ $=E((U-E(U))^2|X)=E((U-E(U))^2)$, where the last equality ho
53,340
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data?
In real, nonsimulated data, does the true P(Type I error) ever actually equal to $\alpha$? Assumptions don't hold (when do all the assumptions hold?), people choose hypotheses after they've seen the data, choose procedures after checking assumptions, omit outliers, etc etc. Even 'exact' nonparametric procedures rely o...
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data?
In real, nonsimulated data, does the true P(Type I error) ever actually equal to $\alpha$? Assumptions don't hold (when do all the assumptions hold?), people choose hypotheses after they've seen the
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data? In real, nonsimulated data, does the true P(Type I error) ever actually equal to $\alpha$? Assumptions don't hold (when do all the assumptions hold?), people choose hypotheses after they've seen the data, choose procedures after checking ass...
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data? In real, nonsimulated data, does the true P(Type I error) ever actually equal to $\alpha$? Assumptions don't hold (when do all the assumptions hold?), people choose hypotheses after they've seen the
53,341
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data?
The only example I can readily think of is data dredging. For example, the probability of a type I error is much higher than alpha if many tests are run (but this is not corrected for) and only those that are 'significant' are reported. The obvious examples would be multiple comparisons via many $t$-tests without som...
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data?
The only example I can readily think of is data dredging. For example, the probability of a type I error is much higher than alpha if many tests are run (but this is not corrected for) and only those
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data? The only example I can readily think of is data dredging. For example, the probability of a type I error is much higher than alpha if many tests are run (but this is not corrected for) and only those that are 'significant' are reported. The...
Does $\Pr(\text{Type I error})$ ever not equal $\alpha$ with continuous data? The only example I can readily think of is data dredging. For example, the probability of a type I error is much higher than alpha if many tests are run (but this is not corrected for) and only those
53,342
Log-uniform distributions
Your definition of $X$ suggests that $X$ is a continuous random variable, but your question $\Pr[X = x]$ suggests you wish to treat it as a discrete variable. If you were asking for the probability density function of $X$, rather than the probability mass function, then we could proceed naturally using a transformatio...
Log-uniform distributions
Your definition of $X$ suggests that $X$ is a continuous random variable, but your question $\Pr[X = x]$ suggests you wish to treat it as a discrete variable. If you were asking for the probability d
Log-uniform distributions Your definition of $X$ suggests that $X$ is a continuous random variable, but your question $\Pr[X = x]$ suggests you wish to treat it as a discrete variable. If you were asking for the probability density function of $X$, rather than the probability mass function, then we could proceed natur...
Log-uniform distributions Your definition of $X$ suggests that $X$ is a continuous random variable, but your question $\Pr[X = x]$ suggests you wish to treat it as a discrete variable. If you were asking for the probability d
53,343
Log-uniform distributions
I like @heropup's answer, but am slightly bothered by the fact that he didn't finish the derivation for the OP. To enrich his answer, I'd like to add the following picture, and some comments on the above answer: If you follow @heropup's derivation, you'll find that $$f_{X}(x) = \frac{I_{[e, e^e]}(x)}{x(e-1)}$$ More ge...
Log-uniform distributions
I like @heropup's answer, but am slightly bothered by the fact that he didn't finish the derivation for the OP. To enrich his answer, I'd like to add the following picture, and some comments on the ab
Log-uniform distributions I like @heropup's answer, but am slightly bothered by the fact that he didn't finish the derivation for the OP. To enrich his answer, I'd like to add the following picture, and some comments on the above answer: If you follow @heropup's derivation, you'll find that $$f_{X}(x) = \frac{I_{[e, e...
Log-uniform distributions I like @heropup's answer, but am slightly bothered by the fact that he didn't finish the derivation for the OP. To enrich his answer, I'd like to add the following picture, and some comments on the ab
53,344
Doing low-dimensional KNN on a large dataset
A naive nearest neighbor implementation will have to compute the distances between your test example and every instance in the training set. This $O(n)$ process can be problematic if you have a lot of data. One solution is to find a more efficient representation of the training data. "Space-partitioning" data structure...
Doing low-dimensional KNN on a large dataset
A naive nearest neighbor implementation will have to compute the distances between your test example and every instance in the training set. This $O(n)$ process can be problematic if you have a lot of
Doing low-dimensional KNN on a large dataset A naive nearest neighbor implementation will have to compute the distances between your test example and every instance in the training set. This $O(n)$ process can be problematic if you have a lot of data. One solution is to find a more efficient representation of the train...
Doing low-dimensional KNN on a large dataset A naive nearest neighbor implementation will have to compute the distances between your test example and every instance in the training set. This $O(n)$ process can be problematic if you have a lot of
53,345
Doing low-dimensional KNN on a large dataset
Depending on your task and your data, you might not need that many nearest neighbours. Since your data is two dimensional, I would first plot it to explore how it looks. Is it linearly separable?. Otherwise, you could try the following, sample at random a small portion of the data. Say 10%. Classify your data, and kee...
Doing low-dimensional KNN on a large dataset
Depending on your task and your data, you might not need that many nearest neighbours. Since your data is two dimensional, I would first plot it to explore how it looks. Is it linearly separable?. Ot
Doing low-dimensional KNN on a large dataset Depending on your task and your data, you might not need that many nearest neighbours. Since your data is two dimensional, I would first plot it to explore how it looks. Is it linearly separable?. Otherwise, you could try the following, sample at random a small portion of t...
Doing low-dimensional KNN on a large dataset Depending on your task and your data, you might not need that many nearest neighbours. Since your data is two dimensional, I would first plot it to explore how it looks. Is it linearly separable?. Ot
53,346
Gaps in time series and time series validity
I am not sure what you mean by "a valid data set". Are you sure what you mean by it? There are reasons why, in a single or in multiple time series consecutive missingness would be irrelevant to the validity of an analysis, and reasons why it would be lethal to valid inference. However, Honaker and King are at the head ...
Gaps in time series and time series validity
I am not sure what you mean by "a valid data set". Are you sure what you mean by it? There are reasons why, in a single or in multiple time series consecutive missingness would be irrelevant to the va
Gaps in time series and time series validity I am not sure what you mean by "a valid data set". Are you sure what you mean by it? There are reasons why, in a single or in multiple time series consecutive missingness would be irrelevant to the validity of an analysis, and reasons why it would be lethal to valid inferenc...
Gaps in time series and time series validity I am not sure what you mean by "a valid data set". Are you sure what you mean by it? There are reasons why, in a single or in multiple time series consecutive missingness would be irrelevant to the va
53,347
Gaps in time series and time series validity
The Kalman filter is one alternative to fill in missing observations in time series. See this post as an example. The Kalman filter is a common algorithm that will be available in most languages and statistical software. Contrary to the Holt-Winters filter you have to specify a model for the data. "How many consecutiv...
Gaps in time series and time series validity
The Kalman filter is one alternative to fill in missing observations in time series. See this post as an example. The Kalman filter is a common algorithm that will be available in most languages and s
Gaps in time series and time series validity The Kalman filter is one alternative to fill in missing observations in time series. See this post as an example. The Kalman filter is a common algorithm that will be available in most languages and statistical software. Contrary to the Holt-Winters filter you have to specif...
Gaps in time series and time series validity The Kalman filter is one alternative to fill in missing observations in time series. See this post as an example. The Kalman filter is a common algorithm that will be available in most languages and s
53,348
Gaps in time series and time series validity
If you have enough data to do a meaningful test, you could look at a chunk of the data with no missing values. Then remove some values and fill in the missing values with interpolations. Fit the Holt Winters model on the interpolated data, and look at the error of the model on a holdout section of your data to see how ...
Gaps in time series and time series validity
If you have enough data to do a meaningful test, you could look at a chunk of the data with no missing values. Then remove some values and fill in the missing values with interpolations. Fit the Holt
Gaps in time series and time series validity If you have enough data to do a meaningful test, you could look at a chunk of the data with no missing values. Then remove some values and fill in the missing values with interpolations. Fit the Holt Winters model on the interpolated data, and look at the error of the model ...
Gaps in time series and time series validity If you have enough data to do a meaningful test, you could look at a chunk of the data with no missing values. Then remove some values and fill in the missing values with interpolations. Fit the Holt
53,349
Comparing AIC among models with different amounts of data
The magnitude of the AIC value is irrelevant; it will always be larger with more data points. AIC is used to compare models based on the exact same data, where the important statistic the the difference between the AIC values. So, in your case, if you remove c from the model and then test against the exact same data, ...
Comparing AIC among models with different amounts of data
The magnitude of the AIC value is irrelevant; it will always be larger with more data points. AIC is used to compare models based on the exact same data, where the important statistic the the differen
Comparing AIC among models with different amounts of data The magnitude of the AIC value is irrelevant; it will always be larger with more data points. AIC is used to compare models based on the exact same data, where the important statistic the the difference between the AIC values. So, in your case, if you remove c ...
Comparing AIC among models with different amounts of data The magnitude of the AIC value is irrelevant; it will always be larger with more data points. AIC is used to compare models based on the exact same data, where the important statistic the the differen
53,350
Comparing AIC among models with different amounts of data
Adding to @Avraham, take a look at the formula for the AIC, which is an intuitive way to see why more or less data points will change the AIC without meaning the model fits better or worse: $2k-2ln(L)$ k is the number of parameters, ln(L) is the likelihood. The log-likelihood magnitude is based on a summation across al...
Comparing AIC among models with different amounts of data
Adding to @Avraham, take a look at the formula for the AIC, which is an intuitive way to see why more or less data points will change the AIC without meaning the model fits better or worse: $2k-2ln(L)
Comparing AIC among models with different amounts of data Adding to @Avraham, take a look at the formula for the AIC, which is an intuitive way to see why more or less data points will change the AIC without meaning the model fits better or worse: $2k-2ln(L)$ k is the number of parameters, ln(L) is the likelihood. The ...
Comparing AIC among models with different amounts of data Adding to @Avraham, take a look at the formula for the AIC, which is an intuitive way to see why more or less data points will change the AIC without meaning the model fits better or worse: $2k-2ln(L)
53,351
Missing Values NAs in the Test Data When using predict.lm in R
First, let me preface this by stating that missing data is its own specialty in statistics, so there's lots and lots of different answers to this question. As you've discovered, by default, R uses case-wise deletion of missing values. This means that whenever a missing value is encountered in your data (on either side...
Missing Values NAs in the Test Data When using predict.lm in R
First, let me preface this by stating that missing data is its own specialty in statistics, so there's lots and lots of different answers to this question. As you've discovered, by default, R uses cas
Missing Values NAs in the Test Data When using predict.lm in R First, let me preface this by stating that missing data is its own specialty in statistics, so there's lots and lots of different answers to this question. As you've discovered, by default, R uses case-wise deletion of missing values. This means that whenev...
Missing Values NAs in the Test Data When using predict.lm in R First, let me preface this by stating that missing data is its own specialty in statistics, so there's lots and lots of different answers to this question. As you've discovered, by default, R uses cas
53,352
SVM data normalization... what about classifying new (training) data?
Store the mean and standard deviation of the training dataset features. When the test data is received, normalize each feature by subtracting its corresponding training mean and dividing by the corresponding training standard deviation. Normalizition by min/max is usually a very bad idea since it involves scaling your ...
SVM data normalization... what about classifying new (training) data?
Store the mean and standard deviation of the training dataset features. When the test data is received, normalize each feature by subtracting its corresponding training mean and dividing by the corres
SVM data normalization... what about classifying new (training) data? Store the mean and standard deviation of the training dataset features. When the test data is received, normalize each feature by subtracting its corresponding training mean and dividing by the corresponding training standard deviation. Normalizition...
SVM data normalization... what about classifying new (training) data? Store the mean and standard deviation of the training dataset features. When the test data is received, normalize each feature by subtracting its corresponding training mean and dividing by the corres
53,353
Probablistic counterpart for kNN
The way I'd model it (I haven't seen this in the literature, but it wouldn't surprise me if it were already out there) is: I'd think of it as expressing the posterior distribution over class labels, given that you have a (test) sample $x$, as a marginalization over a sub-set of the training sample nodes, $n_i$: $$ p(c...
Probablistic counterpart for kNN
The way I'd model it (I haven't seen this in the literature, but it wouldn't surprise me if it were already out there) is: I'd think of it as expressing the posterior distribution over class labels,
Probablistic counterpart for kNN The way I'd model it (I haven't seen this in the literature, but it wouldn't surprise me if it were already out there) is: I'd think of it as expressing the posterior distribution over class labels, given that you have a (test) sample $x$, as a marginalization over a sub-set of the tra...
Probablistic counterpart for kNN The way I'd model it (I haven't seen this in the literature, but it wouldn't surprise me if it were already out there) is: I'd think of it as expressing the posterior distribution over class labels,
53,354
Probablistic counterpart for kNN
Something very similar is Logistic regression with a Radial Basis Function (sometimes called Gaussian) kernel (http://en.wikipedia.org/wiki/Radial_basis_function_kernel), with all weights constrained to be $1$. A fitted RBF kernel regression will compute weighted distances to various points, compute a Gaussian pseudo-p...
Probablistic counterpart for kNN
Something very similar is Logistic regression with a Radial Basis Function (sometimes called Gaussian) kernel (http://en.wikipedia.org/wiki/Radial_basis_function_kernel), with all weights constrained
Probablistic counterpart for kNN Something very similar is Logistic regression with a Radial Basis Function (sometimes called Gaussian) kernel (http://en.wikipedia.org/wiki/Radial_basis_function_kernel), with all weights constrained to be $1$. A fitted RBF kernel regression will compute weighted distances to various po...
Probablistic counterpart for kNN Something very similar is Logistic regression with a Radial Basis Function (sometimes called Gaussian) kernel (http://en.wikipedia.org/wiki/Radial_basis_function_kernel), with all weights constrained
53,355
Probablistic counterpart for kNN
This paper formulates explicitly a probabilistic version of KNN: C.C. Holmes, N.M. Adams: A probabilistic nearest neighbour method for statistical pattern recognition. J. Roy. Statist. Soc. Ser. B, 64 (2) (2002), pp. 295–306. Dave's idea also comes up in this paper: A. Kaban. A probabilistic neighborhood translation ap...
Probablistic counterpart for kNN
This paper formulates explicitly a probabilistic version of KNN: C.C. Holmes, N.M. Adams: A probabilistic nearest neighbour method for statistical pattern recognition. J. Roy. Statist. Soc. Ser. B, 64
Probablistic counterpart for kNN This paper formulates explicitly a probabilistic version of KNN: C.C. Holmes, N.M. Adams: A probabilistic nearest neighbour method for statistical pattern recognition. J. Roy. Statist. Soc. Ser. B, 64 (2) (2002), pp. 295–306. Dave's idea also comes up in this paper: A. Kaban. A probabil...
Probablistic counterpart for kNN This paper formulates explicitly a probabilistic version of KNN: C.C. Holmes, N.M. Adams: A probabilistic nearest neighbour method for statistical pattern recognition. J. Roy. Statist. Soc. Ser. B, 64
53,356
Probablistic counterpart for kNN
Gaussian mixture model is rather a generalization of $k$-means where variances are not identity matrices. One way to construct a probabilistic model which will be a generalization of kNN is to assume there is a gaussian centered at each data point with unknown variances whose distribution is fixed.
Probablistic counterpart for kNN
Gaussian mixture model is rather a generalization of $k$-means where variances are not identity matrices. One way to construct a probabilistic model which will be a generalization of kNN is to assume
Probablistic counterpart for kNN Gaussian mixture model is rather a generalization of $k$-means where variances are not identity matrices. One way to construct a probabilistic model which will be a generalization of kNN is to assume there is a gaussian centered at each data point with unknown variances whose distribut...
Probablistic counterpart for kNN Gaussian mixture model is rather a generalization of $k$-means where variances are not identity matrices. One way to construct a probabilistic model which will be a generalization of kNN is to assume
53,357
Why does one report statistical power only when results are non significant?
If the result is not statistically significant, there are two possibilities. One is that the null hypothesis is true. The other is that the null hypothesis is false (so there really is a difference between the populations) but some combination of small sample size, large scatter and bad luck led your experiment to a co...
Why does one report statistical power only when results are non significant?
If the result is not statistically significant, there are two possibilities. One is that the null hypothesis is true. The other is that the null hypothesis is false (so there really is a difference be
Why does one report statistical power only when results are non significant? If the result is not statistically significant, there are two possibilities. One is that the null hypothesis is true. The other is that the null hypothesis is false (so there really is a difference between the populations) but some combination...
Why does one report statistical power only when results are non significant? If the result is not statistically significant, there are two possibilities. One is that the null hypothesis is true. The other is that the null hypothesis is false (so there really is a difference be
53,358
Does K-means incorporate the K-nearest neighbour algorithm?
No, definitely not; kmeans and kNN are two completely different things, and kmeans doesn't use kNN at all. In step 2 of the kmeans algorithm as you have defined it (and BTW, except for this minor confusion, your summary is otherwise basically accurate), the kmeans function loops through each of the $n$ data points, an...
Does K-means incorporate the K-nearest neighbour algorithm?
No, definitely not; kmeans and kNN are two completely different things, and kmeans doesn't use kNN at all. In step 2 of the kmeans algorithm as you have defined it (and BTW, except for this minor con
Does K-means incorporate the K-nearest neighbour algorithm? No, definitely not; kmeans and kNN are two completely different things, and kmeans doesn't use kNN at all. In step 2 of the kmeans algorithm as you have defined it (and BTW, except for this minor confusion, your summary is otherwise basically accurate), the k...
Does K-means incorporate the K-nearest neighbour algorithm? No, definitely not; kmeans and kNN are two completely different things, and kmeans doesn't use kNN at all. In step 2 of the kmeans algorithm as you have defined it (and BTW, except for this minor con
53,359
Does K-means incorporate the K-nearest neighbour algorithm?
You're sort of right. Both kNN and k-means commonly use Euclidean distance for their respective distance metrics, which is why they seem similar. Keep in mind, however, that k-means is not a classification model, as that is a supervised learning algorithm (since the grouping variable is known). K-means and other cluste...
Does K-means incorporate the K-nearest neighbour algorithm?
You're sort of right. Both kNN and k-means commonly use Euclidean distance for their respective distance metrics, which is why they seem similar. Keep in mind, however, that k-means is not a classific
Does K-means incorporate the K-nearest neighbour algorithm? You're sort of right. Both kNN and k-means commonly use Euclidean distance for their respective distance metrics, which is why they seem similar. Keep in mind, however, that k-means is not a classification model, as that is a supervised learning algorithm (sin...
Does K-means incorporate the K-nearest neighbour algorithm? You're sort of right. Both kNN and k-means commonly use Euclidean distance for their respective distance metrics, which is why they seem similar. Keep in mind, however, that k-means is not a classific
53,360
shuffle my data to investigate differences between 3 groups
If there is really no difference between the 3 regions, then I can assume that any test (eg ANOVA or a non-parametric equivalent) will find approximate the same results even if I randomly mix all data once and again. This is the central insight that underlies resampling methods, such as permutation tests / randomizati...
shuffle my data to investigate differences between 3 groups
If there is really no difference between the 3 regions, then I can assume that any test (eg ANOVA or a non-parametric equivalent) will find approximate the same results even if I randomly mix all data
shuffle my data to investigate differences between 3 groups If there is really no difference between the 3 regions, then I can assume that any test (eg ANOVA or a non-parametric equivalent) will find approximate the same results even if I randomly mix all data once and again. This is the central insight that underlies...
shuffle my data to investigate differences between 3 groups If there is really no difference between the 3 regions, then I can assume that any test (eg ANOVA or a non-parametric equivalent) will find approximate the same results even if I randomly mix all data
53,361
Getting a second-order polynomial trend line from a set of data
As a programmer, you will find an algorithm to be even better than a formula, especially if the algorithm is based on simple steps. There is one, "sequential matching," that requires no matrix algebra and no specialized mathematical procedures (like Cholesky decomposition, QR decomposition, or matrix pseudo-inversion)...
Getting a second-order polynomial trend line from a set of data
As a programmer, you will find an algorithm to be even better than a formula, especially if the algorithm is based on simple steps. There is one, "sequential matching," that requires no matrix algebr
Getting a second-order polynomial trend line from a set of data As a programmer, you will find an algorithm to be even better than a formula, especially if the algorithm is based on simple steps. There is one, "sequential matching," that requires no matrix algebra and no specialized mathematical procedures (like Chole...
Getting a second-order polynomial trend line from a set of data As a programmer, you will find an algorithm to be even better than a formula, especially if the algorithm is based on simple steps. There is one, "sequential matching," that requires no matrix algebr
53,362
Getting a second-order polynomial trend line from a set of data
Your model will be: $$y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2$$ Where $\beta_0$, $\beta_1$ and $\beta_2$ are parameters to be estimated from the data. Standard practice is to find values of these parameters such that the sum of squares: $$ \sum_{i=1}^{n}\left[ y_i - (\beta_0 + \beta_1 x_i + \beta_2x_i^2) \right]^2$...
Getting a second-order polynomial trend line from a set of data
Your model will be: $$y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2$$ Where $\beta_0$, $\beta_1$ and $\beta_2$ are parameters to be estimated from the data. Standard practice is to find values of these
Getting a second-order polynomial trend line from a set of data Your model will be: $$y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2$$ Where $\beta_0$, $\beta_1$ and $\beta_2$ are parameters to be estimated from the data. Standard practice is to find values of these parameters such that the sum of squares: $$ \sum_{i=1}^{...
Getting a second-order polynomial trend line from a set of data Your model will be: $$y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2$$ Where $\beta_0$, $\beta_1$ and $\beta_2$ are parameters to be estimated from the data. Standard practice is to find values of these
53,363
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data?
Use logistic regression with a Gaussian link. The count of simultaneous responses for a given value of $x$, written $y(x)$, is the outcome of $n=100$ independent Bernoulli trials whose chance of success is given by the Gaussian function. Letting $\theta$ stand for the three parameters (unknown, to be estimated), let'...
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data?
Use logistic regression with a Gaussian link. The count of simultaneous responses for a given value of $x$, written $y(x)$, is the outcome of $n=100$ independent Bernoulli trials whose chance of succ
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data? Use logistic regression with a Gaussian link. The count of simultaneous responses for a given value of $x$, written $y(x)$, is the outcome of $n=100$ independent Bernoulli trials whose chance of success is given by the G...
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data? Use logistic regression with a Gaussian link. The count of simultaneous responses for a given value of $x$, written $y(x)$, is the outcome of $n=100$ independent Bernoulli trials whose chance of succ
53,364
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data?
One answer to your question is that least squares is a standard way to fit Gaussians to "some x and y data". However, your data are special in that they are fractions (probabilities) that must lie in [0,1]. What you are doing is fitting a curve which is for probability densities, so it is unaware of the upper limit. T...
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data?
One answer to your question is that least squares is a standard way to fit Gaussians to "some x and y data". However, your data are special in that they are fractions (probabilities) that must lie in
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data? One answer to your question is that least squares is a standard way to fit Gaussians to "some x and y data". However, your data are special in that they are fractions (probabilities) that must lie in [0,1]. What you are ...
Is least squares the standard method to fit a 3 parameters Gaussian function to some x and y data? One answer to your question is that least squares is a standard way to fit Gaussians to "some x and y data". However, your data are special in that they are fractions (probabilities) that must lie in
53,365
Lasso cross validation
Basically you select whichever $\alpha$ gives you the lowest error rate (on a validation set). So to be complete cross-validation entails the following steps: Split your data in three parts: training, validation and test. Train a model with a given $\alpha$ on the train-set and test it on the validation-set and repe...
Lasso cross validation
Basically you select whichever $\alpha$ gives you the lowest error rate (on a validation set). So to be complete cross-validation entails the following steps: Split your data in three parts: trainin
Lasso cross validation Basically you select whichever $\alpha$ gives you the lowest error rate (on a validation set). So to be complete cross-validation entails the following steps: Split your data in three parts: training, validation and test. Train a model with a given $\alpha$ on the train-set and test it on the ...
Lasso cross validation Basically you select whichever $\alpha$ gives you the lowest error rate (on a validation set). So to be complete cross-validation entails the following steps: Split your data in three parts: trainin
53,366
Lasso cross validation
Before going that far, run 5 bootstrap replications of the lasso procedure to make sure the features selected are stable. Otherwise your final interpretation of the lasso result will be suspect.
Lasso cross validation
Before going that far, run 5 bootstrap replications of the lasso procedure to make sure the features selected are stable. Otherwise your final interpretation of the lasso result will be suspect.
Lasso cross validation Before going that far, run 5 bootstrap replications of the lasso procedure to make sure the features selected are stable. Otherwise your final interpretation of the lasso result will be suspect.
Lasso cross validation Before going that far, run 5 bootstrap replications of the lasso procedure to make sure the features selected are stable. Otherwise your final interpretation of the lasso result will be suspect.
53,367
Simple question about variance
In the details of ?var we find: The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. so you should have $2/2=1$ instead. See here for some more details.
Simple question about variance
In the details of ?var we find: The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. so you should have $2/2=1$ instead. See here for some m
Simple question about variance In the details of ?var we find: The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. so you should have $2/2=1$ instead. See here for some more details.
Simple question about variance In the details of ?var we find: The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. so you should have $2/2=1$ instead. See here for some m
53,368
Choice of distance metric when data is combination text/numeric/categorical
You are referring to a very hard problem of finding the best possible metric. It is a hard problem even for the unimodal data, the multimodal case you are referring to is a great challenge. There are basically three possibilities: use some primitive metric, like Euclidean distance, treating everything as numbers (you ...
Choice of distance metric when data is combination text/numeric/categorical
You are referring to a very hard problem of finding the best possible metric. It is a hard problem even for the unimodal data, the multimodal case you are referring to is a great challenge. There are
Choice of distance metric when data is combination text/numeric/categorical You are referring to a very hard problem of finding the best possible metric. It is a hard problem even for the unimodal data, the multimodal case you are referring to is a great challenge. There are basically three possibilities: use some pri...
Choice of distance metric when data is combination text/numeric/categorical You are referring to a very hard problem of finding the best possible metric. It is a hard problem even for the unimodal data, the multimodal case you are referring to is a great challenge. There are
53,369
Choice of distance metric when data is combination text/numeric/categorical
First of all, you must realize that there isn't the single one "correct" distance for your data. Given two coordinates, Euclidean distance is appropriate when looking at a short distance without restrictions on travel. Manhattan distance is usually more appropriate when you are in a city with a grid layout. However, fo...
Choice of distance metric when data is combination text/numeric/categorical
First of all, you must realize that there isn't the single one "correct" distance for your data. Given two coordinates, Euclidean distance is appropriate when looking at a short distance without restr
Choice of distance metric when data is combination text/numeric/categorical First of all, you must realize that there isn't the single one "correct" distance for your data. Given two coordinates, Euclidean distance is appropriate when looking at a short distance without restrictions on travel. Manhattan distance is usu...
Choice of distance metric when data is combination text/numeric/categorical First of all, you must realize that there isn't the single one "correct" distance for your data. Given two coordinates, Euclidean distance is appropriate when looking at a short distance without restr
53,370
Logistic regression diagnostics when predictors all have skewed distributions
The distribution of the predictors is almost irrelevant in regression, as you are conditioning on their values. Changing to factors is not needed unless there are very few unique values and some of them are not well populated. But with very skewed predictors the model may fit better upon a transformation. I tend to u...
Logistic regression diagnostics when predictors all have skewed distributions
The distribution of the predictors is almost irrelevant in regression, as you are conditioning on their values. Changing to factors is not needed unless there are very few unique values and some of t
Logistic regression diagnostics when predictors all have skewed distributions The distribution of the predictors is almost irrelevant in regression, as you are conditioning on their values. Changing to factors is not needed unless there are very few unique values and some of them are not well populated. But with very ...
Logistic regression diagnostics when predictors all have skewed distributions The distribution of the predictors is almost irrelevant in regression, as you are conditioning on their values. Changing to factors is not needed unless there are very few unique values and some of t
53,371
Cronbach's alpha negative result
Two main causes: Small sample size. Even if the assumptions are met and the reliability is decent, an estimate computed from a particular sample can be negative, just as a sample mean is not equal to the population mean. Somewhat surprisingly, whereas experimental psychologists tend to be obsessed with statistical tes...
Cronbach's alpha negative result
Two main causes: Small sample size. Even if the assumptions are met and the reliability is decent, an estimate computed from a particular sample can be negative, just as a sample mean is not equal to
Cronbach's alpha negative result Two main causes: Small sample size. Even if the assumptions are met and the reliability is decent, an estimate computed from a particular sample can be negative, just as a sample mean is not equal to the population mean. Somewhat surprisingly, whereas experimental psychologists tend to...
Cronbach's alpha negative result Two main causes: Small sample size. Even if the assumptions are met and the reliability is decent, an estimate computed from a particular sample can be negative, just as a sample mean is not equal to
53,372
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)?
Boltzmann machines are graphical models, but they are not Bayesian networks. They're a kind of Markov random field, which has undirected connections between the variables, while Bayesian networks have directed connections. The difference between the two kinds of connections can be subtle, but the main advantage of und...
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)?
Boltzmann machines are graphical models, but they are not Bayesian networks. They're a kind of Markov random field, which has undirected connections between the variables, while Bayesian networks hav
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)? Boltzmann machines are graphical models, but they are not Bayesian networks. They're a kind of Markov random field, which has undirected connections between the variables, while Bayesian networks have directed connections. The difference...
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)? Boltzmann machines are graphical models, but they are not Bayesian networks. They're a kind of Markov random field, which has undirected connections between the variables, while Bayesian networks hav
53,373
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)?
An RBM is an undirected graphical mode, see e.g. Wikipedia or this paper.
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)?
An RBM is an undirected graphical mode, see e.g. Wikipedia or this paper.
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)? An RBM is an undirected graphical mode, see e.g. Wikipedia or this paper.
Is the restricted Boltzmann machine a type of graphical model (Bayesian network)? An RBM is an undirected graphical mode, see e.g. Wikipedia or this paper.
53,374
How to compare percentages for two categories from one sample?
Are you interested in being able to say that one of the percentages is greater than the other? In the cases you want to do it, do they always add to 100%? In that case, it's easy - you compare one of the percentages to 50%; if it's bigger than 50% the complementary one is smaller than 50%. If you want to compare two pr...
How to compare percentages for two categories from one sample?
Are you interested in being able to say that one of the percentages is greater than the other? In the cases you want to do it, do they always add to 100%? In that case, it's easy - you compare one of
How to compare percentages for two categories from one sample? Are you interested in being able to say that one of the percentages is greater than the other? In the cases you want to do it, do they always add to 100%? In that case, it's easy - you compare one of the percentages to 50%; if it's bigger than 50% the compl...
How to compare percentages for two categories from one sample? Are you interested in being able to say that one of the percentages is greater than the other? In the cases you want to do it, do they always add to 100%? In that case, it's easy - you compare one of
53,375
How to compare percentages for two categories from one sample?
The "statistical test" your teacher is referring to would be a binomial test. It is an exact test, meaning that it yields the exact probability (p value) of your observed proportion (or a more extreme one) occurring under the null hypothesis. In this case, your null hypothesis appears to be that the proportion of peopl...
How to compare percentages for two categories from one sample?
The "statistical test" your teacher is referring to would be a binomial test. It is an exact test, meaning that it yields the exact probability (p value) of your observed proportion (or a more extreme
How to compare percentages for two categories from one sample? The "statistical test" your teacher is referring to would be a binomial test. It is an exact test, meaning that it yields the exact probability (p value) of your observed proportion (or a more extreme one) occurring under the null hypothesis. In this case, ...
How to compare percentages for two categories from one sample? The "statistical test" your teacher is referring to would be a binomial test. It is an exact test, meaning that it yields the exact probability (p value) of your observed proportion (or a more extreme
53,376
curse of dimensionality & nonparametric techniques
Imagine that effects aren't additive. Imagine we only have to worry about two values of each predictor, $x_i =$ Low and $x_i =$ High. Then there'd be $2^p$ values our function would need to provide estimates for. In practice, there are more than two values in each dimension to worry about. http://en.wikipedia.org/wiki/...
curse of dimensionality & nonparametric techniques
Imagine that effects aren't additive. Imagine we only have to worry about two values of each predictor, $x_i =$ Low and $x_i =$ High. Then there'd be $2^p$ values our function would need to provide es
curse of dimensionality & nonparametric techniques Imagine that effects aren't additive. Imagine we only have to worry about two values of each predictor, $x_i =$ Low and $x_i =$ High. Then there'd be $2^p$ values our function would need to provide estimates for. In practice, there are more than two values in each dime...
curse of dimensionality & nonparametric techniques Imagine that effects aren't additive. Imagine we only have to worry about two values of each predictor, $x_i =$ Low and $x_i =$ High. Then there'd be $2^p$ values our function would need to provide es
53,377
curse of dimensionality & nonparametric techniques
Further to Glen's answer, I think it is nice to think of the problem in terms of the volume/concentration of high dimensional space. Directly from the wikipedia article: There is an exponential increase in volume associated with adding extra dimensions to a mathematical space. For example, $10^2$=100 evenly-spaced sam...
curse of dimensionality & nonparametric techniques
Further to Glen's answer, I think it is nice to think of the problem in terms of the volume/concentration of high dimensional space. Directly from the wikipedia article: There is an exponential incre
curse of dimensionality & nonparametric techniques Further to Glen's answer, I think it is nice to think of the problem in terms of the volume/concentration of high dimensional space. Directly from the wikipedia article: There is an exponential increase in volume associated with adding extra dimensions to a mathematic...
curse of dimensionality & nonparametric techniques Further to Glen's answer, I think it is nice to think of the problem in terms of the volume/concentration of high dimensional space. Directly from the wikipedia article: There is an exponential incre
53,378
Summary of residuals in R
The 5 number summary of the residuals that you see are the values that would be used to construct a boxplot. The residuals are not necessarily errors of the estimate, although you could think of them that way; it depends on what you are trying to estimate / predict. The value people typically use as a 'prediction' ...
Summary of residuals in R
The 5 number summary of the residuals that you see are the values that would be used to construct a boxplot. The residuals are not necessarily errors of the estimate, although you could think of them
Summary of residuals in R The 5 number summary of the residuals that you see are the values that would be used to construct a boxplot. The residuals are not necessarily errors of the estimate, although you could think of them that way; it depends on what you are trying to estimate / predict. The value people typica...
Summary of residuals in R The 5 number summary of the residuals that you see are the values that would be used to construct a boxplot. The residuals are not necessarily errors of the estimate, although you could think of them
53,379
Summary of residuals in R
Those numbers are deviance residuals. $$r_{d_i} = \operatorname{sign}(y_i -\hat{\mu_i}) \sqrt{d_i}$$ where $d_i$ is the individual observations contribution to the deviance. They are NOT like residuals in ordinary regression, which would be $y_i -\hat{\mu_i}$ Conceptually, Pearson residuals are more like a notion ...
Summary of residuals in R
Those numbers are deviance residuals. $$r_{d_i} = \operatorname{sign}(y_i -\hat{\mu_i}) \sqrt{d_i}$$ where $d_i$ is the individual observations contribution to the deviance. They are NOT like res
Summary of residuals in R Those numbers are deviance residuals. $$r_{d_i} = \operatorname{sign}(y_i -\hat{\mu_i}) \sqrt{d_i}$$ where $d_i$ is the individual observations contribution to the deviance. They are NOT like residuals in ordinary regression, which would be $y_i -\hat{\mu_i}$ Conceptually, Pearson residua...
Summary of residuals in R Those numbers are deviance residuals. $$r_{d_i} = \operatorname{sign}(y_i -\hat{\mu_i}) \sqrt{d_i}$$ where $d_i$ is the individual observations contribution to the deviance. They are NOT like res
53,380
How to get the expected counts when computing a chi-squared test?
Using a spreadsheet for a quick-and-dirty check of goodness of fit to a distribution is not a bad idea, especially if somebody has handed you a batch of data in a spreadsheet or you are doing other spreadsheet analyses with these data (or if you want to check up on other software to confirm its accuracy or your underst...
How to get the expected counts when computing a chi-squared test?
Using a spreadsheet for a quick-and-dirty check of goodness of fit to a distribution is not a bad idea, especially if somebody has handed you a batch of data in a spreadsheet or you are doing other sp
How to get the expected counts when computing a chi-squared test? Using a spreadsheet for a quick-and-dirty check of goodness of fit to a distribution is not a bad idea, especially if somebody has handed you a batch of data in a spreadsheet or you are doing other spreadsheet analyses with these data (or if you want to ...
How to get the expected counts when computing a chi-squared test? Using a spreadsheet for a quick-and-dirty check of goodness of fit to a distribution is not a bad idea, especially if somebody has handed you a batch of data in a spreadsheet or you are doing other sp
53,381
How to get the expected counts when computing a chi-squared test?
1) No test will prove your data is normally distributed. In fact I bet that it isn't. (Why would any distribution be exactly normal? Can you name anything that actually is?) 2) When considering the distributional form, usually, hypothesis tests answer the wrong question. What's a good reason to use a hypothesis test f...
How to get the expected counts when computing a chi-squared test?
1) No test will prove your data is normally distributed. In fact I bet that it isn't. (Why would any distribution be exactly normal? Can you name anything that actually is?) 2) When considering the d
How to get the expected counts when computing a chi-squared test? 1) No test will prove your data is normally distributed. In fact I bet that it isn't. (Why would any distribution be exactly normal? Can you name anything that actually is?) 2) When considering the distributional form, usually, hypothesis tests answer t...
How to get the expected counts when computing a chi-squared test? 1) No test will prove your data is normally distributed. In fact I bet that it isn't. (Why would any distribution be exactly normal? Can you name anything that actually is?) 2) When considering the d
53,382
Changing sign estimate manually
You can also make every coefficient your birthdate if you like, but you can't really call the result something based in statistics, and it's certainly not OLS. You also can't test it. Making the coefficient the negative of the LS estimate is not remotely justified by the issues you bring up. 1) First let's deal with k...
Changing sign estimate manually
You can also make every coefficient your birthdate if you like, but you can't really call the result something based in statistics, and it's certainly not OLS. You also can't test it. Making the coef
Changing sign estimate manually You can also make every coefficient your birthdate if you like, but you can't really call the result something based in statistics, and it's certainly not OLS. You also can't test it. Making the coefficient the negative of the LS estimate is not remotely justified by the issues you brin...
Changing sign estimate manually You can also make every coefficient your birthdate if you like, but you can't really call the result something based in statistics, and it's certainly not OLS. You also can't test it. Making the coef
53,383
Changing sign estimate manually
Adding to @glen_b 's excellent answer, the only remotely justifiable reason I could see for doing what you are doing is if you knew, somehow, that X1 was perfectly negatively correlated to X. One way this might happen is if X is a difference between two values and X1 is the reverse difference. Even if this were the cas...
Changing sign estimate manually
Adding to @glen_b 's excellent answer, the only remotely justifiable reason I could see for doing what you are doing is if you knew, somehow, that X1 was perfectly negatively correlated to X. One way
Changing sign estimate manually Adding to @glen_b 's excellent answer, the only remotely justifiable reason I could see for doing what you are doing is if you knew, somehow, that X1 was perfectly negatively correlated to X. One way this might happen is if X is a difference between two values and X1 is the reverse diffe...
Changing sign estimate manually Adding to @glen_b 's excellent answer, the only remotely justifiable reason I could see for doing what you are doing is if you knew, somehow, that X1 was perfectly negatively correlated to X. One way
53,384
Where can I learn about transforming uniform, random distribution into other distribution
A good way to get a random direction on a 2-sphere might be to choose $z$ uniform in $[-1,1]$, and $\theta$ uniform in $[0,2\pi]$. Then take the point $$ (\sqrt{1-z^2} \cos \theta, \sqrt{1-z^2} \sin \theta, z).$$ I won't do the math to show why these give points uniformly on a sphere. It's not hard. For large dimension...
Where can I learn about transforming uniform, random distribution into other distribution
A good way to get a random direction on a 2-sphere might be to choose $z$ uniform in $[-1,1]$, and $\theta$ uniform in $[0,2\pi]$. Then take the point $$ (\sqrt{1-z^2} \cos \theta, \sqrt{1-z^2} \sin \
Where can I learn about transforming uniform, random distribution into other distribution A good way to get a random direction on a 2-sphere might be to choose $z$ uniform in $[-1,1]$, and $\theta$ uniform in $[0,2\pi]$. Then take the point $$ (\sqrt{1-z^2} \cos \theta, \sqrt{1-z^2} \sin \theta, z).$$ I won't do the ma...
Where can I learn about transforming uniform, random distribution into other distribution A good way to get a random direction on a 2-sphere might be to choose $z$ uniform in $[-1,1]$, and $\theta$ uniform in $[0,2\pi]$. Then take the point $$ (\sqrt{1-z^2} \cos \theta, \sqrt{1-z^2} \sin \
53,385
Where can I learn about transforming uniform, random distribution into other distribution
If you choose 3 independent random numbers between -1 and 1, you are basically choosing a point inside a cube. From that image, you can easily see that, after normalization, the likelihood of your vector pointing along the cube main diagonal is $\sqrt{3}$ larger than that of it pointing along the $x$ axis, simply becau...
Where can I learn about transforming uniform, random distribution into other distribution
If you choose 3 independent random numbers between -1 and 1, you are basically choosing a point inside a cube. From that image, you can easily see that, after normalization, the likelihood of your vec
Where can I learn about transforming uniform, random distribution into other distribution If you choose 3 independent random numbers between -1 and 1, you are basically choosing a point inside a cube. From that image, you can easily see that, after normalization, the likelihood of your vector pointing along the cube ma...
Where can I learn about transforming uniform, random distribution into other distribution If you choose 3 independent random numbers between -1 and 1, you are basically choosing a point inside a cube. From that image, you can easily see that, after normalization, the likelihood of your vec
53,386
Best predictive Cox regression model using c-index and cross-validation
There are a number of serious problems with your approach. You used univariable screening which is known to have a number of problems You took the variables that passed the screen and fitted a model, then used cross-validation (CV) to validate the model without informing CV of the univariable screening step. This cre...
Best predictive Cox regression model using c-index and cross-validation
There are a number of serious problems with your approach. You used univariable screening which is known to have a number of problems You took the variables that passed the screen and fitted a model,
Best predictive Cox regression model using c-index and cross-validation There are a number of serious problems with your approach. You used univariable screening which is known to have a number of problems You took the variables that passed the screen and fitted a model, then used cross-validation (CV) to validate the...
Best predictive Cox regression model using c-index and cross-validation There are a number of serious problems with your approach. You used univariable screening which is known to have a number of problems You took the variables that passed the screen and fitted a model,
53,387
How to convert to gaussian distribution with given mean and standard deviation
Dimitriy’s answer is ok if the grades are Gaussian already. In the general case, just perform quantile renormalization : modify your grades to map their quantiles on the Gaussian quantiles. The following R code generates normal grades. Pay attention to the use of rank to deal with ties. # generate uniform grades grades...
How to convert to gaussian distribution with given mean and standard deviation
Dimitriy’s answer is ok if the grades are Gaussian already. In the general case, just perform quantile renormalization : modify your grades to map their quantiles on the Gaussian quantiles. The follow
How to convert to gaussian distribution with given mean and standard deviation Dimitriy’s answer is ok if the grades are Gaussian already. In the general case, just perform quantile renormalization : modify your grades to map their quantiles on the Gaussian quantiles. The following R code generates normal grades. Pay a...
How to convert to gaussian distribution with given mean and standard deviation Dimitriy’s answer is ok if the grades are Gaussian already. In the general case, just perform quantile renormalization : modify your grades to map their quantiles on the Gaussian quantiles. The follow
53,388
How to convert to gaussian distribution with given mean and standard deviation
Standardize the original score by subtracting the sample mean and dividing by the standard deviation. Call that the $z$-score. It will have a mean of zero and standard deviation of one. Then create a rescaled score by multiplying the $z$-score by 12 and adding 81.
How to convert to gaussian distribution with given mean and standard deviation
Standardize the original score by subtracting the sample mean and dividing by the standard deviation. Call that the $z$-score. It will have a mean of zero and standard deviation of one. Then create a
How to convert to gaussian distribution with given mean and standard deviation Standardize the original score by subtracting the sample mean and dividing by the standard deviation. Call that the $z$-score. It will have a mean of zero and standard deviation of one. Then create a rescaled score by multiplying the $z$-sco...
How to convert to gaussian distribution with given mean and standard deviation Standardize the original score by subtracting the sample mean and dividing by the standard deviation. Call that the $z$-score. It will have a mean of zero and standard deviation of one. Then create a
53,389
How to convert to gaussian distribution with given mean and standard deviation
In fact, you need to use a copula-like transformation. You can use the empirical cdf of the data to transform them into uniformly distributed data and use the inverse CDF of Gaussian to transform them into Gaussian distributed data.
How to convert to gaussian distribution with given mean and standard deviation
In fact, you need to use a copula-like transformation. You can use the empirical cdf of the data to transform them into uniformly distributed data and use the inverse CDF of Gaussian to transform them
How to convert to gaussian distribution with given mean and standard deviation In fact, you need to use a copula-like transformation. You can use the empirical cdf of the data to transform them into uniformly distributed data and use the inverse CDF of Gaussian to transform them into Gaussian distributed data.
How to convert to gaussian distribution with given mean and standard deviation In fact, you need to use a copula-like transformation. You can use the empirical cdf of the data to transform them into uniformly distributed data and use the inverse CDF of Gaussian to transform them
53,390
How to convert to gaussian distribution with given mean and standard deviation
As you see there are many ways to get this! :) Here's my two cents in this: Box-Cox transform [1,2] your data first so you set the higher order moments (skewness and kurtosis) to the desire values (0 and 3 for the case of a Gaussian). That can be easily done by trying different parameters for the power transformation a...
How to convert to gaussian distribution with given mean and standard deviation
As you see there are many ways to get this! :) Here's my two cents in this: Box-Cox transform [1,2] your data first so you set the higher order moments (skewness and kurtosis) to the desire values (0
How to convert to gaussian distribution with given mean and standard deviation As you see there are many ways to get this! :) Here's my two cents in this: Box-Cox transform [1,2] your data first so you set the higher order moments (skewness and kurtosis) to the desire values (0 and 3 for the case of a Gaussian). That c...
How to convert to gaussian distribution with given mean and standard deviation As you see there are many ways to get this! :) Here's my two cents in this: Box-Cox transform [1,2] your data first so you set the higher order moments (skewness and kurtosis) to the desire values (0
53,391
Compute gaussian fit corresponding to a discrete variable
A "Gaussian fit" to a discrete probability distribution makes little or no sense in statistical applications, but mathematically almost a perfect fit can be made to these ordered pairs. Just find values $m$ and $s$ for which the cumulative Gaussian $$\Phi(x;m,s)=\frac{1}{\sqrt{2 \pi s^2}}\int_{-\infty}^x \exp(-(t-m)^2...
Compute gaussian fit corresponding to a discrete variable
A "Gaussian fit" to a discrete probability distribution makes little or no sense in statistical applications, but mathematically almost a perfect fit can be made to these ordered pairs. Just find val
Compute gaussian fit corresponding to a discrete variable A "Gaussian fit" to a discrete probability distribution makes little or no sense in statistical applications, but mathematically almost a perfect fit can be made to these ordered pairs. Just find values $m$ and $s$ for which the cumulative Gaussian $$\Phi(x;m,s...
Compute gaussian fit corresponding to a discrete variable A "Gaussian fit" to a discrete probability distribution makes little or no sense in statistical applications, but mathematically almost a perfect fit can be made to these ordered pairs. Just find val
53,392
Adaptive regression splines in earth package R
Yes, there could be several ways. First notice that the model selected is the one with minimal GCV of those fitted. Hence the algorithm has pruned out additional terms as they contribute little to the fit yet add complexity to the model. The issue here is one of parsimony and trying to avoid overfitting. As the model i...
Adaptive regression splines in earth package R
Yes, there could be several ways. First notice that the model selected is the one with minimal GCV of those fitted. Hence the algorithm has pruned out additional terms as they contribute little to the
Adaptive regression splines in earth package R Yes, there could be several ways. First notice that the model selected is the one with minimal GCV of those fitted. Hence the algorithm has pruned out additional terms as they contribute little to the fit yet add complexity to the model. The issue here is one of parsimony ...
Adaptive regression splines in earth package R Yes, there could be several ways. First notice that the model selected is the one with minimal GCV of those fitted. Hence the algorithm has pruned out additional terms as they contribute little to the
53,393
Confusion related to MCMC technique
In Standard Monte Carlo integration, as you correctly state, you draw samples from a distribution and approximate some expectation using the sample average rather than calculating a difficult or intractable integral. So you are exploiting the Strong Law of Large Numbers to do this: \begin{equation} \mathbb{E}_{\pi} [t...
Confusion related to MCMC technique
In Standard Monte Carlo integration, as you correctly state, you draw samples from a distribution and approximate some expectation using the sample average rather than calculating a difficult or intra
Confusion related to MCMC technique In Standard Monte Carlo integration, as you correctly state, you draw samples from a distribution and approximate some expectation using the sample average rather than calculating a difficult or intractable integral. So you are exploiting the Strong Law of Large Numbers to do this: ...
Confusion related to MCMC technique In Standard Monte Carlo integration, as you correctly state, you draw samples from a distribution and approximate some expectation using the sample average rather than calculating a difficult or intra
53,394
Confusion related to MCMC technique
First of all, Monte Carlo methods are not intended just for estimation of integrals. It is intended to sample random variables from distribution and the "by product" is aproximation of integrals. The reason behind the Markov chains is that MCMC methods/algorithms, e.g. Metropolis-Hastings produce a Markov Chain which h...
Confusion related to MCMC technique
First of all, Monte Carlo methods are not intended just for estimation of integrals. It is intended to sample random variables from distribution and the "by product" is aproximation of integrals. The
Confusion related to MCMC technique First of all, Monte Carlo methods are not intended just for estimation of integrals. It is intended to sample random variables from distribution and the "by product" is aproximation of integrals. The reason behind the Markov chains is that MCMC methods/algorithms, e.g. Metropolis-Has...
Confusion related to MCMC technique First of all, Monte Carlo methods are not intended just for estimation of integrals. It is intended to sample random variables from distribution and the "by product" is aproximation of integrals. The
53,395
Confusion between sample and population
It depends on to whom you wish to generalize your final results. If your sole interest was just to see how these people react and you don't care about inference, they are your population. If you wish to use the results to somehow infer how other similar people may behave under influence, then they are samples. Most stu...
Confusion between sample and population
It depends on to whom you wish to generalize your final results. If your sole interest was just to see how these people react and you don't care about inference, they are your population. If you wish
Confusion between sample and population It depends on to whom you wish to generalize your final results. If your sole interest was just to see how these people react and you don't care about inference, they are your population. If you wish to use the results to somehow infer how other similar people may behave under in...
Confusion between sample and population It depends on to whom you wish to generalize your final results. If your sole interest was just to see how these people react and you don't care about inference, they are your population. If you wish
53,396
Confusion between sample and population
As @Michael said, this would be considered a sample. One additional question is "from what population"? That is harder to say, but this is a problem that bedevils many studies. Often researchers will assume that a sample like this is "almost random" or something like that. What is the population, though? All college st...
Confusion between sample and population
As @Michael said, this would be considered a sample. One additional question is "from what population"? That is harder to say, but this is a problem that bedevils many studies. Often researchers will
Confusion between sample and population As @Michael said, this would be considered a sample. One additional question is "from what population"? That is harder to say, but this is a problem that bedevils many studies. Often researchers will assume that a sample like this is "almost random" or something like that. What i...
Confusion between sample and population As @Michael said, this would be considered a sample. One additional question is "from what population"? That is harder to say, but this is a problem that bedevils many studies. Often researchers will
53,397
Confusion between sample and population
For the purposes of statistical tests, this would be considered a sample. For example the average time for group 1 to complete puzzle is $\bar X_1 $ and not $\mu_1$ the population mean. Using a small group (or even large group) to determine effect of alcohol on 'completion time' of puzzle, cannot give you $\mu_1$. Th...
Confusion between sample and population
For the purposes of statistical tests, this would be considered a sample. For example the average time for group 1 to complete puzzle is $\bar X_1 $ and not $\mu_1$ the population mean. Using a small
Confusion between sample and population For the purposes of statistical tests, this would be considered a sample. For example the average time for group 1 to complete puzzle is $\bar X_1 $ and not $\mu_1$ the population mean. Using a small group (or even large group) to determine effect of alcohol on 'completion time...
Confusion between sample and population For the purposes of statistical tests, this would be considered a sample. For example the average time for group 1 to complete puzzle is $\bar X_1 $ and not $\mu_1$ the population mean. Using a small
53,398
Eighth order moment
By the language on the theorem, he's clearly referring to a random $D$-dimensional vector. This means that each $y_d$ is a random variable; for the sake of notation lets denote it by $Y_d$ (I really hate when authors don't do the distinction). With that said, the $n$-th order moment about $x_0$ of $Y_d$ is defined as: ...
Eighth order moment
By the language on the theorem, he's clearly referring to a random $D$-dimensional vector. This means that each $y_d$ is a random variable; for the sake of notation lets denote it by $Y_d$ (I really h
Eighth order moment By the language on the theorem, he's clearly referring to a random $D$-dimensional vector. This means that each $y_d$ is a random variable; for the sake of notation lets denote it by $Y_d$ (I really hate when authors don't do the distinction). With that said, the $n$-th order moment about $x_0$ of $...
Eighth order moment By the language on the theorem, he's clearly referring to a random $D$-dimensional vector. This means that each $y_d$ is a random variable; for the sake of notation lets denote it by $Y_d$ (I really h
53,399
When sampling without replacement from a given distribution, what's the total expected weight of the last k sampled items?
This method for creating a random permutation is used by poker players for estimating their expected value in a tournament which pays prizes for places lower than first. It is called the Independent Chip Model or ICM. The probabilities don't simplify that much although you can do better than the naive summation. I'll g...
When sampling without replacement from a given distribution, what's the total expected weight of the
This method for creating a random permutation is used by poker players for estimating their expected value in a tournament which pays prizes for places lower than first. It is called the Independent C
When sampling without replacement from a given distribution, what's the total expected weight of the last k sampled items? This method for creating a random permutation is used by poker players for estimating their expected value in a tournament which pays prizes for places lower than first. It is called the Independen...
When sampling without replacement from a given distribution, what's the total expected weight of the This method for creating a random permutation is used by poker players for estimating their expected value in a tournament which pays prizes for places lower than first. It is called the Independent C
53,400
When sampling without replacement from a given distribution, what's the total expected weight of the last k sampled items?
This may not be directly relevant if what you put as the question is the only thing that you are concerned with. However, if you in fact need to create an unequal probability sample, and you asked only for a small technical part of the process that you are struggling with, here's some broader context. Sampling without ...
When sampling without replacement from a given distribution, what's the total expected weight of the
This may not be directly relevant if what you put as the question is the only thing that you are concerned with. However, if you in fact need to create an unequal probability sample, and you asked onl
When sampling without replacement from a given distribution, what's the total expected weight of the last k sampled items? This may not be directly relevant if what you put as the question is the only thing that you are concerned with. However, if you in fact need to create an unequal probability sample, and you asked ...
When sampling without replacement from a given distribution, what's the total expected weight of the This may not be directly relevant if what you put as the question is the only thing that you are concerned with. However, if you in fact need to create an unequal probability sample, and you asked onl