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,701
In linear regression, is there any meaning for the term $X^Ty$?
Suppose we have a linear system of $m$ equations in $\mathrm x \in \mathbb R^n$ $$\mathrm A \mathrm x = \mathrm b$$ where $\mathrm A \in \mathbb R^{m \times n}$ has full column rank, and $\mathrm b \in \mathbb R^m$. Left-multiplying both sides by $\mathrm A^T$, we obtain a linear system of $n \leq m$ equations in $\mat...
In linear regression, is there any meaning for the term $X^Ty$?
Suppose we have a linear system of $m$ equations in $\mathrm x \in \mathbb R^n$ $$\mathrm A \mathrm x = \mathrm b$$ where $\mathrm A \in \mathbb R^{m \times n}$ has full column rank, and $\mathrm b \i
In linear regression, is there any meaning for the term $X^Ty$? Suppose we have a linear system of $m$ equations in $\mathrm x \in \mathbb R^n$ $$\mathrm A \mathrm x = \mathrm b$$ where $\mathrm A \in \mathbb R^{m \times n}$ has full column rank, and $\mathrm b \in \mathbb R^m$. Left-multiplying both sides by $\mathrm ...
In linear regression, is there any meaning for the term $X^Ty$? Suppose we have a linear system of $m$ equations in $\mathrm x \in \mathbb R^n$ $$\mathrm A \mathrm x = \mathrm b$$ where $\mathrm A \in \mathbb R^{m \times n}$ has full column rank, and $\mathrm b \i
53,702
What's the convergence rate in the context of convergence in probability?
I would argue that the most widely accepted definition of a convergence rate uses the "big-Oh" and "small-oh" notation. That is, convergence in probability is written as $z_n-z=o_p(1)$, while a rate of convergence could be indicated via a statement like $z_n-z=O_p(n^{-\alpha})$, which says that $z_n-z$ remains stochast...
What's the convergence rate in the context of convergence in probability?
I would argue that the most widely accepted definition of a convergence rate uses the "big-Oh" and "small-oh" notation. That is, convergence in probability is written as $z_n-z=o_p(1)$, while a rate o
What's the convergence rate in the context of convergence in probability? I would argue that the most widely accepted definition of a convergence rate uses the "big-Oh" and "small-oh" notation. That is, convergence in probability is written as $z_n-z=o_p(1)$, while a rate of convergence could be indicated via a stateme...
What's the convergence rate in the context of convergence in probability? I would argue that the most widely accepted definition of a convergence rate uses the "big-Oh" and "small-oh" notation. That is, convergence in probability is written as $z_n-z=o_p(1)$, while a rate o
53,703
Should random forests based on same data but different random seeds be compared?
Random Forest converges with growing number of trees, see the Breiman 2001 paper. So if you would set the number of trees (ntree) to infinity, you would always get the same accuracy (or some other measure like logloss). It only varies a lot because your number of trees is too small (or your resampling strategy (10-fold...
Should random forests based on same data but different random seeds be compared?
Random Forest converges with growing number of trees, see the Breiman 2001 paper. So if you would set the number of trees (ntree) to infinity, you would always get the same accuracy (or some other mea
Should random forests based on same data but different random seeds be compared? Random Forest converges with growing number of trees, see the Breiman 2001 paper. So if you would set the number of trees (ntree) to infinity, you would always get the same accuracy (or some other measure like logloss). It only varies a lo...
Should random forests based on same data but different random seeds be compared? Random Forest converges with growing number of trees, see the Breiman 2001 paper. So if you would set the number of trees (ntree) to infinity, you would always get the same accuracy (or some other mea
53,704
Should random forests based on same data but different random seeds be compared?
Accuracy is just another random variable that depends on your model, the seed, the train / test split, quality of your current data etc. - maximizing this random variable does not automatically lead to the best possible generalization of your model. Besides looking at metrics like accuracy, logloss, auc roc etc. you m...
Should random forests based on same data but different random seeds be compared?
Accuracy is just another random variable that depends on your model, the seed, the train / test split, quality of your current data etc. - maximizing this random variable does not automatically lead t
Should random forests based on same data but different random seeds be compared? Accuracy is just another random variable that depends on your model, the seed, the train / test split, quality of your current data etc. - maximizing this random variable does not automatically lead to the best possible generalization of y...
Should random forests based on same data but different random seeds be compared? Accuracy is just another random variable that depends on your model, the seed, the train / test split, quality of your current data etc. - maximizing this random variable does not automatically lead t
53,705
how to check missing data is missing at random or not?
Here is one way to test the missingness-at-random assumption. Suppose the question on participant's income has some missing entries. Run a logistic regression with income as your response and everything else as predictors. Your response would be 1 if it's missing, 0 otherwise. The p-value of the predictors should give...
how to check missing data is missing at random or not?
Here is one way to test the missingness-at-random assumption. Suppose the question on participant's income has some missing entries. Run a logistic regression with income as your response and everyth
how to check missing data is missing at random or not? Here is one way to test the missingness-at-random assumption. Suppose the question on participant's income has some missing entries. Run a logistic regression with income as your response and everything else as predictors. Your response would be 1 if it's missing,...
how to check missing data is missing at random or not? Here is one way to test the missingness-at-random assumption. Suppose the question on participant's income has some missing entries. Run a logistic regression with income as your response and everyth
53,706
how to check missing data is missing at random or not?
A little bit of terminology: Missing completely at random: Missingness does not depend on any observed or unobserved variables. Missing at random: Missingness does not depend on unobserved variables, but it may depend on observed variables. Missing not at random: Missingness depends on unobserved variables (it may or ...
how to check missing data is missing at random or not?
A little bit of terminology: Missing completely at random: Missingness does not depend on any observed or unobserved variables. Missing at random: Missingness does not depend on unobserved variables,
how to check missing data is missing at random or not? A little bit of terminology: Missing completely at random: Missingness does not depend on any observed or unobserved variables. Missing at random: Missingness does not depend on unobserved variables, but it may depend on observed variables. Missing not at random: ...
how to check missing data is missing at random or not? A little bit of terminology: Missing completely at random: Missingness does not depend on any observed or unobserved variables. Missing at random: Missingness does not depend on unobserved variables,
53,707
XGBoost - Can we find a "better" objective function than RMSE for regression?
does the same logic hold true for gradient boosted trees? Yes, by any mean. Gradient boosting can be used to minimize any sensible loss function, and it is very effective in doing it. It is worth saying that generalised linear models are generally picked considering not the loss/utility function (that answers the ques...
XGBoost - Can we find a "better" objective function than RMSE for regression?
does the same logic hold true for gradient boosted trees? Yes, by any mean. Gradient boosting can be used to minimize any sensible loss function, and it is very effective in doing it. It is worth say
XGBoost - Can we find a "better" objective function than RMSE for regression? does the same logic hold true for gradient boosted trees? Yes, by any mean. Gradient boosting can be used to minimize any sensible loss function, and it is very effective in doing it. It is worth saying that generalised linear models are gen...
XGBoost - Can we find a "better" objective function than RMSE for regression? does the same logic hold true for gradient boosted trees? Yes, by any mean. Gradient boosting can be used to minimize any sensible loss function, and it is very effective in doing it. It is worth say
53,708
XGBoost - Can we find a "better" objective function than RMSE for regression?
To answer your question you need to define what is "better". If your goal is to reach a smaller distance to a gamma distributed variable measured in squared distance than you should build your objective function in that way. A very common problem is to find a solution that minimizes Mean Absolute Error. That cost func...
XGBoost - Can we find a "better" objective function than RMSE for regression?
To answer your question you need to define what is "better". If your goal is to reach a smaller distance to a gamma distributed variable measured in squared distance than you should build your objecti
XGBoost - Can we find a "better" objective function than RMSE for regression? To answer your question you need to define what is "better". If your goal is to reach a smaller distance to a gamma distributed variable measured in squared distance than you should build your objective function in that way. A very common pr...
XGBoost - Can we find a "better" objective function than RMSE for regression? To answer your question you need to define what is "better". If your goal is to reach a smaller distance to a gamma distributed variable measured in squared distance than you should build your objecti
53,709
XGBoost - Can we find a "better" objective function than RMSE for regression?
Well, in the original paper of Gradient Boosting, Friedman proposes some alternatives to RMSE (or L2 loss) for the loss function in the implementation of Boosted Trees. These are Least Absolute Deviation (equivalent to MAE, as expressed in the previous answers), and M-Regression, which uses instead a Huber Loss, which...
XGBoost - Can we find a "better" objective function than RMSE for regression?
Well, in the original paper of Gradient Boosting, Friedman proposes some alternatives to RMSE (or L2 loss) for the loss function in the implementation of Boosted Trees. These are Least Absolute Devia
XGBoost - Can we find a "better" objective function than RMSE for regression? Well, in the original paper of Gradient Boosting, Friedman proposes some alternatives to RMSE (or L2 loss) for the loss function in the implementation of Boosted Trees. These are Least Absolute Deviation (equivalent to MAE, as expressed in t...
XGBoost - Can we find a "better" objective function than RMSE for regression? Well, in the original paper of Gradient Boosting, Friedman proposes some alternatives to RMSE (or L2 loss) for the loss function in the implementation of Boosted Trees. These are Least Absolute Devia
53,710
Is the Jackknife estimation better than Maximum Likelihood Estimator?
You are not doing anything wrong, the are suppossed to give the same number (in this simple setting): # the true mean of y is 0 y <- rnorm(1000) # The MLE estimator is simply the sample mean: MLE <- mean(y) # The Jackknife estimator is: require(bootstrap) JKE <- mean(jackknife(y, mean)$jack.values) # Both estimato...
Is the Jackknife estimation better than Maximum Likelihood Estimator?
You are not doing anything wrong, the are suppossed to give the same number (in this simple setting): # the true mean of y is 0 y <- rnorm(1000) # The MLE estimator is simply the sample mean: MLE <-
Is the Jackknife estimation better than Maximum Likelihood Estimator? You are not doing anything wrong, the are suppossed to give the same number (in this simple setting): # the true mean of y is 0 y <- rnorm(1000) # The MLE estimator is simply the sample mean: MLE <- mean(y) # The Jackknife estimator is: require(b...
Is the Jackknife estimation better than Maximum Likelihood Estimator? You are not doing anything wrong, the are suppossed to give the same number (in this simple setting): # the true mean of y is 0 y <- rnorm(1000) # The MLE estimator is simply the sample mean: MLE <-
53,711
Is the Jackknife estimation better than Maximum Likelihood Estimator?
Comparing maximum likelihood estimation (MLE) and the jackknife is like comparing apples and oranges. These techniques accomplish different things. Maximum likelihood estimation is a method for estimating parameters and fitting models. Since it's based on maximizing the likelihood function, it's a model-based algorith...
Is the Jackknife estimation better than Maximum Likelihood Estimator?
Comparing maximum likelihood estimation (MLE) and the jackknife is like comparing apples and oranges. These techniques accomplish different things. Maximum likelihood estimation is a method for estim
Is the Jackknife estimation better than Maximum Likelihood Estimator? Comparing maximum likelihood estimation (MLE) and the jackknife is like comparing apples and oranges. These techniques accomplish different things. Maximum likelihood estimation is a method for estimating parameters and fitting models. Since it's ba...
Is the Jackknife estimation better than Maximum Likelihood Estimator? Comparing maximum likelihood estimation (MLE) and the jackknife is like comparing apples and oranges. These techniques accomplish different things. Maximum likelihood estimation is a method for estim
53,712
What does it mean to say that "the population mean is a single fixed number?"
Consider a finite population of values -- let's say you have a billion of them The mean of that population is a single value -- you can compute it. If you recalculate it again on the same population, you use all the same values in your mean, so it's the same number every time. By contrast if you take new samples the sa...
What does it mean to say that "the population mean is a single fixed number?"
Consider a finite population of values -- let's say you have a billion of them The mean of that population is a single value -- you can compute it. If you recalculate it again on the same population,
What does it mean to say that "the population mean is a single fixed number?" Consider a finite population of values -- let's say you have a billion of them The mean of that population is a single value -- you can compute it. If you recalculate it again on the same population, you use all the same values in your mean, ...
What does it mean to say that "the population mean is a single fixed number?" Consider a finite population of values -- let's say you have a billion of them The mean of that population is a single value -- you can compute it. If you recalculate it again on the same population,
53,713
What does it mean to say that "the population mean is a single fixed number?"
Here's how it finally made sense to me. When we say something like, "human male height is normally distributed", we really mean it. We actually believe that, whoever is in charge of this thing, has a book, and on a page of that book is written something like: Human males. Distributed like $N(70, 5)$, in units of inc...
What does it mean to say that "the population mean is a single fixed number?"
Here's how it finally made sense to me. When we say something like, "human male height is normally distributed", we really mean it. We actually believe that, whoever is in charge of this thing, has a
What does it mean to say that "the population mean is a single fixed number?" Here's how it finally made sense to me. When we say something like, "human male height is normally distributed", we really mean it. We actually believe that, whoever is in charge of this thing, has a book, and on a page of that book is writt...
What does it mean to say that "the population mean is a single fixed number?" Here's how it finally made sense to me. When we say something like, "human male height is normally distributed", we really mean it. We actually believe that, whoever is in charge of this thing, has a
53,714
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation?
There are several levels of confusion exposed by your question: By reading the code of the sensitivity test procedure, I find the steps in Markov Chain is quite similar to random walk. It would be most profitable to read further than "the code" about Markov chain Monte Carlo methods. For instance, the Wikipedia en...
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation
There are several levels of confusion exposed by your question: By reading the code of the sensitivity test procedure, I find the steps in Markov Chain is quite similar to random walk. It would b
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation? There are several levels of confusion exposed by your question: By reading the code of the sensitivity test procedure, I find the steps in Markov Chain is quite similar to random walk. It would be most profitable ...
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation There are several levels of confusion exposed by your question: By reading the code of the sensitivity test procedure, I find the steps in Markov Chain is quite similar to random walk. It would b
53,715
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation?
A transition matrix determines the movement of a Markov chain when the space over which the chain is defined (the state space) is finite or countable. If the Markov chain is at state $x$, element $(x,y)$ in the transition matrix is the probability of moving to $y$. For example, consider a Markov chain that has only two...
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation
A transition matrix determines the movement of a Markov chain when the space over which the chain is defined (the state space) is finite or countable. If the Markov chain is at state $x$, element $(x,
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation? A transition matrix determines the movement of a Markov chain when the space over which the chain is defined (the state space) is finite or countable. If the Markov chain is at state $x$, element $(x,y)$ in the transit...
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation A transition matrix determines the movement of a Markov chain when the space over which the chain is defined (the state space) is finite or countable. If the Markov chain is at state $x$, element $(x,
53,716
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation?
Every Markov Chain can be viewed as a random walk. If you're implementing MCMC, you don't need to explicitly specify or know the transition function(matrix), as Greenparker suggested, M-H algorithm is a common technique, which allows you achieve the stationary distribution. If you know and prescribe transition matrix ...
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation
Every Markov Chain can be viewed as a random walk. If you're implementing MCMC, you don't need to explicitly specify or know the transition function(matrix), as Greenparker suggested, M-H algorithm is
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation? Every Markov Chain can be viewed as a random walk. If you're implementing MCMC, you don't need to explicitly specify or know the transition function(matrix), as Greenparker suggested, M-H algorithm is a common techniqu...
How to generate the transition matrix of Markov Chain needed for Markov Chain Monte Carlo simulation Every Markov Chain can be viewed as a random walk. If you're implementing MCMC, you don't need to explicitly specify or know the transition function(matrix), as Greenparker suggested, M-H algorithm is
53,717
Objective function of canonical correlation analysis (CCA)
If $X$ is $n\times p$ and $Y$ is $n\times q$, then one can formulate the CCA optimization problem for the first canonical pair as follows: $$\text{Maximize }\operatorname{corr}(Xa, Yb).$$ The value of the correlation does not depend on the lengths of $a$ and $b$, so they can be arbitrarily fixed. It is convenient to fi...
Objective function of canonical correlation analysis (CCA)
If $X$ is $n\times p$ and $Y$ is $n\times q$, then one can formulate the CCA optimization problem for the first canonical pair as follows: $$\text{Maximize }\operatorname{corr}(Xa, Yb).$$ The value of
Objective function of canonical correlation analysis (CCA) If $X$ is $n\times p$ and $Y$ is $n\times q$, then one can formulate the CCA optimization problem for the first canonical pair as follows: $$\text{Maximize }\operatorname{corr}(Xa, Yb).$$ The value of the correlation does not depend on the lengths of $a$ and $b...
Objective function of canonical correlation analysis (CCA) If $X$ is $n\times p$ and $Y$ is $n\times q$, then one can formulate the CCA optimization problem for the first canonical pair as follows: $$\text{Maximize }\operatorname{corr}(Xa, Yb).$$ The value of
53,718
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not significant"?
The reviewer is apparently trying to use the standard deviation as some sort of ad-hoc statistical test, but this doesn't work. The reviewer's snarky "unless my statistics is failing me" comment is therefore funny (or maddening, if this gets your paper rejected). Specifically, standard deviation tells us how spread out...
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not
The reviewer is apparently trying to use the standard deviation as some sort of ad-hoc statistical test, but this doesn't work. The reviewer's snarky "unless my statistics is failing me" comment is th
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not significant"? The reviewer is apparently trying to use the standard deviation as some sort of ad-hoc statistical test, but this doesn't work. The reviewer's snarky "unless my statistics is failing me" comment is therefo...
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not The reviewer is apparently trying to use the standard deviation as some sort of ad-hoc statistical test, but this doesn't work. The reviewer's snarky "unless my statistics is failing me" comment is th
53,719
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not significant"?
It's unclear without more information. Here's an example where the standard deviation is less than 1.0, but the test is significant: # draw 100 samples from two random Normal distributions with small standard deviations, # with different means: x <- rnorm(100, 1, .5) x2 <- rnorm(100, 3, .5) # note the standard devia...
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not
It's unclear without more information. Here's an example where the standard deviation is less than 1.0, but the test is significant: # draw 100 samples from two random Normal distributions with small
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not significant"? It's unclear without more information. Here's an example where the standard deviation is less than 1.0, but the test is significant: # draw 100 samples from two random Normal distributions with small stand...
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not It's unclear without more information. Here's an example where the standard deviation is less than 1.0, but the test is significant: # draw 100 samples from two random Normal distributions with small
53,720
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not significant"?
Most likely the reviewer means that your parameter is closer than one standard deviation to the null hypothesis value. For instance, your regression slope coefficient is 0.5 while its standard deviation is 1. I emphasized to assume that the reviewer is using the correct standard deviation, i.e. adjusted to the sample s...
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not
Most likely the reviewer means that your parameter is closer than one standard deviation to the null hypothesis value. For instance, your regression slope coefficient is 0.5 while its standard deviati
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not significant"? Most likely the reviewer means that your parameter is closer than one standard deviation to the null hypothesis value. For instance, your regression slope coefficient is 0.5 while its standard deviation is...
Why is this reviewer's comment funny: "Unless my statistics is failing me, a less than 1.0 SD is not Most likely the reviewer means that your parameter is closer than one standard deviation to the null hypothesis value. For instance, your regression slope coefficient is 0.5 while its standard deviati
53,721
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn from two different gamma distributions"
Sorry it took me a while to post this answer. To re-phrase the question again; we are given the sample $X_1,...,X_n$ where $X_i \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamma(\alpha_2, \beta_2)$. The hypothesis test of interest is $$ H_0:\; p=1\;\;\;\;\;H_1:\; p \in (0,1) $$ A possible issue with using a likelihood ra...
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn f
Sorry it took me a while to post this answer. To re-phrase the question again; we are given the sample $X_1,...,X_n$ where $X_i \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamma(\alpha_2, \beta_2)$. The
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn from two different gamma distributions" Sorry it took me a while to post this answer. To re-phrase the question again; we are given the sample $X_1,...,X_n$ where $X_i \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamma(\alph...
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn f Sorry it took me a while to post this answer. To re-phrase the question again; we are given the sample $X_1,...,X_n$ where $X_i \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamma(\alpha_2, \beta_2)$. The
53,722
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn from two different gamma distributions"
We can phrase this problem as follows, following Zachary's suggestion: We are given a set of sampled points $X = \{x_1, \dots, x_n\}$. We assume that $X \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamma(\alpha_2, \beta_2)$, where $p \in (0, 1]$ is the mixture weight of the first component. Denote the parameters of the m...
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn f
We can phrase this problem as follows, following Zachary's suggestion: We are given a set of sampled points $X = \{x_1, \dots, x_n\}$. We assume that $X \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamm
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn from two different gamma distributions" We can phrase this problem as follows, following Zachary's suggestion: We are given a set of sampled points $X = \{x_1, \dots, x_n\}$. We assume that $X \sim p \Gamma(\alpha_1, \be...
How to test H0: "this sample is drawn from a gamma distribution" against HA: "this sample is drawn f We can phrase this problem as follows, following Zachary's suggestion: We are given a set of sampled points $X = \{x_1, \dots, x_n\}$. We assume that $X \sim p \Gamma(\alpha_1, \beta_1) + (1-p) \Gamm
53,723
Does the Granger Causality test in the "vars" package make sense?
When I first used the causality function of the vars package I had the same doubt. Here is what I thought. Imagine a trivariate VAR(1) model: $$ Y_t = a_0 + a_1 Y_{t-1} + a_2 X_{t-1} + a_3 Z_{t-1} + \epsilon_{y,t} \\ X_t = b_0 + b_1 Y_{t-1} + b_2 X_{t-1} + b_3 Z_{t-1} + \epsilon_{x,t} \\ Z_t = c_0 + c_1 Y_{t-1} + c_2 X...
Does the Granger Causality test in the "vars" package make sense?
When I first used the causality function of the vars package I had the same doubt. Here is what I thought. Imagine a trivariate VAR(1) model: $$ Y_t = a_0 + a_1 Y_{t-1} + a_2 X_{t-1} + a_3 Z_{t-1} + \
Does the Granger Causality test in the "vars" package make sense? When I first used the causality function of the vars package I had the same doubt. Here is what I thought. Imagine a trivariate VAR(1) model: $$ Y_t = a_0 + a_1 Y_{t-1} + a_2 X_{t-1} + a_3 Z_{t-1} + \epsilon_{y,t} \\ X_t = b_0 + b_1 Y_{t-1} + b_2 X_{t-1}...
Does the Granger Causality test in the "vars" package make sense? When I first used the causality function of the vars package I had the same doubt. Here is what I thought. Imagine a trivariate VAR(1) model: $$ Y_t = a_0 + a_1 Y_{t-1} + a_2 X_{t-1} + a_3 Z_{t-1} + \
53,724
Does the Granger Causality test in the "vars" package make sense?
As Regis suggested, using the function grangertest from the package lmtest is a way to produce the pairwise test result. This should be equivalent to using the causality function from vars on a bivariate VAR model. In the following, the F-statistics are indentical, and the p-values are slightly different: data(ChickEgg...
Does the Granger Causality test in the "vars" package make sense?
As Regis suggested, using the function grangertest from the package lmtest is a way to produce the pairwise test result. This should be equivalent to using the causality function from vars on a bivari
Does the Granger Causality test in the "vars" package make sense? As Regis suggested, using the function grangertest from the package lmtest is a way to produce the pairwise test result. This should be equivalent to using the causality function from vars on a bivariate VAR model. In the following, the F-statistics are ...
Does the Granger Causality test in the "vars" package make sense? As Regis suggested, using the function grangertest from the package lmtest is a way to produce the pairwise test result. This should be equivalent to using the causality function from vars on a bivari
53,725
Does the Granger Causality test in the "vars" package make sense?
Another simple solution is the following: NAMES = colnames(df) k = ncol(df) for (j in 1:k) { for (i in 1:k) { if (i != j) { print(paste(NAMES[j], "->", NAMES[i])) VARest = vars::VAR(df[,c(j,i)], p=1) print(causality(VARest, cause=NAMES[j])) } } }
Does the Granger Causality test in the "vars" package make sense?
Another simple solution is the following: NAMES = colnames(df) k = ncol(df) for (j in 1:k) { for (i in 1:k) { if (i != j) { print(paste(NAMES[j], "->", NAMES[i]))
Does the Granger Causality test in the "vars" package make sense? Another simple solution is the following: NAMES = colnames(df) k = ncol(df) for (j in 1:k) { for (i in 1:k) { if (i != j) { print(paste(NAMES[j], "->", NAMES[i])) VARest = vars::VAR(df[,c(j,i)], p=1) ...
Does the Granger Causality test in the "vars" package make sense? Another simple solution is the following: NAMES = colnames(df) k = ncol(df) for (j in 1:k) { for (i in 1:k) { if (i != j) { print(paste(NAMES[j], "->", NAMES[i]))
53,726
Does the Granger Causality test in the "vars" package make sense?
An workaround to test cause and response within the vars pkg with the help of the "exogen" settings in the VAR function: granger_bivariate <- function(varest, causal, dep){ dtmat <- varest$datamat mat_target <- dtmat[, c(causal, dep)] other_as_exo <- dtmat[, setdiff(names(dtmat),c(causal, dep,'const',names(dtmat)...
Does the Granger Causality test in the "vars" package make sense?
An workaround to test cause and response within the vars pkg with the help of the "exogen" settings in the VAR function: granger_bivariate <- function(varest, causal, dep){ dtmat <- varest$datamat
Does the Granger Causality test in the "vars" package make sense? An workaround to test cause and response within the vars pkg with the help of the "exogen" settings in the VAR function: granger_bivariate <- function(varest, causal, dep){ dtmat <- varest$datamat mat_target <- dtmat[, c(causal, dep)] other_as_exo ...
Does the Granger Causality test in the "vars" package make sense? An workaround to test cause and response within the vars pkg with the help of the "exogen" settings in the VAR function: granger_bivariate <- function(varest, causal, dep){ dtmat <- varest$datamat
53,727
Interpreting Mediation Output when Direct Effect is not Stat. Sig but ACME and Total are
This does suggest a "full" mediation, in which all of the IV's influence is mediated. The ACME being significant shows that the mediating process appears to be present. On the other hand, you don't have evidence that there is an ADE (insignificant result). The reason the total effect is larger than the ACME alone is th...
Interpreting Mediation Output when Direct Effect is not Stat. Sig but ACME and Total are
This does suggest a "full" mediation, in which all of the IV's influence is mediated. The ACME being significant shows that the mediating process appears to be present. On the other hand, you don't ha
Interpreting Mediation Output when Direct Effect is not Stat. Sig but ACME and Total are This does suggest a "full" mediation, in which all of the IV's influence is mediated. The ACME being significant shows that the mediating process appears to be present. On the other hand, you don't have evidence that there is an AD...
Interpreting Mediation Output when Direct Effect is not Stat. Sig but ACME and Total are This does suggest a "full" mediation, in which all of the IV's influence is mediated. The ACME being significant shows that the mediating process appears to be present. On the other hand, you don't ha
53,728
Is this alternative method to Metropolis-Hastings salvageable? What is it called?
The method you suggest is called "importance sampling", and its success depends on finding a good importance distribution $Q$, which should be as similar as possible to $fP$. Note that it does not replace Metropolis-Hastings (MH), since you can still use MH to sample from $Q$.
Is this alternative method to Metropolis-Hastings salvageable? What is it called?
The method you suggest is called "importance sampling", and its success depends on finding a good importance distribution $Q$, which should be as similar as possible to $fP$. Note that it does not rep
Is this alternative method to Metropolis-Hastings salvageable? What is it called? The method you suggest is called "importance sampling", and its success depends on finding a good importance distribution $Q$, which should be as similar as possible to $fP$. Note that it does not replace Metropolis-Hastings (MH), since y...
Is this alternative method to Metropolis-Hastings salvageable? What is it called? The method you suggest is called "importance sampling", and its success depends on finding a good importance distribution $Q$, which should be as similar as possible to $fP$. Note that it does not rep
53,729
Why is a binomial distribution bell-shaped?
The binomial distribution arises as the number of successes in $n$ Bernoulli trials. Each trial is either a success or not, so the number of successes in $n$ trials can be any of the values $0, 1, 2, ..., n$. For example, the number of heads in three tosses of a coin can be 0, 1, 2 or 3. If one divides by the number o...
Why is a binomial distribution bell-shaped?
The binomial distribution arises as the number of successes in $n$ Bernoulli trials. Each trial is either a success or not, so the number of successes in $n$ trials can be any of the values $0, 1, 2,
Why is a binomial distribution bell-shaped? The binomial distribution arises as the number of successes in $n$ Bernoulli trials. Each trial is either a success or not, so the number of successes in $n$ trials can be any of the values $0, 1, 2, ..., n$. For example, the number of heads in three tosses of a coin can be 0...
Why is a binomial distribution bell-shaped? The binomial distribution arises as the number of successes in $n$ Bernoulli trials. Each trial is either a success or not, so the number of successes in $n$ trials can be any of the values $0, 1, 2,
53,730
Trouble in fitting data to a curve (NLS)
I wish I had a dollar for every hour people have wasted trying to do nonlinear parameter estimation with R. Here is the solution to your problem together with the estimated std devs calculated by the delta method and plot of solution is above. y0 85.557909 3.0989e-01 a1 125.20943 1.3766e+01 a2 1394.155 4.4952e+03 b...
Trouble in fitting data to a curve (NLS)
I wish I had a dollar for every hour people have wasted trying to do nonlinear parameter estimation with R. Here is the solution to your problem together with the estimated std devs calculated by the
Trouble in fitting data to a curve (NLS) I wish I had a dollar for every hour people have wasted trying to do nonlinear parameter estimation with R. Here is the solution to your problem together with the estimated std devs calculated by the delta method and plot of solution is above. y0 85.557909 3.0989e-01 a1 125.20...
Trouble in fitting data to a curve (NLS) I wish I had a dollar for every hour people have wasted trying to do nonlinear parameter estimation with R. Here is the solution to your problem together with the estimated std devs calculated by the
53,731
Trouble in fitting data to a curve (NLS)
EDITED TO REMOVE THE ORIGINAL SECOND POINT, WHICH WAS WRONG. Two comments: Looking at the data, something strange is happening at about 80 seconds and 140 seconds. If these are experimental artefacts, then it won't make sense to fit a complicated model. If those data show a real trend (not an experimental artefact), ...
Trouble in fitting data to a curve (NLS)
EDITED TO REMOVE THE ORIGINAL SECOND POINT, WHICH WAS WRONG. Two comments: Looking at the data, something strange is happening at about 80 seconds and 140 seconds. If these are experimental artefact
Trouble in fitting data to a curve (NLS) EDITED TO REMOVE THE ORIGINAL SECOND POINT, WHICH WAS WRONG. Two comments: Looking at the data, something strange is happening at about 80 seconds and 140 seconds. If these are experimental artefacts, then it won't make sense to fit a complicated model. If those data show a re...
Trouble in fitting data to a curve (NLS) EDITED TO REMOVE THE ORIGINAL SECOND POINT, WHICH WAS WRONG. Two comments: Looking at the data, something strange is happening at about 80 seconds and 140 seconds. If these are experimental artefact
53,732
Trouble in fitting data to a curve (NLS)
NB in my discussion, I'll ignore the obvious lack of fit of the model and focus on the issues with getting estimates. A model like this one can sometimes have a few issues (because of a ridge in the parameter space) but there seems to be no such difficulty here. I did a one-exponential fit first, as you did. Then the v...
Trouble in fitting data to a curve (NLS)
NB in my discussion, I'll ignore the obvious lack of fit of the model and focus on the issues with getting estimates. A model like this one can sometimes have a few issues (because of a ridge in the p
Trouble in fitting data to a curve (NLS) NB in my discussion, I'll ignore the obvious lack of fit of the model and focus on the issues with getting estimates. A model like this one can sometimes have a few issues (because of a ridge in the parameter space) but there seems to be no such difficulty here. I did a one-expo...
Trouble in fitting data to a curve (NLS) NB in my discussion, I'll ignore the obvious lack of fit of the model and focus on the issues with getting estimates. A model like this one can sometimes have a few issues (because of a ridge in the p
53,733
Trouble in fitting data to a curve (NLS)
If you realize that your model is partial linear, the whole task gets very simple. You only need starting values for the non-linear parameters and since these are related to the half-life, it's easy to make a decent guess from a plot: tau1_ini <- log(2) / 18 tau2_ini <- log(2) / 180 Then you can fit: fit <...
Trouble in fitting data to a curve (NLS)
If you realize that your model is partial linear, the whole task gets very simple. You only need starting values for the non-linear parameters and since these are related to the half-life, it's easy t
Trouble in fitting data to a curve (NLS) If you realize that your model is partial linear, the whole task gets very simple. You only need starting values for the non-linear parameters and since these are related to the half-life, it's easy to make a decent guess from a plot: tau1_ini <- log(2) / 18 tau2_ini...
Trouble in fitting data to a curve (NLS) If you realize that your model is partial linear, the whole task gets very simple. You only need starting values for the non-linear parameters and since these are related to the half-life, it's easy t
53,734
What is the correct definition of the Likelihood function?
Start with general definitions of likelihood. With likelihood you are not really interested in probabilities, but in likelihood of $\theta$ given your data. It is calculated using probability of data using some model with parameters $\theta$, i.e. $$L(\theta|X) = \prod_i f_\theta(x_i)$$ Now, in your examples two differ...
What is the correct definition of the Likelihood function?
Start with general definitions of likelihood. With likelihood you are not really interested in probabilities, but in likelihood of $\theta$ given your data. It is calculated using probability of data
What is the correct definition of the Likelihood function? Start with general definitions of likelihood. With likelihood you are not really interested in probabilities, but in likelihood of $\theta$ given your data. It is calculated using probability of data using some model with parameters $\theta$, i.e. $$L(\theta|X)...
What is the correct definition of the Likelihood function? Start with general definitions of likelihood. With likelihood you are not really interested in probabilities, but in likelihood of $\theta$ given your data. It is calculated using probability of data
53,735
What is the correct definition of the Likelihood function?
The two likelihoods are related by the following equation: $$P(Y \cap X\,|\,\Theta) = P(Y\,|\,X,\Theta)P(X\,|\,\Theta)$$ So, the joint probability of $Y$ and $X$ has to account for two things: The probability of generating $Y$ given $X$ and $\Theta$ The probability of generating $X$ given $\Theta$ $P(Y\,|\,X,\Theta)...
What is the correct definition of the Likelihood function?
The two likelihoods are related by the following equation: $$P(Y \cap X\,|\,\Theta) = P(Y\,|\,X,\Theta)P(X\,|\,\Theta)$$ So, the joint probability of $Y$ and $X$ has to account for two things: The p
What is the correct definition of the Likelihood function? The two likelihoods are related by the following equation: $$P(Y \cap X\,|\,\Theta) = P(Y\,|\,X,\Theta)P(X\,|\,\Theta)$$ So, the joint probability of $Y$ and $X$ has to account for two things: The probability of generating $Y$ given $X$ and $\Theta$ The proba...
What is the correct definition of the Likelihood function? The two likelihoods are related by the following equation: $$P(Y \cap X\,|\,\Theta) = P(Y\,|\,X,\Theta)P(X\,|\,\Theta)$$ So, the joint probability of $Y$ and $X$ has to account for two things: The p
53,736
What is the correct definition of the Likelihood function?
It just seems that in the second case, $X$ and $Y$ are both modelled jointly in a generative model and you can write the joint likelihood as $P(X, Y | \theta)$ For example, now if you assume X and Y are independent, the joint log likelihood can be written as: $$ \log L(\theta) = \log P(X |\theta) + \log P(Y|\theta) $$
What is the correct definition of the Likelihood function?
It just seems that in the second case, $X$ and $Y$ are both modelled jointly in a generative model and you can write the joint likelihood as $P(X, Y | \theta)$ For example, now if you assume X and Y a
What is the correct definition of the Likelihood function? It just seems that in the second case, $X$ and $Y$ are both modelled jointly in a generative model and you can write the joint likelihood as $P(X, Y | \theta)$ For example, now if you assume X and Y are independent, the joint log likelihood can be written as: $...
What is the correct definition of the Likelihood function? It just seems that in the second case, $X$ and $Y$ are both modelled jointly in a generative model and you can write the joint likelihood as $P(X, Y | \theta)$ For example, now if you assume X and Y a
53,737
How to compute intraclass correlation (ICC) for THREE-level negative binomial hierarchical model?
I don't know if you still need the answer for this, but I'll try anyway. The ICC for a two level negative binomial model (Tseloni and Pease, 2003) can be easily calculated by: $$ \rho = \frac{\sigma_{j}^2}{\sigma_{j}^2 + \alpha} $$ where $\sigma_{j}^2$ is the variance of between-group differences (level 2), and $\alpha...
How to compute intraclass correlation (ICC) for THREE-level negative binomial hierarchical model?
I don't know if you still need the answer for this, but I'll try anyway. The ICC for a two level negative binomial model (Tseloni and Pease, 2003) can be easily calculated by: $$ \rho = \frac{\sigma_{
How to compute intraclass correlation (ICC) for THREE-level negative binomial hierarchical model? I don't know if you still need the answer for this, but I'll try anyway. The ICC for a two level negative binomial model (Tseloni and Pease, 2003) can be easily calculated by: $$ \rho = \frac{\sigma_{j}^2}{\sigma_{j}^2 + \...
How to compute intraclass correlation (ICC) for THREE-level negative binomial hierarchical model? I don't know if you still need the answer for this, but I'll try anyway. The ICC for a two level negative binomial model (Tseloni and Pease, 2003) can be easily calculated by: $$ \rho = \frac{\sigma_{
53,738
Is the $t$ test a special case of the generalized linear model?
As @Glen_b notes, the $t$-test does not assume the response is distributed as $t$. It assumes the response is normally distributed. (The normal is, of course, in the exponential family.) However, the motivation for the $t$-test is that the group SDs are not known a-priori, but are estimated from the data instead. T...
Is the $t$ test a special case of the generalized linear model?
As @Glen_b notes, the $t$-test does not assume the response is distributed as $t$. It assumes the response is normally distributed. (The normal is, of course, in the exponential family.) However, t
Is the $t$ test a special case of the generalized linear model? As @Glen_b notes, the $t$-test does not assume the response is distributed as $t$. It assumes the response is normally distributed. (The normal is, of course, in the exponential family.) However, the motivation for the $t$-test is that the group SDs are...
Is the $t$ test a special case of the generalized linear model? As @Glen_b notes, the $t$-test does not assume the response is distributed as $t$. It assumes the response is normally distributed. (The normal is, of course, in the exponential family.) However, t
53,739
Why is RBF kernel used in SVM?
RUser4512 gave the correct answer: RBF kernel works well in practice and it is relatively easy to tune. It's the SVM equivalent to "no one's ever been fired for estimating an OLS regression:" it's accepted as a reasonable default method. Clearly OLS isn't perfect in every (or even many) scenarios, but it's a well-studi...
Why is RBF kernel used in SVM?
RUser4512 gave the correct answer: RBF kernel works well in practice and it is relatively easy to tune. It's the SVM equivalent to "no one's ever been fired for estimating an OLS regression:" it's acc
Why is RBF kernel used in SVM? RUser4512 gave the correct answer: RBF kernel works well in practice and it is relatively easy to tune. It's the SVM equivalent to "no one's ever been fired for estimating an OLS regression:" it's accepted as a reasonable default method. Clearly OLS isn't perfect in every (or even many) s...
Why is RBF kernel used in SVM? RUser4512 gave the correct answer: RBF kernel works well in practice and it is relatively easy to tune. It's the SVM equivalent to "no one's ever been fired for estimating an OLS regression:" it's acc
53,740
Why is RBF kernel used in SVM?
I think the good reasons to use RBF kernel are that they work well in practice and they are relatively easy to calibrate, as opposed to other kernels. The polynomial kernel has three parameter (offset, scaling, degree). The RBF kernel has one parameter and there are good heuristics to find it. See, per example : SVM rb...
Why is RBF kernel used in SVM?
I think the good reasons to use RBF kernel are that they work well in practice and they are relatively easy to calibrate, as opposed to other kernels. The polynomial kernel has three parameter (offset
Why is RBF kernel used in SVM? I think the good reasons to use RBF kernel are that they work well in practice and they are relatively easy to calibrate, as opposed to other kernels. The polynomial kernel has three parameter (offset, scaling, degree). The RBF kernel has one parameter and there are good heuristics to fin...
Why is RBF kernel used in SVM? I think the good reasons to use RBF kernel are that they work well in practice and they are relatively easy to calibrate, as opposed to other kernels. The polynomial kernel has three parameter (offset
53,741
How to calculate impulse responses for a given autoregressive process?
Elaborating on Martin's answer, you will want to compare coefficients in the general AR(p) case. First, write the AR(p) process in compact lag operator notation, using $\rho(L)=1-\rho_1L-\ldots-\rho_pL^p$. We have from $\rho(L)Y_t=\epsilon_t$ and the lag operator statement of an $MA(\infty)$ process, $Y_t=\psi(L)\epsi...
How to calculate impulse responses for a given autoregressive process?
Elaborating on Martin's answer, you will want to compare coefficients in the general AR(p) case. First, write the AR(p) process in compact lag operator notation, using $\rho(L)=1-\rho_1L-\ldots-\rho_p
How to calculate impulse responses for a given autoregressive process? Elaborating on Martin's answer, you will want to compare coefficients in the general AR(p) case. First, write the AR(p) process in compact lag operator notation, using $\rho(L)=1-\rho_1L-\ldots-\rho_pL^p$. We have from $\rho(L)Y_t=\epsilon_t$ and t...
How to calculate impulse responses for a given autoregressive process? Elaborating on Martin's answer, you will want to compare coefficients in the general AR(p) case. First, write the AR(p) process in compact lag operator notation, using $\rho(L)=1-\rho_1L-\ldots-\rho_p
53,742
How to calculate impulse responses for a given autoregressive process?
Not sure if your equation is correct. I guess you meant $$ y_t = \rho_1 y_{t-1} + \dots + \rho_p y_{t-p} + \epsilon_t $$ In case of a AR(1) process you have to cast it into its MA($\infty$) (or 'covariance stationary') representation by reinserting the past observations $y_{t-j}$ where $j=1,\dots,\infty$: $$ y_t = c + ...
How to calculate impulse responses for a given autoregressive process?
Not sure if your equation is correct. I guess you meant $$ y_t = \rho_1 y_{t-1} + \dots + \rho_p y_{t-p} + \epsilon_t $$ In case of a AR(1) process you have to cast it into its MA($\infty$) (or 'covar
How to calculate impulse responses for a given autoregressive process? Not sure if your equation is correct. I guess you meant $$ y_t = \rho_1 y_{t-1} + \dots + \rho_p y_{t-p} + \epsilon_t $$ In case of a AR(1) process you have to cast it into its MA($\infty$) (or 'covariance stationary') representation by reinserting ...
How to calculate impulse responses for a given autoregressive process? Not sure if your equation is correct. I guess you meant $$ y_t = \rho_1 y_{t-1} + \dots + \rho_p y_{t-p} + \epsilon_t $$ In case of a AR(1) process you have to cast it into its MA($\infty$) (or 'covar
53,743
Fluctuations in hazard function at high (x) values
This kind of wild fluctuation arises from floating point rounding errors in the calculations. The hazard function of a $\Gamma(a,1)$ distribution, with shape parameter $a$ and scale parameter $1$, equals $$H(x; a) = \frac{x^{a-1}\exp(-x)}{\int_x^\infty t^{a-1} \exp(-t) dt }.$$ The maximum requested in the question is a...
Fluctuations in hazard function at high (x) values
This kind of wild fluctuation arises from floating point rounding errors in the calculations. The hazard function of a $\Gamma(a,1)$ distribution, with shape parameter $a$ and scale parameter $1$, equ
Fluctuations in hazard function at high (x) values This kind of wild fluctuation arises from floating point rounding errors in the calculations. The hazard function of a $\Gamma(a,1)$ distribution, with shape parameter $a$ and scale parameter $1$, equals $$H(x; a) = \frac{x^{a-1}\exp(-x)}{\int_x^\infty t^{a-1} \exp(-t)...
Fluctuations in hazard function at high (x) values This kind of wild fluctuation arises from floating point rounding errors in the calculations. The hazard function of a $\Gamma(a,1)$ distribution, with shape parameter $a$ and scale parameter $1$, equ
53,744
How many AdaBoost iterations?
The answer seems to be that it depends, based on the problem and on how you interpret the AdaBoost algorithm. Mease and Wyner (2008) argue that AdaBoost should be run for a long time, until it converges, and that 1,000 iterations should be enough. The main point of the paper is that the intuition gained from the "Stati...
How many AdaBoost iterations?
The answer seems to be that it depends, based on the problem and on how you interpret the AdaBoost algorithm. Mease and Wyner (2008) argue that AdaBoost should be run for a long time, until it converg
How many AdaBoost iterations? The answer seems to be that it depends, based on the problem and on how you interpret the AdaBoost algorithm. Mease and Wyner (2008) argue that AdaBoost should be run for a long time, until it converges, and that 1,000 iterations should be enough. The main point of the paper is that the in...
How many AdaBoost iterations? The answer seems to be that it depends, based on the problem and on how you interpret the AdaBoost algorithm. Mease and Wyner (2008) argue that AdaBoost should be run for a long time, until it converg
53,745
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem
As you say, the three elements used in MH are the proposal (jumping) probability, the prior probability, and the likelihood. Say that we want to estimate the posterior distribution of a parameter $\Theta$ after observing some data $\mathbf x$, that is, $p(\Theta|\mathbf{x})$. Assume that we know the prior distribution ...
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem
As you say, the three elements used in MH are the proposal (jumping) probability, the prior probability, and the likelihood. Say that we want to estimate the posterior distribution of a parameter $\Th
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem As you say, the three elements used in MH are the proposal (jumping) probability, the prior probability, and the likelihood. Say that we want to estimate the posterior distribution of a parameter $\Theta$ after observing some data $\mathbf ...
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem As you say, the three elements used in MH are the proposal (jumping) probability, the prior probability, and the likelihood. Say that we want to estimate the posterior distribution of a parameter $\Th
53,746
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem
First to explain the MH algorithm, it's used to approximate numerically a target distribution, in this case $p(\theta|D)$. At each stage of the algorithm: A value $\theta_{proposed}$ is proposed using the jumping or proposal distribution. An acceptance ratio is calculated, equal to $\frac{p(\theta_{proposed}|D)}{p(\t...
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem
First to explain the MH algorithm, it's used to approximate numerically a target distribution, in this case $p(\theta|D)$. At each stage of the algorithm: A value $\theta_{proposed}$ is proposed usin
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem First to explain the MH algorithm, it's used to approximate numerically a target distribution, in this case $p(\theta|D)$. At each stage of the algorithm: A value $\theta_{proposed}$ is proposed using the jumping or proposal distribution. ...
Metropolis Hastings Algorithm - Prior vs Proposal vs Numerator of Bayes Theorem First to explain the MH algorithm, it's used to approximate numerically a target distribution, in this case $p(\theta|D)$. At each stage of the algorithm: A value $\theta_{proposed}$ is proposed usin
53,747
The name of 'Fused' Lasso
The term is clearly explained in the abstract of the paper[1] you mention. We propose the ‘fused lasso’, a generalization that is designed for problems with features that can be ordered in some meaningful way. The fused lasso penalizes the $L_1$-norm of both the coefficients and their successive differences. Thus it e...
The name of 'Fused' Lasso
The term is clearly explained in the abstract of the paper[1] you mention. We propose the ‘fused lasso’, a generalization that is designed for problems with features that can be ordered in some meani
The name of 'Fused' Lasso The term is clearly explained in the abstract of the paper[1] you mention. We propose the ‘fused lasso’, a generalization that is designed for problems with features that can be ordered in some meaningful way. The fused lasso penalizes the $L_1$-norm of both the coefficients and their success...
The name of 'Fused' Lasso The term is clearly explained in the abstract of the paper[1] you mention. We propose the ‘fused lasso’, a generalization that is designed for problems with features that can be ordered in some meani
53,748
Best Subset Selection Questions
Question 1 Yes, if we had three variables say (any more would be tedious to write out here) then all models containing 1 predictor would be fitted: $$y_i = \beta_0 + \beta_1 x_{i1} + \varepsilon_i$$ $$y_i = \beta_0 + \beta_1 x_{i2} + \varepsilon_i$$ $$y_i = \beta_0 + \beta_1 x_{i3} + \varepsilon_i$$ Then all combinatio...
Best Subset Selection Questions
Question 1 Yes, if we had three variables say (any more would be tedious to write out here) then all models containing 1 predictor would be fitted: $$y_i = \beta_0 + \beta_1 x_{i1} + \varepsilon_i$$ $
Best Subset Selection Questions Question 1 Yes, if we had three variables say (any more would be tedious to write out here) then all models containing 1 predictor would be fitted: $$y_i = \beta_0 + \beta_1 x_{i1} + \varepsilon_i$$ $$y_i = \beta_0 + \beta_1 x_{i2} + \varepsilon_i$$ $$y_i = \beta_0 + \beta_1 x_{i3} + \va...
Best Subset Selection Questions Question 1 Yes, if we had three variables say (any more would be tedious to write out here) then all models containing 1 predictor would be fitted: $$y_i = \beta_0 + \beta_1 x_{i1} + \varepsilon_i$$ $
53,749
Best Subset Selection Questions
1) Yes. 2) You evaluate by obtaining an estimate of the out of sample error rate for each of your models, and then choosing the model with the optimal estimate of out of sample error. A few common methods for this are cross validation, using a fully held out data set, and some kind of estimate that can be performed on...
Best Subset Selection Questions
1) Yes. 2) You evaluate by obtaining an estimate of the out of sample error rate for each of your models, and then choosing the model with the optimal estimate of out of sample error. A few common me
Best Subset Selection Questions 1) Yes. 2) You evaluate by obtaining an estimate of the out of sample error rate for each of your models, and then choosing the model with the optimal estimate of out of sample error. A few common methods for this are cross validation, using a fully held out data set, and some kind of e...
Best Subset Selection Questions 1) Yes. 2) You evaluate by obtaining an estimate of the out of sample error rate for each of your models, and then choosing the model with the optimal estimate of out of sample error. A few common me
53,750
Finding $b$ such that $e^{5B_t - bt}$ is a martingale
You should apply Ito's lemma: Let $Y_t = 5 B_t - bt$ then $$ M_t = \exp(5 B_t -bt) = \exp(Y_t) $$ thus $$ d\exp(Y_t) = dM_t = M_t dY_t + M_t \frac{1}{2} 25 dt = M_t (5 dB_t - b dt + 12.5 dt). $$ It will be a martingale if the drift terms cancel. Thus if $b = 12.5$.
Finding $b$ such that $e^{5B_t - bt}$ is a martingale
You should apply Ito's lemma: Let $Y_t = 5 B_t - bt$ then $$ M_t = \exp(5 B_t -bt) = \exp(Y_t) $$ thus $$ d\exp(Y_t) = dM_t = M_t dY_t + M_t \frac{1}{2} 25 dt = M_t (5 dB_t - b dt + 12.5 dt). $$ It wi
Finding $b$ such that $e^{5B_t - bt}$ is a martingale You should apply Ito's lemma: Let $Y_t = 5 B_t - bt$ then $$ M_t = \exp(5 B_t -bt) = \exp(Y_t) $$ thus $$ d\exp(Y_t) = dM_t = M_t dY_t + M_t \frac{1}{2} 25 dt = M_t (5 dB_t - b dt + 12.5 dt). $$ It will be a martingale if the drift terms cancel. Thus if $b = 12.5$.
Finding $b$ such that $e^{5B_t - bt}$ is a martingale You should apply Ito's lemma: Let $Y_t = 5 B_t - bt$ then $$ M_t = \exp(5 B_t -bt) = \exp(Y_t) $$ thus $$ d\exp(Y_t) = dM_t = M_t dY_t + M_t \frac{1}{2} 25 dt = M_t (5 dB_t - b dt + 12.5 dt). $$ It wi
53,751
Finding $b$ such that $e^{5B_t - bt}$ is a martingale
You are almost there. Write $bt=bs+b(t-s)$ and think how the second summand relates to $25/2(t-s)$.
Finding $b$ such that $e^{5B_t - bt}$ is a martingale
You are almost there. Write $bt=bs+b(t-s)$ and think how the second summand relates to $25/2(t-s)$.
Finding $b$ such that $e^{5B_t - bt}$ is a martingale You are almost there. Write $bt=bs+b(t-s)$ and think how the second summand relates to $25/2(t-s)$.
Finding $b$ such that $e^{5B_t - bt}$ is a martingale You are almost there. Write $bt=bs+b(t-s)$ and think how the second summand relates to $25/2(t-s)$.
53,752
Approximate mean from .25, .5, .75 percentiles
Without imposing some kind of assumption, we can say almost nothing. It's possible for the population mean to be anything at all - any value on the real line... or possibly infinite, or undefined. If the underlying distribution is symmetric and unimodal and more or less normalish, your formula would do reasonably well,...
Approximate mean from .25, .5, .75 percentiles
Without imposing some kind of assumption, we can say almost nothing. It's possible for the population mean to be anything at all - any value on the real line... or possibly infinite, or undefined. If
Approximate mean from .25, .5, .75 percentiles Without imposing some kind of assumption, we can say almost nothing. It's possible for the population mean to be anything at all - any value on the real line... or possibly infinite, or undefined. If the underlying distribution is symmetric and unimodal and more or less no...
Approximate mean from .25, .5, .75 percentiles Without imposing some kind of assumption, we can say almost nothing. It's possible for the population mean to be anything at all - any value on the real line... or possibly infinite, or undefined. If
53,753
Approximate mean from .25, .5, .75 percentiles
Without knowing anything about the distribution your percentiles are coming from, I do not think you can tell much about the mean. What you can do is regard the three points you have as your data and calculate the weighted mean, which is what your formula describes. I would not consider this measure as the mean of your...
Approximate mean from .25, .5, .75 percentiles
Without knowing anything about the distribution your percentiles are coming from, I do not think you can tell much about the mean. What you can do is regard the three points you have as your data and
Approximate mean from .25, .5, .75 percentiles Without knowing anything about the distribution your percentiles are coming from, I do not think you can tell much about the mean. What you can do is regard the three points you have as your data and calculate the weighted mean, which is what your formula describes. I woul...
Approximate mean from .25, .5, .75 percentiles Without knowing anything about the distribution your percentiles are coming from, I do not think you can tell much about the mean. What you can do is regard the three points you have as your data and
53,754
Advantages of taking the logarithm to minimize the likelihood
Numerical stability is by far the most important reason for using the log-likelihood instead of the likelihood. That reason alone is more than enough to choose the log-likelihood over the likelihood. Another reason that jumps to mind is that if there is an analytical solution then it is often much easier to find with t...
Advantages of taking the logarithm to minimize the likelihood
Numerical stability is by far the most important reason for using the log-likelihood instead of the likelihood. That reason alone is more than enough to choose the log-likelihood over the likelihood.
Advantages of taking the logarithm to minimize the likelihood Numerical stability is by far the most important reason for using the log-likelihood instead of the likelihood. That reason alone is more than enough to choose the log-likelihood over the likelihood. Another reason that jumps to mind is that if there is an a...
Advantages of taking the logarithm to minimize the likelihood Numerical stability is by far the most important reason for using the log-likelihood instead of the likelihood. That reason alone is more than enough to choose the log-likelihood over the likelihood.
53,755
Advantages of taking the logarithm to minimize the likelihood
Gradient descent works (best) when the hessian, ie matrix of second derivatives is orthonormal (up to scaling factor.. Don't remember term) . In other words the error surface is quadratic and same in all directions. Remember the step size is not function of err surface in gradient descent.. If second derivative is ra...
Advantages of taking the logarithm to minimize the likelihood
Gradient descent works (best) when the hessian, ie matrix of second derivatives is orthonormal (up to scaling factor.. Don't remember term) . In other words the error surface is quadratic and same i
Advantages of taking the logarithm to minimize the likelihood Gradient descent works (best) when the hessian, ie matrix of second derivatives is orthonormal (up to scaling factor.. Don't remember term) . In other words the error surface is quadratic and same in all directions. Remember the step size is not function o...
Advantages of taking the logarithm to minimize the likelihood Gradient descent works (best) when the hessian, ie matrix of second derivatives is orthonormal (up to scaling factor.. Don't remember term) . In other words the error surface is quadratic and same i
53,756
Newey-West standard errors when Durbin-Watson test results are fine
First, I would recommend to use a software package that not only reports the Durbin-Watson test statistics but also a p-value. That might give you more of an indication how close or far from 2 the statistic actually is. Furthermore, you may consider other tests for autocorrelation, e.g., Breusch-Godfrey etc. And if the...
Newey-West standard errors when Durbin-Watson test results are fine
First, I would recommend to use a software package that not only reports the Durbin-Watson test statistics but also a p-value. That might give you more of an indication how close or far from 2 the sta
Newey-West standard errors when Durbin-Watson test results are fine First, I would recommend to use a software package that not only reports the Durbin-Watson test statistics but also a p-value. That might give you more of an indication how close or far from 2 the statistic actually is. Furthermore, you may consider ot...
Newey-West standard errors when Durbin-Watson test results are fine First, I would recommend to use a software package that not only reports the Durbin-Watson test statistics but also a p-value. That might give you more of an indication how close or far from 2 the sta
53,757
Variance of slope
For a standard linear regression that meets the normal assumptions, the variances of your parameter estimates can be taken from the variance covariance matrix, $\Sigma$. For example, the variance of the intercept is the first element on the main diagonal, $\Sigma_{11}$. The variance of the slope on $X_1$ is the secon...
Variance of slope
For a standard linear regression that meets the normal assumptions, the variances of your parameter estimates can be taken from the variance covariance matrix, $\Sigma$. For example, the variance of
Variance of slope For a standard linear regression that meets the normal assumptions, the variances of your parameter estimates can be taken from the variance covariance matrix, $\Sigma$. For example, the variance of the intercept is the first element on the main diagonal, $\Sigma_{11}$. The variance of the slope on ...
Variance of slope For a standard linear regression that meets the normal assumptions, the variances of your parameter estimates can be taken from the variance covariance matrix, $\Sigma$. For example, the variance of
53,758
Variance of slope
It's easy to do this for the multiple regression case: \begin{align} \text{Var}((X'X)^{-1}X'y) &= (X'X)^{-1}X'\text{Var}(y)X'(X'X)^{-1} \\ &=(X'X)^{-1}X'(\sigma^2I)X'(X'X)^{-1} \\ &=\sigma^2(X'X)^{-1}X'X'(X'X)^{-1} \\ &=\sigma^2(X'X)^{-1} ...
Variance of slope
It's easy to do this for the multiple regression case: \begin{align} \text{Var}((X'X)^{-1}X'y) &= (X'X)^{-1}X'\text{Var}(y)X'(X'X)^{-1} \\ &=(X'X)^{-1}X'(\sigma^2I)X'(X'X)^{
Variance of slope It's easy to do this for the multiple regression case: \begin{align} \text{Var}((X'X)^{-1}X'y) &= (X'X)^{-1}X'\text{Var}(y)X'(X'X)^{-1} \\ &=(X'X)^{-1}X'(\sigma^2I)X'(X'X)^{-1} \\ &=\sigma^2(X'X)^{-1}X'X'(X'X)^{-1} \\ &=\...
Variance of slope It's easy to do this for the multiple regression case: \begin{align} \text{Var}((X'X)^{-1}X'y) &= (X'X)^{-1}X'\text{Var}(y)X'(X'X)^{-1} \\ &=(X'X)^{-1}X'(\sigma^2I)X'(X'X)^{
53,759
Boosted trees and Variable Interactions
From this tutorial. See section 8 in particular. Look up ?gbm.interactions. First construct your model, named angaus.tc5.lr005 in the tutorial. angaus.tc5.lr005 <- gbm.step(data=Anguilla_train, gbm.x = 3:13, gbm.y = 2, + family = "bernoulli", tree.complexity = 5, + learning.rate = 0.005, bag.fraction = 0.5) Then y...
Boosted trees and Variable Interactions
From this tutorial. See section 8 in particular. Look up ?gbm.interactions. First construct your model, named angaus.tc5.lr005 in the tutorial. angaus.tc5.lr005 <- gbm.step(data=Anguilla_train, gb
Boosted trees and Variable Interactions From this tutorial. See section 8 in particular. Look up ?gbm.interactions. First construct your model, named angaus.tc5.lr005 in the tutorial. angaus.tc5.lr005 <- gbm.step(data=Anguilla_train, gbm.x = 3:13, gbm.y = 2, + family = "bernoulli", tree.complexity = 5, + learning.r...
Boosted trees and Variable Interactions From this tutorial. See section 8 in particular. Look up ?gbm.interactions. First construct your model, named angaus.tc5.lr005 in the tutorial. angaus.tc5.lr005 <- gbm.step(data=Anguilla_train, gb
53,760
Boosted trees and Variable Interactions
Additionally, you might also look at ?interact.gbm from the gbm package which implements Friedman's (2005) approach for detecting interactions. J.H. Friedman and B.E. Popescu (2005). “Predictive Learning via Rule Ensembles.” Section 8.1
Boosted trees and Variable Interactions
Additionally, you might also look at ?interact.gbm from the gbm package which implements Friedman's (2005) approach for detecting interactions. J.H. Friedman and B.E. Popescu (2005). “Predictive Learn
Boosted trees and Variable Interactions Additionally, you might also look at ?interact.gbm from the gbm package which implements Friedman's (2005) approach for detecting interactions. J.H. Friedman and B.E. Popescu (2005). “Predictive Learning via Rule Ensembles.” Section 8.1
Boosted trees and Variable Interactions Additionally, you might also look at ?interact.gbm from the gbm package which implements Friedman's (2005) approach for detecting interactions. J.H. Friedman and B.E. Popescu (2005). “Predictive Learn
53,761
When would you use an I-optimal design over a D-optimal design?
D-optimality is related to the covariance matrix of the parameter estimates, so if you wanted to identify which factors aren't significant (factor screening experiment) it's a natural choice. I-optimality minimizes the average prediction variance of your model over a region of measurement parameters, so it is more nat...
When would you use an I-optimal design over a D-optimal design?
D-optimality is related to the covariance matrix of the parameter estimates, so if you wanted to identify which factors aren't significant (factor screening experiment) it's a natural choice. I-optim
When would you use an I-optimal design over a D-optimal design? D-optimality is related to the covariance matrix of the parameter estimates, so if you wanted to identify which factors aren't significant (factor screening experiment) it's a natural choice. I-optimality minimizes the average prediction variance of your ...
When would you use an I-optimal design over a D-optimal design? D-optimality is related to the covariance matrix of the parameter estimates, so if you wanted to identify which factors aren't significant (factor screening experiment) it's a natural choice. I-optim
53,762
Which distribution to use for a probability problem?
The following analysis illustrates one approach to obtaining a solution. At least it might help show how to work with the Poisson distribution. To answer this question constructively and clearly, let's make a few simplifying assumptions to avoid getting bogged down in details that haven't been described. For instance...
Which distribution to use for a probability problem?
The following analysis illustrates one approach to obtaining a solution. At least it might help show how to work with the Poisson distribution. To answer this question constructively and clearly, let
Which distribution to use for a probability problem? The following analysis illustrates one approach to obtaining a solution. At least it might help show how to work with the Poisson distribution. To answer this question constructively and clearly, let's make a few simplifying assumptions to avoid getting bogged down ...
Which distribution to use for a probability problem? The following analysis illustrates one approach to obtaining a solution. At least it might help show how to work with the Poisson distribution. To answer this question constructively and clearly, let
53,763
Which distribution to use for a probability problem?
Both the Poisson and the binomial distribution can model counts, but they do so differently. You assume that each machine can break down or not at most once each week. That suggests a particular distribution is more appropriate. From this, and your calculations, you believe the right distribution is binom(26, 1/13)...
Which distribution to use for a probability problem?
Both the Poisson and the binomial distribution can model counts, but they do so differently. You assume that each machine can break down or not at most once each week. That suggests a particular dis
Which distribution to use for a probability problem? Both the Poisson and the binomial distribution can model counts, but they do so differently. You assume that each machine can break down or not at most once each week. That suggests a particular distribution is more appropriate. From this, and your calculations, ...
Which distribution to use for a probability problem? Both the Poisson and the binomial distribution can model counts, but they do so differently. You assume that each machine can break down or not at most once each week. That suggests a particular dis
53,764
How to determine the sign of R underlying R-squared?
In multiple regression, $R$ represents the correlation between $\hat{y}$ and $y$, and as such is always non-negative. e.g. see Wikipedia on $R^2$ [...] $R^2$ equals the square of the Pearson correlation coefficient between the observed and modeled (predicted) data values of the dependent variable. In simple regressio...
How to determine the sign of R underlying R-squared?
In multiple regression, $R$ represents the correlation between $\hat{y}$ and $y$, and as such is always non-negative. e.g. see Wikipedia on $R^2$ [...] $R^2$ equals the square of the Pearson correlat
How to determine the sign of R underlying R-squared? In multiple regression, $R$ represents the correlation between $\hat{y}$ and $y$, and as such is always non-negative. e.g. see Wikipedia on $R^2$ [...] $R^2$ equals the square of the Pearson correlation coefficient between the observed and modeled (predicted) data v...
How to determine the sign of R underlying R-squared? In multiple regression, $R$ represents the correlation between $\hat{y}$ and $y$, and as such is always non-negative. e.g. see Wikipedia on $R^2$ [...] $R^2$ equals the square of the Pearson correlat
53,765
How do I generate two correlated Poisson random variables?
Since you do not impose any constraint on the joint distribution, any copula structure gives you a solution. For instance, take a bivariate normal $$(x_1,x_2)\sim\mathcal{N}_2\left((0,0),\left[\matrix{1 &\rho\\\rho &1}\right]\right)$$generation; turn $(x_1,x_2)$ in correlated uniforms as $$(u_1,u_2)=(\Phi(x_1),\Phi(x...
How do I generate two correlated Poisson random variables?
Since you do not impose any constraint on the joint distribution, any copula structure gives you a solution. For instance, take a bivariate normal $$(x_1,x_2)\sim\mathcal{N}_2\left((0,0),\left[\matr
How do I generate two correlated Poisson random variables? Since you do not impose any constraint on the joint distribution, any copula structure gives you a solution. For instance, take a bivariate normal $$(x_1,x_2)\sim\mathcal{N}_2\left((0,0),\left[\matrix{1 &\rho\\\rho &1}\right]\right)$$generation; turn $(x_1,x_...
How do I generate two correlated Poisson random variables? Since you do not impose any constraint on the joint distribution, any copula structure gives you a solution. For instance, take a bivariate normal $$(x_1,x_2)\sim\mathcal{N}_2\left((0,0),\left[\matr
53,766
Difference between ANOVA and permutation test
Randomization techniques might be more powerful than ANOVA in some circumstances, but not necessarily. See "Comparative Power Of The Anova, Randomization Anova, And Kruskal-Wallis Test" . Randomization techniques are usually more powerful than non-parametric rank transformation tests like Kruskal Wallis. See Adams a...
Difference between ANOVA and permutation test
Randomization techniques might be more powerful than ANOVA in some circumstances, but not necessarily. See "Comparative Power Of The Anova, Randomization Anova, And Kruskal-Wallis Test" . Randomizat
Difference between ANOVA and permutation test Randomization techniques might be more powerful than ANOVA in some circumstances, but not necessarily. See "Comparative Power Of The Anova, Randomization Anova, And Kruskal-Wallis Test" . Randomization techniques are usually more powerful than non-parametric rank transfor...
Difference between ANOVA and permutation test Randomization techniques might be more powerful than ANOVA in some circumstances, but not necessarily. See "Comparative Power Of The Anova, Randomization Anova, And Kruskal-Wallis Test" . Randomizat
53,767
Difference between ANOVA and permutation test
I have read that permutation test is preferred to use when sample size is relatively small and when ANOVA fails to capture the difference due to this fact. I see several difficulties with this statement, of which I'll mention a few: how can you tell if it's "due to this fact" rather than due to something else? if s...
Difference between ANOVA and permutation test
I have read that permutation test is preferred to use when sample size is relatively small and when ANOVA fails to capture the difference due to this fact. I see several difficulties with this state
Difference between ANOVA and permutation test I have read that permutation test is preferred to use when sample size is relatively small and when ANOVA fails to capture the difference due to this fact. I see several difficulties with this statement, of which I'll mention a few: how can you tell if it's "due to this ...
Difference between ANOVA and permutation test I have read that permutation test is preferred to use when sample size is relatively small and when ANOVA fails to capture the difference due to this fact. I see several difficulties with this state
53,768
K-means++ algorithm
Here is my code, in Mathematica: data = {{7, 1}, {3, 4}, {1, 5}, {5, 8}, {1, 3}, {7, 8}, {8, 2}, {5, 9}, {8, 0}}; centers = {}; RelativeWeights = Table[1/Length[data], {Length[data]}]; Table[ centers = Union[RandomChoice[RelativeWeights -> data , 1], centers]; data = Complement[data, centers]; RelativeWeights...
K-means++ algorithm
Here is my code, in Mathematica: data = {{7, 1}, {3, 4}, {1, 5}, {5, 8}, {1, 3}, {7, 8}, {8, 2}, {5, 9}, {8, 0}}; centers = {}; RelativeWeights = Table[1/Length[data], {Length[data]}]; Table[ center
K-means++ algorithm Here is my code, in Mathematica: data = {{7, 1}, {3, 4}, {1, 5}, {5, 8}, {1, 3}, {7, 8}, {8, 2}, {5, 9}, {8, 0}}; centers = {}; RelativeWeights = Table[1/Length[data], {Length[data]}]; Table[ centers = Union[RandomChoice[RelativeWeights -> data , 1], centers]; data = Complement[data, centers...
K-means++ algorithm Here is my code, in Mathematica: data = {{7, 1}, {3, 4}, {1, 5}, {5, 8}, {1, 3}, {7, 8}, {8, 2}, {5, 9}, {8, 0}}; centers = {}; RelativeWeights = Table[1/Length[data], {Length[data]}]; Table[ center
53,769
K-means++ algorithm
For step 3, Choose one new data point at random as a new center, using a weighted probability distribution where a point x is chosen with probability proportional to $D(x)^2$. Compute all the $D(x)^2$ values and convert them to an array of cumulative sums. That way each item is represented by a range proportiona...
K-means++ algorithm
For step 3, Choose one new data point at random as a new center, using a weighted probability distribution where a point x is chosen with probability proportional to $D(x)^2$. Compute all the $
K-means++ algorithm For step 3, Choose one new data point at random as a new center, using a weighted probability distribution where a point x is chosen with probability proportional to $D(x)^2$. Compute all the $D(x)^2$ values and convert them to an array of cumulative sums. That way each item is represented by...
K-means++ algorithm For step 3, Choose one new data point at random as a new center, using a weighted probability distribution where a point x is chosen with probability proportional to $D(x)^2$. Compute all the $
53,770
Kendall's tau for Clayton Copula
As pointed out by @whuber, the expression for the Copula is $$C(u,v) = \big[\max \{u^{-\theta}+v^{-\theta}-1,\;0\}\big]^{-1/\theta} , \;\;\theta \in [-1,\infty), \theta\neq 0 $$ When $\theta >0 \Rightarrow u^{-\theta}+v^{-\theta}-1>0$ for the whole joint support, and we can "ignore" the $\max$ operator. But when $\thet...
Kendall's tau for Clayton Copula
As pointed out by @whuber, the expression for the Copula is $$C(u,v) = \big[\max \{u^{-\theta}+v^{-\theta}-1,\;0\}\big]^{-1/\theta} , \;\;\theta \in [-1,\infty), \theta\neq 0 $$ When $\theta >0 \Right
Kendall's tau for Clayton Copula As pointed out by @whuber, the expression for the Copula is $$C(u,v) = \big[\max \{u^{-\theta}+v^{-\theta}-1,\;0\}\big]^{-1/\theta} , \;\;\theta \in [-1,\infty), \theta\neq 0 $$ When $\theta >0 \Rightarrow u^{-\theta}+v^{-\theta}-1>0$ for the whole joint support, and we can "ignore" the...
Kendall's tau for Clayton Copula As pointed out by @whuber, the expression for the Copula is $$C(u,v) = \big[\max \{u^{-\theta}+v^{-\theta}-1,\;0\}\big]^{-1/\theta} , \;\;\theta \in [-1,\infty), \theta\neq 0 $$ When $\theta >0 \Right
53,771
Density plot of parameter estimates from linear regression model
You also could use bootstrap estimates. library(boot) f <- function(data, d) coef(lm(Sepal.Length ~ Petal.Length+Petal.Width , data=data[d,])) boot.fit <- boot(iris, f, 1000) Now, estimating the density for the Petal.Length coefficient as an example: petal.density <- density(boot.fit$t[,2]) plot(petal.density, main =...
Density plot of parameter estimates from linear regression model
You also could use bootstrap estimates. library(boot) f <- function(data, d) coef(lm(Sepal.Length ~ Petal.Length+Petal.Width , data=data[d,])) boot.fit <- boot(iris, f, 1000) Now, estimating the den
Density plot of parameter estimates from linear regression model You also could use bootstrap estimates. library(boot) f <- function(data, d) coef(lm(Sepal.Length ~ Petal.Length+Petal.Width , data=data[d,])) boot.fit <- boot(iris, f, 1000) Now, estimating the density for the Petal.Length coefficient as an example: pe...
Density plot of parameter estimates from linear regression model You also could use bootstrap estimates. library(boot) f <- function(data, d) coef(lm(Sepal.Length ~ Petal.Length+Petal.Width , data=data[d,])) boot.fit <- boot(iris, f, 1000) Now, estimating the den
53,772
Density plot of parameter estimates from linear regression model
Under usual conditions the parameter estimates end up being asymptotically normal. You can find the proof in any econometrics textbook. Additionally, if your errors are normal, then parameters would be normal even in small samples. So, assuming that the parameter estimates are normal, you can graph them with any plotti...
Density plot of parameter estimates from linear regression model
Under usual conditions the parameter estimates end up being asymptotically normal. You can find the proof in any econometrics textbook. Additionally, if your errors are normal, then parameters would b
Density plot of parameter estimates from linear regression model Under usual conditions the parameter estimates end up being asymptotically normal. You can find the proof in any econometrics textbook. Additionally, if your errors are normal, then parameters would be normal even in small samples. So, assuming that the p...
Density plot of parameter estimates from linear regression model Under usual conditions the parameter estimates end up being asymptotically normal. You can find the proof in any econometrics textbook. Additionally, if your errors are normal, then parameters would b
53,773
$R^2$ of linear regression with no variation in the response variable
The following plots are accompanied by their Pearson product-moment correlation coefficients (image credit): If the points lie exactly on an upwards sloping line then the Pearson correlation is +1, if they lie exactly on a downwards sloping line the correlation is -1. But notice that the horizontal line has an undefin...
$R^2$ of linear regression with no variation in the response variable
The following plots are accompanied by their Pearson product-moment correlation coefficients (image credit): If the points lie exactly on an upwards sloping line then the Pearson correlation is +1, i
$R^2$ of linear regression with no variation in the response variable The following plots are accompanied by their Pearson product-moment correlation coefficients (image credit): If the points lie exactly on an upwards sloping line then the Pearson correlation is +1, if they lie exactly on a downwards sloping line the...
$R^2$ of linear regression with no variation in the response variable The following plots are accompanied by their Pearson product-moment correlation coefficients (image credit): If the points lie exactly on an upwards sloping line then the Pearson correlation is +1, i
53,774
$R^2$ of linear regression with no variation in the response variable
As $R^2$ is "variance explained", then as $0 = 0 + 0 \times x$ has variance of 0, the same as variance of $y$, so we could think of it as 100% variance explained, i.e. $R^2 = 1$. On another hand, as you notice $0/0$ is indeterminate and does not make sense, as this model does not either. As goangit mentioned, this kind...
$R^2$ of linear regression with no variation in the response variable
As $R^2$ is "variance explained", then as $0 = 0 + 0 \times x$ has variance of 0, the same as variance of $y$, so we could think of it as 100% variance explained, i.e. $R^2 = 1$. On another hand, as y
$R^2$ of linear regression with no variation in the response variable As $R^2$ is "variance explained", then as $0 = 0 + 0 \times x$ has variance of 0, the same as variance of $y$, so we could think of it as 100% variance explained, i.e. $R^2 = 1$. On another hand, as you notice $0/0$ is indeterminate and does not make...
$R^2$ of linear regression with no variation in the response variable As $R^2$ is "variance explained", then as $0 = 0 + 0 \times x$ has variance of 0, the same as variance of $y$, so we could think of it as 100% variance explained, i.e. $R^2 = 1$. On another hand, as y
53,775
$R^2$ of linear regression with no variation in the response variable
For the General Linear Model to be suitable the data need to meet certain criteria: The mean response is a linear function of the predictors. Model residuals are conditionally independent. Model residuals are distributed with conditional mean zero. Model residuals have constant conditional variance. Model residuals a...
$R^2$ of linear regression with no variation in the response variable
For the General Linear Model to be suitable the data need to meet certain criteria: The mean response is a linear function of the predictors. Model residuals are conditionally independent. Model res
$R^2$ of linear regression with no variation in the response variable For the General Linear Model to be suitable the data need to meet certain criteria: The mean response is a linear function of the predictors. Model residuals are conditionally independent. Model residuals are distributed with conditional mean zero....
$R^2$ of linear regression with no variation in the response variable For the General Linear Model to be suitable the data need to meet certain criteria: The mean response is a linear function of the predictors. Model residuals are conditionally independent. Model res
53,776
Robust estimates of the covariance matrix in the big data space
First of all, it is important to point out that, most likely, you will be using the FastMCD[0] or FastMVE[1,p199] algorithms which are random approximations to the actual MCD and MVE estimators. The quality (and specifically, the actual robustness to outliers) of these approximations as well as the computational effor...
Robust estimates of the covariance matrix in the big data space
First of all, it is important to point out that, most likely, you will be using the FastMCD[0] or FastMVE[1,p199] algorithms which are random approximations to the actual MCD and MVE estimators. The
Robust estimates of the covariance matrix in the big data space First of all, it is important to point out that, most likely, you will be using the FastMCD[0] or FastMVE[1,p199] algorithms which are random approximations to the actual MCD and MVE estimators. The quality (and specifically, the actual robustness to outl...
Robust estimates of the covariance matrix in the big data space First of all, it is important to point out that, most likely, you will be using the FastMCD[0] or FastMVE[1,p199] algorithms which are random approximations to the actual MCD and MVE estimators. The
53,777
Problem obtaining a marginal from the joint distribution
Draw pictures of the regions of integration. The region where $0 \le x_1 \le 1, 0 \le x_2 \le 1,$ and $x_1 x_2 \le y$ (for $0 \le y \le 1$) looks like the shaded part of The colors denote the varying values of the density $f(x_1,x_2)$, ranging from blue (low) to red (high). The integral of $f(x_1,x_2)dx_1 dx_2 = 4 x_1...
Problem obtaining a marginal from the joint distribution
Draw pictures of the regions of integration. The region where $0 \le x_1 \le 1, 0 \le x_2 \le 1,$ and $x_1 x_2 \le y$ (for $0 \le y \le 1$) looks like the shaded part of The colors denote the varying
Problem obtaining a marginal from the joint distribution Draw pictures of the regions of integration. The region where $0 \le x_1 \le 1, 0 \le x_2 \le 1,$ and $x_1 x_2 \le y$ (for $0 \le y \le 1$) looks like the shaded part of The colors denote the varying values of the density $f(x_1,x_2)$, ranging from blue (low) to...
Problem obtaining a marginal from the joint distribution Draw pictures of the regions of integration. The region where $0 \le x_1 \le 1, 0 \le x_2 \le 1,$ and $x_1 x_2 \le y$ (for $0 \le y \le 1$) looks like the shaded part of The colors denote the varying
53,778
Problem obtaining a marginal from the joint distribution
Just to add visual input, it is easily found that $$F_X(x_i) = x_i^2$$ and since for $U_i \sim U(0,1)$ $$F^{-1}(U_i) = X_i \Rightarrow X_i = \sqrt{U_i}$$ the $X's$ are the square roots of uniform RV's in $(0,1)$. They are also independent.So simulate two uniforms, and then take their product. The resulting empirical re...
Problem obtaining a marginal from the joint distribution
Just to add visual input, it is easily found that $$F_X(x_i) = x_i^2$$ and since for $U_i \sim U(0,1)$ $$F^{-1}(U_i) = X_i \Rightarrow X_i = \sqrt{U_i}$$ the $X's$ are the square roots of uniform RV's
Problem obtaining a marginal from the joint distribution Just to add visual input, it is easily found that $$F_X(x_i) = x_i^2$$ and since for $U_i \sim U(0,1)$ $$F^{-1}(U_i) = X_i \Rightarrow X_i = \sqrt{U_i}$$ the $X's$ are the square roots of uniform RV's in $(0,1)$. They are also independent.So simulate two uniforms...
Problem obtaining a marginal from the joint distribution Just to add visual input, it is easily found that $$F_X(x_i) = x_i^2$$ and since for $U_i \sim U(0,1)$ $$F^{-1}(U_i) = X_i \Rightarrow X_i = \sqrt{U_i}$$ the $X's$ are the square roots of uniform RV's
53,779
Sample $R^2$ consistent?
As whuber noted, consistency of the $\widehat{R^2}$ should be first examined under the assumption of correct specification, as we usually do with all estimators. It is a separate matter to examine what happens to consistency under misspecification, i.e. under the inclusion of irrelevant variables or the exclusion of re...
Sample $R^2$ consistent?
As whuber noted, consistency of the $\widehat{R^2}$ should be first examined under the assumption of correct specification, as we usually do with all estimators. It is a separate matter to examine wha
Sample $R^2$ consistent? As whuber noted, consistency of the $\widehat{R^2}$ should be first examined under the assumption of correct specification, as we usually do with all estimators. It is a separate matter to examine what happens to consistency under misspecification, i.e. under the inclusion of irrelevant variabl...
Sample $R^2$ consistent? As whuber noted, consistency of the $\widehat{R^2}$ should be first examined under the assumption of correct specification, as we usually do with all estimators. It is a separate matter to examine wha
53,780
Help for Binomial Distribution question
What you are looking for is the probability generating function. This functions allows you to plug in the values given in your exercise and calculate the probabilities needed. A nice derivation of the probability generating function of the binomial distribution can be found under http://economictheoryblog.com/2012/10/...
Help for Binomial Distribution question
What you are looking for is the probability generating function. This functions allows you to plug in the values given in your exercise and calculate the probabilities needed. A nice derivation of the
Help for Binomial Distribution question What you are looking for is the probability generating function. This functions allows you to plug in the values given in your exercise and calculate the probabilities needed. A nice derivation of the probability generating function of the binomial distribution can be found under...
Help for Binomial Distribution question What you are looking for is the probability generating function. This functions allows you to plug in the values given in your exercise and calculate the probabilities needed. A nice derivation of the
53,781
Help for Binomial Distribution question
A binomial distribution models the number of positive outcomes in a number of independent true or false events (Bernoulli events) that each have the same probability of being true. You should ask yourself: for the four individuals being tested, does each person have the same probability of testing positive? If you have...
Help for Binomial Distribution question
A binomial distribution models the number of positive outcomes in a number of independent true or false events (Bernoulli events) that each have the same probability of being true. You should ask your
Help for Binomial Distribution question A binomial distribution models the number of positive outcomes in a number of independent true or false events (Bernoulli events) that each have the same probability of being true. You should ask yourself: for the four individuals being tested, does each person have the same prob...
Help for Binomial Distribution question A binomial distribution models the number of positive outcomes in a number of independent true or false events (Bernoulli events) that each have the same probability of being true. You should ask your
53,782
Obtaining an estimator via Rao-Blackwell theorem
We have $$F_X(x) = \int_{\theta}^{x}e^{\theta -t} dt = -e^{\theta}e^{-t}\Big|^{x}_{\theta} = 1 - e^{\theta -x} $$ Since $F_{X_{(1)}}(x_{(1)}) = 1 -[1-F_X(x_{(1)})]^{n}$, the density function of the minimum order statistic is $$f_{X_{(1)}}(x_{(1)}) = nf_X(x_{(1)})[1-F_X(x_{(1)})]^{n-1}I(x)_{(\theta, \infty)} = ne^{\the...
Obtaining an estimator via Rao-Blackwell theorem
We have $$F_X(x) = \int_{\theta}^{x}e^{\theta -t} dt = -e^{\theta}e^{-t}\Big|^{x}_{\theta} = 1 - e^{\theta -x} $$ Since $F_{X_{(1)}}(x_{(1)}) = 1 -[1-F_X(x_{(1)})]^{n}$, the density function of the m
Obtaining an estimator via Rao-Blackwell theorem We have $$F_X(x) = \int_{\theta}^{x}e^{\theta -t} dt = -e^{\theta}e^{-t}\Big|^{x}_{\theta} = 1 - e^{\theta -x} $$ Since $F_{X_{(1)}}(x_{(1)}) = 1 -[1-F_X(x_{(1)})]^{n}$, the density function of the minimum order statistic is $$f_{X_{(1)}}(x_{(1)}) = nf_X(x_{(1)})[1-F_X(...
Obtaining an estimator via Rao-Blackwell theorem We have $$F_X(x) = \int_{\theta}^{x}e^{\theta -t} dt = -e^{\theta}e^{-t}\Big|^{x}_{\theta} = 1 - e^{\theta -x} $$ Since $F_{X_{(1)}}(x_{(1)}) = 1 -[1-F_X(x_{(1)})]^{n}$, the density function of the m
53,783
Obtaining an estimator via Rao-Blackwell theorem
The fact is that Alecos' answer is the easiest way to handle the problem, but the problem can be solved via Rao-Blackwell as well. Start with the joint density $$f(x_1,..., x_n | \theta) = e^{-\sum x_i + n\theta}\prod{I_{\theta < x_i}(x_i)}. $$ We know that $X_{[1]}$ is a sufficient statistic, so this factors as $$f(x...
Obtaining an estimator via Rao-Blackwell theorem
The fact is that Alecos' answer is the easiest way to handle the problem, but the problem can be solved via Rao-Blackwell as well. Start with the joint density $$f(x_1,..., x_n | \theta) = e^{-\sum x
Obtaining an estimator via Rao-Blackwell theorem The fact is that Alecos' answer is the easiest way to handle the problem, but the problem can be solved via Rao-Blackwell as well. Start with the joint density $$f(x_1,..., x_n | \theta) = e^{-\sum x_i + n\theta}\prod{I_{\theta < x_i}(x_i)}. $$ We know that $X_{[1]}$ is...
Obtaining an estimator via Rao-Blackwell theorem The fact is that Alecos' answer is the easiest way to handle the problem, but the problem can be solved via Rao-Blackwell as well. Start with the joint density $$f(x_1,..., x_n | \theta) = e^{-\sum x
53,784
Analytic or sample standard deviation with binomial data
"Better" depends on context and purpose. Before addressing this issue, though, let's consider the data. As a point of departure we might assume--hypothetically, being willing and happy to be proven wrong later in the analysis--that the outcomes of each subject's attempt at the task are independent. This permits us to...
Analytic or sample standard deviation with binomial data
"Better" depends on context and purpose. Before addressing this issue, though, let's consider the data. As a point of departure we might assume--hypothetically, being willing and happy to be proven w
Analytic or sample standard deviation with binomial data "Better" depends on context and purpose. Before addressing this issue, though, let's consider the data. As a point of departure we might assume--hypothetically, being willing and happy to be proven wrong later in the analysis--that the outcomes of each subject's...
Analytic or sample standard deviation with binomial data "Better" depends on context and purpose. Before addressing this issue, though, let's consider the data. As a point of departure we might assume--hypothetically, being willing and happy to be proven w
53,785
Analytic or sample standard deviation with binomial data
I've been looking for recommendations on whether it's better to use the sample standard deviation (SD) for a binomial distribution or use the analytic SD (or variance). If it was an iid sample actually from a binomial distribution ... the MLE would be the usual analytic one; as such, at least in large samples, that's...
Analytic or sample standard deviation with binomial data
I've been looking for recommendations on whether it's better to use the sample standard deviation (SD) for a binomial distribution or use the analytic SD (or variance). If it was an iid sample actua
Analytic or sample standard deviation with binomial data I've been looking for recommendations on whether it's better to use the sample standard deviation (SD) for a binomial distribution or use the analytic SD (or variance). If it was an iid sample actually from a binomial distribution ... the MLE would be the usual...
Analytic or sample standard deviation with binomial data I've been looking for recommendations on whether it's better to use the sample standard deviation (SD) for a binomial distribution or use the analytic SD (or variance). If it was an iid sample actua
53,786
Analytic or sample standard deviation with binomial data
reporting the central tendency and variability of a sample is a good thing to do You report the central tendency with the mean accuracy. The question is, what should you use for the variability? Note that your "analytical SD" only depends on the mean accuracy (and the number of tests) -- it thus can't give more infor...
Analytic or sample standard deviation with binomial data
reporting the central tendency and variability of a sample is a good thing to do You report the central tendency with the mean accuracy. The question is, what should you use for the variability? Not
Analytic or sample standard deviation with binomial data reporting the central tendency and variability of a sample is a good thing to do You report the central tendency with the mean accuracy. The question is, what should you use for the variability? Note that your "analytical SD" only depends on the mean accuracy (...
Analytic or sample standard deviation with binomial data reporting the central tendency and variability of a sample is a good thing to do You report the central tendency with the mean accuracy. The question is, what should you use for the variability? Not
53,787
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)?
Independence is more like a best-case assumption than a worst-case assumption. Loosely, when data are independent, each datum contains as much information as possible. If data were dependent, because their values can be predicted from other data, each additional datum must have less new information to contribute (the...
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)?
Independence is more like a best-case assumption than a worst-case assumption. Loosely, when data are independent, each datum contains as much information as possible. If data were dependent, becaus
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)? Independence is more like a best-case assumption than a worst-case assumption. Loosely, when data are independent, each datum contains as much information as possible. If data were dependent, because their values can be predicted from o...
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)? Independence is more like a best-case assumption than a worst-case assumption. Loosely, when data are independent, each datum contains as much information as possible. If data were dependent, becaus
53,788
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)?
Gung is incorrect that Dunn-Sidak should be used under independence and Bonferroni must be used under dependence. In fact, Dunn-Sidak controls the FWER not only under independence, but also under positive dependence. And Bonferroni controls the FWER for any dependence structure--including independence. To answer your q...
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)?
Gung is incorrect that Dunn-Sidak should be used under independence and Bonferroni must be used under dependence. In fact, Dunn-Sidak controls the FWER not only under independence, but also under posi
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)? Gung is incorrect that Dunn-Sidak should be used under independence and Bonferroni must be used under dependence. In fact, Dunn-Sidak controls the FWER not only under independence, but also under positive dependence. And Bonferroni contro...
What is the intuition for dependence assumption in Benjamini and Hochberg (1995)? Gung is incorrect that Dunn-Sidak should be used under independence and Bonferroni must be used under dependence. In fact, Dunn-Sidak controls the FWER not only under independence, but also under posi
53,789
importance of predictor variables in multiple linear regression
If you are using R you can use the caret package which has a built in method to give variable importance. See this link (http://caret.r-forge.r-project.org/varimp.html) You basically will just have to do varImp(mod, scale = FALSE)
importance of predictor variables in multiple linear regression
If you are using R you can use the caret package which has a built in method to give variable importance. See this link (http://caret.r-forge.r-project.org/varimp.html) You basically will just have to
importance of predictor variables in multiple linear regression If you are using R you can use the caret package which has a built in method to give variable importance. See this link (http://caret.r-forge.r-project.org/varimp.html) You basically will just have to do varImp(mod, scale = FALSE)
importance of predictor variables in multiple linear regression If you are using R you can use the caret package which has a built in method to give variable importance. See this link (http://caret.r-forge.r-project.org/varimp.html) You basically will just have to
53,790
Pull out most important variables from PCA
The "most important" principal component is usually considered to be the one with the largest eigenvalue. If your package works in the usual way this should be the first principal component, PC1. To see how important each component is, divide the eigenvalues by the number of variables you are decomposing. This tells yo...
Pull out most important variables from PCA
The "most important" principal component is usually considered to be the one with the largest eigenvalue. If your package works in the usual way this should be the first principal component, PC1. To s
Pull out most important variables from PCA The "most important" principal component is usually considered to be the one with the largest eigenvalue. If your package works in the usual way this should be the first principal component, PC1. To see how important each component is, divide the eigenvalues by the number of v...
Pull out most important variables from PCA The "most important" principal component is usually considered to be the one with the largest eigenvalue. If your package works in the usual way this should be the first principal component, PC1. To s
53,791
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed]
R's factor() command is just a shortcut to having to manually create the indicator variables for each (except one) value of a categorical variable. Since you are starting with indicator variables, you don't need to do anything.
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed]
R's factor() command is just a shortcut to having to manually create the indicator variables for each (except one) value of a categorical variable. Since you are starting with indicator variables, you
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed] R's factor() command is just a shortcut to having to manually create the indicator variables for each (except one) value of a categorical variable. Since you are starting with indicator variables, you don't need to do anything...
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed] R's factor() command is just a shortcut to having to manually create the indicator variables for each (except one) value of a categorical variable. Since you are starting with indicator variables, you
53,792
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed]
But be careful if the values you mentioned are your output values. If you use for example the caret package, which describes itself as "a set of functions that attempt to streamline the process for creating predictive models." So it is basically a layer on top of many different machine learning packages in R. If you u...
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed]
But be careful if the values you mentioned are your output values. If you use for example the caret package, which describes itself as "a set of functions that attempt to streamline the process for cr
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed] But be careful if the values you mentioned are your output values. If you use for example the caret package, which describes itself as "a set of functions that attempt to streamline the process for creating predictive models."...
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed] But be careful if the values you mentioned are your output values. If you use for example the caret package, which describes itself as "a set of functions that attempt to streamline the process for cr
53,793
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed]
Take a look at the R ade4 package's dudi.mix and dudi.hillsmith functions. These are natural extensions of PCA for mixed numerical and categorical data. You'll get different (better!) results using these functions if you first convert an integer column containing a categorical variable into a factor. From the docume...
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed]
Take a look at the R ade4 package's dudi.mix and dudi.hillsmith functions. These are natural extensions of PCA for mixed numerical and categorical data. You'll get different (better!) results using
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed] Take a look at the R ade4 package's dudi.mix and dudi.hillsmith functions. These are natural extensions of PCA for mixed numerical and categorical data. You'll get different (better!) results using these functions if you fir...
Is it important in R to convert “integer” variables (with 0 or 1 values) to factors? [closed] Take a look at the R ade4 package's dudi.mix and dudi.hillsmith functions. These are natural extensions of PCA for mixed numerical and categorical data. You'll get different (better!) results using
53,794
cubic relationship after linear relationship
While you don't specify, I assume you mean the model to be both continuous and smooth at the join. Such a model might be called a semi-natural cubic spline (natural on one side, ordinary on the other). You can build one by having a linear predictor and a cubic-spline basis function of the form $(x-k)_+^3$ where $k$ is ...
cubic relationship after linear relationship
While you don't specify, I assume you mean the model to be both continuous and smooth at the join. Such a model might be called a semi-natural cubic spline (natural on one side, ordinary on the other)
cubic relationship after linear relationship While you don't specify, I assume you mean the model to be both continuous and smooth at the join. Such a model might be called a semi-natural cubic spline (natural on one side, ordinary on the other). You can build one by having a linear predictor and a cubic-spline basis f...
cubic relationship after linear relationship While you don't specify, I assume you mean the model to be both continuous and smooth at the join. Such a model might be called a semi-natural cubic spline (natural on one side, ordinary on the other)
53,795
cubic relationship after linear relationship
Of course you could always include the sought point into your optimization problem, which then, however, will become non-linear in general and thus more difficult to solve than the normal linear regression problem. I think one standard approach is to assign a set of points before the calculation and then use piecewiese...
cubic relationship after linear relationship
Of course you could always include the sought point into your optimization problem, which then, however, will become non-linear in general and thus more difficult to solve than the normal linear regre
cubic relationship after linear relationship Of course you could always include the sought point into your optimization problem, which then, however, will become non-linear in general and thus more difficult to solve than the normal linear regression problem. I think one standard approach is to assign a set of points b...
cubic relationship after linear relationship Of course you could always include the sought point into your optimization problem, which then, however, will become non-linear in general and thus more difficult to solve than the normal linear regre
53,796
How to code binary (0/1) predictor variables in regression? Numeric versus factor
In linear regression, if they are independent variables and 1 and 0 are the only possible outcomes, then either way is fine. Modeled as binary, but specified it as if it's continuous (data and syntax are of Stata 12): . sysuse auto . reg mpg foreign Source | SS df MS Number of obs ...
How to code binary (0/1) predictor variables in regression? Numeric versus factor
In linear regression, if they are independent variables and 1 and 0 are the only possible outcomes, then either way is fine. Modeled as binary, but specified it as if it's continuous (data and syntax
How to code binary (0/1) predictor variables in regression? Numeric versus factor In linear regression, if they are independent variables and 1 and 0 are the only possible outcomes, then either way is fine. Modeled as binary, but specified it as if it's continuous (data and syntax are of Stata 12): . sysuse auto . reg ...
How to code binary (0/1) predictor variables in regression? Numeric versus factor In linear regression, if they are independent variables and 1 and 0 are the only possible outcomes, then either way is fine. Modeled as binary, but specified it as if it's continuous (data and syntax
53,797
How to code binary (0/1) predictor variables in regression? Numeric versus factor
In R, it doesn't matter if they are factors or numeric variables. But be sure to indicate that you're doing a logistic regression by indicating family=binomial in, for example, a general linear model or mixed effects model. Without indicating this, the assumed variance of the distribution will differ. In a binomial fam...
How to code binary (0/1) predictor variables in regression? Numeric versus factor
In R, it doesn't matter if they are factors or numeric variables. But be sure to indicate that you're doing a logistic regression by indicating family=binomial in, for example, a general linear model
How to code binary (0/1) predictor variables in regression? Numeric versus factor In R, it doesn't matter if they are factors or numeric variables. But be sure to indicate that you're doing a logistic regression by indicating family=binomial in, for example, a general linear model or mixed effects model. Without indica...
How to code binary (0/1) predictor variables in regression? Numeric versus factor In R, it doesn't matter if they are factors or numeric variables. But be sure to indicate that you're doing a logistic regression by indicating family=binomial in, for example, a general linear model
53,798
Adding interactions to logistic regression leads to high SEs
As @NickStauner and you have surmised, this is due to separation. It is always worth looking at your data! When your data are binary, this is less obvious, but you can see a lot with table(). For example, another problem that causes SEs to expand is multicollinearity (which we think of with continuous variables, but...
Adding interactions to logistic regression leads to high SEs
As @NickStauner and you have surmised, this is due to separation. It is always worth looking at your data! When your data are binary, this is less obvious, but you can see a lot with table(). For e
Adding interactions to logistic regression leads to high SEs As @NickStauner and you have surmised, this is due to separation. It is always worth looking at your data! When your data are binary, this is less obvious, but you can see a lot with table(). For example, another problem that causes SEs to expand is multic...
Adding interactions to logistic regression leads to high SEs As @NickStauner and you have surmised, this is due to separation. It is always worth looking at your data! When your data are binary, this is less obvious, but you can see a lot with table(). For e
53,799
Adding interactions to logistic regression leads to high SEs
Sure enough, you have "perfect" prediction with the interaction term; subset(my.data,A==1&B=='no') yields all 1s for X. The Bayesian alternative you've already chosen is one way to go in handling this. As Avitus and Scortchi have suggested, Firth's (1993) method of penalizing the model to reduce bias is another. Here's...
Adding interactions to logistic regression leads to high SEs
Sure enough, you have "perfect" prediction with the interaction term; subset(my.data,A==1&B=='no') yields all 1s for X. The Bayesian alternative you've already chosen is one way to go in handling this
Adding interactions to logistic regression leads to high SEs Sure enough, you have "perfect" prediction with the interaction term; subset(my.data,A==1&B=='no') yields all 1s for X. The Bayesian alternative you've already chosen is one way to go in handling this. As Avitus and Scortchi have suggested, Firth's (1993) met...
Adding interactions to logistic regression leads to high SEs Sure enough, you have "perfect" prediction with the interaction term; subset(my.data,A==1&B=='no') yields all 1s for X. The Bayesian alternative you've already chosen is one way to go in handling this
53,800
Why do the 95% confidence limits in ARIMA models widen at the forecasts?
Think of ARIMA as ARMA on the differences. For instance, if you have a variable $y_t$, then ARIMA model would be similar to a ARMA on $\Delta y_t=y_t-y_{t-1}$. Next, when you forecast $y_{t+h}=y_t+\sum_{i=1}^h\Delta y_{t+i}$, since $Var[\Delta y_{t+h}]=\sigma^2$, the sum will grow and the forecast confidence will too: ...
Why do the 95% confidence limits in ARIMA models widen at the forecasts?
Think of ARIMA as ARMA on the differences. For instance, if you have a variable $y_t$, then ARIMA model would be similar to a ARMA on $\Delta y_t=y_t-y_{t-1}$. Next, when you forecast $y_{t+h}=y_t+\su
Why do the 95% confidence limits in ARIMA models widen at the forecasts? Think of ARIMA as ARMA on the differences. For instance, if you have a variable $y_t$, then ARIMA model would be similar to a ARMA on $\Delta y_t=y_t-y_{t-1}$. Next, when you forecast $y_{t+h}=y_t+\sum_{i=1}^h\Delta y_{t+i}$, since $Var[\Delta y_{...
Why do the 95% confidence limits in ARIMA models widen at the forecasts? Think of ARIMA as ARMA on the differences. For instance, if you have a variable $y_t$, then ARIMA model would be similar to a ARMA on $\Delta y_t=y_t-y_{t-1}$. Next, when you forecast $y_{t+h}=y_t+\su