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 |
|---|---|---|---|---|---|---|
45,201 | Math behind applying elastic net penalties to logistic regression | Yes, the penalties are simply added to the cost function (and negative/positive depending on whether you minimize or maximize the function).
You can view penalty terms in a cost function (e.g. costfunction like the likelihood) as being equivalent to the Lagrange multiplier equivalent of a problem like
$${\text{maximize... | Math behind applying elastic net penalties to logistic regression | Yes, the penalties are simply added to the cost function (and negative/positive depending on whether you minimize or maximize the function).
You can view penalty terms in a cost function (e.g. costfun | Math behind applying elastic net penalties to logistic regression
Yes, the penalties are simply added to the cost function (and negative/positive depending on whether you minimize or maximize the function).
You can view penalty terms in a cost function (e.g. costfunction like the likelihood) as being equivalent to the ... | Math behind applying elastic net penalties to logistic regression
Yes, the penalties are simply added to the cost function (and negative/positive depending on whether you minimize or maximize the function).
You can view penalty terms in a cost function (e.g. costfun |
45,202 | How to reconcile these two versions of a "linear model"? | You have it exactly right.
For instance, you might have two predictors $X_1$ and $X_2$. In your model, you decide to use $X_1$ untransformed, "as-is": $h_1(X_1)=X_1$. For your second predictor, you decide to use $X_2$ both untransformed, $h_1(X_2)=X_2$ and squared, $h_2(X_2)=X_2^2$. Your model contains three predictors... | How to reconcile these two versions of a "linear model"? | You have it exactly right.
For instance, you might have two predictors $X_1$ and $X_2$. In your model, you decide to use $X_1$ untransformed, "as-is": $h_1(X_1)=X_1$. For your second predictor, you de | How to reconcile these two versions of a "linear model"?
You have it exactly right.
For instance, you might have two predictors $X_1$ and $X_2$. In your model, you decide to use $X_1$ untransformed, "as-is": $h_1(X_1)=X_1$. For your second predictor, you decide to use $X_2$ both untransformed, $h_1(X_2)=X_2$ and square... | How to reconcile these two versions of a "linear model"?
You have it exactly right.
For instance, you might have two predictors $X_1$ and $X_2$. In your model, you decide to use $X_1$ untransformed, "as-is": $h_1(X_1)=X_1$. For your second predictor, you de |
45,203 | How to reconcile these two versions of a "linear model"? | Consider what happens if every $h_j$ is the identity function.
Spoiler alert: It's exactly the same as the other model.
What your professor is showing you is the idea of nonlinear basis functions that allow you to introduce curvature, not just lines and planes. The gist is that, once you do the transformation, you have... | How to reconcile these two versions of a "linear model"? | Consider what happens if every $h_j$ is the identity function.
Spoiler alert: It's exactly the same as the other model.
What your professor is showing you is the idea of nonlinear basis functions that | How to reconcile these two versions of a "linear model"?
Consider what happens if every $h_j$ is the identity function.
Spoiler alert: It's exactly the same as the other model.
What your professor is showing you is the idea of nonlinear basis functions that allow you to introduce curvature, not just lines and planes. T... | How to reconcile these two versions of a "linear model"?
Consider what happens if every $h_j$ is the identity function.
Spoiler alert: It's exactly the same as the other model.
What your professor is showing you is the idea of nonlinear basis functions that |
45,204 | Do I lose a degree of freedom if there is a restriction on the explanatory variables? | By introducing a constraint, you would normally gain a degree of freedom, since there are fewer free parameters to be estimated. In your case, you would have to omit one of the variables (e.g. $x_3$) from the model to prevent perfect multicollinearity, and you would no longer have to estimate $\beta_3$ and $\beta_6$. S... | Do I lose a degree of freedom if there is a restriction on the explanatory variables? | By introducing a constraint, you would normally gain a degree of freedom, since there are fewer free parameters to be estimated. In your case, you would have to omit one of the variables (e.g. $x_3$) | Do I lose a degree of freedom if there is a restriction on the explanatory variables?
By introducing a constraint, you would normally gain a degree of freedom, since there are fewer free parameters to be estimated. In your case, you would have to omit one of the variables (e.g. $x_3$) from the model to prevent perfect ... | Do I lose a degree of freedom if there is a restriction on the explanatory variables?
By introducing a constraint, you would normally gain a degree of freedom, since there are fewer free parameters to be estimated. In your case, you would have to omit one of the variables (e.g. $x_3$) |
45,205 | What is the score function of two parameters? | The score for a multiple parameter problem (a vector parameter) is itself a vector. We need to take partial derivatives of the log likelihood with respect to each model parameter.
Let's consider an example. Find the score vector for $X_1, X_2, \ldots, X_n \sim N(\mu, \sigma^2)$ where the $X_i$ are iid $N(\mu, \sigma^2)... | What is the score function of two parameters? | The score for a multiple parameter problem (a vector parameter) is itself a vector. We need to take partial derivatives of the log likelihood with respect to each model parameter.
Let's consider an ex | What is the score function of two parameters?
The score for a multiple parameter problem (a vector parameter) is itself a vector. We need to take partial derivatives of the log likelihood with respect to each model parameter.
Let's consider an example. Find the score vector for $X_1, X_2, \ldots, X_n \sim N(\mu, \sigma... | What is the score function of two parameters?
The score for a multiple parameter problem (a vector parameter) is itself a vector. We need to take partial derivatives of the log likelihood with respect to each model parameter.
Let's consider an ex |
45,206 | Confusion in classification and regression task exception | To start from the end:
should I just stop reading random articles?
Maybe you should first take a course on statistics, data science, or machine learning, before you return to reading 'random articles'. There are many gems on the internet, but even more garbage, and without a solid foundation it may be hard to disting... | Confusion in classification and regression task exception | To start from the end:
should I just stop reading random articles?
Maybe you should first take a course on statistics, data science, or machine learning, before you return to reading 'random article | Confusion in classification and regression task exception
To start from the end:
should I just stop reading random articles?
Maybe you should first take a course on statistics, data science, or machine learning, before you return to reading 'random articles'. There are many gems on the internet, but even more garbage... | Confusion in classification and regression task exception
To start from the end:
should I just stop reading random articles?
Maybe you should first take a course on statistics, data science, or machine learning, before you return to reading 'random article |
45,207 | Confusion in classification and regression task exception | Any neural network trained on a crossentropy loss function performs categorical prediction, but the raw (trained) model output is a probability distribution (after normalization, possibly softmax).
Outputting a distribution is a hallmark of probabilistic methods. The model doesn't make a prediction, per se, but you can... | Confusion in classification and regression task exception | Any neural network trained on a crossentropy loss function performs categorical prediction, but the raw (trained) model output is a probability distribution (after normalization, possibly softmax).
Ou | Confusion in classification and regression task exception
Any neural network trained on a crossentropy loss function performs categorical prediction, but the raw (trained) model output is a probability distribution (after normalization, possibly softmax).
Outputting a distribution is a hallmark of probabilistic methods... | Confusion in classification and regression task exception
Any neural network trained on a crossentropy loss function performs categorical prediction, but the raw (trained) model output is a probability distribution (after normalization, possibly softmax).
Ou |
45,208 | "Information" Correlation | Taking a different angle from the information coefficient of correlation, I'll give background on the formula you gave.
It's called the normalized mutual information.
Unfortunately, lots of things are called the normalized mutual information. What you've shown uses the geometric mean of $H(X)$ and $H(Y)$ as the denomin... | "Information" Correlation | Taking a different angle from the information coefficient of correlation, I'll give background on the formula you gave.
It's called the normalized mutual information.
Unfortunately, lots of things are | "Information" Correlation
Taking a different angle from the information coefficient of correlation, I'll give background on the formula you gave.
It's called the normalized mutual information.
Unfortunately, lots of things are called the normalized mutual information. What you've shown uses the geometric mean of $H(X)$... | "Information" Correlation
Taking a different angle from the information coefficient of correlation, I'll give background on the formula you gave.
It's called the normalized mutual information.
Unfortunately, lots of things are |
45,209 | "Information" Correlation | To answer your question "Has any literature explored this idea?". Linfoot (1957) introduced the informational coefficient of correlation, $\mathit{(IC)}$:
$$IC=\sqrt{1-e^{-2\cdot{I(X;Y)}}}$$
where $\mathit{I(X;Y)}$ is the mutual information.
While it does not seem to be a commonly used statistic in literature, in may s... | "Information" Correlation | To answer your question "Has any literature explored this idea?". Linfoot (1957) introduced the informational coefficient of correlation, $\mathit{(IC)}$:
$$IC=\sqrt{1-e^{-2\cdot{I(X;Y)}}}$$
where $\m | "Information" Correlation
To answer your question "Has any literature explored this idea?". Linfoot (1957) introduced the informational coefficient of correlation, $\mathit{(IC)}$:
$$IC=\sqrt{1-e^{-2\cdot{I(X;Y)}}}$$
where $\mathit{I(X;Y)}$ is the mutual information.
While it does not seem to be a commonly used statist... | "Information" Correlation
To answer your question "Has any literature explored this idea?". Linfoot (1957) introduced the informational coefficient of correlation, $\mathit{(IC)}$:
$$IC=\sqrt{1-e^{-2\cdot{I(X;Y)}}}$$
where $\m |
45,210 | What is the median of Bernoulli distribution? | Let $X \sim \mathsf{Bern}(p=.2)\equiv\mathsf{Binom}(n=1, p=.2).$ In R, where qbinom is the inverse CDF (quantile function) of a binomial distribution a median $\eta = 0.$
qbinom(.5, 1, .2)
[1] 0
$P(X \le 0) = P(X = 0) = 0.8 \ge 1/2.$
dbinom(0, 1, .2)
[1] 0.8
And obviously, $P(X \ge 0) = 1 \ge 1/2.$
The CDF of $X$ is ... | What is the median of Bernoulli distribution? | Let $X \sim \mathsf{Bern}(p=.2)\equiv\mathsf{Binom}(n=1, p=.2).$ In R, where qbinom is the inverse CDF (quantile function) of a binomial distribution a median $\eta = 0.$
qbinom(.5, 1, .2)
[1] 0
$P(X | What is the median of Bernoulli distribution?
Let $X \sim \mathsf{Bern}(p=.2)\equiv\mathsf{Binom}(n=1, p=.2).$ In R, where qbinom is the inverse CDF (quantile function) of a binomial distribution a median $\eta = 0.$
qbinom(.5, 1, .2)
[1] 0
$P(X \le 0) = P(X = 0) = 0.8 \ge 1/2.$
dbinom(0, 1, .2)
[1] 0.8
And obviously... | What is the median of Bernoulli distribution?
Let $X \sim \mathsf{Bern}(p=.2)\equiv\mathsf{Binom}(n=1, p=.2).$ In R, where qbinom is the inverse CDF (quantile function) of a binomial distribution a median $\eta = 0.$
qbinom(.5, 1, .2)
[1] 0
$P(X |
45,211 | What is the median of Bernoulli distribution? | $X \sim Bern(0.2)$
By the definition of median
$P(X \leq m) \geq 1/2$ and $P(X \geq m) \geq 1/2$
It has
$m = \begin{cases}
0, \quad p < 1/2\\
[0,1], \quad p = 1/2\\
1, \quad p > 1/2
\end{cases}$
It then follows that $m = 0$. | What is the median of Bernoulli distribution? | $X \sim Bern(0.2)$
By the definition of median
$P(X \leq m) \geq 1/2$ and $P(X \geq m) \geq 1/2$
It has
$m = \begin{cases}
0, \quad p < 1/2\\
[0,1], \quad p = 1/2\\
1, \quad p > 1/2
\end{cases}$
It t | What is the median of Bernoulli distribution?
$X \sim Bern(0.2)$
By the definition of median
$P(X \leq m) \geq 1/2$ and $P(X \geq m) \geq 1/2$
It has
$m = \begin{cases}
0, \quad p < 1/2\\
[0,1], \quad p = 1/2\\
1, \quad p > 1/2
\end{cases}$
It then follows that $m = 0$. | What is the median of Bernoulli distribution?
$X \sim Bern(0.2)$
By the definition of median
$P(X \leq m) \geq 1/2$ and $P(X \geq m) \geq 1/2$
It has
$m = \begin{cases}
0, \quad p < 1/2\\
[0,1], \quad p = 1/2\\
1, \quad p > 1/2
\end{cases}$
It t |
45,212 | Multinomial glmm with glmmADMB in R | Anna, because you used family = "binomial" and link = "logit" as options in your model, R assumes that you are trying to model a binary response variable which takes the values 0 ("failure") or 1 ("success"). This assumption is also based on the fact that you didn't use cbind() on the left hand side of your model formu... | Multinomial glmm with glmmADMB in R | Anna, because you used family = "binomial" and link = "logit" as options in your model, R assumes that you are trying to model a binary response variable which takes the values 0 ("failure") or 1 ("su | Multinomial glmm with glmmADMB in R
Anna, because you used family = "binomial" and link = "logit" as options in your model, R assumes that you are trying to model a binary response variable which takes the values 0 ("failure") or 1 ("success"). This assumption is also based on the fact that you didn't use cbind() on th... | Multinomial glmm with glmmADMB in R
Anna, because you used family = "binomial" and link = "logit" as options in your model, R assumes that you are trying to model a binary response variable which takes the values 0 ("failure") or 1 ("su |
45,213 | Multinomial glmm with glmmADMB in R | I'm late to the party here but I really struggled to find a good way to do a mixed multinomial regression and didn't have success with the mixcat package, mostly due to the near complete lack of support/documentation. Just thought I'd add a different solution for anyone else struggling with this - you can use the gam()... | Multinomial glmm with glmmADMB in R | I'm late to the party here but I really struggled to find a good way to do a mixed multinomial regression and didn't have success with the mixcat package, mostly due to the near complete lack of suppo | Multinomial glmm with glmmADMB in R
I'm late to the party here but I really struggled to find a good way to do a mixed multinomial regression and didn't have success with the mixcat package, mostly due to the near complete lack of support/documentation. Just thought I'd add a different solution for anyone else struggli... | Multinomial glmm with glmmADMB in R
I'm late to the party here but I really struggled to find a good way to do a mixed multinomial regression and didn't have success with the mixcat package, mostly due to the near complete lack of suppo |
45,214 | Multinomial glmm with glmmADMB in R | mgcv package seems very slow and space inefficient. I was only able to estimate the binary model. The multinomial model could not complete the estimation. | Multinomial glmm with glmmADMB in R | mgcv package seems very slow and space inefficient. I was only able to estimate the binary model. The multinomial model could not complete the estimation. | Multinomial glmm with glmmADMB in R
mgcv package seems very slow and space inefficient. I was only able to estimate the binary model. The multinomial model could not complete the estimation. | Multinomial glmm with glmmADMB in R
mgcv package seems very slow and space inefficient. I was only able to estimate the binary model. The multinomial model could not complete the estimation. |
45,215 | Conditional probability greater than 1? | It's because of your independence assumption, which is not true based on the data. For example,
$$P(\text{Outlook=Sunny, Temp=High}|\text{Beach})=1/2$$
because there are 4 situations where you go to Beach and in only two of them the Outlook is Sunny and Temp is High. It's the same situation for the denominator. | Conditional probability greater than 1? | It's because of your independence assumption, which is not true based on the data. For example,
$$P(\text{Outlook=Sunny, Temp=High}|\text{Beach})=1/2$$
because there are 4 situations where you go to B | Conditional probability greater than 1?
It's because of your independence assumption, which is not true based on the data. For example,
$$P(\text{Outlook=Sunny, Temp=High}|\text{Beach})=1/2$$
because there are 4 situations where you go to Beach and in only two of them the Outlook is Sunny and Temp is High. It's the sam... | Conditional probability greater than 1?
It's because of your independence assumption, which is not true based on the data. For example,
$$P(\text{Outlook=Sunny, Temp=High}|\text{Beach})=1/2$$
because there are 4 situations where you go to B |
45,216 | Why is it bad if the estimates vary greatly depending on whether we divide by N or (N - 1) in multivariate analysis? | The comment seems to be a way of saying that we like large sample sizes in machine learning.
The numerator is the numerator, whether you divide by $N$ or $N-1$, so all that matters to our discussion is the denominator.
The only way for the two fractions to differ immensely is if $N$ and $N-1$ are very different, say if... | Why is it bad if the estimates vary greatly depending on whether we divide by N or (N - 1) in multiv | The comment seems to be a way of saying that we like large sample sizes in machine learning.
The numerator is the numerator, whether you divide by $N$ or $N-1$, so all that matters to our discussion i | Why is it bad if the estimates vary greatly depending on whether we divide by N or (N - 1) in multivariate analysis?
The comment seems to be a way of saying that we like large sample sizes in machine learning.
The numerator is the numerator, whether you divide by $N$ or $N-1$, so all that matters to our discussion is t... | Why is it bad if the estimates vary greatly depending on whether we divide by N or (N - 1) in multiv
The comment seems to be a way of saying that we like large sample sizes in machine learning.
The numerator is the numerator, whether you divide by $N$ or $N-1$, so all that matters to our discussion i |
45,217 | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}$ | After quite a bit of searching - this is the density of a Generalized Inverse Gaussian random variable. There are a number of algorithms for sampling from this distribution.
R packages include GIGrvg, ghyp and Runuran. More details can be found in the following papers.
Wolfgang Hörmann and Josef Leydold (2013). Generat... | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x} | After quite a bit of searching - this is the density of a Generalized Inverse Gaussian random variable. There are a number of algorithms for sampling from this distribution.
R packages include GIGrvg, | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}$
After quite a bit of searching - this is the density of a Generalized Inverse Gaussian random variable. There are a number of algorithms for sampling from this distribution.
R packages include GIGrvg, ghyp and Runuran.... | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}
After quite a bit of searching - this is the density of a Generalized Inverse Gaussian random variable. There are a number of algorithms for sampling from this distribution.
R packages include GIGrvg, |
45,218 | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}$ | scipy package in python can do it (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geninvgauss.html#scipy.stats.geninvgauss), but its expression are slightly different from above. so I wonder how to convert their parameters | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x} | scipy package in python can do it (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geninvgauss.html#scipy.stats.geninvgauss), but its expression are slightly different from above. so | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}$
scipy package in python can do it (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geninvgauss.html#scipy.stats.geninvgauss), but its expression are slightly different from above. so I wonder how to co... | Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}
scipy package in python can do it (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geninvgauss.html#scipy.stats.geninvgauss), but its expression are slightly different from above. so |
45,219 | interpretation of model coefficient in logistic regression | In logistic regression we have that:
$$
\ln\left({\frac{p}{1-p}}\right) = \mathbf{Xb}
$$
where $\mathbf{Xb}$ is the linear predictor, $\mathbf{X}$ being the model matrix of explanatory variables and $\mathbf{b}$ the vector of coefficients. $\ln\left({\frac{p}{1-p}}\right)$ is the logit function (log of the odds).
Ther... | interpretation of model coefficient in logistic regression | In logistic regression we have that:
$$
\ln\left({\frac{p}{1-p}}\right) = \mathbf{Xb}
$$
where $\mathbf{Xb}$ is the linear predictor, $\mathbf{X}$ being the model matrix of explanatory variables and $ | interpretation of model coefficient in logistic regression
In logistic regression we have that:
$$
\ln\left({\frac{p}{1-p}}\right) = \mathbf{Xb}
$$
where $\mathbf{Xb}$ is the linear predictor, $\mathbf{X}$ being the model matrix of explanatory variables and $\mathbf{b}$ the vector of coefficients. $\ln\left({\frac{p}{... | interpretation of model coefficient in logistic regression
In logistic regression we have that:
$$
\ln\left({\frac{p}{1-p}}\right) = \mathbf{Xb}
$$
where $\mathbf{Xb}$ is the linear predictor, $\mathbf{X}$ being the model matrix of explanatory variables and $ |
45,220 | Bayesian interpretation of logistic ridge regression | As a preliminary note, I see that your equations seem to be dealing with the case where we only have a single explanatory variable and a single data point (and no intercept term). I will generalise this to look at the general case where you observe $n$ data points, so that the log-likelihood function is a sum over the... | Bayesian interpretation of logistic ridge regression | As a preliminary note, I see that your equations seem to be dealing with the case where we only have a single explanatory variable and a single data point (and no intercept term). I will generalise t | Bayesian interpretation of logistic ridge regression
As a preliminary note, I see that your equations seem to be dealing with the case where we only have a single explanatory variable and a single data point (and no intercept term). I will generalise this to look at the general case where you observe $n$ data points, ... | Bayesian interpretation of logistic ridge regression
As a preliminary note, I see that your equations seem to be dealing with the case where we only have a single explanatory variable and a single data point (and no intercept term). I will generalise t |
45,221 | Bayesian interpretation of logistic ridge regression | To look for equivalence one should compare the form of,
$$\hat{\beta} = \underset{\beta}{\text{argmin}} -y\log(\hat{y}) - (1-y)\log(1-\hat{y}) + \lambda||\beta||_2^2,$$
with the posterior distribution whilst keeping a general expression for the prior.
The posterior distribution has form,
$$\pi(\beta|x) \propto \pi(\b... | Bayesian interpretation of logistic ridge regression | To look for equivalence one should compare the form of,
$$\hat{\beta} = \underset{\beta}{\text{argmin}} -y\log(\hat{y}) - (1-y)\log(1-\hat{y}) + \lambda||\beta||_2^2,$$
with the posterior distributi | Bayesian interpretation of logistic ridge regression
To look for equivalence one should compare the form of,
$$\hat{\beta} = \underset{\beta}{\text{argmin}} -y\log(\hat{y}) - (1-y)\log(1-\hat{y}) + \lambda||\beta||_2^2,$$
with the posterior distribution whilst keeping a general expression for the prior.
The posterior... | Bayesian interpretation of logistic ridge regression
To look for equivalence one should compare the form of,
$$\hat{\beta} = \underset{\beta}{\text{argmin}} -y\log(\hat{y}) - (1-y)\log(1-\hat{y}) + \lambda||\beta||_2^2,$$
with the posterior distributi |
45,222 | Multilevel regression model for nested data using "multilevel" and "lme4" R packages? | From what I can see of your data and the descriptions, you do not have multiple measures within ID. You have measured several variables, D_d, RI, RV, and MRP once for each ID.
Thus ID seems is the unit of measurements (that is, it unique to each row in your data).
However you do seem to have multiple measures within Gr... | Multilevel regression model for nested data using "multilevel" and "lme4" R packages? | From what I can see of your data and the descriptions, you do not have multiple measures within ID. You have measured several variables, D_d, RI, RV, and MRP once for each ID.
Thus ID seems is the uni | Multilevel regression model for nested data using "multilevel" and "lme4" R packages?
From what I can see of your data and the descriptions, you do not have multiple measures within ID. You have measured several variables, D_d, RI, RV, and MRP once for each ID.
Thus ID seems is the unit of measurements (that is, it uni... | Multilevel regression model for nested data using "multilevel" and "lme4" R packages?
From what I can see of your data and the descriptions, you do not have multiple measures within ID. You have measured several variables, D_d, RI, RV, and MRP once for each ID.
Thus ID seems is the uni |
45,223 | Multilevel regression model for nested data using "multilevel" and "lme4" R packages? | A couple of points:
Mixed models are indeed used to account for correlations in your outcome variable, I guess TI within the levels of grouping/cluster variables, i.e., ID and Group in your case. Assuming that normal error terms would be adequate for TI, you could use a linear mixed model. For example, using function ... | Multilevel regression model for nested data using "multilevel" and "lme4" R packages? | A couple of points:
Mixed models are indeed used to account for correlations in your outcome variable, I guess TI within the levels of grouping/cluster variables, i.e., ID and Group in your case. Ass | Multilevel regression model for nested data using "multilevel" and "lme4" R packages?
A couple of points:
Mixed models are indeed used to account for correlations in your outcome variable, I guess TI within the levels of grouping/cluster variables, i.e., ID and Group in your case. Assuming that normal error terms woul... | Multilevel regression model for nested data using "multilevel" and "lme4" R packages?
A couple of points:
Mixed models are indeed used to account for correlations in your outcome variable, I guess TI within the levels of grouping/cluster variables, i.e., ID and Group in your case. Ass |
45,224 | The odds ratio calculated in my regression model seems to be too high | Is it okay that the direction of the fixed effects is opposite to the intercept in my model?
Yes. The interpretation of the intercept is that it is the log-odds of the event (DV = 1) for the those in the none group (so, being negative, it is a protective effect), while the estimates for the other 2 groups are the log-... | The odds ratio calculated in my regression model seems to be too high | Is it okay that the direction of the fixed effects is opposite to the intercept in my model?
Yes. The interpretation of the intercept is that it is the log-odds of the event (DV = 1) for the those in | The odds ratio calculated in my regression model seems to be too high
Is it okay that the direction of the fixed effects is opposite to the intercept in my model?
Yes. The interpretation of the intercept is that it is the log-odds of the event (DV = 1) for the those in the none group (so, being negative, it is a prote... | The odds ratio calculated in my regression model seems to be too high
Is it okay that the direction of the fixed effects is opposite to the intercept in my model?
Yes. The interpretation of the intercept is that it is the log-odds of the event (DV = 1) for the those in |
45,225 | Prove that a simple random walk is a martingale | \begin{align}
E[X_{t+1} \mid X_1, \ldots, X_t]
&= E[X_t + a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t + E[a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t
\end{align} | Prove that a simple random walk is a martingale | \begin{align}
E[X_{t+1} \mid X_1, \ldots, X_t]
&= E[X_t + a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t + E[a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t
\end{align} | Prove that a simple random walk is a martingale
\begin{align}
E[X_{t+1} \mid X_1, \ldots, X_t]
&= E[X_t + a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t + E[a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t
\end{align} | Prove that a simple random walk is a martingale
\begin{align}
E[X_{t+1} \mid X_1, \ldots, X_t]
&= E[X_t + a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t + E[a_{t+1} \mid X_1, \ldots, X_t]
\\
&= X_t
\end{align} |
45,226 | Prove that a simple random walk is a martingale | Let $\{X_t\}_{t\geq 1}$ be a sequence of independent random variables such that $\Pr\{X_t=1\}=\Pr\{X_t=-1\}=1/2$. Define $\mathscr{F_t}=\sigma(X_1,\dots,X_t)$ and $M_t=X_1+\dots+X_t$. We have (equalities between conditional expectations holding almost surely)
$$
\mathbb{E}[M_{t+1}\mid\mathscr{F_t}] = \mathbb{E}[X_{t+... | Prove that a simple random walk is a martingale | Let $\{X_t\}_{t\geq 1}$ be a sequence of independent random variables such that $\Pr\{X_t=1\}=\Pr\{X_t=-1\}=1/2$. Define $\mathscr{F_t}=\sigma(X_1,\dots,X_t)$ and $M_t=X_1+\dots+X_t$. We have (equalit | Prove that a simple random walk is a martingale
Let $\{X_t\}_{t\geq 1}$ be a sequence of independent random variables such that $\Pr\{X_t=1\}=\Pr\{X_t=-1\}=1/2$. Define $\mathscr{F_t}=\sigma(X_1,\dots,X_t)$ and $M_t=X_1+\dots+X_t$. We have (equalities between conditional expectations holding almost surely)
$$
\mathbb... | Prove that a simple random walk is a martingale
Let $\{X_t\}_{t\geq 1}$ be a sequence of independent random variables such that $\Pr\{X_t=1\}=\Pr\{X_t=-1\}=1/2$. Define $\mathscr{F_t}=\sigma(X_1,\dots,X_t)$ and $M_t=X_1+\dots+X_t$. We have (equalit |
45,227 | Forcing smoothness of regression coefficients | If you want something simple, I would look at (weighted) fused LASSO or similarly ridge-style regression. Suppose you have
$$ y \in \mathbf{R}^{T\times 1} \text{ response} \qquad X_{k} \in \mathbf{R}^{T\times 1} \text{ where } k\in\{1, \dots, K\} \text{ $k$th covariate }$$
You want some smoothness of coefficients that ... | Forcing smoothness of regression coefficients | If you want something simple, I would look at (weighted) fused LASSO or similarly ridge-style regression. Suppose you have
$$ y \in \mathbf{R}^{T\times 1} \text{ response} \qquad X_{k} \in \mathbf{R}^ | Forcing smoothness of regression coefficients
If you want something simple, I would look at (weighted) fused LASSO or similarly ridge-style regression. Suppose you have
$$ y \in \mathbf{R}^{T\times 1} \text{ response} \qquad X_{k} \in \mathbf{R}^{T\times 1} \text{ where } k\in\{1, \dots, K\} \text{ $k$th covariate }$$
... | Forcing smoothness of regression coefficients
If you want something simple, I would look at (weighted) fused LASSO or similarly ridge-style regression. Suppose you have
$$ y \in \mathbf{R}^{T\times 1} \text{ response} \qquad X_{k} \in \mathbf{R}^ |
45,228 | Forcing smoothness of regression coefficients | This is the motivation for Functional Data Analysis.
I will describe the functional covariate and scalar response linear model which is just one of many many possible models.
Asumes pairs $(x, y)$ where $$ y = \int_{a}^{b} \beta(t)x(t) \, dt + \varepsilon$$
Here $x$ is a random curve, y a scalar response and $\beta$ a... | Forcing smoothness of regression coefficients | This is the motivation for Functional Data Analysis.
I will describe the functional covariate and scalar response linear model which is just one of many many possible models.
Asumes pairs $(x, y)$ wh | Forcing smoothness of regression coefficients
This is the motivation for Functional Data Analysis.
I will describe the functional covariate and scalar response linear model which is just one of many many possible models.
Asumes pairs $(x, y)$ where $$ y = \int_{a}^{b} \beta(t)x(t) \, dt + \varepsilon$$
Here $x$ is a r... | Forcing smoothness of regression coefficients
This is the motivation for Functional Data Analysis.
I will describe the functional covariate and scalar response linear model which is just one of many many possible models.
Asumes pairs $(x, y)$ wh |
45,229 | Is the value of probability invariant of function of a random variable | Let $X_1, X_2$ be two independent random variables each with pmf
$$ P_{X}(x)=
\begin{cases}
\frac{1}{2} & x =1 \\
\frac{1}{2} & x =-1 \\
\end{cases} $$
Then $\mathsf P(X_1>X_2)=0.25$ but $\mathsf P\big(X_1^2>X_2^2\big)=0$ | Is the value of probability invariant of function of a random variable | Let $X_1, X_2$ be two independent random variables each with pmf
$$ P_{X}(x)=
\begin{cases}
\frac{1}{2} & x =1 \\
\frac{1}{2} & x =-1 \\
\end{cases} $$
Then $\mathsf P(X_1>X_2)=0.25$ but $\mathsf | Is the value of probability invariant of function of a random variable
Let $X_1, X_2$ be two independent random variables each with pmf
$$ P_{X}(x)=
\begin{cases}
\frac{1}{2} & x =1 \\
\frac{1}{2} & x =-1 \\
\end{cases} $$
Then $\mathsf P(X_1>X_2)=0.25$ but $\mathsf P\big(X_1^2>X_2^2\big)=0$ | Is the value of probability invariant of function of a random variable
Let $X_1, X_2$ be two independent random variables each with pmf
$$ P_{X}(x)=
\begin{cases}
\frac{1}{2} & x =1 \\
\frac{1}{2} & x =-1 \\
\end{cases} $$
Then $\mathsf P(X_1>X_2)=0.25$ but $\mathsf |
45,230 | Is the value of probability invariant of function of a random variable | No. That equation does not hold in general. Although that equation does not hold in general, it does hold for monotonically increasing functions. If $f$ is monotone increasing (e.g., exponential or logarithmic functions) then you have the event equivalence:
$$\{ X > Y \} \quad \quad \iff \quad \quad \{ f(X) > f(Y) \... | Is the value of probability invariant of function of a random variable | No. That equation does not hold in general. Although that equation does not hold in general, it does hold for monotonically increasing functions. If $f$ is monotone increasing (e.g., exponential or | Is the value of probability invariant of function of a random variable
No. That equation does not hold in general. Although that equation does not hold in general, it does hold for monotonically increasing functions. If $f$ is monotone increasing (e.g., exponential or logarithmic functions) then you have the event e... | Is the value of probability invariant of function of a random variable
No. That equation does not hold in general. Although that equation does not hold in general, it does hold for monotonically increasing functions. If $f$ is monotone increasing (e.g., exponential or |
45,231 | Is the value of probability invariant of function of a random variable | A simple counterexample for any $X_i$ with $P(X_i > 0) = 1$ is the function $f(x) = x^{-1}$. It reverses inequalities, hence $P(f(X_1) > f(X_2)) = P(X_1 < X_2)$, which is in general different from $P(X_1 > X_2)$. | Is the value of probability invariant of function of a random variable | A simple counterexample for any $X_i$ with $P(X_i > 0) = 1$ is the function $f(x) = x^{-1}$. It reverses inequalities, hence $P(f(X_1) > f(X_2)) = P(X_1 < X_2)$, which is in general different from $P( | Is the value of probability invariant of function of a random variable
A simple counterexample for any $X_i$ with $P(X_i > 0) = 1$ is the function $f(x) = x^{-1}$. It reverses inequalities, hence $P(f(X_1) > f(X_2)) = P(X_1 < X_2)$, which is in general different from $P(X_1 > X_2)$. | Is the value of probability invariant of function of a random variable
A simple counterexample for any $X_i$ with $P(X_i > 0) = 1$ is the function $f(x) = x^{-1}$. It reverses inequalities, hence $P(f(X_1) > f(X_2)) = P(X_1 < X_2)$, which is in general different from $P( |
45,232 | Should I do a regression analysis even if the variables do not seem to be associated at all? | A couple of thoughts:
It is usual to put the dependent (or outcome) variable on the vertical axis and the independent (or predictor) variable on the horizontal axis
If you do two separate simple linear regressions, you are, essentially, fitting a line to the plots you have posted. I agree that it doesn't look like the... | Should I do a regression analysis even if the variables do not seem to be associated at all? | A couple of thoughts:
It is usual to put the dependent (or outcome) variable on the vertical axis and the independent (or predictor) variable on the horizontal axis
If you do two separate simple line | Should I do a regression analysis even if the variables do not seem to be associated at all?
A couple of thoughts:
It is usual to put the dependent (or outcome) variable on the vertical axis and the independent (or predictor) variable on the horizontal axis
If you do two separate simple linear regressions, you are, es... | Should I do a regression analysis even if the variables do not seem to be associated at all?
A couple of thoughts:
It is usual to put the dependent (or outcome) variable on the vertical axis and the independent (or predictor) variable on the horizontal axis
If you do two separate simple line |
45,233 | What is the benefit of latent variables? | There are some elements to answer your question in Section 16.5 of the Deep Learning book by Ian Goodfellow and al.:
A good generative model needs to accurately capture the distribution over the
observed or “visible” variables $v$ . Often the different elements of $v$ are highly
dependent on each other. In the con... | What is the benefit of latent variables? | There are some elements to answer your question in Section 16.5 of the Deep Learning book by Ian Goodfellow and al.:
A good generative model needs to accurately capture the distribution over the
ob | What is the benefit of latent variables?
There are some elements to answer your question in Section 16.5 of the Deep Learning book by Ian Goodfellow and al.:
A good generative model needs to accurately capture the distribution over the
observed or “visible” variables $v$ . Often the different elements of $v$ are hig... | What is the benefit of latent variables?
There are some elements to answer your question in Section 16.5 of the Deep Learning book by Ian Goodfellow and al.:
A good generative model needs to accurately capture the distribution over the
ob |
45,234 | What is the benefit of latent variables? | In many cases the data we observe depends on some hidden variables, that were not observed, or could not be observed. Knowing those variables would simplify our model, and in many cases we can get away from not knowing their values by assuming a latent variable model, that can "recover" the unobserved variables from th... | What is the benefit of latent variables? | In many cases the data we observe depends on some hidden variables, that were not observed, or could not be observed. Knowing those variables would simplify our model, and in many cases we can get awa | What is the benefit of latent variables?
In many cases the data we observe depends on some hidden variables, that were not observed, or could not be observed. Knowing those variables would simplify our model, and in many cases we can get away from not knowing their values by assuming a latent variable model, that can "... | What is the benefit of latent variables?
In many cases the data we observe depends on some hidden variables, that were not observed, or could not be observed. Knowing those variables would simplify our model, and in many cases we can get awa |
45,235 | What is the benefit of latent variables? | Take a simple case: the data $x$ is a mixture of Gaussians generated by picking a cluster index $z$ (from a categoric distribution $p(z)$) and then sampling from the Gaussian of that cluster $p(x|z)$. So $x$ is defined by nature as $p(x)=\sum_zp(x|z)p(z)$.
If you observe samples from $p(x)$ and want to model the distr... | What is the benefit of latent variables? | Take a simple case: the data $x$ is a mixture of Gaussians generated by picking a cluster index $z$ (from a categoric distribution $p(z)$) and then sampling from the Gaussian of that cluster $p(x|z)$. | What is the benefit of latent variables?
Take a simple case: the data $x$ is a mixture of Gaussians generated by picking a cluster index $z$ (from a categoric distribution $p(z)$) and then sampling from the Gaussian of that cluster $p(x|z)$. So $x$ is defined by nature as $p(x)=\sum_zp(x|z)p(z)$.
If you observe sample... | What is the benefit of latent variables?
Take a simple case: the data $x$ is a mixture of Gaussians generated by picking a cluster index $z$ (from a categoric distribution $p(z)$) and then sampling from the Gaussian of that cluster $p(x|z)$. |
45,236 | Generate synthetic data given AUC | There are multiple ways to do it. One is to assume to transform AUC to cohen's D and then just sample data from 2 standard normal distributions D standard deviations apart.
We can transform AUC to D according to a formula from SALGADO, Jesús F.. Transforming the Area under the Normal Curve (AUC) into Cohen’s d, Pearso... | Generate synthetic data given AUC | There are multiple ways to do it. One is to assume to transform AUC to cohen's D and then just sample data from 2 standard normal distributions D standard deviations apart.
We can transform AUC to D | Generate synthetic data given AUC
There are multiple ways to do it. One is to assume to transform AUC to cohen's D and then just sample data from 2 standard normal distributions D standard deviations apart.
We can transform AUC to D according to a formula from SALGADO, Jesús F.. Transforming the Area under the Normal ... | Generate synthetic data given AUC
There are multiple ways to do it. One is to assume to transform AUC to cohen's D and then just sample data from 2 standard normal distributions D standard deviations apart.
We can transform AUC to D |
45,237 | Regression when x and y each have uncertainties | In both cases you want to use Deming regression. Case 1 is a special case of Deming regression called orthogonal regression, which minimizes the sum of squared perpendicular distances from the data points to the regression line. For case 2, the general case, you will need an estimate of the ratio $\delta = \sigma^2_y /... | Regression when x and y each have uncertainties | In both cases you want to use Deming regression. Case 1 is a special case of Deming regression called orthogonal regression, which minimizes the sum of squared perpendicular distances from the data po | Regression when x and y each have uncertainties
In both cases you want to use Deming regression. Case 1 is a special case of Deming regression called orthogonal regression, which minimizes the sum of squared perpendicular distances from the data points to the regression line. For case 2, the general case, you will need... | Regression when x and y each have uncertainties
In both cases you want to use Deming regression. Case 1 is a special case of Deming regression called orthogonal regression, which minimizes the sum of squared perpendicular distances from the data po |
45,238 | Regression when x and y each have uncertainties | As a general concept the problem of error in X is called measurement error.
In linear regression analysis it causes attenuation bias, which is considered as one of the sources of engogeneity. Measuremet error shrinks coefficient of the right-hand-side variable measured with an error towards zero. It causes not uncertai... | Regression when x and y each have uncertainties | As a general concept the problem of error in X is called measurement error.
In linear regression analysis it causes attenuation bias, which is considered as one of the sources of engogeneity. Measurem | Regression when x and y each have uncertainties
As a general concept the problem of error in X is called measurement error.
In linear regression analysis it causes attenuation bias, which is considered as one of the sources of engogeneity. Measuremet error shrinks coefficient of the right-hand-side variable measured wi... | Regression when x and y each have uncertainties
As a general concept the problem of error in X is called measurement error.
In linear regression analysis it causes attenuation bias, which is considered as one of the sources of engogeneity. Measurem |
45,239 | Wilcoxon signed rank test – critical value for n>50 | The Wilcoxon signed rank test has a null distribution that rapidly approaches a normal distribution.
The tables tend to stop by n=50 because the normal approximation is excellent well before that point. Indeed, there's probably little point tabulating much beyond n=20. The normal approximation is given at the Wikipedia... | Wilcoxon signed rank test – critical value for n>50 | The Wilcoxon signed rank test has a null distribution that rapidly approaches a normal distribution.
The tables tend to stop by n=50 because the normal approximation is excellent well before that poin | Wilcoxon signed rank test – critical value for n>50
The Wilcoxon signed rank test has a null distribution that rapidly approaches a normal distribution.
The tables tend to stop by n=50 because the normal approximation is excellent well before that point. Indeed, there's probably little point tabulating much beyond n=20... | Wilcoxon signed rank test – critical value for n>50
The Wilcoxon signed rank test has a null distribution that rapidly approaches a normal distribution.
The tables tend to stop by n=50 because the normal approximation is excellent well before that poin |
45,240 | Why is the bayesian information criterion called that way? | BIC, sometimes called the Schwarz information criterion (SIC) was introduced by Gideon Schwartz in 1975. Here is that paper. It's not very long.
Both AIC and BIC address the model evaluation problem where more parameters lead to increased likelihood. To resolve this they penalize additional parameters. Schwartz gave a ... | Why is the bayesian information criterion called that way? | BIC, sometimes called the Schwarz information criterion (SIC) was introduced by Gideon Schwartz in 1975. Here is that paper. It's not very long.
Both AIC and BIC address the model evaluation problem w | Why is the bayesian information criterion called that way?
BIC, sometimes called the Schwarz information criterion (SIC) was introduced by Gideon Schwartz in 1975. Here is that paper. It's not very long.
Both AIC and BIC address the model evaluation problem where more parameters lead to increased likelihood. To resolve... | Why is the bayesian information criterion called that way?
BIC, sometimes called the Schwarz information criterion (SIC) was introduced by Gideon Schwartz in 1975. Here is that paper. It's not very long.
Both AIC and BIC address the model evaluation problem w |
45,241 | Why is the bayesian information criterion called that way? | One of my favourite simple interpretations and derivation of the BIC is in a lecture by Prof. Michael Jordan. This connects the Laplace approximation of the marginal likelihood (normalising constant in the Bayes Theorem, which is used for model comparison) with the BIC.
https://people.eecs.berkeley.edu/~jordan/courses/... | Why is the bayesian information criterion called that way? | One of my favourite simple interpretations and derivation of the BIC is in a lecture by Prof. Michael Jordan. This connects the Laplace approximation of the marginal likelihood (normalising constant i | Why is the bayesian information criterion called that way?
One of my favourite simple interpretations and derivation of the BIC is in a lecture by Prof. Michael Jordan. This connects the Laplace approximation of the marginal likelihood (normalising constant in the Bayes Theorem, which is used for model comparison) with... | Why is the bayesian information criterion called that way?
One of my favourite simple interpretations and derivation of the BIC is in a lecture by Prof. Michael Jordan. This connects the Laplace approximation of the marginal likelihood (normalising constant i |
45,242 | Mean and variance of $\tan(\mathcal{N}(\mu,\,\sigma^{2}))$ | The mean is not defined and the variance is infinite.
To see why this is, we have to analyze the integrals a little indirectly, because there are no formulas available. We will thereby obtain a more general result: namely,
When $X$ is a random variable whose distribution has a density $f$ that is positive and contin... | Mean and variance of $\tan(\mathcal{N}(\mu,\,\sigma^{2}))$ | The mean is not defined and the variance is infinite.
To see why this is, we have to analyze the integrals a little indirectly, because there are no formulas available. We will thereby obtain a more | Mean and variance of $\tan(\mathcal{N}(\mu,\,\sigma^{2}))$
The mean is not defined and the variance is infinite.
To see why this is, we have to analyze the integrals a little indirectly, because there are no formulas available. We will thereby obtain a more general result: namely,
When $X$ is a random variable whose... | Mean and variance of $\tan(\mathcal{N}(\mu,\,\sigma^{2}))$
The mean is not defined and the variance is infinite.
To see why this is, we have to analyze the integrals a little indirectly, because there are no formulas available. We will thereby obtain a more |
45,243 | How exactly to evaluate Treatment effect after Matching? | The documentation for Matching is sadly fairly incomplete, leaving what it does quite mysterious. What is clear is that it takes a different approach from Stuart (2010) (and the Ho, Imai, King, and Stuart camp) in estimating treatment effects and their standard errors. Rather, it takes heavy inspiration from Abadie & I... | How exactly to evaluate Treatment effect after Matching? | The documentation for Matching is sadly fairly incomplete, leaving what it does quite mysterious. What is clear is that it takes a different approach from Stuart (2010) (and the Ho, Imai, King, and St | How exactly to evaluate Treatment effect after Matching?
The documentation for Matching is sadly fairly incomplete, leaving what it does quite mysterious. What is clear is that it takes a different approach from Stuart (2010) (and the Ho, Imai, King, and Stuart camp) in estimating treatment effects and their standard e... | How exactly to evaluate Treatment effect after Matching?
The documentation for Matching is sadly fairly incomplete, leaving what it does quite mysterious. What is clear is that it takes a different approach from Stuart (2010) (and the Ho, Imai, King, and St |
45,244 | R: How to fit a GLMM in nlme | I was looking for a way to do what you're trying to accomplish and came across a couple of things. First was this question that was asked elsewhere on the website with this answer. The second was this paper, which did exactly what you were asking about. What they did was perform a logit transformation on the response v... | R: How to fit a GLMM in nlme | I was looking for a way to do what you're trying to accomplish and came across a couple of things. First was this question that was asked elsewhere on the website with this answer. The second was this | R: How to fit a GLMM in nlme
I was looking for a way to do what you're trying to accomplish and came across a couple of things. First was this question that was asked elsewhere on the website with this answer. The second was this paper, which did exactly what you were asking about. What they did was perform a logit tra... | R: How to fit a GLMM in nlme
I was looking for a way to do what you're trying to accomplish and came across a couple of things. First was this question that was asked elsewhere on the website with this answer. The second was this |
45,245 | R: How to fit a GLMM in nlme | I don't think nlme can be used to fit a mixed effects logistic regression model. However, you have plenty of other options available for this task via packages such as the ones listed below, whose use is illustrated for your model 4.
GLMMadaptive
install.packages("GLMMadaptive")
library(GLMMadaptive)
model4 <- mixed_... | R: How to fit a GLMM in nlme | I don't think nlme can be used to fit a mixed effects logistic regression model. However, you have plenty of other options available for this task via packages such as the ones listed below, whose use | R: How to fit a GLMM in nlme
I don't think nlme can be used to fit a mixed effects logistic regression model. However, you have plenty of other options available for this task via packages such as the ones listed below, whose use is illustrated for your model 4.
GLMMadaptive
install.packages("GLMMadaptive")
library(GL... | R: How to fit a GLMM in nlme
I don't think nlme can be used to fit a mixed effects logistic regression model. However, you have plenty of other options available for this task via packages such as the ones listed below, whose use |
45,246 | DAGs and all models are wrong motto, what's the implication? | I believe the language you are looking for is sensitivity analysis. Sensitivity analysis is the examination of the causal assumptions you made to identify your effect. Sensitivity analysis has been explored quite a bit over many years in the literature, going back quite a ways1. To answer your question, however, yes, y... | DAGs and all models are wrong motto, what's the implication? | I believe the language you are looking for is sensitivity analysis. Sensitivity analysis is the examination of the causal assumptions you made to identify your effect. Sensitivity analysis has been ex | DAGs and all models are wrong motto, what's the implication?
I believe the language you are looking for is sensitivity analysis. Sensitivity analysis is the examination of the causal assumptions you made to identify your effect. Sensitivity analysis has been explored quite a bit over many years in the literature, going... | DAGs and all models are wrong motto, what's the implication?
I believe the language you are looking for is sensitivity analysis. Sensitivity analysis is the examination of the causal assumptions you made to identify your effect. Sensitivity analysis has been ex |
45,247 | DAGs and all models are wrong motto, what's the implication? | To complement Landon's answer, let me elaborate a bit further.
Causal inference always requires untestable assumptions, the usual ones are absence of direct effects among variables (exclusion restrictions) or absence of unobserved common causes among variables (independence restrictions). For now, let us focus on the v... | DAGs and all models are wrong motto, what's the implication? | To complement Landon's answer, let me elaborate a bit further.
Causal inference always requires untestable assumptions, the usual ones are absence of direct effects among variables (exclusion restrict | DAGs and all models are wrong motto, what's the implication?
To complement Landon's answer, let me elaborate a bit further.
Causal inference always requires untestable assumptions, the usual ones are absence of direct effects among variables (exclusion restrictions) or absence of unobserved common causes among variable... | DAGs and all models are wrong motto, what's the implication?
To complement Landon's answer, let me elaborate a bit further.
Causal inference always requires untestable assumptions, the usual ones are absence of direct effects among variables (exclusion restrict |
45,248 | Am I allowed to average the list of precision and recall after k-fold cross validation? | First of all, when you do 5-fold cross validation, you don't have one model, you have five. So it's not really correct to talk about the precision/recall of the "whole model" since there isn't just one. Rather, you're getting an estimate of the precision/recall from your model-building process.
That said, each fold is ... | Am I allowed to average the list of precision and recall after k-fold cross validation? | First of all, when you do 5-fold cross validation, you don't have one model, you have five. So it's not really correct to talk about the precision/recall of the "whole model" since there isn't just on | Am I allowed to average the list of precision and recall after k-fold cross validation?
First of all, when you do 5-fold cross validation, you don't have one model, you have five. So it's not really correct to talk about the precision/recall of the "whole model" since there isn't just one. Rather, you're getting an est... | Am I allowed to average the list of precision and recall after k-fold cross validation?
First of all, when you do 5-fold cross validation, you don't have one model, you have five. So it's not really correct to talk about the precision/recall of the "whole model" since there isn't just on |
45,249 | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$ | It can be shown that by using sufficiently large sample sizes for the MC approximation, a lower bound to the marginal log-likelihood is tightened. While this estimator is hence biased, in can serve the same practical purposes. It was shown in [1] that
$$
\log p(x) \ge \mathcal{L}_{K+1} \ge \mathcal{L}_{K}
$$
for $\mat... | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$ | It can be shown that by using sufficiently large sample sizes for the MC approximation, a lower bound to the marginal log-likelihood is tightened. While this estimator is hence biased, in can serve th | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$
It can be shown that by using sufficiently large sample sizes for the MC approximation, a lower bound to the marginal log-likelihood is tightened. While this estimator is hence biased, in can serve the same practical purposes. It was shown in [1] that
... | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$
It can be shown that by using sufficiently large sample sizes for the MC approximation, a lower bound to the marginal log-likelihood is tightened. While this estimator is hence biased, in can serve th |
45,250 | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$ | Path sampling is a way to evaluate the log integral by an unbiased estimator. Let us introduce a temperature index $0\le t\le 1$ and a sequence of conditional functions $p_t(x|z)$ such that
$$p_0(x|z)=1\qquad\qquad\text{and}\qquad\qquad p_1(x|z)=p(x|z)$$
Then, if $$\mathfrak{Z}_t(x)=\int p_t(x|z)\,q(z)\text{d}z$$
\begi... | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$ | Path sampling is a way to evaluate the log integral by an unbiased estimator. Let us introduce a temperature index $0\le t\le 1$ and a sequence of conditional functions $p_t(x|z)$ such that
$$p_0(x|z) | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$
Path sampling is a way to evaluate the log integral by an unbiased estimator. Let us introduce a temperature index $0\le t\le 1$ and a sequence of conditional functions $p_t(x|z)$ such that
$$p_0(x|z)=1\qquad\qquad\text{and}\qquad\qquad p_1(x|z)=p(x|z)... | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$
Path sampling is a way to evaluate the log integral by an unbiased estimator. Let us introduce a temperature index $0\le t\le 1$ and a sequence of conditional functions $p_t(x|z)$ such that
$$p_0(x|z) |
45,251 | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$ | The Monte Carlo estimator using $n$ samples of
$$l = \int p(x \mid z) g(z) dz = E(p(x \mid Z))$$
with $Z\sim g$ is
$$\hat l_n = \frac 1n \sum_{i = 1}p(x\mid Z_i) \qquad Z_i\sim g$$
Following Durbin and Koopman
(1997), the error of the log
marginal likelihood is given by
$$\begin{align*}
\log\hat l_n - \log l
&= \log\... | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$ | The Monte Carlo estimator using $n$ samples of
$$l = \int p(x \mid z) g(z) dz = E(p(x \mid Z))$$
with $Z\sim g$ is
$$\hat l_n = \frac 1n \sum_{i = 1}p(x\mid Z_i) \qquad Z_i\sim g$$
Following Durbin an | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$
The Monte Carlo estimator using $n$ samples of
$$l = \int p(x \mid z) g(z) dz = E(p(x \mid Z))$$
with $Z\sim g$ is
$$\hat l_n = \frac 1n \sum_{i = 1}p(x\mid Z_i) \qquad Z_i\sim g$$
Following Durbin and Koopman
(1997), the error of the log
marginal like... | Unbiased Estimator for $\log\left[\int p(x\mid z)p(z) \, dz\right]$
The Monte Carlo estimator using $n$ samples of
$$l = \int p(x \mid z) g(z) dz = E(p(x \mid Z))$$
with $Z\sim g$ is
$$\hat l_n = \frac 1n \sum_{i = 1}p(x\mid Z_i) \qquad Z_i\sim g$$
Following Durbin an |
45,252 | Regression when both the predictor and outcome variables are proportions | A glm with a binomial distribution and a logit link should work fine. If there are no probabilities of $0$ or $1$, beta regression is another possibility. In this case, they yield almost indistinguishable results (not shown).
The relationship between the logit of the actual and the logit of the estimated probabilities ... | Regression when both the predictor and outcome variables are proportions | A glm with a binomial distribution and a logit link should work fine. If there are no probabilities of $0$ or $1$, beta regression is another possibility. In this case, they yield almost indistinguish | Regression when both the predictor and outcome variables are proportions
A glm with a binomial distribution and a logit link should work fine. If there are no probabilities of $0$ or $1$, beta regression is another possibility. In this case, they yield almost indistinguishable results (not shown).
The relationship betw... | Regression when both the predictor and outcome variables are proportions
A glm with a binomial distribution and a logit link should work fine. If there are no probabilities of $0$ or $1$, beta regression is another possibility. In this case, they yield almost indistinguish |
45,253 | Regression when both the predictor and outcome variables are proportions | Differently from the other answer here which I think is a good answer, I think a linear regression suffices in your exact situation. As a matter of principle, it might be wrong because of the hard bounds on the outcome but a plot of your data suggests why it is a good enough approximation. At both extremes, the mean of... | Regression when both the predictor and outcome variables are proportions | Differently from the other answer here which I think is a good answer, I think a linear regression suffices in your exact situation. As a matter of principle, it might be wrong because of the hard bou | Regression when both the predictor and outcome variables are proportions
Differently from the other answer here which I think is a good answer, I think a linear regression suffices in your exact situation. As a matter of principle, it might be wrong because of the hard bounds on the outcome but a plot of your data sugg... | Regression when both the predictor and outcome variables are proportions
Differently from the other answer here which I think is a good answer, I think a linear regression suffices in your exact situation. As a matter of principle, it might be wrong because of the hard bou |
45,254 | What's the intuition for a Beta Distribution with alpha and / or beta less than 1? | Here is a frivolous example that may have some intuitive value.
In US Major League Baseball each team plays 162 games per season.
Suppose a team is equally likely to win or lose each of its games. What
proportion of the time will such a team have more wins than losses?
(In order to have symmetry, if a team's wins and ... | What's the intuition for a Beta Distribution with alpha and / or beta less than 1? | Here is a frivolous example that may have some intuitive value.
In US Major League Baseball each team plays 162 games per season.
Suppose a team is equally likely to win or lose each of its games. Wha | What's the intuition for a Beta Distribution with alpha and / or beta less than 1?
Here is a frivolous example that may have some intuitive value.
In US Major League Baseball each team plays 162 games per season.
Suppose a team is equally likely to win or lose each of its games. What
proportion of the time will such a... | What's the intuition for a Beta Distribution with alpha and / or beta less than 1?
Here is a frivolous example that may have some intuitive value.
In US Major League Baseball each team plays 162 games per season.
Suppose a team is equally likely to win or lose each of its games. Wha |
45,255 | What's the intuition for a Beta Distribution with alpha and / or beta less than 1? | BruceET's answer really helped me understand this better.
It occurred to me that this "bathtub-shape" is due to any random process with saved state.
So I wanted to write a quick answer that might help others like me, who understand the math and are not novices, but who like to find cases which demonstrate the natural p... | What's the intuition for a Beta Distribution with alpha and / or beta less than 1? | BruceET's answer really helped me understand this better.
It occurred to me that this "bathtub-shape" is due to any random process with saved state.
So I wanted to write a quick answer that might help | What's the intuition for a Beta Distribution with alpha and / or beta less than 1?
BruceET's answer really helped me understand this better.
It occurred to me that this "bathtub-shape" is due to any random process with saved state.
So I wanted to write a quick answer that might help others like me, who understand the m... | What's the intuition for a Beta Distribution with alpha and / or beta less than 1?
BruceET's answer really helped me understand this better.
It occurred to me that this "bathtub-shape" is due to any random process with saved state.
So I wanted to write a quick answer that might help |
45,256 | What's the intuition for a Beta Distribution with alpha and / or beta less than 1? | If you take for example $\alpha=\beta=0.5$, then the pdf looks like a horse-shoe, with high density near ends of the interval $(0,1)$ and low density near $0.5$. So as a prior, it puts a lot of density on the extremes, and that helps the posterior have a similar shape.
I understand it as a device to help the posterior... | What's the intuition for a Beta Distribution with alpha and / or beta less than 1? | If you take for example $\alpha=\beta=0.5$, then the pdf looks like a horse-shoe, with high density near ends of the interval $(0,1)$ and low density near $0.5$. So as a prior, it puts a lot of densit | What's the intuition for a Beta Distribution with alpha and / or beta less than 1?
If you take for example $\alpha=\beta=0.5$, then the pdf looks like a horse-shoe, with high density near ends of the interval $(0,1)$ and low density near $0.5$. So as a prior, it puts a lot of density on the extremes, and that helps the... | What's the intuition for a Beta Distribution with alpha and / or beta less than 1?
If you take for example $\alpha=\beta=0.5$, then the pdf looks like a horse-shoe, with high density near ends of the interval $(0,1)$ and low density near $0.5$. So as a prior, it puts a lot of densit |
45,257 | Notation in statistics (parameter/estimator/estimate) | There is no single answer to this question because different authors may use different notation. For me, the most handy notation is the one used, for example, by Larry Wasserman in All of Statistics:
By convention, we denote a point estimate of $\theta$ by $\hat\theta$
or $\widehat\theta_n$. Remember that $\theta$ i... | Notation in statistics (parameter/estimator/estimate) | There is no single answer to this question because different authors may use different notation. For me, the most handy notation is the one used, for example, by Larry Wasserman in All of Statistics:
| Notation in statistics (parameter/estimator/estimate)
There is no single answer to this question because different authors may use different notation. For me, the most handy notation is the one used, for example, by Larry Wasserman in All of Statistics:
By convention, we denote a point estimate of $\theta$ by $\hat\th... | Notation in statistics (parameter/estimator/estimate)
There is no single answer to this question because different authors may use different notation. For me, the most handy notation is the one used, for example, by Larry Wasserman in All of Statistics:
|
45,258 | Notation in statistics (parameter/estimator/estimate) | You are right that the use of lower-case Greek letters creates a potential ambiguity here; this is a common issue in teaching estimation theory to students. To differentiate between an estimator and the corresponding estimate I find it helpful to use notation that includes the data as an argument value, and thereby st... | Notation in statistics (parameter/estimator/estimate) | You are right that the use of lower-case Greek letters creates a potential ambiguity here; this is a common issue in teaching estimation theory to students. To differentiate between an estimator and | Notation in statistics (parameter/estimator/estimate)
You are right that the use of lower-case Greek letters creates a potential ambiguity here; this is a common issue in teaching estimation theory to students. To differentiate between an estimator and the corresponding estimate I find it helpful to use notation that ... | Notation in statistics (parameter/estimator/estimate)
You are right that the use of lower-case Greek letters creates a potential ambiguity here; this is a common issue in teaching estimation theory to students. To differentiate between an estimator and |
45,259 | Understanding a Coursera exam question on significance testing | The correct response is that only II is true:
I. If you conduct a significance test you assume that the alternative hypothesis
is true unless the data provide strong evidence against it.
False - in any significance test, you must assume that the null hypothesis is true. After all, when we test for significance... | Understanding a Coursera exam question on significance testing | The correct response is that only II is true:
I. If you conduct a significance test you assume that the alternative hypothesis
is true unless the data provide strong evidence against it.
False | Understanding a Coursera exam question on significance testing
The correct response is that only II is true:
I. If you conduct a significance test you assume that the alternative hypothesis
is true unless the data provide strong evidence against it.
False - in any significance test, you must assume that the nul... | Understanding a Coursera exam question on significance testing
The correct response is that only II is true:
I. If you conduct a significance test you assume that the alternative hypothesis
is true unless the data provide strong evidence against it.
False |
45,260 | Sufficient statistics for Uniform $(-\theta,\theta)$ | Suppose we have a random sample $(X_1,X_2,\cdots,X_n)$ drawn from $\mathcal U(-\theta,\theta)$ distribution.
PDF of $X\sim\mathcal U(-\theta,\theta)$ is
$$f(x;\theta)=\frac{1}{2\theta}\mathbf1_{-\theta<x<\theta},\quad\theta>0$$
Joint density of $(X_1,X_2,\cdots,X_n)$ is
\begin{align}f_{\theta}(x_1,x_2,\cdots,x_n)&=\pr... | Sufficient statistics for Uniform $(-\theta,\theta)$ | Suppose we have a random sample $(X_1,X_2,\cdots,X_n)$ drawn from $\mathcal U(-\theta,\theta)$ distribution.
PDF of $X\sim\mathcal U(-\theta,\theta)$ is
$$f(x;\theta)=\frac{1}{2\theta}\mathbf1_{-\the | Sufficient statistics for Uniform $(-\theta,\theta)$
Suppose we have a random sample $(X_1,X_2,\cdots,X_n)$ drawn from $\mathcal U(-\theta,\theta)$ distribution.
PDF of $X\sim\mathcal U(-\theta,\theta)$ is
$$f(x;\theta)=\frac{1}{2\theta}\mathbf1_{-\theta<x<\theta},\quad\theta>0$$
Joint density of $(X_1,X_2,\cdots,X_n)... | Sufficient statistics for Uniform $(-\theta,\theta)$
Suppose we have a random sample $(X_1,X_2,\cdots,X_n)$ drawn from $\mathcal U(-\theta,\theta)$ distribution.
PDF of $X\sim\mathcal U(-\theta,\theta)$ is
$$f(x;\theta)=\frac{1}{2\theta}\mathbf1_{-\the |
45,261 | Consistency of lasso | You'll be disappointed to find that the consistency that matters the most with lasso is the consistency about which predictors are chosen. If you simulate two moderately large datasets and perform lasso independently and compare the results, the low degree of overlap will reveal the difficulty of the task in selecting... | Consistency of lasso | You'll be disappointed to find that the consistency that matters the most with lasso is the consistency about which predictors are chosen. If you simulate two moderately large datasets and perform la | Consistency of lasso
You'll be disappointed to find that the consistency that matters the most with lasso is the consistency about which predictors are chosen. If you simulate two moderately large datasets and perform lasso independently and compare the results, the low degree of overlap will reveal the difficulty of ... | Consistency of lasso
You'll be disappointed to find that the consistency that matters the most with lasso is the consistency about which predictors are chosen. If you simulate two moderately large datasets and perform la |
45,262 | Why is the $x$ axis for a histogram labeled "bin"? | When wanting to create a histogram of a continuous variable, you first need to split those into bins (sometimes referred to as buckets). Subsequently, this procedure is called binning or bucketing.
So the x-axis of a histogram represents the bins of the continuous variable. | Why is the $x$ axis for a histogram labeled "bin"? | When wanting to create a histogram of a continuous variable, you first need to split those into bins (sometimes referred to as buckets). Subsequently, this procedure is called binning or bucketing.
So | Why is the $x$ axis for a histogram labeled "bin"?
When wanting to create a histogram of a continuous variable, you first need to split those into bins (sometimes referred to as buckets). Subsequently, this procedure is called binning or bucketing.
So the x-axis of a histogram represents the bins of the continuous vari... | Why is the $x$ axis for a histogram labeled "bin"?
When wanting to create a histogram of a continuous variable, you first need to split those into bins (sometimes referred to as buckets). Subsequently, this procedure is called binning or bucketing.
So |
45,263 | What is the Difference between Inductive Reasoning and Statistical Inference? | Definitions:
Lots of definitions abound, here is two I found that basically speak for the others I read
‘Inductive reasoning is the opposite of deductive reasoning. Inductive reasoning makes broad generalizations from specific observations.’ (https://www.livescience.com/21569-deduction-vs-induction.html)
‘Statistical i... | What is the Difference between Inductive Reasoning and Statistical Inference? | Definitions:
Lots of definitions abound, here is two I found that basically speak for the others I read
‘Inductive reasoning is the opposite of deductive reasoning. Inductive reasoning makes broad gen | What is the Difference between Inductive Reasoning and Statistical Inference?
Definitions:
Lots of definitions abound, here is two I found that basically speak for the others I read
‘Inductive reasoning is the opposite of deductive reasoning. Inductive reasoning makes broad generalizations from specific observations.’ ... | What is the Difference between Inductive Reasoning and Statistical Inference?
Definitions:
Lots of definitions abound, here is two I found that basically speak for the others I read
‘Inductive reasoning is the opposite of deductive reasoning. Inductive reasoning makes broad gen |
45,264 | What is the Difference between Inductive Reasoning and Statistical Inference? | Inductive reasoning refers broadly to the general process of making inferences about unknowns from knowns, and usually involves some attempt to measure the evidential support for an uncertain proposition, based on what is known. It is distinguished from deductive reasoning insofar as the truth or falsity of the uncert... | What is the Difference between Inductive Reasoning and Statistical Inference? | Inductive reasoning refers broadly to the general process of making inferences about unknowns from knowns, and usually involves some attempt to measure the evidential support for an uncertain proposit | What is the Difference between Inductive Reasoning and Statistical Inference?
Inductive reasoning refers broadly to the general process of making inferences about unknowns from knowns, and usually involves some attempt to measure the evidential support for an uncertain proposition, based on what is known. It is distin... | What is the Difference between Inductive Reasoning and Statistical Inference?
Inductive reasoning refers broadly to the general process of making inferences about unknowns from knowns, and usually involves some attempt to measure the evidential support for an uncertain proposit |
45,265 | Can you weight observations in a Neural Network? | Yes, this is possible and often done. However, it seems to me that it is not currently possible to do using scikit-learn. To certain extent you could simulate this by duplicating samples in the training and validation set to increase their weight, but it is certainly not an efficient way to achieve it.
If you plan usin... | Can you weight observations in a Neural Network? | Yes, this is possible and often done. However, it seems to me that it is not currently possible to do using scikit-learn. To certain extent you could simulate this by duplicating samples in the traini | Can you weight observations in a Neural Network?
Yes, this is possible and often done. However, it seems to me that it is not currently possible to do using scikit-learn. To certain extent you could simulate this by duplicating samples in the training and validation set to increase their weight, but it is certainly not... | Can you weight observations in a Neural Network?
Yes, this is possible and often done. However, it seems to me that it is not currently possible to do using scikit-learn. To certain extent you could simulate this by duplicating samples in the traini |
45,266 | Can you weight observations in a Neural Network? | I would share a hack: copy data. This hack works on most models.
For example, if you find data point 1 is super important, make 5 copies of it. This hack can also be used to make the loss function more sensitive to certain class. | Can you weight observations in a Neural Network? | I would share a hack: copy data. This hack works on most models.
For example, if you find data point 1 is super important, make 5 copies of it. This hack can also be used to make the loss function mor | Can you weight observations in a Neural Network?
I would share a hack: copy data. This hack works on most models.
For example, if you find data point 1 is super important, make 5 copies of it. This hack can also be used to make the loss function more sensitive to certain class. | Can you weight observations in a Neural Network?
I would share a hack: copy data. This hack works on most models.
For example, if you find data point 1 is super important, make 5 copies of it. This hack can also be used to make the loss function mor |
45,267 | Can you weight observations in a Neural Network? | As @Jan Kukacka mentioned, scikit-learn does not support sample_weights for the MLPClassifier learner. However, the skorch package which wraps PyTorch neural networks to have the same API as sklearn has some support for it built in. You can find more information on how to do it in skorch's FAQ. | Can you weight observations in a Neural Network? | As @Jan Kukacka mentioned, scikit-learn does not support sample_weights for the MLPClassifier learner. However, the skorch package which wraps PyTorch neural networks to have the same API as sklearn | Can you weight observations in a Neural Network?
As @Jan Kukacka mentioned, scikit-learn does not support sample_weights for the MLPClassifier learner. However, the skorch package which wraps PyTorch neural networks to have the same API as sklearn has some support for it built in. You can find more information on how... | Can you weight observations in a Neural Network?
As @Jan Kukacka mentioned, scikit-learn does not support sample_weights for the MLPClassifier learner. However, the skorch package which wraps PyTorch neural networks to have the same API as sklearn |
45,268 | Covariance, bernoulli distribution and instrumental variables | The standard formula does work, just needs a bit of manipulation
$$Cov(y,z) = E(yz) - E(y)E(z) = E(yz\mid z=1)P(z=1) - E(y)p$$
$$[E(y\mid z=1) - E(y)]p = \Big[E(y\mid z=1) - \big[E(y|z=1)p + E(y\mid z=0)(1-p)\big]\Big]p$$
$$=\Big[ E(y \mid z=1)(1-p) - E(y \mid z=0)(1-p) \Big]p$$
$$=\Big[ E(y \mid z=1) - E(y \mid z=0) \... | Covariance, bernoulli distribution and instrumental variables | The standard formula does work, just needs a bit of manipulation
$$Cov(y,z) = E(yz) - E(y)E(z) = E(yz\mid z=1)P(z=1) - E(y)p$$
$$[E(y\mid z=1) - E(y)]p = \Big[E(y\mid z=1) - \big[E(y|z=1)p + E(y\mid z | Covariance, bernoulli distribution and instrumental variables
The standard formula does work, just needs a bit of manipulation
$$Cov(y,z) = E(yz) - E(y)E(z) = E(yz\mid z=1)P(z=1) - E(y)p$$
$$[E(y\mid z=1) - E(y)]p = \Big[E(y\mid z=1) - \big[E(y|z=1)p + E(y\mid z=0)(1-p)\big]\Big]p$$
$$=\Big[ E(y \mid z=1)(1-p) - E(y \m... | Covariance, bernoulli distribution and instrumental variables
The standard formula does work, just needs a bit of manipulation
$$Cov(y,z) = E(yz) - E(y)E(z) = E(yz\mid z=1)P(z=1) - E(y)p$$
$$[E(y\mid z=1) - E(y)]p = \Big[E(y\mid z=1) - \big[E(y|z=1)p + E(y\mid z |
45,269 | Covariance, bernoulli distribution and instrumental variables | Consider the ordinary least squares fit of $Y$ to $Z$:
Because the mean of univariate data minimizes the sum of squared residuals, this fit must rise from the mean of the $Y$ values associated with $Z=0$ (left hand red point) to the mean of the $Y$ values associated with $Z=1$ (right hand red point). Since $Z$ change... | Covariance, bernoulli distribution and instrumental variables | Consider the ordinary least squares fit of $Y$ to $Z$:
Because the mean of univariate data minimizes the sum of squared residuals, this fit must rise from the mean of the $Y$ values associated with $ | Covariance, bernoulli distribution and instrumental variables
Consider the ordinary least squares fit of $Y$ to $Z$:
Because the mean of univariate data minimizes the sum of squared residuals, this fit must rise from the mean of the $Y$ values associated with $Z=0$ (left hand red point) to the mean of the $Y$ values a... | Covariance, bernoulli distribution and instrumental variables
Consider the ordinary least squares fit of $Y$ to $Z$:
Because the mean of univariate data minimizes the sum of squared residuals, this fit must rise from the mean of the $Y$ values associated with $ |
45,270 | Does scaling a central $\chi^2$ distribution produce a non-central $\chi^2$ distribution? | Unfortunately, the Wikipedia article on "F-test of equality of variances" is incorrect. When the variances are unequal, the distribution of $F$ is neither $F$ nor non-central $F$, it is simply scaled $F$.
The non-central chi-squared distribution on k df specifically refers to the distribution of
$$\sum_{i=1}^k (Z_i+\de... | Does scaling a central $\chi^2$ distribution produce a non-central $\chi^2$ distribution? | Unfortunately, the Wikipedia article on "F-test of equality of variances" is incorrect. When the variances are unequal, the distribution of $F$ is neither $F$ nor non-central $F$, it is simply scaled | Does scaling a central $\chi^2$ distribution produce a non-central $\chi^2$ distribution?
Unfortunately, the Wikipedia article on "F-test of equality of variances" is incorrect. When the variances are unequal, the distribution of $F$ is neither $F$ nor non-central $F$, it is simply scaled $F$.
The non-central chi-squar... | Does scaling a central $\chi^2$ distribution produce a non-central $\chi^2$ distribution?
Unfortunately, the Wikipedia article on "F-test of equality of variances" is incorrect. When the variances are unequal, the distribution of $F$ is neither $F$ nor non-central $F$, it is simply scaled |
45,271 | Difference between a markov process and a semi- markov process | I will discuss only Markov processes on finite or countable state spaces. My answer is based off of this page.
Suppose $s > t_n > ... > t_1$. A Markov process is a stochastic process where the conditional distribution of $X_s$ given $X_{t_1}, X_{t_2}, ... X_{t_n}$ depends only $X_{t_n}$.
One consequence of this defin... | Difference between a markov process and a semi- markov process | I will discuss only Markov processes on finite or countable state spaces. My answer is based off of this page.
Suppose $s > t_n > ... > t_1$. A Markov process is a stochastic process where the condit | Difference between a markov process and a semi- markov process
I will discuss only Markov processes on finite or countable state spaces. My answer is based off of this page.
Suppose $s > t_n > ... > t_1$. A Markov process is a stochastic process where the conditional distribution of $X_s$ given $X_{t_1}, X_{t_2}, ... ... | Difference between a markov process and a semi- markov process
I will discuss only Markov processes on finite or countable state spaces. My answer is based off of this page.
Suppose $s > t_n > ... > t_1$. A Markov process is a stochastic process where the condit |
45,272 | What variables need to be controlled for in regression? | If there are theoretical grounds for suspecting a variable is a confounder, then it should be included in the model to correct for its effect. On the other hand, mediators should generally not be included in the model. While it might seem like a good idea to correct for as many potential confounders as possible, there ... | What variables need to be controlled for in regression? | If there are theoretical grounds for suspecting a variable is a confounder, then it should be included in the model to correct for its effect. On the other hand, mediators should generally not be incl | What variables need to be controlled for in regression?
If there are theoretical grounds for suspecting a variable is a confounder, then it should be included in the model to correct for its effect. On the other hand, mediators should generally not be included in the model. While it might seem like a good idea to corre... | What variables need to be controlled for in regression?
If there are theoretical grounds for suspecting a variable is a confounder, then it should be included in the model to correct for its effect. On the other hand, mediators should generally not be incl |
45,273 | What variables need to be controlled for in regression? | However, there exists unlimited variables in the universe. And in
psychology/epidemiology research, there are a lot of demographic
variables (e.g., age, gender, income, marital status, number of
children, etc). When do we need to control for them? Is there a rule
of thumb?
If you are worried about observationa... | What variables need to be controlled for in regression? | However, there exists unlimited variables in the universe. And in
psychology/epidemiology research, there are a lot of demographic
variables (e.g., age, gender, income, marital status, number of
| What variables need to be controlled for in regression?
However, there exists unlimited variables in the universe. And in
psychology/epidemiology research, there are a lot of demographic
variables (e.g., age, gender, income, marital status, number of
children, etc). When do we need to control for them? Is there a... | What variables need to be controlled for in regression?
However, there exists unlimited variables in the universe. And in
psychology/epidemiology research, there are a lot of demographic
variables (e.g., age, gender, income, marital status, number of
|
45,274 | What variables need to be controlled for in regression? | Just to add one remark to @Frans Rodenburg's answer: Overadjustment might also be an issue. I.e. you don't want to control for variables for which it is not meaningful to keep them fixed when the variable of interested is varied. This is typical if the variable lies in the causal pathway from the exposure to the endpoi... | What variables need to be controlled for in regression? | Just to add one remark to @Frans Rodenburg's answer: Overadjustment might also be an issue. I.e. you don't want to control for variables for which it is not meaningful to keep them fixed when the vari | What variables need to be controlled for in regression?
Just to add one remark to @Frans Rodenburg's answer: Overadjustment might also be an issue. I.e. you don't want to control for variables for which it is not meaningful to keep them fixed when the variable of interested is varied. This is typical if the variable li... | What variables need to be controlled for in regression?
Just to add one remark to @Frans Rodenburg's answer: Overadjustment might also be an issue. I.e. you don't want to control for variables for which it is not meaningful to keep them fixed when the vari |
45,275 | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true? | Here's one case: $X,Y$ are bivariate Normal, each with mean $0$.
\begin{align*}
E[X \mid Y] &= EX + \rho \frac{\sigma_X}{\sigma_Y}[Y - EY] \\
&= \frac{E[XY]}{EY^2 - [EY]^2}Y\\
&= \frac{E[XY]Y}{E[Y^2]}.
\end{align*} | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true? | Here's one case: $X,Y$ are bivariate Normal, each with mean $0$.
\begin{align*}
E[X \mid Y] &= EX + \rho \frac{\sigma_X}{\sigma_Y}[Y - EY] \\
&= \frac{E[XY]}{EY^2 - [EY]^2}Y\\
&= \frac{E[XY]Y}{E[Y^2] | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true?
Here's one case: $X,Y$ are bivariate Normal, each with mean $0$.
\begin{align*}
E[X \mid Y] &= EX + \rho \frac{\sigma_X}{\sigma_Y}[Y - EY] \\
&= \frac{E[XY]}{EY^2 - [EY]^2}Y\\
&= \frac{E[XY]Y}{E[Y^2]}.
\end{align*} | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true?
Here's one case: $X,Y$ are bivariate Normal, each with mean $0$.
\begin{align*}
E[X \mid Y] &= EX + \rho \frac{\sigma_X}{\sigma_Y}[Y - EY] \\
&= \frac{E[XY]}{EY^2 - [EY]^2}Y\\
&= \frac{E[XY]Y}{E[Y^2] |
45,276 | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true? | $E[X \mid Y]$ is a random variable that is a function of the random variable $Y$ (not $X$), say $g(Y)$ and it is the minimum mean-square error (MMSE) estimator of $X$ in terms of $Y$. That is, $g(\cdot)$ is the (measurable) function that minimizes the mean-square error $E[(X-h(Y))^2]$ over all choices of (measurable) f... | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true? | $E[X \mid Y]$ is a random variable that is a function of the random variable $Y$ (not $X$), say $g(Y)$ and it is the minimum mean-square error (MMSE) estimator of $X$ in terms of $Y$. That is, $g(\cdo | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true?
$E[X \mid Y]$ is a random variable that is a function of the random variable $Y$ (not $X$), say $g(Y)$ and it is the minimum mean-square error (MMSE) estimator of $X$ in terms of $Y$. That is, $g(\cdot)$ is the (measurable) function that minimizes the mean-square error $E[... | When is $E[X|Y]= \frac{E[XY]Y}{E[Y^2]} $ true?
$E[X \mid Y]$ is a random variable that is a function of the random variable $Y$ (not $X$), say $g(Y)$ and it is the minimum mean-square error (MMSE) estimator of $X$ in terms of $Y$. That is, $g(\cdo |
45,277 | What is a "benchmark" time-series model? | This is not specific to arima, but to all forecasting methods - and indeed to any kind of prediction exercise.
The idea is that it is always easy to cook up an enormously complex and very impressive forecasting/prediction method. The hard part is showing that this shiny contraption actually improves on the forecasts/pr... | What is a "benchmark" time-series model? | This is not specific to arima, but to all forecasting methods - and indeed to any kind of prediction exercise.
The idea is that it is always easy to cook up an enormously complex and very impressive f | What is a "benchmark" time-series model?
This is not specific to arima, but to all forecasting methods - and indeed to any kind of prediction exercise.
The idea is that it is always easy to cook up an enormously complex and very impressive forecasting/prediction method. The hard part is showing that this shiny contrapt... | What is a "benchmark" time-series model?
This is not specific to arima, but to all forecasting methods - and indeed to any kind of prediction exercise.
The idea is that it is always easy to cook up an enormously complex and very impressive f |
45,278 | What is a "benchmark" time-series model? | Benchmark is a very simple model. I don't know of any standard definition, and I've seen the term applied multiple times with very different meanings. For example, in this competition, for each timeseries, they used the last two points to create a trendline. Here they use the median per series, and here they use S&P500... | What is a "benchmark" time-series model? | Benchmark is a very simple model. I don't know of any standard definition, and I've seen the term applied multiple times with very different meanings. For example, in this competition, for each timese | What is a "benchmark" time-series model?
Benchmark is a very simple model. I don't know of any standard definition, and I've seen the term applied multiple times with very different meanings. For example, in this competition, for each timeseries, they used the last two points to create a trendline. Here they use the me... | What is a "benchmark" time-series model?
Benchmark is a very simple model. I don't know of any standard definition, and I've seen the term applied multiple times with very different meanings. For example, in this competition, for each timese |
45,279 | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$? | The notation is overloaded (or abused) so $p$ refers both to the probability density function as well as to the distribution. This seems a lot simpler than to have say capital letters indicate the distribution and lower case letters indicate the pdf/pmf.
Alternatively the $\sim$ notation can be thought of as overloade... | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$? | The notation is overloaded (or abused) so $p$ refers both to the probability density function as well as to the distribution. This seems a lot simpler than to have say capital letters indicate the dis | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$?
The notation is overloaded (or abused) so $p$ refers both to the probability density function as well as to the distribution. This seems a lot simpler than to have say capital letters indicate the distribution and lower case letters i... | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$?
The notation is overloaded (or abused) so $p$ refers both to the probability density function as well as to the distribution. This seems a lot simpler than to have say capital letters indicate the dis |
45,280 | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$? | The notation is very misleading with $p(\cdot)$ being heavily overloaded with multiple meanings and complete disregard for the difference between random variables and the values that they take on.
There is a parameter $\theta$ of unknown value which is modeled as a random variable $\Theta$, discrete or continuous depen... | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$? | The notation is very misleading with $p(\cdot)$ being heavily overloaded with multiple meanings and complete disregard for the difference between random variables and the values that they take on.
The | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$?
The notation is very misleading with $p(\cdot)$ being heavily overloaded with multiple meanings and complete disregard for the difference between random variables and the values that they take on.
There is a parameter $\theta$ of unkn... | What is the meaning of the notation $\theta \sim p(\theta)$ and $y \sim p(y|\theta)$?
The notation is very misleading with $p(\cdot)$ being heavily overloaded with multiple meanings and complete disregard for the difference between random variables and the values that they take on.
The |
45,281 | What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution? | First we formulate the question in the notation of a probability. We are looking for $p(x_1<x_2, x_3<x_2)$. Now we can simply expand this based on the rules of conditional probability as:
$$p(x_1<x_2, x_3<x_2) = \int_0^1 p(x_1<x_2, x_3<x_2|x_2)p(x_2) dx_2$$
We also know that, given we are working with uniform[0,1] var... | What is the expected length of an iid sequence that is monotonically increasing when drawn from a un | First we formulate the question in the notation of a probability. We are looking for $p(x_1<x_2, x_3<x_2)$. Now we can simply expand this based on the rules of conditional probability as:
$$p(x_1<x_2 | What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
First we formulate the question in the notation of a probability. We are looking for $p(x_1<x_2, x_3<x_2)$. Now we can simply expand this based on the rules of conditional probability as:
$$p(x... | What is the expected length of an iid sequence that is monotonically increasing when drawn from a un
First we formulate the question in the notation of a probability. We are looking for $p(x_1<x_2, x_3<x_2)$. Now we can simply expand this based on the rules of conditional probability as:
$$p(x_1<x_2 |
45,282 | What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution? | Let $F$ be the joint multivariate distribution. You seek, by definition,
$$\Pr(X_1\lt X_2; X_3 \lt X_2) = \iiint_{x_1\lt x_2; x_3\lt x_2}dF(x_1,x_2,x_3).$$
To compute it, notice that
The variables, being iid, are exchangeable;
The event $\mathcal{E}_2 = X_1 \lt X_2; X_3 \lt X_2$ is converted into $\mathcal{E}_1 = X_... | What is the expected length of an iid sequence that is monotonically increasing when drawn from a un | Let $F$ be the joint multivariate distribution. You seek, by definition,
$$\Pr(X_1\lt X_2; X_3 \lt X_2) = \iiint_{x_1\lt x_2; x_3\lt x_2}dF(x_1,x_2,x_3).$$
To compute it, notice that
The variables, | What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?
Let $F$ be the joint multivariate distribution. You seek, by definition,
$$\Pr(X_1\lt X_2; X_3 \lt X_2) = \iiint_{x_1\lt x_2; x_3\lt x_2}dF(x_1,x_2,x_3).$$
To compute it, notice that
The vari... | What is the expected length of an iid sequence that is monotonically increasing when drawn from a un
Let $F$ be the joint multivariate distribution. You seek, by definition,
$$\Pr(X_1\lt X_2; X_3 \lt X_2) = \iiint_{x_1\lt x_2; x_3\lt x_2}dF(x_1,x_2,x_3).$$
To compute it, notice that
The variables, |
45,283 | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3$? | OK, for this answer I will assume the independent random variables have moment generating functions (mgf) existing in some open interval containing zero. To dispel one possible doubt, mgf's can never be zero, since they are given by expectation of an exponential function $\DeclareMathOperator{\E}{\mathbb{E}} M_X(t) = ... | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3 | OK, for this answer I will assume the independent random variables have moment generating functions (mgf) existing in some open interval containing zero. To dispel one possible doubt, mgf's can never | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3$?
OK, for this answer I will assume the independent random variables have moment generating functions (mgf) existing in some open interval containing zero. To dispel one possible doubt, mgf's can never be zero, since t... | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3
OK, for this answer I will assume the independent random variables have moment generating functions (mgf) existing in some open interval containing zero. To dispel one possible doubt, mgf's can never |
45,284 | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3$? | In general, no.
The proof given by @kjetil b halvorsen is fine, as long as the moment generating function exists.
However, there are counter examples when it does not. First, we need to recall a theorem by Polya. (More details can be found in the article Remarks on characterisic functions by G. Polya)
If φ is a real-va... | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3 | In general, no.
The proof given by @kjetil b halvorsen is fine, as long as the moment generating function exists.
However, there are counter examples when it does not. First, we need to recall a theor | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3$?
In general, no.
The proof given by @kjetil b halvorsen is fine, as long as the moment generating function exists.
However, there are counter examples when it does not. First, we need to recall a theorem by Polya. (Mor... | For independent RVs $X_1,X_2,X_3$, does $X_1+X_2\stackrel{d}{=}X_1+X_3$ imply $X_2\stackrel{d}{=}X_3
In general, no.
The proof given by @kjetil b halvorsen is fine, as long as the moment generating function exists.
However, there are counter examples when it does not. First, we need to recall a theor |
45,285 | Proof of MSE is unbiased estimator in Regression | Martijn Weterings's commnet is very useful. Your derivation of term 2 is wrong.
$\epsilon'X (\beta - \hat \beta) \\= \epsilon'X(\beta - (X'X)^{-1}X'Y) \\=\epsilon'X\left\{\beta - (X'X)^{-1}X'(X\beta+\epsilon)\right\}\\=\epsilon'X \left\{\beta-(X'X)^{-1}X'X\beta -(X'X)^{-1}X'\epsilon\right\}\\=-\epsilon'X(X'X)^{-1}X'\ep... | Proof of MSE is unbiased estimator in Regression | Martijn Weterings's commnet is very useful. Your derivation of term 2 is wrong.
$\epsilon'X (\beta - \hat \beta) \\= \epsilon'X(\beta - (X'X)^{-1}X'Y) \\=\epsilon'X\left\{\beta - (X'X)^{-1}X'(X\beta+\ | Proof of MSE is unbiased estimator in Regression
Martijn Weterings's commnet is very useful. Your derivation of term 2 is wrong.
$\epsilon'X (\beta - \hat \beta) \\= \epsilon'X(\beta - (X'X)^{-1}X'Y) \\=\epsilon'X\left\{\beta - (X'X)^{-1}X'(X\beta+\epsilon)\right\}\\=\epsilon'X \left\{\beta-(X'X)^{-1}X'X\beta -(X'X)^{-... | Proof of MSE is unbiased estimator in Regression
Martijn Weterings's commnet is very useful. Your derivation of term 2 is wrong.
$\epsilon'X (\beta - \hat \beta) \\= \epsilon'X(\beta - (X'X)^{-1}X'Y) \\=\epsilon'X\left\{\beta - (X'X)^{-1}X'(X\beta+\ |
45,286 | Proof of MSE is unbiased estimator in Regression | A less computationally intensive method would be
$$
\begin{aligned}
e&=y-\hat{y}\\
\Sigma(y[k]-\hat{y}[k])^2&=e^Te\\
y-\hat{y}&=\phi\theta-\phi\hat{\theta}+\epsilon\\
&=\phi\theta-\phi(\phi^T\phi)^{-1}\phi^Ty+\epsilon\\
&=\phi\theta-\phi(\phi^T\phi)^{-1}\phi^T(\phi\theta+\epsilon)+\epsilon\\
&=-\phi(\phi^T\phi)^{-1}\ph... | Proof of MSE is unbiased estimator in Regression | A less computationally intensive method would be
$$
\begin{aligned}
e&=y-\hat{y}\\
\Sigma(y[k]-\hat{y}[k])^2&=e^Te\\
y-\hat{y}&=\phi\theta-\phi\hat{\theta}+\epsilon\\
&=\phi\theta-\phi(\phi^T\phi)^{-1 | Proof of MSE is unbiased estimator in Regression
A less computationally intensive method would be
$$
\begin{aligned}
e&=y-\hat{y}\\
\Sigma(y[k]-\hat{y}[k])^2&=e^Te\\
y-\hat{y}&=\phi\theta-\phi\hat{\theta}+\epsilon\\
&=\phi\theta-\phi(\phi^T\phi)^{-1}\phi^Ty+\epsilon\\
&=\phi\theta-\phi(\phi^T\phi)^{-1}\phi^T(\phi\theta... | Proof of MSE is unbiased estimator in Regression
A less computationally intensive method would be
$$
\begin{aligned}
e&=y-\hat{y}\\
\Sigma(y[k]-\hat{y}[k])^2&=e^Te\\
y-\hat{y}&=\phi\theta-\phi\hat{\theta}+\epsilon\\
&=\phi\theta-\phi(\phi^T\phi)^{-1 |
45,287 | Defining gradient function argument in optim function-R | In R, the default method used in optim is Nelder-Mead, which does not use gradients for optimization. As such, it's pretty slow. ?optim states that this method is robust...but I'd say that's false advertising; it can often return a sub-optimal solution for easy problems with no warnings.
Because this method does not us... | Defining gradient function argument in optim function-R | In R, the default method used in optim is Nelder-Mead, which does not use gradients for optimization. As such, it's pretty slow. ?optim states that this method is robust...but I'd say that's false adv | Defining gradient function argument in optim function-R
In R, the default method used in optim is Nelder-Mead, which does not use gradients for optimization. As such, it's pretty slow. ?optim states that this method is robust...but I'd say that's false advertising; it can often return a sub-optimal solution for easy pr... | Defining gradient function argument in optim function-R
In R, the default method used in optim is Nelder-Mead, which does not use gradients for optimization. As such, it's pretty slow. ?optim states that this method is robust...but I'd say that's false adv |
45,288 | How many ways to make a straight flush in 7 card poker? (53 card deck with joker) | I found 210,964 hands of 7 cards that contain at least one 5-card straight flush, using the following Python 3 program, which takes about 21 minutes to run on my laptop.
from itertools import combinations
from functools import lru_cache
JACK, QUEEN, KING, ACE = 11, 12, 13, 14
N_HANDS = 154143080 # 53 choose 7
... | How many ways to make a straight flush in 7 card poker? (53 card deck with joker) | I found 210,964 hands of 7 cards that contain at least one 5-card straight flush, using the following Python 3 program, which takes about 21 minutes to run on my laptop.
from itertools import combinat | How many ways to make a straight flush in 7 card poker? (53 card deck with joker)
I found 210,964 hands of 7 cards that contain at least one 5-card straight flush, using the following Python 3 program, which takes about 21 minutes to run on my laptop.
from itertools import combinations
from functools import lru_cache
... | How many ways to make a straight flush in 7 card poker? (53 card deck with joker)
I found 210,964 hands of 7 cards that contain at least one 5-card straight flush, using the following Python 3 program, which takes about 21 minutes to run on my laptop.
from itertools import combinat |
45,289 | How many ways to make a straight flush in 7 card poker? (53 card deck with joker) | If you think about how you might go about writing efficient code to enumerate all the straight flushes, you can develop a mathematical formula--which is the ultimate efficiency! I will not in fact bring you all the way to such a formula, because it's a nuisance. Instead, I will show how to short-circuit both the comp... | How many ways to make a straight flush in 7 card poker? (53 card deck with joker) | If you think about how you might go about writing efficient code to enumerate all the straight flushes, you can develop a mathematical formula--which is the ultimate efficiency! I will not in fact br | How many ways to make a straight flush in 7 card poker? (53 card deck with joker)
If you think about how you might go about writing efficient code to enumerate all the straight flushes, you can develop a mathematical formula--which is the ultimate efficiency! I will not in fact bring you all the way to such a formula,... | How many ways to make a straight flush in 7 card poker? (53 card deck with joker)
If you think about how you might go about writing efficient code to enumerate all the straight flushes, you can develop a mathematical formula--which is the ultimate efficiency! I will not in fact br |
45,290 | How many ways to make a straight flush in 7 card poker? (53 card deck with joker) | Start with how many ways to make a straight
There are 10 as an Ace can be used as low (wheel)
No blocker on an Ace high straight
On any other straight you cannot have the next higher card above or it turns into another straight
1 2 3 4 5 6 7 8 9 10
A x b
K x... | How many ways to make a straight flush in 7 card poker? (53 card deck with joker) | Start with how many ways to make a straight
There are 10 as an Ace can be used as low (wheel)
No blocker on an Ace high straight
On any other straight you cannot have the next higher card above or it | How many ways to make a straight flush in 7 card poker? (53 card deck with joker)
Start with how many ways to make a straight
There are 10 as an Ace can be used as low (wheel)
No blocker on an Ace high straight
On any other straight you cannot have the next higher card above or it turns into another straight
1 ... | How many ways to make a straight flush in 7 card poker? (53 card deck with joker)
Start with how many ways to make a straight
There are 10 as an Ace can be used as low (wheel)
No blocker on an Ace high straight
On any other straight you cannot have the next higher card above or it |
45,291 | Tune alpha and lambda parameters of elastic nets in an optimal way | Cross-validation is a noisy process and you shouldn't expect the results from two runs to be similar, even if everything is working fine. You can try repeating your experiment several times and see what happens.
That said, here's a narrow answer to this specific question:
Question: How could I tune alpha and lambda fo... | Tune alpha and lambda parameters of elastic nets in an optimal way | Cross-validation is a noisy process and you shouldn't expect the results from two runs to be similar, even if everything is working fine. You can try repeating your experiment several times and see wh | Tune alpha and lambda parameters of elastic nets in an optimal way
Cross-validation is a noisy process and you shouldn't expect the results from two runs to be similar, even if everything is working fine. You can try repeating your experiment several times and see what happens.
That said, here's a narrow answer to this... | Tune alpha and lambda parameters of elastic nets in an optimal way
Cross-validation is a noisy process and you shouldn't expect the results from two runs to be similar, even if everything is working fine. You can try repeating your experiment several times and see wh |
45,292 | How to understand the definition of empirical distribution function | Why is $\frac{1}{n}$ called mass?
The term "mass" refers to an amount of probability at a single discrete point, as distinct from "density" in relation to continuous distributions.
The CDF puts mass $\frac{1}{n}$ to each data point $X_i$, then, by my understanding, it should be $\frac{1}{n}X_1+\frac{1}{n}X_2+...+\fra... | How to understand the definition of empirical distribution function | Why is $\frac{1}{n}$ called mass?
The term "mass" refers to an amount of probability at a single discrete point, as distinct from "density" in relation to continuous distributions.
The CDF puts mass | How to understand the definition of empirical distribution function
Why is $\frac{1}{n}$ called mass?
The term "mass" refers to an amount of probability at a single discrete point, as distinct from "density" in relation to continuous distributions.
The CDF puts mass $\frac{1}{n}$ to each data point $X_i$, then, by my... | How to understand the definition of empirical distribution function
Why is $\frac{1}{n}$ called mass?
The term "mass" refers to an amount of probability at a single discrete point, as distinct from "density" in relation to continuous distributions.
The CDF puts mass |
45,293 | Probability of gaussian being smaller than multiple other gaussians | Let $C = \{X_1 < \min\{X_2,X_3\}\} = \{(X_1 < X_2)\cap (X_1 < X_3)\}$. Even if the $X_i$ are independent random variables (a condition that the OP has not included), the events $(X_1 < X_2)$ and $(X_1 < X_3)$ are not independent events, and so $P(C) \neq P((X_1 < X_2)P(X_1 < X_3)$. However, continuing to assume indepen... | Probability of gaussian being smaller than multiple other gaussians | Let $C = \{X_1 < \min\{X_2,X_3\}\} = \{(X_1 < X_2)\cap (X_1 < X_3)\}$. Even if the $X_i$ are independent random variables (a condition that the OP has not included), the events $(X_1 < X_2)$ and $(X_1 | Probability of gaussian being smaller than multiple other gaussians
Let $C = \{X_1 < \min\{X_2,X_3\}\} = \{(X_1 < X_2)\cap (X_1 < X_3)\}$. Even if the $X_i$ are independent random variables (a condition that the OP has not included), the events $(X_1 < X_2)$ and $(X_1 < X_3)$ are not independent events, and so $P(C) \n... | Probability of gaussian being smaller than multiple other gaussians
Let $C = \{X_1 < \min\{X_2,X_3\}\} = \{(X_1 < X_2)\cap (X_1 < X_3)\}$. Even if the $X_i$ are independent random variables (a condition that the OP has not included), the events $(X_1 < X_2)$ and $(X_1 |
45,294 | Probability of gaussian being smaller than multiple other gaussians | In general, your answer is not correct because $P(X<Y)$ and $P(X<Z)$ are not independent and therefore you can't multiply them to get the probability of the intersection.
I'll show a counterexample.
Let $X$, $Y$ and $Z$ be independent random variables with the same distribution. Then all possible permutations are equal... | Probability of gaussian being smaller than multiple other gaussians | In general, your answer is not correct because $P(X<Y)$ and $P(X<Z)$ are not independent and therefore you can't multiply them to get the probability of the intersection.
I'll show a counterexample.
L | Probability of gaussian being smaller than multiple other gaussians
In general, your answer is not correct because $P(X<Y)$ and $P(X<Z)$ are not independent and therefore you can't multiply them to get the probability of the intersection.
I'll show a counterexample.
Let $X$, $Y$ and $Z$ be independent random variables ... | Probability of gaussian being smaller than multiple other gaussians
In general, your answer is not correct because $P(X<Y)$ and $P(X<Z)$ are not independent and therefore you can't multiply them to get the probability of the intersection.
I'll show a counterexample.
L |
45,295 | Comparing a clustering algorithm partition to a "ground truth" one | The Adjusted Rand index could work. It's a popular method for measuring the similarity of two ways of assigning discrete labels to the data, ignoring permutations of the labels themselves. Instead of checking whether the raw class/cluster labels match, you'd look at pairs of points and ask: to what extent are pairs in ... | Comparing a clustering algorithm partition to a "ground truth" one | The Adjusted Rand index could work. It's a popular method for measuring the similarity of two ways of assigning discrete labels to the data, ignoring permutations of the labels themselves. Instead of | Comparing a clustering algorithm partition to a "ground truth" one
The Adjusted Rand index could work. It's a popular method for measuring the similarity of two ways of assigning discrete labels to the data, ignoring permutations of the labels themselves. Instead of checking whether the raw class/cluster labels match, ... | Comparing a clustering algorithm partition to a "ground truth" one
The Adjusted Rand index could work. It's a popular method for measuring the similarity of two ways of assigning discrete labels to the data, ignoring permutations of the labels themselves. Instead of |
45,296 | SVM - number of dimensions greater than number of samples would give good or bad performance? | SVMs, like many other linear models, are based on empirical risk minimization, which leads us to an optimization of this sort:
$$\min_w\sum\ell(x_i, y_i, w)+\lambda\cdot r(w)$$
Where $\ell$ is a loss function (the Hinge-loss in SVMs) and $r$ is a regularization function.
The SVM is a squared $\ell_2$-regularized linear... | SVM - number of dimensions greater than number of samples would give good or bad performance? | SVMs, like many other linear models, are based on empirical risk minimization, which leads us to an optimization of this sort:
$$\min_w\sum\ell(x_i, y_i, w)+\lambda\cdot r(w)$$
Where $\ell$ is a loss | SVM - number of dimensions greater than number of samples would give good or bad performance?
SVMs, like many other linear models, are based on empirical risk minimization, which leads us to an optimization of this sort:
$$\min_w\sum\ell(x_i, y_i, w)+\lambda\cdot r(w)$$
Where $\ell$ is a loss function (the Hinge-loss i... | SVM - number of dimensions greater than number of samples would give good or bad performance?
SVMs, like many other linear models, are based on empirical risk minimization, which leads us to an optimization of this sort:
$$\min_w\sum\ell(x_i, y_i, w)+\lambda\cdot r(w)$$
Where $\ell$ is a loss |
45,297 | SVM - number of dimensions greater than number of samples would give good or bad performance? | Still effective in cases where number of dimensions is greater than the number of samples
If the number of features is much greater than the number of samples, the method is likely to give poor performances.
These two points are pretty much contradictory, as one feature is typically one-dimensional (some features may... | SVM - number of dimensions greater than number of samples would give good or bad performance? | Still effective in cases where number of dimensions is greater than the number of samples
If the number of features is much greater than the number of samples, the method is likely to give poor perfor | SVM - number of dimensions greater than number of samples would give good or bad performance?
Still effective in cases where number of dimensions is greater than the number of samples
If the number of features is much greater than the number of samples, the method is likely to give poor performances.
These two points... | SVM - number of dimensions greater than number of samples would give good or bad performance?
Still effective in cases where number of dimensions is greater than the number of samples
If the number of features is much greater than the number of samples, the method is likely to give poor perfor |
45,298 | What is the discrete equivalent of the powerlaw distribution? | If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ for $x=1,2,3,...$ then you would have a zeta distribution.
If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ for $x=1,2,3,...,N$ then you would have a truncated zeta distribution, also known as Zipf's law.
On the other hand, if (a... | What is the discrete equivalent of the powerlaw distribution? | If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ for $x=1,2,3,...$ then you would have a zeta distribution.
If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ f | What is the discrete equivalent of the powerlaw distribution?
If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ for $x=1,2,3,...$ then you would have a zeta distribution.
If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ for $x=1,2,3,...,N$ then you would have a truncated zeta di... | What is the discrete equivalent of the powerlaw distribution?
If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ for $x=1,2,3,...$ then you would have a zeta distribution.
If you want a discrete distribution where $P(X=x)\propto x^{-\alpha}$ f |
45,299 | How do gamma distributions add and what would that model? | A procedural solution for $n$ tuple convolution is given here.
Q1: The two gamma distribution convolution (GDC) in closed form is only given here
$\mathrm{G}\mathrm{D}\mathrm{C}\left(\mathrm{a}\kern0.1em ,\mathrm{b}\kern0.1em ,\alpha, \beta; \tau \right)=\left\{\begin{array}{cc}\hfill \frac{{\mathrm{b}}^{\mathrm{a}}{... | How do gamma distributions add and what would that model? | A procedural solution for $n$ tuple convolution is given here.
Q1: The two gamma distribution convolution (GDC) in closed form is only given here
$\mathrm{G}\mathrm{D}\mathrm{C}\left(\mathrm{a}\kern | How do gamma distributions add and what would that model?
A procedural solution for $n$ tuple convolution is given here.
Q1: The two gamma distribution convolution (GDC) in closed form is only given here
$\mathrm{G}\mathrm{D}\mathrm{C}\left(\mathrm{a}\kern0.1em ,\mathrm{b}\kern0.1em ,\alpha, \beta; \tau \right)=\left... | How do gamma distributions add and what would that model?
A procedural solution for $n$ tuple convolution is given here.
Q1: The two gamma distribution convolution (GDC) in closed form is only given here
$\mathrm{G}\mathrm{D}\mathrm{C}\left(\mathrm{a}\kern |
45,300 | Correlated variables in Cox model - which one is best | There is no rule against including correlated predictors in a Cox or a standard multiple regression. In practice it is almost inevitable, particularly in clinical work where there can be multiple standard measures of the severity of disease.
Determining which of 2 "measures of the same thing" is better, however, is dif... | Correlated variables in Cox model - which one is best | There is no rule against including correlated predictors in a Cox or a standard multiple regression. In practice it is almost inevitable, particularly in clinical work where there can be multiple stan | Correlated variables in Cox model - which one is best
There is no rule against including correlated predictors in a Cox or a standard multiple regression. In practice it is almost inevitable, particularly in clinical work where there can be multiple standard measures of the severity of disease.
Determining which of 2 "... | Correlated variables in Cox model - which one is best
There is no rule against including correlated predictors in a Cox or a standard multiple regression. In practice it is almost inevitable, particularly in clinical work where there can be multiple stan |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.