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
|
|---|---|---|---|---|---|---|
42,301
|
Predictor and error are independent
|
Subscripts and clear exposition of dependencies matter. We investigate the prediction error. We construct our predictor based on data $\{(x^{(1)},y^{(1)}),\dots,(x^{(m)},y^{(m)})\}$, so write $\hat f = \hat f_m$ to remember that. We then consider predicting
$$y^{(m+1)} = f[x^{(m+1)}]+ \epsilon^{(m+1)}$$
based on $x^{(m+1)}$.
The mean squared error of the prediction here is
$$E\Big[\hat f_m[x^{(m+1)}] - y^{(m+1)}\Big]^2$$
and the troubling expression after manipulations and decompositions is
$$E\Big[\hat f_m[x^{(m+1)}] \cdot \epsilon^{(m+1)}\Big]$$
But $\epsilon^{(m+1)}$ has not directly participated in constructing
$\hat f_m()$ because for this we only used data up to $m$. Under the additional but usually made assumptions that
a) $x^{(m+1)}$ is independent of $\epsilon^{(m+1)}$ and b) that observations are independent,
we get the usual result that appears in the literature.
|
Predictor and error are independent
|
Subscripts and clear exposition of dependencies matter. We investigate the prediction error. We construct our predictor based on data $\{(x^{(1)},y^{(1)}),\dots,(x^{(m)},y^{(m)})\}$, so write $\hat f
|
Predictor and error are independent
Subscripts and clear exposition of dependencies matter. We investigate the prediction error. We construct our predictor based on data $\{(x^{(1)},y^{(1)}),\dots,(x^{(m)},y^{(m)})\}$, so write $\hat f = \hat f_m$ to remember that. We then consider predicting
$$y^{(m+1)} = f[x^{(m+1)}]+ \epsilon^{(m+1)}$$
based on $x^{(m+1)}$.
The mean squared error of the prediction here is
$$E\Big[\hat f_m[x^{(m+1)}] - y^{(m+1)}\Big]^2$$
and the troubling expression after manipulations and decompositions is
$$E\Big[\hat f_m[x^{(m+1)}] \cdot \epsilon^{(m+1)}\Big]$$
But $\epsilon^{(m+1)}$ has not directly participated in constructing
$\hat f_m()$ because for this we only used data up to $m$. Under the additional but usually made assumptions that
a) $x^{(m+1)}$ is independent of $\epsilon^{(m+1)}$ and b) that observations are independent,
we get the usual result that appears in the literature.
|
Predictor and error are independent
Subscripts and clear exposition of dependencies matter. We investigate the prediction error. We construct our predictor based on data $\{(x^{(1)},y^{(1)}),\dots,(x^{(m)},y^{(m)})\}$, so write $\hat f
|
42,302
|
Why are machine learning algorithms performing worse than standard multiple linear regression?
|
Assumptions give you power - when they are valid.
When the assumptions of a linear regression (or any other simple model) are fulfilled, they will outperform more complex and flexible models. Let's consider a model with a single predictor. If the relationship is linear, a linear regression will quite likely outperform a neural network. More complex/flexible models can be beneficial when important assumptions are violated.
But in order to gain the benefits of the flexible models, you need a lot more data in order to learn the complex pattern, or that flexibility can degrade performance relative to a simple model.
So in your case, it seems likely that this is because you have a small dataset, or because the relationships you are modelling are linear, or both.
|
Why are machine learning algorithms performing worse than standard multiple linear regression?
|
Assumptions give you power - when they are valid.
When the assumptions of a linear regression (or any other simple model) are fulfilled, they will outperform more complex and flexible models. Let's co
|
Why are machine learning algorithms performing worse than standard multiple linear regression?
Assumptions give you power - when they are valid.
When the assumptions of a linear regression (or any other simple model) are fulfilled, they will outperform more complex and flexible models. Let's consider a model with a single predictor. If the relationship is linear, a linear regression will quite likely outperform a neural network. More complex/flexible models can be beneficial when important assumptions are violated.
But in order to gain the benefits of the flexible models, you need a lot more data in order to learn the complex pattern, or that flexibility can degrade performance relative to a simple model.
So in your case, it seems likely that this is because you have a small dataset, or because the relationships you are modelling are linear, or both.
|
Why are machine learning algorithms performing worse than standard multiple linear regression?
Assumptions give you power - when they are valid.
When the assumptions of a linear regression (or any other simple model) are fulfilled, they will outperform more complex and flexible models. Let's co
|
42,303
|
Can the differential entropy be negative infinity?
|
Yes, there are densities with negatively infinite entropy.
To construct one, find a family of densities with arbitrarily negative entropy. (Clearly this requires the density functions to have arbitrarily large values and therefore there are points where they become "singular.") By shifting and scaling them into disjoint intervals within $[0,1],$ if we are careful we can produce a density whose entropy is close to the average of the entropies of its pieces. Since the average of a divergent sequence diverges, this can produce a function with negatively infinite entropy provided we make sure to push the closure of singularities into a measure-zero subset. The following account gives an explicit construction.
To discuss entropy in a compact way, define the function $h:\mathbb{R}\to\mathbb{R}$ as
$$h(t) = -t\log(|t|) = -t \log(t^2)/2.$$
The second formula immediately shows $h$ is continuous, and differentiable everywhere except at $0.$ It determines the entropy of any density $f$ as
$$H[f] = \int_{\mathbb{R}} h(f(t))\mathrm{d}t.$$
Note that $H[f]$ is defined for any integrable non-negative function $f$ for which $|h(f(t))|$ is integrable, which will include any positive multiples of densities $t\to \lambda f(t).$
For any number $p\lt 1,$ consider the functions $\phi_p:\mathbb{R}\to\mathbb{R}$ whose values are zero everywhere except on the interval $(0,1]$ where they are given by the formula
$$\phi_p(t) = (1-p)t^{-p}.$$
The $\phi(p)$ integrate to unity and they obviously have non-negative (and finite) values, whence they are all density functions. (They are Beta$(1-p,1)$ densities.) Their entropies are
$$H[\phi_p] = -\int_{(0,1]} (1-p)t^{-p} \log((1-p)t^{-p})\mathrm{d}t = -\left(\frac{p}{1-p} + \log(1-p)\right),\tag{1}$$
which can be made arbitrarily negative (but not infinite) by taking $p$ close to $1.$ Notice that the only singularity of $\phi_p$ is at $0.$
Can we do better? We might try to assemble a density out of the $\phi_p$ by shifting them into disjoint intervals, for then the integral involved in the entropy calculation becomes the simple sum of the integrals in each of those intervals. We will need to discover how such alterations to a density change the entropy. For completeness, the following recapitulates the analysis described at How does entropy depend on location and scale?.
In general, when $f$ is any density, let $$f_{\lambda, \mu,\sigma}(t) = \lambda f\left(\frac{t-\mu}{\sigma}\right)$$ be a scaled version (with $\sigma$ and $\lambda$ positive) and change variables to $x = (t-\mu)/\sigma$ to find
$$\int f_{\lambda,\mu,\sigma}(t)\mathrm{d}t = \lambda\sigma \int \lambda f(x)\sigma \mathrm{d}x = \lambda \sigma\tag{2}$$
and
$$\eqalign{
H[f_{\lambda, \mu,\sigma}] &= -\int \lambda f\left(\frac{t-\mu}{\sigma}\right)\log \left(\lambda f\left(\frac{t-\mu}{\sigma}\right)\right)\mathrm{d}t \\
&= -\lambda\sigma\int f\left(x\right)\log \left(\lambda f\left(x\right)\right)\mathrm{d}x \\
&= -\lambda\sigma\left(\int f(x)\log(f(x))\mathrm{d}x + \log(\lambda)\int f(x)\mathrm{d}x\right) \\
&= \lambda \sigma(H[f] - \log(\lambda)). \tag{3}
}$$
Let's return to the problem of building a density $f$ out of non-overlapping pieces by shifting and scaling various $\phi_p.$ One way is for each $n=1, 2, 3, \ldots,$ shift and scale $$f^{(n)} = \phi_{1-1/n}$$ into the interval $(1/(n+1), 1/n].$ This is done by setting $\mu_n=1/(n+1)$ and $\sigma_n = 1/(n(n+1))$ above. Let $(\lambda_n)$ be a sequence of positive weights and with them form
$$f(t) = \sum_{n=1}^\infty f^{(n)}_{\lambda_n, \mu_n, \sigma_n}(t) = \sum_{n=1}^\infty \lambda_n\phi_{1-1/n}\left(n(n+1)t - n\right).\tag{*}$$
Result $(2)$ above implies that for $f$ to be a density we must have
$$1=\int f(t)\mathrm{d}t = \sum_{n=1}^\infty \lambda_n \sigma_n = \sum_{n=1}^\infty \frac{\lambda_n}{n(n+1)}$$
and $(3)$ along with $p=1-1/n$ in formula $(1)$ yields
$$\eqalign{
H[f] &= \sum_{n=1}^\infty \frac{\lambda_n}{n(n+1)}(H[\phi_{1-1/n}] - \log(\lambda_n)) \\
&= \sum_{n=1}^\infty \frac{\lambda_n}{n(n+1)}(\log(n) - n + 1 - \log(\lambda_n)). \tag{4}
}$$
A simple solution is to take $\lambda_n=1$ for all $n.$
The choice of $\lambda_n$ scales the infinite spikes in this figure so that the total area beneath them is unity. As they move to the left, though, they become "heavier" by making the power $p$ closer to $1.$
This makes $f$ a density and $(4)$ becomes
$$H[f] = \sum_{n=1}^\infty \frac{1}{n(n+1)}(\log(n) - n + 1 - \log(1)) = -\sum_{n=1}^\infty \frac{1 - (\log(n)+1)/n}{n+1}.$$
Since for all positive numbers $\log(n)/n \lt 1/2$, we may take $1/n + 1/2$ to be a lower bound for values $(1+\log(n))/n,$ producing
$$H[f] \lt-\sum_{n=1}^\infty \frac{1 - (1/n+1/2)}{n+1} \lt \sum_{n=1}^\infty \frac{1}{n(n+1)} -\frac{1}{2}\sum_{n=1}^\infty \frac{1}{n+1} = 1-\frac{1}{2}\sum_{n=1}^\infty \frac{1}{n+1},$$
which diverges to $-\infty.$
The entropy of $f$ is the (signed) area between this graph of $h\circ f$ and the t-axis. The spikes at the left contribute an infinitely negative area.
Finally, $f$ is defined and has finite values everywhere on $(0,1].$ Although it has infinitely many singularities, they are countable in number, isolated, and condense only at $0,$ making it clear that $f$ is absolutely continuous with respect to Lebesgue measure on $(0,1].$
For the record, $(*)$ works out to
$$f(t) = \frac{1}{n}\left(n(n+1)t - n\right)^{1/n-1}$$ where $n$ is the greatest integer less than or equal to $1/t$ and $0\lt t\le 1.$ We have shown that $f$ is a density and $H[f] =-\infty.$
|
Can the differential entropy be negative infinity?
|
Yes, there are densities with negatively infinite entropy.
To construct one, find a family of densities with arbitrarily negative entropy. (Clearly this requires the density functions to have arbitrar
|
Can the differential entropy be negative infinity?
Yes, there are densities with negatively infinite entropy.
To construct one, find a family of densities with arbitrarily negative entropy. (Clearly this requires the density functions to have arbitrarily large values and therefore there are points where they become "singular.") By shifting and scaling them into disjoint intervals within $[0,1],$ if we are careful we can produce a density whose entropy is close to the average of the entropies of its pieces. Since the average of a divergent sequence diverges, this can produce a function with negatively infinite entropy provided we make sure to push the closure of singularities into a measure-zero subset. The following account gives an explicit construction.
To discuss entropy in a compact way, define the function $h:\mathbb{R}\to\mathbb{R}$ as
$$h(t) = -t\log(|t|) = -t \log(t^2)/2.$$
The second formula immediately shows $h$ is continuous, and differentiable everywhere except at $0.$ It determines the entropy of any density $f$ as
$$H[f] = \int_{\mathbb{R}} h(f(t))\mathrm{d}t.$$
Note that $H[f]$ is defined for any integrable non-negative function $f$ for which $|h(f(t))|$ is integrable, which will include any positive multiples of densities $t\to \lambda f(t).$
For any number $p\lt 1,$ consider the functions $\phi_p:\mathbb{R}\to\mathbb{R}$ whose values are zero everywhere except on the interval $(0,1]$ where they are given by the formula
$$\phi_p(t) = (1-p)t^{-p}.$$
The $\phi(p)$ integrate to unity and they obviously have non-negative (and finite) values, whence they are all density functions. (They are Beta$(1-p,1)$ densities.) Their entropies are
$$H[\phi_p] = -\int_{(0,1]} (1-p)t^{-p} \log((1-p)t^{-p})\mathrm{d}t = -\left(\frac{p}{1-p} + \log(1-p)\right),\tag{1}$$
which can be made arbitrarily negative (but not infinite) by taking $p$ close to $1.$ Notice that the only singularity of $\phi_p$ is at $0.$
Can we do better? We might try to assemble a density out of the $\phi_p$ by shifting them into disjoint intervals, for then the integral involved in the entropy calculation becomes the simple sum of the integrals in each of those intervals. We will need to discover how such alterations to a density change the entropy. For completeness, the following recapitulates the analysis described at How does entropy depend on location and scale?.
In general, when $f$ is any density, let $$f_{\lambda, \mu,\sigma}(t) = \lambda f\left(\frac{t-\mu}{\sigma}\right)$$ be a scaled version (with $\sigma$ and $\lambda$ positive) and change variables to $x = (t-\mu)/\sigma$ to find
$$\int f_{\lambda,\mu,\sigma}(t)\mathrm{d}t = \lambda\sigma \int \lambda f(x)\sigma \mathrm{d}x = \lambda \sigma\tag{2}$$
and
$$\eqalign{
H[f_{\lambda, \mu,\sigma}] &= -\int \lambda f\left(\frac{t-\mu}{\sigma}\right)\log \left(\lambda f\left(\frac{t-\mu}{\sigma}\right)\right)\mathrm{d}t \\
&= -\lambda\sigma\int f\left(x\right)\log \left(\lambda f\left(x\right)\right)\mathrm{d}x \\
&= -\lambda\sigma\left(\int f(x)\log(f(x))\mathrm{d}x + \log(\lambda)\int f(x)\mathrm{d}x\right) \\
&= \lambda \sigma(H[f] - \log(\lambda)). \tag{3}
}$$
Let's return to the problem of building a density $f$ out of non-overlapping pieces by shifting and scaling various $\phi_p.$ One way is for each $n=1, 2, 3, \ldots,$ shift and scale $$f^{(n)} = \phi_{1-1/n}$$ into the interval $(1/(n+1), 1/n].$ This is done by setting $\mu_n=1/(n+1)$ and $\sigma_n = 1/(n(n+1))$ above. Let $(\lambda_n)$ be a sequence of positive weights and with them form
$$f(t) = \sum_{n=1}^\infty f^{(n)}_{\lambda_n, \mu_n, \sigma_n}(t) = \sum_{n=1}^\infty \lambda_n\phi_{1-1/n}\left(n(n+1)t - n\right).\tag{*}$$
Result $(2)$ above implies that for $f$ to be a density we must have
$$1=\int f(t)\mathrm{d}t = \sum_{n=1}^\infty \lambda_n \sigma_n = \sum_{n=1}^\infty \frac{\lambda_n}{n(n+1)}$$
and $(3)$ along with $p=1-1/n$ in formula $(1)$ yields
$$\eqalign{
H[f] &= \sum_{n=1}^\infty \frac{\lambda_n}{n(n+1)}(H[\phi_{1-1/n}] - \log(\lambda_n)) \\
&= \sum_{n=1}^\infty \frac{\lambda_n}{n(n+1)}(\log(n) - n + 1 - \log(\lambda_n)). \tag{4}
}$$
A simple solution is to take $\lambda_n=1$ for all $n.$
The choice of $\lambda_n$ scales the infinite spikes in this figure so that the total area beneath them is unity. As they move to the left, though, they become "heavier" by making the power $p$ closer to $1.$
This makes $f$ a density and $(4)$ becomes
$$H[f] = \sum_{n=1}^\infty \frac{1}{n(n+1)}(\log(n) - n + 1 - \log(1)) = -\sum_{n=1}^\infty \frac{1 - (\log(n)+1)/n}{n+1}.$$
Since for all positive numbers $\log(n)/n \lt 1/2$, we may take $1/n + 1/2$ to be a lower bound for values $(1+\log(n))/n,$ producing
$$H[f] \lt-\sum_{n=1}^\infty \frac{1 - (1/n+1/2)}{n+1} \lt \sum_{n=1}^\infty \frac{1}{n(n+1)} -\frac{1}{2}\sum_{n=1}^\infty \frac{1}{n+1} = 1-\frac{1}{2}\sum_{n=1}^\infty \frac{1}{n+1},$$
which diverges to $-\infty.$
The entropy of $f$ is the (signed) area between this graph of $h\circ f$ and the t-axis. The spikes at the left contribute an infinitely negative area.
Finally, $f$ is defined and has finite values everywhere on $(0,1].$ Although it has infinitely many singularities, they are countable in number, isolated, and condense only at $0,$ making it clear that $f$ is absolutely continuous with respect to Lebesgue measure on $(0,1].$
For the record, $(*)$ works out to
$$f(t) = \frac{1}{n}\left(n(n+1)t - n\right)^{1/n-1}$$ where $n$ is the greatest integer less than or equal to $1/t$ and $0\lt t\le 1.$ We have shown that $f$ is a density and $H[f] =-\infty.$
|
Can the differential entropy be negative infinity?
Yes, there are densities with negatively infinite entropy.
To construct one, find a family of densities with arbitrarily negative entropy. (Clearly this requires the density functions to have arbitrar
|
42,304
|
Can the differential entropy be negative infinity?
|
I actually came across to this problem from a different angle. I was trying to understand why the mutual information of multivariate normal distribution goes to $\infty$ as the correlation goes to 1. See here
So to your question, sorry I don't know the answer, but if we loose the condition $H(f)=-\infty$ to any arbitrary negative number and consider multivariate functions, then $f(x)$ can be the joint pdf of enough correlated (correlation close to 1) bivariate normal distribution.
|
Can the differential entropy be negative infinity?
|
I actually came across to this problem from a different angle. I was trying to understand why the mutual information of multivariate normal distribution goes to $\infty$ as the correlation goes to 1.
|
Can the differential entropy be negative infinity?
I actually came across to this problem from a different angle. I was trying to understand why the mutual information of multivariate normal distribution goes to $\infty$ as the correlation goes to 1. See here
So to your question, sorry I don't know the answer, but if we loose the condition $H(f)=-\infty$ to any arbitrary negative number and consider multivariate functions, then $f(x)$ can be the joint pdf of enough correlated (correlation close to 1) bivariate normal distribution.
|
Can the differential entropy be negative infinity?
I actually came across to this problem from a different angle. I was trying to understand why the mutual information of multivariate normal distribution goes to $\infty$ as the correlation goes to 1.
|
42,305
|
Why do Variational Bayes methods assume that the likelihood $p(x|z)$ is tractable while the posterior is not?
|
The likelihood is often tractable because we are free to pick it and we pick something that is easy to work with. If it was not tractable, we could not compute it and could not use the model.
Note that the posterior and likelihood are coupled through Bayes theorem:
$$p(z|x) = \frac{p(x|z) p(z)}{p(x)}.$$
The consequence is that we are free to pick the likelihood and the prior as we see fit, but once we have done so the posterior is also fixed. And for many interesting likelihoods, the posterior is intractable.
Conversely, if you wanted the posterior to be tractable, I guess you could also do so but then this would render the likelihood intractable.
|
Why do Variational Bayes methods assume that the likelihood $p(x|z)$ is tractable while the posterio
|
The likelihood is often tractable because we are free to pick it and we pick something that is easy to work with. If it was not tractable, we could not compute it and could not use the model.
Note th
|
Why do Variational Bayes methods assume that the likelihood $p(x|z)$ is tractable while the posterior is not?
The likelihood is often tractable because we are free to pick it and we pick something that is easy to work with. If it was not tractable, we could not compute it and could not use the model.
Note that the posterior and likelihood are coupled through Bayes theorem:
$$p(z|x) = \frac{p(x|z) p(z)}{p(x)}.$$
The consequence is that we are free to pick the likelihood and the prior as we see fit, but once we have done so the posterior is also fixed. And for many interesting likelihoods, the posterior is intractable.
Conversely, if you wanted the posterior to be tractable, I guess you could also do so but then this would render the likelihood intractable.
|
Why do Variational Bayes methods assume that the likelihood $p(x|z)$ is tractable while the posterio
The likelihood is often tractable because we are free to pick it and we pick something that is easy to work with. If it was not tractable, we could not compute it and could not use the model.
Note th
|
42,306
|
Knowledge graph: how to get into it?
|
This set of notes provides a good overview of (some) of the work in the field of knowledge graphs and automated reasoning, including:
A history of ontology experiments on the web, i.e. attempts to extract structured relationships between online resources
A basic overview/tutorial of what knowledge graphs are and how to build them from text data
Slides from Google researchers about their methodology for extracting semantic relationships on a web scale (e.g. when you google a symptom, it will show you related disease information)
Some interesting papers on knowledge graphs and information extraction
More related fields and work, see the table of contents for the full list.
Hope that helps!
|
Knowledge graph: how to get into it?
|
This set of notes provides a good overview of (some) of the work in the field of knowledge graphs and automated reasoning, including:
A history of ontology experiments on the web, i.e. attempts to e
|
Knowledge graph: how to get into it?
This set of notes provides a good overview of (some) of the work in the field of knowledge graphs and automated reasoning, including:
A history of ontology experiments on the web, i.e. attempts to extract structured relationships between online resources
A basic overview/tutorial of what knowledge graphs are and how to build them from text data
Slides from Google researchers about their methodology for extracting semantic relationships on a web scale (e.g. when you google a symptom, it will show you related disease information)
Some interesting papers on knowledge graphs and information extraction
More related fields and work, see the table of contents for the full list.
Hope that helps!
|
Knowledge graph: how to get into it?
This set of notes provides a good overview of (some) of the work in the field of knowledge graphs and automated reasoning, including:
A history of ontology experiments on the web, i.e. attempts to e
|
42,307
|
Showing $S^2$ and $\overline{Y}$ are independent: seeking a solution to this textbook problem
|
I'm not sure what the authors have in mind, but the closest solution I can think of using (c) is to apply Cochran's theorem. Have you covered that, or maybe a special case of it?
Here's the proof using that:
Let $Z_i = \frac{Y_i - \mu}{\sigma}$ so $Z_i \sim \mathcal N(0, 1)$ and $\bar Z \sim \mathcal N(\mu, \sigma^2/n)$. Note that
$$
\left(\frac{Y_i - \bar Y}{\sigma}\right)^2 = \left(\frac{Y_i - \mu}{\sigma} - \frac{\bar Y - \mu}{\sigma}\right)^2 = \left(Z_i - \bar Z\right)^2.
$$
Now (c) tells us
$$
\sum_i Z_i^2 = \sum_i (Z_i - \bar Z)^2 + n\bar Z^2
$$
which we can write as $\newcommand{\one}{\mathbf 1}$
$$
Z^T Z = Z^T \left(I - \frac 1n \one \one^T\right)Z + Z^T\left(\frac 1n \one \one^T\right) Z.
$$
$I - \frac 1n \one \one^T + \frac 1n \one \one^T =I$ and both are idempotent so Cochran's theorem lets us conclude that $\sum_i (Y_i - \mu)^2 \perp n(\bar Y - \mu)^2$ and the rest follows.
$\square$
Could that be what they're going for?
|
Showing $S^2$ and $\overline{Y}$ are independent: seeking a solution to this textbook problem
|
I'm not sure what the authors have in mind, but the closest solution I can think of using (c) is to apply Cochran's theorem. Have you covered that, or maybe a special case of it?
Here's the proof usin
|
Showing $S^2$ and $\overline{Y}$ are independent: seeking a solution to this textbook problem
I'm not sure what the authors have in mind, but the closest solution I can think of using (c) is to apply Cochran's theorem. Have you covered that, or maybe a special case of it?
Here's the proof using that:
Let $Z_i = \frac{Y_i - \mu}{\sigma}$ so $Z_i \sim \mathcal N(0, 1)$ and $\bar Z \sim \mathcal N(\mu, \sigma^2/n)$. Note that
$$
\left(\frac{Y_i - \bar Y}{\sigma}\right)^2 = \left(\frac{Y_i - \mu}{\sigma} - \frac{\bar Y - \mu}{\sigma}\right)^2 = \left(Z_i - \bar Z\right)^2.
$$
Now (c) tells us
$$
\sum_i Z_i^2 = \sum_i (Z_i - \bar Z)^2 + n\bar Z^2
$$
which we can write as $\newcommand{\one}{\mathbf 1}$
$$
Z^T Z = Z^T \left(I - \frac 1n \one \one^T\right)Z + Z^T\left(\frac 1n \one \one^T\right) Z.
$$
$I - \frac 1n \one \one^T + \frac 1n \one \one^T =I$ and both are idempotent so Cochran's theorem lets us conclude that $\sum_i (Y_i - \mu)^2 \perp n(\bar Y - \mu)^2$ and the rest follows.
$\square$
Could that be what they're going for?
|
Showing $S^2$ and $\overline{Y}$ are independent: seeking a solution to this textbook problem
I'm not sure what the authors have in mind, but the closest solution I can think of using (c) is to apply Cochran's theorem. Have you covered that, or maybe a special case of it?
Here's the proof usin
|
42,308
|
Why do we use Vector Autoregressive Models?
|
Your question can be addressed under the Seemingly Unrelated Regression (SUR) theory. Normally if $\epsilon_t$ and $\eta_s$ are not correlated other than when $t=s$ the SUR theory suggests that there is no difference between estimating the equations separately or alltogether as long as all equations contain the same explanatory variables (which in this case they do).
You may read the whole text or as well jump to the last page.
http://www.phdeconomics.sssup.it/documents/Lesson17.pdf
However when there is correlation not only contemporaneously (at the same time point) but across time I believe this result doesn't apply anymore. In this situation a GLS estimation of the equation bundle may be more efficient. But I don't have a reference at hand to back up my claim at the moment. Nevertheless since in VAR models across time correlation is assumed to be zero (https://en.wikipedia.org/wiki/Vector_autoregression) this situation shouldn't be much of a concern.
|
Why do we use Vector Autoregressive Models?
|
Your question can be addressed under the Seemingly Unrelated Regression (SUR) theory. Normally if $\epsilon_t$ and $\eta_s$ are not correlated other than when $t=s$ the SUR theory suggests that there
|
Why do we use Vector Autoregressive Models?
Your question can be addressed under the Seemingly Unrelated Regression (SUR) theory. Normally if $\epsilon_t$ and $\eta_s$ are not correlated other than when $t=s$ the SUR theory suggests that there is no difference between estimating the equations separately or alltogether as long as all equations contain the same explanatory variables (which in this case they do).
You may read the whole text or as well jump to the last page.
http://www.phdeconomics.sssup.it/documents/Lesson17.pdf
However when there is correlation not only contemporaneously (at the same time point) but across time I believe this result doesn't apply anymore. In this situation a GLS estimation of the equation bundle may be more efficient. But I don't have a reference at hand to back up my claim at the moment. Nevertheless since in VAR models across time correlation is assumed to be zero (https://en.wikipedia.org/wiki/Vector_autoregression) this situation shouldn't be much of a concern.
|
Why do we use Vector Autoregressive Models?
Your question can be addressed under the Seemingly Unrelated Regression (SUR) theory. Normally if $\epsilon_t$ and $\eta_s$ are not correlated other than when $t=s$ the SUR theory suggests that there
|
42,309
|
Why do we use Vector Autoregressive Models?
|
Trying a short non-technical answer. Univariate time series models like AR (or ARMA) for stationary time series try to autoproject the future of the series from its past. Thas is, your projections only comes from the history of the series. That may be fine, maybe you do not have any other information on other variables. But maybe you have some other time series (measured at the same points in time), as an example inflation, wages and unemployment. Now, certainly, say wages probably do depend some on unemployment, with low unemployment the employers are competing for workers and need to pay more. So, maybe, the time dynamics of these series do involve all three at once, and if that is true we might make better forecasts of, say, unemployment if we take into account also wages and inflation. That lead to VAR models.
To see if it is worth it, build first some univariate time series models and calculate some measure of prediction quality. Then you can use that as a baseline for your VAR model.
I am sure other reasons can be given, econometricians use such models to test hypothesis about the economy, but I have no experience with such use.
|
Why do we use Vector Autoregressive Models?
|
Trying a short non-technical answer. Univariate time series models like AR (or ARMA) for stationary time series try to autoproject the future of the series from its past. Thas is, your projections onl
|
Why do we use Vector Autoregressive Models?
Trying a short non-technical answer. Univariate time series models like AR (or ARMA) for stationary time series try to autoproject the future of the series from its past. Thas is, your projections only comes from the history of the series. That may be fine, maybe you do not have any other information on other variables. But maybe you have some other time series (measured at the same points in time), as an example inflation, wages and unemployment. Now, certainly, say wages probably do depend some on unemployment, with low unemployment the employers are competing for workers and need to pay more. So, maybe, the time dynamics of these series do involve all three at once, and if that is true we might make better forecasts of, say, unemployment if we take into account also wages and inflation. That lead to VAR models.
To see if it is worth it, build first some univariate time series models and calculate some measure of prediction quality. Then you can use that as a baseline for your VAR model.
I am sure other reasons can be given, econometricians use such models to test hypothesis about the economy, but I have no experience with such use.
|
Why do we use Vector Autoregressive Models?
Trying a short non-technical answer. Univariate time series models like AR (or ARMA) for stationary time series try to autoproject the future of the series from its past. Thas is, your projections onl
|
42,310
|
Standard error of regression and of predictions in python (these are available in R) [closed]
|
To the last part
Several models have now a get_prediction method that provide standard errors and confidence interval for predicted mean and prediction intervals for new observations.
pred = results.get_prediction(x_predict)
pred_df = pred.summary_frame()
some examples are in this gist https://gist.github.com/josef-pkt/1417e0473c2a87e14d76b425657342f5
|
Standard error of regression and of predictions in python (these are available in R) [closed]
|
To the last part
Several models have now a get_prediction method that provide standard errors and confidence interval for predicted mean and prediction intervals for new observations.
pred = results.g
|
Standard error of regression and of predictions in python (these are available in R) [closed]
To the last part
Several models have now a get_prediction method that provide standard errors and confidence interval for predicted mean and prediction intervals for new observations.
pred = results.get_prediction(x_predict)
pred_df = pred.summary_frame()
some examples are in this gist https://gist.github.com/josef-pkt/1417e0473c2a87e14d76b425657342f5
|
Standard error of regression and of predictions in python (these are available in R) [closed]
To the last part
Several models have now a get_prediction method that provide standard errors and confidence interval for predicted mean and prediction intervals for new observations.
pred = results.g
|
42,311
|
Standard error of regression and of predictions in python (these are available in R) [closed]
|
For your first question, I think what R calls the "residual standard error" is the square root of the scale parameter:
np.sqrt(est_1a.scale)
|
Standard error of regression and of predictions in python (these are available in R) [closed]
|
For your first question, I think what R calls the "residual standard error" is the square root of the scale parameter:
np.sqrt(est_1a.scale)
|
Standard error of regression and of predictions in python (these are available in R) [closed]
For your first question, I think what R calls the "residual standard error" is the square root of the scale parameter:
np.sqrt(est_1a.scale)
|
Standard error of regression and of predictions in python (these are available in R) [closed]
For your first question, I think what R calls the "residual standard error" is the square root of the scale parameter:
np.sqrt(est_1a.scale)
|
42,312
|
Training Autoencoder with Softmax Layer
|
I don't know why this was downvoted, but I figured out the answer though it may be obvious.
The training set is used to train one compression/encoder layer by learning to approximate itself using the training set.
Once this is done, the weights / layer that is responsible for the encoding part is saved and paired with a classification layer (e.g. softmax layer) to learn a supervised classifier. This is done by using the same training set as before and fitting them with labels / classes of this training set that weren't used previously.
After the classifier is trained, it can be used to make predictions or check performance using the test set.
For example, if you already had an autoencoder trained and wanted to use the encoding layer with a softmax layer, you could do the following with keras:
# For a single-input model with 10 classes (categorical classification):
model = Sequential()
model.add(autoencoder.layers[1])
model.add(Dense(10, activation='softmax'))
model.compile(optimizer='rmsprop',
loss='categorical_crossentropy',
metrics=['accuracy'])
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(y_train, num_classes=10)
# Train the model, iterating on the data in batches of 32 samples
model.fit(x_train, one_hot_labels, epochs=10, batch_size=32)
# Overall F1 score
f1_score(y_test, np.argmax(model.predict(x_test), axis=1), average='macro')
In the stacked autoencoder case, the procedure is the same except with more encoding layers. Discussion about this using keras here and here.
|
Training Autoencoder with Softmax Layer
|
I don't know why this was downvoted, but I figured out the answer though it may be obvious.
The training set is used to train one compression/encoder layer by learning to approximate itself using the
|
Training Autoencoder with Softmax Layer
I don't know why this was downvoted, but I figured out the answer though it may be obvious.
The training set is used to train one compression/encoder layer by learning to approximate itself using the training set.
Once this is done, the weights / layer that is responsible for the encoding part is saved and paired with a classification layer (e.g. softmax layer) to learn a supervised classifier. This is done by using the same training set as before and fitting them with labels / classes of this training set that weren't used previously.
After the classifier is trained, it can be used to make predictions or check performance using the test set.
For example, if you already had an autoencoder trained and wanted to use the encoding layer with a softmax layer, you could do the following with keras:
# For a single-input model with 10 classes (categorical classification):
model = Sequential()
model.add(autoencoder.layers[1])
model.add(Dense(10, activation='softmax'))
model.compile(optimizer='rmsprop',
loss='categorical_crossentropy',
metrics=['accuracy'])
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(y_train, num_classes=10)
# Train the model, iterating on the data in batches of 32 samples
model.fit(x_train, one_hot_labels, epochs=10, batch_size=32)
# Overall F1 score
f1_score(y_test, np.argmax(model.predict(x_test), axis=1), average='macro')
In the stacked autoencoder case, the procedure is the same except with more encoding layers. Discussion about this using keras here and here.
|
Training Autoencoder with Softmax Layer
I don't know why this was downvoted, but I figured out the answer though it may be obvious.
The training set is used to train one compression/encoder layer by learning to approximate itself using the
|
42,313
|
Generating random sample from inverse Cdf without closed form
|
Here are two ways to compute numerical approximations to the inverse of the cdf, assuming that you have made choices for m,d,α,β and p. Both methods require that you can compute F(x) for a given x, so ...
m = 1
d = 2
a = 1
b = 2
p = 0.5
F = function(x) (1 - ((1+x^m)^-d) * exp(-b*x^a)) /
(1 - (p*(1+x^m)^-d) * exp(-b*x^a))
Method 1
To compute InvF(a), solve the equation F(x) = a
InvF1 = function(a) uniroot(function(x) F(x) - a, c(0,10))$root
InvF1(0.5)
[1] 0.1038906
F(InvF1(0.5))
[1] 0.4999983
Method 2
Evaluate y = F(x) for a range of x's and then fit a curve to x as a function of y.
x = c(seq(0,3, 0.001), seq(3.1,10,0.1))
y = F(x)
InvF2 = approxfun(y, x)
InvF2(0.5)
[1] 0.1038916
F(InvF2(0.5))
[1] 0.5000011
You can increase the accuracy for InvF2 by using a denser sampling of x, particularly for small values of x.
|
Generating random sample from inverse Cdf without closed form
|
Here are two ways to compute numerical approximations to the inverse of the cdf, assuming that you have made choices for m,d,α,β and p. Both methods require that you can compute F(x) for a given x, s
|
Generating random sample from inverse Cdf without closed form
Here are two ways to compute numerical approximations to the inverse of the cdf, assuming that you have made choices for m,d,α,β and p. Both methods require that you can compute F(x) for a given x, so ...
m = 1
d = 2
a = 1
b = 2
p = 0.5
F = function(x) (1 - ((1+x^m)^-d) * exp(-b*x^a)) /
(1 - (p*(1+x^m)^-d) * exp(-b*x^a))
Method 1
To compute InvF(a), solve the equation F(x) = a
InvF1 = function(a) uniroot(function(x) F(x) - a, c(0,10))$root
InvF1(0.5)
[1] 0.1038906
F(InvF1(0.5))
[1] 0.4999983
Method 2
Evaluate y = F(x) for a range of x's and then fit a curve to x as a function of y.
x = c(seq(0,3, 0.001), seq(3.1,10,0.1))
y = F(x)
InvF2 = approxfun(y, x)
InvF2(0.5)
[1] 0.1038916
F(InvF2(0.5))
[1] 0.5000011
You can increase the accuracy for InvF2 by using a denser sampling of x, particularly for small values of x.
|
Generating random sample from inverse Cdf without closed form
Here are two ways to compute numerical approximations to the inverse of the cdf, assuming that you have made choices for m,d,α,β and p. Both methods require that you can compute F(x) for a given x, s
|
42,314
|
Likelihood ratio minimal sufficient
|
Consider $f(x|\theta)$ for $\theta \in \{\theta_1, \cdots, \theta_p\}$. It can be written as \begin{align*}
f(x|\theta)&=\frac{f(x|\theta)}{f(x|\theta_p)}\times f(x|\theta_p)\\
&=f(x|\theta_p)\,\exp\{\log[{f(x|\theta)}\big/{f(x|\theta_p)}]\}
\end{align*}
Since $\theta \in \{\theta_1, \cdots, \theta_p\}$, $\theta$ is one of the $\theta_i$'s, meaning
$$\sum_{i=1}^p \mathbb{I}_{\theta=\theta_i}=\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)=1$$
Thus
$$\log[{f(x|\theta)}\big/{f(x|\theta_p)}]=\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)\log[{f(x|\theta_i)}\big/{f(x|\theta_p)}]=\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)\log[T_i(x)]$$and
$$f(x|\theta)=\underbrace{f(x|\theta_p)}_{h(x)}\,\exp\underbrace{\left\{\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)\log[T_i(x)]\right\}}_{R(\theta)^\text{T}S(x)}$$As a consequence, the density $f(x|\theta)$ belongs to an exponential family with natural parameter $R(\theta)$ and sufficient statistic $S(x)$. Since the components of $R(\theta)$ are linearly independent, the statistic $S(x)$ [and hence the statistic $T(x)$] are minimal. I remember seeing something like that in a paper by Don Fraser. (And this one as well.)
|
Likelihood ratio minimal sufficient
|
Consider $f(x|\theta)$ for $\theta \in \{\theta_1, \cdots, \theta_p\}$. It can be written as \begin{align*}
f(x|\theta)&=\frac{f(x|\theta)}{f(x|\theta_p)}\times f(x|\theta_p)\\
&=f(x|\theta_p)\,\exp\{
|
Likelihood ratio minimal sufficient
Consider $f(x|\theta)$ for $\theta \in \{\theta_1, \cdots, \theta_p\}$. It can be written as \begin{align*}
f(x|\theta)&=\frac{f(x|\theta)}{f(x|\theta_p)}\times f(x|\theta_p)\\
&=f(x|\theta_p)\,\exp\{\log[{f(x|\theta)}\big/{f(x|\theta_p)}]\}
\end{align*}
Since $\theta \in \{\theta_1, \cdots, \theta_p\}$, $\theta$ is one of the $\theta_i$'s, meaning
$$\sum_{i=1}^p \mathbb{I}_{\theta=\theta_i}=\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)=1$$
Thus
$$\log[{f(x|\theta)}\big/{f(x|\theta_p)}]=\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)\log[{f(x|\theta_i)}\big/{f(x|\theta_p)}]=\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)\log[T_i(x)]$$and
$$f(x|\theta)=\underbrace{f(x|\theta_p)}_{h(x)}\,\exp\underbrace{\left\{\sum_{i=1}^p \mathbb{I}_{\theta_i}(\theta)\log[T_i(x)]\right\}}_{R(\theta)^\text{T}S(x)}$$As a consequence, the density $f(x|\theta)$ belongs to an exponential family with natural parameter $R(\theta)$ and sufficient statistic $S(x)$. Since the components of $R(\theta)$ are linearly independent, the statistic $S(x)$ [and hence the statistic $T(x)$] are minimal. I remember seeing something like that in a paper by Don Fraser. (And this one as well.)
|
Likelihood ratio minimal sufficient
Consider $f(x|\theta)$ for $\theta \in \{\theta_1, \cdots, \theta_p\}$. It can be written as \begin{align*}
f(x|\theta)&=\frac{f(x|\theta)}{f(x|\theta_p)}\times f(x|\theta_p)\\
&=f(x|\theta_p)\,\exp\{
|
42,315
|
Expected survival time for Weibull proportional hazards model with R's predict.survreg
|
Your question is somewhat related to this question and particularly this question and the following answer by Therneau, Terry M.
The survreg routine assumes that log(y) ~ covariates + error. For a log-normal distribion the error is Gaussian and thus the
predict(fit, type='response') will be exp(predicted mean of log
time), which is not the predicted mean time. For Weibull the error
dist is asymmetric so things are more muddy. Each is the MLE
prediction for the subject, just not interpretable as a mean. To get
the actual mean you need to look up the formulas for Weibull and/or
lognormal in a textbook, and map from the survreg parameterization to
whatever one the textbook uses. The two parameterizations are never
the same.
So it seems like you should not expect a mean from predict.survreg. Göran Broström though do make the same points that you do
No need for 'the mathematical statistics text': The necessary
information is found on the help page for the Weibull distribution:
E(T)
= b Gamma(1 + 1/a), where 'b' is scale (really!) and 'a' is shape. You must however take into account the special parametrization that
is used by 'survreg'; see its help page for how to do it.
The above though does make it a bit strange to infer what is meant in ?predict.survreg by
type the type of predicted value. This can be on the original scale
of the data (response), ...
Your example
The relevant code is
> # look at predict function
> pred_func <- asNamespace("survival")$predict.survreg
> body(pred_func)[23]
(if (type == "lp" || type == "response") {
if (missing(newdata)) {
pred <- object$linear.predictors
}
else pred <- drop(x %*% coef) + offset
if (se.fit)
se <- sqrt(diag(x %*% vv %*% t(x)))
if (type == "response") {
pred <- itrans(pred)
if (se.fit)
se <- se/dtrans(pred)
}
} else ...
>
> # this is the function that is used
> dd <- survreg.distributions[["weibull"]]
> dd$itrans
function (x)
exp(x)
<bytecode: 0x000000001e07ef00>
<environment: namespace:survival>
|
Expected survival time for Weibull proportional hazards model with R's predict.survreg
|
Your question is somewhat related to this question and particularly this question and the following answer by Therneau, Terry M.
The survreg routine assumes that log(y) ~ covariates + error. For a
|
Expected survival time for Weibull proportional hazards model with R's predict.survreg
Your question is somewhat related to this question and particularly this question and the following answer by Therneau, Terry M.
The survreg routine assumes that log(y) ~ covariates + error. For a log-normal distribion the error is Gaussian and thus the
predict(fit, type='response') will be exp(predicted mean of log
time), which is not the predicted mean time. For Weibull the error
dist is asymmetric so things are more muddy. Each is the MLE
prediction for the subject, just not interpretable as a mean. To get
the actual mean you need to look up the formulas for Weibull and/or
lognormal in a textbook, and map from the survreg parameterization to
whatever one the textbook uses. The two parameterizations are never
the same.
So it seems like you should not expect a mean from predict.survreg. Göran Broström though do make the same points that you do
No need for 'the mathematical statistics text': The necessary
information is found on the help page for the Weibull distribution:
E(T)
= b Gamma(1 + 1/a), where 'b' is scale (really!) and 'a' is shape. You must however take into account the special parametrization that
is used by 'survreg'; see its help page for how to do it.
The above though does make it a bit strange to infer what is meant in ?predict.survreg by
type the type of predicted value. This can be on the original scale
of the data (response), ...
Your example
The relevant code is
> # look at predict function
> pred_func <- asNamespace("survival")$predict.survreg
> body(pred_func)[23]
(if (type == "lp" || type == "response") {
if (missing(newdata)) {
pred <- object$linear.predictors
}
else pred <- drop(x %*% coef) + offset
if (se.fit)
se <- sqrt(diag(x %*% vv %*% t(x)))
if (type == "response") {
pred <- itrans(pred)
if (se.fit)
se <- se/dtrans(pred)
}
} else ...
>
> # this is the function that is used
> dd <- survreg.distributions[["weibull"]]
> dd$itrans
function (x)
exp(x)
<bytecode: 0x000000001e07ef00>
<environment: namespace:survival>
|
Expected survival time for Weibull proportional hazards model with R's predict.survreg
Your question is somewhat related to this question and particularly this question and the following answer by Therneau, Terry M.
The survreg routine assumes that log(y) ~ covariates + error. For a
|
42,316
|
How avoid regularizing intercept in scikit's LogisticRegression
|
Use a solver other than liblinear. The liblinear solver (formerly the default for LogisticRegression) regularizes the intercept, but the others do not (see https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression). If you must use liblinear, see the intercept_scaling argument, which presumably is included to mitigate this issue.
|
How avoid regularizing intercept in scikit's LogisticRegression
|
Use a solver other than liblinear. The liblinear solver (formerly the default for LogisticRegression) regularizes the intercept, but the others do not (see https://scikit-learn.org/stable/modules/line
|
How avoid regularizing intercept in scikit's LogisticRegression
Use a solver other than liblinear. The liblinear solver (formerly the default for LogisticRegression) regularizes the intercept, but the others do not (see https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression). If you must use liblinear, see the intercept_scaling argument, which presumably is included to mitigate this issue.
|
How avoid regularizing intercept in scikit's LogisticRegression
Use a solver other than liblinear. The liblinear solver (formerly the default for LogisticRegression) regularizes the intercept, but the others do not (see https://scikit-learn.org/stable/modules/line
|
42,317
|
How avoid regularizing intercept in scikit's LogisticRegression
|
There is one quick and dirty fix to make less regularization on intercept.
To do it, we can append a huge number in intercept column say $1 \times 10^{9}$, instead of expand the data frame with all $1$ column.
For example, with mtcars data, if we want to do logistic regression respect to weight, we do
> head(cbind(1e9,mtcars$wt))
[,1] [,2]
[1,] 1e+09 2.620
[2,] 1e+09 2.875
[3,] 1e+09 2.320
[4,] 1e+09 3.215
[5,] 1e+09 3.440
[6,] 1e+09 3.460
instead of
> head(model.matrix(am~wt,mtcars))
(Intercept) wt
Mazda RX4 1 2.620
Mazda RX4 Wag 1 2.875
Datsun 710 1 2.320
Hornet 4 Drive 1 3.215
Hornet Sportabout 1 3.440
Valiant 1 3.460
|
How avoid regularizing intercept in scikit's LogisticRegression
|
There is one quick and dirty fix to make less regularization on intercept.
To do it, we can append a huge number in intercept column say $1 \times 10^{9}$, instead of expand the data frame with all $
|
How avoid regularizing intercept in scikit's LogisticRegression
There is one quick and dirty fix to make less regularization on intercept.
To do it, we can append a huge number in intercept column say $1 \times 10^{9}$, instead of expand the data frame with all $1$ column.
For example, with mtcars data, if we want to do logistic regression respect to weight, we do
> head(cbind(1e9,mtcars$wt))
[,1] [,2]
[1,] 1e+09 2.620
[2,] 1e+09 2.875
[3,] 1e+09 2.320
[4,] 1e+09 3.215
[5,] 1e+09 3.440
[6,] 1e+09 3.460
instead of
> head(model.matrix(am~wt,mtcars))
(Intercept) wt
Mazda RX4 1 2.620
Mazda RX4 Wag 1 2.875
Datsun 710 1 2.320
Hornet 4 Drive 1 3.215
Hornet Sportabout 1 3.440
Valiant 1 3.460
|
How avoid regularizing intercept in scikit's LogisticRegression
There is one quick and dirty fix to make less regularization on intercept.
To do it, we can append a huge number in intercept column say $1 \times 10^{9}$, instead of expand the data frame with all $
|
42,318
|
Big difference between a t-test and a F-test in a mixed model (anova vs summary in lmerTest)
|
Type III tests require correct coding for lower-order effects to be meaningful, specifically orthogonal contrasts. The R default contr.treatment is not orthogonal, other contrasts are though (e.g., contr.sum). In your code it looks like you used did not change the defaults, hence your results are so-called simple main effects. We discuss this in our soon-to-come out chapter here, but other references are easy to find.
To use the correct contrasts run the following before fitting a mixed model in R:
options(contrasts=c("contr.sum","contr.poly"))
An easier to remember code is to use set_sum_contrasts() from my afex package:
afex::set_sum_contrasts()
Please update your question if this does not resolve your problem (preferably with data to recreate the problem).
|
Big difference between a t-test and a F-test in a mixed model (anova vs summary in lmerTest)
|
Type III tests require correct coding for lower-order effects to be meaningful, specifically orthogonal contrasts. The R default contr.treatment is not orthogonal, other contrasts are though (e.g., co
|
Big difference between a t-test and a F-test in a mixed model (anova vs summary in lmerTest)
Type III tests require correct coding for lower-order effects to be meaningful, specifically orthogonal contrasts. The R default contr.treatment is not orthogonal, other contrasts are though (e.g., contr.sum). In your code it looks like you used did not change the defaults, hence your results are so-called simple main effects. We discuss this in our soon-to-come out chapter here, but other references are easy to find.
To use the correct contrasts run the following before fitting a mixed model in R:
options(contrasts=c("contr.sum","contr.poly"))
An easier to remember code is to use set_sum_contrasts() from my afex package:
afex::set_sum_contrasts()
Please update your question if this does not resolve your problem (preferably with data to recreate the problem).
|
Big difference between a t-test and a F-test in a mixed model (anova vs summary in lmerTest)
Type III tests require correct coding for lower-order effects to be meaningful, specifically orthogonal contrasts. The R default contr.treatment is not orthogonal, other contrasts are though (e.g., co
|
42,319
|
What does alignment between input and output mean for recurrent neural network
|
What the paragraph from Sutskever and Sutskever means is, in a single RNN, the RNN receives a sequence of inputs, and gives a sequence of outputs , typically the same number of outputs as inputs, like:
Inputs: i1 i2 i3 i4 i5 i6 i7
Outputs: o1 o2 o3 o4 o5 o6 o7
So, for each input, we get an output, which could be for example a prediction for the input at the next timestep, though that's not obligatory, just a typical use-case.
Now, this works for tasks such as predicting the next word of a sentence, like i1 is the first word, and i2 is the second. o1 is a prediction for i2, and o2 is a prediction for i3. There is a one-to-one mapping of inputs and outputs.
However, eg to translate from French to English, the number of input words and output words might not match:
Il pleut
It is raining
2 words => 3 words
Sequence to sequence solves this by having two RNNs, back to back. The first one takes an arbitrary sequence, and maps it to a single embedding vector, being simply the hidden state of the RNN, after receiving all the input words.
i1 i2 i3 i4 i5 i6 i7 ... => embedding-vector
Then the second RNN is initialized with this embedding-vector, and then predicts words freely, with no further inputs, until it outputs a termination token.
embedding-vector => o1 o2 o3 ... termination-token
Putting these together, we pump in a sequence of one length, and the output can be a different length, eg:
i1 i2 i3 => embedding-vector => o1 o2 o3 o4 o5 termination-token
|
What does alignment between input and output mean for recurrent neural network
|
What the paragraph from Sutskever and Sutskever means is, in a single RNN, the RNN receives a sequence of inputs, and gives a sequence of outputs , typically the same number of outputs as inputs, like
|
What does alignment between input and output mean for recurrent neural network
What the paragraph from Sutskever and Sutskever means is, in a single RNN, the RNN receives a sequence of inputs, and gives a sequence of outputs , typically the same number of outputs as inputs, like:
Inputs: i1 i2 i3 i4 i5 i6 i7
Outputs: o1 o2 o3 o4 o5 o6 o7
So, for each input, we get an output, which could be for example a prediction for the input at the next timestep, though that's not obligatory, just a typical use-case.
Now, this works for tasks such as predicting the next word of a sentence, like i1 is the first word, and i2 is the second. o1 is a prediction for i2, and o2 is a prediction for i3. There is a one-to-one mapping of inputs and outputs.
However, eg to translate from French to English, the number of input words and output words might not match:
Il pleut
It is raining
2 words => 3 words
Sequence to sequence solves this by having two RNNs, back to back. The first one takes an arbitrary sequence, and maps it to a single embedding vector, being simply the hidden state of the RNN, after receiving all the input words.
i1 i2 i3 i4 i5 i6 i7 ... => embedding-vector
Then the second RNN is initialized with this embedding-vector, and then predicts words freely, with no further inputs, until it outputs a termination token.
embedding-vector => o1 o2 o3 ... termination-token
Putting these together, we pump in a sequence of one length, and the output can be a different length, eg:
i1 i2 i3 => embedding-vector => o1 o2 o3 o4 o5 termination-token
|
What does alignment between input and output mean for recurrent neural network
What the paragraph from Sutskever and Sutskever means is, in a single RNN, the RNN receives a sequence of inputs, and gives a sequence of outputs , typically the same number of outputs as inputs, like
|
42,320
|
Is the expectation of the sufficient statistics $S(X)$ transverse the whole space in an exponential family?
|
Short answer to OP
Not necessarily, it depends on whether the extended convex cone spanned by varying the $\lambda_i$ outside the range of your parameter space can cover the whole mean parameter space. One situation is that your exponential model is over-parameterized, where you cannot "fill" the whole space by varying $\lambda$'s; the other situation is that your exponential family is curved, which also fails such an attempt. See also my answer HERE
I do not really want to turn this answer into an exposition of mean parameter space(Maybe [Brown], but far from complete), but it seems unavoidable now according to successive discussions.
I do not really know if there is any treatises devoted to mean parameter space, but mean parameter space gives a natural representation of the family of probability measures and thus convenient in convex analysis. In most statistical applications, differentiability is way too strong for reality.
$\bullet$ Differentiability w.r.t. parameters is usually only assumed to guarante some kind of consistency when other assumptions are either trivial or too complicated to formalize. E.g. Bootstrap methods.
$\bullet$ Continuity w.r.t. parameters is quite a mild assumption, and we sometimes want to assume it even if the collected data seems to be discrete. Continuity will allow sort of local inference but some optimization technique lost their power. E.g. Rapidest gradient method.
$\bullet$ Convexity w.r.t. parameters is the weakest assumption among three, but even so we do not always want to assume that. E.g. Concave loss function.
The mean parameter space is introduced to give the "convex family" a useful representation. Later in the study of positivity [Karlin], the duality between mean parameter space and the family of p.m.s is found to be very useful. There are other motivations like Frenchel duality from convex analysis that explains why we study the mean parameter space. But you can see that some sort of subgradients is usually introduced to model the convex space after Hilbert space.
Now we explain why mean parameter space is important. Define the dual cone for a convex cone $C\subset\mathbb{R}^{n+1}$ $C^+:=\{v\in\mathbb{R}^{n+1}:<v,u>\geq 0,\forall u\in C\}$ For a special case, Karlin-Shapley representation theorem[Karlin&Shapley] told us that the extreme rays/points of the dual cone of the moment space associated with the family lies exactly at the boundary of the parameter space.
For what kind of values can the sufficient family attain, if the sufficient statistics $S(X)$ is also complete and have the same dimension as the parameter space,
which mean the structure of the exponential family is linear, then I believe as long as the parameter space does not have a degenerate boundary, the expectation $ES(X)$ of sufficient statistics can transverse all values. From perspective of geometry, only when the dual cone degenerates, you can transverse the whole space, reaching all "possible values" $ES(X)$ possibly have.
When it is not complete or over-parameterized or curved, I am not sure.
In your second example, the dual cone of moment space is actually a strict cone while in the first example a degenerated cone (the whole $\mathbb{R}\times\mathbb{R}$, just imagine that the diameter of a cone tends to $\infty$). But I am still not clear how your reach the result you claimed.
Reference
[Brown]Brown, Lawrence D. "Fundamentals of statistical exponential families with applications in statistical decision theory." Lecture Notes-monograph series 9 (1986): i-279.
[Karlin]Karlin, Samuel. Total positivity. Vol. 1. Stanford University Press, 1968.
[Karlin&Shapley]Karlin, Samuel, and Lloyd S. Shapley. Geometry of moment spaces. No. 12. American Mathematical Soc., 1953.
|
Is the expectation of the sufficient statistics $S(X)$ transverse the whole space in an exponential
|
Short answer to OP
Not necessarily, it depends on whether the extended convex cone spanned by varying the $\lambda_i$ outside the range of your parameter space can cover the whole mean parameter space
|
Is the expectation of the sufficient statistics $S(X)$ transverse the whole space in an exponential family?
Short answer to OP
Not necessarily, it depends on whether the extended convex cone spanned by varying the $\lambda_i$ outside the range of your parameter space can cover the whole mean parameter space. One situation is that your exponential model is over-parameterized, where you cannot "fill" the whole space by varying $\lambda$'s; the other situation is that your exponential family is curved, which also fails such an attempt. See also my answer HERE
I do not really want to turn this answer into an exposition of mean parameter space(Maybe [Brown], but far from complete), but it seems unavoidable now according to successive discussions.
I do not really know if there is any treatises devoted to mean parameter space, but mean parameter space gives a natural representation of the family of probability measures and thus convenient in convex analysis. In most statistical applications, differentiability is way too strong for reality.
$\bullet$ Differentiability w.r.t. parameters is usually only assumed to guarante some kind of consistency when other assumptions are either trivial or too complicated to formalize. E.g. Bootstrap methods.
$\bullet$ Continuity w.r.t. parameters is quite a mild assumption, and we sometimes want to assume it even if the collected data seems to be discrete. Continuity will allow sort of local inference but some optimization technique lost their power. E.g. Rapidest gradient method.
$\bullet$ Convexity w.r.t. parameters is the weakest assumption among three, but even so we do not always want to assume that. E.g. Concave loss function.
The mean parameter space is introduced to give the "convex family" a useful representation. Later in the study of positivity [Karlin], the duality between mean parameter space and the family of p.m.s is found to be very useful. There are other motivations like Frenchel duality from convex analysis that explains why we study the mean parameter space. But you can see that some sort of subgradients is usually introduced to model the convex space after Hilbert space.
Now we explain why mean parameter space is important. Define the dual cone for a convex cone $C\subset\mathbb{R}^{n+1}$ $C^+:=\{v\in\mathbb{R}^{n+1}:<v,u>\geq 0,\forall u\in C\}$ For a special case, Karlin-Shapley representation theorem[Karlin&Shapley] told us that the extreme rays/points of the dual cone of the moment space associated with the family lies exactly at the boundary of the parameter space.
For what kind of values can the sufficient family attain, if the sufficient statistics $S(X)$ is also complete and have the same dimension as the parameter space,
which mean the structure of the exponential family is linear, then I believe as long as the parameter space does not have a degenerate boundary, the expectation $ES(X)$ of sufficient statistics can transverse all values. From perspective of geometry, only when the dual cone degenerates, you can transverse the whole space, reaching all "possible values" $ES(X)$ possibly have.
When it is not complete or over-parameterized or curved, I am not sure.
In your second example, the dual cone of moment space is actually a strict cone while in the first example a degenerated cone (the whole $\mathbb{R}\times\mathbb{R}$, just imagine that the diameter of a cone tends to $\infty$). But I am still not clear how your reach the result you claimed.
Reference
[Brown]Brown, Lawrence D. "Fundamentals of statistical exponential families with applications in statistical decision theory." Lecture Notes-monograph series 9 (1986): i-279.
[Karlin]Karlin, Samuel. Total positivity. Vol. 1. Stanford University Press, 1968.
[Karlin&Shapley]Karlin, Samuel, and Lloyd S. Shapley. Geometry of moment spaces. No. 12. American Mathematical Soc., 1953.
|
Is the expectation of the sufficient statistics $S(X)$ transverse the whole space in an exponential
Short answer to OP
Not necessarily, it depends on whether the extended convex cone spanned by varying the $\lambda_i$ outside the range of your parameter space can cover the whole mean parameter space
|
42,321
|
Standardizing quadratic variables in linear model [closed]
|
I was just looking at the same question and did some simple simulations to get the answer using a poisson glm. It turns out that both methods make the exact same predictions as using the unstandardized variables. The difference is that method 2 (reflected in "mod1" in the code below) gives the exact same z-scores and p-values for both variables as the unstandardized model ("mod" below), while method 1 (reflected in "mod2" below) estimates that variable 1 is not significant while the quadratic is.
Here is the simulation code in R:
# ----------------------------------
n.site <- 200
vege <- sort(runif(n.site, 0, 1))
alpha.lam <- 2
beta1.lam <- 2
beta2.lam <- -2
lam <- exp(alpha.lam + beta1.lam*vege + beta2.lam*(vege^2))
N <- rpois(n.site, lam)
plot(vege, lam)
z.veg <- scale(vege)
z.veg2 <- scale(vege^2)
z.vege2.1 <- z.veg^2
mod <- glm(N ~ vege + I(vege^2), family = poisson)
a <- predict(mod, data = vege)
mod1 <- glm(N ~ z.veg + z.veg2, family = poisson)
b <- predict(mod1, data = c(z.veg, z.veg2))
mod2 <- glm(N ~ z.veg + z.vege2.1, family = poisson)
c <- predict(mod2, data = c(z.veg, z.vege2.1))
summary(mod)
summary(mod1)
summary(mod2)
par(mfrow=c(2, 2))
plot(vege, lam)
plot(vege, a)
plot(vege, b)
plot(vege, c)
# ----------------------------------
|
Standardizing quadratic variables in linear model [closed]
|
I was just looking at the same question and did some simple simulations to get the answer using a poisson glm. It turns out that both methods make the exact same predictions as using the unstandardize
|
Standardizing quadratic variables in linear model [closed]
I was just looking at the same question and did some simple simulations to get the answer using a poisson glm. It turns out that both methods make the exact same predictions as using the unstandardized variables. The difference is that method 2 (reflected in "mod1" in the code below) gives the exact same z-scores and p-values for both variables as the unstandardized model ("mod" below), while method 1 (reflected in "mod2" below) estimates that variable 1 is not significant while the quadratic is.
Here is the simulation code in R:
# ----------------------------------
n.site <- 200
vege <- sort(runif(n.site, 0, 1))
alpha.lam <- 2
beta1.lam <- 2
beta2.lam <- -2
lam <- exp(alpha.lam + beta1.lam*vege + beta2.lam*(vege^2))
N <- rpois(n.site, lam)
plot(vege, lam)
z.veg <- scale(vege)
z.veg2 <- scale(vege^2)
z.vege2.1 <- z.veg^2
mod <- glm(N ~ vege + I(vege^2), family = poisson)
a <- predict(mod, data = vege)
mod1 <- glm(N ~ z.veg + z.veg2, family = poisson)
b <- predict(mod1, data = c(z.veg, z.veg2))
mod2 <- glm(N ~ z.veg + z.vege2.1, family = poisson)
c <- predict(mod2, data = c(z.veg, z.vege2.1))
summary(mod)
summary(mod1)
summary(mod2)
par(mfrow=c(2, 2))
plot(vege, lam)
plot(vege, a)
plot(vege, b)
plot(vege, c)
# ----------------------------------
|
Standardizing quadratic variables in linear model [closed]
I was just looking at the same question and did some simple simulations to get the answer using a poisson glm. It turns out that both methods make the exact same predictions as using the unstandardize
|
42,322
|
Standardizing quadratic variables in linear model [closed]
|
One add-on to Neerajs and Andrews answer:
If you consider the correlations between the linear and squared term, you will see that method 2 (first squaring then scaling) produces the same correlation as the original variables. Method 1 on the other hand creates much more orthogonal variables:
vege <- sort(runif(200, 0, 1))
veg2<-vege^2
z.veg <- scale(vege)
z.veg2 <- scale(veg2)
z.vege2.1 <- z.veg^2
#original variables
cor(veg2,vege) #highly correlated e.g. 0.97
#method 2
cor(z.veg2,z.veg) #highly correlated e.g. 0.97
#method 1
cor(z.vege2.1,z.veg) #much less correlated e.g. -0.13
Thus collinearities in a multiple regressions are removed, which might be worthy of consideration. But still I'd love to hear an expert on that
|
Standardizing quadratic variables in linear model [closed]
|
One add-on to Neerajs and Andrews answer:
If you consider the correlations between the linear and squared term, you will see that method 2 (first squaring then scaling) produces the same correlation a
|
Standardizing quadratic variables in linear model [closed]
One add-on to Neerajs and Andrews answer:
If you consider the correlations between the linear and squared term, you will see that method 2 (first squaring then scaling) produces the same correlation as the original variables. Method 1 on the other hand creates much more orthogonal variables:
vege <- sort(runif(200, 0, 1))
veg2<-vege^2
z.veg <- scale(vege)
z.veg2 <- scale(veg2)
z.vege2.1 <- z.veg^2
#original variables
cor(veg2,vege) #highly correlated e.g. 0.97
#method 2
cor(z.veg2,z.veg) #highly correlated e.g. 0.97
#method 1
cor(z.vege2.1,z.veg) #much less correlated e.g. -0.13
Thus collinearities in a multiple regressions are removed, which might be worthy of consideration. But still I'd love to hear an expert on that
|
Standardizing quadratic variables in linear model [closed]
One add-on to Neerajs and Andrews answer:
If you consider the correlations between the linear and squared term, you will see that method 2 (first squaring then scaling) produces the same correlation a
|
42,323
|
Standardizing quadratic variables in linear model [closed]
|
I would prefer the first method. Here you have normalized the data initially itself before taking the linear / quadratic terms in your equation.
Standardization is meant for data (predictor) to bring them into same scale.
It is not related with any terms. You can go to cubic/quadratic terms too here in your equation based on your need.
|
Standardizing quadratic variables in linear model [closed]
|
I would prefer the first method. Here you have normalized the data initially itself before taking the linear / quadratic terms in your equation.
Standardization is meant for data (predictor) to bring
|
Standardizing quadratic variables in linear model [closed]
I would prefer the first method. Here you have normalized the data initially itself before taking the linear / quadratic terms in your equation.
Standardization is meant for data (predictor) to bring them into same scale.
It is not related with any terms. You can go to cubic/quadratic terms too here in your equation based on your need.
|
Standardizing quadratic variables in linear model [closed]
I would prefer the first method. Here you have normalized the data initially itself before taking the linear / quadratic terms in your equation.
Standardization is meant for data (predictor) to bring
|
42,324
|
What is the difference between artificial intelligence and machine intelligence?
|
Nice, provocative, definition is given by Yonatan Zunger in his Asking the Right Questions About AI article posted on Medium.com:
... I’m going to use the terms “artificial intelligence”
(AI) and “machine learning” (ML) more or less interchangeably. There’s
a stupid reason these terms mean almost the same thing: it’s that
“artificial intelligence” has historically been defined as “whatever
computers can’t do yet.” For years, people argued that it would take
true artificial intelligence to play chess, or simulate conversations, or recognize images; every time one of those things
actually happened, the goalposts got moved. The phrase “artificial
intelligence” was just too frightening: it cut too close, perhaps, to
the way we define ourselves, and what makes us different as humans. So
at some point, professionals started using the term “machine learning”
to avoid the entire conversation, and it stuck.
|
What is the difference between artificial intelligence and machine intelligence?
|
Nice, provocative, definition is given by Yonatan Zunger in his Asking the Right Questions About AI article posted on Medium.com:
... I’m going to use the terms “artificial intelligence”
(AI) and “
|
What is the difference between artificial intelligence and machine intelligence?
Nice, provocative, definition is given by Yonatan Zunger in his Asking the Right Questions About AI article posted on Medium.com:
... I’m going to use the terms “artificial intelligence”
(AI) and “machine learning” (ML) more or less interchangeably. There’s
a stupid reason these terms mean almost the same thing: it’s that
“artificial intelligence” has historically been defined as “whatever
computers can’t do yet.” For years, people argued that it would take
true artificial intelligence to play chess, or simulate conversations, or recognize images; every time one of those things
actually happened, the goalposts got moved. The phrase “artificial
intelligence” was just too frightening: it cut too close, perhaps, to
the way we define ourselves, and what makes us different as humans. So
at some point, professionals started using the term “machine learning”
to avoid the entire conversation, and it stuck.
|
What is the difference between artificial intelligence and machine intelligence?
Nice, provocative, definition is given by Yonatan Zunger in his Asking the Right Questions About AI article posted on Medium.com:
... I’m going to use the terms “artificial intelligence”
(AI) and “
|
42,325
|
What is the difference between artificial intelligence and machine intelligence?
|
Artificial intelligence (AI) in their highly cited book by that name has been described by Stuart J. Russell and Peter Norvig as intelligent agent design consisting of the following:
The unifying theme of the book is the concept of an intelligent agent.
In this view, the problem of AI is to describe and build agents that
receive precepts from the environment and perform actions. Each such
agent is implemented by a function that maps percepts to actions, and
we cover different ways to represent these functions, such as
production systems, reactive agents, logical planners, neural
networks, and decision-theoretic systems. We explain the role of
learning as extending the reach of the designer into unknown
environments, and show how it constrains agent design, favoring
explicit knowledge representation and reasoning. We treat robotics and
vision not as independently defined problems, but as occurring in the
service of goal achievement. We stress the importance of the task
environment characteristics in determining the appropriate agent
design.
In contrast to AI the term machine intelligence appears in a more sub-specialized or mechanical computational context, for example a natural language translation machine, a Turning machine, and more generally Raymond
Kurzweil's (1990) Age of Intelligent Machines treats AI in the context of computer science and intellectual history in general.
I suppose one could claim that not every artifice is silicon based, that some could be constructed from biological neurons grown in a Petri dish, in which case we could construct an artificial intelligence that is not especially a machine intelligence. In other words, not every artifice is a machine.
|
What is the difference between artificial intelligence and machine intelligence?
|
Artificial intelligence (AI) in their highly cited book by that name has been described by Stuart J. Russell and Peter Norvig as intelligent agent design consisting of the following:
The unifying the
|
What is the difference between artificial intelligence and machine intelligence?
Artificial intelligence (AI) in their highly cited book by that name has been described by Stuart J. Russell and Peter Norvig as intelligent agent design consisting of the following:
The unifying theme of the book is the concept of an intelligent agent.
In this view, the problem of AI is to describe and build agents that
receive precepts from the environment and perform actions. Each such
agent is implemented by a function that maps percepts to actions, and
we cover different ways to represent these functions, such as
production systems, reactive agents, logical planners, neural
networks, and decision-theoretic systems. We explain the role of
learning as extending the reach of the designer into unknown
environments, and show how it constrains agent design, favoring
explicit knowledge representation and reasoning. We treat robotics and
vision not as independently defined problems, but as occurring in the
service of goal achievement. We stress the importance of the task
environment characteristics in determining the appropriate agent
design.
In contrast to AI the term machine intelligence appears in a more sub-specialized or mechanical computational context, for example a natural language translation machine, a Turning machine, and more generally Raymond
Kurzweil's (1990) Age of Intelligent Machines treats AI in the context of computer science and intellectual history in general.
I suppose one could claim that not every artifice is silicon based, that some could be constructed from biological neurons grown in a Petri dish, in which case we could construct an artificial intelligence that is not especially a machine intelligence. In other words, not every artifice is a machine.
|
What is the difference between artificial intelligence and machine intelligence?
Artificial intelligence (AI) in their highly cited book by that name has been described by Stuart J. Russell and Peter Norvig as intelligent agent design consisting of the following:
The unifying the
|
42,326
|
What is the difference between artificial intelligence and machine intelligence?
|
Difference between AI & ML
Artificial Intelligence : The word Artificial Intelligence comprises of two words “Artificial” and “Intelligence”. Artificial refers to something which is made by human or non natural thing and Intelligence means ability to understand or think. There is a misconception that Artificial Intelligence is a system, but it is not a system .AI is implemented in the system. There can be so many definition of AI, one definition can be “It is the study of how to train the computers so that computers can do things which at present human can do better.”Therefore It is a intelligence where we want to add all the capabilities to machine that human contain.
Machine Learning : Machine Learning is the learning in which machine can learn by its own without being explicitly programmed. It is an application of AI that provide system the ability to automatically learn and improve from experience. Here we can generate a program by integrating input and output of that program. One of the simple definition of the Machine Learning is “Machine Learning is said to learn from experience E w.r.t some class of task T and a performance measure P if learners performance at the task in the class as measured by P improves with experiences.”
Click on the link to know more:http://snip.ly/94wpqt
|
What is the difference between artificial intelligence and machine intelligence?
|
Difference between AI & ML
Artificial Intelligence : The word Artificial Intelligence comprises of two words “Artificial” and “Intelligence”. Artificial refers to something which is made by human or n
|
What is the difference between artificial intelligence and machine intelligence?
Difference between AI & ML
Artificial Intelligence : The word Artificial Intelligence comprises of two words “Artificial” and “Intelligence”. Artificial refers to something which is made by human or non natural thing and Intelligence means ability to understand or think. There is a misconception that Artificial Intelligence is a system, but it is not a system .AI is implemented in the system. There can be so many definition of AI, one definition can be “It is the study of how to train the computers so that computers can do things which at present human can do better.”Therefore It is a intelligence where we want to add all the capabilities to machine that human contain.
Machine Learning : Machine Learning is the learning in which machine can learn by its own without being explicitly programmed. It is an application of AI that provide system the ability to automatically learn and improve from experience. Here we can generate a program by integrating input and output of that program. One of the simple definition of the Machine Learning is “Machine Learning is said to learn from experience E w.r.t some class of task T and a performance measure P if learners performance at the task in the class as measured by P improves with experiences.”
Click on the link to know more:http://snip.ly/94wpqt
|
What is the difference between artificial intelligence and machine intelligence?
Difference between AI & ML
Artificial Intelligence : The word Artificial Intelligence comprises of two words “Artificial” and “Intelligence”. Artificial refers to something which is made by human or n
|
42,327
|
Judging flatness of time-series
|
I would consider the following protocol, which I would call quick-and-dirty. Code is from R.
a) Determine a linear model
mod<-lm(signal ~ t)
to see if there is evidence for a trend. See if the coefficients have p-values satisfying $p \le 0.025$, or some other suitably small $\alpha/2$.
b) Subtract the model elements that are significant at your chosen $\alpha/2$.
c) Considering only the residuals obtained from part b, determine if a non-trivial auto-correlation exists.
plot(acf(residuals))
If there is no evidence of autocorrelation with lag $d > 0$, namely, that for all $d$, $ACF < 1.96/(T-d)$, as described by @RichardHardy here, where $T$ is the number of points in the sample, then then you may conclude "flat," or really "featureless."
If there is evidence of autocorrelation with lag $d>0$ then you may conclude, provisionally, "not flat" pending analysis of other models in which you test if "bumps" in the time series meet your criterion for being "well-formed" or "coherent".
End quick and dirty.
A related question is whether a time series is stationary. You didn't ask that, but if you had, there would be more to say. Regardless, for short time series, it is hard to conclude demonstrate non-stationarity on any meaningfully long time scale.
So quick-and-dirty is probably the way to go.
|
Judging flatness of time-series
|
I would consider the following protocol, which I would call quick-and-dirty. Code is from R.
a) Determine a linear model
mod<-lm(signal ~ t)
to see if there is evidence for a trend. See if the co
|
Judging flatness of time-series
I would consider the following protocol, which I would call quick-and-dirty. Code is from R.
a) Determine a linear model
mod<-lm(signal ~ t)
to see if there is evidence for a trend. See if the coefficients have p-values satisfying $p \le 0.025$, or some other suitably small $\alpha/2$.
b) Subtract the model elements that are significant at your chosen $\alpha/2$.
c) Considering only the residuals obtained from part b, determine if a non-trivial auto-correlation exists.
plot(acf(residuals))
If there is no evidence of autocorrelation with lag $d > 0$, namely, that for all $d$, $ACF < 1.96/(T-d)$, as described by @RichardHardy here, where $T$ is the number of points in the sample, then then you may conclude "flat," or really "featureless."
If there is evidence of autocorrelation with lag $d>0$ then you may conclude, provisionally, "not flat" pending analysis of other models in which you test if "bumps" in the time series meet your criterion for being "well-formed" or "coherent".
End quick and dirty.
A related question is whether a time series is stationary. You didn't ask that, but if you had, there would be more to say. Regardless, for short time series, it is hard to conclude demonstrate non-stationarity on any meaningfully long time scale.
So quick-and-dirty is probably the way to go.
|
Judging flatness of time-series
I would consider the following protocol, which I would call quick-and-dirty. Code is from R.
a) Determine a linear model
mod<-lm(signal ~ t)
to see if there is evidence for a trend. See if the co
|
42,328
|
Judging flatness of time-series
|
I can imagine a report that summarizes statistically significant model structures for each time series. This report would contain information like the #of step/level shifts encountered, the # of positive pulses , the # of negative pulses , the # of deterministic trends , a pointer indicating a stochastic trend ,# of break points in error variance etc. . This information could then be post-processed for purposes of distinguishing between the characteristic of 'flatness' . I have programmed a number of these summary reports which enable contrasts to be made. This is a feature of AUTOBOX which I have helped to develop and it might be useful for you to see them as an example of what you could possibly implement.
|
Judging flatness of time-series
|
I can imagine a report that summarizes statistically significant model structures for each time series. This report would contain information like the #of step/level shifts encountered, the # of posit
|
Judging flatness of time-series
I can imagine a report that summarizes statistically significant model structures for each time series. This report would contain information like the #of step/level shifts encountered, the # of positive pulses , the # of negative pulses , the # of deterministic trends , a pointer indicating a stochastic trend ,# of break points in error variance etc. . This information could then be post-processed for purposes of distinguishing between the characteristic of 'flatness' . I have programmed a number of these summary reports which enable contrasts to be made. This is a feature of AUTOBOX which I have helped to develop and it might be useful for you to see them as an example of what you could possibly implement.
|
Judging flatness of time-series
I can imagine a report that summarizes statistically significant model structures for each time series. This report would contain information like the #of step/level shifts encountered, the # of posit
|
42,329
|
How to decide the "best" accuracy score for prediction of binary outcome?
|
The scores are continuous not (necessarily) in the sense of small perturbations to the input data, but rather in small perturbations of the prediction model. Of course, small perturbations in input data will often yield small perturbations in the model.
If you have probabilistic predictions for a discrete classification and perturb these probabilities slightly, scores will only change slightly.
In contrast, assume you output non-probabilistic classifications that are based on these probabilities and a probability threshold, and then assess quality via accuracy, precision or similar. If you perturb the probabilities or the threshold slightly, then the classifications will not change, nor will accuracy/precision. However, at slightly larger perturbations, the first cases will discretely change classification, and at this point, accuracy/precision will change by a discrete step.
Yes, scores will depend on the underlying prevalence. But this is typically considered as given, whereas the thing we want to vary is the predictive model, so this is not a problem. (And in any case, as the prevalence changes, scores will change continuously with it.)
How to choose among different possible scoring rules is a thornier problem. Merkle & Steyvers (2013, Decision Analysis) point out that the Brier and the logarithmic scores are members of a two-parameter family of proper scoring rules (of course, not all members are strictly proper). They give a few guidelines on how to choose a rule and point out that "Researchers often find that one’s choice of strictly proper scoring rule has minimal impact on one’s conclusions", at least if we restrict ourselves to the "classical" scoring rules.
|
How to decide the "best" accuracy score for prediction of binary outcome?
|
The scores are continuous not (necessarily) in the sense of small perturbations to the input data, but rather in small perturbations of the prediction model. Of course, small perturbations in input da
|
How to decide the "best" accuracy score for prediction of binary outcome?
The scores are continuous not (necessarily) in the sense of small perturbations to the input data, but rather in small perturbations of the prediction model. Of course, small perturbations in input data will often yield small perturbations in the model.
If you have probabilistic predictions for a discrete classification and perturb these probabilities slightly, scores will only change slightly.
In contrast, assume you output non-probabilistic classifications that are based on these probabilities and a probability threshold, and then assess quality via accuracy, precision or similar. If you perturb the probabilities or the threshold slightly, then the classifications will not change, nor will accuracy/precision. However, at slightly larger perturbations, the first cases will discretely change classification, and at this point, accuracy/precision will change by a discrete step.
Yes, scores will depend on the underlying prevalence. But this is typically considered as given, whereas the thing we want to vary is the predictive model, so this is not a problem. (And in any case, as the prevalence changes, scores will change continuously with it.)
How to choose among different possible scoring rules is a thornier problem. Merkle & Steyvers (2013, Decision Analysis) point out that the Brier and the logarithmic scores are members of a two-parameter family of proper scoring rules (of course, not all members are strictly proper). They give a few guidelines on how to choose a rule and point out that "Researchers often find that one’s choice of strictly proper scoring rule has minimal impact on one’s conclusions", at least if we restrict ourselves to the "classical" scoring rules.
|
How to decide the "best" accuracy score for prediction of binary outcome?
The scores are continuous not (necessarily) in the sense of small perturbations to the input data, but rather in small perturbations of the prediction model. Of course, small perturbations in input da
|
42,330
|
Famous historical example(s) of Type II error
|
"The harm done by tests of significance" (pdf) relates 3 true stories in which not rejecting the null while it was actually false (so making a Type II error) has been interpreted as accepting the null and had lead to bad general interest decisions. Here is a brief summary of one of them:
The practice of allowing right-turn-on-red (or RTOR) at signalized intersections started in California in 1937.
To see weither this can be generalized to other state, a consultant did before–after study at 20 intersections for Virginia and concluded, quite correctly, that the change was not statistically significant.
More published studies followed. An example: one study in 1977 found that there were 19 crashes involving right turning vehicles before and 24 after allowing RTOR and "conclude correctly that “this increase in accidents in not statistically significant, and therefore it cannot be said that this increase in RTOR accidents is attributable to RTOR”". Several small studies all pointing in the same direction get published but with statistically not significant results continued to accumulate all concluding that there was no significant difference in crashes.
"After RTOR became nearly universally used in North America, several large data sets became available and the adverse effect of RTOR could be established."
The author concludes:
Researchers obtain real data which, while noisy, time and again point in a certain direction. However, instead of saying: “here is my estimate of the safety effect, here is its precision, and this is how what I found relates to previous findings”, the data is processed by NHST, and the researcher says, correctly but pointlessly: “I cannot be sure that the safety effect is not zero”.
|
Famous historical example(s) of Type II error
|
"The harm done by tests of significance" (pdf) relates 3 true stories in which not rejecting the null while it was actually false (so making a Type II error) has been interpreted as accepting the nul
|
Famous historical example(s) of Type II error
"The harm done by tests of significance" (pdf) relates 3 true stories in which not rejecting the null while it was actually false (so making a Type II error) has been interpreted as accepting the null and had lead to bad general interest decisions. Here is a brief summary of one of them:
The practice of allowing right-turn-on-red (or RTOR) at signalized intersections started in California in 1937.
To see weither this can be generalized to other state, a consultant did before–after study at 20 intersections for Virginia and concluded, quite correctly, that the change was not statistically significant.
More published studies followed. An example: one study in 1977 found that there were 19 crashes involving right turning vehicles before and 24 after allowing RTOR and "conclude correctly that “this increase in accidents in not statistically significant, and therefore it cannot be said that this increase in RTOR accidents is attributable to RTOR”". Several small studies all pointing in the same direction get published but with statistically not significant results continued to accumulate all concluding that there was no significant difference in crashes.
"After RTOR became nearly universally used in North America, several large data sets became available and the adverse effect of RTOR could be established."
The author concludes:
Researchers obtain real data which, while noisy, time and again point in a certain direction. However, instead of saying: “here is my estimate of the safety effect, here is its precision, and this is how what I found relates to previous findings”, the data is processed by NHST, and the researcher says, correctly but pointlessly: “I cannot be sure that the safety effect is not zero”.
|
Famous historical example(s) of Type II error
"The harm done by tests of significance" (pdf) relates 3 true stories in which not rejecting the null while it was actually false (so making a Type II error) has been interpreted as accepting the nul
|
42,331
|
How do I examine biasedness in nonlinear regression?
|
If you define
$$z\equiv{y}-e^{\beta_2 x_2}=\beta_0+\beta_1 x_1+u$$
then given $\beta_2$, you can estimate $\beta_0$ and $\beta_1$ via OLS.
This trick is useful computationally to turn your problem into a scalar nonlinear optimization over $\beta_2$.
As OLS is unbiased, any bias in the nonlinear parameter will be inherited by the linear parameters. That is, if $\beta_2$ is unbiased, then all parameters will be unbiased. But if not, then the linear parameters must also be biased. So in general the answer to your question B is no.
For your question A, numerical experiments would be a reasonable start. (Here the regime of interest would be where the range of $\beta_2x_2$ is "not too small", else the nonlinearity will be "linearized out".)
Note also that your references give some approximate formulas for estimating the bias.
Clarification: the optimization objective function (error) is identical when using the partitioned approach, i.e.
$$E\big[\beta_{0:2}\big]=\tfrac{1}{2}\Big\|z\big[\beta_2\big]-\hat{y}_\mathrm{lin}\big[\beta_{0:1}\big]\Big\|^2$$
The "separable" approach works because for the linear sub-problem, OLS gives the global optimum (for a given $\beta_2$).
|
How do I examine biasedness in nonlinear regression?
|
If you define
$$z\equiv{y}-e^{\beta_2 x_2}=\beta_0+\beta_1 x_1+u$$
then given $\beta_2$, you can estimate $\beta_0$ and $\beta_1$ via OLS.
This trick is useful computationally to turn your problem int
|
How do I examine biasedness in nonlinear regression?
If you define
$$z\equiv{y}-e^{\beta_2 x_2}=\beta_0+\beta_1 x_1+u$$
then given $\beta_2$, you can estimate $\beta_0$ and $\beta_1$ via OLS.
This trick is useful computationally to turn your problem into a scalar nonlinear optimization over $\beta_2$.
As OLS is unbiased, any bias in the nonlinear parameter will be inherited by the linear parameters. That is, if $\beta_2$ is unbiased, then all parameters will be unbiased. But if not, then the linear parameters must also be biased. So in general the answer to your question B is no.
For your question A, numerical experiments would be a reasonable start. (Here the regime of interest would be where the range of $\beta_2x_2$ is "not too small", else the nonlinearity will be "linearized out".)
Note also that your references give some approximate formulas for estimating the bias.
Clarification: the optimization objective function (error) is identical when using the partitioned approach, i.e.
$$E\big[\beta_{0:2}\big]=\tfrac{1}{2}\Big\|z\big[\beta_2\big]-\hat{y}_\mathrm{lin}\big[\beta_{0:1}\big]\Big\|^2$$
The "separable" approach works because for the linear sub-problem, OLS gives the global optimum (for a given $\beta_2$).
|
How do I examine biasedness in nonlinear regression?
If you define
$$z\equiv{y}-e^{\beta_2 x_2}=\beta_0+\beta_1 x_1+u$$
then given $\beta_2$, you can estimate $\beta_0$ and $\beta_1$ via OLS.
This trick is useful computationally to turn your problem int
|
42,332
|
How do I examine biasedness in nonlinear regression?
|
In order to be able to talk about whether $\hat{\beta}$ is biased, we need to have some concept of a true $\beta$. That is, we need to specify a data-generating process. So in order to make this problem tractable, let's assume that
$y_i = \beta_0 + \beta_1 x_{i1} + e^{\beta_2 x_{i2}} + u_i$
and
$u_i \sim N(0, \sigma^2)$.
Your estimator is asymptotically unbiased because it has the same
solution as a maximum likelihood problem, and MLE is asymptotically unbiased.
Here's the math:
\begin{align}
f(y_i | x_i; b, \sigma^2) = \frac{1}{\sqrt{2 \pi \sigma^2}} e^{-(y_i - b_0 - b_1 x_{i1} - e^{b_2 x_{i2}})^2 / 2 \sigma^2} \\
\end{align}
$
\log(LL(b, \sigma | y_1, \dots y_n, x_1, \dots x_n)) =
-\frac{n}{2} \log(\sigma^2) - \sum_i (y_i - b_0 - b_1 x_{i1} - e^{b_2 x_{i2}})^2 / (2 \sigma^2)
$
You can check that the log-likelihood has the same first-order conditions for $b_0$, $b_1$, and $b_2$ as the least-squares problem you set up, so it has the same answer. (Solving this as an MLE problem also requires estimating $\sigma^2$, but the estimate of $\sigma^2$ doesn't affect the estimates of $\beta$.)
So it's asymptotically unbiased, but what about in finite samples? I'm not sure how to prove that. Here's a sketchy "proof by Matlab", where the first three components of "params" correspond to $\beta$ and the last corresponds to $\sigma^2$::
b = [1, 1, 1];
sigma_squared = 1;
n = 100;
nIters = 10000;
rng(10317);
ll = @(y, x, b, n) sum((y - b(1) - b(2)*x(:, 1) - exp(b(3) * x(:, 2))).^2) / (2 * b(4)) + .5 * n* log(b(4));
params = zeros(niters, 4);
options = optimoptions(@fminunc, 'Algorithm', 'quasi-newton')
x = normrnd(0, 1, n(n_obs), 2);
mean_ = b(1) + x(:, 1) * b(2) + exp(x(:, 2) * b(3));
for ii = 1:niters
y = mean_ + normrnd(0, sigma_squared, n(n_obs), 1);
params(ii, :) = fminunc(@(b) ll(y, x, b, n(n_obs)), [1, 1, 1, 1], options);
end
E_b_hat = mean(params);
b_se = std(params) / (nIters - 1);
bias = E_b_hat - b;
I get a near-zero and insignificant bias for $\hat{\beta}$. However, this only "proves" that $\hat{\beta}$ is unbiased for a particular value of $\beta$ and distribution of $u$ and $x$. This estimator might not be finite-sample unbiased in general.
(A general tip that doesn't apply here: When it's easy to prove biasedness in nonlinear least squares, it's often through invoking Jensen's Inequality. See this reference.)
|
How do I examine biasedness in nonlinear regression?
|
In order to be able to talk about whether $\hat{\beta}$ is biased, we need to have some concept of a true $\beta$. That is, we need to specify a data-generating process. So in order to make this probl
|
How do I examine biasedness in nonlinear regression?
In order to be able to talk about whether $\hat{\beta}$ is biased, we need to have some concept of a true $\beta$. That is, we need to specify a data-generating process. So in order to make this problem tractable, let's assume that
$y_i = \beta_0 + \beta_1 x_{i1} + e^{\beta_2 x_{i2}} + u_i$
and
$u_i \sim N(0, \sigma^2)$.
Your estimator is asymptotically unbiased because it has the same
solution as a maximum likelihood problem, and MLE is asymptotically unbiased.
Here's the math:
\begin{align}
f(y_i | x_i; b, \sigma^2) = \frac{1}{\sqrt{2 \pi \sigma^2}} e^{-(y_i - b_0 - b_1 x_{i1} - e^{b_2 x_{i2}})^2 / 2 \sigma^2} \\
\end{align}
$
\log(LL(b, \sigma | y_1, \dots y_n, x_1, \dots x_n)) =
-\frac{n}{2} \log(\sigma^2) - \sum_i (y_i - b_0 - b_1 x_{i1} - e^{b_2 x_{i2}})^2 / (2 \sigma^2)
$
You can check that the log-likelihood has the same first-order conditions for $b_0$, $b_1$, and $b_2$ as the least-squares problem you set up, so it has the same answer. (Solving this as an MLE problem also requires estimating $\sigma^2$, but the estimate of $\sigma^2$ doesn't affect the estimates of $\beta$.)
So it's asymptotically unbiased, but what about in finite samples? I'm not sure how to prove that. Here's a sketchy "proof by Matlab", where the first three components of "params" correspond to $\beta$ and the last corresponds to $\sigma^2$::
b = [1, 1, 1];
sigma_squared = 1;
n = 100;
nIters = 10000;
rng(10317);
ll = @(y, x, b, n) sum((y - b(1) - b(2)*x(:, 1) - exp(b(3) * x(:, 2))).^2) / (2 * b(4)) + .5 * n* log(b(4));
params = zeros(niters, 4);
options = optimoptions(@fminunc, 'Algorithm', 'quasi-newton')
x = normrnd(0, 1, n(n_obs), 2);
mean_ = b(1) + x(:, 1) * b(2) + exp(x(:, 2) * b(3));
for ii = 1:niters
y = mean_ + normrnd(0, sigma_squared, n(n_obs), 1);
params(ii, :) = fminunc(@(b) ll(y, x, b, n(n_obs)), [1, 1, 1, 1], options);
end
E_b_hat = mean(params);
b_se = std(params) / (nIters - 1);
bias = E_b_hat - b;
I get a near-zero and insignificant bias for $\hat{\beta}$. However, this only "proves" that $\hat{\beta}$ is unbiased for a particular value of $\beta$ and distribution of $u$ and $x$. This estimator might not be finite-sample unbiased in general.
(A general tip that doesn't apply here: When it's easy to prove biasedness in nonlinear least squares, it's often through invoking Jensen's Inequality. See this reference.)
|
How do I examine biasedness in nonlinear regression?
In order to be able to talk about whether $\hat{\beta}$ is biased, we need to have some concept of a true $\beta$. That is, we need to specify a data-generating process. So in order to make this probl
|
42,333
|
Ensemble learning with time-varying covariates and effects
|
The most widely used approach for survival analysis of time-varying covariates (TVCs) are Cox models. There you need to create a dataset with TVCs which is described in this vignette
fit.cox <- coxph(Surv(time1, time2, event) ~ x), data = data)
However there is also the possibility to include TVCs in random survival forests. This paper by Wongvibulsin, Wu, and Zeger (2019) extends the randomForestSRC package to handle TVC, but you may need to contact the authors for any relevant code.
|
Ensemble learning with time-varying covariates and effects
|
The most widely used approach for survival analysis of time-varying covariates (TVCs) are Cox models. There you need to create a dataset with TVCs which is described in this vignette
fit.cox <- coxph(
|
Ensemble learning with time-varying covariates and effects
The most widely used approach for survival analysis of time-varying covariates (TVCs) are Cox models. There you need to create a dataset with TVCs which is described in this vignette
fit.cox <- coxph(Surv(time1, time2, event) ~ x), data = data)
However there is also the possibility to include TVCs in random survival forests. This paper by Wongvibulsin, Wu, and Zeger (2019) extends the randomForestSRC package to handle TVC, but you may need to contact the authors for any relevant code.
|
Ensemble learning with time-varying covariates and effects
The most widely used approach for survival analysis of time-varying covariates (TVCs) are Cox models. There you need to create a dataset with TVCs which is described in this vignette
fit.cox <- coxph(
|
42,334
|
Intuitively how does Bayesian Network Structure Learning Work?
|
There is a concept in Bayesian network literature, called I-equivalence. Two Bayesian network structures are called I-equivalence if they encode the same set of conditional independencies. For example, the following three structures are I-equivalence, since they all encode $A$ is independent of $C$ given $B$:
$$A\rightarrow B \rightarrow C$$
$$A\leftarrow B \leftarrow C$$
$$A\leftarrow B\rightarrow C$$
But the following structure does not belong to the I-equivalence class of the above three structures:
$$A\rightarrow B \leftarrow C$$
This is because of the v-structure or the head-to-head node $B$. In the above structure, $A$ is NOT independent of $C$ given $B$. There is a very useful theorem for checking the I-equivalency of two structures:
Two Bayesian network structures are I-equivalence if and only if they have the same set of immoralities and the same skeleton. Immoralities are head-to-head nodes without any edge between the parents. For example, $A\rightarrow B \leftarrow C$ is an immorality but it is not an immorality if there is an edge between $A$ and $C$. The skeleton of a Bayesian network structure is simply its undirected version.
Obviously, the I-equivalence relation is an equivalence relation which partition the space of structures into equivalence classes. In the above examples, $A\rightarrow B \leftarrow C$ belongs to another class than the class of other three structures. In your example, $Age \rightarrow Edu$ and $Age \leftarrow Edu$ belong to the same equivalence class.
No Bayesian network structure learning algorithm can choose a structure from the equivalence class based on data alone. In other words, the structures in an equivalence class cannot be distinguished based on data alone. Therefore, a Bayesian network structure learning cannot favor $Age \rightarrow Edu$ over $Age \leftarrow Edu$ or vice versa based on the data alone.
Note that this does not mean that the structure learning algorithms cannot find any direction in the graph. For example, if according to the data it finds out that the skeleton of the graph is $A-B-C$ and also $A$ is not independent of $C$ given $B$, it will conclude that there should be a v-structure, that is the correct structure is $A\rightarrow B \leftarrow C$.
Although it is not possible to choose a structure in an equivalence class based on data alone, as Diego mentioned we can exploit other knowledge than data to find the direction of undirected edges. For example, in our recent work [1], we tried to use the experts' knowledge to find more accurate Bayesian network structures.
Hope this short summary answers your question. For more information, I encourage you to read chapter 3 of the excellent book by Koller and Friedman [2].
[1] Amirkhani, Hossein, et al. "Exploiting Experts' Knowledge for Structure Learning of Bayesian Networks." IEEE Transactions on Pattern Analysis and Machine Intelligence (2016).
[2] Koller, Daphne, and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009.
|
Intuitively how does Bayesian Network Structure Learning Work?
|
There is a concept in Bayesian network literature, called I-equivalence. Two Bayesian network structures are called I-equivalence if they encode the same set of conditional independencies. For example
|
Intuitively how does Bayesian Network Structure Learning Work?
There is a concept in Bayesian network literature, called I-equivalence. Two Bayesian network structures are called I-equivalence if they encode the same set of conditional independencies. For example, the following three structures are I-equivalence, since they all encode $A$ is independent of $C$ given $B$:
$$A\rightarrow B \rightarrow C$$
$$A\leftarrow B \leftarrow C$$
$$A\leftarrow B\rightarrow C$$
But the following structure does not belong to the I-equivalence class of the above three structures:
$$A\rightarrow B \leftarrow C$$
This is because of the v-structure or the head-to-head node $B$. In the above structure, $A$ is NOT independent of $C$ given $B$. There is a very useful theorem for checking the I-equivalency of two structures:
Two Bayesian network structures are I-equivalence if and only if they have the same set of immoralities and the same skeleton. Immoralities are head-to-head nodes without any edge between the parents. For example, $A\rightarrow B \leftarrow C$ is an immorality but it is not an immorality if there is an edge between $A$ and $C$. The skeleton of a Bayesian network structure is simply its undirected version.
Obviously, the I-equivalence relation is an equivalence relation which partition the space of structures into equivalence classes. In the above examples, $A\rightarrow B \leftarrow C$ belongs to another class than the class of other three structures. In your example, $Age \rightarrow Edu$ and $Age \leftarrow Edu$ belong to the same equivalence class.
No Bayesian network structure learning algorithm can choose a structure from the equivalence class based on data alone. In other words, the structures in an equivalence class cannot be distinguished based on data alone. Therefore, a Bayesian network structure learning cannot favor $Age \rightarrow Edu$ over $Age \leftarrow Edu$ or vice versa based on the data alone.
Note that this does not mean that the structure learning algorithms cannot find any direction in the graph. For example, if according to the data it finds out that the skeleton of the graph is $A-B-C$ and also $A$ is not independent of $C$ given $B$, it will conclude that there should be a v-structure, that is the correct structure is $A\rightarrow B \leftarrow C$.
Although it is not possible to choose a structure in an equivalence class based on data alone, as Diego mentioned we can exploit other knowledge than data to find the direction of undirected edges. For example, in our recent work [1], we tried to use the experts' knowledge to find more accurate Bayesian network structures.
Hope this short summary answers your question. For more information, I encourage you to read chapter 3 of the excellent book by Koller and Friedman [2].
[1] Amirkhani, Hossein, et al. "Exploiting Experts' Knowledge for Structure Learning of Bayesian Networks." IEEE Transactions on Pattern Analysis and Machine Intelligence (2016).
[2] Koller, Daphne, and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009.
|
Intuitively how does Bayesian Network Structure Learning Work?
There is a concept in Bayesian network literature, called I-equivalence. Two Bayesian network structures are called I-equivalence if they encode the same set of conditional independencies. For example
|
42,335
|
Intuitively how does Bayesian Network Structure Learning Work?
|
You're right Bayesian Networks don't hold any information about real causality, it just assumes one random variable directly influences another random variable , and the joint distribution of those variables tells us the second variable also directly influences the first one. They are just two Mathematical points of view, which gives the same result.
However, in some situations (and we can force those situations to happen) we have something more than just the Joint Distribution, we have the Do-Calculus formulated by Judea Pearl that gives us information about how the variables (or the network) behavior under external intervention. The main concept can be captured when you try to answer:
P(X | do(Y=y)) = ?
Where do(Y=y) is the action of externally forcing Y to be y ignoring that Y depends only on its parents. That gives us more information about the REAL CAUSAL structure of the Bayesian Network. When you have what is sometimes called by Interventional Data, which is data generated under external intervention , the do(Y=y) statement ignored all Y possible parents in the network (which is extra information about the structure), then you can infere the real causal structure more accurately.
In your example, in your case you could get data assuming, for example, that in a subset of the whole data, the variable Education was forced to the value lets say educated (because we took the action to educate those people), then if inside that part we still have "correlation" between the variables Educated and Age you know the arrow should likely be Education -> Age , because Education was forced not to have any parents, including Age.
|
Intuitively how does Bayesian Network Structure Learning Work?
|
You're right Bayesian Networks don't hold any information about real causality, it just assumes one random variable directly influences another random variable , and the joint distribution of those va
|
Intuitively how does Bayesian Network Structure Learning Work?
You're right Bayesian Networks don't hold any information about real causality, it just assumes one random variable directly influences another random variable , and the joint distribution of those variables tells us the second variable also directly influences the first one. They are just two Mathematical points of view, which gives the same result.
However, in some situations (and we can force those situations to happen) we have something more than just the Joint Distribution, we have the Do-Calculus formulated by Judea Pearl that gives us information about how the variables (or the network) behavior under external intervention. The main concept can be captured when you try to answer:
P(X | do(Y=y)) = ?
Where do(Y=y) is the action of externally forcing Y to be y ignoring that Y depends only on its parents. That gives us more information about the REAL CAUSAL structure of the Bayesian Network. When you have what is sometimes called by Interventional Data, which is data generated under external intervention , the do(Y=y) statement ignored all Y possible parents in the network (which is extra information about the structure), then you can infere the real causal structure more accurately.
In your example, in your case you could get data assuming, for example, that in a subset of the whole data, the variable Education was forced to the value lets say educated (because we took the action to educate those people), then if inside that part we still have "correlation" between the variables Educated and Age you know the arrow should likely be Education -> Age , because Education was forced not to have any parents, including Age.
|
Intuitively how does Bayesian Network Structure Learning Work?
You're right Bayesian Networks don't hold any information about real causality, it just assumes one random variable directly influences another random variable , and the joint distribution of those va
|
42,336
|
How to say if the variable is significant looking only at "t value"?
|
Beforehand: The t distribution changes its shape depending on the degrees of freedom (df). Since in regression $df= n - p - 1$ where $n$ is the sample size and $p$ the number of the predictors, we know that $df$ increases if $n$ does (assuming $p$ stays the same). The important thing here is that the bigger the df the more the t distributions approximates a standard normal distribution. Here is an example from wikipedia that shows how the t distribution changes with increasing df:
Here the Density of the t-distribution is red (for 1, 2, 3, 5, 10, and 30 df) compared to the standard normal distribution which is blue. Further, the previous plots shown in green. Thus "You are pretty safe (unless you are interested in the extreme tails) in ignoring the difference between the standard normal and the t-distribution when the degrees of freedom are even moderately large" (source for quote).
We know that in case of a standard normal distribution z< -1.96 and z> 1.96 mark the cutoff for statistical significance if α is set at .05 (see here to learn about the Z-test). So if your sample size is big enough you can say that a t value is significant if the absolute t value is higher or equal to 1.96, meaning $|t| ≥ 1.96$. Or if you decide to set α at .01 you would need $|t| ≥ 2.58$.
The obvious question is what in this context "large enough" means. I would say it simply depends on how exact you want this rule of thumb to be. But in your case with $n= 428$ this should be a reasonable rule of thumb.
|
How to say if the variable is significant looking only at "t value"?
|
Beforehand: The t distribution changes its shape depending on the degrees of freedom (df). Since in regression $df= n - p - 1$ where $n$ is the sample size and $p$ the number of the predictors, we kno
|
How to say if the variable is significant looking only at "t value"?
Beforehand: The t distribution changes its shape depending on the degrees of freedom (df). Since in regression $df= n - p - 1$ where $n$ is the sample size and $p$ the number of the predictors, we know that $df$ increases if $n$ does (assuming $p$ stays the same). The important thing here is that the bigger the df the more the t distributions approximates a standard normal distribution. Here is an example from wikipedia that shows how the t distribution changes with increasing df:
Here the Density of the t-distribution is red (for 1, 2, 3, 5, 10, and 30 df) compared to the standard normal distribution which is blue. Further, the previous plots shown in green. Thus "You are pretty safe (unless you are interested in the extreme tails) in ignoring the difference between the standard normal and the t-distribution when the degrees of freedom are even moderately large" (source for quote).
We know that in case of a standard normal distribution z< -1.96 and z> 1.96 mark the cutoff for statistical significance if α is set at .05 (see here to learn about the Z-test). So if your sample size is big enough you can say that a t value is significant if the absolute t value is higher or equal to 1.96, meaning $|t| ≥ 1.96$. Or if you decide to set α at .01 you would need $|t| ≥ 2.58$.
The obvious question is what in this context "large enough" means. I would say it simply depends on how exact you want this rule of thumb to be. But in your case with $n= 428$ this should be a reasonable rule of thumb.
|
How to say if the variable is significant looking only at "t value"?
Beforehand: The t distribution changes its shape depending on the degrees of freedom (df). Since in regression $df= n - p - 1$ where $n$ is the sample size and $p$ the number of the predictors, we kno
|
42,337
|
How to say if the variable is significant looking only at "t value"?
|
When dealing with significance testing, you are deciding between two hypotheses
$H_0:\beta=0$
$H_1:\beta\neq0$
A beta coefficient is significant if you are able to reject the null hypothesis for a specified level of significance $\alpha$, that is usually chosen to be $0.05$.
If you use the p-value, you reject the null hypothesis when the p-value is lower than the level of significance $\alpha$. If you use the t-stat, instead, you reject the null hypothesis if the value of the t-stat is greater than the value, which corresponds to the level of significance $\alpha$ on the Normal distribution table. As an example if your level of significance is $0.05$, the correspondent t-stat value is $1.96$, thus when the t-stat reported in the output is higher than $1.96$ you reject the null hypothesis and your coefficient is significant at $5\%$ significance level.
Since, the t-stat is computed as $\beta/s.e.$, if your $\beta$ value is negative, the t-stat will be negative but the comparison has to be made in absolute value, thus in your case $-6.53$ is higher than $1.96$ in absolute value, but it is also higher than $2.58$, the critical value for a $0.01$ ($1\%$) significance level.
|
How to say if the variable is significant looking only at "t value"?
|
When dealing with significance testing, you are deciding between two hypotheses
$H_0:\beta=0$
$H_1:\beta\neq0$
A beta coefficient is significant if you are able to reject the null hypothesis for a
|
How to say if the variable is significant looking only at "t value"?
When dealing with significance testing, you are deciding between two hypotheses
$H_0:\beta=0$
$H_1:\beta\neq0$
A beta coefficient is significant if you are able to reject the null hypothesis for a specified level of significance $\alpha$, that is usually chosen to be $0.05$.
If you use the p-value, you reject the null hypothesis when the p-value is lower than the level of significance $\alpha$. If you use the t-stat, instead, you reject the null hypothesis if the value of the t-stat is greater than the value, which corresponds to the level of significance $\alpha$ on the Normal distribution table. As an example if your level of significance is $0.05$, the correspondent t-stat value is $1.96$, thus when the t-stat reported in the output is higher than $1.96$ you reject the null hypothesis and your coefficient is significant at $5\%$ significance level.
Since, the t-stat is computed as $\beta/s.e.$, if your $\beta$ value is negative, the t-stat will be negative but the comparison has to be made in absolute value, thus in your case $-6.53$ is higher than $1.96$ in absolute value, but it is also higher than $2.58$, the critical value for a $0.01$ ($1\%$) significance level.
|
How to say if the variable is significant looking only at "t value"?
When dealing with significance testing, you are deciding between two hypotheses
$H_0:\beta=0$
$H_1:\beta\neq0$
A beta coefficient is significant if you are able to reject the null hypothesis for a
|
42,338
|
How to find the prior distribution in De Finetti Representation Theorem?
|
De Finetti's theorem proves the existence of a prior distribution $H(\theta)$ such that $$
\int^1_0\theta\,^k(1-\theta)^{n-k}dH(\theta)=\frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\frac{\Gamma(r+k)\Gamma(w+n-k)}{\Gamma(r+w+n)}
$$ Looking more closely at the proof of this theorem, it seems that the prior distribution is obtained as the solution to a Hausdorff moment problem (see these notes), so the distribution is uniquely determined by its moments. So, if we can find a named distribution whose moments match those required for $H(\theta)$ then we have found $H(\theta)$.
Following the example at the end of the referenced notes, we can write $$\frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\frac{\Gamma(r+k)\Gamma(w+n-k)}{\Gamma(r+w+n)}=\int_0^1 \frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\theta^{r+k-1}(1-\theta)^{w+n-k-1} d\theta $$ From this we now see that the $Beta(r,w)$ distribution has the same moments as $H$, and hence $H$ must be the $Beta(r,w)$ distribution.
|
How to find the prior distribution in De Finetti Representation Theorem?
|
De Finetti's theorem proves the existence of a prior distribution $H(\theta)$ such that $$
\int^1_0\theta\,^k(1-\theta)^{n-k}dH(\theta)=\frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\frac{\Gamma(r+k)\Gamma(w+
|
How to find the prior distribution in De Finetti Representation Theorem?
De Finetti's theorem proves the existence of a prior distribution $H(\theta)$ such that $$
\int^1_0\theta\,^k(1-\theta)^{n-k}dH(\theta)=\frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\frac{\Gamma(r+k)\Gamma(w+n-k)}{\Gamma(r+w+n)}
$$ Looking more closely at the proof of this theorem, it seems that the prior distribution is obtained as the solution to a Hausdorff moment problem (see these notes), so the distribution is uniquely determined by its moments. So, if we can find a named distribution whose moments match those required for $H(\theta)$ then we have found $H(\theta)$.
Following the example at the end of the referenced notes, we can write $$\frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\frac{\Gamma(r+k)\Gamma(w+n-k)}{\Gamma(r+w+n)}=\int_0^1 \frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\theta^{r+k-1}(1-\theta)^{w+n-k-1} d\theta $$ From this we now see that the $Beta(r,w)$ distribution has the same moments as $H$, and hence $H$ must be the $Beta(r,w)$ distribution.
|
How to find the prior distribution in De Finetti Representation Theorem?
De Finetti's theorem proves the existence of a prior distribution $H(\theta)$ such that $$
\int^1_0\theta\,^k(1-\theta)^{n-k}dH(\theta)=\frac{\Gamma(r+w)}{\Gamma(r)\Gamma(w)}\frac{\Gamma(r+k)\Gamma(w+
|
42,339
|
Optimization by random sampling
|
It sound like you are interested in studying stochastic optimisation methods. If you re-frame optimisation as a type of sampling problem, you will obtain a stochastic optimisation method, and this latter method will only be advantageous if it provides some improvement over analogous deterministic optimisation methods.
Generally speaking, stochastic optimisation methods of this kind will involve the generation of random values in a way that depends on the function being optimised, and so it is likely to be at least as computationally intensive (and probably more computationally intensive) than corresponding deterministic methods. Stochastic methods are also generally more complicated to understand. Thus, the only advantage that is likely to accrue to (well-constructed) stochastic optimisation methods, is that they generally retain some non-zero probability of "searching" areas of the domain that might be missed by deterministic methods, and so they are arguably more robust, if you are willing to run them for a long time.
Most standard deterministic optimisation methods involve taking iterative steps towards the optima by choosing a deterministic movement direction, and moving in that direction by some deterministic amount (e.g., with steepest ascent we move in the direction of the gradient vector). The direction and length of the steps are usually determined by looking at the gradient of the function, which in practice, is computed by looking at the slope over a small movement increment. By turning the optimisation into a sampling problem, you effectively just move in a random direction by a random amount, but you are still going to want to use information on the slope of the function to determine the stochastic behaviour of this movement. It is likely that the latter method will use the same information as the former, only in a more complex (and thus, more computationally intensive) way. Below I will construct a method using the MH algorithm, based on your description.
Implementation with Metropolis-Hastings algorithm: Suppose you are dealing with a maximisation problem with a distribution over one-dimension, and consider the method of Metropolis-Hasting sampling using Gaussian deviations. This is a well-known method of sampling that is quite robust against nasty behaviour by the sampling density.
To implement the algorithm, we generate a sequence $\varepsilon_1, \varepsilon_2, \varepsilon_3, ... \sim \text{IID N}(0, 1)$ of random deviations, which we will later multiply by the "bandwidth" parameter $\lambda > 0$ (so this parameter represents the standard deviation of our proposed steps). We also generate a sequence $U_1,U_2,U_3 ,... \sim \text{U}(0,1)$ of uniform random variables. We choose a starting value $x_0$ arbitrarily and generate the sequence of sample values recursively as:
$$x_{t+1} = \begin{cases}
x_t + \lambda \varepsilon_{t+1} & & \text{if } U_{t+1} \leqslant \exp \Big( k \big( f(x_t + \lambda \varepsilon_{t+1}) - f(x_t) \big) \Big), \\[6pt]
x_t & & \text{otherwise}. \\[6pt]
\end{cases}$$
The MH algorithm has the stationary distribution equal to the target density, so we have the approximate distribution $X_n \sim \exp( k (f(x))$ for large $n$. Taking a large value for $k$ (relative to the bandwidth parameter) will mean that deviations in the direction of the optima will be accepted with high probability, and deviations away from the optima (or overshooting the optima) will be rejected with high probability. Thus, in practice, the sample values should converge near to the maximising point of the density $f$. (There would still be cases where this would not occur; e.g., if the density is bimodal, and the algorithm climbs the wrong slope.) If we take a large value of $k$ then the distribution $\exp( k (f(x))$ is highly concentrated near the maximising value, so in this case the sample mean of the sampled values (discarding some burn-in values) should give us a good estimate of the maximising value in the optimisation.
Now, suppose we counteract the large value of $k$ by setting the bandwidth $\lambda$ to be small. In that case, we get small values for the deviations, so we have the approximate acceptance probabilities:
$$\exp \Big( k \big( f(x_t + \lambda \varepsilon_{t+1}) - f(x_t) \big) \Big) \approx \exp \Big( k \lambda \cdot \varepsilon_{t+1} \cdot f'(x_t) \Big).$$
We can see that in this case, the acceptance probability is determined by the derivative of the density, the magnitude and direction of the deviation $\varepsilon_{t+1}$ and the value $k \lambda$.
So, does this algorithm actually perform any better than applicable deterministic optimisation algorithms? Well, we can see that the algorithm requires us to compute the density at each potential step, and if the bandwidth parameter is small then this is tantamount to computing the derivative of the function. So this is quite similar to a form of stochastic gradient ascent, with more computational work than the corresponding deterministic method. The advantage, if any, is that the proposed deviations are random, and all occur with some non-zero probability (albeit vanishing very quickly), so the algorithm has the potential to "escape" regions of high, but non-maximising, density.
|
Optimization by random sampling
|
It sound like you are interested in studying stochastic optimisation methods. If you re-frame optimisation as a type of sampling problem, you will obtain a stochastic optimisation method, and this la
|
Optimization by random sampling
It sound like you are interested in studying stochastic optimisation methods. If you re-frame optimisation as a type of sampling problem, you will obtain a stochastic optimisation method, and this latter method will only be advantageous if it provides some improvement over analogous deterministic optimisation methods.
Generally speaking, stochastic optimisation methods of this kind will involve the generation of random values in a way that depends on the function being optimised, and so it is likely to be at least as computationally intensive (and probably more computationally intensive) than corresponding deterministic methods. Stochastic methods are also generally more complicated to understand. Thus, the only advantage that is likely to accrue to (well-constructed) stochastic optimisation methods, is that they generally retain some non-zero probability of "searching" areas of the domain that might be missed by deterministic methods, and so they are arguably more robust, if you are willing to run them for a long time.
Most standard deterministic optimisation methods involve taking iterative steps towards the optima by choosing a deterministic movement direction, and moving in that direction by some deterministic amount (e.g., with steepest ascent we move in the direction of the gradient vector). The direction and length of the steps are usually determined by looking at the gradient of the function, which in practice, is computed by looking at the slope over a small movement increment. By turning the optimisation into a sampling problem, you effectively just move in a random direction by a random amount, but you are still going to want to use information on the slope of the function to determine the stochastic behaviour of this movement. It is likely that the latter method will use the same information as the former, only in a more complex (and thus, more computationally intensive) way. Below I will construct a method using the MH algorithm, based on your description.
Implementation with Metropolis-Hastings algorithm: Suppose you are dealing with a maximisation problem with a distribution over one-dimension, and consider the method of Metropolis-Hasting sampling using Gaussian deviations. This is a well-known method of sampling that is quite robust against nasty behaviour by the sampling density.
To implement the algorithm, we generate a sequence $\varepsilon_1, \varepsilon_2, \varepsilon_3, ... \sim \text{IID N}(0, 1)$ of random deviations, which we will later multiply by the "bandwidth" parameter $\lambda > 0$ (so this parameter represents the standard deviation of our proposed steps). We also generate a sequence $U_1,U_2,U_3 ,... \sim \text{U}(0,1)$ of uniform random variables. We choose a starting value $x_0$ arbitrarily and generate the sequence of sample values recursively as:
$$x_{t+1} = \begin{cases}
x_t + \lambda \varepsilon_{t+1} & & \text{if } U_{t+1} \leqslant \exp \Big( k \big( f(x_t + \lambda \varepsilon_{t+1}) - f(x_t) \big) \Big), \\[6pt]
x_t & & \text{otherwise}. \\[6pt]
\end{cases}$$
The MH algorithm has the stationary distribution equal to the target density, so we have the approximate distribution $X_n \sim \exp( k (f(x))$ for large $n$. Taking a large value for $k$ (relative to the bandwidth parameter) will mean that deviations in the direction of the optima will be accepted with high probability, and deviations away from the optima (or overshooting the optima) will be rejected with high probability. Thus, in practice, the sample values should converge near to the maximising point of the density $f$. (There would still be cases where this would not occur; e.g., if the density is bimodal, and the algorithm climbs the wrong slope.) If we take a large value of $k$ then the distribution $\exp( k (f(x))$ is highly concentrated near the maximising value, so in this case the sample mean of the sampled values (discarding some burn-in values) should give us a good estimate of the maximising value in the optimisation.
Now, suppose we counteract the large value of $k$ by setting the bandwidth $\lambda$ to be small. In that case, we get small values for the deviations, so we have the approximate acceptance probabilities:
$$\exp \Big( k \big( f(x_t + \lambda \varepsilon_{t+1}) - f(x_t) \big) \Big) \approx \exp \Big( k \lambda \cdot \varepsilon_{t+1} \cdot f'(x_t) \Big).$$
We can see that in this case, the acceptance probability is determined by the derivative of the density, the magnitude and direction of the deviation $\varepsilon_{t+1}$ and the value $k \lambda$.
So, does this algorithm actually perform any better than applicable deterministic optimisation algorithms? Well, we can see that the algorithm requires us to compute the density at each potential step, and if the bandwidth parameter is small then this is tantamount to computing the derivative of the function. So this is quite similar to a form of stochastic gradient ascent, with more computational work than the corresponding deterministic method. The advantage, if any, is that the proposed deviations are random, and all occur with some non-zero probability (albeit vanishing very quickly), so the algorithm has the potential to "escape" regions of high, but non-maximising, density.
|
Optimization by random sampling
It sound like you are interested in studying stochastic optimisation methods. If you re-frame optimisation as a type of sampling problem, you will obtain a stochastic optimisation method, and this la
|
42,340
|
How to read the x-axis of this qqplot?
|
This seems to be a qqplot of the data compared with a standard normal distribution, so I would have thought the $x$ values should the typical values of the population quantiles of a standard normal distribution
So with $105$ observations I would have thought the extreme left $x$ value should be not far away from $\Phi^{-1}\left(\dfrac{0.5}{105}\right) \approx -2.59$ and the one next to it near $\Phi^{-1}\left(\dfrac{1.5}{105}\right) \approx -2.19$, with the extreme right values being the corresponding $\Phi^{-1}\left(\dfrac{104.5}{105}\right) \approx +2.59$ and $\Phi^{-1}\left(\dfrac{103.5}{105}\right) \approx +2.19$. Visually, this seems to be close to what you have in the charts
|
How to read the x-axis of this qqplot?
|
This seems to be a qqplot of the data compared with a standard normal distribution, so I would have thought the $x$ values should the typical values of the population quantiles of a standard normal di
|
How to read the x-axis of this qqplot?
This seems to be a qqplot of the data compared with a standard normal distribution, so I would have thought the $x$ values should the typical values of the population quantiles of a standard normal distribution
So with $105$ observations I would have thought the extreme left $x$ value should be not far away from $\Phi^{-1}\left(\dfrac{0.5}{105}\right) \approx -2.59$ and the one next to it near $\Phi^{-1}\left(\dfrac{1.5}{105}\right) \approx -2.19$, with the extreme right values being the corresponding $\Phi^{-1}\left(\dfrac{104.5}{105}\right) \approx +2.59$ and $\Phi^{-1}\left(\dfrac{103.5}{105}\right) \approx +2.19$. Visually, this seems to be close to what you have in the charts
|
How to read the x-axis of this qqplot?
This seems to be a qqplot of the data compared with a standard normal distribution, so I would have thought the $x$ values should the typical values of the population quantiles of a standard normal di
|
42,341
|
Plotting Correlation Matrix over time
|
There are a number of issues here (and whether you use ggplot2 strikes me as entirely orthogonal to them). First, recognize that that correlations don't necessarily scale in an intuitive, 'linear' manner (in large part because their possible range is bounded). It's worth thinking about how you want to represent the values. For example, you could use:
the original correlations ($r$-scores)
coefficients of determination ($r^2$'s)
$z$-scores based on the results of Fisher's '$r$ to $z$' transformation:
$$z_r = .5\ln\! \bigg(\frac{1+r}{1-r}\bigg)$$
I don't really know anything about your situation, so it's hard for me to say, but my default would be to use the transformed scores ($z_r$).
Next, you need to decide what about the data you want to include (at all, or more or less prominently). For example, do you want to include the absolute magnitudes of the values, or only their changes (cf., levels vs. changes in economics)? Do you primarily care about the magnitudes of the changes (i.e., absolute values), whether they are increases or decreases (the signs, either in an absolute sense, or towards or away from no correlation), or both?
Given that you want to visualize a correlation matrix (i.e., a set of correlations), it is worth remembering that they won't be independent. Consider that a change in only one variable will have an effect on multiple correlations, even if the other variables are constant over time. So again, it depends on whether that matters for you.
In other words, figuring out exactly what you really care about is vital. There won't be a visualization that will capture all of these facets.
From your comment, I gather you will have just two correlation matrices, before and after. That simplifies things. Again, without any information about your situation, data, or goals, I would probably make a scatterplot with before and after on the X-axis, and $z_r$ on the Y-axis, and the two points representing the same correlation joined by a line segment. Consider this example, coded in R:
library(MASS) # we'll use these packages
library(psych)
set.seed(541) # this makes the example exactly reproducible
bef = mvrnorm(100, mu=rep(0, 5), Sigma=rbind(c(1.0, 0.0, 0.0, 0.0, 0.0),
c(0.0, 1.0, 0.4, 0.0, 0.5),
c(0.0, 0.4, 1.0, 0.1, 0.0),
c(0.0, 0.0, 0.1, 1.0, 0.8),
c(0.0, 0.5, 0.0, 0.8, 1.0) ))
aft = mvrnorm(100, mu=rep(0, 5), Sigma=rbind(c(1.0, 0.0, 0.0, 0.0, 0.0),
c(0.0, 1.0, 0.4, 0.0, 0.5),
c(0.0, 0.4, 1.0, 0.1, 0.0),
c(0.0, 0.0, 0.1, 1.0, 0.8),
c(0.0, 0.5, 0.0, 0.8, 1.0) ))
aft[,5] = rnorm(100) # above I generate data 2x from the same population,
b.c = cor(bef) # here I change just 1 variable
a.c = cor(aft) # then I make cor matrices, & extract the rs into a vector
b.v = b.c[upper.tri(b.c)]
a.v = a.c[upper.tri(a.c)]
d = stack(list(bef=b.v, aft=a.v))
d$ind = relevel(d$ind, ref="bef")
windows(width=7, height=4)
layout(matrix(1:2, nrow=1))
plot(as.numeric(d$ind), fisherz(d$values), main="Fisher's z",
axes=F, xlab="time", ylab=expression(z [r]), xlim=c(.5,2.5))
box()
axis(side=1, at=1:2, labels=c("before","after"))
axis(side=2, at=seq(-.2,1.5, by=.2), cex.axis=.8, las=1)
for(i in 1:10){ lines(1:2, matrix(fisherz(d$values), nrow=10, ncol=2)[i,]) }
plot(as.numeric(d$ind), d$values, main="Raw rs",
axes=F, xlab="time", ylab="r", xlim=c(.5,2.5))
box()
axis(side=1, at=1:2, labels=c("before","after"))
axis(side=2, at=seq(-.2,1.0, by=.2), cex.axis=.8, las=1)
for(i in 1:10){ lines(1:2, matrix(d$values, nrow=10, ncol=2)[i,]) }; rm(i)
fdif = abs(fisherz(a.c)-fisherz(b.c))
diag(fdif) = 0
windows()
image(1:5, 1:5, z=fdif,
xlab="", ylab="", col=gray.colors(8)[8:3])
for(i in 1:5){ for(j in 1:5){ text(i,j,round(fdif,2)[i,j]) }}
The figures above display both the levels of the correlations and the amount of change. You can see various features, such as a convergence towards $r=0$. The difference between using $z_r$ and $r$ is that the $r$-scores are more uniformly distributed beforehand. The distance between $0$ and $.4$ is the same as the distance between $.4$ and $.8$, for example. On the other hand, for $z_r$, the correlations that are close to $0$ are clumped together and the strong correlation is much further out from the rest. What those figures don't capture is the non-independence of those lines. You can see in the heatmap below (using absolute values of the differences in $z_r$'s) that the larger changes are associated with variable 5.
Update: @whuber has detailed a method to compare covariance matrices based on a new paper (as of 6/2/20) here: Diagnostic plot for assessing homogeneity of variance-covariance matrices
|
Plotting Correlation Matrix over time
|
There are a number of issues here (and whether you use ggplot2 strikes me as entirely orthogonal to them). First, recognize that that correlations don't necessarily scale in an intuitive, 'linear' ma
|
Plotting Correlation Matrix over time
There are a number of issues here (and whether you use ggplot2 strikes me as entirely orthogonal to them). First, recognize that that correlations don't necessarily scale in an intuitive, 'linear' manner (in large part because their possible range is bounded). It's worth thinking about how you want to represent the values. For example, you could use:
the original correlations ($r$-scores)
coefficients of determination ($r^2$'s)
$z$-scores based on the results of Fisher's '$r$ to $z$' transformation:
$$z_r = .5\ln\! \bigg(\frac{1+r}{1-r}\bigg)$$
I don't really know anything about your situation, so it's hard for me to say, but my default would be to use the transformed scores ($z_r$).
Next, you need to decide what about the data you want to include (at all, or more or less prominently). For example, do you want to include the absolute magnitudes of the values, or only their changes (cf., levels vs. changes in economics)? Do you primarily care about the magnitudes of the changes (i.e., absolute values), whether they are increases or decreases (the signs, either in an absolute sense, or towards or away from no correlation), or both?
Given that you want to visualize a correlation matrix (i.e., a set of correlations), it is worth remembering that they won't be independent. Consider that a change in only one variable will have an effect on multiple correlations, even if the other variables are constant over time. So again, it depends on whether that matters for you.
In other words, figuring out exactly what you really care about is vital. There won't be a visualization that will capture all of these facets.
From your comment, I gather you will have just two correlation matrices, before and after. That simplifies things. Again, without any information about your situation, data, or goals, I would probably make a scatterplot with before and after on the X-axis, and $z_r$ on the Y-axis, and the two points representing the same correlation joined by a line segment. Consider this example, coded in R:
library(MASS) # we'll use these packages
library(psych)
set.seed(541) # this makes the example exactly reproducible
bef = mvrnorm(100, mu=rep(0, 5), Sigma=rbind(c(1.0, 0.0, 0.0, 0.0, 0.0),
c(0.0, 1.0, 0.4, 0.0, 0.5),
c(0.0, 0.4, 1.0, 0.1, 0.0),
c(0.0, 0.0, 0.1, 1.0, 0.8),
c(0.0, 0.5, 0.0, 0.8, 1.0) ))
aft = mvrnorm(100, mu=rep(0, 5), Sigma=rbind(c(1.0, 0.0, 0.0, 0.0, 0.0),
c(0.0, 1.0, 0.4, 0.0, 0.5),
c(0.0, 0.4, 1.0, 0.1, 0.0),
c(0.0, 0.0, 0.1, 1.0, 0.8),
c(0.0, 0.5, 0.0, 0.8, 1.0) ))
aft[,5] = rnorm(100) # above I generate data 2x from the same population,
b.c = cor(bef) # here I change just 1 variable
a.c = cor(aft) # then I make cor matrices, & extract the rs into a vector
b.v = b.c[upper.tri(b.c)]
a.v = a.c[upper.tri(a.c)]
d = stack(list(bef=b.v, aft=a.v))
d$ind = relevel(d$ind, ref="bef")
windows(width=7, height=4)
layout(matrix(1:2, nrow=1))
plot(as.numeric(d$ind), fisherz(d$values), main="Fisher's z",
axes=F, xlab="time", ylab=expression(z [r]), xlim=c(.5,2.5))
box()
axis(side=1, at=1:2, labels=c("before","after"))
axis(side=2, at=seq(-.2,1.5, by=.2), cex.axis=.8, las=1)
for(i in 1:10){ lines(1:2, matrix(fisherz(d$values), nrow=10, ncol=2)[i,]) }
plot(as.numeric(d$ind), d$values, main="Raw rs",
axes=F, xlab="time", ylab="r", xlim=c(.5,2.5))
box()
axis(side=1, at=1:2, labels=c("before","after"))
axis(side=2, at=seq(-.2,1.0, by=.2), cex.axis=.8, las=1)
for(i in 1:10){ lines(1:2, matrix(d$values, nrow=10, ncol=2)[i,]) }; rm(i)
fdif = abs(fisherz(a.c)-fisherz(b.c))
diag(fdif) = 0
windows()
image(1:5, 1:5, z=fdif,
xlab="", ylab="", col=gray.colors(8)[8:3])
for(i in 1:5){ for(j in 1:5){ text(i,j,round(fdif,2)[i,j]) }}
The figures above display both the levels of the correlations and the amount of change. You can see various features, such as a convergence towards $r=0$. The difference between using $z_r$ and $r$ is that the $r$-scores are more uniformly distributed beforehand. The distance between $0$ and $.4$ is the same as the distance between $.4$ and $.8$, for example. On the other hand, for $z_r$, the correlations that are close to $0$ are clumped together and the strong correlation is much further out from the rest. What those figures don't capture is the non-independence of those lines. You can see in the heatmap below (using absolute values of the differences in $z_r$'s) that the larger changes are associated with variable 5.
Update: @whuber has detailed a method to compare covariance matrices based on a new paper (as of 6/2/20) here: Diagnostic plot for assessing homogeneity of variance-covariance matrices
|
Plotting Correlation Matrix over time
There are a number of issues here (and whether you use ggplot2 strikes me as entirely orthogonal to them). First, recognize that that correlations don't necessarily scale in an intuitive, 'linear' ma
|
42,342
|
Plotting Correlation Matrix over time
|
In my opinion it is better to quantify the effect of changes in parameters ( a proxy for local correlations ) rather than attempt a visual as attempts at visual comparisons can be quite subjective Your question is similar to "How do I test if the parameters of my model change over time" . What I have done is to program the Chow test to determine at what point in time do the parameters have the greatest divergence. Finding this leads to a direct test of significance possibly yielding the conclusion that "earlier data" should be set aside.
|
Plotting Correlation Matrix over time
|
In my opinion it is better to quantify the effect of changes in parameters ( a proxy for local correlations ) rather than attempt a visual as attempts at visual comparisons can be quite subjective You
|
Plotting Correlation Matrix over time
In my opinion it is better to quantify the effect of changes in parameters ( a proxy for local correlations ) rather than attempt a visual as attempts at visual comparisons can be quite subjective Your question is similar to "How do I test if the parameters of my model change over time" . What I have done is to program the Chow test to determine at what point in time do the parameters have the greatest divergence. Finding this leads to a direct test of significance possibly yielding the conclusion that "earlier data" should be set aside.
|
Plotting Correlation Matrix over time
In my opinion it is better to quantify the effect of changes in parameters ( a proxy for local correlations ) rather than attempt a visual as attempts at visual comparisons can be quite subjective You
|
42,343
|
What is the R rnbinom negative binomial dispersion parameter?
|
The documentation calls it "size":
size target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.
That is the simplest way to understand it. The negative binomial distribution is typically understood as:
a discrete probability distribution of the number of successes in a sequence of independent and identically distributed Bernoulli trials before a specified (non-random) number of failures (denoted r) occurs.
In other words, when performing a series of coin flips, you could count how many tails you got before you got $r$ heads, with a coin that has a $p$ probability of heads.
|
What is the R rnbinom negative binomial dispersion parameter?
|
The documentation calls it "size":
size target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not
|
What is the R rnbinom negative binomial dispersion parameter?
The documentation calls it "size":
size target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.
That is the simplest way to understand it. The negative binomial distribution is typically understood as:
a discrete probability distribution of the number of successes in a sequence of independent and identically distributed Bernoulli trials before a specified (non-random) number of failures (denoted r) occurs.
In other words, when performing a series of coin flips, you could count how many tails you got before you got $r$ heads, with a coin that has a $p$ probability of heads.
|
What is the R rnbinom negative binomial dispersion parameter?
The documentation calls it "size":
size target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not
|
42,344
|
What is the R rnbinom negative binomial dispersion parameter?
|
I have recently just had trouble with this question, and as I found no concrete answer on the edit of the original post I will share my findings.
The glm.nb function estimates a dispersion parameter, labelled $\theta$. This is often called the size parameter and notated by $r$, as shown in the Negative Binomial Wikipedia article.
The rnbinom function (with documentation) takes prob and size as parameters, or alternatively mu and size, where mu is calculated by prob = size/(size+mu).
Therefore the post is correct in its assumption that you want:
x <- rnbinom(nrow(dt), size=5.855, mu=1/exp(-3.689))
|
What is the R rnbinom negative binomial dispersion parameter?
|
I have recently just had trouble with this question, and as I found no concrete answer on the edit of the original post I will share my findings.
The glm.nb function estimates a dispersion parameter,
|
What is the R rnbinom negative binomial dispersion parameter?
I have recently just had trouble with this question, and as I found no concrete answer on the edit of the original post I will share my findings.
The glm.nb function estimates a dispersion parameter, labelled $\theta$. This is often called the size parameter and notated by $r$, as shown in the Negative Binomial Wikipedia article.
The rnbinom function (with documentation) takes prob and size as parameters, or alternatively mu and size, where mu is calculated by prob = size/(size+mu).
Therefore the post is correct in its assumption that you want:
x <- rnbinom(nrow(dt), size=5.855, mu=1/exp(-3.689))
|
What is the R rnbinom negative binomial dispersion parameter?
I have recently just had trouble with this question, and as I found no concrete answer on the edit of the original post I will share my findings.
The glm.nb function estimates a dispersion parameter,
|
42,345
|
Information geometry tutorial
|
You can give a try to:
Information Geometry and Its Applications: An Overview
Pattern learning and recognition on statistical manifolds: An information-geometric review
|
Information geometry tutorial
|
You can give a try to:
Information Geometry and Its Applications: An Overview
Pattern learning and recognition on statistical manifolds: An information-geometric review
|
Information geometry tutorial
You can give a try to:
Information Geometry and Its Applications: An Overview
Pattern learning and recognition on statistical manifolds: An information-geometric review
|
Information geometry tutorial
You can give a try to:
Information Geometry and Its Applications: An Overview
Pattern learning and recognition on statistical manifolds: An information-geometric review
|
42,346
|
R glmnet and elasticnet gives different results, why?
|
x=model.matrix(Apps~.,College)[,-1]
y=College$Apps
enet.model=enet(x, y, lambda=1)
mx_x <- data.frame(coef_enet = round(predict(enet.model, type="coef", s=2, mode="penalty", naive = F)$coefficients, 2))
mx_x$coef_enet.naive <- round(predict(enet.model, type="coef", s=2, mode="penalty", naive = T)$coefficients, 2)
glmnet.model=glmnet(x, y, alpha=0.50)
mx_x$coef_glmnet <- round(coef(glmnet.model, s=2, exact=TRUE), 2)[-1]
mx_x
The script above gives:
coef_enet coef_enet.naive coef_glmnet
PrivateYes -1125.13 -562.56 -493.72
Accept 0.85 0.43 1.57
Enroll 1.44 0.72 -0.80
Top10perc 26.13 13.06 48.90
Top25perc 17.20 8.60 -13.47
F.Undergrad 0.25 0.12 0.05
P.Undergrad 0.21 0.10 0.04
Outstate 0.02 0.01 -0.08
Room.Board 0.31 0.15 0.15
Books 0.70 0.35 0.02
Personal 0.12 0.06 0.03
PhD 11.77 5.88 -8.53
Terminal 10.30 5.15 -3.31
S.F.Ratio 23.87 11.93 14.97
perc.alumni -17.08 -8.54 -0.01
Expend 0.09 0.05 0.08
Grad.Rate 19.05 9.52 8.51
Using naive=FALSE for ElasticNet is just transforming the coefficients of naive=TRUE according to formula:
coef(ENet) = (1 + lambda) * coef(NaiveENet)
The glmnet gives "ready-to-use" coefficients. However they are different from those of ElasticNet. (maybe different algorithms)
You'll get ElasticNet and glmnet "aligned" if you don't normalize the predictors.
enet.model=enet(x, y, lambda=1, normalize = F)
mx_x <- data.frame(coef_enet = round(predict(enet.model, type="coef", s=2, mode="penalty", naive = F)$coefficients, 2))
mx_x$coef_enet.naive <- round(predict(enet.model, type="coef", s=2, mode="penalty", naive = T)$coefficients, 2)
glmnet.model=glmnet(x, y, alpha=0.50, standardize = F)
mx_x$coef_glmnet <- round(coef(glmnet.model, s=2, exact=TRUE), 2)[-1]
mx_x
coef_enet coef_enet.naive coef_glmnet
PrivateYes -971.26 -485.63 -481.73
Accept 3.17 1.59 1.58
Enroll -1.76 -0.88 -0.87
Top10perc 99.84 49.92 49.57
Top25perc -28.47 -14.24 -14.03
F.Undergrad 0.12 0.06 0.06
P.Undergrad 0.09 0.04 0.04
Outstate -0.17 -0.09 -0.09
Room.Board 0.30 0.15 0.15
Books 0.04 0.02 0.02
Personal 0.06 0.03 0.03
PhD -17.29 -8.65 -8.54
Terminal -6.59 -3.30 -3.35
S.F.Ratio 31.04 15.52 15.48
perc.alumni 0.31 0.16 0.09
Expend 0.16 0.08 0.08
Grad.Rate 17.31 8.66 8.63
How predict works?
mx_x2 <- data.frame(pred_enet = predict(enet.model, newx=x, s=2, mode="penalty", naive=F)$fit,
pred_enet.naive = predict(enet.model, newx=x, s=2, mode="penalty", naive=T)$fit,
pred_glmnet = as.vector(predict(glmnet.model, newx=x, s=2, exact=T)))
head(mx_x2)
pred_enet pred_enet.naive pred_glmnet
Abilene Christian University -200.7408 1400.4488 1403.1934
Adelphi University 3757.6684 3379.6534 3376.7797
Adrian College -456.4379 1272.6002 1272.1445
Agnes Scott College 994.5582 1998.0983 1997.6611
Alaska Pacific University -3453.9529 -226.1573 -221.7383
Albertson College -1664.2285 668.7049 668.3047
enet prediction is linear in enet naive prediction (formula):
fit.lm <- lm(pred_enet~pred_enet.naive, data=mx_x2)
coef(fit.lm)
(Intercept) pred_enet.naive
-3001.638 2.000
summary(fit.lm)$r.squared
[1] 1
enet naive is almost identical to glmnet prediction:
fit.lm <- lm(pred_enet.naive~-1+pred_glmnet, data=mx_x2)
coef(fit.lm)
pred_glmnet
1.000126
summary(fit.lm)$r.squared
[1] 0.9999994
|
R glmnet and elasticnet gives different results, why?
|
x=model.matrix(Apps~.,College)[,-1]
y=College$Apps
enet.model=enet(x, y, lambda=1)
mx_x <- data.frame(coef_enet = round(predict(enet.model, type="coef", s=2, mode="penalty", naive = F)$coefficients,
|
R glmnet and elasticnet gives different results, why?
x=model.matrix(Apps~.,College)[,-1]
y=College$Apps
enet.model=enet(x, y, lambda=1)
mx_x <- data.frame(coef_enet = round(predict(enet.model, type="coef", s=2, mode="penalty", naive = F)$coefficients, 2))
mx_x$coef_enet.naive <- round(predict(enet.model, type="coef", s=2, mode="penalty", naive = T)$coefficients, 2)
glmnet.model=glmnet(x, y, alpha=0.50)
mx_x$coef_glmnet <- round(coef(glmnet.model, s=2, exact=TRUE), 2)[-1]
mx_x
The script above gives:
coef_enet coef_enet.naive coef_glmnet
PrivateYes -1125.13 -562.56 -493.72
Accept 0.85 0.43 1.57
Enroll 1.44 0.72 -0.80
Top10perc 26.13 13.06 48.90
Top25perc 17.20 8.60 -13.47
F.Undergrad 0.25 0.12 0.05
P.Undergrad 0.21 0.10 0.04
Outstate 0.02 0.01 -0.08
Room.Board 0.31 0.15 0.15
Books 0.70 0.35 0.02
Personal 0.12 0.06 0.03
PhD 11.77 5.88 -8.53
Terminal 10.30 5.15 -3.31
S.F.Ratio 23.87 11.93 14.97
perc.alumni -17.08 -8.54 -0.01
Expend 0.09 0.05 0.08
Grad.Rate 19.05 9.52 8.51
Using naive=FALSE for ElasticNet is just transforming the coefficients of naive=TRUE according to formula:
coef(ENet) = (1 + lambda) * coef(NaiveENet)
The glmnet gives "ready-to-use" coefficients. However they are different from those of ElasticNet. (maybe different algorithms)
You'll get ElasticNet and glmnet "aligned" if you don't normalize the predictors.
enet.model=enet(x, y, lambda=1, normalize = F)
mx_x <- data.frame(coef_enet = round(predict(enet.model, type="coef", s=2, mode="penalty", naive = F)$coefficients, 2))
mx_x$coef_enet.naive <- round(predict(enet.model, type="coef", s=2, mode="penalty", naive = T)$coefficients, 2)
glmnet.model=glmnet(x, y, alpha=0.50, standardize = F)
mx_x$coef_glmnet <- round(coef(glmnet.model, s=2, exact=TRUE), 2)[-1]
mx_x
coef_enet coef_enet.naive coef_glmnet
PrivateYes -971.26 -485.63 -481.73
Accept 3.17 1.59 1.58
Enroll -1.76 -0.88 -0.87
Top10perc 99.84 49.92 49.57
Top25perc -28.47 -14.24 -14.03
F.Undergrad 0.12 0.06 0.06
P.Undergrad 0.09 0.04 0.04
Outstate -0.17 -0.09 -0.09
Room.Board 0.30 0.15 0.15
Books 0.04 0.02 0.02
Personal 0.06 0.03 0.03
PhD -17.29 -8.65 -8.54
Terminal -6.59 -3.30 -3.35
S.F.Ratio 31.04 15.52 15.48
perc.alumni 0.31 0.16 0.09
Expend 0.16 0.08 0.08
Grad.Rate 17.31 8.66 8.63
How predict works?
mx_x2 <- data.frame(pred_enet = predict(enet.model, newx=x, s=2, mode="penalty", naive=F)$fit,
pred_enet.naive = predict(enet.model, newx=x, s=2, mode="penalty", naive=T)$fit,
pred_glmnet = as.vector(predict(glmnet.model, newx=x, s=2, exact=T)))
head(mx_x2)
pred_enet pred_enet.naive pred_glmnet
Abilene Christian University -200.7408 1400.4488 1403.1934
Adelphi University 3757.6684 3379.6534 3376.7797
Adrian College -456.4379 1272.6002 1272.1445
Agnes Scott College 994.5582 1998.0983 1997.6611
Alaska Pacific University -3453.9529 -226.1573 -221.7383
Albertson College -1664.2285 668.7049 668.3047
enet prediction is linear in enet naive prediction (formula):
fit.lm <- lm(pred_enet~pred_enet.naive, data=mx_x2)
coef(fit.lm)
(Intercept) pred_enet.naive
-3001.638 2.000
summary(fit.lm)$r.squared
[1] 1
enet naive is almost identical to glmnet prediction:
fit.lm <- lm(pred_enet.naive~-1+pred_glmnet, data=mx_x2)
coef(fit.lm)
pred_glmnet
1.000126
summary(fit.lm)$r.squared
[1] 0.9999994
|
R glmnet and elasticnet gives different results, why?
x=model.matrix(Apps~.,College)[,-1]
y=College$Apps
enet.model=enet(x, y, lambda=1)
mx_x <- data.frame(coef_enet = round(predict(enet.model, type="coef", s=2, mode="penalty", naive = F)$coefficients,
|
42,347
|
What is the problem with training Neural Networks with back propagation with activation functions that only output positive values? [duplicate]
|
The gradient of sigmoid function is $$ (1-\sigma) \sigma $$ So if the input is $[0,1]$ then the output of the gradients on $w$ could only be all positive or all negative. You can check more on the notebook.
Sigmoid outputs are not zero-centered. This is undesirable since neurons in later layers of processing in a Neural Network (more on this soon) would be receiving data that is not zero-centered. This has implications on the dynamics during gradient descent, because if the data coming into a neuron is always positive (e.g. $x>0$ elementwise in $f=w^Tx+b$)), then the gradient on the weights ww will during backpropagation become either all be positive, or all negative (depending on the gradient of the whole expression $f$).
|
What is the problem with training Neural Networks with back propagation with activation functions th
|
The gradient of sigmoid function is $$ (1-\sigma) \sigma $$ So if the input is $[0,1]$ then the output of the gradients on $w$ could only be all positive or all negative. You can check more on the not
|
What is the problem with training Neural Networks with back propagation with activation functions that only output positive values? [duplicate]
The gradient of sigmoid function is $$ (1-\sigma) \sigma $$ So if the input is $[0,1]$ then the output of the gradients on $w$ could only be all positive or all negative. You can check more on the notebook.
Sigmoid outputs are not zero-centered. This is undesirable since neurons in later layers of processing in a Neural Network (more on this soon) would be receiving data that is not zero-centered. This has implications on the dynamics during gradient descent, because if the data coming into a neuron is always positive (e.g. $x>0$ elementwise in $f=w^Tx+b$)), then the gradient on the weights ww will during backpropagation become either all be positive, or all negative (depending on the gradient of the whole expression $f$).
|
What is the problem with training Neural Networks with back propagation with activation functions th
The gradient of sigmoid function is $$ (1-\sigma) \sigma $$ So if the input is $[0,1]$ then the output of the gradients on $w$ could only be all positive or all negative. You can check more on the not
|
42,348
|
What is the problem with training Neural Networks with back propagation with activation functions that only output positive values? [duplicate]
|
$$f = w^T.x + b$$
Thus, the gradient is: $$\frac{\partial f}{\partial w} = x $$.
If $x > 0$, then this expression is positive.
$$\sigma = \frac{1}{1+ \exp(-f) }$$
$$\frac{\partial \sigma}{\partial f} = \sigma (1 - \sigma)$$
Now since, $\sigma$ is sigmoid function and it always outputs in the range (0,1) this expression is always positive.
The loss gradient coming upstream is say $\frac{\partial L}{\partial \sigma}$.
Thus by using chain rule, $$ \frac{\partial L}{\partial w} = \frac{\partial L}{\partial \sigma}\sigma (1 - \sigma)x $$
In the above three terms on RHS the rightmost two terms are positive given $x > 0$ and so the sign of gradient is only determined by the gradient of loss function coming upstream in back propagation.
The problem now here is if $x$ which is positive is parameterized by say $n$ $w$'s, then all of these $w$'s will have same sign for gradient. A case where different $w$'s have different signs will not occur. That's what will lead to zig zag dynamics.
|
What is the problem with training Neural Networks with back propagation with activation functions th
|
$$f = w^T.x + b$$
Thus, the gradient is: $$\frac{\partial f}{\partial w} = x $$.
If $x > 0$, then this expression is positive.
$$\sigma = \frac{1}{1+ \exp(-f) }$$
$$\frac{\partial \sigma}{\partial f}
|
What is the problem with training Neural Networks with back propagation with activation functions that only output positive values? [duplicate]
$$f = w^T.x + b$$
Thus, the gradient is: $$\frac{\partial f}{\partial w} = x $$.
If $x > 0$, then this expression is positive.
$$\sigma = \frac{1}{1+ \exp(-f) }$$
$$\frac{\partial \sigma}{\partial f} = \sigma (1 - \sigma)$$
Now since, $\sigma$ is sigmoid function and it always outputs in the range (0,1) this expression is always positive.
The loss gradient coming upstream is say $\frac{\partial L}{\partial \sigma}$.
Thus by using chain rule, $$ \frac{\partial L}{\partial w} = \frac{\partial L}{\partial \sigma}\sigma (1 - \sigma)x $$
In the above three terms on RHS the rightmost two terms are positive given $x > 0$ and so the sign of gradient is only determined by the gradient of loss function coming upstream in back propagation.
The problem now here is if $x$ which is positive is parameterized by say $n$ $w$'s, then all of these $w$'s will have same sign for gradient. A case where different $w$'s have different signs will not occur. That's what will lead to zig zag dynamics.
|
What is the problem with training Neural Networks with back propagation with activation functions th
$$f = w^T.x + b$$
Thus, the gradient is: $$\frac{\partial f}{\partial w} = x $$.
If $x > 0$, then this expression is positive.
$$\sigma = \frac{1}{1+ \exp(-f) }$$
$$\frac{\partial \sigma}{\partial f}
|
42,349
|
Does it take progressively fewer EXTRA correct answers to move up a grading curve in standardised exams?
|
Some understanding of the why can be gleaned from a simple but realistic model.
The curve shown in the question is consistent with a 46-question test in which each question contributes $100/46 \approx 2$ to the total score when answered correctly and otherwise contributes nothing. It is "consistent" in the sense that the distribution of scores is extremely close to what would obtain if each student were to be guessing each question independently, with a $54.5\%$ chance of being correct and $100-54.5 = 45.5\%$ chance of being incorrect.
Consider some circumstances near the end of the administration of the test. You have answered all questions; you do not know your score; but you are contemplating changing some answers.
Suppose your score (unbeknownst to you) is at the middle, equal to $54.5$. This corresponds to a raw score of $54.5\% \times 46 = 25$, indicating you got $25$ questions right and $46-25=21$ wrong. If you were to pick a question randomly and change it, there would be a $25/46 = 54.5\%$ chance it is correct--and you would turn your answer into a wrong one--and only a $45.5\%$ chance it is incorrect and you would turn it into a correct one. Therefore it's a little bit harder to increase your score than to decrease it.
Suppose your score actually is high, equal to $65$: that is, $30$ correct and $16$ incorrect answers. Now your chance of alighting randomly on one of the incorrect questions and changing it--thereby improving your score--is only about $1/3$. It is twice as hard to increase this high score than to decrease it.
Conversely, using a similar analysis, it is easier to improve a low score by randomly changing one of the answers.
More generally--and you might find this to be a more appealing model than one that seems based on luck alone--consider any test in which your score is expected to be $100p\%$ of the total based on your underlying knowledge. To improve your expected test score from $100p$ to $100(p+x)\%$ -- that is, an increase of $100x$ points -- you would have to retain your performance on the $100p\%$ of the answers you got right while learning enough to add $100x$ points out of the $100(1-p)$ points lost on the wrong answers. This relative improvement in your knowledge can be expressed in two ways:
You reduced the proportion $1-p$ of wrong answers to $1-p-x$, a change of $-x/(1-p)$; and
You increased the proportion $p$ of right answers to $p+x$, a change of $+x/p$.
The ratio of these (up to sign), namely
$$\frac{xp}{x(1-p)} = \frac{p}{1-p}$$
is the odds of $p$. In a balanced way--by accounting for the need both to get fewer wrong answers and more right answers--it measures how difficult it is to make a small increase of $100x$ starting with a score of $100p$. As $100p$ grows towards $100$ points, the dwindling size of the denominator $1-p$ shows how it gets progressively much more difficult to improve an already high score. Roughly, increases from $90\%$ to $95\%$ to $97\%$ are equally difficult. (These are odds of approximately $9$, $19$, and $32$, respectively.)
Note, too, that it's far more likely for your score to drop due to small errors on questions than to rise when your score is above 50%, with the reverse being the case for lower scores: guessing and random mistakes benefit the poor student and hurt the good student.
As far as a study strategy goes, this analysis suggests you get the most benefit from studying the sections you are weakest at--assuming that each unit of study effort results in the same relative increase in performance in each section.
|
Does it take progressively fewer EXTRA correct answers to move up a grading curve in standardised ex
|
Some understanding of the why can be gleaned from a simple but realistic model.
The curve shown in the question is consistent with a 46-question test in which each question contributes $100/46 \approx
|
Does it take progressively fewer EXTRA correct answers to move up a grading curve in standardised exams?
Some understanding of the why can be gleaned from a simple but realistic model.
The curve shown in the question is consistent with a 46-question test in which each question contributes $100/46 \approx 2$ to the total score when answered correctly and otherwise contributes nothing. It is "consistent" in the sense that the distribution of scores is extremely close to what would obtain if each student were to be guessing each question independently, with a $54.5\%$ chance of being correct and $100-54.5 = 45.5\%$ chance of being incorrect.
Consider some circumstances near the end of the administration of the test. You have answered all questions; you do not know your score; but you are contemplating changing some answers.
Suppose your score (unbeknownst to you) is at the middle, equal to $54.5$. This corresponds to a raw score of $54.5\% \times 46 = 25$, indicating you got $25$ questions right and $46-25=21$ wrong. If you were to pick a question randomly and change it, there would be a $25/46 = 54.5\%$ chance it is correct--and you would turn your answer into a wrong one--and only a $45.5\%$ chance it is incorrect and you would turn it into a correct one. Therefore it's a little bit harder to increase your score than to decrease it.
Suppose your score actually is high, equal to $65$: that is, $30$ correct and $16$ incorrect answers. Now your chance of alighting randomly on one of the incorrect questions and changing it--thereby improving your score--is only about $1/3$. It is twice as hard to increase this high score than to decrease it.
Conversely, using a similar analysis, it is easier to improve a low score by randomly changing one of the answers.
More generally--and you might find this to be a more appealing model than one that seems based on luck alone--consider any test in which your score is expected to be $100p\%$ of the total based on your underlying knowledge. To improve your expected test score from $100p$ to $100(p+x)\%$ -- that is, an increase of $100x$ points -- you would have to retain your performance on the $100p\%$ of the answers you got right while learning enough to add $100x$ points out of the $100(1-p)$ points lost on the wrong answers. This relative improvement in your knowledge can be expressed in two ways:
You reduced the proportion $1-p$ of wrong answers to $1-p-x$, a change of $-x/(1-p)$; and
You increased the proportion $p$ of right answers to $p+x$, a change of $+x/p$.
The ratio of these (up to sign), namely
$$\frac{xp}{x(1-p)} = \frac{p}{1-p}$$
is the odds of $p$. In a balanced way--by accounting for the need both to get fewer wrong answers and more right answers--it measures how difficult it is to make a small increase of $100x$ starting with a score of $100p$. As $100p$ grows towards $100$ points, the dwindling size of the denominator $1-p$ shows how it gets progressively much more difficult to improve an already high score. Roughly, increases from $90\%$ to $95\%$ to $97\%$ are equally difficult. (These are odds of approximately $9$, $19$, and $32$, respectively.)
Note, too, that it's far more likely for your score to drop due to small errors on questions than to rise when your score is above 50%, with the reverse being the case for lower scores: guessing and random mistakes benefit the poor student and hurt the good student.
As far as a study strategy goes, this analysis suggests you get the most benefit from studying the sections you are weakest at--assuming that each unit of study effort results in the same relative increase in performance in each section.
|
Does it take progressively fewer EXTRA correct answers to move up a grading curve in standardised ex
Some understanding of the why can be gleaned from a simple but realistic model.
The curve shown in the question is consistent with a 46-question test in which each question contributes $100/46 \approx
|
42,350
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
|
Yes. This becomes clear upon working through the definitions.
The Kronecker Product
The unit sphere $S^{n-1}$ is the set of unit vectors in the Euclidean space $E^n = \left(\mathbb{R}^n, ||\cdot ||\right)$ where $$||(x_1,x_2,\ldots,x_n)^\prime|| = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}$$ is the Euclidean norm.
The "Kronecker product" is the usual tensor product. There are several ways to think about it and compute with it. One is to define it as an $n\times n$ matrix
$$x \otimes y = x\, y^\prime = \pmatrix{x_1y_1 & x_1y_2 & \cdots & x_1y_n \\
x_2y_1 & x_2y_2 & \cdots & x_2y_n \\
\vdots & \vdots & \cdots & \vdots \\
x_ny_1 & x_ny_2 & \cdots & x_ny_n} \in \operatorname{Mat}\left(\mathbb{R}^n, \mathbb{R}^n\right).$$
Another equivalent way unravels the components of this matrix into a vector with $n^2$ components, allowing us to view $x\otimes y$ as an element of $\mathbb{R}^{n^2}$. Notice that the Euclidean metric for $\mathbb{R}^{n^2}$ can be written
$$||Z||^2 = \operatorname{Tr}( Z Z^\prime ).\tag{1}$$
Both are ways of writing the sum of squares of all $n^2$ components.
The Kronecker product is compatible with the Euclidean metrics on $E^n$ and $E^{n^2}$ in the sense that
$$||x \otimes y||^2 = ||x||^2\,||y||^2.$$
This is easily demonstrated, because the left hand side is defined as the sum of the squares of all the $x_i y_j$ while the right hand side is the product of their sums of squares. Just expand that product:
$$||x \otimes y||^2 = \sum_i\sum_j (x_iy_j)^2 = \left(\sum_i x_i^2\right)\left(\sum_j y_j^2\right) = ||x||^2\,||y||^2.$$
In particular, when both $x$ and $y$ have unit length, $x \otimes y$ has unit length. Therefore
$$S^{n-1}\otimes S^{n-1} \subset S^{n^2-1}.$$
Uniform distributions
The Euclidean spheres inherit a measure from the usual measure on the Euclidean spaces (the Lebesgue measure, ultimately determined by the Euclidean distance). That measure is preserved by any isometry of a sphere, because (by definition) an isometry preserves distances and the measure ultimately is determined by distances. The group of isometries of the unit sphere in $\mathbb{R}^m$ is denoted $O(m)$, the orthogonal group. It is a classical result, and straightforward to show, that it consists of the linear transformations represented by all $m\times m$ matrices $P$ for which $PP^\prime = P^\prime P = \mathbb{I}_m$.
The orthogonal group $O(n)$ acts transitively on $S^{n-1}$. (Here's a proof Euclid might have made: pick any two distinct points $x$ and $y$ on the sphere. Draw the line segment $xy$ between them. It determines a unique hyperplane perpendicular to $xy$ passing through the midpoint of $xy$. The reflection in that hyperplane maps $S^{n-1}$ to itself and preserves all distances, whence it is in $O(n)$. That reflection swaps $x$ and $y$, showing there exists an orthogonal transformation sending $x$ to $y$.)
To say that "vectors are uniformly distributed on $S^{n-1}$" means that the distribution is invariant under a transitive group of isometries like $O(n)$.
Here's the punchline: the "hypertorus" $S^{n-1}\otimes S^{n-1} \subset S^{n^2-1}$ enjoys a transitive group of isometries isomorphic to a quotient of $O(n)\times O(n)$. Indeed, given an arbitrary $x\otimes y\in S^{n-1}$ and another $x_2\otimes y_2\in S^{n-1}$, pick $P,Q\in O(n)$ for which $Px=x_2$ and $Qy=y_2$. Let $Z=(z_{ij})$ be any $n\times n$ matrix and define
$$(P\otimes Q)(Z) = PZQ^\prime.\tag{2}$$
This is an isometry because, using the formula $(1)$,
$$\eqalign{
||(P \otimes Q) (Z)||^2 &= \operatorname{Tr}\left((PZQ^\prime)(PZQ^\prime)^\prime\right) = \operatorname{Tr}\left(PZ Z^\prime P^\prime\right) = \operatorname{Tr}\left(PP^\prime Z Z^\prime \right) = \operatorname{Tr}\left(ZZ^\prime \right) \\
&= ||Z||^2.}$$
These steps exploited the orthogonality of $P$ and $Q$ and the fact that $\operatorname{Tr}(AB) = \operatorname{Tr}(BA)$ for any square matrices $A$ and $B$.
Because the isometries of $S^{n-1}$ induce a transitive group of isometries of $S^{n-1}\otimes S^{n-1}$ via $(2)$, the uniform (that is, group-invariant) distribution on $S^{n-1}$ is mapped to a uniform distribution on $S^{n-1}\otimes S^{n-1}$, QED.
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
|
Yes. This becomes clear upon working through the definitions.
The Kronecker Product
The unit sphere $S^{n-1}$ is the set of unit vectors in the Euclidean space $E^n = \left(\mathbb{R}^n, ||\cdot ||\r
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
Yes. This becomes clear upon working through the definitions.
The Kronecker Product
The unit sphere $S^{n-1}$ is the set of unit vectors in the Euclidean space $E^n = \left(\mathbb{R}^n, ||\cdot ||\right)$ where $$||(x_1,x_2,\ldots,x_n)^\prime|| = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}$$ is the Euclidean norm.
The "Kronecker product" is the usual tensor product. There are several ways to think about it and compute with it. One is to define it as an $n\times n$ matrix
$$x \otimes y = x\, y^\prime = \pmatrix{x_1y_1 & x_1y_2 & \cdots & x_1y_n \\
x_2y_1 & x_2y_2 & \cdots & x_2y_n \\
\vdots & \vdots & \cdots & \vdots \\
x_ny_1 & x_ny_2 & \cdots & x_ny_n} \in \operatorname{Mat}\left(\mathbb{R}^n, \mathbb{R}^n\right).$$
Another equivalent way unravels the components of this matrix into a vector with $n^2$ components, allowing us to view $x\otimes y$ as an element of $\mathbb{R}^{n^2}$. Notice that the Euclidean metric for $\mathbb{R}^{n^2}$ can be written
$$||Z||^2 = \operatorname{Tr}( Z Z^\prime ).\tag{1}$$
Both are ways of writing the sum of squares of all $n^2$ components.
The Kronecker product is compatible with the Euclidean metrics on $E^n$ and $E^{n^2}$ in the sense that
$$||x \otimes y||^2 = ||x||^2\,||y||^2.$$
This is easily demonstrated, because the left hand side is defined as the sum of the squares of all the $x_i y_j$ while the right hand side is the product of their sums of squares. Just expand that product:
$$||x \otimes y||^2 = \sum_i\sum_j (x_iy_j)^2 = \left(\sum_i x_i^2\right)\left(\sum_j y_j^2\right) = ||x||^2\,||y||^2.$$
In particular, when both $x$ and $y$ have unit length, $x \otimes y$ has unit length. Therefore
$$S^{n-1}\otimes S^{n-1} \subset S^{n^2-1}.$$
Uniform distributions
The Euclidean spheres inherit a measure from the usual measure on the Euclidean spaces (the Lebesgue measure, ultimately determined by the Euclidean distance). That measure is preserved by any isometry of a sphere, because (by definition) an isometry preserves distances and the measure ultimately is determined by distances. The group of isometries of the unit sphere in $\mathbb{R}^m$ is denoted $O(m)$, the orthogonal group. It is a classical result, and straightforward to show, that it consists of the linear transformations represented by all $m\times m$ matrices $P$ for which $PP^\prime = P^\prime P = \mathbb{I}_m$.
The orthogonal group $O(n)$ acts transitively on $S^{n-1}$. (Here's a proof Euclid might have made: pick any two distinct points $x$ and $y$ on the sphere. Draw the line segment $xy$ between them. It determines a unique hyperplane perpendicular to $xy$ passing through the midpoint of $xy$. The reflection in that hyperplane maps $S^{n-1}$ to itself and preserves all distances, whence it is in $O(n)$. That reflection swaps $x$ and $y$, showing there exists an orthogonal transformation sending $x$ to $y$.)
To say that "vectors are uniformly distributed on $S^{n-1}$" means that the distribution is invariant under a transitive group of isometries like $O(n)$.
Here's the punchline: the "hypertorus" $S^{n-1}\otimes S^{n-1} \subset S^{n^2-1}$ enjoys a transitive group of isometries isomorphic to a quotient of $O(n)\times O(n)$. Indeed, given an arbitrary $x\otimes y\in S^{n-1}$ and another $x_2\otimes y_2\in S^{n-1}$, pick $P,Q\in O(n)$ for which $Px=x_2$ and $Qy=y_2$. Let $Z=(z_{ij})$ be any $n\times n$ matrix and define
$$(P\otimes Q)(Z) = PZQ^\prime.\tag{2}$$
This is an isometry because, using the formula $(1)$,
$$\eqalign{
||(P \otimes Q) (Z)||^2 &= \operatorname{Tr}\left((PZQ^\prime)(PZQ^\prime)^\prime\right) = \operatorname{Tr}\left(PZ Z^\prime P^\prime\right) = \operatorname{Tr}\left(PP^\prime Z Z^\prime \right) = \operatorname{Tr}\left(ZZ^\prime \right) \\
&= ||Z||^2.}$$
These steps exploited the orthogonality of $P$ and $Q$ and the fact that $\operatorname{Tr}(AB) = \operatorname{Tr}(BA)$ for any square matrices $A$ and $B$.
Because the isometries of $S^{n-1}$ induce a transitive group of isometries of $S^{n-1}\otimes S^{n-1}$ via $(2)$, the uniform (that is, group-invariant) distribution on $S^{n-1}$ is mapped to a uniform distribution on $S^{n-1}\otimes S^{n-1}$, QED.
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
Yes. This becomes clear upon working through the definitions.
The Kronecker Product
The unit sphere $S^{n-1}$ is the set of unit vectors in the Euclidean space $E^n = \left(\mathbb{R}^n, ||\cdot ||\r
|
42,351
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
|
As long as $x$ and $y$ are independent, then what you say is true.
It's easiest to think about angles rather than points in space.
For example, in the 2-D sphere in $\mathbb R^3$, we can generate points uniformly on the surface of that sphere by sampling $\theta_1$ and $\theta_2$ independently from $U[0,2\pi]$ and taking those as zenith and azimuth respectively.
Thus, we can think of $x$ as $(\theta_1,...,\theta_{n-1}) \sim U[0,2\pi]^{n-1}$ and $y$ as $(\phi_1,...,\phi_{n-1}) \sim U[0,2\pi]^{n-1}$. Their KP is then $(\theta_1,...,\theta_{n-1},\phi_1,...,\phi_{n-1})$ and it's clear from the construction that that follows a uniform distribution $U[0,2\pi]^{2n-2}$ as well.
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
|
As long as $x$ and $y$ are independent, then what you say is true.
It's easiest to think about angles rather than points in space.
For example, in the 2-D sphere in $\mathbb R^3$, we can generate poin
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
As long as $x$ and $y$ are independent, then what you say is true.
It's easiest to think about angles rather than points in space.
For example, in the 2-D sphere in $\mathbb R^3$, we can generate points uniformly on the surface of that sphere by sampling $\theta_1$ and $\theta_2$ independently from $U[0,2\pi]$ and taking those as zenith and azimuth respectively.
Thus, we can think of $x$ as $(\theta_1,...,\theta_{n-1}) \sim U[0,2\pi]^{n-1}$ and $y$ as $(\phi_1,...,\phi_{n-1}) \sim U[0,2\pi]^{n-1}$. Their KP is then $(\theta_1,...,\theta_{n-1},\phi_1,...,\phi_{n-1})$ and it's clear from the construction that that follows a uniform distribution $U[0,2\pi]^{2n-2}$ as well.
|
The distribution for the Kronecker product of two uniform random vectors in unit sphere?
As long as $x$ and $y$ are independent, then what you say is true.
It's easiest to think about angles rather than points in space.
For example, in the 2-D sphere in $\mathbb R^3$, we can generate poin
|
42,352
|
Linear regression with several DVs with correlated errors
|
This is in fact called multivariate regression. I just think that it's not a commonly-used term because it's not a commonly-used model. Note also that it is very easy to confuse with "multiple linear regression."
The reason why multivariate regression is so relatively unpopular (and not implemented explicitly in any major statistical package) is actually buried in the comments to one of the answers to Multivariate linear regression in R, which I'll repeat here:
User603's answer is correct. Given a model $Y=XB+E$ and assuming $E \sim N(0,\Sigma)$ (so you don't have a strictly diagonal covariance matrix) the maximum likelihood estimator for $B$ is simply $B_{OLS}=(X^TX)^{−1}X^TY$, which amounts in performing separate ordinary least squares estimates for each of the q response variables and does not depend on $\Sigma$. ($Σ$ appears as $Ω^{−1}$ in the literature sometimes, $Ω$ being the precision matrix)
This is why lm is designed that way: because the coefficient estimates are actually equivalent.
Therefore differences arise only when you're trying to conduct statistical tests on the parameter estimates using their theoretical standard errors (as opposed to, say, bootstrapping), or if you're trying to estimate the distribution of model predictions (which with an improper flat prior are equivalent to posterior predictions).
If you're interested in making use of the correlation structure in the dependent variables, Breiman and Friedman (1997) [1] have a very interesting paper in which they develop something they call the "Curds & Whey" procedure for improving prediction accuracy in multivariate linear regression problems.
I also have some personal experience with these kinds of models, but they were unpleasant and mostly unfruitful. I attempted to directly fit one in Stan by specifying a multivariate normal error distribution for each data point. I didn't have a damn clue what I was doing at the time and I kept layering on extensions to the model, so it turned into a mess that wouldn't converge and I dropped it entirely. However I think there is some merit to the basic idea and I'm be tempted to try it again at some point.
[1]: Breiman, L. and Friedman, J. (1997). Predicting Multivariate Responses in Multiple Linear Regression. Journal of the Royal Statistical Society, 59(1), 3-54. Available (gated) at: http://onlinelibrary.wiley.com/doi/10.1111/1467-9868.00054/pdf. Available (free) at: you know where to look 😉
|
Linear regression with several DVs with correlated errors
|
This is in fact called multivariate regression. I just think that it's not a commonly-used term because it's not a commonly-used model. Note also that it is very easy to confuse with "multiple linear
|
Linear regression with several DVs with correlated errors
This is in fact called multivariate regression. I just think that it's not a commonly-used term because it's not a commonly-used model. Note also that it is very easy to confuse with "multiple linear regression."
The reason why multivariate regression is so relatively unpopular (and not implemented explicitly in any major statistical package) is actually buried in the comments to one of the answers to Multivariate linear regression in R, which I'll repeat here:
User603's answer is correct. Given a model $Y=XB+E$ and assuming $E \sim N(0,\Sigma)$ (so you don't have a strictly diagonal covariance matrix) the maximum likelihood estimator for $B$ is simply $B_{OLS}=(X^TX)^{−1}X^TY$, which amounts in performing separate ordinary least squares estimates for each of the q response variables and does not depend on $\Sigma$. ($Σ$ appears as $Ω^{−1}$ in the literature sometimes, $Ω$ being the precision matrix)
This is why lm is designed that way: because the coefficient estimates are actually equivalent.
Therefore differences arise only when you're trying to conduct statistical tests on the parameter estimates using their theoretical standard errors (as opposed to, say, bootstrapping), or if you're trying to estimate the distribution of model predictions (which with an improper flat prior are equivalent to posterior predictions).
If you're interested in making use of the correlation structure in the dependent variables, Breiman and Friedman (1997) [1] have a very interesting paper in which they develop something they call the "Curds & Whey" procedure for improving prediction accuracy in multivariate linear regression problems.
I also have some personal experience with these kinds of models, but they were unpleasant and mostly unfruitful. I attempted to directly fit one in Stan by specifying a multivariate normal error distribution for each data point. I didn't have a damn clue what I was doing at the time and I kept layering on extensions to the model, so it turned into a mess that wouldn't converge and I dropped it entirely. However I think there is some merit to the basic idea and I'm be tempted to try it again at some point.
[1]: Breiman, L. and Friedman, J. (1997). Predicting Multivariate Responses in Multiple Linear Regression. Journal of the Royal Statistical Society, 59(1), 3-54. Available (gated) at: http://onlinelibrary.wiley.com/doi/10.1111/1467-9868.00054/pdf. Available (free) at: you know where to look 😉
|
Linear regression with several DVs with correlated errors
This is in fact called multivariate regression. I just think that it's not a commonly-used term because it's not a commonly-used model. Note also that it is very easy to confuse with "multiple linear
|
42,353
|
GLMM - between, within and nested
|
I don't see why Rating is nested within ID. This means that every every unique Rating belongs to one and only one ID which does not appear to be the case. If Rating is to be treated as random, then these should be crossed random effects. See the answer here for the difference between crossed and nested random effects and how to specify them.
That said, however, Rating should not be specified as a random intercept here because 1) there are only 4 levels, which is insufficient and 2) it is a likert scale item so the assumption of normality of random effects is hardly likely to hold.
So a better model would be
model = glmer(Correct ~ (1|ID) + Memory * State * Rating, data, family=binomial)
Lastly, note that there a several ways that you can treat Rating as an independent variable, see here, here and here for more details.
|
GLMM - between, within and nested
|
I don't see why Rating is nested within ID. This means that every every unique Rating belongs to one and only one ID which does not appear to be the case. If Rating is to be treated as random, then th
|
GLMM - between, within and nested
I don't see why Rating is nested within ID. This means that every every unique Rating belongs to one and only one ID which does not appear to be the case. If Rating is to be treated as random, then these should be crossed random effects. See the answer here for the difference between crossed and nested random effects and how to specify them.
That said, however, Rating should not be specified as a random intercept here because 1) there are only 4 levels, which is insufficient and 2) it is a likert scale item so the assumption of normality of random effects is hardly likely to hold.
So a better model would be
model = glmer(Correct ~ (1|ID) + Memory * State * Rating, data, family=binomial)
Lastly, note that there a several ways that you can treat Rating as an independent variable, see here, here and here for more details.
|
GLMM - between, within and nested
I don't see why Rating is nested within ID. This means that every every unique Rating belongs to one and only one ID which does not appear to be the case. If Rating is to be treated as random, then th
|
42,354
|
Poisson random variable self-study question
|
To check (1), note that the expected number of people arriving after you must equal the expected number of people arriving before you and that the sum of those is the expected number of people (besides yourself), which the problem states is equal to 10. Therefore the answer must be $10/2=5$.
For (2), use the hint you provided in your tags: these are conditional-probability problems. Thus, we partition the event "I am the $n^\text{th}$ person to arrive" into the disjoint events
"I am at position $n$" and "$k-1=n-1$ people arrive with me",
"I am at position $n$" and "$k-1=n$ people arrive with me",
"I am at position $n$" and "$k-1=n+1$ people arrive with me", etc,
with $k=n, n+1, n+2, \ldots$. Each of those events "$k-1$ people arrive with me" occurs with the Poisson probability associated with $k-1$. Conditional on $k-1$, the chance that I am in position $n$ is the same as the chance that anyone else is in that position, which therefore must be $1/k$ when there are $k-1$ people plus myself.
In terms of $\lambda=10$ and letting $X$ be a Poisson$(\lambda)$ variable with distribution function $F_\lambda$, the answer therefore is
$$\sum_{k=n}^\infty \frac{1}{k} e^{-\lambda} \frac{\lambda^{k-1}}{(k-1)!}=\frac{1}{\lambda}e^{-\lambda}\sum_{k=n}^\infty \frac{\lambda^k}{k!}=\frac{1}{\lambda}\Pr(X\ge n) = \frac{1}{\lambda}(1-F_\lambda(n-1)).$$
A well-known relationship between the Poisson distribution and the Gamma distribution equates this to
$$\frac{1}{\lambda}(1-F_\lambda(n-1)) = \frac{1}{\lambda}\Gamma(\lambda;n)$$
where
$$\Gamma(\lambda;n) = \frac{1}{\Gamma(n)}\int_0^\lambda t^{n-1} e^{-t}\,\mathrm{d}t$$
is the Gamma distribution of parameter $x$. Being proportional to a $\chi^2$ probability, which is a basic statistical computation, it can be obtained with just about any statistical software, as illustrated in R here, using its pgamma function.
library(data.table)
library(ggplot2)
lambda <- 10 # The Poisson parameter
x <- 1:30
X <- data.table(n=rep(x, 3), lambda=rep(c(5,10,20), each=length(x)))
#
# Here is where the chances are calculated.
#
X[, probability := pgamma(lambda, n)/lambda]
#
# Plot them.
#
ggplot(X, aes(n, probability)) +
geom_point(aes(color=factor(lambda)), size=2, alpha=0.8) +
guides(color=guide_legend(title=expression(lambda), title.vjust=0)) +
theme(legend.title=element_text(size=24)) +
ggtitle("(Unconditional) Chance of Being n in Line")
|
Poisson random variable self-study question
|
To check (1), note that the expected number of people arriving after you must equal the expected number of people arriving before you and that the sum of those is the expected number of people (beside
|
Poisson random variable self-study question
To check (1), note that the expected number of people arriving after you must equal the expected number of people arriving before you and that the sum of those is the expected number of people (besides yourself), which the problem states is equal to 10. Therefore the answer must be $10/2=5$.
For (2), use the hint you provided in your tags: these are conditional-probability problems. Thus, we partition the event "I am the $n^\text{th}$ person to arrive" into the disjoint events
"I am at position $n$" and "$k-1=n-1$ people arrive with me",
"I am at position $n$" and "$k-1=n$ people arrive with me",
"I am at position $n$" and "$k-1=n+1$ people arrive with me", etc,
with $k=n, n+1, n+2, \ldots$. Each of those events "$k-1$ people arrive with me" occurs with the Poisson probability associated with $k-1$. Conditional on $k-1$, the chance that I am in position $n$ is the same as the chance that anyone else is in that position, which therefore must be $1/k$ when there are $k-1$ people plus myself.
In terms of $\lambda=10$ and letting $X$ be a Poisson$(\lambda)$ variable with distribution function $F_\lambda$, the answer therefore is
$$\sum_{k=n}^\infty \frac{1}{k} e^{-\lambda} \frac{\lambda^{k-1}}{(k-1)!}=\frac{1}{\lambda}e^{-\lambda}\sum_{k=n}^\infty \frac{\lambda^k}{k!}=\frac{1}{\lambda}\Pr(X\ge n) = \frac{1}{\lambda}(1-F_\lambda(n-1)).$$
A well-known relationship between the Poisson distribution and the Gamma distribution equates this to
$$\frac{1}{\lambda}(1-F_\lambda(n-1)) = \frac{1}{\lambda}\Gamma(\lambda;n)$$
where
$$\Gamma(\lambda;n) = \frac{1}{\Gamma(n)}\int_0^\lambda t^{n-1} e^{-t}\,\mathrm{d}t$$
is the Gamma distribution of parameter $x$. Being proportional to a $\chi^2$ probability, which is a basic statistical computation, it can be obtained with just about any statistical software, as illustrated in R here, using its pgamma function.
library(data.table)
library(ggplot2)
lambda <- 10 # The Poisson parameter
x <- 1:30
X <- data.table(n=rep(x, 3), lambda=rep(c(5,10,20), each=length(x)))
#
# Here is where the chances are calculated.
#
X[, probability := pgamma(lambda, n)/lambda]
#
# Plot them.
#
ggplot(X, aes(n, probability)) +
geom_point(aes(color=factor(lambda)), size=2, alpha=0.8) +
guides(color=guide_legend(title=expression(lambda), title.vjust=0)) +
theme(legend.title=element_text(size=24)) +
ggtitle("(Unconditional) Chance of Being n in Line")
|
Poisson random variable self-study question
To check (1), note that the expected number of people arriving after you must equal the expected number of people arriving before you and that the sum of those is the expected number of people (beside
|
42,355
|
Poisson random variable self-study question
|
This is not a full answer, but may help you get there.
Say $N$ is the total number of people invited to the party, and $n$ is your position in the arrival sequence. Then from your setup we have that $N-1$ is Poisson distributed with mean 10. So you can answer your questions in two steps: First, you can compute the answers conditional on knowing $N$. Then, you must compute the final answers by incorporating the distribution of $N$.
Your post addresses only the first part. You are correct that $\Pr[n|N]=\frac{1}{N}$, and $\langle n|N\rangle=\frac{N+1}{2}$. To finish, you now need to incorporate the distribution of $N$.
(You also need to account for some unit offsets, i.e. it is $n-1$ people who arrive before you, and it is $N-1$ which is Poisson distributed).
Hope this helps!
|
Poisson random variable self-study question
|
This is not a full answer, but may help you get there.
Say $N$ is the total number of people invited to the party, and $n$ is your position in the arrival sequence. Then from your setup we have that $
|
Poisson random variable self-study question
This is not a full answer, but may help you get there.
Say $N$ is the total number of people invited to the party, and $n$ is your position in the arrival sequence. Then from your setup we have that $N-1$ is Poisson distributed with mean 10. So you can answer your questions in two steps: First, you can compute the answers conditional on knowing $N$. Then, you must compute the final answers by incorporating the distribution of $N$.
Your post addresses only the first part. You are correct that $\Pr[n|N]=\frac{1}{N}$, and $\langle n|N\rangle=\frac{N+1}{2}$. To finish, you now need to incorporate the distribution of $N$.
(You also need to account for some unit offsets, i.e. it is $n-1$ people who arrive before you, and it is $N-1$ which is Poisson distributed).
Hope this helps!
|
Poisson random variable self-study question
This is not a full answer, but may help you get there.
Say $N$ is the total number of people invited to the party, and $n$ is your position in the arrival sequence. Then from your setup we have that $
|
42,356
|
Poisson random variable self-study question
|
Here's my attempt. Let's assume that the number of invitees (excluding you) to the party, $N$, is Poisson distributed with parameter $\lambda$:
$$N\sim \text{POI}(\lambda)$$
Let's further assume that all those invited actually attend the party. Moreover, let the arrival time of you and all other party attendees be uniformly distributed:
$$T_{i}\sim U(0,1)$$
where $i=1,2,\ldots,(N+1)$. Given that all the arrival times are independent and identically distributed, each attendee must equally share the probability of being the $i$th to arrive. Therefore, the probability of being the $i$th attendee, given $N$, is:
$$\text{Pr}(X=i\,|\,N=n)=\frac{1}{n+1}$$
where $i=1,2,\ldots,(n+1)$. Now, this is the conditional distribution. From here we can calculate the joint distribution:
$$\begin{align}
\text{Pr}(X=i,\,N=n)&=\text{Pr}(X=i\,|\,N=n)\cdot\text{Pr}(N=n)\notag\\
&=\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)
\end{align}$$
To arrive at the marginal distribution for $X$ we need to sum across all values for $N$:
$$\begin{align}
\text{Pr}(X=i)&=\sum_{n=i}^{\infty}\text{Pr}(X=i,\,\,N=n)\notag\\
&=\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)
\end{align}$$
Note that the lower bound of the summation is that way because in order for you to have an $i$th placing, $n$ has to be larger than or equal to $i$. This is the answer to your second question. Finally, we can calculate the expected value of your arrival rank relative to the other attendees:
$$\begin{align}
E[X]&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\text{Pr}(X=i,\,\,N=n)\cdot i\notag\\
&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)\cdot i
\end{align}$$
Now the above expression may not seem very tractable. But due to the independent and identical distribution of the arrival times we can state the expected number of arrivals after you is the same as the expected number of arrivals before you. Therefore, by symmetry, the expected value of your rank relative to the other attendees can be reasoned as follows:
If $\lambda=0$, then you would expect on average to be the first attendee i.e. $E[X]=1$.
If $\lambda=1$, then you would expect on average be the first attendee half the time and the second attendee the other half i.e. $E[X]=1.5$.
If $\lambda=2$, then you would expect on average be the first attendee a third of the time and the second attendee a third of the time and the third attendee a third of the time i.e. $E[X]=2$.
And so on...Thus you arrive at:
$$\begin{align}
E[X]&=\frac{\lambda}{2}+1
\end{align}$$
Interestingly, you verify this expression by evaluating the previously derived expression:
$$\begin{align}
E[X]&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\sum_{i=0}^{n}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\frac{n(n+1)}{2}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\frac{n^{2}+n}{2}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)
\end{align}$$
Now, we use a change of variables:
$$M=N+1$$
and
$$m=n+1$$
Leading to:
$$\begin{align}
E[X]&=\frac{1}{\lambda}\sum_{m=1}^{\infty}\frac{(m-1)^{2}+(m-1)}{2}\bigg(\frac{\lambda^{m}e^{-\lambda}}{m!}\bigg)\\
&=\frac{1}{2\lambda}\sum_{m=1}^{\infty}\big(m^2-m\big)\bigg(\frac{\lambda^{m}e^{-\lambda}}{m!}\bigg)\\
&=\frac{1}{2\lambda}\Big(E[M^2]-E[M]\Big)\\
&=\frac{1}{2\lambda}\Big(\text{Var}(M)+E[M]^{2}-E[M]\Big)\\
&=\frac{1}{2\lambda}\big(\lambda^{2}+2\lambda\big)\\
&=\frac{\lambda}{2}+1
\end{align}$$
Note, the answer to your first question regarding the expected number of people who arrive before you is simply:
$$E[X]-1=\frac{\lambda}{2}$$
Therefore with $\lambda=10$, you expect
$$\frac{\lambda}{2}=5$$
people to arrive before you. Furthermore, the probability of being the $i$th person to arrive can be shown graphically as (shown below for various $\lambda$):
|
Poisson random variable self-study question
|
Here's my attempt. Let's assume that the number of invitees (excluding you) to the party, $N$, is Poisson distributed with parameter $\lambda$:
$$N\sim \text{POI}(\lambda)$$
Let's further assume that
|
Poisson random variable self-study question
Here's my attempt. Let's assume that the number of invitees (excluding you) to the party, $N$, is Poisson distributed with parameter $\lambda$:
$$N\sim \text{POI}(\lambda)$$
Let's further assume that all those invited actually attend the party. Moreover, let the arrival time of you and all other party attendees be uniformly distributed:
$$T_{i}\sim U(0,1)$$
where $i=1,2,\ldots,(N+1)$. Given that all the arrival times are independent and identically distributed, each attendee must equally share the probability of being the $i$th to arrive. Therefore, the probability of being the $i$th attendee, given $N$, is:
$$\text{Pr}(X=i\,|\,N=n)=\frac{1}{n+1}$$
where $i=1,2,\ldots,(n+1)$. Now, this is the conditional distribution. From here we can calculate the joint distribution:
$$\begin{align}
\text{Pr}(X=i,\,N=n)&=\text{Pr}(X=i\,|\,N=n)\cdot\text{Pr}(N=n)\notag\\
&=\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)
\end{align}$$
To arrive at the marginal distribution for $X$ we need to sum across all values for $N$:
$$\begin{align}
\text{Pr}(X=i)&=\sum_{n=i}^{\infty}\text{Pr}(X=i,\,\,N=n)\notag\\
&=\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)
\end{align}$$
Note that the lower bound of the summation is that way because in order for you to have an $i$th placing, $n$ has to be larger than or equal to $i$. This is the answer to your second question. Finally, we can calculate the expected value of your arrival rank relative to the other attendees:
$$\begin{align}
E[X]&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\text{Pr}(X=i,\,\,N=n)\cdot i\notag\\
&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)\cdot i
\end{align}$$
Now the above expression may not seem very tractable. But due to the independent and identical distribution of the arrival times we can state the expected number of arrivals after you is the same as the expected number of arrivals before you. Therefore, by symmetry, the expected value of your rank relative to the other attendees can be reasoned as follows:
If $\lambda=0$, then you would expect on average to be the first attendee i.e. $E[X]=1$.
If $\lambda=1$, then you would expect on average be the first attendee half the time and the second attendee the other half i.e. $E[X]=1.5$.
If $\lambda=2$, then you would expect on average be the first attendee a third of the time and the second attendee a third of the time and the third attendee a third of the time i.e. $E[X]=2$.
And so on...Thus you arrive at:
$$\begin{align}
E[X]&=\frac{\lambda}{2}+1
\end{align}$$
Interestingly, you verify this expression by evaluating the previously derived expression:
$$\begin{align}
E[X]&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\sum_{i=0}^{n}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\frac{n(n+1)}{2}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\frac{n^{2}+n}{2}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)
\end{align}$$
Now, we use a change of variables:
$$M=N+1$$
and
$$m=n+1$$
Leading to:
$$\begin{align}
E[X]&=\frac{1}{\lambda}\sum_{m=1}^{\infty}\frac{(m-1)^{2}+(m-1)}{2}\bigg(\frac{\lambda^{m}e^{-\lambda}}{m!}\bigg)\\
&=\frac{1}{2\lambda}\sum_{m=1}^{\infty}\big(m^2-m\big)\bigg(\frac{\lambda^{m}e^{-\lambda}}{m!}\bigg)\\
&=\frac{1}{2\lambda}\Big(E[M^2]-E[M]\Big)\\
&=\frac{1}{2\lambda}\Big(\text{Var}(M)+E[M]^{2}-E[M]\Big)\\
&=\frac{1}{2\lambda}\big(\lambda^{2}+2\lambda\big)\\
&=\frac{\lambda}{2}+1
\end{align}$$
Note, the answer to your first question regarding the expected number of people who arrive before you is simply:
$$E[X]-1=\frac{\lambda}{2}$$
Therefore with $\lambda=10$, you expect
$$\frac{\lambda}{2}=5$$
people to arrive before you. Furthermore, the probability of being the $i$th person to arrive can be shown graphically as (shown below for various $\lambda$):
|
Poisson random variable self-study question
Here's my attempt. Let's assume that the number of invitees (excluding you) to the party, $N$, is Poisson distributed with parameter $\lambda$:
$$N\sim \text{POI}(\lambda)$$
Let's further assume that
|
42,357
|
Change threshold of classifier based on ROC
|
The Accuracy (or the area under the ROC curve) depends on the sample used to construct the ROC curve (see, e.g., How to interpret 95% confidence interval for Area Under Curve of ROC?). So if you use this ROC to optimise the threshold there is a risk of overfitting to the sample.
You can indeed "calibrate" a threshold using a hold-out data set. You might also use k-fold cross validation. The link with the ROC-curve is the fact that that there exists a link between the area under the ROC-curve and the accuracy ratio ($AR=2AUC-1$).
The Area under the ROC (AUROC or AUC) is linked to the accuracy ratio. The area under the curve can be interpreted as follows: of all possible pairs with one subject of class 1 and one subject of class 2, there is a fraction equal to AUC for which the subject in class 1 will have a better score.
This interpretation is the same when you use a random forest.
You can find more on all this in, e.g., this paper
|
Change threshold of classifier based on ROC
|
The Accuracy (or the area under the ROC curve) depends on the sample used to construct the ROC curve (see, e.g., How to interpret 95% confidence interval for Area Under Curve of ROC?). So if you use t
|
Change threshold of classifier based on ROC
The Accuracy (or the area under the ROC curve) depends on the sample used to construct the ROC curve (see, e.g., How to interpret 95% confidence interval for Area Under Curve of ROC?). So if you use this ROC to optimise the threshold there is a risk of overfitting to the sample.
You can indeed "calibrate" a threshold using a hold-out data set. You might also use k-fold cross validation. The link with the ROC-curve is the fact that that there exists a link between the area under the ROC-curve and the accuracy ratio ($AR=2AUC-1$).
The Area under the ROC (AUROC or AUC) is linked to the accuracy ratio. The area under the curve can be interpreted as follows: of all possible pairs with one subject of class 1 and one subject of class 2, there is a fraction equal to AUC for which the subject in class 1 will have a better score.
This interpretation is the same when you use a random forest.
You can find more on all this in, e.g., this paper
|
Change threshold of classifier based on ROC
The Accuracy (or the area under the ROC curve) depends on the sample used to construct the ROC curve (see, e.g., How to interpret 95% confidence interval for Area Under Curve of ROC?). So if you use t
|
42,358
|
How can I prepare the input layer for recurrent neural network if there are many categorical variables?
|
The "default" way of dealing with categorical variables for neural networks is to use embeddings. The most popular usage is word embeddings, where words are represented by vector representation (learned or pre-trained). The advantages of such approach is that it has smaller dimensionality then if you used one-hot encodings and they usually form meaningful representations of words, i.e. similar words have similar representations in the embedding space. Same idea can be applied to any other categorical variables, Sycorax gave one reference of paper by Guo and Berkhahn, but you can check also other references and this Medium post. Embeddings were used for categorical variables in Kaggle competitions, but you can also find many examples of recommender systems using such representations, for example this recent post on Google Cloud blog.
|
How can I prepare the input layer for recurrent neural network if there are many categorical variabl
|
The "default" way of dealing with categorical variables for neural networks is to use embeddings. The most popular usage is word embeddings, where words are represented by vector representation (learn
|
How can I prepare the input layer for recurrent neural network if there are many categorical variables?
The "default" way of dealing with categorical variables for neural networks is to use embeddings. The most popular usage is word embeddings, where words are represented by vector representation (learned or pre-trained). The advantages of such approach is that it has smaller dimensionality then if you used one-hot encodings and they usually form meaningful representations of words, i.e. similar words have similar representations in the embedding space. Same idea can be applied to any other categorical variables, Sycorax gave one reference of paper by Guo and Berkhahn, but you can check also other references and this Medium post. Embeddings were used for categorical variables in Kaggle competitions, but you can also find many examples of recommender systems using such representations, for example this recent post on Google Cloud blog.
|
How can I prepare the input layer for recurrent neural network if there are many categorical variabl
The "default" way of dealing with categorical variables for neural networks is to use embeddings. The most popular usage is word embeddings, where words are represented by vector representation (learn
|
42,359
|
How can I prepare the input layer for recurrent neural network if there are many categorical variables?
|
This is not my area of expertise, but my understanding is that it's a lot harder to learn on a sparse representation. You won't have many training examples for each input, so most of the neurons will be training on just a few examples.
The canonical example for RNNs would be NLP, and I think it's fairly standard to transform the input text from something sparse (e.g., a one-hot encoding of word IDs), to a dense vector embedding (e.g., word2vec). This page is pretty good:
https://www.tensorflow.org/versions/r0.8/tutorials/word2vec/index.html
In your case it's hard to say what exactly would be best without knowing more about your data. But maybe you could find some sort of vector embedding that would work for your data. Then you could capture some of its essential properties and train your RNN effectively.
|
How can I prepare the input layer for recurrent neural network if there are many categorical variabl
|
This is not my area of expertise, but my understanding is that it's a lot harder to learn on a sparse representation. You won't have many training examples for each input, so most of the neurons will
|
How can I prepare the input layer for recurrent neural network if there are many categorical variables?
This is not my area of expertise, but my understanding is that it's a lot harder to learn on a sparse representation. You won't have many training examples for each input, so most of the neurons will be training on just a few examples.
The canonical example for RNNs would be NLP, and I think it's fairly standard to transform the input text from something sparse (e.g., a one-hot encoding of word IDs), to a dense vector embedding (e.g., word2vec). This page is pretty good:
https://www.tensorflow.org/versions/r0.8/tutorials/word2vec/index.html
In your case it's hard to say what exactly would be best without knowing more about your data. But maybe you could find some sort of vector embedding that would work for your data. Then you could capture some of its essential properties and train your RNN effectively.
|
How can I prepare the input layer for recurrent neural network if there are many categorical variabl
This is not my area of expertise, but my understanding is that it's a lot harder to learn on a sparse representation. You won't have many training examples for each input, so most of the neurons will
|
42,360
|
lavaan works with `cfa`, provides error with lavaan(method = 'cfa')
|
The cfa() function is a wrapper for lavaan, which (among other things) adds the arguments
auto.fix.first = TRUE
auto.var = TRUE
Changing your model type to CFA changes a few cosmetic things, but not the basic model. Because the lavaan() command has not put these in, you need to add the arguments, or add the appropriate parameters to the model.
lavaan(model = 'latent =~ 1*ind1 + ind2 + ind3 + ind4
latent ~~ latent
ind1 ~~ ind1
ind2 ~~ ind2
ind3 ~~ ind3
ind4 ~~ ind4',
data = foo,
model.type = "cfa")
That seems like more work, but I prefer to (almost) always use the lavaan() function - the trouble with using cfa() is that it does some of the work for you, but you can forget what it has done, and what you want to do. You can therefore screw up by, say, fixing the variance of the latent to 1 AND fixing the first loading to 1 (because the second thing is done automatically, you might forget). But cfa() is much easier for simple models that you're not going to futz around with much.
|
lavaan works with `cfa`, provides error with lavaan(method = 'cfa')
|
The cfa() function is a wrapper for lavaan, which (among other things) adds the arguments
auto.fix.first = TRUE
auto.var = TRUE
Changing your model type to CFA changes a few cosmetic things, but not
|
lavaan works with `cfa`, provides error with lavaan(method = 'cfa')
The cfa() function is a wrapper for lavaan, which (among other things) adds the arguments
auto.fix.first = TRUE
auto.var = TRUE
Changing your model type to CFA changes a few cosmetic things, but not the basic model. Because the lavaan() command has not put these in, you need to add the arguments, or add the appropriate parameters to the model.
lavaan(model = 'latent =~ 1*ind1 + ind2 + ind3 + ind4
latent ~~ latent
ind1 ~~ ind1
ind2 ~~ ind2
ind3 ~~ ind3
ind4 ~~ ind4',
data = foo,
model.type = "cfa")
That seems like more work, but I prefer to (almost) always use the lavaan() function - the trouble with using cfa() is that it does some of the work for you, but you can forget what it has done, and what you want to do. You can therefore screw up by, say, fixing the variance of the latent to 1 AND fixing the first loading to 1 (because the second thing is done automatically, you might forget). But cfa() is much easier for simple models that you're not going to futz around with much.
|
lavaan works with `cfa`, provides error with lavaan(method = 'cfa')
The cfa() function is a wrapper for lavaan, which (among other things) adds the arguments
auto.fix.first = TRUE
auto.var = TRUE
Changing your model type to CFA changes a few cosmetic things, but not
|
42,361
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
|
I'm providing second answer since it is either: problem formulation that is unclear, or the answer provided by OP is wrong, since it does not address the problem. In my answer I'll try to refer to both of the cases.
First, let's try to define the problem. You have rankings of restaurants based on votes, where each vote is either "like" coded as $1$, or "dislike" coded as $0$. This means that we are dealing with Bernoulli distributed random variable. If you count the number of "likes", you have binomial distribution with $k_i$ likes per $n_i$ votes, for $i$-th restaurant. You are interested in the probability of restaurant being "good", $\theta_i$. The simple estimate of $\theta_i$ is $k_i/n_i$ (likes/votes), but as you already noticed, this does not account for the fact then restaurants differ in the number of votes they got, so some rankings are more reliable than others.
This problem may be formulated in terms of beta-binomial model, where we use conjugate beta prior for binomial likelihood function. In such case we define our model as follows
$$ \theta_i \sim \mathrm{Beta}(\alpha, \beta) $$
$$ k_i \sim \mathrm{Binomial}(n_i, \theta_i) $$
so we assume beta prior for $\theta_i$ parametrized by $\alpha$ and $\beta$. This is a Bayesian model, so you can recall that Bayesian model is defined in terms of likelihood and prior, that both taken together tell you about posterior probability of your parameter given the data and priors
$$ \color{violet}{\text{posterior}} \propto \color{red}{\text{prior}} \times \color{lightblue}{\text{likelihood}} $$
This means that the prior information you include in your model may influence the results, however the more information your data contain (relative to the prior), the more likely it is going to overcome the information contained in the prior.
So choosing a prior means making a subjective decision that can possibly affect your model (this is why Bayesian approach was criticized by some). Of course, you can make such choice of prior that brings as little as possible information into the model and let's "the data talk", i.e. weekly informative prior (there is no such a thing as "uninformative" prior). In case of beta-binomial model, you can choose for that beta distribution with parameters $\alpha = \beta = 1$, that leads to uniform prior. This means that you assume that $\theta_i$ can be any value between $0$ and $1$ with equal probability. Such assumption does not seem to bring much subjectivity into the model, but notice that what follows is that you assume a priori that $\theta_i$ has mean
$$ \frac{\alpha}{\alpha+\beta} = \frac{1}{1+1} = 0.5 $$
since this is the mean of $\mathrm{Beta}(1, 1)$ distribution. So if you have no data at all, then you "estimate" the ranking to be $0.5$.
Until now, we had no data for discussing this question so let me make up some data. Say that in your database you have in total $N=53480$ votes, where $K=34561$ are "likes" ($65\%$). As examples I'll use three restaurants:
# likes votes
1 1 1
2 3 4
3 19 25
Under beta prior the posterior mean is
$$ \frac{\alpha + k_i}{\alpha+ k_i + \beta + n_i - k_i} = \frac{\alpha + k_i}{\alpha + \beta + n_i} $$
So under $\alpha = \beta = 1$ parameters you would estimate posterior means $\bar \theta_1 = 0.66$, $\bar \theta_2 = 0.66$, and $\bar \theta_3 = 0.74$ (blue lines on the plots below, where violet lines mark simple estimates $k_i/n_i$). You can notice when we do not have much data (much information), the posterior means are shrinked towards the prior means.
You may be however interested in using informative prior, i.e. bringing some out-of-data information into your model. One such choice would be to center your beta distribution on global mean, with $\alpha$ and $\beta$ chosen in proportionally to how much you want to insist on your prior mean (how strongly would your prior shrink posterior towards it), as in the link that you posted. The more informative you make your model, the more influence it would have on your results. Unfortunately, since the final result depends on both your data and the prior, there is no single valid choice for the parameters, since they will always be problem-specific. On the plot below you can see different such choices.
You may think of setting prior mean to $K/N$ (global mean) and sample size to $N-K$ (the sample values calculated as in the link you posted), but with choosing such prior you would need more data then is in the whole database to make your posterior estimate close to the arithmetic mean and this does not sound reasonable.
In both cases (weakly informative and informative priors), you would end up with totally valid Bayesian estimates (in fact, "handbook" examples), but the choice of $\alpha$ and $\beta$ is subjective and even if you decide for a weekly informative prior, so you still bring some a priori information in your model.
While this approach "works", there are few problems connected to your needs as described in the question:
It does not account for the fact that restaurants differ in the number of votes, so it does not correct for their reliability. When using weakly informative prior $\alpha = \beta = 1$, for very small counts of votes the results will be influenced by prior and shrinked towards $0.5$, but that is all. When using informative prior, results will be shrinked towards the prior mean, but this leads to further complications (see below).
While in case of IMBD estimator you need to specify single parameter $m$, in case of beta-binomial model, you need to decide about two parameters. This does not seem to simplify your problem. Of course, you can re-define beta distribution to be parametrized by mean and sample size (or precision), as in the link you posted, but this still does not help with the fact that you need to make a subjective choice about it. In fact, choosing $m$ for the IMDB estimator is also about how many votes you consider as reliable, so it is also about quantifying your certainty.
In fact, in case of IMDB estimator the choice of $m$ parameter is more obvious since it tells you simply that one vote counts as $1/m$ pseudo-votes equal to global mean, what makes deciding about the parameter actually easier.
Finally, choosing $\alpha$ and $\beta$ parameters in beta-binomial model does not help you anyhow in choosing the $m$ parameter in the IMDB estimator since both methods work differently.
So while there is no reason why choosing beta-binomial model would be a bad choice, it does not solve the the problem of deciding about the parameter.
Briefly commenting on other choices you considered:
Adding two successes and two failures as in Agresti-Coull estimator for confidence intervals does not differ that much from the beta-binomial model described above.
In the Wikipedia page about naive Bayes spam filtering they mention adding 3 to the results calling it "good value", but they do not provide any reference for that suggestion and any rationale behind it, so I do not see any reason for treating it seriously. I guess it is connected to smoothing the data that is often done when working with language data, but I don't think it relates to your problem.
Using $m=30$ because sample size of $30$ was described in old textbooks as a rule of thumb for central limit theorem is not a good choice. First, the choice of $30$ was pretty arbitrary. Second, central limit theorem says nothing about "goodness" of the data (check What intuitive explanation is there for the central limit theorem?).
You ask why IMDB used $m=3000$. I guess they decided on it either by observing something like "80% of the movies have number of votes above it", or by making research that has shown that this value is optimal (e.g. makes their rankings correlate with some external criteria, as described in my first answer).
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
|
I'm providing second answer since it is either: problem formulation that is unclear, or the answer provided by OP is wrong, since it does not address the problem. In my answer I'll try to refer to bot
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
I'm providing second answer since it is either: problem formulation that is unclear, or the answer provided by OP is wrong, since it does not address the problem. In my answer I'll try to refer to both of the cases.
First, let's try to define the problem. You have rankings of restaurants based on votes, where each vote is either "like" coded as $1$, or "dislike" coded as $0$. This means that we are dealing with Bernoulli distributed random variable. If you count the number of "likes", you have binomial distribution with $k_i$ likes per $n_i$ votes, for $i$-th restaurant. You are interested in the probability of restaurant being "good", $\theta_i$. The simple estimate of $\theta_i$ is $k_i/n_i$ (likes/votes), but as you already noticed, this does not account for the fact then restaurants differ in the number of votes they got, so some rankings are more reliable than others.
This problem may be formulated in terms of beta-binomial model, where we use conjugate beta prior for binomial likelihood function. In such case we define our model as follows
$$ \theta_i \sim \mathrm{Beta}(\alpha, \beta) $$
$$ k_i \sim \mathrm{Binomial}(n_i, \theta_i) $$
so we assume beta prior for $\theta_i$ parametrized by $\alpha$ and $\beta$. This is a Bayesian model, so you can recall that Bayesian model is defined in terms of likelihood and prior, that both taken together tell you about posterior probability of your parameter given the data and priors
$$ \color{violet}{\text{posterior}} \propto \color{red}{\text{prior}} \times \color{lightblue}{\text{likelihood}} $$
This means that the prior information you include in your model may influence the results, however the more information your data contain (relative to the prior), the more likely it is going to overcome the information contained in the prior.
So choosing a prior means making a subjective decision that can possibly affect your model (this is why Bayesian approach was criticized by some). Of course, you can make such choice of prior that brings as little as possible information into the model and let's "the data talk", i.e. weekly informative prior (there is no such a thing as "uninformative" prior). In case of beta-binomial model, you can choose for that beta distribution with parameters $\alpha = \beta = 1$, that leads to uniform prior. This means that you assume that $\theta_i$ can be any value between $0$ and $1$ with equal probability. Such assumption does not seem to bring much subjectivity into the model, but notice that what follows is that you assume a priori that $\theta_i$ has mean
$$ \frac{\alpha}{\alpha+\beta} = \frac{1}{1+1} = 0.5 $$
since this is the mean of $\mathrm{Beta}(1, 1)$ distribution. So if you have no data at all, then you "estimate" the ranking to be $0.5$.
Until now, we had no data for discussing this question so let me make up some data. Say that in your database you have in total $N=53480$ votes, where $K=34561$ are "likes" ($65\%$). As examples I'll use three restaurants:
# likes votes
1 1 1
2 3 4
3 19 25
Under beta prior the posterior mean is
$$ \frac{\alpha + k_i}{\alpha+ k_i + \beta + n_i - k_i} = \frac{\alpha + k_i}{\alpha + \beta + n_i} $$
So under $\alpha = \beta = 1$ parameters you would estimate posterior means $\bar \theta_1 = 0.66$, $\bar \theta_2 = 0.66$, and $\bar \theta_3 = 0.74$ (blue lines on the plots below, where violet lines mark simple estimates $k_i/n_i$). You can notice when we do not have much data (much information), the posterior means are shrinked towards the prior means.
You may be however interested in using informative prior, i.e. bringing some out-of-data information into your model. One such choice would be to center your beta distribution on global mean, with $\alpha$ and $\beta$ chosen in proportionally to how much you want to insist on your prior mean (how strongly would your prior shrink posterior towards it), as in the link that you posted. The more informative you make your model, the more influence it would have on your results. Unfortunately, since the final result depends on both your data and the prior, there is no single valid choice for the parameters, since they will always be problem-specific. On the plot below you can see different such choices.
You may think of setting prior mean to $K/N$ (global mean) and sample size to $N-K$ (the sample values calculated as in the link you posted), but with choosing such prior you would need more data then is in the whole database to make your posterior estimate close to the arithmetic mean and this does not sound reasonable.
In both cases (weakly informative and informative priors), you would end up with totally valid Bayesian estimates (in fact, "handbook" examples), but the choice of $\alpha$ and $\beta$ is subjective and even if you decide for a weekly informative prior, so you still bring some a priori information in your model.
While this approach "works", there are few problems connected to your needs as described in the question:
It does not account for the fact that restaurants differ in the number of votes, so it does not correct for their reliability. When using weakly informative prior $\alpha = \beta = 1$, for very small counts of votes the results will be influenced by prior and shrinked towards $0.5$, but that is all. When using informative prior, results will be shrinked towards the prior mean, but this leads to further complications (see below).
While in case of IMBD estimator you need to specify single parameter $m$, in case of beta-binomial model, you need to decide about two parameters. This does not seem to simplify your problem. Of course, you can re-define beta distribution to be parametrized by mean and sample size (or precision), as in the link you posted, but this still does not help with the fact that you need to make a subjective choice about it. In fact, choosing $m$ for the IMDB estimator is also about how many votes you consider as reliable, so it is also about quantifying your certainty.
In fact, in case of IMDB estimator the choice of $m$ parameter is more obvious since it tells you simply that one vote counts as $1/m$ pseudo-votes equal to global mean, what makes deciding about the parameter actually easier.
Finally, choosing $\alpha$ and $\beta$ parameters in beta-binomial model does not help you anyhow in choosing the $m$ parameter in the IMDB estimator since both methods work differently.
So while there is no reason why choosing beta-binomial model would be a bad choice, it does not solve the the problem of deciding about the parameter.
Briefly commenting on other choices you considered:
Adding two successes and two failures as in Agresti-Coull estimator for confidence intervals does not differ that much from the beta-binomial model described above.
In the Wikipedia page about naive Bayes spam filtering they mention adding 3 to the results calling it "good value", but they do not provide any reference for that suggestion and any rationale behind it, so I do not see any reason for treating it seriously. I guess it is connected to smoothing the data that is often done when working with language data, but I don't think it relates to your problem.
Using $m=30$ because sample size of $30$ was described in old textbooks as a rule of thumb for central limit theorem is not a good choice. First, the choice of $30$ was pretty arbitrary. Second, central limit theorem says nothing about "goodness" of the data (check What intuitive explanation is there for the central limit theorem?).
You ask why IMDB used $m=3000$. I guess they decided on it either by observing something like "80% of the movies have number of votes above it", or by making research that has shown that this value is optimal (e.g. makes their rankings correlate with some external criteria, as described in my first answer).
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
I'm providing second answer since it is either: problem formulation that is unclear, or the answer provided by OP is wrong, since it does not address the problem. In my answer I'll try to refer to bot
|
42,362
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
|
The IMDB ratings example is a simple one, so you are right that in many cases they get more complicated.
Actually, the answer to your question is already given in the Wikipedia entry:
Note that $W$ is just the weighted arithmetic mean of $R$ and $C$ with
weight vector $(v, m)$. As the number of ratings surpasses $m$, the
confidence of the average rating surpasses the confidence of the prior
knowledge, and the weighted bayesian rating ($W$) approaches a
straight average ($R$). The closer $v$ (the number of ratings for the
film) is to zero, the closer $W$ gets to $C$, where $W$ is the weighted
rating and $C$ is the average rating of all films. So, in simpler terms,
films with very few ratings/votes will have a rating weighted towards
the average across all films, while films with many ratings/votes will
have a rating weighted towards its average rating.
So in the formula
$$ W = {Rv + Cm\over v+m} $$
$m$ is prior information or belief. Saying it in plain English: by default the movies are rated closer to overall average of votes for all of the movies $C$, but as they grab more votes, they get closer and closer to average of their votes $R$. By specifying $m$ you decide about the threshold. There is no "good", or "bad" choices since it is a subjective choice based on how heavy you want the overall average $C$ to weight on your estimate. You simply state that one real vote counts as $1/m$ pseudo-votes based on overall average. It is called prior because it is based on a priori, out-of-data information -- it may be based on your beliefs, some previous experiments that suggest so, expert opinions, etc. It is one of the core aspects of Bayesian approach that you include such out-of-data information in your model. There is simply no objective criterion saying something like "4 ratings are not trustworthy, but 5 are", stating something like this would be ridiculous, so you are forced to make some arbitrary decision on it.
This estimator is designed to have threshold that can be flexibly adapted to your needs. For example, if your site has on average 1000 ratings per item, you do not want to threat items with 5, 10, or even 100 ratings as equally reliable as the majority.
Of course, you can always try to find optimal $m$ that maximizes some optimality criterion, e.g. correlation of ratings with movie theater's ticket sales, but then it would be hard to call it prior since it'd be just some unknown parameter to maximize. Then it also wouldn't be a Bayesian estimator. If the subjective aspect of this method does not appeal to you, you can always use arithmetic mean of the ratings, i.e. $m=0$. This does not use any arbitrary threshold.
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
|
The IMDB ratings example is a simple one, so you are right that in many cases they get more complicated.
Actually, the answer to your question is already given in the Wikipedia entry:
Note that $W$ i
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
The IMDB ratings example is a simple one, so you are right that in many cases they get more complicated.
Actually, the answer to your question is already given in the Wikipedia entry:
Note that $W$ is just the weighted arithmetic mean of $R$ and $C$ with
weight vector $(v, m)$. As the number of ratings surpasses $m$, the
confidence of the average rating surpasses the confidence of the prior
knowledge, and the weighted bayesian rating ($W$) approaches a
straight average ($R$). The closer $v$ (the number of ratings for the
film) is to zero, the closer $W$ gets to $C$, where $W$ is the weighted
rating and $C$ is the average rating of all films. So, in simpler terms,
films with very few ratings/votes will have a rating weighted towards
the average across all films, while films with many ratings/votes will
have a rating weighted towards its average rating.
So in the formula
$$ W = {Rv + Cm\over v+m} $$
$m$ is prior information or belief. Saying it in plain English: by default the movies are rated closer to overall average of votes for all of the movies $C$, but as they grab more votes, they get closer and closer to average of their votes $R$. By specifying $m$ you decide about the threshold. There is no "good", or "bad" choices since it is a subjective choice based on how heavy you want the overall average $C$ to weight on your estimate. You simply state that one real vote counts as $1/m$ pseudo-votes based on overall average. It is called prior because it is based on a priori, out-of-data information -- it may be based on your beliefs, some previous experiments that suggest so, expert opinions, etc. It is one of the core aspects of Bayesian approach that you include such out-of-data information in your model. There is simply no objective criterion saying something like "4 ratings are not trustworthy, but 5 are", stating something like this would be ridiculous, so you are forced to make some arbitrary decision on it.
This estimator is designed to have threshold that can be flexibly adapted to your needs. For example, if your site has on average 1000 ratings per item, you do not want to threat items with 5, 10, or even 100 ratings as equally reliable as the majority.
Of course, you can always try to find optimal $m$ that maximizes some optimality criterion, e.g. correlation of ratings with movie theater's ticket sales, but then it would be hard to call it prior since it'd be just some unknown parameter to maximize. Then it also wouldn't be a Bayesian estimator. If the subjective aspect of this method does not appeal to you, you can always use arithmetic mean of the ratings, i.e. $m=0$. This does not use any arbitrary threshold.
|
Weighted arithmetic mean weight choice in a simplified Bayes estimator
The IMDB ratings example is a simple one, so you are right that in many cases they get more complicated.
Actually, the answer to your question is already given in the Wikipedia entry:
Note that $W$ i
|
42,363
|
Maximum entropy distribution of a proportion with known mean and variance? Is it a beta?
|
It's a truncated Normal distribution. This is a consequence of Boltzmann's Theorem.
The following analysis provides the details needed to implement a practical solution.
A Normal$(\mu,\sigma)$ distribution $F$ truncated to the interval $[0,1]$ arises by taking a standard Normal variable $X$ with probability distribution $\Phi$, scaling it by $\sigma$, shifting it to $\mu$, and truncating it to $[0,1]$. Equivalently--working backwards--the original variable $X$ must have been truncated to the interval $[-\mu/\sigma, (1-\mu)/\sigma]$ where it had a total probability of
$$C = \Phi\left(\frac{1-\mu}{\sigma}\right) - \Phi\left(\frac{-\mu}{\sigma}\right),\tag{1}$$
expectation
$$\mu_1=\frac{1}{C\sqrt{2\pi}}\int_\frac{-\mu}{\sigma}^\frac{1-\mu}{\sigma} x\exp\left(\frac{-x^2}{2}\right)\mathrm{d}x,$$
and second (raw) moment
$$\mu_2 = \frac{1}{C\sqrt{2\pi}}\int_\frac{-\mu}{\sigma}^\frac{1-\mu}{\sigma} x^2\exp\left(\frac{-x^2}{2}\right)\mathrm{d}x.$$
Presumably your "standard error" is either $\sqrt{\mu_2-\mu_1^2}$ or some constant multiple of it.
These integrals can be computed in terms of
$$\mu_1(z) = \frac{1}{C\sqrt{2\pi}}\int_{-\infty}^z x\exp\left(\frac{-x^2}{2}\right)\mathrm{d}x = -\frac{1}{C\sqrt{2\pi}}\exp\left(-\frac{z^2}{2}\right)\tag{2}$$
and, integrating by parts,
$$\eqalign{
\mu_2(z) &= \frac{1}{C\sqrt{2\pi}}\int_{-\infty}^z (x)\left(x\exp\left(\frac{-x^2}{2}\right)\right)\mathrm{d}x \\
&= \frac{1}{C\sqrt{2\pi}}\left(x\left(-\exp\left(-\frac{x^2}{2}\right)\right)\mid_{-\infty}^z - \int_{-\infty}^z -\exp\left(-\frac{x^2}{2}\right)\mathrm{d}x \right)\\
&=-\frac{1}{C\sqrt{2\pi}}z\exp\left(-\frac{z^2}{2}\right) + \frac{1}{C}\Phi(z)\tag{3}.
}$$
Thus
$$\mu_1 = \mu_1\left(\frac{1-\mu}{\sigma}\right) - \mu_1\left(\frac{-\mu}{\sigma}\right)$$
and
$$\mu_2 = \mu_2\left(\frac{1-\mu}{\sigma}\right) - \mu_2\left(\frac{-\mu}{\sigma}\right).$$
These calculations $(1)$, $(2)$, and $(3)$ can be implemented in any software where exponentials, square roots, and $\Phi$ are available. This permits application in any fitting procedure, such as method of moments or maximum likelihood. Either would require numerical solutions.
|
Maximum entropy distribution of a proportion with known mean and variance? Is it a beta?
|
It's a truncated Normal distribution. This is a consequence of Boltzmann's Theorem.
The following analysis provides the details needed to implement a practical solution.
A Normal$(\mu,\sigma)$ distr
|
Maximum entropy distribution of a proportion with known mean and variance? Is it a beta?
It's a truncated Normal distribution. This is a consequence of Boltzmann's Theorem.
The following analysis provides the details needed to implement a practical solution.
A Normal$(\mu,\sigma)$ distribution $F$ truncated to the interval $[0,1]$ arises by taking a standard Normal variable $X$ with probability distribution $\Phi$, scaling it by $\sigma$, shifting it to $\mu$, and truncating it to $[0,1]$. Equivalently--working backwards--the original variable $X$ must have been truncated to the interval $[-\mu/\sigma, (1-\mu)/\sigma]$ where it had a total probability of
$$C = \Phi\left(\frac{1-\mu}{\sigma}\right) - \Phi\left(\frac{-\mu}{\sigma}\right),\tag{1}$$
expectation
$$\mu_1=\frac{1}{C\sqrt{2\pi}}\int_\frac{-\mu}{\sigma}^\frac{1-\mu}{\sigma} x\exp\left(\frac{-x^2}{2}\right)\mathrm{d}x,$$
and second (raw) moment
$$\mu_2 = \frac{1}{C\sqrt{2\pi}}\int_\frac{-\mu}{\sigma}^\frac{1-\mu}{\sigma} x^2\exp\left(\frac{-x^2}{2}\right)\mathrm{d}x.$$
Presumably your "standard error" is either $\sqrt{\mu_2-\mu_1^2}$ or some constant multiple of it.
These integrals can be computed in terms of
$$\mu_1(z) = \frac{1}{C\sqrt{2\pi}}\int_{-\infty}^z x\exp\left(\frac{-x^2}{2}\right)\mathrm{d}x = -\frac{1}{C\sqrt{2\pi}}\exp\left(-\frac{z^2}{2}\right)\tag{2}$$
and, integrating by parts,
$$\eqalign{
\mu_2(z) &= \frac{1}{C\sqrt{2\pi}}\int_{-\infty}^z (x)\left(x\exp\left(\frac{-x^2}{2}\right)\right)\mathrm{d}x \\
&= \frac{1}{C\sqrt{2\pi}}\left(x\left(-\exp\left(-\frac{x^2}{2}\right)\right)\mid_{-\infty}^z - \int_{-\infty}^z -\exp\left(-\frac{x^2}{2}\right)\mathrm{d}x \right)\\
&=-\frac{1}{C\sqrt{2\pi}}z\exp\left(-\frac{z^2}{2}\right) + \frac{1}{C}\Phi(z)\tag{3}.
}$$
Thus
$$\mu_1 = \mu_1\left(\frac{1-\mu}{\sigma}\right) - \mu_1\left(\frac{-\mu}{\sigma}\right)$$
and
$$\mu_2 = \mu_2\left(\frac{1-\mu}{\sigma}\right) - \mu_2\left(\frac{-\mu}{\sigma}\right).$$
These calculations $(1)$, $(2)$, and $(3)$ can be implemented in any software where exponentials, square roots, and $\Phi$ are available. This permits application in any fitting procedure, such as method of moments or maximum likelihood. Either would require numerical solutions.
|
Maximum entropy distribution of a proportion with known mean and variance? Is it a beta?
It's a truncated Normal distribution. This is a consequence of Boltzmann's Theorem.
The following analysis provides the details needed to implement a practical solution.
A Normal$(\mu,\sigma)$ distr
|
42,364
|
Do Bayesians use the terminology "statistically significant"?
|
This issue doesn't come up often because when people use fully Bayesian methods, they don't usually create a null hypothesis and then make a choice on the basis of a hard threshold of relative probability, as you have. After all, a lot of the motivation for using Bayesian methods is to avoid such things.
I'd recommend avoiding the various forms of the word "significant" to avoid any confusion, although the analogy with classical null-hypothesis significance testing is clear, and is worth pointing out in your paper. Just say something like "Using the decision rule specified by Equation 2, I accepted $H_a$."
|
Do Bayesians use the terminology "statistically significant"?
|
This issue doesn't come up often because when people use fully Bayesian methods, they don't usually create a null hypothesis and then make a choice on the basis of a hard threshold of relative probabi
|
Do Bayesians use the terminology "statistically significant"?
This issue doesn't come up often because when people use fully Bayesian methods, they don't usually create a null hypothesis and then make a choice on the basis of a hard threshold of relative probability, as you have. After all, a lot of the motivation for using Bayesian methods is to avoid such things.
I'd recommend avoiding the various forms of the word "significant" to avoid any confusion, although the analogy with classical null-hypothesis significance testing is clear, and is worth pointing out in your paper. Just say something like "Using the decision rule specified by Equation 2, I accepted $H_a$."
|
Do Bayesians use the terminology "statistically significant"?
This issue doesn't come up often because when people use fully Bayesian methods, they don't usually create a null hypothesis and then make a choice on the basis of a hard threshold of relative probabi
|
42,365
|
Do Bayesians use the terminology "statistically significant"?
|
Not really. Bayesian testing is very liberating for statisticians and non-statisticians. A distinction, and one which frequentists should consider, is the point of being rigorous in apriori specifying decision rules, or alternative hypotheses of interest. It allows one to report the results of a trial or study in terms of "We have $Pr(H_a | X)$ belief that $H_a$ is true" if a suitable, possibly informative prior has been chosen for $Pr(H_a)$.
If one insists that a declaration of "statistical significance" is really, truly, honestly necessary (which it usually never is), a decision theoretic approach can be used to make this rigorous. This is analagous to the Neyman-Pearson method of testing. If one defines a loss function, for choosing $H_a$ over $H_0$, or vice versa, one can report which decision has a minimal loss, which is informed by the data as well as some decisions about the cost of type I and type II errors.
An analogous approach to Fisherian testing is using Bayes factors. Bayes factors are useful to report for statistical tests, and more closely resemble classic hypothesis testing via $p$-value without comparing it to any arbitrary $\alpha$ threshold. Again this benefits from an appropriately stated alternative hypothesis and prior for the decision. A Bayes factor again, is a reflection of belief, whereas for frequentists probability is considered a frequency.
|
Do Bayesians use the terminology "statistically significant"?
|
Not really. Bayesian testing is very liberating for statisticians and non-statisticians. A distinction, and one which frequentists should consider, is the point of being rigorous in apriori specifying
|
Do Bayesians use the terminology "statistically significant"?
Not really. Bayesian testing is very liberating for statisticians and non-statisticians. A distinction, and one which frequentists should consider, is the point of being rigorous in apriori specifying decision rules, or alternative hypotheses of interest. It allows one to report the results of a trial or study in terms of "We have $Pr(H_a | X)$ belief that $H_a$ is true" if a suitable, possibly informative prior has been chosen for $Pr(H_a)$.
If one insists that a declaration of "statistical significance" is really, truly, honestly necessary (which it usually never is), a decision theoretic approach can be used to make this rigorous. This is analagous to the Neyman-Pearson method of testing. If one defines a loss function, for choosing $H_a$ over $H_0$, or vice versa, one can report which decision has a minimal loss, which is informed by the data as well as some decisions about the cost of type I and type II errors.
An analogous approach to Fisherian testing is using Bayes factors. Bayes factors are useful to report for statistical tests, and more closely resemble classic hypothesis testing via $p$-value without comparing it to any arbitrary $\alpha$ threshold. Again this benefits from an appropriately stated alternative hypothesis and prior for the decision. A Bayes factor again, is a reflection of belief, whereas for frequentists probability is considered a frequency.
|
Do Bayesians use the terminology "statistically significant"?
Not really. Bayesian testing is very liberating for statisticians and non-statisticians. A distinction, and one which frequentists should consider, is the point of being rigorous in apriori specifying
|
42,366
|
Is the Scheffé test of contrasts the "best-case" for post-hoc tests?
|
Firstly, there are many tests and each one has its good and bad sides over another test. Some of the most basic tests are Tukey's, Bonferroni's and Scheffés, so we can compare and contrast these to understand what goes into choosing a test.
A useful explanation of choosing between tests (http://www.itl.nist.gov/div898/handbook/prc/section4/prc473.htm):
If all pairwise comparisons are of interest, Tukey has the edge. If
only a subset of pairwise comparisons are required, Bonferroni may
sometimes be better.
When the number of contrasts to be estimated is small, (about as
many as there are factors) Bonferroni is better than Scheffé.
Actually, unless the number of desired contrasts is at least twice
the number of factors, Scheffé will always show wider confidence
bands than Bonferroni.
Many computer packages include all three methods. So, study the
output and select the method with the smallest confidence band. edit: (This is listed in the source but is likely not a good idea).
No single method of multiple comparisons is uniformly best among all
the methods.
Here is a simplified decision tree for choosing the correct test (http://www.statsdirect.com/help/content/analysis_of_variance/multiple_comparisons.htm):
pairwise
equal group sizes: Tukey
unequal group sizes: Tukey-Kramer or Scheffé's
not pairwise
planned: Bonferroni
not planned: Scheffé's
Tangent:
In addition, you need to understand the difference between planned and unplanned comparisons. If you know every comparison that you want to compare then you can use a planned comparison test like Tukey and Bonferroni. If you think you may need to do some of the notorious data snooping then you can at least adjust for the unplanned comparisons with Scheffé's method.
(Tukey: http://www.itl.nist.gov/div898/handbook/prc/section4/prc471.htm,
Bonferroni: http://www.itl.nist.gov/div898/handbook/prc/section4/prc473.htm,
Scheffé: http://www.itl.nist.gov/div898/handbook/prc/section4/prc472.htm)
In general, do not data snoop (unplanned comparisons) if possible. You need to understand what you are looking for (planned comparisons) and should consult with a professional statistician before deciding what test would be best. Also, an understanding of the data you are testing will allow you to do specific comparisons and thus allow you to use a specific test that gives you the most narrow confidence interval (detect differences) while being statistically correct.
|
Is the Scheffé test of contrasts the "best-case" for post-hoc tests?
|
Firstly, there are many tests and each one has its good and bad sides over another test. Some of the most basic tests are Tukey's, Bonferroni's and Scheffés, so we can compare and contrast these to un
|
Is the Scheffé test of contrasts the "best-case" for post-hoc tests?
Firstly, there are many tests and each one has its good and bad sides over another test. Some of the most basic tests are Tukey's, Bonferroni's and Scheffés, so we can compare and contrast these to understand what goes into choosing a test.
A useful explanation of choosing between tests (http://www.itl.nist.gov/div898/handbook/prc/section4/prc473.htm):
If all pairwise comparisons are of interest, Tukey has the edge. If
only a subset of pairwise comparisons are required, Bonferroni may
sometimes be better.
When the number of contrasts to be estimated is small, (about as
many as there are factors) Bonferroni is better than Scheffé.
Actually, unless the number of desired contrasts is at least twice
the number of factors, Scheffé will always show wider confidence
bands than Bonferroni.
Many computer packages include all three methods. So, study the
output and select the method with the smallest confidence band. edit: (This is listed in the source but is likely not a good idea).
No single method of multiple comparisons is uniformly best among all
the methods.
Here is a simplified decision tree for choosing the correct test (http://www.statsdirect.com/help/content/analysis_of_variance/multiple_comparisons.htm):
pairwise
equal group sizes: Tukey
unequal group sizes: Tukey-Kramer or Scheffé's
not pairwise
planned: Bonferroni
not planned: Scheffé's
Tangent:
In addition, you need to understand the difference between planned and unplanned comparisons. If you know every comparison that you want to compare then you can use a planned comparison test like Tukey and Bonferroni. If you think you may need to do some of the notorious data snooping then you can at least adjust for the unplanned comparisons with Scheffé's method.
(Tukey: http://www.itl.nist.gov/div898/handbook/prc/section4/prc471.htm,
Bonferroni: http://www.itl.nist.gov/div898/handbook/prc/section4/prc473.htm,
Scheffé: http://www.itl.nist.gov/div898/handbook/prc/section4/prc472.htm)
In general, do not data snoop (unplanned comparisons) if possible. You need to understand what you are looking for (planned comparisons) and should consult with a professional statistician before deciding what test would be best. Also, an understanding of the data you are testing will allow you to do specific comparisons and thus allow you to use a specific test that gives you the most narrow confidence interval (detect differences) while being statistically correct.
|
Is the Scheffé test of contrasts the "best-case" for post-hoc tests?
Firstly, there are many tests and each one has its good and bad sides over another test. Some of the most basic tests are Tukey's, Bonferroni's and Scheffés, so we can compare and contrast these to un
|
42,367
|
Relationship between Linear Projection and OLS Regression
|
Another formulation of the $\beta$ regression parameter estimator is as
$\hat{\beta} = \left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^T Y$
Here $\hat{\beta}$ is a two element vector of $\hat{\beta}_0$ the intercept and $\hat{\beta}_1$ the slope. I like to use $\mathbf{X}$ notationally as a design matrix with the principal column a vector of 1s.
It's easy to see the crossproducts have a factor of $n$ that cancels out in these operations. WLOG we may assume that the random component(s) of $\mathbf{X}$ are centered, you have:
$\mbox{Cov} (\mathbf{X}) = \frac{1}{n}\left( \mathbf{X}^T \mathbf{X} \right) $
and
$\mbox{Cov} (\mathbf{X}, Y) = \frac{1}{n}\left( \mathbf{X}^T Y \right) $
Therefore the least squares estimator can be expressed as $\beta_1 = E(\hat{\beta}_1) = \mbox{Cov}(X, Y) / \mbox{Var} (X)$ for univariate models.
The projection matrix is formulated as $ P = \mathbf{X}\left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^T$ and the predicted values of $Y$ (e.g. $\hat{Y}$) are given by:
$\hat{Y} = PY = \mathbf{X}\left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^TY = \mathbf{X} \hat{\beta}$
and you'll see it's a projection. All predicted values of $Y$ are formed using a linear combination of vectors of $\mathbf{X}$ e.g. they span the basis of $\mathbf{X}$. The projection specifically "projects" the values of $Y$ onto the fitted values $\hat{Y}$.
The author has formulated the fitted value or conditional mean function using unusual notation $L(y | 1, x)$ is basically equivalent to $\hat{Y}$
Alternately, the hat matrix, or influence matrix, is $H = \mathcal{I} - P$ and the residuals are given by $r = HY$.
Reference: Seber, Lee 2nd edition 1990.
|
Relationship between Linear Projection and OLS Regression
|
Another formulation of the $\beta$ regression parameter estimator is as
$\hat{\beta} = \left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^T Y$
Here $\hat{\beta}$ is a two element vector of $\hat{\be
|
Relationship between Linear Projection and OLS Regression
Another formulation of the $\beta$ regression parameter estimator is as
$\hat{\beta} = \left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^T Y$
Here $\hat{\beta}$ is a two element vector of $\hat{\beta}_0$ the intercept and $\hat{\beta}_1$ the slope. I like to use $\mathbf{X}$ notationally as a design matrix with the principal column a vector of 1s.
It's easy to see the crossproducts have a factor of $n$ that cancels out in these operations. WLOG we may assume that the random component(s) of $\mathbf{X}$ are centered, you have:
$\mbox{Cov} (\mathbf{X}) = \frac{1}{n}\left( \mathbf{X}^T \mathbf{X} \right) $
and
$\mbox{Cov} (\mathbf{X}, Y) = \frac{1}{n}\left( \mathbf{X}^T Y \right) $
Therefore the least squares estimator can be expressed as $\beta_1 = E(\hat{\beta}_1) = \mbox{Cov}(X, Y) / \mbox{Var} (X)$ for univariate models.
The projection matrix is formulated as $ P = \mathbf{X}\left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^T$ and the predicted values of $Y$ (e.g. $\hat{Y}$) are given by:
$\hat{Y} = PY = \mathbf{X}\left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^TY = \mathbf{X} \hat{\beta}$
and you'll see it's a projection. All predicted values of $Y$ are formed using a linear combination of vectors of $\mathbf{X}$ e.g. they span the basis of $\mathbf{X}$. The projection specifically "projects" the values of $Y$ onto the fitted values $\hat{Y}$.
The author has formulated the fitted value or conditional mean function using unusual notation $L(y | 1, x)$ is basically equivalent to $\hat{Y}$
Alternately, the hat matrix, or influence matrix, is $H = \mathcal{I} - P$ and the residuals are given by $r = HY$.
Reference: Seber, Lee 2nd edition 1990.
|
Relationship between Linear Projection and OLS Regression
Another formulation of the $\beta$ regression parameter estimator is as
$\hat{\beta} = \left(\mathbf{X}^T\mathbf{X}\right)^{-1} \mathbf{X}^T Y$
Here $\hat{\beta}$ is a two element vector of $\hat{\be
|
42,368
|
Relationship between Linear Projection and OLS Regression
|
We start with the population model:
$$\begin{aligned}y &=E(y|{\bf x)}+e \\ E(e|{\bf x}) &=0 \end{aligned}$$
where $m({\bf x})=E(y|x)$ is the conditional expectation function (CEF) and e is the CEF error. It is important to note that the equations above are a definition. Here $E(e|{\bf x})=0$ is a defintion, not a restriction.
It can be shown that $m({\bf x})$ is the Best Predictor of $y$ in the sense that it minimizes the mean squared prediction error $E\left[(y-g({\bf x}))^2\right]$. If we could obtain $m({\bf x})$ then we would have the best overall predictor of $y$.
However, we do not know the functional form of $m({\bf x})$. We could assume it is linear, but this might be overly-restrictive. Why would it be linear?
Instead we consider the Best Linear Predictor of $y$. A linear predictor of $y$ is function of the form ${\bf x}'\boldsymbol\beta$. The best linear predictor minimizes
$$E\left[ (y- {\bf x}'\boldsymbol\beta)^2\right] \tag{1}$$
If the variance matrix of $\bf x$, $E({\bf xx}')$, is positive definite (i.e, invertible, i.e., nonsingular) then we can find a unique solution for $\beta$ in (1) by taking and solving the first order condition. We get
$$\boldsymbol\beta=\left(E[{\bf xx}'] \right)^{-1}E[{\bf x}y] \tag{2}$$
By pluggin (2) into ${\bf x}'\boldsymbol\beta$ we get the best linear predictor also called the Linear Projection of $y$ on $\bf x$
$$\begin{aligned}L(y|{\bf x})&={\bf x}'\boldsymbol\beta \\ \text{where} \ \ \ \ \boldsymbol\beta &=\left(E[{\bf xx}'] \right)^{-1}E[{\bf x}y]\end{aligned}$$
The Projection Error is then:
$$e=y-{\bf x}'\boldsymbol\beta \tag{3}$$
and we can see that $E({\bf x}e)=0$
$$\begin{aligned} E[{\bf x}e] &= E[{\bf x}(y-{\bf x}'\boldsymbol\beta)] \\ &= E[{\bf x}y]-E[{\bf xx}'] \left(E[{\bf xx}']\right)^{-1}E[{\bf x}y] \\ &={\bf 0} \end{aligned}$$
Since $\bf x$ has a constant we get $E(e)=0$ as well.
Now lets take (3) rearrange it to have y on the left side. Then separate the constant out of $\bf x$ and take expectations on both sides
$$E[y] =E[{\bf x}'\boldsymbol\beta]+E[\beta_0]+E[e] $$
Note that $E[\beta_0]=\beta_0$ and $E[e]=0$. Then solve for $\beta_0$ to get same as Wooldridge.
$$\beta_0=E[y]-E[{\bf x}]'\boldsymbol\beta \tag{4}$$
Now subtract (4) from (3) to get,
$$y-E[y]=({\bf x}-E[{\bf x}])'\boldsymbol\beta + e \tag{5}$$
Because $({\bf x}-E[{\bf x}])$ and $e$ are uncorrelated, (5) is also a linear projection and we can find $\boldsymbol\beta$
$$\begin{aligned}\boldsymbol\beta & =\left(E\left[ ({\bf x}-E[{\bf x}])({\bf x}-E[{\bf x}])'\right]\right)^{-1} E\left[ (y-E[y])(y-E[y])'\right] \\ &= [\text{Var}({\bf x})]^{-1} \text{Cov}({\bf x}y)\end{aligned}$$.
Thus we have our Linear Projection Model
$$\begin{aligned} & y=\beta_0 +{\bf x}'\boldsymbol\beta +e \\ \text{where} & \\ & L(y|1,{\bf x})= \beta_0 + {\bf x}'\boldsymbol\beta \\ & \boldsymbol\beta=[\text{Var}({\bf x})]^{-1} \text{Cov}({\bf x}y) \\ & \beta_0=E[y]-E[{\bf x}]'\boldsymbol\beta \end{aligned}$$
|
Relationship between Linear Projection and OLS Regression
|
We start with the population model:
$$\begin{aligned}y &=E(y|{\bf x)}+e \\ E(e|{\bf x}) &=0 \end{aligned}$$
where $m({\bf x})=E(y|x)$ is the conditional expectation function (CEF) and e is the CEF er
|
Relationship between Linear Projection and OLS Regression
We start with the population model:
$$\begin{aligned}y &=E(y|{\bf x)}+e \\ E(e|{\bf x}) &=0 \end{aligned}$$
where $m({\bf x})=E(y|x)$ is the conditional expectation function (CEF) and e is the CEF error. It is important to note that the equations above are a definition. Here $E(e|{\bf x})=0$ is a defintion, not a restriction.
It can be shown that $m({\bf x})$ is the Best Predictor of $y$ in the sense that it minimizes the mean squared prediction error $E\left[(y-g({\bf x}))^2\right]$. If we could obtain $m({\bf x})$ then we would have the best overall predictor of $y$.
However, we do not know the functional form of $m({\bf x})$. We could assume it is linear, but this might be overly-restrictive. Why would it be linear?
Instead we consider the Best Linear Predictor of $y$. A linear predictor of $y$ is function of the form ${\bf x}'\boldsymbol\beta$. The best linear predictor minimizes
$$E\left[ (y- {\bf x}'\boldsymbol\beta)^2\right] \tag{1}$$
If the variance matrix of $\bf x$, $E({\bf xx}')$, is positive definite (i.e, invertible, i.e., nonsingular) then we can find a unique solution for $\beta$ in (1) by taking and solving the first order condition. We get
$$\boldsymbol\beta=\left(E[{\bf xx}'] \right)^{-1}E[{\bf x}y] \tag{2}$$
By pluggin (2) into ${\bf x}'\boldsymbol\beta$ we get the best linear predictor also called the Linear Projection of $y$ on $\bf x$
$$\begin{aligned}L(y|{\bf x})&={\bf x}'\boldsymbol\beta \\ \text{where} \ \ \ \ \boldsymbol\beta &=\left(E[{\bf xx}'] \right)^{-1}E[{\bf x}y]\end{aligned}$$
The Projection Error is then:
$$e=y-{\bf x}'\boldsymbol\beta \tag{3}$$
and we can see that $E({\bf x}e)=0$
$$\begin{aligned} E[{\bf x}e] &= E[{\bf x}(y-{\bf x}'\boldsymbol\beta)] \\ &= E[{\bf x}y]-E[{\bf xx}'] \left(E[{\bf xx}']\right)^{-1}E[{\bf x}y] \\ &={\bf 0} \end{aligned}$$
Since $\bf x$ has a constant we get $E(e)=0$ as well.
Now lets take (3) rearrange it to have y on the left side. Then separate the constant out of $\bf x$ and take expectations on both sides
$$E[y] =E[{\bf x}'\boldsymbol\beta]+E[\beta_0]+E[e] $$
Note that $E[\beta_0]=\beta_0$ and $E[e]=0$. Then solve for $\beta_0$ to get same as Wooldridge.
$$\beta_0=E[y]-E[{\bf x}]'\boldsymbol\beta \tag{4}$$
Now subtract (4) from (3) to get,
$$y-E[y]=({\bf x}-E[{\bf x}])'\boldsymbol\beta + e \tag{5}$$
Because $({\bf x}-E[{\bf x}])$ and $e$ are uncorrelated, (5) is also a linear projection and we can find $\boldsymbol\beta$
$$\begin{aligned}\boldsymbol\beta & =\left(E\left[ ({\bf x}-E[{\bf x}])({\bf x}-E[{\bf x}])'\right]\right)^{-1} E\left[ (y-E[y])(y-E[y])'\right] \\ &= [\text{Var}({\bf x})]^{-1} \text{Cov}({\bf x}y)\end{aligned}$$.
Thus we have our Linear Projection Model
$$\begin{aligned} & y=\beta_0 +{\bf x}'\boldsymbol\beta +e \\ \text{where} & \\ & L(y|1,{\bf x})= \beta_0 + {\bf x}'\boldsymbol\beta \\ & \boldsymbol\beta=[\text{Var}({\bf x})]^{-1} \text{Cov}({\bf x}y) \\ & \beta_0=E[y]-E[{\bf x}]'\boldsymbol\beta \end{aligned}$$
|
Relationship between Linear Projection and OLS Regression
We start with the population model:
$$\begin{aligned}y &=E(y|{\bf x)}+e \\ E(e|{\bf x}) &=0 \end{aligned}$$
where $m({\bf x})=E(y|x)$ is the conditional expectation function (CEF) and e is the CEF er
|
42,369
|
Conditional expectation for non-gaussian variables
|
Without making additional assumptions, there is little one can say.
The idea behind the examples given here is that in the regression of $A$ against $B$, we may take a tiny bit of the range of $B$ (for which there is low probability $q$) and drastically alter the conditional distribution of $A$ in that range without changing any of the lower bivariate moments very much.
The bivariate Normal distribution, whose density is shown as a contour plot at the left, has been altered within a narrow strip of horizontal ($B$) values by shifting all vertical ($A$) densities upwards. To compensate, (1) the remaining density was shifted slightly downward (thus rebalancing the expectation of $A$) and (2) the remaining density was contracted in the vertical direction (thus reducing the overall variance of $A$ to compensate for the slight increase caused by the initial shift within the strip).
By making the strip sufficiently narrow, we can shift as much probability of $A$ as we want arbitrarily much (up or down) while keeping the compensating effects on the remainder of the distribution arbitrarily small. (Furthermore, by situating the strip near the middle (horizontally), we can also arrange not to disturb the correlation coefficient if we wish.)
The following explicit example takes this idea to an extreme by supposing both $A$ and $B$ have only two possible values each, but there's nothing special about this extreme case.
Assume $\sigma_A$ and $\sigma_B$ are both nonzero. Given any nonzero numbers $x\gt 0$ and $y$ and $0\lt q \lt 1$, define a bivariate distribution for $(A,B)$ as follows:
$$\eqalign{
\Pr((A,B)=(0,0)) &= q/2 \\
\Pr((A,B)=(x,0)) &= q/2 \\
\Pr((A,B)=(0,y)) &= 1-q.
}$$
This makes $A$ a multiple $x$ of a Bernoulli$(q/2)$ variable and $B$ is a multiple $y$ of a Bernoulli$(1-q)$ variable. Therefore
$$\sigma^2_A = x^2\left(\frac{q}{2}\right)\left(1-\frac{q}{2}\right);\quad
\sigma^2_B = y^2 q(1-q).$$
These determine $x^2$ and $y^2$ in terms of $q$ and the given variances:
$$x^2 = \frac{4\sigma^2_A}{q(2-q)};\quad y^2 = \frac{\sigma^2_B}{q(1-q)}.$$
From the definition of conditional expectation
$$\mathbb{E}(A|B=0) = \frac{0(q/2) + x(q/2)}{q/2 + q/2} = \frac{x}{2} = \frac{\sigma_A}{\sqrt{q(2-q)}}.\tag{1}$$
Obviously we can make the right hand side as large as we wish by making $q$ sufficiently small. Rigorously, if $N \gt 0$, pick $q \gt 0$ such that $q \lt \sigma^2_A/(2N^2)$, so that
$$q(2-q) = 1-(1-q)^2 \lt 1-(1-\sigma^2_A/(2N^2))^2 = \frac{\sigma^2_A}{N^2} - \left(\frac{\sigma_A^2}{2N^2}\right)^2 \lt \frac{\sigma^2_A}{N^2},$$
implying (from expression $(1)$) that
$$\mathbb{E}(A|B=0) = \frac{\sigma_A}{\sqrt{q(2-q)}} \gt \frac{\sigma_A}{\sigma_A/N} = N.$$
Thus we may select $q$ to match the intended variances of the distribution of $(A,B)$ while making $\mathbb{E}(A|B=0)$ arbitrarily large.
|
Conditional expectation for non-gaussian variables
|
Without making additional assumptions, there is little one can say.
The idea behind the examples given here is that in the regression of $A$ against $B$, we may take a tiny bit of the range of $B$ (fo
|
Conditional expectation for non-gaussian variables
Without making additional assumptions, there is little one can say.
The idea behind the examples given here is that in the regression of $A$ against $B$, we may take a tiny bit of the range of $B$ (for which there is low probability $q$) and drastically alter the conditional distribution of $A$ in that range without changing any of the lower bivariate moments very much.
The bivariate Normal distribution, whose density is shown as a contour plot at the left, has been altered within a narrow strip of horizontal ($B$) values by shifting all vertical ($A$) densities upwards. To compensate, (1) the remaining density was shifted slightly downward (thus rebalancing the expectation of $A$) and (2) the remaining density was contracted in the vertical direction (thus reducing the overall variance of $A$ to compensate for the slight increase caused by the initial shift within the strip).
By making the strip sufficiently narrow, we can shift as much probability of $A$ as we want arbitrarily much (up or down) while keeping the compensating effects on the remainder of the distribution arbitrarily small. (Furthermore, by situating the strip near the middle (horizontally), we can also arrange not to disturb the correlation coefficient if we wish.)
The following explicit example takes this idea to an extreme by supposing both $A$ and $B$ have only two possible values each, but there's nothing special about this extreme case.
Assume $\sigma_A$ and $\sigma_B$ are both nonzero. Given any nonzero numbers $x\gt 0$ and $y$ and $0\lt q \lt 1$, define a bivariate distribution for $(A,B)$ as follows:
$$\eqalign{
\Pr((A,B)=(0,0)) &= q/2 \\
\Pr((A,B)=(x,0)) &= q/2 \\
\Pr((A,B)=(0,y)) &= 1-q.
}$$
This makes $A$ a multiple $x$ of a Bernoulli$(q/2)$ variable and $B$ is a multiple $y$ of a Bernoulli$(1-q)$ variable. Therefore
$$\sigma^2_A = x^2\left(\frac{q}{2}\right)\left(1-\frac{q}{2}\right);\quad
\sigma^2_B = y^2 q(1-q).$$
These determine $x^2$ and $y^2$ in terms of $q$ and the given variances:
$$x^2 = \frac{4\sigma^2_A}{q(2-q)};\quad y^2 = \frac{\sigma^2_B}{q(1-q)}.$$
From the definition of conditional expectation
$$\mathbb{E}(A|B=0) = \frac{0(q/2) + x(q/2)}{q/2 + q/2} = \frac{x}{2} = \frac{\sigma_A}{\sqrt{q(2-q)}}.\tag{1}$$
Obviously we can make the right hand side as large as we wish by making $q$ sufficiently small. Rigorously, if $N \gt 0$, pick $q \gt 0$ such that $q \lt \sigma^2_A/(2N^2)$, so that
$$q(2-q) = 1-(1-q)^2 \lt 1-(1-\sigma^2_A/(2N^2))^2 = \frac{\sigma^2_A}{N^2} - \left(\frac{\sigma_A^2}{2N^2}\right)^2 \lt \frac{\sigma^2_A}{N^2},$$
implying (from expression $(1)$) that
$$\mathbb{E}(A|B=0) = \frac{\sigma_A}{\sqrt{q(2-q)}} \gt \frac{\sigma_A}{\sigma_A/N} = N.$$
Thus we may select $q$ to match the intended variances of the distribution of $(A,B)$ while making $\mathbb{E}(A|B=0)$ arbitrarily large.
|
Conditional expectation for non-gaussian variables
Without making additional assumptions, there is little one can say.
The idea behind the examples given here is that in the regression of $A$ against $B$, we may take a tiny bit of the range of $B$ (fo
|
42,370
|
Reporting of Neural Network Accuracy for Academic Publications
|
Before I answer your question let me say, in general it is considered good practice to have a Validation set that is completely distinct from your Test set. You may or may not be aware of this fact, but you seem to gloss over it in your question, so I wanted to make that explicitly clear.
The answer to your question would be an average across all mini-batches of your Test set, as the Test set is supposed to represent an unbiased representation of how that NN may perform in the wild. Another way of stating this would be that the test set (since you haven't tuned your hyper-parameters to do well on that set) should represent how well your network generalizes, which is the goal for any network.
It would likely be considered deceptive academic practice to cherry-pick the best mini-batch for publishing results, and generally any published results should be able to be reproduced by other researchers. If you artificially conflate your accuracy by choosing the best mini-batch, that would make replication of your results difficult for other researchers and would likely lead other researchers to question the validity of your claims.
Examples of this can be seen in other areas of Science: many researchers have swiftly ruined their careers by publishing results that are not able to be reproduced by other researchers.
While I can't explicitly tell you whether or not this is typical of academic publications in this field of study, it is definitely unethical, probably immoral, and, as you have already stated yourself, not good practice.
It is likely that as this field grows in maturity, more attention will be paid to replication of results, and in doing so, will make the ability to replicate results vital to not only the integrity of the researcher, but also whether or not the research is generally accepted.
Please note that reproducability is a standard in all Scientific endeavors, and Computer Scientists are not the only ones facing this issue. For instance, I just ran across this BBC article about reproducability. This article (tangentially) addresses some of the points you have brought up with this question. This article also addresses the issue of, and need for, reproducability in general.
|
Reporting of Neural Network Accuracy for Academic Publications
|
Before I answer your question let me say, in general it is considered good practice to have a Validation set that is completely distinct from your Test set. You may or may not be aware of this fact, b
|
Reporting of Neural Network Accuracy for Academic Publications
Before I answer your question let me say, in general it is considered good practice to have a Validation set that is completely distinct from your Test set. You may or may not be aware of this fact, but you seem to gloss over it in your question, so I wanted to make that explicitly clear.
The answer to your question would be an average across all mini-batches of your Test set, as the Test set is supposed to represent an unbiased representation of how that NN may perform in the wild. Another way of stating this would be that the test set (since you haven't tuned your hyper-parameters to do well on that set) should represent how well your network generalizes, which is the goal for any network.
It would likely be considered deceptive academic practice to cherry-pick the best mini-batch for publishing results, and generally any published results should be able to be reproduced by other researchers. If you artificially conflate your accuracy by choosing the best mini-batch, that would make replication of your results difficult for other researchers and would likely lead other researchers to question the validity of your claims.
Examples of this can be seen in other areas of Science: many researchers have swiftly ruined their careers by publishing results that are not able to be reproduced by other researchers.
While I can't explicitly tell you whether or not this is typical of academic publications in this field of study, it is definitely unethical, probably immoral, and, as you have already stated yourself, not good practice.
It is likely that as this field grows in maturity, more attention will be paid to replication of results, and in doing so, will make the ability to replicate results vital to not only the integrity of the researcher, but also whether or not the research is generally accepted.
Please note that reproducability is a standard in all Scientific endeavors, and Computer Scientists are not the only ones facing this issue. For instance, I just ran across this BBC article about reproducability. This article (tangentially) addresses some of the points you have brought up with this question. This article also addresses the issue of, and need for, reproducability in general.
|
Reporting of Neural Network Accuracy for Academic Publications
Before I answer your question let me say, in general it is considered good practice to have a Validation set that is completely distinct from your Test set. You may or may not be aware of this fact, b
|
42,371
|
Sampling from Truncated Distribution in STAN
|
Given that xtrue[i]'s are constrained, Stan requires that these constraints are included in the variable declaration. To my knowledge, these constraints must be scalar quantities.
Below, I worked around this requirement by considering auxillary parameters, xraw[i], which have a truncated normal distribution.
m <- "
data {
int<lower = 1> N;
real x[N];
}
parameters {
real<lower=-1, upper=0> xraw[N];
}
transformed parameters {
real xtrue[N];
for(i in 1:N)
xtrue[i] = xraw[i] + x[i];
}
model{
for(i in 1:N){
target += normal_lpdf(xraw[i]| 0, 1);
target += -log_diff_exp(normal_lcdf(0| 0, 1), normal_lcdf(-1| 0, 1));
}
}
"
library(rstan)
rstan_options(auto_write = FALSE)
options(mc.cores = parallel::detectCores())
nobs=10
xtrue=runif(nobs,0,5)
xobs=ceiling(xtrue+rnorm(nobs,0,1))
dat=list(N=length(xobs),x=xobs)
init_fun <- function() {list(xtrue=xobs-.5) }
mod <- stan_model(model_code = m)
s <- sampling(mod, data = dat, iter = 2000, chains = 1, thin = 3, init = init_fun)
fit=stan(model_code=m, data = dat,iter = 2000, chains = 1,thin=3,init=init_fun)
parms=extract(s,c('xtrue'))
xtrue <- colMeans(parms[['xtrue']])
head(xobs)
[1] 4 2 5 6 4 2
head(xtrue)
[1] 3.533775 1.507112 4.561159 5.545677 3.538002 1.520043
par(mfrow = c(2,5))
for(i in 1:10) {
hist(samples$xtrue[,i], prob=T, main = paste(c("xtrue[",i,"]"), collapse=""), xlab=NULL)
curve(dnorm(x, xobs[i], 1)/(.5 - pnorm(-1)), add=T, lty=2)
}
The posterior draws appear to follow the correct distributions:
|
Sampling from Truncated Distribution in STAN
|
Given that xtrue[i]'s are constrained, Stan requires that these constraints are included in the variable declaration. To my knowledge, these constraints must be scalar quantities.
Below, I worked arou
|
Sampling from Truncated Distribution in STAN
Given that xtrue[i]'s are constrained, Stan requires that these constraints are included in the variable declaration. To my knowledge, these constraints must be scalar quantities.
Below, I worked around this requirement by considering auxillary parameters, xraw[i], which have a truncated normal distribution.
m <- "
data {
int<lower = 1> N;
real x[N];
}
parameters {
real<lower=-1, upper=0> xraw[N];
}
transformed parameters {
real xtrue[N];
for(i in 1:N)
xtrue[i] = xraw[i] + x[i];
}
model{
for(i in 1:N){
target += normal_lpdf(xraw[i]| 0, 1);
target += -log_diff_exp(normal_lcdf(0| 0, 1), normal_lcdf(-1| 0, 1));
}
}
"
library(rstan)
rstan_options(auto_write = FALSE)
options(mc.cores = parallel::detectCores())
nobs=10
xtrue=runif(nobs,0,5)
xobs=ceiling(xtrue+rnorm(nobs,0,1))
dat=list(N=length(xobs),x=xobs)
init_fun <- function() {list(xtrue=xobs-.5) }
mod <- stan_model(model_code = m)
s <- sampling(mod, data = dat, iter = 2000, chains = 1, thin = 3, init = init_fun)
fit=stan(model_code=m, data = dat,iter = 2000, chains = 1,thin=3,init=init_fun)
parms=extract(s,c('xtrue'))
xtrue <- colMeans(parms[['xtrue']])
head(xobs)
[1] 4 2 5 6 4 2
head(xtrue)
[1] 3.533775 1.507112 4.561159 5.545677 3.538002 1.520043
par(mfrow = c(2,5))
for(i in 1:10) {
hist(samples$xtrue[,i], prob=T, main = paste(c("xtrue[",i,"]"), collapse=""), xlab=NULL)
curve(dnorm(x, xobs[i], 1)/(.5 - pnorm(-1)), add=T, lty=2)
}
The posterior draws appear to follow the correct distributions:
|
Sampling from Truncated Distribution in STAN
Given that xtrue[i]'s are constrained, Stan requires that these constraints are included in the variable declaration. To my knowledge, these constraints must be scalar quantities.
Below, I worked arou
|
42,372
|
Add New Object Class in Deep Learning Network
|
You should, at least, re-train the classification layer. When you add another output, during learning the new class, the other class activation must shrink either explicitly (sigmoid) or implicitly (softmax). However, it may be better to learn, at least, last feature layer as there would be some useful features to recognize pedestrians.
Another approach can be feeding the new class to the network and collect confidence from the output. Low confidence can be indication of another class that is not belong to any of the classes learnt before. For sure this method can also give low confidence to another class other than pedestrian or any class the network learnt on. Also, NN is a non-local generalization method. It is prone to classify a totally garbage image with high confidence (See adversarial examples if you are curious).
|
Add New Object Class in Deep Learning Network
|
You should, at least, re-train the classification layer. When you add another output, during learning the new class, the other class activation must shrink either explicitly (sigmoid) or implicitly (s
|
Add New Object Class in Deep Learning Network
You should, at least, re-train the classification layer. When you add another output, during learning the new class, the other class activation must shrink either explicitly (sigmoid) or implicitly (softmax). However, it may be better to learn, at least, last feature layer as there would be some useful features to recognize pedestrians.
Another approach can be feeding the new class to the network and collect confidence from the output. Low confidence can be indication of another class that is not belong to any of the classes learnt before. For sure this method can also give low confidence to another class other than pedestrian or any class the network learnt on. Also, NN is a non-local generalization method. It is prone to classify a totally garbage image with high confidence (See adversarial examples if you are curious).
|
Add New Object Class in Deep Learning Network
You should, at least, re-train the classification layer. When you add another output, during learning the new class, the other class activation must shrink either explicitly (sigmoid) or implicitly (s
|
42,373
|
Add New Object Class in Deep Learning Network
|
A few years after the question was asked, there are several attempt to solve this problem.
My best guess would be to:
add a class in the last layer
train the class corresponding to pedestrian with the new data
try not to move the way the network was predicting the other class by using distillation. This may need some other data than the pedestrian one, where other class appear (cars, see, microscope,... ). The good thing is that if you are able to sample these (maybe through internet), you don't have to label them to make the technique work. If the new data with pedestrian labels come from the same distribution as the one used to train the network initially, you don't even have to think about that.
An example of this technique can be found in this paper: https://arxiv.org/abs/1708.06977
You may find other relevant papers by searching the following themes: "Continuous learning", "Lifelong Learning", "Catastrophic Forgetting".
[EDITS]
I recently read and loved these related articles: learning without forgetting, iCaRL, and End-to-End Incremental Learning
|
Add New Object Class in Deep Learning Network
|
A few years after the question was asked, there are several attempt to solve this problem.
My best guess would be to:
add a class in the last layer
train the class corresponding to pedestrian with
|
Add New Object Class in Deep Learning Network
A few years after the question was asked, there are several attempt to solve this problem.
My best guess would be to:
add a class in the last layer
train the class corresponding to pedestrian with the new data
try not to move the way the network was predicting the other class by using distillation. This may need some other data than the pedestrian one, where other class appear (cars, see, microscope,... ). The good thing is that if you are able to sample these (maybe through internet), you don't have to label them to make the technique work. If the new data with pedestrian labels come from the same distribution as the one used to train the network initially, you don't even have to think about that.
An example of this technique can be found in this paper: https://arxiv.org/abs/1708.06977
You may find other relevant papers by searching the following themes: "Continuous learning", "Lifelong Learning", "Catastrophic Forgetting".
[EDITS]
I recently read and loved these related articles: learning without forgetting, iCaRL, and End-to-End Incremental Learning
|
Add New Object Class in Deep Learning Network
A few years after the question was asked, there are several attempt to solve this problem.
My best guess would be to:
add a class in the last layer
train the class corresponding to pedestrian with
|
42,374
|
Add New Object Class in Deep Learning Network
|
In order to add a class you will almost certainly need a differently structured network (ie. +1 output). You may also require more hidden nodes or inputs depending on your problem. Of course, as you mentioned you could simply re-train the parameters based on all the new data, however, you will lose all the benefit of the original dataset.
On possibility would be to initialize your new network (or at least the same number of input/hidden/output parameters) with the weights you have from the original dataset and then train on the new data. This will almost certainly speed up the process and to some degree retains the original information from the first dataset assuming it generalized well enough.
|
Add New Object Class in Deep Learning Network
|
In order to add a class you will almost certainly need a differently structured network (ie. +1 output). You may also require more hidden nodes or inputs depending on your problem. Of course, as you m
|
Add New Object Class in Deep Learning Network
In order to add a class you will almost certainly need a differently structured network (ie. +1 output). You may also require more hidden nodes or inputs depending on your problem. Of course, as you mentioned you could simply re-train the parameters based on all the new data, however, you will lose all the benefit of the original dataset.
On possibility would be to initialize your new network (or at least the same number of input/hidden/output parameters) with the weights you have from the original dataset and then train on the new data. This will almost certainly speed up the process and to some degree retains the original information from the first dataset assuming it generalized well enough.
|
Add New Object Class in Deep Learning Network
In order to add a class you will almost certainly need a differently structured network (ie. +1 output). You may also require more hidden nodes or inputs depending on your problem. Of course, as you m
|
42,375
|
Add New Object Class in Deep Learning Network
|
I don't know if it would work, but one approach would be to add a new neuron in the output softmax layer and train with gradient descent but updating only the weights going to that new class.
It is probably a very sub-optimal method but it could be worth trying.
|
Add New Object Class in Deep Learning Network
|
I don't know if it would work, but one approach would be to add a new neuron in the output softmax layer and train with gradient descent but updating only the weights going to that new class.
It is pr
|
Add New Object Class in Deep Learning Network
I don't know if it would work, but one approach would be to add a new neuron in the output softmax layer and train with gradient descent but updating only the weights going to that new class.
It is probably a very sub-optimal method but it could be worth trying.
|
Add New Object Class in Deep Learning Network
I don't know if it would work, but one approach would be to add a new neuron in the output softmax layer and train with gradient descent but updating only the weights going to that new class.
It is pr
|
42,376
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
|
Try to build one!
We need a cluster assignment that is stable, but not optimal.
So the medoids bust be the medoids of their clusters, and every object is assigned to its closest medoid. But there is a solution that is a lot better.
Lets start simple. One dimensional, three points per cluster, stars indicate the cluster centers.
Data: 1 2 3 6 7 8
Sol1: * *
Now let's modify this by moving one object away from the center.
Data:1 2 3 6 7 15
Sol1: * *
Sol2: * *
The cost of Sol2 is 2+1+0+3+4+0=10. But it's hard to get there. Most likely PAM will get stuck in the first solution, which costs 1+0+1+1+0+8=11. If it doesn't, you may need to increase the spacing of the clusters, or move the outlier.
Example of R code for the above example:
> pam(c(1:3,6,7,15), k = 2, medoids = c(2,5))$med
[,1]
[1,] 2
[2,] 7
> pam(c(1:3,6,7,15), k = 2, medoids = c(2,6))$med
[,1]
[1,] 3
[2,] 15
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
|
Try to build one!
We need a cluster assignment that is stable, but not optimal.
So the medoids bust be the medoids of their clusters, and every object is assigned to its closest medoid. But there is a
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
Try to build one!
We need a cluster assignment that is stable, but not optimal.
So the medoids bust be the medoids of their clusters, and every object is assigned to its closest medoid. But there is a solution that is a lot better.
Lets start simple. One dimensional, three points per cluster, stars indicate the cluster centers.
Data: 1 2 3 6 7 8
Sol1: * *
Now let's modify this by moving one object away from the center.
Data:1 2 3 6 7 15
Sol1: * *
Sol2: * *
The cost of Sol2 is 2+1+0+3+4+0=10. But it's hard to get there. Most likely PAM will get stuck in the first solution, which costs 1+0+1+1+0+8=11. If it doesn't, you may need to increase the spacing of the clusters, or move the outlier.
Example of R code for the above example:
> pam(c(1:3,6,7,15), k = 2, medoids = c(2,5))$med
[,1]
[1,] 2
[2,] 7
> pam(c(1:3,6,7,15), k = 2, medoids = c(2,6))$med
[,1]
[1,] 3
[2,] 15
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
Try to build one!
We need a cluster assignment that is stable, but not optimal.
So the medoids bust be the medoids of their clusters, and every object is assigned to its closest medoid. But there is a
|
42,377
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
|
Clustering is an NP-complete problem - see proof fo the one definition of clustering and another definition of clustering.
The question of whether P=NP wasn't answered yet but is seems as if the complexity classes are different.
If it is so, then no polynomial time algorithm, like the pam algorithm can solve the problem.
When facing an NP-complete problem we can cope with it by looking for approximation algorithms. The one bellow has approximation ratio of 2.
Gonzalez, T. F. (1985),
``Clustering to minimize the maximum intercluster distance'',
Theoretical Comput. Sci. 38, 293-306.
However, pam goes in a different direction and it is a randomized greedy algorithm.
Hence, it looks for an optimal solution but I guess that usually it fails and finds a local optimum.
It seems that pam fails on the regular cases that are hard to k-means.
On slide 24 there is a example that is hard for k-means like algorithms but
DBSCAN clusters well.
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
|
Clustering is an NP-complete problem - see proof fo the one definition of clustering and another definition of clustering.
The question of whether P=NP wasn't answered yet but is seems as if the compl
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
Clustering is an NP-complete problem - see proof fo the one definition of clustering and another definition of clustering.
The question of whether P=NP wasn't answered yet but is seems as if the complexity classes are different.
If it is so, then no polynomial time algorithm, like the pam algorithm can solve the problem.
When facing an NP-complete problem we can cope with it by looking for approximation algorithms. The one bellow has approximation ratio of 2.
Gonzalez, T. F. (1985),
``Clustering to minimize the maximum intercluster distance'',
Theoretical Comput. Sci. 38, 293-306.
However, pam goes in a different direction and it is a randomized greedy algorithm.
Hence, it looks for an optimal solution but I guess that usually it fails and finds a local optimum.
It seems that pam fails on the regular cases that are hard to k-means.
On slide 24 there is a example that is hard for k-means like algorithms but
DBSCAN clusters well.
|
When does pam (partition around medoids) fails to find the optimal solution? (counter example?!)
Clustering is an NP-complete problem - see proof fo the one definition of clustering and another definition of clustering.
The question of whether P=NP wasn't answered yet but is seems as if the compl
|
42,378
|
Interpretation of level, trend and seasonal indices in Holt-Winters exponential smoothing
|
As you know, you will first initialize all three indices, then update them over the historical period, then extrapolate them out into the future to derive the forecast from their extrapolated values.
At any given time, the level index gives an estimate of the local mean, or "level" of the data-generating process (DGP), at this time. The trend index gives an estimate of the trend at this time, i.e., the change between successive time points. Finally, the seasonality index estimates the deviation from the local mean due to seasonality.
Accordingly, in forecasting, the level will be extrapolated "as-is", since we expect future changes in the time series to be driven only by the other two indices. The trend value will also be extrapolated "as-is", or it will slowly be reduced if you use a dampened trend, which will result in a forecasted time series whose growth (or decay) asymptotically becomes flat. Trend dampening often improves accuracy over the long range. Finally, the seasonality is extrapolated by looking back exactly one cycle - for next March, you would use the seasonality index of last March, for next April, the one from last April, and so forth.
If, at a particular point in time, the local trend is 100, this means that the model estimates that the local mean of the DGP is half as high as if it were 200. If the trend at this time is 2, this means that the estimated growth between two time points is 2 (and a trend index of 5 indicates an estimated growth of 5).
There are various ways of initializing these values. You can initialize the mean by the overall average, or by the average of the first few observations, or simply by the very first observation. You can initialize the trend by the difference between the last and the first observation, divided by $n-1$ if you have $n$ observations (because $n$ observations give you $n-1$ increments), or by a regression trend line. You can initialize the seasonality by the deviations between your first year's observations and the level+trend fit, or take averages of these deviations over all years in your history.
If you use a state space approach, you can initialize all these through maximum likelihood. However, this is often computationally very burdensome (monthly data require 12 seasonal indices - with level and trend, you'd have to estimate 14 parameters), for little gain in forecast accuracy, so your software will often use a heuristic as in the previous paragraph.
It may be most informative to plot the development of your indices over time. Here is an example, using forecast::ets in R, which implements a state space approach, and which we force to use a model with additive trend, seasonality and error, so this is essentially Holt-Winters:
> library(Mcomp)
> library(forecast)
>
> model <- ets(M3[[1998]]$x,model="AAA")
> model
ETS(A,A,A)
Call:
ets(y = M3[[1998]]$x, model = "AAA")
Smoothing parameters:
alpha = 0.9947
beta = 4e-04
gamma = 1e-04
Initial states:
l = 3552.7263
b = 7.9458
s=154.906 -7.4477 98.1232 -14.7209 -79.7366 -117.3236
-154.2015 -9.4785 181.9343 216.3269 -152.2493 -116.1322
sigma: 139.8064
AIC AICc BIC
1886.317 1891.308 1931.697
> plot(model)
Finally, I very much recommend this free online forecasting textbook, especially of course the chapter on Exponential Smoothing. One of the authors is the author and maintainer of the forecast package for R I used above.
|
Interpretation of level, trend and seasonal indices in Holt-Winters exponential smoothing
|
As you know, you will first initialize all three indices, then update them over the historical period, then extrapolate them out into the future to derive the forecast from their extrapolated values.
|
Interpretation of level, trend and seasonal indices in Holt-Winters exponential smoothing
As you know, you will first initialize all three indices, then update them over the historical period, then extrapolate them out into the future to derive the forecast from their extrapolated values.
At any given time, the level index gives an estimate of the local mean, or "level" of the data-generating process (DGP), at this time. The trend index gives an estimate of the trend at this time, i.e., the change between successive time points. Finally, the seasonality index estimates the deviation from the local mean due to seasonality.
Accordingly, in forecasting, the level will be extrapolated "as-is", since we expect future changes in the time series to be driven only by the other two indices. The trend value will also be extrapolated "as-is", or it will slowly be reduced if you use a dampened trend, which will result in a forecasted time series whose growth (or decay) asymptotically becomes flat. Trend dampening often improves accuracy over the long range. Finally, the seasonality is extrapolated by looking back exactly one cycle - for next March, you would use the seasonality index of last March, for next April, the one from last April, and so forth.
If, at a particular point in time, the local trend is 100, this means that the model estimates that the local mean of the DGP is half as high as if it were 200. If the trend at this time is 2, this means that the estimated growth between two time points is 2 (and a trend index of 5 indicates an estimated growth of 5).
There are various ways of initializing these values. You can initialize the mean by the overall average, or by the average of the first few observations, or simply by the very first observation. You can initialize the trend by the difference between the last and the first observation, divided by $n-1$ if you have $n$ observations (because $n$ observations give you $n-1$ increments), or by a regression trend line. You can initialize the seasonality by the deviations between your first year's observations and the level+trend fit, or take averages of these deviations over all years in your history.
If you use a state space approach, you can initialize all these through maximum likelihood. However, this is often computationally very burdensome (monthly data require 12 seasonal indices - with level and trend, you'd have to estimate 14 parameters), for little gain in forecast accuracy, so your software will often use a heuristic as in the previous paragraph.
It may be most informative to plot the development of your indices over time. Here is an example, using forecast::ets in R, which implements a state space approach, and which we force to use a model with additive trend, seasonality and error, so this is essentially Holt-Winters:
> library(Mcomp)
> library(forecast)
>
> model <- ets(M3[[1998]]$x,model="AAA")
> model
ETS(A,A,A)
Call:
ets(y = M3[[1998]]$x, model = "AAA")
Smoothing parameters:
alpha = 0.9947
beta = 4e-04
gamma = 1e-04
Initial states:
l = 3552.7263
b = 7.9458
s=154.906 -7.4477 98.1232 -14.7209 -79.7366 -117.3236
-154.2015 -9.4785 181.9343 216.3269 -152.2493 -116.1322
sigma: 139.8064
AIC AICc BIC
1886.317 1891.308 1931.697
> plot(model)
Finally, I very much recommend this free online forecasting textbook, especially of course the chapter on Exponential Smoothing. One of the authors is the author and maintainer of the forecast package for R I used above.
|
Interpretation of level, trend and seasonal indices in Holt-Winters exponential smoothing
As you know, you will first initialize all three indices, then update them over the historical period, then extrapolate them out into the future to derive the forecast from their extrapolated values.
|
42,379
|
Resources for understanding Gaussian processes
|
Chapter 6.4 of Bishop's PRML book explains Gaussian Processes for regression and classification. In addition, Murphy's ML book discusses GP latent variable models and connections with other methods. The web-site (http://www.gaussianprocess.org/) accompanying the GP book has additional implementation resources.
|
Resources for understanding Gaussian processes
|
Chapter 6.4 of Bishop's PRML book explains Gaussian Processes for regression and classification. In addition, Murphy's ML book discusses GP latent variable models and connections with other methods. T
|
Resources for understanding Gaussian processes
Chapter 6.4 of Bishop's PRML book explains Gaussian Processes for regression and classification. In addition, Murphy's ML book discusses GP latent variable models and connections with other methods. The web-site (http://www.gaussianprocess.org/) accompanying the GP book has additional implementation resources.
|
Resources for understanding Gaussian processes
Chapter 6.4 of Bishop's PRML book explains Gaussian Processes for regression and classification. In addition, Murphy's ML book discusses GP latent variable models and connections with other methods. T
|
42,380
|
Resources for understanding Gaussian processes
|
I highly recommend the Distill.pub article on visual exploration of Gaussian processes that provides a lot of intuitive understanding. You can also watch the video recordings of past Gaussian process summer schools.
|
Resources for understanding Gaussian processes
|
I highly recommend the Distill.pub article on visual exploration of Gaussian processes that provides a lot of intuitive understanding. You can also watch the video recordings of past Gaussian process
|
Resources for understanding Gaussian processes
I highly recommend the Distill.pub article on visual exploration of Gaussian processes that provides a lot of intuitive understanding. You can also watch the video recordings of past Gaussian process summer schools.
|
Resources for understanding Gaussian processes
I highly recommend the Distill.pub article on visual exploration of Gaussian processes that provides a lot of intuitive understanding. You can also watch the video recordings of past Gaussian process
|
42,381
|
Resources for understanding Gaussian processes
|
I read the scikit-learn documentation on Gaussian processes in order to learn the basics.
|
Resources for understanding Gaussian processes
|
I read the scikit-learn documentation on Gaussian processes in order to learn the basics.
|
Resources for understanding Gaussian processes
I read the scikit-learn documentation on Gaussian processes in order to learn the basics.
|
Resources for understanding Gaussian processes
I read the scikit-learn documentation on Gaussian processes in order to learn the basics.
|
42,382
|
When to use RBF networks instead of multilayer perceptron?
|
You may use RBF networks in case you do not necessarily need to have multiple hidden layers in your model and more importantly, you want your model to be robust to adversarial noise/examples. The advantage of RBF networks is they bring much more robustness to your prediction, but as mentioned earlier they are more limited compared to commonly-used types of neural networks. However, commonly-used types of neural network models are highly vulnerable to adversarial noise and can make very wrong predictions when fed with such examples as their inputs. This is not the case in RBF networks which seems to be due to their non-linear nature of these networks. So it is a trade-off between higher accuracy in commonly-used types of neural networks or higher robustness in radial-basis function networks.
Sources
Intriguing Properties of Neural Networks
RBF Networks
Explaining and Harnessing Adversarial Examples
|
When to use RBF networks instead of multilayer perceptron?
|
You may use RBF networks in case you do not necessarily need to have multiple hidden layers in your model and more importantly, you want your model to be robust to adversarial noise/examples. The adva
|
When to use RBF networks instead of multilayer perceptron?
You may use RBF networks in case you do not necessarily need to have multiple hidden layers in your model and more importantly, you want your model to be robust to adversarial noise/examples. The advantage of RBF networks is they bring much more robustness to your prediction, but as mentioned earlier they are more limited compared to commonly-used types of neural networks. However, commonly-used types of neural network models are highly vulnerable to adversarial noise and can make very wrong predictions when fed with such examples as their inputs. This is not the case in RBF networks which seems to be due to their non-linear nature of these networks. So it is a trade-off between higher accuracy in commonly-used types of neural networks or higher robustness in radial-basis function networks.
Sources
Intriguing Properties of Neural Networks
RBF Networks
Explaining and Harnessing Adversarial Examples
|
When to use RBF networks instead of multilayer perceptron?
You may use RBF networks in case you do not necessarily need to have multiple hidden layers in your model and more importantly, you want your model to be robust to adversarial noise/examples. The adva
|
42,383
|
Bayes theorem in odds form - incorrect in Tetlock's 'Superforecasting' book?
|
So this doesn't remain unanswered (except in comments) let's derive the odds ratio form from scratch:
We know
$P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}$, so:
$$\frac{P(A|B)}{P(\bar{A}|B)}=\frac{\frac{P(B|A)\cdot P(A)}{P(B)}}{\frac{P(B|\bar{A})\cdot P(\bar{A})}{P(B)}}$$
$$=\frac{P(B|A)\cdot P(A)}{{P(B|\bar{A})\cdot P(\bar{A})}}$$
$$=\frac{P(B|A)}{{P(B|\bar{A})}}\cdot \frac{P(A)}{P(\bar{A})}$$
So yes, it's a typo as you suggest and should be divided rather than multiplied.
|
Bayes theorem in odds form - incorrect in Tetlock's 'Superforecasting' book?
|
So this doesn't remain unanswered (except in comments) let's derive the odds ratio form from scratch:
We know
$P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}$, so:
$$\frac{P(A|B)}{P(\bar{A}|B)}=\frac{\frac{P(B
|
Bayes theorem in odds form - incorrect in Tetlock's 'Superforecasting' book?
So this doesn't remain unanswered (except in comments) let's derive the odds ratio form from scratch:
We know
$P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}$, so:
$$\frac{P(A|B)}{P(\bar{A}|B)}=\frac{\frac{P(B|A)\cdot P(A)}{P(B)}}{\frac{P(B|\bar{A})\cdot P(\bar{A})}{P(B)}}$$
$$=\frac{P(B|A)\cdot P(A)}{{P(B|\bar{A})\cdot P(\bar{A})}}$$
$$=\frac{P(B|A)}{{P(B|\bar{A})}}\cdot \frac{P(A)}{P(\bar{A})}$$
So yes, it's a typo as you suggest and should be divided rather than multiplied.
|
Bayes theorem in odds form - incorrect in Tetlock's 'Superforecasting' book?
So this doesn't remain unanswered (except in comments) let's derive the odds ratio form from scratch:
We know
$P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}$, so:
$$\frac{P(A|B)}{P(\bar{A}|B)}=\frac{\frac{P(B
|
42,384
|
What are some of the potential consequences of adding junk controls in your regression?
|
We can write the formula for the standard error of a regression coefficient $\hat \beta_j$ as
$$\sqrt{\frac{\sum_{i=1}^n \hat u^2}{(n-k-1)\sum_{i=1}^n(x_{ij}-\bar x_j)^2(1-R^2_j)}}$$
where $\hat u^2$ are the regression residuals, $n$ is the numbers of observations, $k$ is the number of regressors, and $R^2_j$ is the $R^2$ from a regression of $x_j$ on all other independent variables.
If the additional variables have no effect on the dependent variable the only parts of the formula that will change will be $k$ and $R^2_j$, both of which will increase the standard error, leading to larger p-values.
|
What are some of the potential consequences of adding junk controls in your regression?
|
We can write the formula for the standard error of a regression coefficient $\hat \beta_j$ as
$$\sqrt{\frac{\sum_{i=1}^n \hat u^2}{(n-k-1)\sum_{i=1}^n(x_{ij}-\bar x_j)^2(1-R^2_j)}}$$
where $\hat u^2$
|
What are some of the potential consequences of adding junk controls in your regression?
We can write the formula for the standard error of a regression coefficient $\hat \beta_j$ as
$$\sqrt{\frac{\sum_{i=1}^n \hat u^2}{(n-k-1)\sum_{i=1}^n(x_{ij}-\bar x_j)^2(1-R^2_j)}}$$
where $\hat u^2$ are the regression residuals, $n$ is the numbers of observations, $k$ is the number of regressors, and $R^2_j$ is the $R^2$ from a regression of $x_j$ on all other independent variables.
If the additional variables have no effect on the dependent variable the only parts of the formula that will change will be $k$ and $R^2_j$, both of which will increase the standard error, leading to larger p-values.
|
What are some of the potential consequences of adding junk controls in your regression?
We can write the formula for the standard error of a regression coefficient $\hat \beta_j$ as
$$\sqrt{\frac{\sum_{i=1}^n \hat u^2}{(n-k-1)\sum_{i=1}^n(x_{ij}-\bar x_j)^2(1-R^2_j)}}$$
where $\hat u^2$
|
42,385
|
Sequential Update of Bayesian
|
Indeed - you can update sequentially or in a batch fashion so long as you assume exchangeability. It's analogous to the iid assumption typically made in frequentist models.
In this case, $D_{a}$ and $D_{b}$ exchangeable implies that $P(D_{a}, D_{b} \, | \, \theta) = P(D_{a} \, | \, \theta) P(D_{b} \, | \, \theta)$ for some $\theta$, which is exactly what you need to make the connection.
You can see a proof of equivalence between a single $n$-large batch update and $n$ sequential updates in an answer I wrote to a similar question.
|
Sequential Update of Bayesian
|
Indeed - you can update sequentially or in a batch fashion so long as you assume exchangeability. It's analogous to the iid assumption typically made in frequentist models.
In this case, $D_{a}$ an
|
Sequential Update of Bayesian
Indeed - you can update sequentially or in a batch fashion so long as you assume exchangeability. It's analogous to the iid assumption typically made in frequentist models.
In this case, $D_{a}$ and $D_{b}$ exchangeable implies that $P(D_{a}, D_{b} \, | \, \theta) = P(D_{a} \, | \, \theta) P(D_{b} \, | \, \theta)$ for some $\theta$, which is exactly what you need to make the connection.
You can see a proof of equivalence between a single $n$-large batch update and $n$ sequential updates in an answer I wrote to a similar question.
|
Sequential Update of Bayesian
Indeed - you can update sequentially or in a batch fashion so long as you assume exchangeability. It's analogous to the iid assumption typically made in frequentist models.
In this case, $D_{a}$ an
|
42,386
|
Sequential Update of Bayesian
|
Actually, the general formula of sequential Bayesian updating is:
$$
P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta, D_a) P(\theta \mid D_a).
\,\,\,(*)
$$
However, for most machine learning models,
$D_a$ and $D_b$ are conditionally independent given $\theta$, i.e.,
$$
P(D_a \mid \theta) P(D_b \mid \theta) = P(D_a, D_b \mid \theta),
$$
then, $P(D_b \mid \theta, D_a)$ in $(*)$ naturally equals to $P(D_b \mid \theta), $
so the $(*)$ becomes:
$$
(1)\,\,\,\,\,\,P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta) P(\theta \mid D_a),
$$
which is exactly what Murphy's ML book talks about.
|
Sequential Update of Bayesian
|
Actually, the general formula of sequential Bayesian updating is:
$$
P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta, D_a) P(\theta \mid D_a).
\,\,\,(*)
$$
However, for most machine learning mo
|
Sequential Update of Bayesian
Actually, the general formula of sequential Bayesian updating is:
$$
P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta, D_a) P(\theta \mid D_a).
\,\,\,(*)
$$
However, for most machine learning models,
$D_a$ and $D_b$ are conditionally independent given $\theta$, i.e.,
$$
P(D_a \mid \theta) P(D_b \mid \theta) = P(D_a, D_b \mid \theta),
$$
then, $P(D_b \mid \theta, D_a)$ in $(*)$ naturally equals to $P(D_b \mid \theta), $
so the $(*)$ becomes:
$$
(1)\,\,\,\,\,\,P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta) P(\theta \mid D_a),
$$
which is exactly what Murphy's ML book talks about.
|
Sequential Update of Bayesian
Actually, the general formula of sequential Bayesian updating is:
$$
P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta, D_a) P(\theta \mid D_a).
\,\,\,(*)
$$
However, for most machine learning mo
|
42,387
|
What does a copula density explain about dependence of random variables?
|
Well, the copula density is a density and can be interpreted as any other density. Specifically, with the density you have shown us, clearly the conditional distribution of one variable depends on the other, so there is dependence, not independence. Further, the density is higher (highest) for (0,0) and (1,1), and lowest for (1,0) and (0,1), so we have a positive correlation.
|
What does a copula density explain about dependence of random variables?
|
Well, the copula density is a density and can be interpreted as any other density. Specifically, with the density you have shown us, clearly the conditional distribution of one variable depends on th
|
What does a copula density explain about dependence of random variables?
Well, the copula density is a density and can be interpreted as any other density. Specifically, with the density you have shown us, clearly the conditional distribution of one variable depends on the other, so there is dependence, not independence. Further, the density is higher (highest) for (0,0) and (1,1), and lowest for (1,0) and (0,1), so we have a positive correlation.
|
What does a copula density explain about dependence of random variables?
Well, the copula density is a density and can be interpreted as any other density. Specifically, with the density you have shown us, clearly the conditional distribution of one variable depends on th
|
42,388
|
Adadelta idea 1 vs RMSprop
|
Referring the links pointed out by you, RMSprop is focussed on updating the learning rate $\eta$ for each iteration using accumulation of square of gradients:
$r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2}$ [where g is the gradient] and plugging to find the effective learning rate at step t using: $\eta_{t}=\frac{\eta}{\sqrt[]{r_{t}+\epsilon}}$ [where epsilon is the smoothing constant].
On the other hand Adadelta (Concentrating solely on Idea 1) does not focus on updating the learning rate for each step at all. The paper explains that the accumulation of square of gradients($r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2}$) can be approximated by RMS of gradient:
RMS[$g_{t}$]=$\sqrt{(r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2})+\epsilon}$
and then describes how parameter update can be handled using learning rate $\eta$ (note the learning rate here is not step dependant). Update step from Idea 1 in adadelta:
$\delta x_{t}=-\frac{\eta}{RMS[g_{t}]}g_{t}$[where $x_{t}$ is the parameter to be updated].
The two methods RMSprop and Adadelta differ from each other even at Idea 1. Further down (Idea 2) Adadelta shows why learning rate constant is not important for this method of optimisation at all. The learning rate is only used for the initial step in update of parameters and later the learning rate has a relationship with accumulative updates. This however is another discussion as our OP was only concerning the Idea 1 of Adadelta.
|
Adadelta idea 1 vs RMSprop
|
Referring the links pointed out by you, RMSprop is focussed on updating the learning rate $\eta$ for each iteration using accumulation of square of gradients:
$r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2}$
|
Adadelta idea 1 vs RMSprop
Referring the links pointed out by you, RMSprop is focussed on updating the learning rate $\eta$ for each iteration using accumulation of square of gradients:
$r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2}$ [where g is the gradient] and plugging to find the effective learning rate at step t using: $\eta_{t}=\frac{\eta}{\sqrt[]{r_{t}+\epsilon}}$ [where epsilon is the smoothing constant].
On the other hand Adadelta (Concentrating solely on Idea 1) does not focus on updating the learning rate for each step at all. The paper explains that the accumulation of square of gradients($r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2}$) can be approximated by RMS of gradient:
RMS[$g_{t}$]=$\sqrt{(r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2})+\epsilon}$
and then describes how parameter update can be handled using learning rate $\eta$ (note the learning rate here is not step dependant). Update step from Idea 1 in adadelta:
$\delta x_{t}=-\frac{\eta}{RMS[g_{t}]}g_{t}$[where $x_{t}$ is the parameter to be updated].
The two methods RMSprop and Adadelta differ from each other even at Idea 1. Further down (Idea 2) Adadelta shows why learning rate constant is not important for this method of optimisation at all. The learning rate is only used for the initial step in update of parameters and later the learning rate has a relationship with accumulative updates. This however is another discussion as our OP was only concerning the Idea 1 of Adadelta.
|
Adadelta idea 1 vs RMSprop
Referring the links pointed out by you, RMSprop is focussed on updating the learning rate $\eta$ for each iteration using accumulation of square of gradients:
$r_{t}=\rho r_{t-1} + (1-\rho)g_{t}^{2}$
|
42,389
|
Adadelta idea 1 vs RMSprop
|
Yes, you are correct.
Like you, I also arrived at the same conclusion by examining Idea 1 (section 3.1) in the Adadelta paper and the lecture.
Anyway, here is some more evidence:
Sebastian Ruder wrote in his popular blog post An overview of gradient descent optimization algorithms:
RMSprop and Adadelta have both been developed independently around the same time stemming from the need to resolve Adagrad's radically diminishing learning rates. RMSprop in fact is identical to the first update vector of Adadelta that we derived above [...]
("the first update vector" refers to the implementation of Idea 1, which is described earlier in the post.)
Indeed, the Adadelta paper was published in 2012, and the lecture was first given in 2012, so it makes perfect sense that both were unaware of each other, and thus neither referenced the other.
Also, I searched the many comments to Sebastian's post, and I didn't find anyone challenging him about the claim I quoted.
Recently I also made the same claim in an answer on stackoverflow, and wasn't challenged about it. (Though obviously my answer is less visited than Sebastian's post by some orders of magnitude, so this evidence is much weaker.)
|
Adadelta idea 1 vs RMSprop
|
Yes, you are correct.
Like you, I also arrived at the same conclusion by examining Idea 1 (section 3.1) in the Adadelta paper and the lecture.
Anyway, here is some more evidence:
Sebastian Ruder wrot
|
Adadelta idea 1 vs RMSprop
Yes, you are correct.
Like you, I also arrived at the same conclusion by examining Idea 1 (section 3.1) in the Adadelta paper and the lecture.
Anyway, here is some more evidence:
Sebastian Ruder wrote in his popular blog post An overview of gradient descent optimization algorithms:
RMSprop and Adadelta have both been developed independently around the same time stemming from the need to resolve Adagrad's radically diminishing learning rates. RMSprop in fact is identical to the first update vector of Adadelta that we derived above [...]
("the first update vector" refers to the implementation of Idea 1, which is described earlier in the post.)
Indeed, the Adadelta paper was published in 2012, and the lecture was first given in 2012, so it makes perfect sense that both were unaware of each other, and thus neither referenced the other.
Also, I searched the many comments to Sebastian's post, and I didn't find anyone challenging him about the claim I quoted.
Recently I also made the same claim in an answer on stackoverflow, and wasn't challenged about it. (Though obviously my answer is less visited than Sebastian's post by some orders of magnitude, so this evidence is much weaker.)
|
Adadelta idea 1 vs RMSprop
Yes, you are correct.
Like you, I also arrived at the same conclusion by examining Idea 1 (section 3.1) in the Adadelta paper and the lecture.
Anyway, here is some more evidence:
Sebastian Ruder wrot
|
42,390
|
Model construction: when to shuffle data and when to sort it?
|
Pre-treatment
If your data comes from different sources (different sensors, stores...) and you want to split it into train/validation sets, yes it is generally safer to shuffle it, as the partitions you will create will come from different sources.
Say some patients come from various hospitals and you want to predict if they have a specific disease from the following variables : age, sex, location. You gathered data from various hospitals and one of them, hospital $i$, is specialized in treating this disease. Then, if you just stacked the lines, you will see that lines between 100 and 150 (corresponding to the observations of hospital $i$) are more likely to be affected that other and treat it as a relevant predictor. You don't want this to happen. Even worse could be to train your model on this specific hospital data set and test it on another.
Training and performance
If you concern is based on training only, the performance of batch methods should not be influenced by the order of the rows.
Take the example of a linear regression: $$\hat\beta=(X'X)^{-1}X'Y$$If you multiply $X$ by a permutation matrix $O$ such that $X_2=OX$ contains the same lines as $X$ in a different order, then, using the fact that $O'O=I$
$$\hat\beta=(X_2'X_2)^{-1}X_{2}'Y_2$$
It is the same for the other batch methods. KNN, in particular, in its original implementation is not dependent on the order of the rows.
However, note that some machine learning method rely on various subsets of the data (random forests, gradient boosting methods) the order may lead to different performances (though the difference should not be important).
The specific case of online learning
When it comes to online learning the answer is not obvious. Shuffling the data removes possible drifts. Maybe you want to take them into account in your model, maybe you don't. Regarding this last point, there is no specific answer. Drift should probably be removed if your data does not have a natural order (does not depend on time per example). If it arrives in a chronological fashion, you may want to try your model with and without possible drift.
|
Model construction: when to shuffle data and when to sort it?
|
Pre-treatment
If your data comes from different sources (different sensors, stores...) and you want to split it into train/validation sets, yes it is generally safer to shuffle it, as the partitions y
|
Model construction: when to shuffle data and when to sort it?
Pre-treatment
If your data comes from different sources (different sensors, stores...) and you want to split it into train/validation sets, yes it is generally safer to shuffle it, as the partitions you will create will come from different sources.
Say some patients come from various hospitals and you want to predict if they have a specific disease from the following variables : age, sex, location. You gathered data from various hospitals and one of them, hospital $i$, is specialized in treating this disease. Then, if you just stacked the lines, you will see that lines between 100 and 150 (corresponding to the observations of hospital $i$) are more likely to be affected that other and treat it as a relevant predictor. You don't want this to happen. Even worse could be to train your model on this specific hospital data set and test it on another.
Training and performance
If you concern is based on training only, the performance of batch methods should not be influenced by the order of the rows.
Take the example of a linear regression: $$\hat\beta=(X'X)^{-1}X'Y$$If you multiply $X$ by a permutation matrix $O$ such that $X_2=OX$ contains the same lines as $X$ in a different order, then, using the fact that $O'O=I$
$$\hat\beta=(X_2'X_2)^{-1}X_{2}'Y_2$$
It is the same for the other batch methods. KNN, in particular, in its original implementation is not dependent on the order of the rows.
However, note that some machine learning method rely on various subsets of the data (random forests, gradient boosting methods) the order may lead to different performances (though the difference should not be important).
The specific case of online learning
When it comes to online learning the answer is not obvious. Shuffling the data removes possible drifts. Maybe you want to take them into account in your model, maybe you don't. Regarding this last point, there is no specific answer. Drift should probably be removed if your data does not have a natural order (does not depend on time per example). If it arrives in a chronological fashion, you may want to try your model with and without possible drift.
|
Model construction: when to shuffle data and when to sort it?
Pre-treatment
If your data comes from different sources (different sensors, stores...) and you want to split it into train/validation sets, yes it is generally safer to shuffle it, as the partitions y
|
42,391
|
Multicollinearity in WLS regression
|
It's a great question, because it concerns an important and fundamental issue about multiple regression. The answer is that weighting can change the VIF (a measure of collinearity among the regressors) by arbitrary amounts up or down (with a lower limit of $1$).
To see why that is, consider a model with two regressors $X_1$ and $X_2$. (We do not have to consider the response variable: it plays no role in computing the VIF.) Here is a scatterplot of 50 observations, with the symbol areas proportional to the weights:
If those weights were not applied, clearly the correlation would be strongly positive, because the points line up closely along a positively sloping line. Indeed, their (unweighted) VIF is $13.54$: large enough to drive one to investigate this model carefully for effects of collinearity. (Rules of thumb assert that VIFs above $5$ or $10$ begin to be of concern.)
The weights, though, throw the correlation in altogether a different direction. The points with the heaviest weights tend to be negatively correlated: some towards the upper left, others toward the lower right. These cause the weighted correlation to be nearly zero. Indeed, the VIF for these weighted data is merely $1.44$: low and benign.
The procedure works in reverse: we could weight the data to perform an OLS and then unweight them in a WLS. Thus it's just as possible that the weighted fit will reduce the VIF as increase it.
|
Multicollinearity in WLS regression
|
It's a great question, because it concerns an important and fundamental issue about multiple regression. The answer is that weighting can change the VIF (a measure of collinearity among the regressor
|
Multicollinearity in WLS regression
It's a great question, because it concerns an important and fundamental issue about multiple regression. The answer is that weighting can change the VIF (a measure of collinearity among the regressors) by arbitrary amounts up or down (with a lower limit of $1$).
To see why that is, consider a model with two regressors $X_1$ and $X_2$. (We do not have to consider the response variable: it plays no role in computing the VIF.) Here is a scatterplot of 50 observations, with the symbol areas proportional to the weights:
If those weights were not applied, clearly the correlation would be strongly positive, because the points line up closely along a positively sloping line. Indeed, their (unweighted) VIF is $13.54$: large enough to drive one to investigate this model carefully for effects of collinearity. (Rules of thumb assert that VIFs above $5$ or $10$ begin to be of concern.)
The weights, though, throw the correlation in altogether a different direction. The points with the heaviest weights tend to be negatively correlated: some towards the upper left, others toward the lower right. These cause the weighted correlation to be nearly zero. Indeed, the VIF for these weighted data is merely $1.44$: low and benign.
The procedure works in reverse: we could weight the data to perform an OLS and then unweight them in a WLS. Thus it's just as possible that the weighted fit will reduce the VIF as increase it.
|
Multicollinearity in WLS regression
It's a great question, because it concerns an important and fundamental issue about multiple regression. The answer is that weighting can change the VIF (a measure of collinearity among the regressor
|
42,392
|
Truncated Back-propagation through time for RNNs
|
I had wondered the same thing, and it looks like this has been thoroughly researched in this nice blog post:
http://r2rt.com/styles-of-truncated-backpropagation.html (mirror)
The author found that the disjoint approach, which is what TensorFlow uses, works reasonably well. Using a sliding window every time step is difficult/expensive to calculate (especially with a framework like TensorFlow), and doesn't yield much benefit. The post cites a paper from the 1990s that found jumping forward h steps, then running BPTT back 2h steps was similar in outcome to just doing the disjoint approach of jumping h steps and running BPTT back also h steps.
If you're using LSTM's instead of simple RNN cells, then longer contexts do matter and it would probably be better not to truncate at all, or at least use a really high number of unroll steps. The author's results were for a simple RNN model.
|
Truncated Back-propagation through time for RNNs
|
I had wondered the same thing, and it looks like this has been thoroughly researched in this nice blog post:
http://r2rt.com/styles-of-truncated-backpropagation.html (mirror)
The author found that the
|
Truncated Back-propagation through time for RNNs
I had wondered the same thing, and it looks like this has been thoroughly researched in this nice blog post:
http://r2rt.com/styles-of-truncated-backpropagation.html (mirror)
The author found that the disjoint approach, which is what TensorFlow uses, works reasonably well. Using a sliding window every time step is difficult/expensive to calculate (especially with a framework like TensorFlow), and doesn't yield much benefit. The post cites a paper from the 1990s that found jumping forward h steps, then running BPTT back 2h steps was similar in outcome to just doing the disjoint approach of jumping h steps and running BPTT back also h steps.
If you're using LSTM's instead of simple RNN cells, then longer contexts do matter and it would probably be better not to truncate at all, or at least use a really high number of unroll steps. The author's results were for a simple RNN model.
|
Truncated Back-propagation through time for RNNs
I had wondered the same thing, and it looks like this has been thoroughly researched in this nice blog post:
http://r2rt.com/styles-of-truncated-backpropagation.html (mirror)
The author found that the
|
42,393
|
Discretizing a Continuous Input for an Artificial Neural Network
|
You're touching on problem formulation, where the designer defines input variables and their characteristics. Looking at the structure you show, if you were trying to predict whether a liquid is frozen or solid, such a structure would be useful. If you were trying to predict a future value of the variable, then it would be much less useful. So your question is quite abstract, and so the answer is yes such a structure is surely used and has advantages in certain circumstances. But the challenge in machine learning is the inverse of the challenge you propose. Given a problem that needs a solution, what are the best variables and model to solve the problem.
|
Discretizing a Continuous Input for an Artificial Neural Network
|
You're touching on problem formulation, where the designer defines input variables and their characteristics. Looking at the structure you show, if you were trying to predict whether a liquid is froz
|
Discretizing a Continuous Input for an Artificial Neural Network
You're touching on problem formulation, where the designer defines input variables and their characteristics. Looking at the structure you show, if you were trying to predict whether a liquid is frozen or solid, such a structure would be useful. If you were trying to predict a future value of the variable, then it would be much less useful. So your question is quite abstract, and so the answer is yes such a structure is surely used and has advantages in certain circumstances. But the challenge in machine learning is the inverse of the challenge you propose. Given a problem that needs a solution, what are the best variables and model to solve the problem.
|
Discretizing a Continuous Input for an Artificial Neural Network
You're touching on problem formulation, where the designer defines input variables and their characteristics. Looking at the structure you show, if you were trying to predict whether a liquid is froz
|
42,394
|
What is the difference between Apriori and Eclat algorithms?
|
Here is a good description:
http://www.slideshare.net/wanaezwani/apriori-and-eclat-algorithm-in-association-rule-mining
In particular, apriori is probably the first association rule mining and computationally complex. This leads to the introduction of further fast algorithms.
|
What is the difference between Apriori and Eclat algorithms?
|
Here is a good description:
http://www.slideshare.net/wanaezwani/apriori-and-eclat-algorithm-in-association-rule-mining
In particular, apriori is probably the first association rule mining and computa
|
What is the difference between Apriori and Eclat algorithms?
Here is a good description:
http://www.slideshare.net/wanaezwani/apriori-and-eclat-algorithm-in-association-rule-mining
In particular, apriori is probably the first association rule mining and computationally complex. This leads to the introduction of further fast algorithms.
|
What is the difference between Apriori and Eclat algorithms?
Here is a good description:
http://www.slideshare.net/wanaezwani/apriori-and-eclat-algorithm-in-association-rule-mining
In particular, apriori is probably the first association rule mining and computa
|
42,395
|
What is the difference between Apriori and Eclat algorithms?
|
Apriori is useable with large datasets and Eclat is better suited to small and medium datasets.
Apriori scans the original (real) dataset, whereas Eclat scan the currently generated dataset.
Apriori is slower than Eclat.
|
What is the difference between Apriori and Eclat algorithms?
|
Apriori is useable with large datasets and Eclat is better suited to small and medium datasets.
Apriori scans the original (real) dataset, whereas Eclat scan the currently generated dataset.
Apriori i
|
What is the difference between Apriori and Eclat algorithms?
Apriori is useable with large datasets and Eclat is better suited to small and medium datasets.
Apriori scans the original (real) dataset, whereas Eclat scan the currently generated dataset.
Apriori is slower than Eclat.
|
What is the difference between Apriori and Eclat algorithms?
Apriori is useable with large datasets and Eclat is better suited to small and medium datasets.
Apriori scans the original (real) dataset, whereas Eclat scan the currently generated dataset.
Apriori i
|
42,396
|
What is the difference between Apriori and Eclat algorithms?
|
Apriori algorithm is a classical algorithm used to mining the frequent item sets in a given dataset.
Coming to Eclat algorithm also mining the frequent itemsets but in vertical manner and it follows the depth first search of a graph.
As per the speed,Eclat is fast than the Apriori algorithm.
Apriori works on larger datasets where as Eclat algorithm works on smaller datasets.
|
What is the difference between Apriori and Eclat algorithms?
|
Apriori algorithm is a classical algorithm used to mining the frequent item sets in a given dataset.
Coming to Eclat algorithm also mining the frequent itemsets but in vertical manner and it follows
|
What is the difference between Apriori and Eclat algorithms?
Apriori algorithm is a classical algorithm used to mining the frequent item sets in a given dataset.
Coming to Eclat algorithm also mining the frequent itemsets but in vertical manner and it follows the depth first search of a graph.
As per the speed,Eclat is fast than the Apriori algorithm.
Apriori works on larger datasets where as Eclat algorithm works on smaller datasets.
|
What is the difference between Apriori and Eclat algorithms?
Apriori algorithm is a classical algorithm used to mining the frequent item sets in a given dataset.
Coming to Eclat algorithm also mining the frequent itemsets but in vertical manner and it follows
|
42,397
|
What is the difference between Apriori and Eclat algorithms?
|
Look this article:
Comparing Dataset Characteristics that Favor the
Apriori, Eclat or FP-Growth Frequent Itemset
Mining Algorithms
Apriori is an easily understandable frequent itemset mining
algorithm. Because of this, Apriori is a popular starting
point for frequent itemset study. However, Apriori has serious
scalability issues and exhausts available memory much faster
than Eclat and FP-Growth. Because of this Apriori should not
be used for large datasets.
|
What is the difference between Apriori and Eclat algorithms?
|
Look this article:
Comparing Dataset Characteristics that Favor the
Apriori, Eclat or FP-Growth Frequent Itemset
Mining Algorithms
Apriori is an easily understandable frequent itemset mining
algorith
|
What is the difference between Apriori and Eclat algorithms?
Look this article:
Comparing Dataset Characteristics that Favor the
Apriori, Eclat or FP-Growth Frequent Itemset
Mining Algorithms
Apriori is an easily understandable frequent itemset mining
algorithm. Because of this, Apriori is a popular starting
point for frequent itemset study. However, Apriori has serious
scalability issues and exhausts available memory much faster
than Eclat and FP-Growth. Because of this Apriori should not
be used for large datasets.
|
What is the difference between Apriori and Eclat algorithms?
Look this article:
Comparing Dataset Characteristics that Favor the
Apriori, Eclat or FP-Growth Frequent Itemset
Mining Algorithms
Apriori is an easily understandable frequent itemset mining
algorith
|
42,398
|
which book can help me for self-learning VARIMA model?
|
VARIMA model are discussed in http://www.amazon.co.uk/Time-Series-Analysis-Univariate-Multivariate/dp/0201159112 . It has exanples using MTS software. VAR models are easier to compute which is why they are more popular but who said statistical analysis would be easy.
|
which book can help me for self-learning VARIMA model?
|
VARIMA model are discussed in http://www.amazon.co.uk/Time-Series-Analysis-Univariate-Multivariate/dp/0201159112 . It has exanples using MTS software. VAR models are easier to compute which is why the
|
which book can help me for self-learning VARIMA model?
VARIMA model are discussed in http://www.amazon.co.uk/Time-Series-Analysis-Univariate-Multivariate/dp/0201159112 . It has exanples using MTS software. VAR models are easier to compute which is why they are more popular but who said statistical analysis would be easy.
|
which book can help me for self-learning VARIMA model?
VARIMA model are discussed in http://www.amazon.co.uk/Time-Series-Analysis-Univariate-Multivariate/dp/0201159112 . It has exanples using MTS software. VAR models are easier to compute which is why the
|
42,399
|
which book can help me for self-learning VARIMA model?
|
I highly recommend Luktepohl's "New Introduction to Multiple Time Series Analysis" or Tsay's "Multivariate Time Series," both of which are specifically dedicated to multivarate time series analysis. Both texts contain much more if you are so inclined to read beyond VARIMA. Tsay even has his own multivariate time series library for R and has exercises in the book that you can practice with.
|
which book can help me for self-learning VARIMA model?
|
I highly recommend Luktepohl's "New Introduction to Multiple Time Series Analysis" or Tsay's "Multivariate Time Series," both of which are specifically dedicated to multivarate time series analysis. B
|
which book can help me for self-learning VARIMA model?
I highly recommend Luktepohl's "New Introduction to Multiple Time Series Analysis" or Tsay's "Multivariate Time Series," both of which are specifically dedicated to multivarate time series analysis. Both texts contain much more if you are so inclined to read beyond VARIMA. Tsay even has his own multivariate time series library for R and has exercises in the book that you can practice with.
|
which book can help me for self-learning VARIMA model?
I highly recommend Luktepohl's "New Introduction to Multiple Time Series Analysis" or Tsay's "Multivariate Time Series," both of which are specifically dedicated to multivarate time series analysis. B
|
42,400
|
Statistical significance test for averages of correlation coefficients
|
Short answer: Yes, transform each correlation ($AB_i$ and $CD_i$) using the Fisher $r-to-z'$ transform:
$f(r)=\frac12 ln \frac{1+r}{1-r}$.
Then, perform an independent samples t-test to test the null hypothesis of $\mu_{f(AB)}=\mu_{f(CD)}$.
Rationale: You're right that approximate normality is important here. With only a small number of subjects, you can't count on the central limit theorem to address the (often) non-normal sampling distribution of r. The sampling distribution of r will only be approximately normal when $\rho$ is close to 0 or when n is very large (here, I refer to the n used to compute the correlation, not the n indexed by i in your question). Based on the examples in your question, I'm guessing n is modest, and if you already knew the $\rho$'s, there'd be no point in asking your question. Bottom line: the Fisher $r-to-z'$ will probably help here.
It sounds like you're comparing independent samples, especially based on this part of your description:
$A_i$ and $C_i$ as well as $B_i$ and $D_i$ correspond to the same variable being measured, but for different sub-groups of my subjects.
So, it makes sense to use an independent samples t-test.
|
Statistical significance test for averages of correlation coefficients
|
Short answer: Yes, transform each correlation ($AB_i$ and $CD_i$) using the Fisher $r-to-z'$ transform:
$f(r)=\frac12 ln \frac{1+r}{1-r}$.
Then, perform an independent samples t-test to test the nul
|
Statistical significance test for averages of correlation coefficients
Short answer: Yes, transform each correlation ($AB_i$ and $CD_i$) using the Fisher $r-to-z'$ transform:
$f(r)=\frac12 ln \frac{1+r}{1-r}$.
Then, perform an independent samples t-test to test the null hypothesis of $\mu_{f(AB)}=\mu_{f(CD)}$.
Rationale: You're right that approximate normality is important here. With only a small number of subjects, you can't count on the central limit theorem to address the (often) non-normal sampling distribution of r. The sampling distribution of r will only be approximately normal when $\rho$ is close to 0 or when n is very large (here, I refer to the n used to compute the correlation, not the n indexed by i in your question). Based on the examples in your question, I'm guessing n is modest, and if you already knew the $\rho$'s, there'd be no point in asking your question. Bottom line: the Fisher $r-to-z'$ will probably help here.
It sounds like you're comparing independent samples, especially based on this part of your description:
$A_i$ and $C_i$ as well as $B_i$ and $D_i$ correspond to the same variable being measured, but for different sub-groups of my subjects.
So, it makes sense to use an independent samples t-test.
|
Statistical significance test for averages of correlation coefficients
Short answer: Yes, transform each correlation ($AB_i$ and $CD_i$) using the Fisher $r-to-z'$ transform:
$f(r)=\frac12 ln \frac{1+r}{1-r}$.
Then, perform an independent samples t-test to test the nul
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.