idx
int64 1
56k
| question
stringlengths 15
155
| answer
stringlengths 2
29.2k
⌀ | question_cut
stringlengths 15
100
| answer_cut
stringlengths 2
200
⌀ | conversation
stringlengths 47
29.3k
| conversation_cut
stringlengths 47
301
|
|---|---|---|---|---|---|---|
43,001
|
How to compute confidence intervals from *weighted* samples?
|
You have a scheme of two-level sampling, first sampling the urls, then sampling from that empirical distribution over urls to detect some website property. I will assume that website property, White (W) is constant in time, so it is enough to visit each site once. So it would be best with sampling without replacement, but you didn't tell us how you sampled. So first I will assume sampling with replacement, since that is easier analysis, and good approximation if number of sites is large.
Some notation. There is a population of websites (urls) visited by some frequencies $\pi=(\pi_1, \dotsc, \pi_S)$. Each website has (or not) some property $W$, written $W_i$ for site $i$, which is 1 if site is $W$ and 0 else. On the first level of sampling site $i$ is visited $N_i$ times, and so we have an estimate of $\pi_i$, $\hat{\pi}_1=N_i/N_\cdot$, where $N_\cdot=\sum_i N_i$.
On the second level of sampling, we sample websites from the distribution $\hat{\pi}$ (with replacement), $n$ times. Let the site being sampled be $I_j$, but first we concentrate on the first time and write only $I$. Under the second-level distribution, we have $\DeclareMathOperator{\P}{\mathbb{P}} \P(I=i)=\hat{\pi}_i$. The observed property is $W_I$, and we have
$$
\P(W_I=1)=\sum_i \P(W_I=1 \mid I=i)\hat{\pi}_i=\sum_i W_i \hat{\pi}_i
$$
and then taking the expectation of that expression over the first-level sampling, we find $\P(W_I=1)=\sum_i W_i \pi_i$ which we denote by $Q$ and is the weighted fraction of sites with the property, which is our estimand. So the $\sum_{j=1}^n W_{I_j}$ has a binomial distribution with parameters $n,Q$, and confidence intervals can be based on that.
|
How to compute confidence intervals from *weighted* samples?
|
You have a scheme of two-level sampling, first sampling the urls, then sampling from that empirical distribution over urls to detect some website property. I will assume that website property, White (
|
How to compute confidence intervals from *weighted* samples?
You have a scheme of two-level sampling, first sampling the urls, then sampling from that empirical distribution over urls to detect some website property. I will assume that website property, White (W) is constant in time, so it is enough to visit each site once. So it would be best with sampling without replacement, but you didn't tell us how you sampled. So first I will assume sampling with replacement, since that is easier analysis, and good approximation if number of sites is large.
Some notation. There is a population of websites (urls) visited by some frequencies $\pi=(\pi_1, \dotsc, \pi_S)$. Each website has (or not) some property $W$, written $W_i$ for site $i$, which is 1 if site is $W$ and 0 else. On the first level of sampling site $i$ is visited $N_i$ times, and so we have an estimate of $\pi_i$, $\hat{\pi}_1=N_i/N_\cdot$, where $N_\cdot=\sum_i N_i$.
On the second level of sampling, we sample websites from the distribution $\hat{\pi}$ (with replacement), $n$ times. Let the site being sampled be $I_j$, but first we concentrate on the first time and write only $I$. Under the second-level distribution, we have $\DeclareMathOperator{\P}{\mathbb{P}} \P(I=i)=\hat{\pi}_i$. The observed property is $W_I$, and we have
$$
\P(W_I=1)=\sum_i \P(W_I=1 \mid I=i)\hat{\pi}_i=\sum_i W_i \hat{\pi}_i
$$
and then taking the expectation of that expression over the first-level sampling, we find $\P(W_I=1)=\sum_i W_i \pi_i$ which we denote by $Q$ and is the weighted fraction of sites with the property, which is our estimand. So the $\sum_{j=1}^n W_{I_j}$ has a binomial distribution with parameters $n,Q$, and confidence intervals can be based on that.
|
How to compute confidence intervals from *weighted* samples?
You have a scheme of two-level sampling, first sampling the urls, then sampling from that empirical distribution over urls to detect some website property. I will assume that website property, White (
|
43,002
|
Distribution of random variable with multinomial sampling distribution and parameters $(n,p)$, where $n\sim$ Poisson with truncation
|
At the moment your model is not clearly defined, so it is premature to seek the distribution of the count vector $X$. You are seeking to generalise from the multinomial distribution, which is the distribution of count values over categories for an underlying sequence of independent categorical random variables with a specified probability vector. In your generalisation you say you want to impose maximums on each of the counts, but you also want to keep the specified probabilities used in the multinomial distribution. (You also mis-specify the form of the probabilities; with your formula the elements of the probability vector don't add to one.)
In order to make your model well-defined you will need to fix the form of your probability vector so that its elements add to one. (Presumably you meant to have an additional element $p_0 = 1/(1+\sum_k \exp(v_k))$.) Let $\mathbf{k} = (k_0,...,k_J)$ be the imposed maximum counts across the categories, and let $\dot{k} \equiv \sum_j k_j$ be the total maximum count. (I will use lower case here since this is assumed to be fixed rather than random.) You then have a sequence of values $W_1,...,W_{\dot{k}}$ such that:
$$\mathbb{P}(W_i = j|W_1,...,W_{i-1}) = \frac{\exp(v_j) \cdot I_{i,j}}{I_{i,0} + \sum_j \exp(v_j) \cdot I_{i,j}},$$
where $X_j(i) \equiv \sum_{r=1}^{i} \mathbb{I}(W_i = j)$ are the category counts after the $i$th value is selected, and the indicator $I_{i,j}$ is defined as $I_{i,j} \equiv \mathbb{I} ( X_j(i) < k_j )$. Notably, after observing $\dot{k}$ values from this model, the category counts must necessarily be at the maximums, so $\mathbf{X}(\dot{k}) = \mathbf{k}$.
This is a complicated generalisation of the multinomial model, with the latter occurring in the special case where $\mathbf{k} = (\infty,...,\infty)$, so that there are no maximums on the category counts.
Writing the distribution of $\mathbf{X}$: The count vector $\mathbf{X}$ is a function of the underlying categorical variables $W_1,...,W_N$. Denote this function by $T:\mathbf{W} \mapsto \mathbf{X}$. For any given $N \leqslant \dot{k}$ we define the set of $N$ category vectors:
$$\mathscr{S}(\mathbf{x}, \mathbf{k}) \equiv
\Bigg\{ (w_1,...,w_N) \in \{ 0,...,J \}^N \Bigg| T(\mathbf{w}) = \mathbf{x} \leqslant \mathbf{k} \Bigg\}.$$
The set $$ gives us the set of all vectors $w_1,...,w_N$ that lead to an admissible count vector $\mathbf{x}$ (admissible in the sense that none of the counts are above the specified maximum).
$$\begin{equation} \begin{aligned}
\mathbb{P}(\mathbf{X} = \mathbf{x})
&= \mathbb{P}(\mathbf{W} \in \mathscr{S}(\mathbf{x}, \mathbf{k})) \\[6pt]
&= \sum_{\mathbb{w} \in \mathscr{S}(\mathbf{x}, \mathbf{k})} \mathbb{P}(\mathbf{W} = \mathbf{w}) \\[6pt]
&= \sum_{\mathbb{w} \in \mathscr{S}(\mathbf{x}, \mathbf{k})}
\prod_{i=1}^N \mathbb{P}(W_i = w_i|W_1 = w_1,...,W_{i-1} = w_{i-1}) \\[6pt]
&= \sum_{\mathbb{w} \in \mathscr{S}(\mathbf{x}, \mathbf{k})}
\prod_{i=1}^N \frac{\exp(v_{w_i}) \cdot I_{i,{w_i}}}{I_{i,0} + \sum_j \exp(v_j) \cdot I_{i,j}}. \\[6pt]
\end{aligned} \end{equation}$$
As you can see, this is a horrendously complicated expression. Unless $N$ and $J$ are both very small, the summation in this expression will get very complicated indeed. Technically this is a closed form expression, since it is a finite sum of terms involving elementary operations. However, the expression is complicated heavy by the fact that it involves a sum over a combinatorial set that is hard to construct, and the summand involves a product of terms that each key of counts from the previous elements of the category vector.
I am unaware of any way this can be simplified further. In view of this, there does not appear to me to be any simple closed form expression for the distribution of the count vector $\mathbf{X}(N)$ (except for the trivial case where $N=\dot{k}$). You would therefore need to generate the distribution of the count vector by simulation from the model. It is unlikely that there can be any efficiency gain beyond simulating the underlying values in the model from the above categorical distributions.
|
Distribution of random variable with multinomial sampling distribution and parameters $(n,p)$, where
|
At the moment your model is not clearly defined, so it is premature to seek the distribution of the count vector $X$. You are seeking to generalise from the multinomial distribution, which is the dis
|
Distribution of random variable with multinomial sampling distribution and parameters $(n,p)$, where $n\sim$ Poisson with truncation
At the moment your model is not clearly defined, so it is premature to seek the distribution of the count vector $X$. You are seeking to generalise from the multinomial distribution, which is the distribution of count values over categories for an underlying sequence of independent categorical random variables with a specified probability vector. In your generalisation you say you want to impose maximums on each of the counts, but you also want to keep the specified probabilities used in the multinomial distribution. (You also mis-specify the form of the probabilities; with your formula the elements of the probability vector don't add to one.)
In order to make your model well-defined you will need to fix the form of your probability vector so that its elements add to one. (Presumably you meant to have an additional element $p_0 = 1/(1+\sum_k \exp(v_k))$.) Let $\mathbf{k} = (k_0,...,k_J)$ be the imposed maximum counts across the categories, and let $\dot{k} \equiv \sum_j k_j$ be the total maximum count. (I will use lower case here since this is assumed to be fixed rather than random.) You then have a sequence of values $W_1,...,W_{\dot{k}}$ such that:
$$\mathbb{P}(W_i = j|W_1,...,W_{i-1}) = \frac{\exp(v_j) \cdot I_{i,j}}{I_{i,0} + \sum_j \exp(v_j) \cdot I_{i,j}},$$
where $X_j(i) \equiv \sum_{r=1}^{i} \mathbb{I}(W_i = j)$ are the category counts after the $i$th value is selected, and the indicator $I_{i,j}$ is defined as $I_{i,j} \equiv \mathbb{I} ( X_j(i) < k_j )$. Notably, after observing $\dot{k}$ values from this model, the category counts must necessarily be at the maximums, so $\mathbf{X}(\dot{k}) = \mathbf{k}$.
This is a complicated generalisation of the multinomial model, with the latter occurring in the special case where $\mathbf{k} = (\infty,...,\infty)$, so that there are no maximums on the category counts.
Writing the distribution of $\mathbf{X}$: The count vector $\mathbf{X}$ is a function of the underlying categorical variables $W_1,...,W_N$. Denote this function by $T:\mathbf{W} \mapsto \mathbf{X}$. For any given $N \leqslant \dot{k}$ we define the set of $N$ category vectors:
$$\mathscr{S}(\mathbf{x}, \mathbf{k}) \equiv
\Bigg\{ (w_1,...,w_N) \in \{ 0,...,J \}^N \Bigg| T(\mathbf{w}) = \mathbf{x} \leqslant \mathbf{k} \Bigg\}.$$
The set $$ gives us the set of all vectors $w_1,...,w_N$ that lead to an admissible count vector $\mathbf{x}$ (admissible in the sense that none of the counts are above the specified maximum).
$$\begin{equation} \begin{aligned}
\mathbb{P}(\mathbf{X} = \mathbf{x})
&= \mathbb{P}(\mathbf{W} \in \mathscr{S}(\mathbf{x}, \mathbf{k})) \\[6pt]
&= \sum_{\mathbb{w} \in \mathscr{S}(\mathbf{x}, \mathbf{k})} \mathbb{P}(\mathbf{W} = \mathbf{w}) \\[6pt]
&= \sum_{\mathbb{w} \in \mathscr{S}(\mathbf{x}, \mathbf{k})}
\prod_{i=1}^N \mathbb{P}(W_i = w_i|W_1 = w_1,...,W_{i-1} = w_{i-1}) \\[6pt]
&= \sum_{\mathbb{w} \in \mathscr{S}(\mathbf{x}, \mathbf{k})}
\prod_{i=1}^N \frac{\exp(v_{w_i}) \cdot I_{i,{w_i}}}{I_{i,0} + \sum_j \exp(v_j) \cdot I_{i,j}}. \\[6pt]
\end{aligned} \end{equation}$$
As you can see, this is a horrendously complicated expression. Unless $N$ and $J$ are both very small, the summation in this expression will get very complicated indeed. Technically this is a closed form expression, since it is a finite sum of terms involving elementary operations. However, the expression is complicated heavy by the fact that it involves a sum over a combinatorial set that is hard to construct, and the summand involves a product of terms that each key of counts from the previous elements of the category vector.
I am unaware of any way this can be simplified further. In view of this, there does not appear to me to be any simple closed form expression for the distribution of the count vector $\mathbf{X}(N)$ (except for the trivial case where $N=\dot{k}$). You would therefore need to generate the distribution of the count vector by simulation from the model. It is unlikely that there can be any efficiency gain beyond simulating the underlying values in the model from the above categorical distributions.
|
Distribution of random variable with multinomial sampling distribution and parameters $(n,p)$, where
At the moment your model is not clearly defined, so it is premature to seek the distribution of the count vector $X$. You are seeking to generalise from the multinomial distribution, which is the dis
|
43,003
|
Implicit Feedback Factorization Machines : Format of Input and Recommendations
|
Your intuition is correct, unless we have a few tens of thousand items it can quickly become too expensive to generate hundred of thousands of rankings and then sort them. What is done is commonly referred as "candidate items selection"; estimates are generated for a subset of the available items. We aim to avoid unnecessarily evaluating items that have extremely small probability to be in the final top-$k$ ranking. To that extent, there is no difference due to Implicit or Explicit feedback mechanisms.
Simplistically, the above mentioned "pruning" can be achieved by simply evaluating items $I_U$ such that these are the items that were ranked by a group of users $U$ who themselves are clustered together the candidate user $U_c$. That are far more rigorous approaches: A prototypical algorithm for this task is Weighted AND (WAND) as this was proposed by Broder et al. (2003) in Efficient query evaluation using a two-level retrieval process. It creates what could be considered an "approximate" ranking based on the presence or absence of certain high-impact features and then if that approximate ranking is above a certain threshold then a full ranking is estimated. Asadi & Lin's (2013) Effectiveness/Efficiency Tradeoffs for Candidate Generation in Multi-Stage Retrieval Architecture give a nice overview of different candidate generation approaches. Recent develops build on WAND (e.g. Borisyuk et al. (2016) CaSMoS: A Framework for Learning Candidate Selection Models over Structured Queries and Documents) as well as circumvent altogether (e.g. Wang X. et al. (2016) Skype: top-k spatial-keyword publish/subscribe over sliding window). For the sake of completeness: the actual indexing system used by each algorithm is crucial. Without getting into any gory details, WAND and other algorithms like BMW, are what we call DaaT - Document-at-a-time approaches, documents are evaluated in an iterative manner and we have document-ordered indices. There are other approaches like Term-at-a-time (TaaT), where we have frequency-order indices and Score-at-a-Tie (SaaT) where we have impact-order indices. Crane et al. (2017) A Comparison of Document-at-a-Time and Score-at-a-Time Query Evaluation offer a comprehensive look into this comparison.
Final caveat: As one might correctly recognise the approaches previously mentioned exaggerate the problem of the "rich-getting-richer" issue, i.e. popular items getting consistently recommended more often. While this phenomenon is well-known for some years (e.g. Celma & Cano (2008) From hits to niches? or how popular artists can bias music recommendation and discovery) it is still an extremely active field of study (e.g. see Wang Y. et al. (2015) Peacock: Learning Long-Tail Topic Features for Industrial Applications or Antikacioglu & Ravi (2017) Post Processing Recommender Systems for Diversity) and if indeed we need to rank only a subset of the available candidate it would be good to keep it in mind.
To succinctly address the initial question of input formats: Encoding negative examples (or absence of inforation) can indeed lead to extremely large datasets of sparse data. One of the first ML formats to address this was the LibSVM format for sparse data. LibSVM is still generally accepted as a semi-reasonable standard especially when it comes to ranking (i.e. recommender systems) applications. For example, both XGBoost and Tensorflow offers way to read LibSVM data (see respectively the links here and here for more details). Nevertheless a lot of things are case specific and particular to algorithm used; the old Netflix Prize used per movie ratings in .txt files while the latest 2019 RecSys challenge reports session information in .csv files. Ultimately we do need "some sparse matrix" functionality and whether or not that is going to be provided by the format we use (e.g. LibSVM) or we just going to build it up as we read the data in (e.g. in the RecSys challenges) are up to us. Familiarising oneself with the particulars of the algorithms input format (e.g. the DMatrix in the case of XGBoost) is crucial when data size is an important factor.
|
Implicit Feedback Factorization Machines : Format of Input and Recommendations
|
Your intuition is correct, unless we have a few tens of thousand items it can quickly become too expensive to generate hundred of thousands of rankings and then sort them. What is done is commonly ref
|
Implicit Feedback Factorization Machines : Format of Input and Recommendations
Your intuition is correct, unless we have a few tens of thousand items it can quickly become too expensive to generate hundred of thousands of rankings and then sort them. What is done is commonly referred as "candidate items selection"; estimates are generated for a subset of the available items. We aim to avoid unnecessarily evaluating items that have extremely small probability to be in the final top-$k$ ranking. To that extent, there is no difference due to Implicit or Explicit feedback mechanisms.
Simplistically, the above mentioned "pruning" can be achieved by simply evaluating items $I_U$ such that these are the items that were ranked by a group of users $U$ who themselves are clustered together the candidate user $U_c$. That are far more rigorous approaches: A prototypical algorithm for this task is Weighted AND (WAND) as this was proposed by Broder et al. (2003) in Efficient query evaluation using a two-level retrieval process. It creates what could be considered an "approximate" ranking based on the presence or absence of certain high-impact features and then if that approximate ranking is above a certain threshold then a full ranking is estimated. Asadi & Lin's (2013) Effectiveness/Efficiency Tradeoffs for Candidate Generation in Multi-Stage Retrieval Architecture give a nice overview of different candidate generation approaches. Recent develops build on WAND (e.g. Borisyuk et al. (2016) CaSMoS: A Framework for Learning Candidate Selection Models over Structured Queries and Documents) as well as circumvent altogether (e.g. Wang X. et al. (2016) Skype: top-k spatial-keyword publish/subscribe over sliding window). For the sake of completeness: the actual indexing system used by each algorithm is crucial. Without getting into any gory details, WAND and other algorithms like BMW, are what we call DaaT - Document-at-a-time approaches, documents are evaluated in an iterative manner and we have document-ordered indices. There are other approaches like Term-at-a-time (TaaT), where we have frequency-order indices and Score-at-a-Tie (SaaT) where we have impact-order indices. Crane et al. (2017) A Comparison of Document-at-a-Time and Score-at-a-Time Query Evaluation offer a comprehensive look into this comparison.
Final caveat: As one might correctly recognise the approaches previously mentioned exaggerate the problem of the "rich-getting-richer" issue, i.e. popular items getting consistently recommended more often. While this phenomenon is well-known for some years (e.g. Celma & Cano (2008) From hits to niches? or how popular artists can bias music recommendation and discovery) it is still an extremely active field of study (e.g. see Wang Y. et al. (2015) Peacock: Learning Long-Tail Topic Features for Industrial Applications or Antikacioglu & Ravi (2017) Post Processing Recommender Systems for Diversity) and if indeed we need to rank only a subset of the available candidate it would be good to keep it in mind.
To succinctly address the initial question of input formats: Encoding negative examples (or absence of inforation) can indeed lead to extremely large datasets of sparse data. One of the first ML formats to address this was the LibSVM format for sparse data. LibSVM is still generally accepted as a semi-reasonable standard especially when it comes to ranking (i.e. recommender systems) applications. For example, both XGBoost and Tensorflow offers way to read LibSVM data (see respectively the links here and here for more details). Nevertheless a lot of things are case specific and particular to algorithm used; the old Netflix Prize used per movie ratings in .txt files while the latest 2019 RecSys challenge reports session information in .csv files. Ultimately we do need "some sparse matrix" functionality and whether or not that is going to be provided by the format we use (e.g. LibSVM) or we just going to build it up as we read the data in (e.g. in the RecSys challenges) are up to us. Familiarising oneself with the particulars of the algorithms input format (e.g. the DMatrix in the case of XGBoost) is crucial when data size is an important factor.
|
Implicit Feedback Factorization Machines : Format of Input and Recommendations
Your intuition is correct, unless we have a few tens of thousand items it can quickly become too expensive to generate hundred of thousands of rankings and then sort them. What is done is commonly ref
|
43,004
|
Does Approximate Bayesian Computation (ABC) follow the Likelihood Principle?
|
The "when the likelihood function is tractable" is somewhat self-defeating, as the reason for using ABC is that it is intractable.
As for the likelihood principle, ABC is definitely not respecting it, since it requires a simulation of the data from its sampling distribution. It thus uses the frequentist properties of that distribution rather than the likelihood itself. Except in the (unrealistic) limiting case when the tolerance is exactly zero and the distance is based on the sufficient statistic, the ABC thus fails to agree with the likelihood principle.
In my humble opinion, this is a minor issue when compared with the major problems faced by ABC, unless you can provide an example with dire (There are also exact Bayesian approaches that do not agree with the likelihood principle, witness the Jeffreys or matching priors.)
|
Does Approximate Bayesian Computation (ABC) follow the Likelihood Principle?
|
The "when the likelihood function is tractable" is somewhat self-defeating, as the reason for using ABC is that it is intractable.
As for the likelihood principle, ABC is definitely not respecting it,
|
Does Approximate Bayesian Computation (ABC) follow the Likelihood Principle?
The "when the likelihood function is tractable" is somewhat self-defeating, as the reason for using ABC is that it is intractable.
As for the likelihood principle, ABC is definitely not respecting it, since it requires a simulation of the data from its sampling distribution. It thus uses the frequentist properties of that distribution rather than the likelihood itself. Except in the (unrealistic) limiting case when the tolerance is exactly zero and the distance is based on the sufficient statistic, the ABC thus fails to agree with the likelihood principle.
In my humble opinion, this is a minor issue when compared with the major problems faced by ABC, unless you can provide an example with dire (There are also exact Bayesian approaches that do not agree with the likelihood principle, witness the Jeffreys or matching priors.)
|
Does Approximate Bayesian Computation (ABC) follow the Likelihood Principle?
The "when the likelihood function is tractable" is somewhat self-defeating, as the reason for using ABC is that it is intractable.
As for the likelihood principle, ABC is definitely not respecting it,
|
43,005
|
How can we verify the intuition that in the RW-Metropolis-Hastings algorithm with Gaussian proposal too small and too large variances are bad choices
|
The original approach by Gareth Roberts et al. is to investigate the limiting distribution of the first coordinate process $X^{(1)}_n$, accelerated by a factor $d$. This leads to the limiting process $Z_t = X^{(1)}_{\lfloor t d \rfloor}$.
If you put $\alpha < 1/2$ (large steps), it can be shown that asymptotically none of the proposed moves are going to be accepted, so that the process $(Z_t)$ is constant almost surely.
Similarly, if $\alpha > 1/2$ (small steps), asymptotically all moves are going to be accepted but the moves are so small, so that again the limiting process $(Z_t)$ is constant almost surely.
Finally, only for $\alpha = 1/2$, we get a non-trivial limiting process (which happens to be a Langevin diffusion).
This is the way in which $\alpha = 1/2$ can be considered an optimal choice. For a more precise statement and proof of this result, consult the original research paper which is very readable.
Roberts, G. O., Gelman, A., & Gilks, W. R. (1997). Weak convergence and optimal scaling of random walk Metropolis algorithms. The Annals of Applied Probability, 7(1), 110–120. https://doi.org/10.1214/aoap/1034625254
The result is later extended in various ways: e.g. looking at different functions of the high-dimensional process (instead of the first coordinate), and more general distributional assumptions. Also different Metropolis-Hastings algorithms have been studied, for example the MALA algorithm, which was shown to require a time speed up of only $d^{1/3}$ instead of $d$ in order to converge. This is also discussed in the survey paper you are reading.
|
How can we verify the intuition that in the RW-Metropolis-Hastings algorithm with Gaussian proposal
|
The original approach by Gareth Roberts et al. is to investigate the limiting distribution of the first coordinate process $X^{(1)}_n$, accelerated by a factor $d$. This leads to the limiting process
|
How can we verify the intuition that in the RW-Metropolis-Hastings algorithm with Gaussian proposal too small and too large variances are bad choices
The original approach by Gareth Roberts et al. is to investigate the limiting distribution of the first coordinate process $X^{(1)}_n$, accelerated by a factor $d$. This leads to the limiting process $Z_t = X^{(1)}_{\lfloor t d \rfloor}$.
If you put $\alpha < 1/2$ (large steps), it can be shown that asymptotically none of the proposed moves are going to be accepted, so that the process $(Z_t)$ is constant almost surely.
Similarly, if $\alpha > 1/2$ (small steps), asymptotically all moves are going to be accepted but the moves are so small, so that again the limiting process $(Z_t)$ is constant almost surely.
Finally, only for $\alpha = 1/2$, we get a non-trivial limiting process (which happens to be a Langevin diffusion).
This is the way in which $\alpha = 1/2$ can be considered an optimal choice. For a more precise statement and proof of this result, consult the original research paper which is very readable.
Roberts, G. O., Gelman, A., & Gilks, W. R. (1997). Weak convergence and optimal scaling of random walk Metropolis algorithms. The Annals of Applied Probability, 7(1), 110–120. https://doi.org/10.1214/aoap/1034625254
The result is later extended in various ways: e.g. looking at different functions of the high-dimensional process (instead of the first coordinate), and more general distributional assumptions. Also different Metropolis-Hastings algorithms have been studied, for example the MALA algorithm, which was shown to require a time speed up of only $d^{1/3}$ instead of $d$ in order to converge. This is also discussed in the survey paper you are reading.
|
How can we verify the intuition that in the RW-Metropolis-Hastings algorithm with Gaussian proposal
The original approach by Gareth Roberts et al. is to investigate the limiting distribution of the first coordinate process $X^{(1)}_n$, accelerated by a factor $d$. This leads to the limiting process
|
43,006
|
How to calculate causal effects with repeated exogenous shocks over a time series
|
The situation that you describe sound like simple treatment effect story, where the exogenous binary shock represent the treatment. If you have the shock $T=1$, otherwise $T=0$. The blue line represent the level of $x$, your outcome variable. In time series sense $x$ seems stationary, so it come back to the long run mean, then the effect of the shocks is not permanent.
So you can simply compute the difference in the conditional means
$E[x|T=1]-E[x|T=0]$
and it represent the average causal effect (ACE) of the treatment/shock
Note that you assume exogeneity of the shocks (treatments), like in idealized experiment situations, therefore selection bias disappear. Probably you refers on observational situations and among them the endogeneity by confounding variables represent the main problem.
Causal effect in stationary time series can be more exhaustively treated with autoregressive distributed lag models (see for example Econometrics - Verbeek 2017 chap 9.1)
|
How to calculate causal effects with repeated exogenous shocks over a time series
|
The situation that you describe sound like simple treatment effect story, where the exogenous binary shock represent the treatment. If you have the shock $T=1$, otherwise $T=0$. The blue line represen
|
How to calculate causal effects with repeated exogenous shocks over a time series
The situation that you describe sound like simple treatment effect story, where the exogenous binary shock represent the treatment. If you have the shock $T=1$, otherwise $T=0$. The blue line represent the level of $x$, your outcome variable. In time series sense $x$ seems stationary, so it come back to the long run mean, then the effect of the shocks is not permanent.
So you can simply compute the difference in the conditional means
$E[x|T=1]-E[x|T=0]$
and it represent the average causal effect (ACE) of the treatment/shock
Note that you assume exogeneity of the shocks (treatments), like in idealized experiment situations, therefore selection bias disappear. Probably you refers on observational situations and among them the endogeneity by confounding variables represent the main problem.
Causal effect in stationary time series can be more exhaustively treated with autoregressive distributed lag models (see for example Econometrics - Verbeek 2017 chap 9.1)
|
How to calculate causal effects with repeated exogenous shocks over a time series
The situation that you describe sound like simple treatment effect story, where the exogenous binary shock represent the treatment. If you have the shock $T=1$, otherwise $T=0$. The blue line represen
|
43,007
|
How to calculate causal effects with repeated exogenous shocks over a time series
|
Basically you need a good model for the process without shocks, and a good model for a) the effect of the shock on the process, and probably b) the dependence of the effect of the shock on the process. Any answer will be contingent on these. As far as I can see, the 'difference in conditional means' approach discussed by markowitz relies on the assumptions that a) the process characteristics are unchanged by the shock, b) the effect of the shock is realised approximately instantly, and dissipates approximately instantly, and c) the effect of the shock is independent of the state of the system / previous shocks. These may be workable assumptions, but in many cases not. I've a little bit of work discussing ways to think about the modelling of shocks here: https://www.researchgate.net/profile/Charles_Driver/publication/323457904_Understanding_the_time_course_of_interventions_with_continuous_time_dynamic_models/links/5bdef77b299bf1124fba5c00/Understanding-the-time-course-of-interventions-with-continuous-time-dynamic-models.pdf
though that only scratches the surface -- you could take a look at the modelling of hemodynamic response functions in FMRI research for further inspiration.
|
How to calculate causal effects with repeated exogenous shocks over a time series
|
Basically you need a good model for the process without shocks, and a good model for a) the effect of the shock on the process, and probably b) the dependence of the effect of the shock on the process
|
How to calculate causal effects with repeated exogenous shocks over a time series
Basically you need a good model for the process without shocks, and a good model for a) the effect of the shock on the process, and probably b) the dependence of the effect of the shock on the process. Any answer will be contingent on these. As far as I can see, the 'difference in conditional means' approach discussed by markowitz relies on the assumptions that a) the process characteristics are unchanged by the shock, b) the effect of the shock is realised approximately instantly, and dissipates approximately instantly, and c) the effect of the shock is independent of the state of the system / previous shocks. These may be workable assumptions, but in many cases not. I've a little bit of work discussing ways to think about the modelling of shocks here: https://www.researchgate.net/profile/Charles_Driver/publication/323457904_Understanding_the_time_course_of_interventions_with_continuous_time_dynamic_models/links/5bdef77b299bf1124fba5c00/Understanding-the-time-course-of-interventions-with-continuous-time-dynamic-models.pdf
though that only scratches the surface -- you could take a look at the modelling of hemodynamic response functions in FMRI research for further inspiration.
|
How to calculate causal effects with repeated exogenous shocks over a time series
Basically you need a good model for the process without shocks, and a good model for a) the effect of the shock on the process, and probably b) the dependence of the effect of the shock on the process
|
43,008
|
How to calculate causal effects with repeated exogenous shocks over a time series
|
The problem you describe in your question is discussed in detail in the following paper:
Bojinov, Iavor, and Neil Shephard. "Time series experiments and causal estimands: exact randomization tests and trading." Journal of the American Statistical Association 114, no. 528 (2019): 1665-1682.
It would not be very useful to summarize the paper here, because of the significant amount of setup that would be required; besides, you state that you are looking for a "canonical answer."
|
How to calculate causal effects with repeated exogenous shocks over a time series
|
The problem you describe in your question is discussed in detail in the following paper:
Bojinov, Iavor, and Neil Shephard. "Time series experiments and causal estimands: exact randomization tests and
|
How to calculate causal effects with repeated exogenous shocks over a time series
The problem you describe in your question is discussed in detail in the following paper:
Bojinov, Iavor, and Neil Shephard. "Time series experiments and causal estimands: exact randomization tests and trading." Journal of the American Statistical Association 114, no. 528 (2019): 1665-1682.
It would not be very useful to summarize the paper here, because of the significant amount of setup that would be required; besides, you state that you are looking for a "canonical answer."
|
How to calculate causal effects with repeated exogenous shocks over a time series
The problem you describe in your question is discussed in detail in the following paper:
Bojinov, Iavor, and Neil Shephard. "Time series experiments and causal estimands: exact randomization tests and
|
43,009
|
Can double dipping be reasonable?
|
Looking at the overall pattern you describe: yes this could be reasonable (or, it's not obviously unreasonable).
Why? The starting position for MCMC can be arbitrarily chosen. So long as the chain is run to stationarity. Choosing a reasonable starting position will reduce compute time.
You do have to look out for some problems though. In the case of a multimodal distribution, starting multiple chains at the same mode could fool you into believing you've sampled the whole space when you have not (but this is a special problem).
Using the data to form a prior is a conceptually separate issue, which sometimes goes under the name of empirical Bayes. Empirical Bayes is neither wrong nor right.
In my opinion it's often safe to extract some extremely general information from a dataset using empirical Bayes. E.g. extract the range of possible values |max - min| of the data in order to calibrate, say, a prior on the variance of some parameter - is it 10^1 or 10^6? But not, e.g. what was the value of unit $i$ at time $t$?
|
Can double dipping be reasonable?
|
Looking at the overall pattern you describe: yes this could be reasonable (or, it's not obviously unreasonable).
Why? The starting position for MCMC can be arbitrarily chosen. So long as the chain is
|
Can double dipping be reasonable?
Looking at the overall pattern you describe: yes this could be reasonable (or, it's not obviously unreasonable).
Why? The starting position for MCMC can be arbitrarily chosen. So long as the chain is run to stationarity. Choosing a reasonable starting position will reduce compute time.
You do have to look out for some problems though. In the case of a multimodal distribution, starting multiple chains at the same mode could fool you into believing you've sampled the whole space when you have not (but this is a special problem).
Using the data to form a prior is a conceptually separate issue, which sometimes goes under the name of empirical Bayes. Empirical Bayes is neither wrong nor right.
In my opinion it's often safe to extract some extremely general information from a dataset using empirical Bayes. E.g. extract the range of possible values |max - min| of the data in order to calibrate, say, a prior on the variance of some parameter - is it 10^1 or 10^6? But not, e.g. what was the value of unit $i$ at time $t$?
|
Can double dipping be reasonable?
Looking at the overall pattern you describe: yes this could be reasonable (or, it's not obviously unreasonable).
Why? The starting position for MCMC can be arbitrarily chosen. So long as the chain is
|
43,010
|
Is Structurally Missing Data a subset of Missing at Random Data?
|
No, I would consider Structurally Missing Data to be a separate category, with distinct methods of dealing with it in analyses.
It is definitely not Missing at Random. By definition, it is non-random, being instead logically associated with specific values of a different variable. Let's use a lightly modified version of the example at the link: consider the variables Has_children? (yes/no) and age_of_youngest_child. If a person has no children, then age_of_youngest_child is undefined, not omitted. The missing values for age_of_youngest_child are associated logically with a specific value in Has_children?.
Note that MAR and MCAR are frequently solved by multiple imputation, while Structurally Missing Data cannot be.
EDIT (h/t to kjetil b halvorsen for the suggestion in the comments):
As to how to analyse data such as this, the key is to put the nested variable into the model as an interaction term only, with no main effect. This is explain in much more detail at How do you deal with "nested" variables in a regression model?
|
Is Structurally Missing Data a subset of Missing at Random Data?
|
No, I would consider Structurally Missing Data to be a separate category, with distinct methods of dealing with it in analyses.
It is definitely not Missing at Random. By definition, it is non-random
|
Is Structurally Missing Data a subset of Missing at Random Data?
No, I would consider Structurally Missing Data to be a separate category, with distinct methods of dealing with it in analyses.
It is definitely not Missing at Random. By definition, it is non-random, being instead logically associated with specific values of a different variable. Let's use a lightly modified version of the example at the link: consider the variables Has_children? (yes/no) and age_of_youngest_child. If a person has no children, then age_of_youngest_child is undefined, not omitted. The missing values for age_of_youngest_child are associated logically with a specific value in Has_children?.
Note that MAR and MCAR are frequently solved by multiple imputation, while Structurally Missing Data cannot be.
EDIT (h/t to kjetil b halvorsen for the suggestion in the comments):
As to how to analyse data such as this, the key is to put the nested variable into the model as an interaction term only, with no main effect. This is explain in much more detail at How do you deal with "nested" variables in a regression model?
|
Is Structurally Missing Data a subset of Missing at Random Data?
No, I would consider Structurally Missing Data to be a separate category, with distinct methods of dealing with it in analyses.
It is definitely not Missing at Random. By definition, it is non-random
|
43,011
|
When does my autoencoder start to overfit?
|
As validation tells about generalization of the algorithm. And from your graph, ADAM is working very good, with a biased response. But for sure, there is no overfitting sign in there.
For biasing check, you can try out k-fold method, and check the response of algorithm for each fold. Then you can find, whether this is irreducible error or something else.
|
When does my autoencoder start to overfit?
|
As validation tells about generalization of the algorithm. And from your graph, ADAM is working very good, with a biased response. But for sure, there is no overfitting sign in there.
For biasing chec
|
When does my autoencoder start to overfit?
As validation tells about generalization of the algorithm. And from your graph, ADAM is working very good, with a biased response. But for sure, there is no overfitting sign in there.
For biasing check, you can try out k-fold method, and check the response of algorithm for each fold. Then you can find, whether this is irreducible error or something else.
|
When does my autoencoder start to overfit?
As validation tells about generalization of the algorithm. And from your graph, ADAM is working very good, with a biased response. But for sure, there is no overfitting sign in there.
For biasing chec
|
43,012
|
When does my autoencoder start to overfit?
|
@Sycorax answer is what comes the closest to the answer.
Usually, overfitting is described as the model training error going down while validation error goes up, which means the model is learning patterns that don't generalize beyond the training set.
In the case of an autoencoder, you're training the model to reproduce the input. At an extreme your model could simply be output = input and both validation and training loss would be 0.
But that's not what you want from an autoencoder for anomaly detection.
You want the model to learn an abstract representation of what the input should look like, so the model develop the ability to generate instances on it's own when presented with an input.
The distance or error between what the model "think it should look like" and the input is what tells us if the input is "abnormal" or not.
Best way to assess it would be to present the model with valid and invalid instances and monitor the reconstruction error. If it tends to be the same on both set your model is most probably learning the identity function and needs to be modified.
|
When does my autoencoder start to overfit?
|
@Sycorax answer is what comes the closest to the answer.
Usually, overfitting is described as the model training error going down while validation error goes up, which means the model is learning patt
|
When does my autoencoder start to overfit?
@Sycorax answer is what comes the closest to the answer.
Usually, overfitting is described as the model training error going down while validation error goes up, which means the model is learning patterns that don't generalize beyond the training set.
In the case of an autoencoder, you're training the model to reproduce the input. At an extreme your model could simply be output = input and both validation and training loss would be 0.
But that's not what you want from an autoencoder for anomaly detection.
You want the model to learn an abstract representation of what the input should look like, so the model develop the ability to generate instances on it's own when presented with an input.
The distance or error between what the model "think it should look like" and the input is what tells us if the input is "abnormal" or not.
Best way to assess it would be to present the model with valid and invalid instances and monitor the reconstruction error. If it tends to be the same on both set your model is most probably learning the identity function and needs to be modified.
|
When does my autoencoder start to overfit?
@Sycorax answer is what comes the closest to the answer.
Usually, overfitting is described as the model training error going down while validation error goes up, which means the model is learning patt
|
43,013
|
Data Augmentation in Keras: How many training observations do I end up with?
|
Data augmentation is used to artificially increase the number of samples in the training set (because small datasets are more vulnerable to over-fitting).
Keras is using an online data-augmentation process, where every single image is augmented at the start of every epoch (they are probably processed in batches, but the point is that it happens ones per epoch).
With the exemption of the horizontal flip (which doubles the number of samples), all the remaining augmentation techniques consist of a range of possible operations. If you want to treat this range as continues, you end up with an infinite amount of samples. Obviously each individual process is actually discrete so you can calculate the final number of possible samples as the product of the individual affects of all techniques:
For example the width shift is discreetly limited by the number of pixels in the x axis of the images, So for a value of 0.2, each image can be shifted up to 0.2*number of pixels in the x axis, and the shift can be either to the left or to the right (so we double the number).
* There is a chance that Keras also performs some sub-pixel shifts (it should be in their documentation), but it just means that this number needs to be further multiplied by some factor.
You can perform this calculation for every single operation with the aid of the source code from Keras: Image Preprocessing source code
|
Data Augmentation in Keras: How many training observations do I end up with?
|
Data augmentation is used to artificially increase the number of samples in the training set (because small datasets are more vulnerable to over-fitting).
Keras is using an online data-augmentation pr
|
Data Augmentation in Keras: How many training observations do I end up with?
Data augmentation is used to artificially increase the number of samples in the training set (because small datasets are more vulnerable to over-fitting).
Keras is using an online data-augmentation process, where every single image is augmented at the start of every epoch (they are probably processed in batches, but the point is that it happens ones per epoch).
With the exemption of the horizontal flip (which doubles the number of samples), all the remaining augmentation techniques consist of a range of possible operations. If you want to treat this range as continues, you end up with an infinite amount of samples. Obviously each individual process is actually discrete so you can calculate the final number of possible samples as the product of the individual affects of all techniques:
For example the width shift is discreetly limited by the number of pixels in the x axis of the images, So for a value of 0.2, each image can be shifted up to 0.2*number of pixels in the x axis, and the shift can be either to the left or to the right (so we double the number).
* There is a chance that Keras also performs some sub-pixel shifts (it should be in their documentation), but it just means that this number needs to be further multiplied by some factor.
You can perform this calculation for every single operation with the aid of the source code from Keras: Image Preprocessing source code
|
Data Augmentation in Keras: How many training observations do I end up with?
Data augmentation is used to artificially increase the number of samples in the training set (because small datasets are more vulnerable to over-fitting).
Keras is using an online data-augmentation pr
|
43,014
|
Weighted Cosine Similarity
|
scipy.spatial.distance.cosine has implemented weighted cosine similarity as follows (source):
$$\frac{\sum_{i}{w_i u_i v_i}}{\sqrt{\sum_{i}w_i u_i^2}\sqrt{\sum_{i}w_i v_i^2}}$$
I know this doesn't actually answer this question, but since scipy has implemented like this, may be this is better than both of your approaches.
Also you can see that by using square root of your weights in your second approach will give scipy method. This will differ when you use your weights to sum up to 1
|
Weighted Cosine Similarity
|
scipy.spatial.distance.cosine has implemented weighted cosine similarity as follows (source):
$$\frac{\sum_{i}{w_i u_i v_i}}{\sqrt{\sum_{i}w_i u_i^2}\sqrt{\sum_{i}w_i v_i^2}}$$
I know this doesn't act
|
Weighted Cosine Similarity
scipy.spatial.distance.cosine has implemented weighted cosine similarity as follows (source):
$$\frac{\sum_{i}{w_i u_i v_i}}{\sqrt{\sum_{i}w_i u_i^2}\sqrt{\sum_{i}w_i v_i^2}}$$
I know this doesn't actually answer this question, but since scipy has implemented like this, may be this is better than both of your approaches.
Also you can see that by using square root of your weights in your second approach will give scipy method. This will differ when you use your weights to sum up to 1
|
Weighted Cosine Similarity
scipy.spatial.distance.cosine has implemented weighted cosine similarity as follows (source):
$$\frac{\sum_{i}{w_i u_i v_i}}{\sqrt{\sum_{i}w_i u_i^2}\sqrt{\sum_{i}w_i v_i^2}}$$
I know this doesn't act
|
43,015
|
Intuition behind perplexity parameter in t-SNE
|
if you write down the equation for perplexity defined by the conditional distribution in the original paper. it does not increase wrt to the entropy simply because the conditional distribution is discrete and is not gaussian. It is not a rigorous term and in the original paper they didn't even talk about it in detail... it is completely a different thing from gaussian entropy....I think that's why tsne gives very confusing results sometimes....
|
Intuition behind perplexity parameter in t-SNE
|
if you write down the equation for perplexity defined by the conditional distribution in the original paper. it does not increase wrt to the entropy simply because the conditional distribution is disc
|
Intuition behind perplexity parameter in t-SNE
if you write down the equation for perplexity defined by the conditional distribution in the original paper. it does not increase wrt to the entropy simply because the conditional distribution is discrete and is not gaussian. It is not a rigorous term and in the original paper they didn't even talk about it in detail... it is completely a different thing from gaussian entropy....I think that's why tsne gives very confusing results sometimes....
|
Intuition behind perplexity parameter in t-SNE
if you write down the equation for perplexity defined by the conditional distribution in the original paper. it does not increase wrt to the entropy simply because the conditional distribution is disc
|
43,016
|
Intuition behind perplexity parameter in t-SNE
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Yeah, i can't agree with you more, in my view, perplexity doesn't increase monotonically with σ at all. Considering two extrame scenario, when σ is extremely close to zero, and when σ is extremely large, in these two cases, the perplexities are equal.
|
Intuition behind perplexity parameter in t-SNE
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
Intuition behind perplexity parameter in t-SNE
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Yeah, i can't agree with you more, in my view, perplexity doesn't increase monotonically with σ at all. Considering two extrame scenario, when σ is extremely close to zero, and when σ is extremely large, in these two cases, the perplexities are equal.
|
Intuition behind perplexity parameter in t-SNE
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
43,017
|
how to deal with correlated/colinear features when using Permutation feature importance?
|
Regularize. If you regularize your model and inputs, you should remove the issue of multi-collinearity.
Correlation is not causation, however, and so while you can use your method to assign "predictive power" to your features, you cannot establish any sort of causal relationship.
|
how to deal with correlated/colinear features when using Permutation feature importance?
|
Regularize. If you regularize your model and inputs, you should remove the issue of multi-collinearity.
Correlation is not causation, however, and so while you can use your method to assign "predictiv
|
how to deal with correlated/colinear features when using Permutation feature importance?
Regularize. If you regularize your model and inputs, you should remove the issue of multi-collinearity.
Correlation is not causation, however, and so while you can use your method to assign "predictive power" to your features, you cannot establish any sort of causal relationship.
|
how to deal with correlated/colinear features when using Permutation feature importance?
Regularize. If you regularize your model and inputs, you should remove the issue of multi-collinearity.
Correlation is not causation, however, and so while you can use your method to assign "predictiv
|
43,018
|
Clarification of the intuition behind backpropagation
|
What you want to compute, is
$$\frac{\partial \sigma(\hat{x})}{\partial \vec{x}}=\left[\frac{\partial \sigma(\hat{x})}{\partial x_0},\frac{\partial \sigma(\hat{x})}{\partial x_1}\right]$$
and
$$\frac{\partial \sigma({\hat{x}})}{\partial \vec{w}}=\left[\frac{\partial \sigma(\hat{x})}{\partial w_0},\frac{\partial \sigma(\hat{x})}{\partial w_1},\frac{\partial \sigma(\hat{x})}{\partial w_2}\right]$$
knowing that $\hat{x}$ is in fact a function of those variables, as $\hat{x}=w_0x_0+w_1x_1+w_2$.
You can use the chain rule to compute this as:
$$\frac{\partial \sigma(\hat{x})}{\partial x_0}=\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}\frac{\partial \hat{x}}{\partial x_0}$$
You already know $\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}$
as its
$$\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}=(1-\sigma(\hat{x}))\sigma(\hat{x})$$
and the second derivative is trivial (its just a polynomial! $\frac{\partial \hat{x}}{\partial x_0}=w_0$). You now only need to compute for the 5 partial derivatives. In short:
$$\frac{\partial \sigma(\hat{x})}{\partial \vec{x}}=\left[\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}w_0,\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}w_1\right]$$
$$\frac{\partial \sigma(\hat{\hat{x}})}{\partial \vec{w}}=\left[\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}x_0,\frac{\partial \sigma(x)}{\partial \hat{x}}x_1,\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}\right]$$
|
Clarification of the intuition behind backpropagation
|
What you want to compute, is
$$\frac{\partial \sigma(\hat{x})}{\partial \vec{x}}=\left[\frac{\partial \sigma(\hat{x})}{\partial x_0},\frac{\partial \sigma(\hat{x})}{\partial x_1}\right]$$
and
$$\fr
|
Clarification of the intuition behind backpropagation
What you want to compute, is
$$\frac{\partial \sigma(\hat{x})}{\partial \vec{x}}=\left[\frac{\partial \sigma(\hat{x})}{\partial x_0},\frac{\partial \sigma(\hat{x})}{\partial x_1}\right]$$
and
$$\frac{\partial \sigma({\hat{x}})}{\partial \vec{w}}=\left[\frac{\partial \sigma(\hat{x})}{\partial w_0},\frac{\partial \sigma(\hat{x})}{\partial w_1},\frac{\partial \sigma(\hat{x})}{\partial w_2}\right]$$
knowing that $\hat{x}$ is in fact a function of those variables, as $\hat{x}=w_0x_0+w_1x_1+w_2$.
You can use the chain rule to compute this as:
$$\frac{\partial \sigma(\hat{x})}{\partial x_0}=\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}\frac{\partial \hat{x}}{\partial x_0}$$
You already know $\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}$
as its
$$\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}=(1-\sigma(\hat{x}))\sigma(\hat{x})$$
and the second derivative is trivial (its just a polynomial! $\frac{\partial \hat{x}}{\partial x_0}=w_0$). You now only need to compute for the 5 partial derivatives. In short:
$$\frac{\partial \sigma(\hat{x})}{\partial \vec{x}}=\left[\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}w_0,\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}w_1\right]$$
$$\frac{\partial \sigma(\hat{\hat{x}})}{\partial \vec{w}}=\left[\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}x_0,\frac{\partial \sigma(x)}{\partial \hat{x}}x_1,\frac{\partial \sigma(\hat{x})}{\partial \hat{x}}\right]$$
|
Clarification of the intuition behind backpropagation
What you want to compute, is
$$\frac{\partial \sigma(\hat{x})}{\partial \vec{x}}=\left[\frac{\partial \sigma(\hat{x})}{\partial x_0},\frac{\partial \sigma(\hat{x})}{\partial x_1}\right]$$
and
$$\fr
|
43,019
|
Clarification of the intuition behind backpropagation
|
The best way to understand backpropagation for a programmer is in terms of the chain rule as a recursion.
Here's the chain rule. You have a nested function expression $y=f(g(x))$. First you look at it as two different functions:
$$f(x)\\g(x)$$
When you do forward propagation it's nothing but this psudo code:
$$t=g(x)\\
y=f(t)$$
Now, if you want to take a derivative, you apply a chain rule:
$$y'=f(g(x))'=f'g'$$
where $$f'=df(t)/dt$$ and $$g'=dg(x)/dx$$
This is basically a recursion on a nested structure. If $g(x)=g(h(x))$, then you simply apply the chain rule again, and keep doing it until you reach the bottom, i.e. the input layer in case of NN.
Here's an example, a one neuron: $$a=sigmoid(Wx+b)$$
You have two functions here: $sigmoid(x)$ and $Wx+b$.
If you have two layers of neurons it's not much different:
$$sigmoid(W_1*sigmoid(Wx+b)+b_1)$$
so you go backwards:
$$z=Wx+b\\a_1=sigmoid(z)\\z_1=W_1*a_1+b_1\\a_2=sigmoid(z_1)$$
|
Clarification of the intuition behind backpropagation
|
The best way to understand backpropagation for a programmer is in terms of the chain rule as a recursion.
Here's the chain rule. You have a nested function expression $y=f(g(x))$. First you look at it
|
Clarification of the intuition behind backpropagation
The best way to understand backpropagation for a programmer is in terms of the chain rule as a recursion.
Here's the chain rule. You have a nested function expression $y=f(g(x))$. First you look at it as two different functions:
$$f(x)\\g(x)$$
When you do forward propagation it's nothing but this psudo code:
$$t=g(x)\\
y=f(t)$$
Now, if you want to take a derivative, you apply a chain rule:
$$y'=f(g(x))'=f'g'$$
where $$f'=df(t)/dt$$ and $$g'=dg(x)/dx$$
This is basically a recursion on a nested structure. If $g(x)=g(h(x))$, then you simply apply the chain rule again, and keep doing it until you reach the bottom, i.e. the input layer in case of NN.
Here's an example, a one neuron: $$a=sigmoid(Wx+b)$$
You have two functions here: $sigmoid(x)$ and $Wx+b$.
If you have two layers of neurons it's not much different:
$$sigmoid(W_1*sigmoid(Wx+b)+b_1)$$
so you go backwards:
$$z=Wx+b\\a_1=sigmoid(z)\\z_1=W_1*a_1+b_1\\a_2=sigmoid(z_1)$$
|
Clarification of the intuition behind backpropagation
The best way to understand backpropagation for a programmer is in terms of the chain rule as a recursion.
Here's the chain rule. You have a nested function expression $y=f(g(x))$. First you look at it
|
43,020
|
Machine Learning and Missing Data: Impute, and If So When?
|
The inclination of some collaborators is to go with the complete case type analysis, where only subjects with full data are used, but this makes me slightly nervous, as I feel like those missing data patterns might have an impact.
I would argue that your intuition is correct, missing data can have strong predictive power which should not be thrown away.
The question is what to do with the missing data, and here are two options (out of many)
Use a decision tree based algorithm which can deal with missing data. In particular it will treat missing categorical data as a category of its own. For example XGboost, Light GBM, Catboost or any other advanced tree algorithm
For other algorithms that can't deal with NAN (e.g. logistic regression, neural networks etc): use some form of imputation on missing data: this will depend on the shape and specifics of the distribution of data. The mean is not always the best idea, and the mode, or a percentile is sometimes better
If you are mostly interested in predictive power then I suggest using tree based algorithms which have become the norm in Kaggle competitions (with great success)
|
Machine Learning and Missing Data: Impute, and If So When?
|
The inclination of some collaborators is to go with the complete case type analysis, where only subjects with full data are used, but this makes me slightly nervous, as I feel like those missing data
|
Machine Learning and Missing Data: Impute, and If So When?
The inclination of some collaborators is to go with the complete case type analysis, where only subjects with full data are used, but this makes me slightly nervous, as I feel like those missing data patterns might have an impact.
I would argue that your intuition is correct, missing data can have strong predictive power which should not be thrown away.
The question is what to do with the missing data, and here are two options (out of many)
Use a decision tree based algorithm which can deal with missing data. In particular it will treat missing categorical data as a category of its own. For example XGboost, Light GBM, Catboost or any other advanced tree algorithm
For other algorithms that can't deal with NAN (e.g. logistic regression, neural networks etc): use some form of imputation on missing data: this will depend on the shape and specifics of the distribution of data. The mean is not always the best idea, and the mode, or a percentile is sometimes better
If you are mostly interested in predictive power then I suggest using tree based algorithms which have become the norm in Kaggle competitions (with great success)
|
Machine Learning and Missing Data: Impute, and If So When?
The inclination of some collaborators is to go with the complete case type analysis, where only subjects with full data are used, but this makes me slightly nervous, as I feel like those missing data
|
43,021
|
Feature Selection in unbalanced data
|
In my experience feature selection tends to make performance worse rather than better if you are using a modern machine learning method that has some feature, such as regularisation, to avoid over-fitting. Miller's monograph on feature selection has similar advice hidden away in the appendices (sadly someone has borrowed my copy, so I can't find it). Basically feature selection is adding one binary degree of freedom to the learning problem for each input feature. This means the feature selection criteria can be reduced in two ways (i) getting rid of genuinely uninformative features (ii) selecting a set of features that happens to exploit some random sampling peculiarity of the data (i.e. overfitting). For an example of over-fitting in feature selection, see my answer to a related question about cross-validation and feature selection. The paper by Ambroise and MacLachlan is also well worth reading by anybody thinking of using feature selection with modern machine learning methods.
Secondly, the class imbalance problem is not really due to the imbalance itself, but because there are too few patterns belonging to the minority class to adequately describe it's distribution. Most classifiers work fine with imbalanced data provided you have a lot of data. Attempts to balance the dataset can make things worse rather than better by over-correcting for the bias due to class imbalance.
So if you have a performance problem due to class imbalance, it means you don't have enough data to adequately estimate the model parameters, in which case the last thing you should do is to perform feature selection as the added degrees of freedom this adds to the problem will only make the estimation problem worse. Regularisation is likely to be a much better solution as it adds essentially one continuous degree of freedom, and will be much less susceptible to over-fitting.
|
Feature Selection in unbalanced data
|
In my experience feature selection tends to make performance worse rather than better if you are using a modern machine learning method that has some feature, such as regularisation, to avoid over-fit
|
Feature Selection in unbalanced data
In my experience feature selection tends to make performance worse rather than better if you are using a modern machine learning method that has some feature, such as regularisation, to avoid over-fitting. Miller's monograph on feature selection has similar advice hidden away in the appendices (sadly someone has borrowed my copy, so I can't find it). Basically feature selection is adding one binary degree of freedom to the learning problem for each input feature. This means the feature selection criteria can be reduced in two ways (i) getting rid of genuinely uninformative features (ii) selecting a set of features that happens to exploit some random sampling peculiarity of the data (i.e. overfitting). For an example of over-fitting in feature selection, see my answer to a related question about cross-validation and feature selection. The paper by Ambroise and MacLachlan is also well worth reading by anybody thinking of using feature selection with modern machine learning methods.
Secondly, the class imbalance problem is not really due to the imbalance itself, but because there are too few patterns belonging to the minority class to adequately describe it's distribution. Most classifiers work fine with imbalanced data provided you have a lot of data. Attempts to balance the dataset can make things worse rather than better by over-correcting for the bias due to class imbalance.
So if you have a performance problem due to class imbalance, it means you don't have enough data to adequately estimate the model parameters, in which case the last thing you should do is to perform feature selection as the added degrees of freedom this adds to the problem will only make the estimation problem worse. Regularisation is likely to be a much better solution as it adds essentially one continuous degree of freedom, and will be much less susceptible to over-fitting.
|
Feature Selection in unbalanced data
In my experience feature selection tends to make performance worse rather than better if you are using a modern machine learning method that has some feature, such as regularisation, to avoid over-fit
|
43,022
|
Feature Selection in unbalanced data
|
It seems that you are mixing two problems: 1) performing feature selection with an ensemble learning algorithm (e.g. random forest, RF); 2) balancing your dataset so the learning process of your algorithm is maximum.
For the first one, perhaps you could take a look to this paper, in which the authors propose a modification of RF (called Guided Regularized RF) to perform feature selection as well. There is an R implementation of this algorithm here that maybe is useful.
Then, the second problem is largely detached from the first one. In my experience, I have never seen a machine learning algorithm handling decently data imbalance by default (I am all ears if any reader has experienced the contrary), like a Poisson, Weibull or a Negative Binomial model would do. They are simply not fit for this task, at least in its basic form. But this does not have to be a problem: you can balance the classes yourself.
You should ensure an even number of samples belonging to each class during the training phase, and you should repeat this training phase using cross-validation techniques with random selection of samples to make sure that you are capturing most of the variance of the imbalanced class(es). In this way, the subsequent process of feature selection with RF should not be biased towards the imbalanced classes.
|
Feature Selection in unbalanced data
|
It seems that you are mixing two problems: 1) performing feature selection with an ensemble learning algorithm (e.g. random forest, RF); 2) balancing your dataset so the learning process of your algor
|
Feature Selection in unbalanced data
It seems that you are mixing two problems: 1) performing feature selection with an ensemble learning algorithm (e.g. random forest, RF); 2) balancing your dataset so the learning process of your algorithm is maximum.
For the first one, perhaps you could take a look to this paper, in which the authors propose a modification of RF (called Guided Regularized RF) to perform feature selection as well. There is an R implementation of this algorithm here that maybe is useful.
Then, the second problem is largely detached from the first one. In my experience, I have never seen a machine learning algorithm handling decently data imbalance by default (I am all ears if any reader has experienced the contrary), like a Poisson, Weibull or a Negative Binomial model would do. They are simply not fit for this task, at least in its basic form. But this does not have to be a problem: you can balance the classes yourself.
You should ensure an even number of samples belonging to each class during the training phase, and you should repeat this training phase using cross-validation techniques with random selection of samples to make sure that you are capturing most of the variance of the imbalanced class(es). In this way, the subsequent process of feature selection with RF should not be biased towards the imbalanced classes.
|
Feature Selection in unbalanced data
It seems that you are mixing two problems: 1) performing feature selection with an ensemble learning algorithm (e.g. random forest, RF); 2) balancing your dataset so the learning process of your algor
|
43,023
|
Feature Selection in unbalanced data
|
The question discusses more than one important topic.
For the first one: There are many techniques to handle imbalance classes before learning a model or after the learning process. Techniques for balancing classes such as SMOTE and cost-sensitive learning and after learning a model, including the choice of performance measures that are less sensitive such as the AUC score.
The second question, I'd suggest applying cross-validation then balancing the classes followed by the chosen feature selection technique.
Regarding the third point, there are three categories of feature selection techniques (filters, wrappers and embedded techniques) and not all of them measure features' importance based on training a predictive model.
|
Feature Selection in unbalanced data
|
The question discusses more than one important topic.
For the first one: There are many techniques to handle imbalance classes before learning a model or after the learning process. Techniques for bal
|
Feature Selection in unbalanced data
The question discusses more than one important topic.
For the first one: There are many techniques to handle imbalance classes before learning a model or after the learning process. Techniques for balancing classes such as SMOTE and cost-sensitive learning and after learning a model, including the choice of performance measures that are less sensitive such as the AUC score.
The second question, I'd suggest applying cross-validation then balancing the classes followed by the chosen feature selection technique.
Regarding the third point, there are three categories of feature selection techniques (filters, wrappers and embedded techniques) and not all of them measure features' importance based on training a predictive model.
|
Feature Selection in unbalanced data
The question discusses more than one important topic.
For the first one: There are many techniques to handle imbalance classes before learning a model or after the learning process. Techniques for bal
|
43,024
|
Finite state machine with gamma distributed waiting times
|
Note that this is NOT an attempt to fully answer the problem, but to show how to overcome the lack of the Markov property for a special case that may not apply - one that is far too long to put in comments.
Unfortunately, as you have realized, this is not a Markov process, but a semi-Markov process. If you a) have integer $k_+$ and $k_-$, and b) are willing to expand your state space, you can transform this to a Markov process using the fact that the Gamma distributions become Erlang distributions and the Erlang variates are a sum of i.i.d. Exponential variates with the same scale parameter as the original Erlang variate.
We can expand the state space to include two new variables, the "+ state" and "- state", which record "how far along" we are in generating the next positive or negative arrival. For concreteness, assume $k_+ = 5$; the next positive arrival occurs when the fifth of five consecutive Exponential arrivals has occurred, so the "+ state" records how many positive arrivals have occurred since the last positive input. The sequence of "+ state" values is $\{0, 1, 2, 3, 4, 0, 1, ...\}$; state $0$ can only transition to $0$ or $1$, state $4$ can only transition to $4$ or $0$, and so forth.
Your state space becomes $[\text{BoxID},+,-]$ recording which box the process is in, how many positive arrivals have occurred modulus $k_+$, and how many negative arrivals have occurred modulus $k_-$.
We now have two random variates - the time until the next "+ state" transition and the time until the next "- state" transition - both of which are Exponentially distributed. As the minimum of two independent Exponential variates is itself Exponential, the time until the next transition (of any type) is Exponential with rate equal to the sum of the two component rates ($\theta_+ + \theta_-$ or $1/\theta_+ + 1/\theta_-$ depending on how your Gamma distributions are parameterized). The probability that the next transition is a "+ state" transition is just $\theta_+/(\theta_+ + \theta_-)$, or $1/\theta_+ / (1/\theta_+ + 1/\theta_-)$, again depending on how your Gamma distributions are parameterized. Given that the time to the next transition now has an Exponential distribution, you have a CTMC (Continuous Time Markov Chain), which can be analyzed in standard ways.
For a concrete example, assume positive arrivals occur at a rate of $0.5/$unit of time and negative arrivals occur at the rate of $0.25/$unit of time. The time until the next transition is Exponential with a rate of $0.75/$unit of time and the probability that the transition is triggered by a positive arrival is $0.5/(0.5+0.25) = 2/3$.
Now you have a much-enlarged state space, with each box in your initial diagram having $k_+k_-$ states interior to it, but at least you have the Markov property and can find the steady-state probabilities of being in box 3 and the states with "+ state" = $k_+-1$, i.e., one of the states from which you can experience a transition that results in a positive output. Combining those steady state probabilities with the transition matrix and the mean time between transitions gives you the long run average rate of seeing a positive output. You can also calculate the desired probability distribution using the steady state probabilities, the transition matrix, and the fact that the time between transitions has an Exponential distribution with known rate.
|
Finite state machine with gamma distributed waiting times
|
Note that this is NOT an attempt to fully answer the problem, but to show how to overcome the lack of the Markov property for a special case that may not apply - one that is far too long to put in com
|
Finite state machine with gamma distributed waiting times
Note that this is NOT an attempt to fully answer the problem, but to show how to overcome the lack of the Markov property for a special case that may not apply - one that is far too long to put in comments.
Unfortunately, as you have realized, this is not a Markov process, but a semi-Markov process. If you a) have integer $k_+$ and $k_-$, and b) are willing to expand your state space, you can transform this to a Markov process using the fact that the Gamma distributions become Erlang distributions and the Erlang variates are a sum of i.i.d. Exponential variates with the same scale parameter as the original Erlang variate.
We can expand the state space to include two new variables, the "+ state" and "- state", which record "how far along" we are in generating the next positive or negative arrival. For concreteness, assume $k_+ = 5$; the next positive arrival occurs when the fifth of five consecutive Exponential arrivals has occurred, so the "+ state" records how many positive arrivals have occurred since the last positive input. The sequence of "+ state" values is $\{0, 1, 2, 3, 4, 0, 1, ...\}$; state $0$ can only transition to $0$ or $1$, state $4$ can only transition to $4$ or $0$, and so forth.
Your state space becomes $[\text{BoxID},+,-]$ recording which box the process is in, how many positive arrivals have occurred modulus $k_+$, and how many negative arrivals have occurred modulus $k_-$.
We now have two random variates - the time until the next "+ state" transition and the time until the next "- state" transition - both of which are Exponentially distributed. As the minimum of two independent Exponential variates is itself Exponential, the time until the next transition (of any type) is Exponential with rate equal to the sum of the two component rates ($\theta_+ + \theta_-$ or $1/\theta_+ + 1/\theta_-$ depending on how your Gamma distributions are parameterized). The probability that the next transition is a "+ state" transition is just $\theta_+/(\theta_+ + \theta_-)$, or $1/\theta_+ / (1/\theta_+ + 1/\theta_-)$, again depending on how your Gamma distributions are parameterized. Given that the time to the next transition now has an Exponential distribution, you have a CTMC (Continuous Time Markov Chain), which can be analyzed in standard ways.
For a concrete example, assume positive arrivals occur at a rate of $0.5/$unit of time and negative arrivals occur at the rate of $0.25/$unit of time. The time until the next transition is Exponential with a rate of $0.75/$unit of time and the probability that the transition is triggered by a positive arrival is $0.5/(0.5+0.25) = 2/3$.
Now you have a much-enlarged state space, with each box in your initial diagram having $k_+k_-$ states interior to it, but at least you have the Markov property and can find the steady-state probabilities of being in box 3 and the states with "+ state" = $k_+-1$, i.e., one of the states from which you can experience a transition that results in a positive output. Combining those steady state probabilities with the transition matrix and the mean time between transitions gives you the long run average rate of seeing a positive output. You can also calculate the desired probability distribution using the steady state probabilities, the transition matrix, and the fact that the time between transitions has an Exponential distribution with known rate.
|
Finite state machine with gamma distributed waiting times
Note that this is NOT an attempt to fully answer the problem, but to show how to overcome the lack of the Markov property for a special case that may not apply - one that is far too long to put in com
|
43,025
|
Is there a "central distribution" for distributions for which the CLT doesn't apply?
|
An answer is already found in the wikipedia link from the first comment by Smith.
Q: Are there situations where this sample average nevertheless converges in distribution to some other (non-normal) distribution?
A: Yes, iff a distribution is a stable distribution then it is a limit to sums of the type:
$$\zeta_n = \frac{\xi_1 + \xi_2 + \dots + \xi_n}{B_n} - A_n $$
with the $\xi$ independent and identically distributed random variables, $B_n>0$ and $\vert A_n\vert<\infty$
The type of distribution laws for $\xi$ that let the above sum converge to a stable distribution (the domain of attraction for that distribution) are described by a theorem in 'Limit distributions for sums of independent random variables' by Gnedenko and Kolmogorov (page 175 in the translated version 1954, link via google)
Theorem 2.* In order that the distribution function F(x) belong to the domain of attraction of a stable law with the characteristic exponent $\alpha$ ($0 \leq \alpha \leq 2$) it is necessary and sufficient that
1) $$\frac{F(-x)}{1-F(x)} \to \frac{c_1}{c_2} \qquad \text{as } k \to \infty$$
2) for every constant $k>0$
$$\frac{1 - F(x) + F(-x)}{1-F(xk) + F(-kx)} \to k^\alpha \qquad \text{as } k \to \infty$$
*The theorem is attributed to
B.V. Gedenko 1939 (no online version available ГНЕДЕНКО, Б. В. К теории областей притяжения устойчивых законов. Ученые записки МГУ, 1939, 2: 30.)
and Doeblin 1940, see theorem V in the freely available pdf.
A slightly more exact description (in comparison to the wikipedia article) is given by https://www.encyclopediaofmath.org/index.php/Attraction_domain_of_a_stable_distribution
|
Is there a "central distribution" for distributions for which the CLT doesn't apply?
|
An answer is already found in the wikipedia link from the first comment by Smith.
Q: Are there situations where this sample average nevertheless converges in distribution to some other (non-normal) di
|
Is there a "central distribution" for distributions for which the CLT doesn't apply?
An answer is already found in the wikipedia link from the first comment by Smith.
Q: Are there situations where this sample average nevertheless converges in distribution to some other (non-normal) distribution?
A: Yes, iff a distribution is a stable distribution then it is a limit to sums of the type:
$$\zeta_n = \frac{\xi_1 + \xi_2 + \dots + \xi_n}{B_n} - A_n $$
with the $\xi$ independent and identically distributed random variables, $B_n>0$ and $\vert A_n\vert<\infty$
The type of distribution laws for $\xi$ that let the above sum converge to a stable distribution (the domain of attraction for that distribution) are described by a theorem in 'Limit distributions for sums of independent random variables' by Gnedenko and Kolmogorov (page 175 in the translated version 1954, link via google)
Theorem 2.* In order that the distribution function F(x) belong to the domain of attraction of a stable law with the characteristic exponent $\alpha$ ($0 \leq \alpha \leq 2$) it is necessary and sufficient that
1) $$\frac{F(-x)}{1-F(x)} \to \frac{c_1}{c_2} \qquad \text{as } k \to \infty$$
2) for every constant $k>0$
$$\frac{1 - F(x) + F(-x)}{1-F(xk) + F(-kx)} \to k^\alpha \qquad \text{as } k \to \infty$$
*The theorem is attributed to
B.V. Gedenko 1939 (no online version available ГНЕДЕНКО, Б. В. К теории областей притяжения устойчивых законов. Ученые записки МГУ, 1939, 2: 30.)
and Doeblin 1940, see theorem V in the freely available pdf.
A slightly more exact description (in comparison to the wikipedia article) is given by https://www.encyclopediaofmath.org/index.php/Attraction_domain_of_a_stable_distribution
|
Is there a "central distribution" for distributions for which the CLT doesn't apply?
An answer is already found in the wikipedia link from the first comment by Smith.
Q: Are there situations where this sample average nevertheless converges in distribution to some other (non-normal) di
|
43,026
|
Difference between the Wold Decomposition and MA representation
|
The Wold decomposition does not say what you state. It says that any weakly stationary $(x_t)_{t=-\infty}^{\infty}$, there exists a white noise process $\{\epsilon_t\}_{t=-\infty}^{+\infty}$ such that $(x_t)_{t=-\infty}^{\infty}$ has two-sided MA representation
$$
x_t=\sum_{-\infty < j < \infty} b_j\epsilon_{t-j}.
$$
What you're asking is whether the two-sided MA representation is unique.
No. Existence does not imply uniqueness, i.e. there is no "the Wold decomposition." Given a two-sided MA representation
$$
x_t=\sum_{-\infty < j < \infty} b_j\epsilon_{t-j},
$$
it is easy to find another MA representation---a different white noise process $\{\epsilon'_t\}_{t=-\infty}^{+\infty}$ and a different sequence $\{b'_t\}_{t=-\infty}^{+\infty}$ such that
$$
x_t=\sum_{-\infty < j < \infty} b'_j\epsilon'_{t-j}.
$$
So it does not make sense to speak of "the Wold decomposition."
Given a stationary ARMA $(x_t)_{t=-\infty}^{\infty}$, you can write down an MA(∞) representation
$$
x_t=\sum_{-\infty < j < \infty} \psi_j\epsilon_{t-j}.
$$
But it does not make sense to ask whether "...the Wold decomposition...coincides with the MA(∞)-representation".
|
Difference between the Wold Decomposition and MA representation
|
The Wold decomposition does not say what you state. It says that any weakly stationary $(x_t)_{t=-\infty}^{\infty}$, there exists a white noise process $\{\epsilon_t\}_{t=-\infty}^{+\infty}$ such that
|
Difference between the Wold Decomposition and MA representation
The Wold decomposition does not say what you state. It says that any weakly stationary $(x_t)_{t=-\infty}^{\infty}$, there exists a white noise process $\{\epsilon_t\}_{t=-\infty}^{+\infty}$ such that $(x_t)_{t=-\infty}^{\infty}$ has two-sided MA representation
$$
x_t=\sum_{-\infty < j < \infty} b_j\epsilon_{t-j}.
$$
What you're asking is whether the two-sided MA representation is unique.
No. Existence does not imply uniqueness, i.e. there is no "the Wold decomposition." Given a two-sided MA representation
$$
x_t=\sum_{-\infty < j < \infty} b_j\epsilon_{t-j},
$$
it is easy to find another MA representation---a different white noise process $\{\epsilon'_t\}_{t=-\infty}^{+\infty}$ and a different sequence $\{b'_t\}_{t=-\infty}^{+\infty}$ such that
$$
x_t=\sum_{-\infty < j < \infty} b'_j\epsilon'_{t-j}.
$$
So it does not make sense to speak of "the Wold decomposition."
Given a stationary ARMA $(x_t)_{t=-\infty}^{\infty}$, you can write down an MA(∞) representation
$$
x_t=\sum_{-\infty < j < \infty} \psi_j\epsilon_{t-j}.
$$
But it does not make sense to ask whether "...the Wold decomposition...coincides with the MA(∞)-representation".
|
Difference between the Wold Decomposition and MA representation
The Wold decomposition does not say what you state. It says that any weakly stationary $(x_t)_{t=-\infty}^{\infty}$, there exists a white noise process $\{\epsilon_t\}_{t=-\infty}^{+\infty}$ such that
|
43,027
|
Difference between the Wold Decomposition and MA representation
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Yes, conditional on ARMA(p,q) being the true model, what you said is correct.
|
Difference between the Wold Decomposition and MA representation
|
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
Difference between the Wold Decomposition and MA representation
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
Yes, conditional on ARMA(p,q) being the true model, what you said is correct.
|
Difference between the Wold Decomposition and MA representation
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
|
43,028
|
Binary Genetic Algorithm in R, with strong cardinality constraints
|
I will try and solve it using the Cross entropy algorithm. It is a method suggest by Reuven Rubenstein CE Method.
Basically the idea is to keep good solutions and deduce on the parameters based on them. So in general suppose you want to find the 4 lowest SD. the algorithm will be as following:
1. Create a vector of probabilities for each instrument.
2. Simulate multiple solutions.
3. Take the best $\xi$ solutions.
4. Update the probability vector.
Small Simulation.
> ## Creating Data
>
> sig.vec <- rep(1, 200)
> low.sig.ind <- sample(200, 4)
> sig.vec[low.sig.ind] <- 0.4
>
> ret <- t(replicate(300, rnorm(200, rep(0, 200), sig.vec)))
>
>
>
> low.sig.ind
[1] 197 152 49 51
> ### Prepare running CE
> iter <- 100
> prob.vec <- runif(200)
> sol.mat <- matrix(NA, nrow = iter, ncol = 5)
> prob.list <- list()
> for (i in 1:10) {
+ ## Creating Sol
+ for (j in 1:iter) {
+ temp.choice <- sample(4, x = 200, prob = prob.vec)
+ sol.mat[j, ] <- c(temp.choice, sd(apply(ret[,temp.choice], 1, sum)))
+ }
+ temp.tab <- table(factor(sol.mat[sol.mat[,5] <= quantile(sol.mat[,5], 0.1), 1:4],
+ levels = 1:200))
+ prob.vec <- temp.tab / sum(temp.tab)
+ prob.list[[i]] <- prob.vec
+ }
>
> prob.vec[prob.vec == 0.25]
10 49 72 152
0.25 0.25 0.25 0.25
So it found the correct ones, off course this is a toy example.
|
Binary Genetic Algorithm in R, with strong cardinality constraints
|
I will try and solve it using the Cross entropy algorithm. It is a method suggest by Reuven Rubenstein CE Method.
Basically the idea is to keep good solutions and deduce on the parameters based on th
|
Binary Genetic Algorithm in R, with strong cardinality constraints
I will try and solve it using the Cross entropy algorithm. It is a method suggest by Reuven Rubenstein CE Method.
Basically the idea is to keep good solutions and deduce on the parameters based on them. So in general suppose you want to find the 4 lowest SD. the algorithm will be as following:
1. Create a vector of probabilities for each instrument.
2. Simulate multiple solutions.
3. Take the best $\xi$ solutions.
4. Update the probability vector.
Small Simulation.
> ## Creating Data
>
> sig.vec <- rep(1, 200)
> low.sig.ind <- sample(200, 4)
> sig.vec[low.sig.ind] <- 0.4
>
> ret <- t(replicate(300, rnorm(200, rep(0, 200), sig.vec)))
>
>
>
> low.sig.ind
[1] 197 152 49 51
> ### Prepare running CE
> iter <- 100
> prob.vec <- runif(200)
> sol.mat <- matrix(NA, nrow = iter, ncol = 5)
> prob.list <- list()
> for (i in 1:10) {
+ ## Creating Sol
+ for (j in 1:iter) {
+ temp.choice <- sample(4, x = 200, prob = prob.vec)
+ sol.mat[j, ] <- c(temp.choice, sd(apply(ret[,temp.choice], 1, sum)))
+ }
+ temp.tab <- table(factor(sol.mat[sol.mat[,5] <= quantile(sol.mat[,5], 0.1), 1:4],
+ levels = 1:200))
+ prob.vec <- temp.tab / sum(temp.tab)
+ prob.list[[i]] <- prob.vec
+ }
>
> prob.vec[prob.vec == 0.25]
10 49 72 152
0.25 0.25 0.25 0.25
So it found the correct ones, off course this is a toy example.
|
Binary Genetic Algorithm in R, with strong cardinality constraints
I will try and solve it using the Cross entropy algorithm. It is a method suggest by Reuven Rubenstein CE Method.
Basically the idea is to keep good solutions and deduce on the parameters based on th
|
43,029
|
Explanation for MSE formula for vector comparison with "Euclidean distance"?
|
What is the connection between the formula and the Euclidean distance?
Consider the formula of the Euclidean Distance between $\hat{y}$ and $ y $ when they have same dimensionality:
$ D = \sqrt{\sum_{i=0}^n (\hat{y}_{i} - y_{i})^2 } $
so the square is:
$ D^2 = {\sum_{i=0}^n (\hat{y}_{i} - y_{i})^2 } $
that is very close to you formula except for the factors $N$ and $M$.
How does the fact that "N and M are constants" explain anything?
How scaling factors come into the picture?
Basically, the fact that $ N $ and $ M $ are costants means that they you can see them as scaling factors. Indeed you will divide your amount always for the same quantity.
What is the "mathematical convenience" here and how does it become
clearer in backpropagation? (I'm more or less familiar with backprop).
It's just for a matter of convenience, because in the backprogation you need to compute the derivative of your squared term. So if your loss function (bias omitted for simplicity) is:
$ L = \frac{1}{2N} \sum_{i=0}^n (\hat{y}_{ij} - y_{ij})^2 $
when apply the power rule on it for getting the derivative wrt the weights, you obtain:
$ \frac{\partial L}{\partial W} = \frac{1}{N} \sum_{i=0}^n (\hat{y}_{ij} -y_{ij}) $
So the constant $ 2 $ has disappear from the equation.
|
Explanation for MSE formula for vector comparison with "Euclidean distance"?
|
What is the connection between the formula and the Euclidean distance?
Consider the formula of the Euclidean Distance between $\hat{y}$ and $ y $ when they have same dimensionality:
$ D = \sqrt{\sum_
|
Explanation for MSE formula for vector comparison with "Euclidean distance"?
What is the connection between the formula and the Euclidean distance?
Consider the formula of the Euclidean Distance between $\hat{y}$ and $ y $ when they have same dimensionality:
$ D = \sqrt{\sum_{i=0}^n (\hat{y}_{i} - y_{i})^2 } $
so the square is:
$ D^2 = {\sum_{i=0}^n (\hat{y}_{i} - y_{i})^2 } $
that is very close to you formula except for the factors $N$ and $M$.
How does the fact that "N and M are constants" explain anything?
How scaling factors come into the picture?
Basically, the fact that $ N $ and $ M $ are costants means that they you can see them as scaling factors. Indeed you will divide your amount always for the same quantity.
What is the "mathematical convenience" here and how does it become
clearer in backpropagation? (I'm more or less familiar with backprop).
It's just for a matter of convenience, because in the backprogation you need to compute the derivative of your squared term. So if your loss function (bias omitted for simplicity) is:
$ L = \frac{1}{2N} \sum_{i=0}^n (\hat{y}_{ij} - y_{ij})^2 $
when apply the power rule on it for getting the derivative wrt the weights, you obtain:
$ \frac{\partial L}{\partial W} = \frac{1}{N} \sum_{i=0}^n (\hat{y}_{ij} -y_{ij}) $
So the constant $ 2 $ has disappear from the equation.
|
Explanation for MSE formula for vector comparison with "Euclidean distance"?
What is the connection between the formula and the Euclidean distance?
Consider the formula of the Euclidean Distance between $\hat{y}$ and $ y $ when they have same dimensionality:
$ D = \sqrt{\sum_
|
43,030
|
Can Kalman Filtering be done hierarchically - estimated from multiple time series with the same parameters?
|
If the parameters can be assumed to have the same value across all trials, the total likelihood (assuming independence between trials) is just the product of the likelihood for each trial. So just write a function that computes this product (or the sum of the logs) taking the unknown parameter values as a vector first argument. If you're happy with maximum likelihood estimates, then maximise this function numerically. In R, the functions you need are optim and KalmanLike (or perhaps Kfilter0 in the astsa package).
|
Can Kalman Filtering be done hierarchically - estimated from multiple time series with the same para
|
If the parameters can be assumed to have the same value across all trials, the total likelihood (assuming independence between trials) is just the product of the likelihood for each trial. So just wr
|
Can Kalman Filtering be done hierarchically - estimated from multiple time series with the same parameters?
If the parameters can be assumed to have the same value across all trials, the total likelihood (assuming independence between trials) is just the product of the likelihood for each trial. So just write a function that computes this product (or the sum of the logs) taking the unknown parameter values as a vector first argument. If you're happy with maximum likelihood estimates, then maximise this function numerically. In R, the functions you need are optim and KalmanLike (or perhaps Kfilter0 in the astsa package).
|
Can Kalman Filtering be done hierarchically - estimated from multiple time series with the same para
If the parameters can be assumed to have the same value across all trials, the total likelihood (assuming independence between trials) is just the product of the likelihood for each trial. So just wr
|
43,031
|
Asymptotic joint distribution of the sample medians of a collection and a sub-collection of i.i.d. random variables
|
If each $X$ is Bernoulli with probability $p$, then the correlation between $M_k$ and $M_n$ has the following graph for $k=21$, $n=41$:
So also for smooth distributions approximating the Bernoulli distributions, the correlations of medians would depend on $p$, and not just on $k$ and $n$. In general, the correlations of medians would depend on the parent distribution and not just on the sample and subsample sizes.
|
Asymptotic joint distribution of the sample medians of a collection and a sub-collection of i.i.d. r
|
If each $X$ is Bernoulli with probability $p$, then the correlation between $M_k$ and $M_n$ has the following graph for $k=21$, $n=41$:
So also for smooth distributions approximating the Bernoulli di
|
Asymptotic joint distribution of the sample medians of a collection and a sub-collection of i.i.d. random variables
If each $X$ is Bernoulli with probability $p$, then the correlation between $M_k$ and $M_n$ has the following graph for $k=21$, $n=41$:
So also for smooth distributions approximating the Bernoulli distributions, the correlations of medians would depend on $p$, and not just on $k$ and $n$. In general, the correlations of medians would depend on the parent distribution and not just on the sample and subsample sizes.
|
Asymptotic joint distribution of the sample medians of a collection and a sub-collection of i.i.d. r
If each $X$ is Bernoulli with probability $p$, then the correlation between $M_k$ and $M_n$ has the following graph for $k=21$, $n=41$:
So also for smooth distributions approximating the Bernoulli di
|
43,032
|
Does taking the logs of the dependent and/or independent variable affect the model errors and thus the validity of inference?
|
You're seeing ringing, which is the result of passing a high-frequency change, ie a step-function, through a low-pass filter, ie the GAM.
When you apply the log transformation, you change the gradient of the near-vertical section of the graph, on the left hand side, so that it is slightly less steep, with fewer implicit high frequencies, and the ringing effect goes away.
Edit: some pictures of ringing here: https://electronics.stackexchange.com/questions/79717/what-can-reduce-overshoot-and-ringing-on-a-simple-square-wave-pulse-generator
Edit2: note that increasing smoothing would increase ringing, since the smoothing is essentially the low-pass filter that is causing the ringing. What would reduce ringing would be for example 1. remove the points in the rising cliff-edge on the left, and refit, or 2. reduce the smoothing, or 3. reduce the frequency/increase wavelength/increase the cutoff frequency of the smoothing.
You can see that if you remove the cliff-edge bit, the rest of the graph is more or less a straight-line, so why is the GAM fitting a sinusoidal wave through those points? Its entirely because the cliff-edge part is forcing a very high gradient, which then causes subsequent overshoot.
Edit3: if it was me, I think I'd try to find a transform that will transform the graph into an approximately straight line. I'm not quite sure what that transform would be, but looks like the graph is very close to being a flat line, asymptotic to ~380 or so. This is a stronger non-linearity than eg log, which will become flat-ish, but not quite so quickly I think. Maybe something like an inverse sigmoid? Sigmoid is:
$$
y = \frac{1}{1 + \exp(-x)}
$$
... and looks like (from wikipedia https://en.wikipedia.org/wiki/Sigmoid_function )
Inverse sigmoid is the logit function, https://en.wikipedia.org/wiki/Logit:
$$
f(x) = \log \left(
\frac{1}{1-x}
\right)
$$
Maybe a transformation related to this, or a parameterized version of this, might make the graph closer to being a straight line, and thus more amenable to standard statistical techniques?
|
Does taking the logs of the dependent and/or independent variable affect the model errors and thus t
|
You're seeing ringing, which is the result of passing a high-frequency change, ie a step-function, through a low-pass filter, ie the GAM.
When you apply the log transformation, you change the gradient
|
Does taking the logs of the dependent and/or independent variable affect the model errors and thus the validity of inference?
You're seeing ringing, which is the result of passing a high-frequency change, ie a step-function, through a low-pass filter, ie the GAM.
When you apply the log transformation, you change the gradient of the near-vertical section of the graph, on the left hand side, so that it is slightly less steep, with fewer implicit high frequencies, and the ringing effect goes away.
Edit: some pictures of ringing here: https://electronics.stackexchange.com/questions/79717/what-can-reduce-overshoot-and-ringing-on-a-simple-square-wave-pulse-generator
Edit2: note that increasing smoothing would increase ringing, since the smoothing is essentially the low-pass filter that is causing the ringing. What would reduce ringing would be for example 1. remove the points in the rising cliff-edge on the left, and refit, or 2. reduce the smoothing, or 3. reduce the frequency/increase wavelength/increase the cutoff frequency of the smoothing.
You can see that if you remove the cliff-edge bit, the rest of the graph is more or less a straight-line, so why is the GAM fitting a sinusoidal wave through those points? Its entirely because the cliff-edge part is forcing a very high gradient, which then causes subsequent overshoot.
Edit3: if it was me, I think I'd try to find a transform that will transform the graph into an approximately straight line. I'm not quite sure what that transform would be, but looks like the graph is very close to being a flat line, asymptotic to ~380 or so. This is a stronger non-linearity than eg log, which will become flat-ish, but not quite so quickly I think. Maybe something like an inverse sigmoid? Sigmoid is:
$$
y = \frac{1}{1 + \exp(-x)}
$$
... and looks like (from wikipedia https://en.wikipedia.org/wiki/Sigmoid_function )
Inverse sigmoid is the logit function, https://en.wikipedia.org/wiki/Logit:
$$
f(x) = \log \left(
\frac{1}{1-x}
\right)
$$
Maybe a transformation related to this, or a parameterized version of this, might make the graph closer to being a straight line, and thus more amenable to standard statistical techniques?
|
Does taking the logs of the dependent and/or independent variable affect the model errors and thus t
You're seeing ringing, which is the result of passing a high-frequency change, ie a step-function, through a low-pass filter, ie the GAM.
When you apply the log transformation, you change the gradient
|
43,033
|
What is statistic in statistics?
|
A statistic is a function of your data.
That's all it is. In different context, you may be interested in different statistics. Maybe T = number of observations. That's a valid statistic. Or T = max value observed. T = seventh observation. T = sixth largest observation. I guess it's valid to say T=1 too, just a constant, although it's quite meaningless. Most commonly as an introduction, we look at T = sample mean, and use it to infer the population parameter.
Maybe your samples aren't event real numbers! For example, maybe your X1, X2, ... are students first names. A valid statistic could be T= most common name. Or T = total number of characters in every name.
To reiterate, a statistic is just a function of your data. In introductory courses, you often work with sample means, sample variances, and play with some algebra to make a mathematical statement about a population's parameter.
|
What is statistic in statistics?
|
A statistic is a function of your data.
That's all it is. In different context, you may be interested in different statistics. Maybe T = number of observations. That's a valid statistic. Or T = max v
|
What is statistic in statistics?
A statistic is a function of your data.
That's all it is. In different context, you may be interested in different statistics. Maybe T = number of observations. That's a valid statistic. Or T = max value observed. T = seventh observation. T = sixth largest observation. I guess it's valid to say T=1 too, just a constant, although it's quite meaningless. Most commonly as an introduction, we look at T = sample mean, and use it to infer the population parameter.
Maybe your samples aren't event real numbers! For example, maybe your X1, X2, ... are students first names. A valid statistic could be T= most common name. Or T = total number of characters in every name.
To reiterate, a statistic is just a function of your data. In introductory courses, you often work with sample means, sample variances, and play with some algebra to make a mathematical statement about a population's parameter.
|
What is statistic in statistics?
A statistic is a function of your data.
That's all it is. In different context, you may be interested in different statistics. Maybe T = number of observations. That's a valid statistic. Or T = max v
|
43,034
|
What is statistic in statistics?
|
Asking questions in class is never a bad idea.
A statistic is an estimate of a population parameter based on a sample. So if mu is the population mean, the sample mean x-bar is the statistic.
|
What is statistic in statistics?
|
Asking questions in class is never a bad idea.
A statistic is an estimate of a population parameter based on a sample. So if mu is the population mean, the sample mean x-bar is the statistic.
|
What is statistic in statistics?
Asking questions in class is never a bad idea.
A statistic is an estimate of a population parameter based on a sample. So if mu is the population mean, the sample mean x-bar is the statistic.
|
What is statistic in statistics?
Asking questions in class is never a bad idea.
A statistic is an estimate of a population parameter based on a sample. So if mu is the population mean, the sample mean x-bar is the statistic.
|
43,035
|
Lagged dependent variable in linear regression
|
Hi: Your model is also called a koyck distributed lag and it can be difficult to estimate with small samples. With larger samples, my experience is that there is not a problem with bias. ( I used simulation to check this ).
The link discusses the statistical properties of the estimates briefly on pages 12 and 13. Essentially the problems with it are similar to those of the estimates of an AR(1).
https://www.reed.edu/economics/parker/312/tschapters/S13_Ch_3.pdf
I would check out hamilton or the little koyck book (1954) for a more in depth discussion but hopefully the above helps some.
|
Lagged dependent variable in linear regression
|
Hi: Your model is also called a koyck distributed lag and it can be difficult to estimate with small samples. With larger samples, my experience is that there is not a problem with bias. ( I used simu
|
Lagged dependent variable in linear regression
Hi: Your model is also called a koyck distributed lag and it can be difficult to estimate with small samples. With larger samples, my experience is that there is not a problem with bias. ( I used simulation to check this ).
The link discusses the statistical properties of the estimates briefly on pages 12 and 13. Essentially the problems with it are similar to those of the estimates of an AR(1).
https://www.reed.edu/economics/parker/312/tschapters/S13_Ch_3.pdf
I would check out hamilton or the little koyck book (1954) for a more in depth discussion but hopefully the above helps some.
|
Lagged dependent variable in linear regression
Hi: Your model is also called a koyck distributed lag and it can be difficult to estimate with small samples. With larger samples, my experience is that there is not a problem with bias. ( I used simu
|
43,036
|
Lagged dependent variable in linear regression
|
From what I have read, the Yule-Walker equations use least squares to estimate the AR-1 lag coefficient (what you call $\beta_1$ in display 1 and $\theta$ in display 2). The joint estimation of the lag coefficient and the $X$ coefficient is correctly done using a least squares model adjusting for the lag and the concurrent $X$ in the model you have written. If the model is misspecified due to either cross lags, omitted variables, or higher lag orders, and display 1 does not describe the data generation process, the coefficients can be massively biased.
|
Lagged dependent variable in linear regression
|
From what I have read, the Yule-Walker equations use least squares to estimate the AR-1 lag coefficient (what you call $\beta_1$ in display 1 and $\theta$ in display 2). The joint estimation of the la
|
Lagged dependent variable in linear regression
From what I have read, the Yule-Walker equations use least squares to estimate the AR-1 lag coefficient (what you call $\beta_1$ in display 1 and $\theta$ in display 2). The joint estimation of the lag coefficient and the $X$ coefficient is correctly done using a least squares model adjusting for the lag and the concurrent $X$ in the model you have written. If the model is misspecified due to either cross lags, omitted variables, or higher lag orders, and display 1 does not describe the data generation process, the coefficients can be massively biased.
|
Lagged dependent variable in linear regression
From what I have read, the Yule-Walker equations use least squares to estimate the AR-1 lag coefficient (what you call $\beta_1$ in display 1 and $\theta$ in display 2). The joint estimation of the la
|
43,037
|
Why is the coefficient of determination ($R^2$) so called?
|
This Google search turns up an interesting result.
What follows is my speculation.
A deterministic model is a "Mathematical model in which outcomes are precisely determined through known relationships among states and events, without any room for random variation." From: What is a deterministic model?
I think the coefficient of determination can be thought of in terms of what is determined/known (without variation) about a model. If $R^2 = 1.00$, then 100% of the relation between the predictors and the outcome is determined. If you put in values for your predictors, you always get a prediction with no error term. You know the outcome with no room for error, or variation of any type. Your model becomes akin to $2 + 3 = 5$.
Typically, you do not have 100% $R^2$, so even though we obtain the same predicted value for two cases with the same values on our predictors, there is some error. So the correct predictions for both cases remain unknown and the correct predictions are probably different. But these correct predictions are determined (or we know them) to some extent - the extent of the $R^2$.
|
Why is the coefficient of determination ($R^2$) so called?
|
This Google search turns up an interesting result.
What follows is my speculation.
A deterministic model is a "Mathematical model in which outcomes are precisely determined through known relationships
|
Why is the coefficient of determination ($R^2$) so called?
This Google search turns up an interesting result.
What follows is my speculation.
A deterministic model is a "Mathematical model in which outcomes are precisely determined through known relationships among states and events, without any room for random variation." From: What is a deterministic model?
I think the coefficient of determination can be thought of in terms of what is determined/known (without variation) about a model. If $R^2 = 1.00$, then 100% of the relation between the predictors and the outcome is determined. If you put in values for your predictors, you always get a prediction with no error term. You know the outcome with no room for error, or variation of any type. Your model becomes akin to $2 + 3 = 5$.
Typically, you do not have 100% $R^2$, so even though we obtain the same predicted value for two cases with the same values on our predictors, there is some error. So the correct predictions for both cases remain unknown and the correct predictions are probably different. But these correct predictions are determined (or we know them) to some extent - the extent of the $R^2$.
|
Why is the coefficient of determination ($R^2$) so called?
This Google search turns up an interesting result.
What follows is my speculation.
A deterministic model is a "Mathematical model in which outcomes are precisely determined through known relationships
|
43,038
|
Why is the coefficient of determination ($R^2$) so called?
|
Here are my 2 cents.
The variance that our model consists of is of 2 types: stochastic (totally probabilistic that may vary according to the sample we select) whereas there will be variance that can be quantified or determined possibly by our modelling techniques. Now as our calculation deals with understanding the value of R^2 which explains how much deterministic variance is explained through our model, it is rightly called so.
Just a hypothesis.
|
Why is the coefficient of determination ($R^2$) so called?
|
Here are my 2 cents.
The variance that our model consists of is of 2 types: stochastic (totally probabilistic that may vary according to the sample we select) whereas there will be variance that can b
|
Why is the coefficient of determination ($R^2$) so called?
Here are my 2 cents.
The variance that our model consists of is of 2 types: stochastic (totally probabilistic that may vary according to the sample we select) whereas there will be variance that can be quantified or determined possibly by our modelling techniques. Now as our calculation deals with understanding the value of R^2 which explains how much deterministic variance is explained through our model, it is rightly called so.
Just a hypothesis.
|
Why is the coefficient of determination ($R^2$) so called?
Here are my 2 cents.
The variance that our model consists of is of 2 types: stochastic (totally probabilistic that may vary according to the sample we select) whereas there will be variance that can b
|
43,039
|
Consistency of a sequence of Bernoullis
|
Consider the simpler case where $X_i \sim N(\theta a_i,1)$, then the MLE
$$\hat{\theta} = \sum_{i=1}^n a_iX_i/\sum_{i=1}^n a_i^2 \sim N(\theta, 1/\sum_{i=1}^n a_i^2).$$ Note that if $\sum_{i=1}^n a_i^2 $ diverges, then $\hat{\theta}$ is consistent since the variance goes to 0 and it is unbiased; if $\sum_{i=1}^n a_i^2 $ converges, $\hat{\theta}$ is asymptotically normal with constant variance, which implies inconsistency of MLE and there is no other estimator that can achieve consistency in this case.
Going back to your problem, I think you can show that asymptotic variance of the MLE, by computing the Fisher information, is the same order of $1/\sum_{i=1}^n a_i^2$. If $\sum_{i=1}^n a_i^2 < \infty$, it means the information is not accrued fast enough, MLE will not be consistent and there are no other consistent estimators. If $\sum_{i=1}^n a_i^2 = \infty$, MLE will be consistent.
|
Consistency of a sequence of Bernoullis
|
Consider the simpler case where $X_i \sim N(\theta a_i,1)$, then the MLE
$$\hat{\theta} = \sum_{i=1}^n a_iX_i/\sum_{i=1}^n a_i^2 \sim N(\theta, 1/\sum_{i=1}^n a_i^2).$$ Note that if $\sum_{i=1}^n a_
|
Consistency of a sequence of Bernoullis
Consider the simpler case where $X_i \sim N(\theta a_i,1)$, then the MLE
$$\hat{\theta} = \sum_{i=1}^n a_iX_i/\sum_{i=1}^n a_i^2 \sim N(\theta, 1/\sum_{i=1}^n a_i^2).$$ Note that if $\sum_{i=1}^n a_i^2 $ diverges, then $\hat{\theta}$ is consistent since the variance goes to 0 and it is unbiased; if $\sum_{i=1}^n a_i^2 $ converges, $\hat{\theta}$ is asymptotically normal with constant variance, which implies inconsistency of MLE and there is no other estimator that can achieve consistency in this case.
Going back to your problem, I think you can show that asymptotic variance of the MLE, by computing the Fisher information, is the same order of $1/\sum_{i=1}^n a_i^2$. If $\sum_{i=1}^n a_i^2 < \infty$, it means the information is not accrued fast enough, MLE will not be consistent and there are no other consistent estimators. If $\sum_{i=1}^n a_i^2 = \infty$, MLE will be consistent.
|
Consistency of a sequence of Bernoullis
Consider the simpler case where $X_i \sim N(\theta a_i,1)$, then the MLE
$$\hat{\theta} = \sum_{i=1}^n a_iX_i/\sum_{i=1}^n a_i^2 \sim N(\theta, 1/\sum_{i=1}^n a_i^2).$$ Note that if $\sum_{i=1}^n a_
|
43,040
|
Consistency of a sequence of Bernoullis
|
Here is an estimator which can consistently estimate $\theta$ and for which the condition $\sum_{i=1}^{\infty}a_i ^2 =\infty$ is relevant.
We have
$$E(X_i) = \frac 12 + \theta a_i \implies \frac{2E(X_i)-1}{2a_i} = \theta$$
Set
$$Z_i = \frac{2X_i-1}{2a_i} \implies E(Z_i) = \theta$$
and
$$\text{Var}(Z_i) = \text{Var}(X_i/a_i) = \frac {1}{4a_i^2} -\theta^2$$
Consider the sample mean $\bar Z_n$. Its expected value is always $\theta$, and its variance is
$$\text{Var}(\bar Z_n) = \frac {1}{n^2}\sum_{i=1}^n\frac{1}{4a_i^2} -\frac{\theta^2}{n}$$
Ignoring weird situations, we want this variance to go to zero in order to make certain that $\bar Z_n$ will consistently estimate $\theta$. So we want
$$\frac {1}{n^2}\sum_{i=1}^n\frac{1}{a_i^2} \to 0 \implies \frac {n^2}{\sum_{i=1}^n\frac{1}{a_i^2}} \to \infty$$
Now from the Harmonic-Arithmetic mean inequality , we have that
$$\frac {n}{\sum_{i=1}^n\frac{1}{a_i^2}} < \frac 1n \sum_{i=1}^na_i^2 \implies \frac {n^2}{\sum_{i=1}^n\frac{1}{a_i^2}} < \sum_{i=1}^na_i^2$$
Since we want the left side of the inequality to go to infinity, it follows that $\sum_{i=1}^{\infty}a_i ^2 =\infty$ is a necessary condition for this to happen, i.e. a necessary condition for $\bar Z_n$ to consistently estimate $\theta$.
(Follows the original exploratory post).
We have that
$$\{a_i\} \to 0 \implies \frac 1 n \sum a_i \to 0 \tag{1}$$
and
$$\{a_i\} \to 0 \implies \{a_i^2\} \to 0\implies \frac 1 n \sum a_i^2 \to 0 \tag{2}$$
Now, the OP does not state it but I will assume that the rv's are independent, since the focus is elsewhere. Also, I note that the Bernoulli distribution belongs to the Exponential family and so the sum of observations is a sufficient statistic, it has all the information that the sample can give us.
More over, Chebychev's Law of Large Numbers applies (mean and variance of each $X_i$ is finite), namely, the sample average of the $X$s converges in probability to the limit of the average of their means, and we have
$$\text{plim}\bar X = \lim\frac 1n \sum E(X_i) = \frac 12 + \theta \lim\frac1n \sum a_i = \frac 12 \tag{2}$$
So as sample size tends to infinity, information on $\theta$ is eliminated if we use the sufficient statistic.
The same we would obtain if we looked at the variance. The variance of $X_i$ is
$$\text{Var}(X_i) = \left (\frac 12 + \theta a_i\right) \left(1-\frac 12 - \theta a_i\right) = \left (\frac 12 + \theta a_i\right) \left(\frac 12 - \theta a_i\right) = (1/4) - \theta^2 a_i^2$$
and calculating any sample mean will again tend to eliminate the information on $\theta$ as the sample size increases, due to $(2)$.
So the challenge here appears to be that we have to abandon the sufficient statistic.
|
Consistency of a sequence of Bernoullis
|
Here is an estimator which can consistently estimate $\theta$ and for which the condition $\sum_{i=1}^{\infty}a_i ^2 =\infty$ is relevant.
We have
$$E(X_i) = \frac 12 + \theta a_i \implies \frac{2E(
|
Consistency of a sequence of Bernoullis
Here is an estimator which can consistently estimate $\theta$ and for which the condition $\sum_{i=1}^{\infty}a_i ^2 =\infty$ is relevant.
We have
$$E(X_i) = \frac 12 + \theta a_i \implies \frac{2E(X_i)-1}{2a_i} = \theta$$
Set
$$Z_i = \frac{2X_i-1}{2a_i} \implies E(Z_i) = \theta$$
and
$$\text{Var}(Z_i) = \text{Var}(X_i/a_i) = \frac {1}{4a_i^2} -\theta^2$$
Consider the sample mean $\bar Z_n$. Its expected value is always $\theta$, and its variance is
$$\text{Var}(\bar Z_n) = \frac {1}{n^2}\sum_{i=1}^n\frac{1}{4a_i^2} -\frac{\theta^2}{n}$$
Ignoring weird situations, we want this variance to go to zero in order to make certain that $\bar Z_n$ will consistently estimate $\theta$. So we want
$$\frac {1}{n^2}\sum_{i=1}^n\frac{1}{a_i^2} \to 0 \implies \frac {n^2}{\sum_{i=1}^n\frac{1}{a_i^2}} \to \infty$$
Now from the Harmonic-Arithmetic mean inequality , we have that
$$\frac {n}{\sum_{i=1}^n\frac{1}{a_i^2}} < \frac 1n \sum_{i=1}^na_i^2 \implies \frac {n^2}{\sum_{i=1}^n\frac{1}{a_i^2}} < \sum_{i=1}^na_i^2$$
Since we want the left side of the inequality to go to infinity, it follows that $\sum_{i=1}^{\infty}a_i ^2 =\infty$ is a necessary condition for this to happen, i.e. a necessary condition for $\bar Z_n$ to consistently estimate $\theta$.
(Follows the original exploratory post).
We have that
$$\{a_i\} \to 0 \implies \frac 1 n \sum a_i \to 0 \tag{1}$$
and
$$\{a_i\} \to 0 \implies \{a_i^2\} \to 0\implies \frac 1 n \sum a_i^2 \to 0 \tag{2}$$
Now, the OP does not state it but I will assume that the rv's are independent, since the focus is elsewhere. Also, I note that the Bernoulli distribution belongs to the Exponential family and so the sum of observations is a sufficient statistic, it has all the information that the sample can give us.
More over, Chebychev's Law of Large Numbers applies (mean and variance of each $X_i$ is finite), namely, the sample average of the $X$s converges in probability to the limit of the average of their means, and we have
$$\text{plim}\bar X = \lim\frac 1n \sum E(X_i) = \frac 12 + \theta \lim\frac1n \sum a_i = \frac 12 \tag{2}$$
So as sample size tends to infinity, information on $\theta$ is eliminated if we use the sufficient statistic.
The same we would obtain if we looked at the variance. The variance of $X_i$ is
$$\text{Var}(X_i) = \left (\frac 12 + \theta a_i\right) \left(1-\frac 12 - \theta a_i\right) = \left (\frac 12 + \theta a_i\right) \left(\frac 12 - \theta a_i\right) = (1/4) - \theta^2 a_i^2$$
and calculating any sample mean will again tend to eliminate the information on $\theta$ as the sample size increases, due to $(2)$.
So the challenge here appears to be that we have to abandon the sufficient statistic.
|
Consistency of a sequence of Bernoullis
Here is an estimator which can consistently estimate $\theta$ and for which the condition $\sum_{i=1}^{\infty}a_i ^2 =\infty$ is relevant.
We have
$$E(X_i) = \frac 12 + \theta a_i \implies \frac{2E(
|
43,041
|
Consistency of a sequence of Bernoullis
|
I think I have finally figured out a way to solve this problem. The details are yet to be worked out but I feel if the sum is finite then for two different $\theta_1,\theta_2$ the sequence of likelihood ratios will be mutually contiguous, which would imply there is no consistent estimator. A complete solution will be added when time permits.
|
Consistency of a sequence of Bernoullis
|
I think I have finally figured out a way to solve this problem. The details are yet to be worked out but I feel if the sum is finite then for two different $\theta_1,\theta_2$ the sequence of likeliho
|
Consistency of a sequence of Bernoullis
I think I have finally figured out a way to solve this problem. The details are yet to be worked out but I feel if the sum is finite then for two different $\theta_1,\theta_2$ the sequence of likelihood ratios will be mutually contiguous, which would imply there is no consistent estimator. A complete solution will be added when time permits.
|
Consistency of a sequence of Bernoullis
I think I have finally figured out a way to solve this problem. The details are yet to be worked out but I feel if the sum is finite then for two different $\theta_1,\theta_2$ the sequence of likeliho
|
43,042
|
How to check the linearity assumption?
|
If you want to see if the relationship between (the conditional expectation of) $y$ and $x_0$ is linear, after adjusting for control variables $x_1, x_2, \dots, x_p$, a simple graphical approach is to create an added-variable plot using the following procedure.
First, regress $y$ on $x_1, x_2, \dots, x_p$ and obtain the residuals from that regression, $\hat{\epsilon}_y$. Then, regress $X_0$ on $x_1, x_2, \dots, x_p$ and obtain the residuals from that regression, $\hat{\epsilon}_{x_0}$.
Then, create a scatter plot of $\hat{\epsilon}_y$ against $\hat{\epsilon}_{x_0}$ and overlay a nonparametric curve (e.g. loess) along with the linear regression line. The linear regression line will have exactly the same slope as the "long" regression that includes all variables $x_0, x_1, \dots, x_p$ by the Frisch-Waugh theorem. The nonparametric curve will give you a sense of how well the relationship between $y$ and $x_0$ can be approximated as linear.
Some simple R code to demonstrate:
data(mtcars)
# full model, with all control variables
fullmod = lm(mpg ~ wt + vs + gear + am, mtcars)
coef(mod)[2]
> wt
> -3.786
# regress y on controls and x on controls, extract residuals
eps_y = lm(mpg ~ vs + gear + am, mtcars)$residuals
eps_x = lm(wt ~ vs + gear + am, mtcars)$residuals
# regress epsilon_y on epsilon_x, see the coef is the same as above
coef(lm(eps_y ~ eps_x))[2]
> eps_y
> -3.786
# make added variable plot
library(ggplot2)
qplot(x = eps_x, y = eps_y) +
geom_smooth(method = "lm", colour = "black", se= FALSE) +
geom_smooth(method = "loess", colour = "red", se = FALSE)
|
How to check the linearity assumption?
|
If you want to see if the relationship between (the conditional expectation of) $y$ and $x_0$ is linear, after adjusting for control variables $x_1, x_2, \dots, x_p$, a simple graphical approach is to
|
How to check the linearity assumption?
If you want to see if the relationship between (the conditional expectation of) $y$ and $x_0$ is linear, after adjusting for control variables $x_1, x_2, \dots, x_p$, a simple graphical approach is to create an added-variable plot using the following procedure.
First, regress $y$ on $x_1, x_2, \dots, x_p$ and obtain the residuals from that regression, $\hat{\epsilon}_y$. Then, regress $X_0$ on $x_1, x_2, \dots, x_p$ and obtain the residuals from that regression, $\hat{\epsilon}_{x_0}$.
Then, create a scatter plot of $\hat{\epsilon}_y$ against $\hat{\epsilon}_{x_0}$ and overlay a nonparametric curve (e.g. loess) along with the linear regression line. The linear regression line will have exactly the same slope as the "long" regression that includes all variables $x_0, x_1, \dots, x_p$ by the Frisch-Waugh theorem. The nonparametric curve will give you a sense of how well the relationship between $y$ and $x_0$ can be approximated as linear.
Some simple R code to demonstrate:
data(mtcars)
# full model, with all control variables
fullmod = lm(mpg ~ wt + vs + gear + am, mtcars)
coef(mod)[2]
> wt
> -3.786
# regress y on controls and x on controls, extract residuals
eps_y = lm(mpg ~ vs + gear + am, mtcars)$residuals
eps_x = lm(wt ~ vs + gear + am, mtcars)$residuals
# regress epsilon_y on epsilon_x, see the coef is the same as above
coef(lm(eps_y ~ eps_x))[2]
> eps_y
> -3.786
# make added variable plot
library(ggplot2)
qplot(x = eps_x, y = eps_y) +
geom_smooth(method = "lm", colour = "black", se= FALSE) +
geom_smooth(method = "loess", colour = "red", se = FALSE)
|
How to check the linearity assumption?
If you want to see if the relationship between (the conditional expectation of) $y$ and $x_0$ is linear, after adjusting for control variables $x_1, x_2, \dots, x_p$, a simple graphical approach is to
|
43,043
|
How to check the linearity assumption?
|
As @stephan-kolassa mentioned. An added spline portion can be more beneficial than a quadratic term, since that will not explicitly determine the nonlinearity of the model. A likelihood ratio test or F-test can be performed from there.
Now, there are problems with such a method that I think need to be considered.
The model will test $H_0: Y=X\beta+\epsilon$ vs $H_a:Y=X\beta + f(x) + \epsilon$, where $f(x)$ is a spline model. In such a situation, all you can ever say is that the data does not supply evidence of that nonlinear term, it will never truly verify the assumption of linearity.
Furthermore, there may be the testing for normality issue where the model may never be truly linear. So like testing normality, the only reason a test will ever fail to reject that assumption on real is because a lack of sample size, since no data is actually normal. The same may apply to testing linearity, linearity is a theoretical assumption, and the lack of rejection may be due to the lack of sample size rather than the assumption being actually true.
What may be the best option is to consider the linear model to be the best model via model selection. This can be done with AIC/BIC (which are actually quite good at testing nested models) or cross-validation or some measure of deviance (does the model seem to be around the expected value of the $\chi^2$ it is supposed to represent).
|
How to check the linearity assumption?
|
As @stephan-kolassa mentioned. An added spline portion can be more beneficial than a quadratic term, since that will not explicitly determine the nonlinearity of the model. A likelihood ratio test or
|
How to check the linearity assumption?
As @stephan-kolassa mentioned. An added spline portion can be more beneficial than a quadratic term, since that will not explicitly determine the nonlinearity of the model. A likelihood ratio test or F-test can be performed from there.
Now, there are problems with such a method that I think need to be considered.
The model will test $H_0: Y=X\beta+\epsilon$ vs $H_a:Y=X\beta + f(x) + \epsilon$, where $f(x)$ is a spline model. In such a situation, all you can ever say is that the data does not supply evidence of that nonlinear term, it will never truly verify the assumption of linearity.
Furthermore, there may be the testing for normality issue where the model may never be truly linear. So like testing normality, the only reason a test will ever fail to reject that assumption on real is because a lack of sample size, since no data is actually normal. The same may apply to testing linearity, linearity is a theoretical assumption, and the lack of rejection may be due to the lack of sample size rather than the assumption being actually true.
What may be the best option is to consider the linear model to be the best model via model selection. This can be done with AIC/BIC (which are actually quite good at testing nested models) or cross-validation or some measure of deviance (does the model seem to be around the expected value of the $\chi^2$ it is supposed to represent).
|
How to check the linearity assumption?
As @stephan-kolassa mentioned. An added spline portion can be more beneficial than a quadratic term, since that will not explicitly determine the nonlinearity of the model. A likelihood ratio test or
|
43,044
|
Dealing with sparse categories in binary cross-entropy
|
I think the problem is the sigmoid activation function in your output layer. Binary crossentropy computes the sigmoid again as part of the loss computation (see the description in tensor flow: https://www.tensorflow.org/api_docs/python/tf/nn/sigmoid_cross_entropy_with_logits). Just changing the activation function in the output layer to linear worked in our (similarly structured) case.
|
Dealing with sparse categories in binary cross-entropy
|
I think the problem is the sigmoid activation function in your output layer. Binary crossentropy computes the sigmoid again as part of the loss computation (see the description in tensor flow: https:/
|
Dealing with sparse categories in binary cross-entropy
I think the problem is the sigmoid activation function in your output layer. Binary crossentropy computes the sigmoid again as part of the loss computation (see the description in tensor flow: https://www.tensorflow.org/api_docs/python/tf/nn/sigmoid_cross_entropy_with_logits). Just changing the activation function in the output layer to linear worked in our (similarly structured) case.
|
Dealing with sparse categories in binary cross-entropy
I think the problem is the sigmoid activation function in your output layer. Binary crossentropy computes the sigmoid again as part of the loss computation (see the description in tensor flow: https:/
|
43,045
|
Are there any seemingly simple probability question that are actually intractable?
|
The survival function $S_{t}$ is a quantity of interest in many (most?) kinds of event history analysis. It is commonly estimated, and 'survival curves' depicting $S_{t}$ versus time are often used to compare the cumulative probability of events among different groups. Statistical comparisons are often facilitated by inference—things like hypothesis test and confidence intervals.
I and a few statisticians have struggled with several different approaches to provide an asymptotic analytic estimator of the sample variance of the survival function ($\sigma^{2}_{\hat{S}_{t}}$) in discrete time event history models (a la logit hazard, probit hazard, etc. models), which would be useful to construct hypothesis tests and confidence intervals.
It turns out that—as best I understand it—that while it is possible and common to estimate the asymptotic variance of sums of random variables (like the sample mean), the asymptotic variance of products of random variables is a tricky sticky wicket to estimate.
$$\hat{S}_{t} = \prod^{t}_{i=1}{1-\hat{h}_{i}}$$
where $\hat{h}_{t}$ is the discrete time hazard function at time $t$.
We have more or less given up on an asymptotic estimator of the variance of that puppy, and declared that numerical techniques like bootstrapping seem to be our best bets.
|
Are there any seemingly simple probability question that are actually intractable?
|
The survival function $S_{t}$ is a quantity of interest in many (most?) kinds of event history analysis. It is commonly estimated, and 'survival curves' depicting $S_{t}$ versus time are often used to
|
Are there any seemingly simple probability question that are actually intractable?
The survival function $S_{t}$ is a quantity of interest in many (most?) kinds of event history analysis. It is commonly estimated, and 'survival curves' depicting $S_{t}$ versus time are often used to compare the cumulative probability of events among different groups. Statistical comparisons are often facilitated by inference—things like hypothesis test and confidence intervals.
I and a few statisticians have struggled with several different approaches to provide an asymptotic analytic estimator of the sample variance of the survival function ($\sigma^{2}_{\hat{S}_{t}}$) in discrete time event history models (a la logit hazard, probit hazard, etc. models), which would be useful to construct hypothesis tests and confidence intervals.
It turns out that—as best I understand it—that while it is possible and common to estimate the asymptotic variance of sums of random variables (like the sample mean), the asymptotic variance of products of random variables is a tricky sticky wicket to estimate.
$$\hat{S}_{t} = \prod^{t}_{i=1}{1-\hat{h}_{i}}$$
where $\hat{h}_{t}$ is the discrete time hazard function at time $t$.
We have more or less given up on an asymptotic estimator of the variance of that puppy, and declared that numerical techniques like bootstrapping seem to be our best bets.
|
Are there any seemingly simple probability question that are actually intractable?
The survival function $S_{t}$ is a quantity of interest in many (most?) kinds of event history analysis. It is commonly estimated, and 'survival curves' depicting $S_{t}$ versus time are often used to
|
43,046
|
Are there any seemingly simple probability question that are actually intractable?
|
You've got 5 variables and you're doing a "multivariate" analysis. You assume multivariate normality and enjoy a complete data set. Then the maximum likelihood estimates of the mean and covariance matrix are closed form and easy to calculate.
Oh wait, you didn't want to assume joint normality. You meant to assume that, marginally, each of your variables follows a beta distribution. No big deal. There must be a multivariate analogue of the beta distribution with an arbitrary correlation structure, right? Well, you might be able to construct something, but I'll call it "intractable" for my level of patience. Here is a reddit post from someone trying to figure out something similar without much luck.
|
Are there any seemingly simple probability question that are actually intractable?
|
You've got 5 variables and you're doing a "multivariate" analysis. You assume multivariate normality and enjoy a complete data set. Then the maximum likelihood estimates of the mean and covariance mat
|
Are there any seemingly simple probability question that are actually intractable?
You've got 5 variables and you're doing a "multivariate" analysis. You assume multivariate normality and enjoy a complete data set. Then the maximum likelihood estimates of the mean and covariance matrix are closed form and easy to calculate.
Oh wait, you didn't want to assume joint normality. You meant to assume that, marginally, each of your variables follows a beta distribution. No big deal. There must be a multivariate analogue of the beta distribution with an arbitrary correlation structure, right? Well, you might be able to construct something, but I'll call it "intractable" for my level of patience. Here is a reddit post from someone trying to figure out something similar without much luck.
|
Are there any seemingly simple probability question that are actually intractable?
You've got 5 variables and you're doing a "multivariate" analysis. You assume multivariate normality and enjoy a complete data set. Then the maximum likelihood estimates of the mean and covariance mat
|
43,047
|
Are there any seemingly simple probability question that are actually intractable?
|
A simple probability problem that is intractable could be the following for a horse race.
If the horse trainer has a win rate of 25% and the jockey a 10% win rate and the horse has a 40% win rate what is the un-normalised probabilty of success of the horse in today's race?
The trainer has trained the horse to have a 40% success rate but will the rate fall in future races towards 25%? Will the jockey have a better chance than 15%, and by how much, on a horse that wins 40% of the time and a trainer that wins 25% of the time?
|
Are there any seemingly simple probability question that are actually intractable?
|
A simple probability problem that is intractable could be the following for a horse race.
If the horse trainer has a win rate of 25% and the jockey a 10% win rate and the horse has a 40% win rate what
|
Are there any seemingly simple probability question that are actually intractable?
A simple probability problem that is intractable could be the following for a horse race.
If the horse trainer has a win rate of 25% and the jockey a 10% win rate and the horse has a 40% win rate what is the un-normalised probabilty of success of the horse in today's race?
The trainer has trained the horse to have a 40% success rate but will the rate fall in future races towards 25%? Will the jockey have a better chance than 15%, and by how much, on a horse that wins 40% of the time and a trainer that wins 25% of the time?
|
Are there any seemingly simple probability question that are actually intractable?
A simple probability problem that is intractable could be the following for a horse race.
If the horse trainer has a win rate of 25% and the jockey a 10% win rate and the horse has a 40% win rate what
|
43,048
|
Computer vision algorithm that maps the positions of objects in 3D onto 2D image
|
I do not know of a publication on this area.
In my opinion it is a computer vision problem, comprising several smaller problems. You need a model of the pitch, be able to segment and keep track of the players, and to keep track of where the camera is looking at.
Ideally, the camera is calibrated, so you have a mapping from pixels into meters. The problem is recognizing what part of the field the camera is covering (need landmark detection), detect the players and project their position onto the plane, and finally apply a projective transformation defined by the camera, that rectifies the pitch into a 2d view of the field (or 3D from the top).
The question is then:
how to define what the landmarks are, and how to find them in the image,
how to detect and keep track of the players.
For the first problem there are a number of approaches to fit ellipses and other sort of primitives. See for example (Robust Pose Estimation from a Planar Target, Schweighofer et al.). This would additionally allow to recalibrate or realign your system, if necessary.
You may be able to detect the corners with some standard approach for corner detection: Harris (at the right scale). See this lecture for more details (https://ags.cs.uni-kl.de/fileadmin/inf_ags/opt-ss14/OPT_SS2014_lec02.pdf)
For the second, I would expect a standard HOG based approach to be able to detect the players (see Histograms of Oriented Gradients for Human Detection). At least in the sort of images like the one you posted.
Keeping track of the players can get really tricky when they overlap each other. I am not aware of a robust approach to that tracking problem. You may get some good results from one of the approaches implemented in OpenCV (https://www.learnopencv.com/object-tracking-using-opencv-cpp-python/)
|
Computer vision algorithm that maps the positions of objects in 3D onto 2D image
|
I do not know of a publication on this area.
In my opinion it is a computer vision problem, comprising several smaller problems. You need a model of the pitch, be able to segment and keep track of the
|
Computer vision algorithm that maps the positions of objects in 3D onto 2D image
I do not know of a publication on this area.
In my opinion it is a computer vision problem, comprising several smaller problems. You need a model of the pitch, be able to segment and keep track of the players, and to keep track of where the camera is looking at.
Ideally, the camera is calibrated, so you have a mapping from pixels into meters. The problem is recognizing what part of the field the camera is covering (need landmark detection), detect the players and project their position onto the plane, and finally apply a projective transformation defined by the camera, that rectifies the pitch into a 2d view of the field (or 3D from the top).
The question is then:
how to define what the landmarks are, and how to find them in the image,
how to detect and keep track of the players.
For the first problem there are a number of approaches to fit ellipses and other sort of primitives. See for example (Robust Pose Estimation from a Planar Target, Schweighofer et al.). This would additionally allow to recalibrate or realign your system, if necessary.
You may be able to detect the corners with some standard approach for corner detection: Harris (at the right scale). See this lecture for more details (https://ags.cs.uni-kl.de/fileadmin/inf_ags/opt-ss14/OPT_SS2014_lec02.pdf)
For the second, I would expect a standard HOG based approach to be able to detect the players (see Histograms of Oriented Gradients for Human Detection). At least in the sort of images like the one you posted.
Keeping track of the players can get really tricky when they overlap each other. I am not aware of a robust approach to that tracking problem. You may get some good results from one of the approaches implemented in OpenCV (https://www.learnopencv.com/object-tracking-using-opencv-cpp-python/)
|
Computer vision algorithm that maps the positions of objects in 3D onto 2D image
I do not know of a publication on this area.
In my opinion it is a computer vision problem, comprising several smaller problems. You need a model of the pitch, be able to segment and keep track of the
|
43,049
|
What is a generalized confidence interval?
|
The two properties imply each other. Indeed, the implication is nearly trivial provided we formulate them mathematically, as you have requested: let's begin there.
I would like to remark that the language is confusing because it is attempting to make statements about probabilities by referring to "a large number of": in other words, it is appealing implicitly to laws of large numbers to equate probabilities with asymptotic frequencies in sequences of independent trials. I will avoid such solecisms by translating these statements into what I think they are trying to say about probabilities.
For background, let us understand a "situation" to consist of collecting $n$ independent observations $\mathbf{x}=(x_1, x_2, \ldots, x_n)$ from some distribution $F$ assumed to lie within a specific family $\Omega$ of distributions.
A "parameter" is a function $\delta:\Omega\to\mathbb{R}$.
An "interval" can be represented as an indexed pair of functions $l_n,u_n:\mathbb{R}^n\to\mathbb{R}$ with the restriction that $l_n(\mathbf{x})\le u_n(\mathbf{x})$ for all $n\ge 1$ and all $\mathbf{x}\in\mathbb{R}^n$. For any $\mathbf{x}$, these functions determine the interval $[l_n(\mathbf{x}), u_n(\mathbf{x})]$.
A $1-\alpha$ confidence interval for $\delta$ is a pair $l_n, u_n$ for which $${\Pr}_F(\delta(F)\in [l_n(\mathbf{x}), u_n(\mathbf{x})])=1-\alpha$$ for all $F\in\Omega$ and all $n\ge 1$.
Consider a nonempty set of distributional families and parameters $\mathcal{S}=\{\delta_i:\Omega_i\to\mathbb{R}\}$. This models "a large number of independent situations." A $1-\alpha$ generalized confidence interval for $\mathcal{S}$ is a collection of functions $l_{i;n}, u_{i;n}$ indexed by $i\in\mathcal{S}$ and integers $n\ge 1$ such that for any sequence of length $s$ of samples $\mathbf{x}_j$ of sizes $n_j$ taken from $\Omega_j$, $$\frac{1}{s}\sum_{j=1}^s {\Pr}_F(\delta_{i_j}(\mathbf{x}_j)\in [l_{i_j;n_j}(\mathbf{x}_j), u_{i_j;n_j}(\mathbf{x}_j)])=1-\alpha.\tag{2}$$for all sequences $(F_j)$ with $F_j\in\Omega_j$.
By taking $\mathcal{S}=\{\delta\}$, $(2)$ trivially implies $(1)$. To go the other way, let $l_{i_j;n},u_{i_j;n}$ be a $1-\alpha$ confidence interval for each situation $j$: since all the probabilities appearing in formula $(2)$ exactly equal $1-\alpha$, the mean (on the left) also is $1-\alpha$.
|
What is a generalized confidence interval?
|
The two properties imply each other. Indeed, the implication is nearly trivial provided we formulate them mathematically, as you have requested: let's begin there.
I would like to remark that the la
|
What is a generalized confidence interval?
The two properties imply each other. Indeed, the implication is nearly trivial provided we formulate them mathematically, as you have requested: let's begin there.
I would like to remark that the language is confusing because it is attempting to make statements about probabilities by referring to "a large number of": in other words, it is appealing implicitly to laws of large numbers to equate probabilities with asymptotic frequencies in sequences of independent trials. I will avoid such solecisms by translating these statements into what I think they are trying to say about probabilities.
For background, let us understand a "situation" to consist of collecting $n$ independent observations $\mathbf{x}=(x_1, x_2, \ldots, x_n)$ from some distribution $F$ assumed to lie within a specific family $\Omega$ of distributions.
A "parameter" is a function $\delta:\Omega\to\mathbb{R}$.
An "interval" can be represented as an indexed pair of functions $l_n,u_n:\mathbb{R}^n\to\mathbb{R}$ with the restriction that $l_n(\mathbf{x})\le u_n(\mathbf{x})$ for all $n\ge 1$ and all $\mathbf{x}\in\mathbb{R}^n$. For any $\mathbf{x}$, these functions determine the interval $[l_n(\mathbf{x}), u_n(\mathbf{x})]$.
A $1-\alpha$ confidence interval for $\delta$ is a pair $l_n, u_n$ for which $${\Pr}_F(\delta(F)\in [l_n(\mathbf{x}), u_n(\mathbf{x})])=1-\alpha$$ for all $F\in\Omega$ and all $n\ge 1$.
Consider a nonempty set of distributional families and parameters $\mathcal{S}=\{\delta_i:\Omega_i\to\mathbb{R}\}$. This models "a large number of independent situations." A $1-\alpha$ generalized confidence interval for $\mathcal{S}$ is a collection of functions $l_{i;n}, u_{i;n}$ indexed by $i\in\mathcal{S}$ and integers $n\ge 1$ such that for any sequence of length $s$ of samples $\mathbf{x}_j$ of sizes $n_j$ taken from $\Omega_j$, $$\frac{1}{s}\sum_{j=1}^s {\Pr}_F(\delta_{i_j}(\mathbf{x}_j)\in [l_{i_j;n_j}(\mathbf{x}_j), u_{i_j;n_j}(\mathbf{x}_j)])=1-\alpha.\tag{2}$$for all sequences $(F_j)$ with $F_j\in\Omega_j$.
By taking $\mathcal{S}=\{\delta\}$, $(2)$ trivially implies $(1)$. To go the other way, let $l_{i_j;n},u_{i_j;n}$ be a $1-\alpha$ confidence interval for each situation $j$: since all the probabilities appearing in formula $(2)$ exactly equal $1-\alpha$, the mean (on the left) also is $1-\alpha$.
|
What is a generalized confidence interval?
The two properties imply each other. Indeed, the implication is nearly trivial provided we formulate them mathematically, as you have requested: let's begin there.
I would like to remark that the la
|
43,050
|
What is a generalized confidence interval?
|
under construction
This is very similar to Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean?
Your first property is more strict because it requires that the confidence interval contains 95% of the time the true parameter, conditional on the true parameter. The second property does not specify this conditional probability.
(The first property is not so explicit but you have this contrast between ”the same experiment is repeated a large number of times” and "After a large number of independent situations".)
This graph below comparing a confidence interval and a credible interval might be helpful to show the difference. In the left image we see that a credible interval will not be containing the true parameter exactly 95% of the time conditional on the particular true parameter value. For some parameters it will be more for others it will be less. But on average (averaging over the prior distribution of the parameter) it contains the parameter 95% of the time.
|
What is a generalized confidence interval?
|
under construction
This is very similar to Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean?
Your first property is more strict because it requires that the confid
|
What is a generalized confidence interval?
under construction
This is very similar to Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean?
Your first property is more strict because it requires that the confidence interval contains 95% of the time the true parameter, conditional on the true parameter. The second property does not specify this conditional probability.
(The first property is not so explicit but you have this contrast between ”the same experiment is repeated a large number of times” and "After a large number of independent situations".)
This graph below comparing a confidence interval and a credible interval might be helpful to show the difference. In the left image we see that a credible interval will not be containing the true parameter exactly 95% of the time conditional on the particular true parameter value. For some parameters it will be more for others it will be less. But on average (averaging over the prior distribution of the parameter) it contains the parameter 95% of the time.
|
What is a generalized confidence interval?
under construction
This is very similar to Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean?
Your first property is more strict because it requires that the confid
|
43,051
|
How to prepare data for input to a sparse categorical cross entropy multiclassification model [closed]
|
The problem is that
metrics=['accuracy']
defaults to categorical accuracy. You need sparse categorical accuracy:
from keras import metrics
model.compile(loss='sparse_categorical_crossentropy',
optimizer=sgd,
metrics=[metrics.sparse_categorical_accuracy])
|
How to prepare data for input to a sparse categorical cross entropy multiclassification model [close
|
The problem is that
metrics=['accuracy']
defaults to categorical accuracy. You need sparse categorical accuracy:
from keras import metrics
model.compile(loss='sparse_categorical_crossentropy',
|
How to prepare data for input to a sparse categorical cross entropy multiclassification model [closed]
The problem is that
metrics=['accuracy']
defaults to categorical accuracy. You need sparse categorical accuracy:
from keras import metrics
model.compile(loss='sparse_categorical_crossentropy',
optimizer=sgd,
metrics=[metrics.sparse_categorical_accuracy])
|
How to prepare data for input to a sparse categorical cross entropy multiclassification model [close
The problem is that
metrics=['accuracy']
defaults to categorical accuracy. You need sparse categorical accuracy:
from keras import metrics
model.compile(loss='sparse_categorical_crossentropy',
|
43,052
|
Why ROC Curve on test set?
|
Why do we want to calculate ROC curve on test set? In many other resources that I read, they calculated ROC curve on
either training set or test set without a clear definition of "test
set", so pardon me if I read it wrong.
You want to calculate the ROC on the test set because that's actually the set of data that can help you estimate generalized performance, as it was not used to train the model in any way. And that is the definition of a test set, it's the same in holdout or nested cross-validation: a set of data that was not used in any way to optimize the model being tested on it.
However, I'm still curious if
in the case of the test set by my above definition, what is so the
point of calculating ROC curve? Isn't the threshold choice made on the
training set (which is perhaps heavily optimistically biased) or the
validation set (which might be less optimistically biased)? Doesn't
the test set become a validation set if we make threshold choice on
it?
You can optimize a threshold during training (in fact, if you want to do it, you should do it in training/validation data).
Often, however, this dichotomization is skipped altogether, leaving models to output probabilities or similar, continuous-valued, scores.
Then, computing the ROC gives you a good idea of the predictive potential of your model, without ever establishing a threshold.
|
Why ROC Curve on test set?
|
Why do we want to calculate ROC curve on test set? In many other resources that I read, they calculated ROC curve on
either training set or test set without a clear definition of "test
set", so pardon
|
Why ROC Curve on test set?
Why do we want to calculate ROC curve on test set? In many other resources that I read, they calculated ROC curve on
either training set or test set without a clear definition of "test
set", so pardon me if I read it wrong.
You want to calculate the ROC on the test set because that's actually the set of data that can help you estimate generalized performance, as it was not used to train the model in any way. And that is the definition of a test set, it's the same in holdout or nested cross-validation: a set of data that was not used in any way to optimize the model being tested on it.
However, I'm still curious if
in the case of the test set by my above definition, what is so the
point of calculating ROC curve? Isn't the threshold choice made on the
training set (which is perhaps heavily optimistically biased) or the
validation set (which might be less optimistically biased)? Doesn't
the test set become a validation set if we make threshold choice on
it?
You can optimize a threshold during training (in fact, if you want to do it, you should do it in training/validation data).
Often, however, this dichotomization is skipped altogether, leaving models to output probabilities or similar, continuous-valued, scores.
Then, computing the ROC gives you a good idea of the predictive potential of your model, without ever establishing a threshold.
|
Why ROC Curve on test set?
Why do we want to calculate ROC curve on test set? In many other resources that I read, they calculated ROC curve on
either training set or test set without a clear definition of "test
set", so pardon
|
43,053
|
Interpretation of calibration curve
|
The curve labeled bias-corrected appears to be "over confident": its predictions for Predicted P(Class=1)<0.5 are too low and its predictions for Predicted P(Class=1)>0.5 are too high relative to Actual probability.
This is also the case for the curve labeled apparent, except at the extremes (roughly: x<=0.28 or x>=0.9) it appears to actually be $less$ confident.
I am unsure of the details of the bias correcting method in rms, but I don't think the result is necessarily "worse"; With the correction, the probability estimates are parallel to the ideal. In other words, although it's known that the model is slightly overconfident, we can say that the difference between its mean prediction for a population with P(class)=0.2 is half of its mean prediction for a population with P(class)=0.4, which was not the case before and probably what one would hope for.
|
Interpretation of calibration curve
|
The curve labeled bias-corrected appears to be "over confident": its predictions for Predicted P(Class=1)<0.5 are too low and its predictions for Predicted P(Class=1)>0.5 are too high relative to Actu
|
Interpretation of calibration curve
The curve labeled bias-corrected appears to be "over confident": its predictions for Predicted P(Class=1)<0.5 are too low and its predictions for Predicted P(Class=1)>0.5 are too high relative to Actual probability.
This is also the case for the curve labeled apparent, except at the extremes (roughly: x<=0.28 or x>=0.9) it appears to actually be $less$ confident.
I am unsure of the details of the bias correcting method in rms, but I don't think the result is necessarily "worse"; With the correction, the probability estimates are parallel to the ideal. In other words, although it's known that the model is slightly overconfident, we can say that the difference between its mean prediction for a population with P(class)=0.2 is half of its mean prediction for a population with P(class)=0.4, which was not the case before and probably what one would hope for.
|
Interpretation of calibration curve
The curve labeled bias-corrected appears to be "over confident": its predictions for Predicted P(Class=1)<0.5 are too low and its predictions for Predicted P(Class=1)>0.5 are too high relative to Actu
|
43,054
|
In cross-validation, which is the AUC population parameter I really want to estimate?
|
It is the first case, i.e. the expected value of the AUC and CI with the same test set size.
We can rule out the third case (infinite models) immediately because the cross-validation is done using only the trained model. Hence, it is not valid for any other model.
While the AUC for the first and second cases would be the same (perhaps given weak assumptions on the model), the CI would be smaller if prediction were performed on the entire population instead of a subset of it (second case).
|
In cross-validation, which is the AUC population parameter I really want to estimate?
|
It is the first case, i.e. the expected value of the AUC and CI with the same test set size.
We can rule out the third case (infinite models) immediately because the cross-validation is done using onl
|
In cross-validation, which is the AUC population parameter I really want to estimate?
It is the first case, i.e. the expected value of the AUC and CI with the same test set size.
We can rule out the third case (infinite models) immediately because the cross-validation is done using only the trained model. Hence, it is not valid for any other model.
While the AUC for the first and second cases would be the same (perhaps given weak assumptions on the model), the CI would be smaller if prediction were performed on the entire population instead of a subset of it (second case).
|
In cross-validation, which is the AUC population parameter I really want to estimate?
It is the first case, i.e. the expected value of the AUC and CI with the same test set size.
We can rule out the third case (infinite models) immediately because the cross-validation is done using onl
|
43,055
|
Covariance matrix for missing data
|
Another approach is to compute the maximum likelihood mean and covariance matrix, given all observed data. This requires an iterative algorithm, such as the expectation maximization algorithm. Accelerated variants and other types of optimization algorithms exist too. Compared to imputation, this approach can produce estimators that are more efficient, and unbiased under a wider variety of settings. It does require that the missingness of data is independent of the missing values (i.e. the data is 'missing completely at random' or 'missing at random').
References:
Jamshidian and Bentler (1999). ML Estimation of Mean and Covariance structures with Missing Data Using Complete Data Routines.
Little and Rubin (1987). Statistical Analysis with Missing Data. [Particularly chapter 8]
|
Covariance matrix for missing data
|
Another approach is to compute the maximum likelihood mean and covariance matrix, given all observed data. This requires an iterative algorithm, such as the expectation maximization algorithm. Acceler
|
Covariance matrix for missing data
Another approach is to compute the maximum likelihood mean and covariance matrix, given all observed data. This requires an iterative algorithm, such as the expectation maximization algorithm. Accelerated variants and other types of optimization algorithms exist too. Compared to imputation, this approach can produce estimators that are more efficient, and unbiased under a wider variety of settings. It does require that the missingness of data is independent of the missing values (i.e. the data is 'missing completely at random' or 'missing at random').
References:
Jamshidian and Bentler (1999). ML Estimation of Mean and Covariance structures with Missing Data Using Complete Data Routines.
Little and Rubin (1987). Statistical Analysis with Missing Data. [Particularly chapter 8]
|
Covariance matrix for missing data
Another approach is to compute the maximum likelihood mean and covariance matrix, given all observed data. This requires an iterative algorithm, such as the expectation maximization algorithm. Acceler
|
43,056
|
How would I compute the standard deviation of data with errors?
|
This answer will assume your errors are standard deviations.
If you have a data set $x_1,\ldots,x_n$, then we can define the discrete mean and variance as
$$\langle{x}\rangle\equiv\frac{1}{n}\sum_ix_i \,,\,\hat{\sigma}^2\equiv\langle{x^2}\rangle-\langle{x}\rangle^2$$
which means
$$\langle{x}\rangle{n}=\sum_ix_i \,,\, \langle{x^2}\rangle{n}=\sum_ix_i^2$$
Now imagine your data is really giving
$$X_k\pm{\Delta}X_k=\langle{x}\rangle_k\pm\hat{\sigma}_k$$
where the "subsample size" $n_k$ is unknown.
Then we have
$$\langle{x}\rangle_k=X_k \,,\, \langle{x^2}\rangle_k={\Delta}X_k^2-\langle{x}\rangle_k^2$$
And the aggregate statistics can be computed via
$$\langle{X}\rangle=\frac{1}{N}\sum_kX_kn_k \,,\, \langle{X^2}\rangle=\frac{1}{N}\sum_k(X_k^2+\Delta{X}_k^2)n_k \,,\, N=\sum_kn_k$$
from which you can compute
$$\hat{\sigma}_X^2=\langle{X^2}\rangle-\langle{X}\rangle^2$$
For simplicity you could take $n_k=1$.
|
How would I compute the standard deviation of data with errors?
|
This answer will assume your errors are standard deviations.
If you have a data set $x_1,\ldots,x_n$, then we can define the discrete mean and variance as
$$\langle{x}\rangle\equiv\frac{1}{n}\sum_ix_i
|
How would I compute the standard deviation of data with errors?
This answer will assume your errors are standard deviations.
If you have a data set $x_1,\ldots,x_n$, then we can define the discrete mean and variance as
$$\langle{x}\rangle\equiv\frac{1}{n}\sum_ix_i \,,\,\hat{\sigma}^2\equiv\langle{x^2}\rangle-\langle{x}\rangle^2$$
which means
$$\langle{x}\rangle{n}=\sum_ix_i \,,\, \langle{x^2}\rangle{n}=\sum_ix_i^2$$
Now imagine your data is really giving
$$X_k\pm{\Delta}X_k=\langle{x}\rangle_k\pm\hat{\sigma}_k$$
where the "subsample size" $n_k$ is unknown.
Then we have
$$\langle{x}\rangle_k=X_k \,,\, \langle{x^2}\rangle_k={\Delta}X_k^2-\langle{x}\rangle_k^2$$
And the aggregate statistics can be computed via
$$\langle{X}\rangle=\frac{1}{N}\sum_kX_kn_k \,,\, \langle{X^2}\rangle=\frac{1}{N}\sum_k(X_k^2+\Delta{X}_k^2)n_k \,,\, N=\sum_kn_k$$
from which you can compute
$$\hat{\sigma}_X^2=\langle{X^2}\rangle-\langle{X}\rangle^2$$
For simplicity you could take $n_k=1$.
|
How would I compute the standard deviation of data with errors?
This answer will assume your errors are standard deviations.
If you have a data set $x_1,\ldots,x_n$, then we can define the discrete mean and variance as
$$\langle{x}\rangle\equiv\frac{1}{n}\sum_ix_i
|
43,057
|
How would I compute the standard deviation of data with errors?
|
If your "errors" are standard deviations, you should use a weighted mean, where the weights are the inverse of the data variances, and compute the variance of the weighted mean.
For the formulae, cf. Wikipedia. This results from the law of uncertainty propagation (Wikipedia)
|
How would I compute the standard deviation of data with errors?
|
If your "errors" are standard deviations, you should use a weighted mean, where the weights are the inverse of the data variances, and compute the variance of the weighted mean.
For the formulae, cf.
|
How would I compute the standard deviation of data with errors?
If your "errors" are standard deviations, you should use a weighted mean, where the weights are the inverse of the data variances, and compute the variance of the weighted mean.
For the formulae, cf. Wikipedia. This results from the law of uncertainty propagation (Wikipedia)
|
How would I compute the standard deviation of data with errors?
If your "errors" are standard deviations, you should use a weighted mean, where the weights are the inverse of the data variances, and compute the variance of the weighted mean.
For the formulae, cf.
|
43,058
|
How would I compute the standard deviation of data with errors?
|
Yes, the typical approach will not necessarily be the best estimate.
You are saying that there is a random variable, $x$, that is IID with some mean $\bar{x}$ and std.dev. $\sigma$. However, there is noise added to $x$, so that the observed variable is $y = x + e$, where $e$ is the error term.
If you know (or are willing to assume) something about $e$, then you can get a little further. E.g. if you assume that $e \sim N(0,\sigma_e^2)$, and you are willing to assume that $x \sim N(0,\sigma^2)$, then we know that $y \sim N(0,\sigma_y^2)$ (because the sum of two normals will be normal), where $\sigma_y^2 = \sigma^2 + \sigma_e^2$. Hence, we can estimate $\sigma_y^2$ and then subtract the assumed $\sigma_e^2$ and we have $\sigma^2$.
But in general, if you do not make any more assumptions, then it is hard to say more than probably, the variance in the underlying process will be smaller than the variance in the observed one. But it could also be larger, e.g. if the added noise, $e$ above, is negatively correlated with the realization.
|
How would I compute the standard deviation of data with errors?
|
Yes, the typical approach will not necessarily be the best estimate.
You are saying that there is a random variable, $x$, that is IID with some mean $\bar{x}$ and std.dev. $\sigma$. However, there is
|
How would I compute the standard deviation of data with errors?
Yes, the typical approach will not necessarily be the best estimate.
You are saying that there is a random variable, $x$, that is IID with some mean $\bar{x}$ and std.dev. $\sigma$. However, there is noise added to $x$, so that the observed variable is $y = x + e$, where $e$ is the error term.
If you know (or are willing to assume) something about $e$, then you can get a little further. E.g. if you assume that $e \sim N(0,\sigma_e^2)$, and you are willing to assume that $x \sim N(0,\sigma^2)$, then we know that $y \sim N(0,\sigma_y^2)$ (because the sum of two normals will be normal), where $\sigma_y^2 = \sigma^2 + \sigma_e^2$. Hence, we can estimate $\sigma_y^2$ and then subtract the assumed $\sigma_e^2$ and we have $\sigma^2$.
But in general, if you do not make any more assumptions, then it is hard to say more than probably, the variance in the underlying process will be smaller than the variance in the observed one. But it could also be larger, e.g. if the added noise, $e$ above, is negatively correlated with the realization.
|
How would I compute the standard deviation of data with errors?
Yes, the typical approach will not necessarily be the best estimate.
You are saying that there is a random variable, $x$, that is IID with some mean $\bar{x}$ and std.dev. $\sigma$. However, there is
|
43,059
|
expectation of log of expectation by Monte Carlo
|
The methods presented in this work (https://people.maths.ox.ac.uk/gilesm/files/SLOAN80-056.pdf) concern Multi-Level Monte Carlo (MLMC) methods for expectations of this form. MLMC is typically not designed to provide unbiased estimators per se, but can usually be modified to do so using the trick of McLeish.
Broadly, if you are interested in
$$\mathfrak{I}=\mathbb{E}^X \left[ g \left\{\mathbb{E}^{Y|X}[h(X,Y)|X] \right\} \right]$$
then the standard trick is to write
$$\hat{\mathfrak{I}}_{\ell_1, \ell_2} = \frac{1}{N_{\ell_1}} \sum_{i = 1}^{N_{\ell_1}} g \left( \frac{1}{N_{\ell_2}} \sum_{j = 1}^{N_{\ell_2}} h \left(X^i, Y^{i, j} \right) \right)$$
where $N_{\ell_1}, N_{\ell_2}$ are two sequences of positive integers increasing to infinity. One can then form a sort of double-telescoping sum representation of
$$\lim_{\min \left(N_{\ell_1}, N_{\ell_2} \right) \to \infty} \hat{\mathfrak{I}}_{\ell_1, \ell_2} = \mathfrak{I}$$
and the debiasing trick of McLeish applies. The work of Crisan et al. (https://arxiv.org/abs/1702.03057) is also relevant here.
|
expectation of log of expectation by Monte Carlo
|
The methods presented in this work (https://people.maths.ox.ac.uk/gilesm/files/SLOAN80-056.pdf) concern Multi-Level Monte Carlo (MLMC) methods for expectations of this form. MLMC is typically not desi
|
expectation of log of expectation by Monte Carlo
The methods presented in this work (https://people.maths.ox.ac.uk/gilesm/files/SLOAN80-056.pdf) concern Multi-Level Monte Carlo (MLMC) methods for expectations of this form. MLMC is typically not designed to provide unbiased estimators per se, but can usually be modified to do so using the trick of McLeish.
Broadly, if you are interested in
$$\mathfrak{I}=\mathbb{E}^X \left[ g \left\{\mathbb{E}^{Y|X}[h(X,Y)|X] \right\} \right]$$
then the standard trick is to write
$$\hat{\mathfrak{I}}_{\ell_1, \ell_2} = \frac{1}{N_{\ell_1}} \sum_{i = 1}^{N_{\ell_1}} g \left( \frac{1}{N_{\ell_2}} \sum_{j = 1}^{N_{\ell_2}} h \left(X^i, Y^{i, j} \right) \right)$$
where $N_{\ell_1}, N_{\ell_2}$ are two sequences of positive integers increasing to infinity. One can then form a sort of double-telescoping sum representation of
$$\lim_{\min \left(N_{\ell_1}, N_{\ell_2} \right) \to \infty} \hat{\mathfrak{I}}_{\ell_1, \ell_2} = \mathfrak{I}$$
and the debiasing trick of McLeish applies. The work of Crisan et al. (https://arxiv.org/abs/1702.03057) is also relevant here.
|
expectation of log of expectation by Monte Carlo
The methods presented in this work (https://people.maths.ox.ac.uk/gilesm/files/SLOAN80-056.pdf) concern Multi-Level Monte Carlo (MLMC) methods for expectations of this form. MLMC is typically not desi
|
43,060
|
interval censored survival analysis with time dependent covariates
|
Semi-parametric models such as Cox regression are not easily applied in the presence of interval censoring. In this situation the default choice is to use parametric models.
On the other hand, time-dependent covariates are easily included in a right-censored setting and not with interval censoring. To include time-dependent covariates in an interval censoring scenario few methods have been proposed, and this is probably the best available approach. However, this method (as far as I know) has only been implemented in SAS. The Weibull model is among the possible methods they discuss, so if you are interested in a proportional hazard model you will be fine.
For your analyses I see three options:
Choose this latter approach based on parametric survival, which would be ideal for your data, and use SAS to fit your models.
If you prefer to use R, make an assumption on when events are occurring within the interval (normally distributed for example), and do a classical right-censored analysis using Cox regression (in this case you can refer to this R tutorial)
Seek alternative approaches such as the one you mentioned based on logistic regression.
|
interval censored survival analysis with time dependent covariates
|
Semi-parametric models such as Cox regression are not easily applied in the presence of interval censoring. In this situation the default choice is to use parametric models.
On the other hand, time-d
|
interval censored survival analysis with time dependent covariates
Semi-parametric models such as Cox regression are not easily applied in the presence of interval censoring. In this situation the default choice is to use parametric models.
On the other hand, time-dependent covariates are easily included in a right-censored setting and not with interval censoring. To include time-dependent covariates in an interval censoring scenario few methods have been proposed, and this is probably the best available approach. However, this method (as far as I know) has only been implemented in SAS. The Weibull model is among the possible methods they discuss, so if you are interested in a proportional hazard model you will be fine.
For your analyses I see three options:
Choose this latter approach based on parametric survival, which would be ideal for your data, and use SAS to fit your models.
If you prefer to use R, make an assumption on when events are occurring within the interval (normally distributed for example), and do a classical right-censored analysis using Cox regression (in this case you can refer to this R tutorial)
Seek alternative approaches such as the one you mentioned based on logistic regression.
|
interval censored survival analysis with time dependent covariates
Semi-parametric models such as Cox regression are not easily applied in the presence of interval censoring. In this situation the default choice is to use parametric models.
On the other hand, time-d
|
43,061
|
What causes the elbow shape of the loss curve?
|
There are 3 reasons learning can slow, when considering the learning rate:
the optimal value has been reached (or at least a local minimum)
The learning rate is too big and we are overshooting our target
We are at a plateau with a very small gradient and the learning rate is too small to get us out there quickly.
Now one issue is determining in which situation you are. Would decreasing the learning rate help or make the problem worse? And if we need to decrease the learning rate, how fast do we need to do it?
For FractalNet, we see that the performance for epochs 50-200 is quite poor, but for 1-50 is quite good. Undoubtedly decreasing the learning rate in a linear manner is going to decrease performance on those first 50 epochs. On the other hand, there might be a plateau that the algorithm found in epochs 50-200, so it is not certain that a lower learning rate would even improve the performance in those epochs. So what do we do? Do we reduce the learning rate linearly and if so how quickly?
There are various ways to approach this problem. An interesting one is for example momentum based approaches, where we try to filter out repeated overshooting. The issue is that the perfect solution varies from problem to problem and it takes quite some testing to figure out which approach has the best effect. It then could be faster to just do something simple like this and train it a bit longer than to investigate the problem for weeks to reduce training time.
|
What causes the elbow shape of the loss curve?
|
There are 3 reasons learning can slow, when considering the learning rate:
the optimal value has been reached (or at least a local minimum)
The learning rate is too big and we are overshooting our
|
What causes the elbow shape of the loss curve?
There are 3 reasons learning can slow, when considering the learning rate:
the optimal value has been reached (or at least a local minimum)
The learning rate is too big and we are overshooting our target
We are at a plateau with a very small gradient and the learning rate is too small to get us out there quickly.
Now one issue is determining in which situation you are. Would decreasing the learning rate help or make the problem worse? And if we need to decrease the learning rate, how fast do we need to do it?
For FractalNet, we see that the performance for epochs 50-200 is quite poor, but for 1-50 is quite good. Undoubtedly decreasing the learning rate in a linear manner is going to decrease performance on those first 50 epochs. On the other hand, there might be a plateau that the algorithm found in epochs 50-200, so it is not certain that a lower learning rate would even improve the performance in those epochs. So what do we do? Do we reduce the learning rate linearly and if so how quickly?
There are various ways to approach this problem. An interesting one is for example momentum based approaches, where we try to filter out repeated overshooting. The issue is that the perfect solution varies from problem to problem and it takes quite some testing to figure out which approach has the best effect. It then could be faster to just do something simple like this and train it a bit longer than to investigate the problem for weeks to reduce training time.
|
What causes the elbow shape of the loss curve?
There are 3 reasons learning can slow, when considering the learning rate:
the optimal value has been reached (or at least a local minimum)
The learning rate is too big and we are overshooting our
|
43,062
|
Setting custom three-way interaction contrasts in R
|
This can be done in the lsmeans package pretty simply:
lsm = lsmeans(fit, ~A*B|C)
contrast(lsm, interaction = "pairwise")
This code generates and tests the contrast with coefficients $(1,-1,-1,1)$ at each level of factor $C$. This contrast is generated by taking the product of coefficients $(1,-1,1,-1)$ (for factor $A$) and $(1,1,-1,-1)$ (for factor $B$).
|
Setting custom three-way interaction contrasts in R
|
This can be done in the lsmeans package pretty simply:
lsm = lsmeans(fit, ~A*B|C)
contrast(lsm, interaction = "pairwise")
This code generates and tests the contrast with coefficients $(1,-1,-1,1)$ at
|
Setting custom three-way interaction contrasts in R
This can be done in the lsmeans package pretty simply:
lsm = lsmeans(fit, ~A*B|C)
contrast(lsm, interaction = "pairwise")
This code generates and tests the contrast with coefficients $(1,-1,-1,1)$ at each level of factor $C$. This contrast is generated by taking the product of coefficients $(1,-1,1,-1)$ (for factor $A$) and $(1,1,-1,-1)$ (for factor $B$).
|
Setting custom three-way interaction contrasts in R
This can be done in the lsmeans package pretty simply:
lsm = lsmeans(fit, ~A*B|C)
contrast(lsm, interaction = "pairwise")
This code generates and tests the contrast with coefficients $(1,-1,-1,1)$ at
|
43,063
|
What is the role of feature engineering in statistical inference?
|
I will try to illustrate the reason behind feature engineering in general, say I would like to analyze images.
When we design features, we have to keep in mind that they are a representation of the original data/image. Now, if I know which kind of information matter for the task I have to do, I need the features to reflect this.
For instance, if I would like to know the content of an image and I choose as feature the number of pixels in the image, it will not work, obviously. Now, if I choose to use the average intensity of the pixels across patches, I will be able to differentiate between a blue image and a white image. But maybe I want to know if an object is present in the image and this feature will be useless. So, I may consider the intensity gradients between the pixels and look at their variations (but then, I will not be able to say if my image is rather blue or white!).
There is no ideal feature, just features that are designed for a specific task and this task is only known from the person designing the entire framework: you! This is why feature engineering is important. However, research on the topic of features design is huge and for most tasks that you are working with, someone has already designed features that are proven to work great and you can just use them as is (or twist them a bit if needed).
Most efficient features are based on theories from various mathematical fields and their range of application is somehow narrow. Opposite, classifiers often have a broad range of applications and that's why I think the emphasis is often on them while in studying in academia.
|
What is the role of feature engineering in statistical inference?
|
I will try to illustrate the reason behind feature engineering in general, say I would like to analyze images.
When we design features, we have to keep in mind that they are a representation of the or
|
What is the role of feature engineering in statistical inference?
I will try to illustrate the reason behind feature engineering in general, say I would like to analyze images.
When we design features, we have to keep in mind that they are a representation of the original data/image. Now, if I know which kind of information matter for the task I have to do, I need the features to reflect this.
For instance, if I would like to know the content of an image and I choose as feature the number of pixels in the image, it will not work, obviously. Now, if I choose to use the average intensity of the pixels across patches, I will be able to differentiate between a blue image and a white image. But maybe I want to know if an object is present in the image and this feature will be useless. So, I may consider the intensity gradients between the pixels and look at their variations (but then, I will not be able to say if my image is rather blue or white!).
There is no ideal feature, just features that are designed for a specific task and this task is only known from the person designing the entire framework: you! This is why feature engineering is important. However, research on the topic of features design is huge and for most tasks that you are working with, someone has already designed features that are proven to work great and you can just use them as is (or twist them a bit if needed).
Most efficient features are based on theories from various mathematical fields and their range of application is somehow narrow. Opposite, classifiers often have a broad range of applications and that's why I think the emphasis is often on them while in studying in academia.
|
What is the role of feature engineering in statistical inference?
I will try to illustrate the reason behind feature engineering in general, say I would like to analyze images.
When we design features, we have to keep in mind that they are a representation of the or
|
43,064
|
What is the role of feature engineering in statistical inference?
|
As this Wiki article makes clear (https://en.wikipedia.org/wiki/Feature_engineering), feature engineering is a key step in machine learning, involving the generation and cultivation of a set of features or attributes that may prove empirically (not necessarily theoretically) useful in the prediction or classification of a target. Andrew Ng (and others) make much of expert, domain knowledge in the development of a set of features but given the multitude of transformations that can be applied to data to improve model fit, the massive numbers of features that are commonly analyzed and the "black-box" nature of many of the algorithms employed, domain knowledge hardly seems a priority.
For me, it's always useful to point out that inference vs prediction and classification can be viewed as separate domains, the former belonging to statistics and the latter the focus of machine learning. Obviously, there is much overlap in this terminology and these fields, i.e., they are by no means mutually exclusive. Broadly speaking, statistical inference involves expert, domain knowledge, careful specification of an hypothesis, a finite (small) set of attributes or features, coupled with an experimental design to test the hypothesis out -- classic scientific inquiry with the goal of driving insight and understanding relative to ground truth. ML prediction and classification, on the other hand, may or may not be hypothesis driven, may or may not have descriptive insight as a goal and may or may not have ground truth as a benchmark.
|
What is the role of feature engineering in statistical inference?
|
As this Wiki article makes clear (https://en.wikipedia.org/wiki/Feature_engineering), feature engineering is a key step in machine learning, involving the generation and cultivation of a set of featur
|
What is the role of feature engineering in statistical inference?
As this Wiki article makes clear (https://en.wikipedia.org/wiki/Feature_engineering), feature engineering is a key step in machine learning, involving the generation and cultivation of a set of features or attributes that may prove empirically (not necessarily theoretically) useful in the prediction or classification of a target. Andrew Ng (and others) make much of expert, domain knowledge in the development of a set of features but given the multitude of transformations that can be applied to data to improve model fit, the massive numbers of features that are commonly analyzed and the "black-box" nature of many of the algorithms employed, domain knowledge hardly seems a priority.
For me, it's always useful to point out that inference vs prediction and classification can be viewed as separate domains, the former belonging to statistics and the latter the focus of machine learning. Obviously, there is much overlap in this terminology and these fields, i.e., they are by no means mutually exclusive. Broadly speaking, statistical inference involves expert, domain knowledge, careful specification of an hypothesis, a finite (small) set of attributes or features, coupled with an experimental design to test the hypothesis out -- classic scientific inquiry with the goal of driving insight and understanding relative to ground truth. ML prediction and classification, on the other hand, may or may not be hypothesis driven, may or may not have descriptive insight as a goal and may or may not have ground truth as a benchmark.
|
What is the role of feature engineering in statistical inference?
As this Wiki article makes clear (https://en.wikipedia.org/wiki/Feature_engineering), feature engineering is a key step in machine learning, involving the generation and cultivation of a set of featur
|
43,065
|
What is the role of feature engineering in statistical inference?
|
Predictors, dummy variables, or features are important in predictive modeling as they help capture genuine patterns in a data set and therefore make a better prediction since a model having a certain behavior will likely continue to have a certain behavior. And feature engineering helps capture this behavior.
Now for statistical inference based on your definition, you can already assess to an extent the relationship between predictor and response variable using exploratory analysis like scatterplots, correlation plots, correlograms, seasonal plots, lag plots. And further, strengthen your assessment by removing/adding the predictor from the features and evaluating the prediction.
So, feature engineering I would say is a crucial step in predictive modeling, and secondary in drawing statistical inference (since there are other methods to assess the relationship between available variables, looking into the historic data)
|
What is the role of feature engineering in statistical inference?
|
Predictors, dummy variables, or features are important in predictive modeling as they help capture genuine patterns in a data set and therefore make a better prediction since a model having a certain
|
What is the role of feature engineering in statistical inference?
Predictors, dummy variables, or features are important in predictive modeling as they help capture genuine patterns in a data set and therefore make a better prediction since a model having a certain behavior will likely continue to have a certain behavior. And feature engineering helps capture this behavior.
Now for statistical inference based on your definition, you can already assess to an extent the relationship between predictor and response variable using exploratory analysis like scatterplots, correlation plots, correlograms, seasonal plots, lag plots. And further, strengthen your assessment by removing/adding the predictor from the features and evaluating the prediction.
So, feature engineering I would say is a crucial step in predictive modeling, and secondary in drawing statistical inference (since there are other methods to assess the relationship between available variables, looking into the historic data)
|
What is the role of feature engineering in statistical inference?
Predictors, dummy variables, or features are important in predictive modeling as they help capture genuine patterns in a data set and therefore make a better prediction since a model having a certain
|
43,066
|
What is the role of feature engineering in statistical inference?
|
Feature engineering, broadly speaking, does at least 2 things.
First, you might clean, restructure, or transform your features in such a way that the useful information is enhanced and redundant or noise information is minimized. Perhaps you know that one category of people/products/widgets is totally irrelevant and remove them.
Second, you might create new features based on domain knowledge in your particular field. In this case, you actually add new information that was not there previously. In my own work, it's been these engineered features that provide the most utility.
This is probably difficult to teach, yet it's unfortunate your program overlooked this very important step.
|
What is the role of feature engineering in statistical inference?
|
Feature engineering, broadly speaking, does at least 2 things.
First, you might clean, restructure, or transform your features in such a way that the useful information is enhanced and redundant or n
|
What is the role of feature engineering in statistical inference?
Feature engineering, broadly speaking, does at least 2 things.
First, you might clean, restructure, or transform your features in such a way that the useful information is enhanced and redundant or noise information is minimized. Perhaps you know that one category of people/products/widgets is totally irrelevant and remove them.
Second, you might create new features based on domain knowledge in your particular field. In this case, you actually add new information that was not there previously. In my own work, it's been these engineered features that provide the most utility.
This is probably difficult to teach, yet it's unfortunate your program overlooked this very important step.
|
What is the role of feature engineering in statistical inference?
Feature engineering, broadly speaking, does at least 2 things.
First, you might clean, restructure, or transform your features in such a way that the useful information is enhanced and redundant or n
|
43,067
|
Tversky and Kahneman eye color problem
|
Great question! So,
P(Blue-Eyed Mom AND Blue-Eyed Daughter) = P(Blue-Eyed Mom | Blue-Eyed Daughter) * P( Blue-Eyed Daughter) = P( Blue-Eyed Daughter | Blue-Eyed Mom ) * P( Blue-Eyed Mom )
If P( Blue-Eyed Mom ) = P( Blue-Eyed Daughter ), then the conditional probabilities should, indeed hold.
However, I think your example excellently illustrates how P( Blue-Eyed Mom ) = P( Blue-Eyed Daughter ) is not a simple matter of counting!
These have to be equal regardless of how we sample them. So one way to guarantee that is (as you stated!) enforce a one-child policy. However, I think it would also work with an n-child policy (i.e. as long as every mother had the same number).
Perhaps, we could get away with this being approximately true with a very large number of Moms and some number of Daughter variance. I ran a quick simulation with 10,000 Moms, each having 1 to 3 daughters (uniform distribution), with a 1/3 chance of blue eyes among Moms and Daughters and a 1/2 chance of Blue implying Blue from a Mom to Daughter perspective. It looks like the rule held up reasonably well. On 4 runs the M|D s where 49.08 to 50.66%
|
Tversky and Kahneman eye color problem
|
Great question! So,
P(Blue-Eyed Mom AND Blue-Eyed Daughter) = P(Blue-Eyed Mom | Blue-Eyed Daughter) * P( Blue-Eyed Daughter) = P( Blue-Eyed Daughter | Blue-Eyed Mom ) * P( Blue-Eyed Mom )
If P( Blue
|
Tversky and Kahneman eye color problem
Great question! So,
P(Blue-Eyed Mom AND Blue-Eyed Daughter) = P(Blue-Eyed Mom | Blue-Eyed Daughter) * P( Blue-Eyed Daughter) = P( Blue-Eyed Daughter | Blue-Eyed Mom ) * P( Blue-Eyed Mom )
If P( Blue-Eyed Mom ) = P( Blue-Eyed Daughter ), then the conditional probabilities should, indeed hold.
However, I think your example excellently illustrates how P( Blue-Eyed Mom ) = P( Blue-Eyed Daughter ) is not a simple matter of counting!
These have to be equal regardless of how we sample them. So one way to guarantee that is (as you stated!) enforce a one-child policy. However, I think it would also work with an n-child policy (i.e. as long as every mother had the same number).
Perhaps, we could get away with this being approximately true with a very large number of Moms and some number of Daughter variance. I ran a quick simulation with 10,000 Moms, each having 1 to 3 daughters (uniform distribution), with a 1/3 chance of blue eyes among Moms and Daughters and a 1/2 chance of Blue implying Blue from a Mom to Daughter perspective. It looks like the rule held up reasonably well. On 4 runs the M|D s where 49.08 to 50.66%
|
Tversky and Kahneman eye color problem
Great question! So,
P(Blue-Eyed Mom AND Blue-Eyed Daughter) = P(Blue-Eyed Mom | Blue-Eyed Daughter) * P( Blue-Eyed Daughter) = P( Blue-Eyed Daughter | Blue-Eyed Mom ) * P( Blue-Eyed Mom )
If P( Blue
|
43,068
|
Any soft version for precision/recall?
|
There are different scenarios that make such "partial class memberships" sensible (in different ways) for both prediction [that is quite straightforward] and reference.
Remote sensing discusses the "problem of mixed pixels" which are not probabilities but fractions as in fuzzy sets - true classes are mixed because of low [spatial] resolution. For literature, see e.g. the references in the paper linked below.
I've been looking into "soft" figures of merit from a chemometric perspective with a medical application in my PhD (and in a scenario where we have both probabilities as in the reference diagnosis is not entirely certain about class and mixture of pure classes as in the measurement volume, several classes of cells occur). In that context I found it better to sort out optimism/pessimism (as in optimistic/pessimistic bias) in the derived figures of merit: the uncertainty in the reference for both probability and mixture translates into a range for the figure of merit that is in accordance with the observed reference and prediction labels. I find it convenient to state figures of merit as worst case - expected case [under certain assumptions] - best case (as the medical application was a scenario of advising surgeons to cut out brain tissue, the worst case performance of such a diagnostic tool would be the one to focus on - whereas I found that the remote sensing literature tended to use the optimistic best case numbers).
The paper is:
Beleites, C. et al.: Validation of soft classification models using partial class memberships: An extended concept of sensitivity & Co. applied to grading of astrocytoma tissues, Chemom Intell Lab Syst, 122, 12 - 22 (2013).
DOI: 10.1016/j.chemolab.2012.12.003
on arXiv: 1301.0264
Implementation: R package softclassval
http://softclassval.r-forge.r-project.org
Explanation in German is available in chapter 8 of my PhD thesis. Chapter 8.3 discusses variance properties that are not discussed in the paper.
Your multiplication for the AND-operator (precision = fraction of cases that are predicted true AND are true by reference of all cases predicted true) leads to the expected precision above.
BTW: the expectation can be expressed in a way that is closely related to Brier's score (a proper scoring rule), and to typical regression-error figures of merit.
|
Any soft version for precision/recall?
|
There are different scenarios that make such "partial class memberships" sensible (in different ways) for both prediction [that is quite straightforward] and reference.
Remote sensing discusses the "
|
Any soft version for precision/recall?
There are different scenarios that make such "partial class memberships" sensible (in different ways) for both prediction [that is quite straightforward] and reference.
Remote sensing discusses the "problem of mixed pixels" which are not probabilities but fractions as in fuzzy sets - true classes are mixed because of low [spatial] resolution. For literature, see e.g. the references in the paper linked below.
I've been looking into "soft" figures of merit from a chemometric perspective with a medical application in my PhD (and in a scenario where we have both probabilities as in the reference diagnosis is not entirely certain about class and mixture of pure classes as in the measurement volume, several classes of cells occur). In that context I found it better to sort out optimism/pessimism (as in optimistic/pessimistic bias) in the derived figures of merit: the uncertainty in the reference for both probability and mixture translates into a range for the figure of merit that is in accordance with the observed reference and prediction labels. I find it convenient to state figures of merit as worst case - expected case [under certain assumptions] - best case (as the medical application was a scenario of advising surgeons to cut out brain tissue, the worst case performance of such a diagnostic tool would be the one to focus on - whereas I found that the remote sensing literature tended to use the optimistic best case numbers).
The paper is:
Beleites, C. et al.: Validation of soft classification models using partial class memberships: An extended concept of sensitivity & Co. applied to grading of astrocytoma tissues, Chemom Intell Lab Syst, 122, 12 - 22 (2013).
DOI: 10.1016/j.chemolab.2012.12.003
on arXiv: 1301.0264
Implementation: R package softclassval
http://softclassval.r-forge.r-project.org
Explanation in German is available in chapter 8 of my PhD thesis. Chapter 8.3 discusses variance properties that are not discussed in the paper.
Your multiplication for the AND-operator (precision = fraction of cases that are predicted true AND are true by reference of all cases predicted true) leads to the expected precision above.
BTW: the expectation can be expressed in a way that is closely related to Brier's score (a proper scoring rule), and to typical regression-error figures of merit.
|
Any soft version for precision/recall?
There are different scenarios that make such "partial class memberships" sensible (in different ways) for both prediction [that is quite straightforward] and reference.
Remote sensing discusses the "
|
43,069
|
Gibbs sampling for spike and slab priors
|
The notation in the paper uses $\mathcal J_k$ instead of $\lambda_k$. I am going to use $\lambda_k$ as in the question. I am going to drop subscript $k$ for simplicity. The model is then
\begin{align*}
\beta \mid \lambda &\sim N(0, \lambda \tau^2) \\
\lambda &\sim (1-w) \delta_{\nu_0} + w \delta_1.
\end{align*}
The rest requires some measure theory knowledge and the Radon-Nikodym theorem. The trick to write a joint density for this model is to note that both of the point mass measures $\delta_{\nu_0}$ and $\delta_1$ have densities with w.r.t. $\mu = $ the counting measure on $\{\nu_0, 1\}$. With some abuse of notation let us write $\delta_{\nu_0}(\lambda)$ for the density of $\delta_{\nu_0}$ w.r.t. $\mu$ as well, and similarly $\delta_1(\lambda)$ denotes the density of $\delta_1$ w.r.t. $\mu$. It is easy to verify that
$$
\delta_{\nu_0}(\lambda) =
\begin{cases}
1 & \lambda = \nu_0 \\
0 & \lambda \neq \nu_0
\end{cases}
$$
and similarly for $\delta_1(\lambda)$. Let $\mathcal L$ be the Lebesgue measure on the real line. Then the distribution of $(\beta, \lambda)$ is absolutely continuous w.r.t. $\mathcal L + \mu$ with density
\begin{align*}
p(\beta, \lambda) &\propto \underbrace{\frac{1}{\sqrt{\lambda \tau^2}} \exp \Bigl( - \frac{\beta^2}{2 \lambda \tau^2} \Bigr)}_{:= f(\lambda,\beta)}\cdot
\bigl[(1-w) \delta_{\nu_0}(\lambda) + w \delta_1(\lambda)\bigr] \\
&= (1-w) f(\lambda, \beta) \delta_{\nu_0}(\lambda) + w f(\lambda, \beta) \delta_1(\lambda) \\
&= (1-w) f(\nu_0, \beta) \delta_{\nu_0}(\lambda) + (1-w) f(1, \beta) \delta_1(\lambda)
\end{align*}
where the last line follows since $\delta_{\nu_0}(\lambda)$ and $\delta_1(\lambda)$ are indicator functions.
Then, we have
$$
p(\lambda \mid \beta) \propto \underbrace{(1-w) f(\nu_0, \beta)}_{w_1} \delta_{\nu_0}(\lambda) + \underbrace{(1-w) f(1, \beta)}_{w_2} \delta_1(\lambda)
$$
which is a density w.r.t. to $\mathcal L + \mu$. Since $\beta$ is a constant here, this is a discrete distribution taking values $\nu_0$ and $1$ with probabilities proportional to $w_1$ and $w_2$. This can be alternatively stated as
$$
\mathbb P(\lambda = \nu_0 \mid \beta) = \frac{w_1}{w_1 + w_2}, \quad
\mathbb P(\lambda = 1 \mid \beta) = \frac{w_2}{w_1 + w_2}.
$$
|
Gibbs sampling for spike and slab priors
|
The notation in the paper uses $\mathcal J_k$ instead of $\lambda_k$. I am going to use $\lambda_k$ as in the question. I am going to drop subscript $k$ for simplicity. The model is then
\begin{align*
|
Gibbs sampling for spike and slab priors
The notation in the paper uses $\mathcal J_k$ instead of $\lambda_k$. I am going to use $\lambda_k$ as in the question. I am going to drop subscript $k$ for simplicity. The model is then
\begin{align*}
\beta \mid \lambda &\sim N(0, \lambda \tau^2) \\
\lambda &\sim (1-w) \delta_{\nu_0} + w \delta_1.
\end{align*}
The rest requires some measure theory knowledge and the Radon-Nikodym theorem. The trick to write a joint density for this model is to note that both of the point mass measures $\delta_{\nu_0}$ and $\delta_1$ have densities with w.r.t. $\mu = $ the counting measure on $\{\nu_0, 1\}$. With some abuse of notation let us write $\delta_{\nu_0}(\lambda)$ for the density of $\delta_{\nu_0}$ w.r.t. $\mu$ as well, and similarly $\delta_1(\lambda)$ denotes the density of $\delta_1$ w.r.t. $\mu$. It is easy to verify that
$$
\delta_{\nu_0}(\lambda) =
\begin{cases}
1 & \lambda = \nu_0 \\
0 & \lambda \neq \nu_0
\end{cases}
$$
and similarly for $\delta_1(\lambda)$. Let $\mathcal L$ be the Lebesgue measure on the real line. Then the distribution of $(\beta, \lambda)$ is absolutely continuous w.r.t. $\mathcal L + \mu$ with density
\begin{align*}
p(\beta, \lambda) &\propto \underbrace{\frac{1}{\sqrt{\lambda \tau^2}} \exp \Bigl( - \frac{\beta^2}{2 \lambda \tau^2} \Bigr)}_{:= f(\lambda,\beta)}\cdot
\bigl[(1-w) \delta_{\nu_0}(\lambda) + w \delta_1(\lambda)\bigr] \\
&= (1-w) f(\lambda, \beta) \delta_{\nu_0}(\lambda) + w f(\lambda, \beta) \delta_1(\lambda) \\
&= (1-w) f(\nu_0, \beta) \delta_{\nu_0}(\lambda) + (1-w) f(1, \beta) \delta_1(\lambda)
\end{align*}
where the last line follows since $\delta_{\nu_0}(\lambda)$ and $\delta_1(\lambda)$ are indicator functions.
Then, we have
$$
p(\lambda \mid \beta) \propto \underbrace{(1-w) f(\nu_0, \beta)}_{w_1} \delta_{\nu_0}(\lambda) + \underbrace{(1-w) f(1, \beta)}_{w_2} \delta_1(\lambda)
$$
which is a density w.r.t. to $\mathcal L + \mu$. Since $\beta$ is a constant here, this is a discrete distribution taking values $\nu_0$ and $1$ with probabilities proportional to $w_1$ and $w_2$. This can be alternatively stated as
$$
\mathbb P(\lambda = \nu_0 \mid \beta) = \frac{w_1}{w_1 + w_2}, \quad
\mathbb P(\lambda = 1 \mid \beta) = \frac{w_2}{w_1 + w_2}.
$$
|
Gibbs sampling for spike and slab priors
The notation in the paper uses $\mathcal J_k$ instead of $\lambda_k$. I am going to use $\lambda_k$ as in the question. I am going to drop subscript $k$ for simplicity. The model is then
\begin{align*
|
43,070
|
Inconsistency in unit on gradient descent equation
|
As was concluded in the discussion in comments, dimensional analysis would necessitate that the relevant component of $\alpha$ is in fact in the units necessary to make
$$\alpha_j \frac{\partial}{\partial \theta_j}J(\theta)$$
have the same units as $\theta_j$
|
Inconsistency in unit on gradient descent equation
|
As was concluded in the discussion in comments, dimensional analysis would necessitate that the relevant component of $\alpha$ is in fact in the units necessary to make
$$\alpha_j \frac{\partial}{\pa
|
Inconsistency in unit on gradient descent equation
As was concluded in the discussion in comments, dimensional analysis would necessitate that the relevant component of $\alpha$ is in fact in the units necessary to make
$$\alpha_j \frac{\partial}{\partial \theta_j}J(\theta)$$
have the same units as $\theta_j$
|
Inconsistency in unit on gradient descent equation
As was concluded in the discussion in comments, dimensional analysis would necessitate that the relevant component of $\alpha$ is in fact in the units necessary to make
$$\alpha_j \frac{\partial}{\pa
|
43,071
|
Inconsistency in unit on gradient descent equation
|
For the same reason that the slope of a line is not the "run", but is instead "rise" over "run", a gradient isn't a displacement in your theta-parameter space... anyone telling you otherwise is wrong. This is why the units don't match as you noted. However, the fundamental property of a gradient is that the directional derivative of a function is maximized in a direction PARALLEL to the gradient. It makes sense because gradient vector components are all the "rise" of the function divided by the "run" in each parameter (i.e. they're the slopes in each direction). If the slope of a tangent to your function (hyper-)surface is 5 times stronger in one parameter than another, you will want to move 5 times more in the strong parameter than the other. If the units are bothering you, remember that you can multiply (or divide) the gradient vector by any unit and by any scalar (like minus alpha) and you will still be parallel (or anti-parallel) to it.
|
Inconsistency in unit on gradient descent equation
|
For the same reason that the slope of a line is not the "run", but is instead "rise" over "run", a gradient isn't a displacement in your theta-parameter space... anyone telling you otherwise is wrong.
|
Inconsistency in unit on gradient descent equation
For the same reason that the slope of a line is not the "run", but is instead "rise" over "run", a gradient isn't a displacement in your theta-parameter space... anyone telling you otherwise is wrong. This is why the units don't match as you noted. However, the fundamental property of a gradient is that the directional derivative of a function is maximized in a direction PARALLEL to the gradient. It makes sense because gradient vector components are all the "rise" of the function divided by the "run" in each parameter (i.e. they're the slopes in each direction). If the slope of a tangent to your function (hyper-)surface is 5 times stronger in one parameter than another, you will want to move 5 times more in the strong parameter than the other. If the units are bothering you, remember that you can multiply (or divide) the gradient vector by any unit and by any scalar (like minus alpha) and you will still be parallel (or anti-parallel) to it.
|
Inconsistency in unit on gradient descent equation
For the same reason that the slope of a line is not the "run", but is instead "rise" over "run", a gradient isn't a displacement in your theta-parameter space... anyone telling you otherwise is wrong.
|
43,072
|
anomaly detection with gaussian mixture models
|
Gaussian Mixture Models allow assigning a probability to each datapoint of beeing created by one of k gaussian distributions.
These are normalized to sum up to one, allowing interpretation as "Which cluster is most probably responsible for this datapoint?"
If you do not normalize, you have absolute probabilities which estimate how probable a point is - given a specific gaussian mixture model.
Then you can simply define an outlier such as: If p < 0.05 for each cluster, then the point is an outlier.
Yet be warned, the expectation maximization algorithm for gaussian mixture models - which you will need to get best parameters for your gaussian mixture model - is not very robust and tends to find suboptimal solution.
For reading more - especially unterstanding more - I recommend Bishop: Pattern Recognition and Machine Learning
|
anomaly detection with gaussian mixture models
|
Gaussian Mixture Models allow assigning a probability to each datapoint of beeing created by one of k gaussian distributions.
These are normalized to sum up to one, allowing interpretation as "Which
|
anomaly detection with gaussian mixture models
Gaussian Mixture Models allow assigning a probability to each datapoint of beeing created by one of k gaussian distributions.
These are normalized to sum up to one, allowing interpretation as "Which cluster is most probably responsible for this datapoint?"
If you do not normalize, you have absolute probabilities which estimate how probable a point is - given a specific gaussian mixture model.
Then you can simply define an outlier such as: If p < 0.05 for each cluster, then the point is an outlier.
Yet be warned, the expectation maximization algorithm for gaussian mixture models - which you will need to get best parameters for your gaussian mixture model - is not very robust and tends to find suboptimal solution.
For reading more - especially unterstanding more - I recommend Bishop: Pattern Recognition and Machine Learning
|
anomaly detection with gaussian mixture models
Gaussian Mixture Models allow assigning a probability to each datapoint of beeing created by one of k gaussian distributions.
These are normalized to sum up to one, allowing interpretation as "Which
|
43,073
|
Can all neural network with DAG topology be trained by Back-prop?
|
Can all neural network having directed acyclic graph (DAG) topology be trained by back propagation methods? I mean by the back propagation methods like Stochastic gradient decent, AdaGrad, Adam, etc.
The methods you mention are gradient-based, and subsequently won't work if one activation function used by the artificial neurons isn't differentiable. However, they are some ways around, e.g. using reinforcement learning.
|
Can all neural network with DAG topology be trained by Back-prop?
|
Can all neural network having directed acyclic graph (DAG) topology be trained by back propagation methods? I mean by the back propagation methods like Stochastic gradient decent, AdaGrad, Adam, etc.
|
Can all neural network with DAG topology be trained by Back-prop?
Can all neural network having directed acyclic graph (DAG) topology be trained by back propagation methods? I mean by the back propagation methods like Stochastic gradient decent, AdaGrad, Adam, etc.
The methods you mention are gradient-based, and subsequently won't work if one activation function used by the artificial neurons isn't differentiable. However, they are some ways around, e.g. using reinforcement learning.
|
Can all neural network with DAG topology be trained by Back-prop?
Can all neural network having directed acyclic graph (DAG) topology be trained by back propagation methods? I mean by the back propagation methods like Stochastic gradient decent, AdaGrad, Adam, etc.
|
43,074
|
Likelihood Factorization
|
I don't know whether this winds up being a good thing to do, but you can express the distribution of $y_3$ conditional on $y_1,y_2$, which is a 1D Normal, using the standard Schur complement approach shown in https://en.wikipedia.org/wiki/Multivariate_normal_distribution#Conditional_distributions .
Let $\mu_1,\mu_2,\mu_3$ be the means of $y_1,y_2,y_3$.
Denote $K_{12}$ as the diagonal matrix with entries $k_{11}$ and $k_{22}$, i.e., the covariance matrix of $[y_1,y_2]^T$. Its inverse is obtained by inverting the diagonal elements.
$y_3$ conditional on $[y_1,y_2]^{T} = [x_1,x_2]^{T}$ is Normal and has
$$mean = \mu_3 + [k_{13},k_{23}] K_{12}^{-1} [x_1 - \mu1,x_2 - \mu_2]^{T}$$
and $$variance = k_{33} - [k_{13},k_{23}] K_{12}^{-1} [k_{13},k_{23}]^T$$
|
Likelihood Factorization
|
I don't know whether this winds up being a good thing to do, but you can express the distribution of $y_3$ conditional on $y_1,y_2$, which is a 1D Normal, using the standard Schur complement approach
|
Likelihood Factorization
I don't know whether this winds up being a good thing to do, but you can express the distribution of $y_3$ conditional on $y_1,y_2$, which is a 1D Normal, using the standard Schur complement approach shown in https://en.wikipedia.org/wiki/Multivariate_normal_distribution#Conditional_distributions .
Let $\mu_1,\mu_2,\mu_3$ be the means of $y_1,y_2,y_3$.
Denote $K_{12}$ as the diagonal matrix with entries $k_{11}$ and $k_{22}$, i.e., the covariance matrix of $[y_1,y_2]^T$. Its inverse is obtained by inverting the diagonal elements.
$y_3$ conditional on $[y_1,y_2]^{T} = [x_1,x_2]^{T}$ is Normal and has
$$mean = \mu_3 + [k_{13},k_{23}] K_{12}^{-1} [x_1 - \mu1,x_2 - \mu_2]^{T}$$
and $$variance = k_{33} - [k_{13},k_{23}] K_{12}^{-1} [k_{13},k_{23}]^T$$
|
Likelihood Factorization
I don't know whether this winds up being a good thing to do, but you can express the distribution of $y_3$ conditional on $y_1,y_2$, which is a 1D Normal, using the standard Schur complement approach
|
43,075
|
Poisson regression: how do number of observations and offset affect variance of betas?
|
For Poisson likelihoods estimated in log-linear models, the number of observations do not affect the variance of the betas. This is because there is a mean variance relationship. The variance-covariance estimate of a coefficients to a Poisson regression model is given by:
$$ \text{var}(\hat{\beta}) = \left( \mathbf{X}^T \text{diag}(\hat{y}) \mathbf{X} \right) ^T$$
Note there is no use of the offset here. The variance structure is given by the usual $\mathbf{A}$ matrix formulation of exact likelihood based inference, where the variance is the predicted model variance (the variance is the mean for Poisson models).
This all falls apart if you consider quasipoisson models where the mean equals the variance up to a constant value. That constant, the dispersion, must be estimated and leads to inference which does depend on the number and formatting of the observations. Each observation must, in that case, have a tangible meaning and fundamental level of replication which is endemic to the study design. A very illustrative example comes from Agresti's Categorical Data Analysis book and the example of horseshoe crabs mating.
|
Poisson regression: how do number of observations and offset affect variance of betas?
|
For Poisson likelihoods estimated in log-linear models, the number of observations do not affect the variance of the betas. This is because there is a mean variance relationship. The variance-covarian
|
Poisson regression: how do number of observations and offset affect variance of betas?
For Poisson likelihoods estimated in log-linear models, the number of observations do not affect the variance of the betas. This is because there is a mean variance relationship. The variance-covariance estimate of a coefficients to a Poisson regression model is given by:
$$ \text{var}(\hat{\beta}) = \left( \mathbf{X}^T \text{diag}(\hat{y}) \mathbf{X} \right) ^T$$
Note there is no use of the offset here. The variance structure is given by the usual $\mathbf{A}$ matrix formulation of exact likelihood based inference, where the variance is the predicted model variance (the variance is the mean for Poisson models).
This all falls apart if you consider quasipoisson models where the mean equals the variance up to a constant value. That constant, the dispersion, must be estimated and leads to inference which does depend on the number and formatting of the observations. Each observation must, in that case, have a tangible meaning and fundamental level of replication which is endemic to the study design. A very illustrative example comes from Agresti's Categorical Data Analysis book and the example of horseshoe crabs mating.
|
Poisson regression: how do number of observations and offset affect variance of betas?
For Poisson likelihoods estimated in log-linear models, the number of observations do not affect the variance of the betas. This is because there is a mean variance relationship. The variance-covarian
|
43,076
|
Does it make a difference to run xgboost on hot encoded variables or single factor variable?
|
Yes, it makes a difference. There is no good answer, you should try both. If you are looking for performance, you may even need to try various encodings and stack the models with the different ecodings...
Another approach could be to replace the factors (with a relatively large number of occurences) by the conditional average value of the target.
Edit.
As for the why, the reason comes from the fact that boosting are based on decision trees.
Imagine the factor column represents a country. If you encode it as an integer, the decision rule will read as if country > 10. This groups will represent all the countries that do not correspond to the first 10 countries (and the order of encoding will matter).
On the other hand, if you encode it with dummy variables, the generated rules will be if country10 > 0.5 (and this may correspond to a specific country : country10 == 1). Now (if you don't subsamble the columns when growing a tree), the performance of the model will be the same regardless of the encoding.
Towards an optimal integer encoding ?
Do you have information on the products ? Or is it just an ID ? If you could range your products so that 1-100 are, say, cellphones, 101-300 cars, 301 - 1000 books, it may help your algorithm to find groups with an actual meaning (now the rule if product > 300 automatically refers to all the books... There is absolutely no guarantees of improvement of performance with this method though.
|
Does it make a difference to run xgboost on hot encoded variables or single factor variable?
|
Yes, it makes a difference. There is no good answer, you should try both. If you are looking for performance, you may even need to try various encodings and stack the models with the different ecoding
|
Does it make a difference to run xgboost on hot encoded variables or single factor variable?
Yes, it makes a difference. There is no good answer, you should try both. If you are looking for performance, you may even need to try various encodings and stack the models with the different ecodings...
Another approach could be to replace the factors (with a relatively large number of occurences) by the conditional average value of the target.
Edit.
As for the why, the reason comes from the fact that boosting are based on decision trees.
Imagine the factor column represents a country. If you encode it as an integer, the decision rule will read as if country > 10. This groups will represent all the countries that do not correspond to the first 10 countries (and the order of encoding will matter).
On the other hand, if you encode it with dummy variables, the generated rules will be if country10 > 0.5 (and this may correspond to a specific country : country10 == 1). Now (if you don't subsamble the columns when growing a tree), the performance of the model will be the same regardless of the encoding.
Towards an optimal integer encoding ?
Do you have information on the products ? Or is it just an ID ? If you could range your products so that 1-100 are, say, cellphones, 101-300 cars, 301 - 1000 books, it may help your algorithm to find groups with an actual meaning (now the rule if product > 300 automatically refers to all the books... There is absolutely no guarantees of improvement of performance with this method though.
|
Does it make a difference to run xgboost on hot encoded variables or single factor variable?
Yes, it makes a difference. There is no good answer, you should try both. If you are looking for performance, you may even need to try various encodings and stack the models with the different ecoding
|
43,077
|
Should L2 regularization be corrected for scale?
|
Recall where this term actually comes from: the amount of weight decay we want to have for each weight at every iteration
del(E)/del(w(j,k,l))= del(left cross entropy error) + λ*(w(j,k,l)
say the λ is 0.001 essentially it means if Error is not affected by this particular weight, decay it by 0.1%. The number of units and layers does not affect the decay we want in a particular weight.
In his paper I don't think he is normalizing loss by n samples as you are doing:
but rather adding a 1/nsamples term to the gradient where nsamples is the minibatch size. So effectively his λ[his]= λ[yours]*nsamples. As you correctly said λ[yours] doesn't depend on mini batch size, but λ[his] depends, so he assumes λ is the regulartization parameter he would use for full batch gradient descent, and normalizes it by (nsamples/training set size) if doing it with mini-batches.
|
Should L2 regularization be corrected for scale?
|
Recall where this term actually comes from: the amount of weight decay we want to have for each weight at every iteration
del(E)/del(w(j,k,l))= del(left cross entropy error) + λ*(w(j,k,l)
say the λ is
|
Should L2 regularization be corrected for scale?
Recall where this term actually comes from: the amount of weight decay we want to have for each weight at every iteration
del(E)/del(w(j,k,l))= del(left cross entropy error) + λ*(w(j,k,l)
say the λ is 0.001 essentially it means if Error is not affected by this particular weight, decay it by 0.1%. The number of units and layers does not affect the decay we want in a particular weight.
In his paper I don't think he is normalizing loss by n samples as you are doing:
but rather adding a 1/nsamples term to the gradient where nsamples is the minibatch size. So effectively his λ[his]= λ[yours]*nsamples. As you correctly said λ[yours] doesn't depend on mini batch size, but λ[his] depends, so he assumes λ is the regulartization parameter he would use for full batch gradient descent, and normalizes it by (nsamples/training set size) if doing it with mini-batches.
|
Should L2 regularization be corrected for scale?
Recall where this term actually comes from: the amount of weight decay we want to have for each weight at every iteration
del(E)/del(w(j,k,l))= del(left cross entropy error) + λ*(w(j,k,l)
say the λ is
|
43,078
|
Are spectral decompositions of time-series useful for modeling/forecasting, or are they more of a tool for analysis?
|
I'd like to informally try to approach a few of these.
1) Are spectral decompositions useful for modeling/forecasting, or are they typically used only for analysis purposes.
1A) When modelling, I use the spectrum to give information about the seasonal components of my data. Simplistically, I might consider a model of the form:
$$
x_{t} = m_{t} + \sum_{i=1}^{S} s_{t}^{(i)} + Y_{t}
$$
Where you would have a mean function ($m_{t}$), $S$ seasonal components (sinusoids) ($s_{t}^{(i)}$), and a zero-mean random process $Y_{t}$.
I use the spectrum to estimate the seasonal components amplitudes and phases and then an ARMA (ARIMA?) to model $Y_{t}$.
2) Are the forecast of spectral decompositions always some repeated periodic series?
2A) As far as I'm aware, yes. The motivation for the theory makes the assumption that the process of interest is a discrete parameter stochastic process of the form:
$$
X_{t} = \sum_{l=1}^{L} D_{l}\cos(2\pi f_{l}t + \phi_{l})
$$
We let $L \rightarrow \infty$ in a "nice" way.
I believe we would also say, plus noise?
This is on page 127 of Spectral Analysis for Physical Applications: Multitaper and Conventional Univariate Techniques by Percival and Walden.
The only non-sinusoidal part is at $f = 0$.
3) Would using a seasonal ARIMA likely outperform (in terms of forecasting) a spectral decomposition, even with a ARIMA model on the residuals of the spectral model? (assuming data with strong seasonal/periodic trends)
3A) My intuition is that I would be doubtful that the ARIMA would perform better than spectral decomposition, however without any concrete proof. The reasoning is that you should get a much better estimate of the frequencies of interest from a spectral decomposition. I'd like to reiterate: I'm not sure though.
I'm not too sure about 4), again my intuition would be that you would need to recalculate the spectrum using the new data as opposed to being able to update the existing spectrum.
|
Are spectral decompositions of time-series useful for modeling/forecasting, or are they more of a to
|
I'd like to informally try to approach a few of these.
1) Are spectral decompositions useful for modeling/forecasting, or are they typically used only for analysis purposes.
1A) When modelling, I use
|
Are spectral decompositions of time-series useful for modeling/forecasting, or are they more of a tool for analysis?
I'd like to informally try to approach a few of these.
1) Are spectral decompositions useful for modeling/forecasting, or are they typically used only for analysis purposes.
1A) When modelling, I use the spectrum to give information about the seasonal components of my data. Simplistically, I might consider a model of the form:
$$
x_{t} = m_{t} + \sum_{i=1}^{S} s_{t}^{(i)} + Y_{t}
$$
Where you would have a mean function ($m_{t}$), $S$ seasonal components (sinusoids) ($s_{t}^{(i)}$), and a zero-mean random process $Y_{t}$.
I use the spectrum to estimate the seasonal components amplitudes and phases and then an ARMA (ARIMA?) to model $Y_{t}$.
2) Are the forecast of spectral decompositions always some repeated periodic series?
2A) As far as I'm aware, yes. The motivation for the theory makes the assumption that the process of interest is a discrete parameter stochastic process of the form:
$$
X_{t} = \sum_{l=1}^{L} D_{l}\cos(2\pi f_{l}t + \phi_{l})
$$
We let $L \rightarrow \infty$ in a "nice" way.
I believe we would also say, plus noise?
This is on page 127 of Spectral Analysis for Physical Applications: Multitaper and Conventional Univariate Techniques by Percival and Walden.
The only non-sinusoidal part is at $f = 0$.
3) Would using a seasonal ARIMA likely outperform (in terms of forecasting) a spectral decomposition, even with a ARIMA model on the residuals of the spectral model? (assuming data with strong seasonal/periodic trends)
3A) My intuition is that I would be doubtful that the ARIMA would perform better than spectral decomposition, however without any concrete proof. The reasoning is that you should get a much better estimate of the frequencies of interest from a spectral decomposition. I'd like to reiterate: I'm not sure though.
I'm not too sure about 4), again my intuition would be that you would need to recalculate the spectrum using the new data as opposed to being able to update the existing spectrum.
|
Are spectral decompositions of time-series useful for modeling/forecasting, or are they more of a to
I'd like to informally try to approach a few of these.
1) Are spectral decompositions useful for modeling/forecasting, or are they typically used only for analysis purposes.
1A) When modelling, I use
|
43,079
|
ideas on machine-learning algorithms to classify products
|
Addressing your issues one by one:
1) OCR: This is probably the easiest of your problems as there are many algorithms that perform well in this task. As a reference, in the best known handwritten digit dataset, MNIST, several algorithms have achieved over 99.5% accuracy (the state-of-the-art being Convolutional Neural Networks). You can also find many out-of-the-box solutions to your problem; it helps a lot if your data is in English, as the tools there are more advanced.
If your scans are noisy you may try denoising them first.
2) You need to do some preprocessing for this issue. First I would suggest, if possible, creating a bag of words, i.e. a list of all unique words in your "corpus". Verify that all these words are correct and perform a string distance comparison (e.g. hamming distance) to correct 1-2 letter typos. Another thing I would do would be to calculate the occurrences of each term in your bag and remove the least frequent ones (e.g. terms that occur less than N times in your corpus are probably typos, or remove least frequent M% of your terms). That should significantly reduce the noise in your dataset.
3) In order to solve this issue you need to perform some sort of semantic labelling. If you are familiar with ontologies, their hierarchical structure can help here a lot. You can create rules like "coca-cola" is a "soft drink" which is a type of beverage, etc.
I don't have experience in R, but I'm sure you can find tools to perform all the above quite easily.
|
ideas on machine-learning algorithms to classify products
|
Addressing your issues one by one:
1) OCR: This is probably the easiest of your problems as there are many algorithms that perform well in this task. As a reference, in the best known handwritten digi
|
ideas on machine-learning algorithms to classify products
Addressing your issues one by one:
1) OCR: This is probably the easiest of your problems as there are many algorithms that perform well in this task. As a reference, in the best known handwritten digit dataset, MNIST, several algorithms have achieved over 99.5% accuracy (the state-of-the-art being Convolutional Neural Networks). You can also find many out-of-the-box solutions to your problem; it helps a lot if your data is in English, as the tools there are more advanced.
If your scans are noisy you may try denoising them first.
2) You need to do some preprocessing for this issue. First I would suggest, if possible, creating a bag of words, i.e. a list of all unique words in your "corpus". Verify that all these words are correct and perform a string distance comparison (e.g. hamming distance) to correct 1-2 letter typos. Another thing I would do would be to calculate the occurrences of each term in your bag and remove the least frequent ones (e.g. terms that occur less than N times in your corpus are probably typos, or remove least frequent M% of your terms). That should significantly reduce the noise in your dataset.
3) In order to solve this issue you need to perform some sort of semantic labelling. If you are familiar with ontologies, their hierarchical structure can help here a lot. You can create rules like "coca-cola" is a "soft drink" which is a type of beverage, etc.
I don't have experience in R, but I'm sure you can find tools to perform all the above quite easily.
|
ideas on machine-learning algorithms to classify products
Addressing your issues one by one:
1) OCR: This is probably the easiest of your problems as there are many algorithms that perform well in this task. As a reference, in the best known handwritten digi
|
43,080
|
ideas on machine-learning algorithms to classify products
|
It seems that you should define similarity among the entities.
You have plenty of sources for similarity. You mentioned distance on the names (edit distance) and membership in groups. Note that you can extend the similarity by groups to many group and many similarity types. Groups can be belonging to the same recipe, sold by the same merchant, belonging to the same category, etc. Similarity types might be plane belonging to the same group, weight with inverse ratio to the group size, etc. On all of the use can use transitivity. For examples, you can find similar product of a different names by using the fact that they will be used with the same products (e.g., spice X` and spice X`` will both be used with chicken).
Very soon you will have plenty of similarity relations and you will wonder how to combine them. Here come to help the labeling you already done. Take these as positive pairs of associated products. Generate sets of distinct products (not in the positives pairs) as negative pairs. Build a dataset in which the positivity is the concept and the similarities are the pairs. Now you can use supervised learning algorithm to get a model that combines the similarities into a single prediction. You can use this model to predict the association between new pair. As a bonus you will be able to evaluate the performance of the model on the dataset (e.g., accuracy, precision,...) and have more certainty in it.
|
ideas on machine-learning algorithms to classify products
|
It seems that you should define similarity among the entities.
You have plenty of sources for similarity. You mentioned distance on the names (edit distance) and membership in groups. Note that you ca
|
ideas on machine-learning algorithms to classify products
It seems that you should define similarity among the entities.
You have plenty of sources for similarity. You mentioned distance on the names (edit distance) and membership in groups. Note that you can extend the similarity by groups to many group and many similarity types. Groups can be belonging to the same recipe, sold by the same merchant, belonging to the same category, etc. Similarity types might be plane belonging to the same group, weight with inverse ratio to the group size, etc. On all of the use can use transitivity. For examples, you can find similar product of a different names by using the fact that they will be used with the same products (e.g., spice X` and spice X`` will both be used with chicken).
Very soon you will have plenty of similarity relations and you will wonder how to combine them. Here come to help the labeling you already done. Take these as positive pairs of associated products. Generate sets of distinct products (not in the positives pairs) as negative pairs. Build a dataset in which the positivity is the concept and the similarities are the pairs. Now you can use supervised learning algorithm to get a model that combines the similarities into a single prediction. You can use this model to predict the association between new pair. As a bonus you will be able to evaluate the performance of the model on the dataset (e.g., accuracy, precision,...) and have more certainty in it.
|
ideas on machine-learning algorithms to classify products
It seems that you should define similarity among the entities.
You have plenty of sources for similarity. You mentioned distance on the names (edit distance) and membership in groups. Note that you ca
|
43,081
|
Causality and stationarity of AR models
|
A linear process $X_t$ is defined to be causal if $X_t=\psi(B)w_t$ where $w_t$ are white noises and $\sum_{j=1}^{\infty}|\psi(j)|<\infty$.
$X_t$ is defined to be invertible if we can write $w_t=\pi(B) X_t$ where $\pi(B)=\pi_0 + \pi_1 B+\pi_2 B^2 + \cdots$ and $\sum_{j=0}^{\infty}|\pi(j)|<\infty$.
Apparently, an arbitrary $\text{AR}(p)$ model, $$X_t-\phi_1 X_{t-1}-\phi_2 X_{t-2}-\cdots - \phi_p X_{t-p}=w_t$$
automatically satisfies the requirement to be invertible since $\pi(B)=1-\phi_1 B - \cdots - \phi_p B^p$ and $\sum_{j=0}^{\infty}|\pi(j)|=1+\sum_{j=1}^{p}|\phi_j|<\infty$.
You can take a look at this note.
|
Causality and stationarity of AR models
|
A linear process $X_t$ is defined to be causal if $X_t=\psi(B)w_t$ where $w_t$ are white noises and $\sum_{j=1}^{\infty}|\psi(j)|<\infty$.
$X_t$ is defined to be invertible if we can write $w_t=\pi(B)
|
Causality and stationarity of AR models
A linear process $X_t$ is defined to be causal if $X_t=\psi(B)w_t$ where $w_t$ are white noises and $\sum_{j=1}^{\infty}|\psi(j)|<\infty$.
$X_t$ is defined to be invertible if we can write $w_t=\pi(B) X_t$ where $\pi(B)=\pi_0 + \pi_1 B+\pi_2 B^2 + \cdots$ and $\sum_{j=0}^{\infty}|\pi(j)|<\infty$.
Apparently, an arbitrary $\text{AR}(p)$ model, $$X_t-\phi_1 X_{t-1}-\phi_2 X_{t-2}-\cdots - \phi_p X_{t-p}=w_t$$
automatically satisfies the requirement to be invertible since $\pi(B)=1-\phi_1 B - \cdots - \phi_p B^p$ and $\sum_{j=0}^{\infty}|\pi(j)|=1+\sum_{j=1}^{p}|\phi_j|<\infty$.
You can take a look at this note.
|
Causality and stationarity of AR models
A linear process $X_t$ is defined to be causal if $X_t=\psi(B)w_t$ where $w_t$ are white noises and $\sum_{j=1}^{\infty}|\psi(j)|<\infty$.
$X_t$ is defined to be invertible if we can write $w_t=\pi(B)
|
43,082
|
Estimating a variable from its cosine corrupted by additive Gaussian noise
|
The CRLB in the general scalar case where we want to estimate $\theta=g(a)$, is given by:
$$\mathbb{E}(\theta-\hat{\theta})^2]\geq \frac{\left(\frac{\partial g}{\partial a}\right)^2}{I(a)}$$
where $I(a)$ is the Fisher information associated with $a$. Here $a=\cos\theta$. Since $\theta=\cos^{-1}(a)$, one must square the derivative of $\cos^{-1}(a)$ and substitute $a=\cos\theta$. One therefore gets:
$$\tag{1, corrected}\mathbb{E}[(\theta-\hat{\theta})^2]\geq\frac{\sigma^2}{n\sin^2\theta}.$$
I also forgot to square the $\sin\theta$ term when taking it out of the expectation in (2). It should read:
$$\tag{2, corrected}\mathbb{E}[(\theta-\hat{\theta})^2]\approx\frac{\sigma^2}{n\sin^2\theta}.$$
Thus, the MSE of the "natural" estimator matches CRLB asymptotically.
|
Estimating a variable from its cosine corrupted by additive Gaussian noise
|
The CRLB in the general scalar case where we want to estimate $\theta=g(a)$, is given by:
$$\mathbb{E}(\theta-\hat{\theta})^2]\geq \frac{\left(\frac{\partial g}{\partial a}\right)^2}{I(a)}$$
where $I(
|
Estimating a variable from its cosine corrupted by additive Gaussian noise
The CRLB in the general scalar case where we want to estimate $\theta=g(a)$, is given by:
$$\mathbb{E}(\theta-\hat{\theta})^2]\geq \frac{\left(\frac{\partial g}{\partial a}\right)^2}{I(a)}$$
where $I(a)$ is the Fisher information associated with $a$. Here $a=\cos\theta$. Since $\theta=\cos^{-1}(a)$, one must square the derivative of $\cos^{-1}(a)$ and substitute $a=\cos\theta$. One therefore gets:
$$\tag{1, corrected}\mathbb{E}[(\theta-\hat{\theta})^2]\geq\frac{\sigma^2}{n\sin^2\theta}.$$
I also forgot to square the $\sin\theta$ term when taking it out of the expectation in (2). It should read:
$$\tag{2, corrected}\mathbb{E}[(\theta-\hat{\theta})^2]\approx\frac{\sigma^2}{n\sin^2\theta}.$$
Thus, the MSE of the "natural" estimator matches CRLB asymptotically.
|
Estimating a variable from its cosine corrupted by additive Gaussian noise
The CRLB in the general scalar case where we want to estimate $\theta=g(a)$, is given by:
$$\mathbb{E}(\theta-\hat{\theta})^2]\geq \frac{\left(\frac{\partial g}{\partial a}\right)^2}{I(a)}$$
where $I(
|
43,083
|
Learning functional analysis for studying kernels
|
You haven't given us much information about your current mathematical background. Do you have the background of a typical undergraduate science or engineering student (single and multivariable calculus, ordinary differential equations and perhaps an exposure to Fourier series)? Have you taken any introductory courses in analysis?
One classic text book that introduces applied functional analysis to students who have typical engineering math backgrounds and some analysis is Optimization by Vector Space Methods by David G. Luenberger.
|
Learning functional analysis for studying kernels
|
You haven't given us much information about your current mathematical background. Do you have the background of a typical undergraduate science or engineering student (single and multivariable calculu
|
Learning functional analysis for studying kernels
You haven't given us much information about your current mathematical background. Do you have the background of a typical undergraduate science or engineering student (single and multivariable calculus, ordinary differential equations and perhaps an exposure to Fourier series)? Have you taken any introductory courses in analysis?
One classic text book that introduces applied functional analysis to students who have typical engineering math backgrounds and some analysis is Optimization by Vector Space Methods by David G. Luenberger.
|
Learning functional analysis for studying kernels
You haven't given us much information about your current mathematical background. Do you have the background of a typical undergraduate science or engineering student (single and multivariable calculu
|
43,084
|
Exercise on finding the joint probability distribution
|
Statistical reasoning provides an elegant solution.
Because the integral of $f$ is used to define inverse trig functions, one is immediately tempted to interpret $X=\sin^2(A)$ for a random variable $A$ ranging from (say) $0$ to $\pi/2$. Substituting $\sin(a)$ for $x$ in $f$ gives
$$f(x)\,\mathrm{d}x = f(\sin^2(a))\mathrm{d}\left(\sin^2(a)\right) = \frac{2\sin(a)\cos(a)\,\mathrm{d}a}{\pi\sqrt{\sin^2(a)(1-\sin^2(a))}}=\frac{2}{\pi}\mathrm{d}a.$$
This reveals $X$ as the squared sine of a uniformly distributed angle on $[0,\pi/2)$. Consequently $1-X=\cos^2(A)$ is its squared cosine.
Recall (this is familiar from the study of the Normal distribution and related distributions of statistical importance) that an Exponential variable $Y$ has the same distribution as half the sum of squares of two independent standard Normal variables $Z_1$ and $Z_2$. In the plane, the ordered pair $\mathbf{Z}=(Z_1,Z_2)$ has a standard bivariate Normal distribution, showing that $Y$ is half the squared length of $\mathbf{Z}$, $$Y=1/2\,|\mathbf{Z}|^2.$$
Consequently
$$U=XY = 1/2\,\sin^2(A)|\mathbf{Z}|^2 = 1/2\,\left(\sin(a)|\mathbf{Z}|\right)^2$$
and
$$V=(1-X)Y = 1/2\,\cos^2(A)|\mathbf{Z}|^2 = 1/2\,\left(\cos(a)|\mathbf{Z}|\right)^2.$$
Those expressions that have been squared are the very components of $\mathbf{Z}$ itself:
$$U = 1/2\,Z_1^2,\ V=1/2\,Z_2^2.$$
Apparently $U$ and $V$ are independent and their distributions are both--by definition--half a $\chi^2(1)$ distribution. It is now easy to write down their joint distribution any way you wish: as a PDF, CDF, characteristic function, moment-generating function, cumulant-generating function, etc. But it's probably most revealing to have expressed them in this familiar statistical form.
A quick simulation supports these conclusions: by simulating $U$ and $V$ independently as proportional to $\chi^2(1)$ variates and solving
$$Y=U+V;\ X=U/Y$$
we can see whether $X$ and $Y$ have the distributions originally assumed of them. A quick check--which could be formally verified with a goodness of fit test (like a chi-squared test)--is to overplot the histograms of the simulated $X$ and $Y$ with the density functions. They should match, up to a small amount of random variation in the areas of the histogram bars. They do.
Here is the R code that made this figure.
n <- 1e5
set.seed(17)
u <- 1/2 * rchisq(n, df=1)
v <- 1/2 * rchisq(n, df=1)
y <- u + v
x <- u / y
par(mfrow=c(1,2))
hist(x, freq=FALSE)
curve(1 / (pi * sqrt(x*(1-x))), col="Red", lwd=2, add=TRUE)
hist(y, freq=FALSE)
curve(exp(-x), col="Red", lwd=2, add=TRUE)
|
Exercise on finding the joint probability distribution
|
Statistical reasoning provides an elegant solution.
Because the integral of $f$ is used to define inverse trig functions, one is immediately tempted to interpret $X=\sin^2(A)$ for a random variable $A
|
Exercise on finding the joint probability distribution
Statistical reasoning provides an elegant solution.
Because the integral of $f$ is used to define inverse trig functions, one is immediately tempted to interpret $X=\sin^2(A)$ for a random variable $A$ ranging from (say) $0$ to $\pi/2$. Substituting $\sin(a)$ for $x$ in $f$ gives
$$f(x)\,\mathrm{d}x = f(\sin^2(a))\mathrm{d}\left(\sin^2(a)\right) = \frac{2\sin(a)\cos(a)\,\mathrm{d}a}{\pi\sqrt{\sin^2(a)(1-\sin^2(a))}}=\frac{2}{\pi}\mathrm{d}a.$$
This reveals $X$ as the squared sine of a uniformly distributed angle on $[0,\pi/2)$. Consequently $1-X=\cos^2(A)$ is its squared cosine.
Recall (this is familiar from the study of the Normal distribution and related distributions of statistical importance) that an Exponential variable $Y$ has the same distribution as half the sum of squares of two independent standard Normal variables $Z_1$ and $Z_2$. In the plane, the ordered pair $\mathbf{Z}=(Z_1,Z_2)$ has a standard bivariate Normal distribution, showing that $Y$ is half the squared length of $\mathbf{Z}$, $$Y=1/2\,|\mathbf{Z}|^2.$$
Consequently
$$U=XY = 1/2\,\sin^2(A)|\mathbf{Z}|^2 = 1/2\,\left(\sin(a)|\mathbf{Z}|\right)^2$$
and
$$V=(1-X)Y = 1/2\,\cos^2(A)|\mathbf{Z}|^2 = 1/2\,\left(\cos(a)|\mathbf{Z}|\right)^2.$$
Those expressions that have been squared are the very components of $\mathbf{Z}$ itself:
$$U = 1/2\,Z_1^2,\ V=1/2\,Z_2^2.$$
Apparently $U$ and $V$ are independent and their distributions are both--by definition--half a $\chi^2(1)$ distribution. It is now easy to write down their joint distribution any way you wish: as a PDF, CDF, characteristic function, moment-generating function, cumulant-generating function, etc. But it's probably most revealing to have expressed them in this familiar statistical form.
A quick simulation supports these conclusions: by simulating $U$ and $V$ independently as proportional to $\chi^2(1)$ variates and solving
$$Y=U+V;\ X=U/Y$$
we can see whether $X$ and $Y$ have the distributions originally assumed of them. A quick check--which could be formally verified with a goodness of fit test (like a chi-squared test)--is to overplot the histograms of the simulated $X$ and $Y$ with the density functions. They should match, up to a small amount of random variation in the areas of the histogram bars. They do.
Here is the R code that made this figure.
n <- 1e5
set.seed(17)
u <- 1/2 * rchisq(n, df=1)
v <- 1/2 * rchisq(n, df=1)
y <- u + v
x <- u / y
par(mfrow=c(1,2))
hist(x, freq=FALSE)
curve(1 / (pi * sqrt(x*(1-x))), col="Red", lwd=2, add=TRUE)
hist(y, freq=FALSE)
curve(exp(-x), col="Red", lwd=2, add=TRUE)
|
Exercise on finding the joint probability distribution
Statistical reasoning provides an elegant solution.
Because the integral of $f$ is used to define inverse trig functions, one is immediately tempted to interpret $X=\sin^2(A)$ for a random variable $A
|
43,085
|
Why aren't we simply using $R_j^2$ instead the VIF?
|
You make a good point. I'd like to point out that one thing we like to use VIF for is its relationship to the standard error of the beta coefficient estimates. We can say that, the standard error is a function of MSE (the total variability around the model), $s^2\left\{X_k\right\}$ (the variability of the kth variable), and the VIF for the kth variable. It would be weird to say, a function of the inverse of 1 minus the coefficient of partial determination. i.e.
$$s^2\left\{b_k\right\} = \frac{MSE}{(n-1)s^2\left\{X_k\right\}}(VIF_k)$$
|
Why aren't we simply using $R_j^2$ instead the VIF?
|
You make a good point. I'd like to point out that one thing we like to use VIF for is its relationship to the standard error of the beta coefficient estimates. We can say that, the standard error i
|
Why aren't we simply using $R_j^2$ instead the VIF?
You make a good point. I'd like to point out that one thing we like to use VIF for is its relationship to the standard error of the beta coefficient estimates. We can say that, the standard error is a function of MSE (the total variability around the model), $s^2\left\{X_k\right\}$ (the variability of the kth variable), and the VIF for the kth variable. It would be weird to say, a function of the inverse of 1 minus the coefficient of partial determination. i.e.
$$s^2\left\{b_k\right\} = \frac{MSE}{(n-1)s^2\left\{X_k\right\}}(VIF_k)$$
|
Why aren't we simply using $R_j^2$ instead the VIF?
You make a good point. I'd like to point out that one thing we like to use VIF for is its relationship to the standard error of the beta coefficient estimates. We can say that, the standard error i
|
43,086
|
Why aren't we simply using $R_j^2$ instead the VIF?
|
When I learned it, I was told the the larger numbers made it easier to identify to the naked eye. My instructor also used 10 as the cut off and not 5. So if you had many VIF calculations in a matrix of some sort, you would round to the digit and then numbers with 2 digits = multicolinearity.
Also I think the VIF intuition is that we are changing the values to grow exponentially rather than linearly: 0.8, 0.85, 0.90, 0.95 vs 5, 6.66, 10, 20 again making it easier to identify.
That being said, since there is a 1-1 mapping, you can use $R^2$ and nothing changes
|
Why aren't we simply using $R_j^2$ instead the VIF?
|
When I learned it, I was told the the larger numbers made it easier to identify to the naked eye. My instructor also used 10 as the cut off and not 5. So if you had many VIF calculations in a matrix o
|
Why aren't we simply using $R_j^2$ instead the VIF?
When I learned it, I was told the the larger numbers made it easier to identify to the naked eye. My instructor also used 10 as the cut off and not 5. So if you had many VIF calculations in a matrix of some sort, you would round to the digit and then numbers with 2 digits = multicolinearity.
Also I think the VIF intuition is that we are changing the values to grow exponentially rather than linearly: 0.8, 0.85, 0.90, 0.95 vs 5, 6.66, 10, 20 again making it easier to identify.
That being said, since there is a 1-1 mapping, you can use $R^2$ and nothing changes
|
Why aren't we simply using $R_j^2$ instead the VIF?
When I learned it, I was told the the larger numbers made it easier to identify to the naked eye. My instructor also used 10 as the cut off and not 5. So if you had many VIF calculations in a matrix o
|
43,087
|
Is it valid to use an ARMAX model for TV Attribution?
|
This is an excellent question. I recommend that you get a cup of coffee and carefully read through Rob Hyndman's blog post on "The ARIMAX model muddle".
Basically, the answer is no. If you fit a straightforward AR(I)MAX model, your covariate coefficients cannot be interpreted as the promotion effect. The problem is that a change in a covariate value will have an effect on the forecast that depends on prior fits. This is very hard to interpret and to communicate.
However, not all is lost, because your call to R's Arima() does not, in fact, fit an AR(I)MAX model. Rather, it first regresses your observations on the covariates, and then models the residuals with an AR(I)MA process. That is, it fits a so-called regression with AR(I)MA errors. And for this model, your interpretation - the covariates and their coefficients capture promotional effects, while the ARMA part captures "the rest" - is perfectly valid.
Now, whether an AR(I)MAX model or a regression with AR(I)MA errors produces better forecasts I don't know. Given that I don't know an easy way to actually fit an AR(I)MAX model in R and the interpretational difficulties described above, I'd recommend that you don't worry overly over true AR(I)MAX models and stick with what Arima() gives you.
However, I suspect that web surfing and TV watching may have multiple-seasonalities - the intra-day patterns may well be different between the weekend and the rest of the week. I don't see this in your plot, but you may want to look whether your data exhibit this. If so, there has been some work on forecasting with multiple seasonalities, mostly using variants of Exponential Smoothing and/or State Space Models. Some of these may be able to simultaneously model multiple seasonalities and explanatory variables.
|
Is it valid to use an ARMAX model for TV Attribution?
|
This is an excellent question. I recommend that you get a cup of coffee and carefully read through Rob Hyndman's blog post on "The ARIMAX model muddle".
Basically, the answer is no. If you fit a strai
|
Is it valid to use an ARMAX model for TV Attribution?
This is an excellent question. I recommend that you get a cup of coffee and carefully read through Rob Hyndman's blog post on "The ARIMAX model muddle".
Basically, the answer is no. If you fit a straightforward AR(I)MAX model, your covariate coefficients cannot be interpreted as the promotion effect. The problem is that a change in a covariate value will have an effect on the forecast that depends on prior fits. This is very hard to interpret and to communicate.
However, not all is lost, because your call to R's Arima() does not, in fact, fit an AR(I)MAX model. Rather, it first regresses your observations on the covariates, and then models the residuals with an AR(I)MA process. That is, it fits a so-called regression with AR(I)MA errors. And for this model, your interpretation - the covariates and their coefficients capture promotional effects, while the ARMA part captures "the rest" - is perfectly valid.
Now, whether an AR(I)MAX model or a regression with AR(I)MA errors produces better forecasts I don't know. Given that I don't know an easy way to actually fit an AR(I)MAX model in R and the interpretational difficulties described above, I'd recommend that you don't worry overly over true AR(I)MAX models and stick with what Arima() gives you.
However, I suspect that web surfing and TV watching may have multiple-seasonalities - the intra-day patterns may well be different between the weekend and the rest of the week. I don't see this in your plot, but you may want to look whether your data exhibit this. If so, there has been some work on forecasting with multiple seasonalities, mostly using variants of Exponential Smoothing and/or State Space Models. Some of these may be able to simultaneously model multiple seasonalities and explanatory variables.
|
Is it valid to use an ARMAX model for TV Attribution?
This is an excellent question. I recommend that you get a cup of coffee and carefully read through Rob Hyndman's blog post on "The ARIMAX model muddle".
Basically, the answer is no. If you fit a strai
|
43,088
|
How to down-weight older data in time series regression
|
A common method is to use an exponentially weighted cost function:
$$ \sum_i \lambda^{i} e(t-i)^2 $$
where $e(t)$ is the residual error, and $\lambda$ is the forgetting rate. If $\lambda=1$, you get back least squares regression.
You can use recursive least squares (RLS) to find a solution efficiently.
|
How to down-weight older data in time series regression
|
A common method is to use an exponentially weighted cost function:
$$ \sum_i \lambda^{i} e(t-i)^2 $$
where $e(t)$ is the residual error, and $\lambda$ is the forgetting rate. If $\lambda=1$, you get b
|
How to down-weight older data in time series regression
A common method is to use an exponentially weighted cost function:
$$ \sum_i \lambda^{i} e(t-i)^2 $$
where $e(t)$ is the residual error, and $\lambda$ is the forgetting rate. If $\lambda=1$, you get back least squares regression.
You can use recursive least squares (RLS) to find a solution efficiently.
|
How to down-weight older data in time series regression
A common method is to use an exponentially weighted cost function:
$$ \sum_i \lambda^{i} e(t-i)^2 $$
where $e(t)$ is the residual error, and $\lambda$ is the forgetting rate. If $\lambda=1$, you get b
|
43,089
|
Bonferroni Correction - When not to use it
|
You should generally address the issue of multiple testing in some way. That doesn't mean Bonferroni is the best approach in all cases, however. Different methods address different error rates and the proper method depends on the goals of the testing and the consequences of making a Type I error. Try this paper:
Frane, A. V. (2015). Planned Hypothesis Tests Are Not Necessarily Exempt From Multiplicity Adjustment. Journal of Research Practice, 11(1). Available from http://jrp.icaap.org/index.php/jrp/article/view/514/417
|
Bonferroni Correction - When not to use it
|
You should generally address the issue of multiple testing in some way. That doesn't mean Bonferroni is the best approach in all cases, however. Different methods address different error rates and the
|
Bonferroni Correction - When not to use it
You should generally address the issue of multiple testing in some way. That doesn't mean Bonferroni is the best approach in all cases, however. Different methods address different error rates and the proper method depends on the goals of the testing and the consequences of making a Type I error. Try this paper:
Frane, A. V. (2015). Planned Hypothesis Tests Are Not Necessarily Exempt From Multiplicity Adjustment. Journal of Research Practice, 11(1). Available from http://jrp.icaap.org/index.php/jrp/article/view/514/417
|
Bonferroni Correction - When not to use it
You should generally address the issue of multiple testing in some way. That doesn't mean Bonferroni is the best approach in all cases, however. Different methods address different error rates and the
|
43,090
|
Bonferroni Correction - When not to use it
|
The Bonferroni correction is a pretty conservative approach to hypothesis testing. For $n$ tests, it requires you a p-value of $p/n$ where $p$ is your significance level. This guarantees that the probability of you getting a positive by pure chance stays below $p$, but sometimes it makes it go way below $p$, thus also losing power in your tests.
For instance, if you want to perform a million tests, a $p$-value of $5\cdot10^{-8}$ for each of them will result in an "overall $p$-value" of much less than $0.05$
This does not mean that a $p$-value correction is not necessary when you have a lot of tests. It's quite the opposite! If you make enough comparisons, you will eventually get false positives if you do not adjust your $p$-value. The issue here is that Bonferroni "takes things too far". For a more balanced approach, you may want to use something like Tukey's honest significance
|
Bonferroni Correction - When not to use it
|
The Bonferroni correction is a pretty conservative approach to hypothesis testing. For $n$ tests, it requires you a p-value of $p/n$ where $p$ is your significance level. This guarantees that the prob
|
Bonferroni Correction - When not to use it
The Bonferroni correction is a pretty conservative approach to hypothesis testing. For $n$ tests, it requires you a p-value of $p/n$ where $p$ is your significance level. This guarantees that the probability of you getting a positive by pure chance stays below $p$, but sometimes it makes it go way below $p$, thus also losing power in your tests.
For instance, if you want to perform a million tests, a $p$-value of $5\cdot10^{-8}$ for each of them will result in an "overall $p$-value" of much less than $0.05$
This does not mean that a $p$-value correction is not necessary when you have a lot of tests. It's quite the opposite! If you make enough comparisons, you will eventually get false positives if you do not adjust your $p$-value. The issue here is that Bonferroni "takes things too far". For a more balanced approach, you may want to use something like Tukey's honest significance
|
Bonferroni Correction - When not to use it
The Bonferroni correction is a pretty conservative approach to hypothesis testing. For $n$ tests, it requires you a p-value of $p/n$ where $p$ is your significance level. This guarantees that the prob
|
43,091
|
Do I need to use multivariate regression or several regression analyses?
|
Let $Y_i$ denote the vector of $i$th response, wehre $i = 1, \dots, r$. In your example $r$ is 5 since you have 5 test scores. Let $X$ be an $n \times p$ matrix of predictors. If you implement $r$ separate regressions (one for each $Y_i$),
$$Y_i = X\beta_i + \epsilon_i, $$
where $\epsilon_i \sim N_n(0, \sigma^2_iI_n)$. Using OLS, you get estimates for $\beta$. You can also do a multivariate regression,
$$\mathbf{Y} = X\mathbf{B} + \mathbf{E}, $$
where $\mathbf{Y}$ is the $n \times r$ matrix of responses, $\mathbf{B}$ is the $p \times r$ matrix of regression coefficients, and $\mathbf{E}$ is the error matrix such that the $i$th column, $\epsilon_i \overset{iid}{\sim} N_n(0, \sigma^2_iI_n)$. In this case, the OLS estimate for $\mathbf{B}$ is equivalent to the $r$ OLS estimates for $\beta_i$.
However, if you have reason to assume that conditioned on $X$, the 5 predictors are correlated (which seems like that would be a reasonable assumption in your case), then the rows of $\mathbf{E}$ are assumed to to be such that for $j = 1, 2, \dots, n, \epsilon_j \overset{iid}{\sim} N_r(0, \Sigma)$. Here $\Sigma$ now represents the correlation structure for the predictors as well.
It is important to note that even in this case, the estimate for $\mathbf{B}$ is the same as the OLS estimate, but the error structure of the estimates changes, and thus inference on the estimates changes. As a consequence, $p$-values change.
The MRCE R package allows for such model fits. This package also uses regularization methods for when $n$ is not large enough compared to $p$, so you might not be forced to reduce to a smaller number of predictors. You can also find more detailed theory here along with motivating examples. The authors state the following motivation
Applications of this general model arise in chemometrics, econometrics, psychometrics, and other quantitative disciplines where one predicts multiple responses with a single set of prediction variables. For example, predicting several measures of quality of paper with a set of variables relating to its production.
Similarly in your setup, you seem to have 5 sets of responses arising from the same predictors, with an inherent correlation structure between responses.
|
Do I need to use multivariate regression or several regression analyses?
|
Let $Y_i$ denote the vector of $i$th response, wehre $i = 1, \dots, r$. In your example $r$ is 5 since you have 5 test scores. Let $X$ be an $n \times p$ matrix of predictors. If you implement $r$ sep
|
Do I need to use multivariate regression or several regression analyses?
Let $Y_i$ denote the vector of $i$th response, wehre $i = 1, \dots, r$. In your example $r$ is 5 since you have 5 test scores. Let $X$ be an $n \times p$ matrix of predictors. If you implement $r$ separate regressions (one for each $Y_i$),
$$Y_i = X\beta_i + \epsilon_i, $$
where $\epsilon_i \sim N_n(0, \sigma^2_iI_n)$. Using OLS, you get estimates for $\beta$. You can also do a multivariate regression,
$$\mathbf{Y} = X\mathbf{B} + \mathbf{E}, $$
where $\mathbf{Y}$ is the $n \times r$ matrix of responses, $\mathbf{B}$ is the $p \times r$ matrix of regression coefficients, and $\mathbf{E}$ is the error matrix such that the $i$th column, $\epsilon_i \overset{iid}{\sim} N_n(0, \sigma^2_iI_n)$. In this case, the OLS estimate for $\mathbf{B}$ is equivalent to the $r$ OLS estimates for $\beta_i$.
However, if you have reason to assume that conditioned on $X$, the 5 predictors are correlated (which seems like that would be a reasonable assumption in your case), then the rows of $\mathbf{E}$ are assumed to to be such that for $j = 1, 2, \dots, n, \epsilon_j \overset{iid}{\sim} N_r(0, \Sigma)$. Here $\Sigma$ now represents the correlation structure for the predictors as well.
It is important to note that even in this case, the estimate for $\mathbf{B}$ is the same as the OLS estimate, but the error structure of the estimates changes, and thus inference on the estimates changes. As a consequence, $p$-values change.
The MRCE R package allows for such model fits. This package also uses regularization methods for when $n$ is not large enough compared to $p$, so you might not be forced to reduce to a smaller number of predictors. You can also find more detailed theory here along with motivating examples. The authors state the following motivation
Applications of this general model arise in chemometrics, econometrics, psychometrics, and other quantitative disciplines where one predicts multiple responses with a single set of prediction variables. For example, predicting several measures of quality of paper with a set of variables relating to its production.
Similarly in your setup, you seem to have 5 sets of responses arising from the same predictors, with an inherent correlation structure between responses.
|
Do I need to use multivariate regression or several regression analyses?
Let $Y_i$ denote the vector of $i$th response, wehre $i = 1, \dots, r$. In your example $r$ is 5 since you have 5 test scores. Let $X$ be an $n \times p$ matrix of predictors. If you implement $r$ sep
|
43,092
|
Multi-class classification easier than binary classification?
|
This is actually true as it is possible from this simulated example using R
library(mvtnorm)
sigma <- matrix(c(1,0,0,1), ncol=2)
x1 <- rmvnorm(n=500, mean=c(0,0), sigma=sigma, method="chol")
x2<- rmvnorm(n=500, mean=c(3,0), sigma=sigma, method="chol")
x3 <- rmvnorm(n=500, mean=c(1.5,3), sigma=sigma, method="chol")
x4 <- rmvnorm(n=500, mean=c(-2.5,3), sigma=sigma, method="chol")
x5 <- rmvnorm(n=500, mean=c(-4,-2), sigma=sigma, method="chol")
data<-data.frame(rbind(x1,x2,x3,x4,x5))
data$class<-c(rep(1,500),rep(2,500),rep(3,500),rep(4,500),rep(5,500))
Visualize the data
library(ggplot2)
qplot(data[,1],data[,2],colour=data[,3])
Let's fit the first model and see accuracy and a plot of the predicted
library(e1071)
fit1<-naiveBayes(factor(class) ~., data, laplace = 0)
data$predicted<-predict(fit1,data[,1:2],type="class")
sum(data$predicted==data$class)/length(data$predicted)
[1] 0.9228
qplot(data[,1],data[,2],colour=data[,3])
Now change the data and repeat the same steps for the second model with binary classification
data2<-data
data2$class<-c(rep(2,500),rep(1,500),rep(2,1000),rep(1,500))
qplot(data2[,1],data2[,2],colour=data2[,3])
fit2<-naiveBayes(factor(class) ~., data2, laplace = 0)
data2$predicted<-predict(fit2,data2[,1:2],type="class")
sum(data2$predicted==data2$class)/length(data2$predicted)
qplot(data2[,1],data2[,2],colour=data2$predicted)
The underlying reason is that having a distribution for each class enhance the flexibility and can model regions with different shapes
|
Multi-class classification easier than binary classification?
|
This is actually true as it is possible from this simulated example using R
library(mvtnorm)
sigma <- matrix(c(1,0,0,1), ncol=2)
x1 <- rmvnorm(n=500, mean=c(0,0), sigma=sigma, method="chol")
x2<- rmvn
|
Multi-class classification easier than binary classification?
This is actually true as it is possible from this simulated example using R
library(mvtnorm)
sigma <- matrix(c(1,0,0,1), ncol=2)
x1 <- rmvnorm(n=500, mean=c(0,0), sigma=sigma, method="chol")
x2<- rmvnorm(n=500, mean=c(3,0), sigma=sigma, method="chol")
x3 <- rmvnorm(n=500, mean=c(1.5,3), sigma=sigma, method="chol")
x4 <- rmvnorm(n=500, mean=c(-2.5,3), sigma=sigma, method="chol")
x5 <- rmvnorm(n=500, mean=c(-4,-2), sigma=sigma, method="chol")
data<-data.frame(rbind(x1,x2,x3,x4,x5))
data$class<-c(rep(1,500),rep(2,500),rep(3,500),rep(4,500),rep(5,500))
Visualize the data
library(ggplot2)
qplot(data[,1],data[,2],colour=data[,3])
Let's fit the first model and see accuracy and a plot of the predicted
library(e1071)
fit1<-naiveBayes(factor(class) ~., data, laplace = 0)
data$predicted<-predict(fit1,data[,1:2],type="class")
sum(data$predicted==data$class)/length(data$predicted)
[1] 0.9228
qplot(data[,1],data[,2],colour=data[,3])
Now change the data and repeat the same steps for the second model with binary classification
data2<-data
data2$class<-c(rep(2,500),rep(1,500),rep(2,1000),rep(1,500))
qplot(data2[,1],data2[,2],colour=data2[,3])
fit2<-naiveBayes(factor(class) ~., data2, laplace = 0)
data2$predicted<-predict(fit2,data2[,1:2],type="class")
sum(data2$predicted==data2$class)/length(data2$predicted)
qplot(data2[,1],data2[,2],colour=data2$predicted)
The underlying reason is that having a distribution for each class enhance the flexibility and can model regions with different shapes
|
Multi-class classification easier than binary classification?
This is actually true as it is possible from this simulated example using R
library(mvtnorm)
sigma <- matrix(c(1,0,0,1), ncol=2)
x1 <- rmvnorm(n=500, mean=c(0,0), sigma=sigma, method="chol")
x2<- rmvn
|
43,093
|
Displaying mean +/- st. error or confidence interval on bar charts
|
SE and CI give us different - albeit related - information about the data. SE tells us about the variability of the mean values, e.g. if we were to repeat the study. CI tells us about the accuracy of our estimates. They are related because SE is used to calculate the CIs.
The why for using one or the other thus comes down to what the author wants to convey. If you are reporting the results of a statistical test elsewhere in your report/publication, using CIs might be considered extraneous as you already have a measure of statistical significance in the P value from the test.
While SE may have become de rigueur, this excellent paper shows clearly some of the many pitfalls related to just sticking with SE by default. Bottom line: think about what story your data are telling, and use appropriate figures to represent this story accurately.
|
Displaying mean +/- st. error or confidence interval on bar charts
|
SE and CI give us different - albeit related - information about the data. SE tells us about the variability of the mean values, e.g. if we were to repeat the study. CI tells us about the accuracy of
|
Displaying mean +/- st. error or confidence interval on bar charts
SE and CI give us different - albeit related - information about the data. SE tells us about the variability of the mean values, e.g. if we were to repeat the study. CI tells us about the accuracy of our estimates. They are related because SE is used to calculate the CIs.
The why for using one or the other thus comes down to what the author wants to convey. If you are reporting the results of a statistical test elsewhere in your report/publication, using CIs might be considered extraneous as you already have a measure of statistical significance in the P value from the test.
While SE may have become de rigueur, this excellent paper shows clearly some of the many pitfalls related to just sticking with SE by default. Bottom line: think about what story your data are telling, and use appropriate figures to represent this story accurately.
|
Displaying mean +/- st. error or confidence interval on bar charts
SE and CI give us different - albeit related - information about the data. SE tells us about the variability of the mean values, e.g. if we were to repeat the study. CI tells us about the accuracy of
|
43,094
|
In RNN Back Propagation through time, why is the D(h_t)/D(h_(t-1)) diagonal?
|
I'll provide a sketch of the derivation. Omitting the bias term (since anyways we take derivatives later), the recursion looks like:
$$\mathbf{h_{t+1}}=tanh(\mathbf{ U x_{t}+W h_{t}}) $$ where the $tanh$ is taken elementwise.
Now, since $\mathbf{h_{t}}$ and $\mathbf{h_{t+1}}$ are vectors, the derivative $\frac{\partial \mathbf{h_{t+1}}}{\partial \mathbf{h_{t}}}$ is a Jacobian.
Notice that if $y=tanh(x), dy/dx=1-tanh^2(x)=1-y^2$.
Let's see how a single element of the Jacobian looks like. Assume that the hidden layers are of dimension $n$ Now $h_{t+1, i}=tanh(\sum_{k=1} ^{n} w_{ik}h_{t,k}+ g(x))$. Here $g(x)$ stands for some function of x.
Hence $\frac{\partial h_{t+1, i}}{\partial h_{t, j}}$ = $1-h_{t+1,i}^{2}w_{i,j}$. This corresponds to element in position $(i,j)$ of the Jacobian (from #1 above).
This multiplier $1-h_{t+1,i}^{2}$ applies to each element of the $i^{th}$ row of the Jacobian.
From basic linear algebra you can show that pre-multiplying a matrix $A$ by a diagonal matrix $diag(b_{i,i})$ is equivalent to scaling up row $i$ of matrix $A$ by $b_{i,i}$
Hence the term $diag(1-\mathbf{h_{t+1}^{2}})$ occurs as a premultiplier to the matrix $\mathbf{W}$
|
In RNN Back Propagation through time, why is the D(h_t)/D(h_(t-1)) diagonal?
|
I'll provide a sketch of the derivation. Omitting the bias term (since anyways we take derivatives later), the recursion looks like:
$$\mathbf{h_{t+1}}=tanh(\mathbf{ U x_{t}+W h_{t}}) $$ where the $ta
|
In RNN Back Propagation through time, why is the D(h_t)/D(h_(t-1)) diagonal?
I'll provide a sketch of the derivation. Omitting the bias term (since anyways we take derivatives later), the recursion looks like:
$$\mathbf{h_{t+1}}=tanh(\mathbf{ U x_{t}+W h_{t}}) $$ where the $tanh$ is taken elementwise.
Now, since $\mathbf{h_{t}}$ and $\mathbf{h_{t+1}}$ are vectors, the derivative $\frac{\partial \mathbf{h_{t+1}}}{\partial \mathbf{h_{t}}}$ is a Jacobian.
Notice that if $y=tanh(x), dy/dx=1-tanh^2(x)=1-y^2$.
Let's see how a single element of the Jacobian looks like. Assume that the hidden layers are of dimension $n$ Now $h_{t+1, i}=tanh(\sum_{k=1} ^{n} w_{ik}h_{t,k}+ g(x))$. Here $g(x)$ stands for some function of x.
Hence $\frac{\partial h_{t+1, i}}{\partial h_{t, j}}$ = $1-h_{t+1,i}^{2}w_{i,j}$. This corresponds to element in position $(i,j)$ of the Jacobian (from #1 above).
This multiplier $1-h_{t+1,i}^{2}$ applies to each element of the $i^{th}$ row of the Jacobian.
From basic linear algebra you can show that pre-multiplying a matrix $A$ by a diagonal matrix $diag(b_{i,i})$ is equivalent to scaling up row $i$ of matrix $A$ by $b_{i,i}$
Hence the term $diag(1-\mathbf{h_{t+1}^{2}})$ occurs as a premultiplier to the matrix $\mathbf{W}$
|
In RNN Back Propagation through time, why is the D(h_t)/D(h_(t-1)) diagonal?
I'll provide a sketch of the derivation. Omitting the bias term (since anyways we take derivatives later), the recursion looks like:
$$\mathbf{h_{t+1}}=tanh(\mathbf{ U x_{t}+W h_{t}}) $$ where the $ta
|
43,095
|
Box-Cox transformation for repeated measures ANOVA (rANOVA) in R
|
As @kjetil b halvorsen suggests I would go with linear mixed models: here are relevant paper and post .
|
Box-Cox transformation for repeated measures ANOVA (rANOVA) in R
|
As @kjetil b halvorsen suggests I would go with linear mixed models: here are relevant paper and post .
|
Box-Cox transformation for repeated measures ANOVA (rANOVA) in R
As @kjetil b halvorsen suggests I would go with linear mixed models: here are relevant paper and post .
|
Box-Cox transformation for repeated measures ANOVA (rANOVA) in R
As @kjetil b halvorsen suggests I would go with linear mixed models: here are relevant paper and post .
|
43,096
|
Combining multiple classifiers
|
This may be helpful as well: Kuncheva, L. I. (2004). Combining pattern classifiers: methods and algorithms
Edit: For my similar problem, I ended up finding classifier probabilities based on accuracy values as described in the question here: Assigning probabilities to ensemble experts (classification)
using using Theorem 4.2 (p. 127) from Kuncheva, L. I. (2004). Combining pattern classifiers: methods and algorithms, which says that the optimal combination weights for this case are $w_i=log(p_i/(1−p_i))$, where $p_i$ is the classification accuracy of the $i$-th expert. Then I converted weights to probabilities using projection onto probability simplex.
Then one could combine those with the probabilities of each prediction that you already have to get the final probability values.
|
Combining multiple classifiers
|
This may be helpful as well: Kuncheva, L. I. (2004). Combining pattern classifiers: methods and algorithms
Edit: For my similar problem, I ended up finding classifier probabilities based on accuracy v
|
Combining multiple classifiers
This may be helpful as well: Kuncheva, L. I. (2004). Combining pattern classifiers: methods and algorithms
Edit: For my similar problem, I ended up finding classifier probabilities based on accuracy values as described in the question here: Assigning probabilities to ensemble experts (classification)
using using Theorem 4.2 (p. 127) from Kuncheva, L. I. (2004). Combining pattern classifiers: methods and algorithms, which says that the optimal combination weights for this case are $w_i=log(p_i/(1−p_i))$, where $p_i$ is the classification accuracy of the $i$-th expert. Then I converted weights to probabilities using projection onto probability simplex.
Then one could combine those with the probabilities of each prediction that you already have to get the final probability values.
|
Combining multiple classifiers
This may be helpful as well: Kuncheva, L. I. (2004). Combining pattern classifiers: methods and algorithms
Edit: For my similar problem, I ended up finding classifier probabilities based on accuracy v
|
43,097
|
Equality vs. Equality in Distribution ($t$-distribution for example)
|
$5.5$ years after posting this question, I've since taken measure-theoretic probability and can answer this question.
The very definition of a random variable $T \sim t_{\nu}$ is
$$T = \dfrac{Z}{\sqrt{V/\nu}}$$
for some $Z \sim \mathcal{N}(0, 1)$ and $V \sim \chi^2_\nu$ independent, with probability one ("almost surely").
This immediately implies that obviously equality in distribution must hold, since equality almost surely of two random variables implies that their distribution functions must be equal.
Regarding the more general statement, suppose $X \overset{d}{=}Y$. For $f(X) \overset{d}{=} f(Y)$ to hold, $f$ must be a measurable map so that $f(X)$ and $f(Y)$ are valid random variables. So we assume $f$ is measurable.
Based on Taylor's comment, we may write for some set $C$ that
$$\mathbb{P}(f(X) \in C) = \mathbb{P}(X \in f^{-1}(C)) = \mathbb{P}(Y \in f^{-1}(C)) = \mathbb{P}(f(Y) \in C)$$
hence the statement holds.
|
Equality vs. Equality in Distribution ($t$-distribution for example)
|
$5.5$ years after posting this question, I've since taken measure-theoretic probability and can answer this question.
The very definition of a random variable $T \sim t_{\nu}$ is
$$T = \dfrac{Z}{\sqrt
|
Equality vs. Equality in Distribution ($t$-distribution for example)
$5.5$ years after posting this question, I've since taken measure-theoretic probability and can answer this question.
The very definition of a random variable $T \sim t_{\nu}$ is
$$T = \dfrac{Z}{\sqrt{V/\nu}}$$
for some $Z \sim \mathcal{N}(0, 1)$ and $V \sim \chi^2_\nu$ independent, with probability one ("almost surely").
This immediately implies that obviously equality in distribution must hold, since equality almost surely of two random variables implies that their distribution functions must be equal.
Regarding the more general statement, suppose $X \overset{d}{=}Y$. For $f(X) \overset{d}{=} f(Y)$ to hold, $f$ must be a measurable map so that $f(X)$ and $f(Y)$ are valid random variables. So we assume $f$ is measurable.
Based on Taylor's comment, we may write for some set $C$ that
$$\mathbb{P}(f(X) \in C) = \mathbb{P}(X \in f^{-1}(C)) = \mathbb{P}(Y \in f^{-1}(C)) = \mathbb{P}(f(Y) \in C)$$
hence the statement holds.
|
Equality vs. Equality in Distribution ($t$-distribution for example)
$5.5$ years after posting this question, I've since taken measure-theoretic probability and can answer this question.
The very definition of a random variable $T \sim t_{\nu}$ is
$$T = \dfrac{Z}{\sqrt
|
43,098
|
How is it logically possible to sample a single value from a continuous distribution?
|
It's because zero probability should not be conflated with impossibility. Of course some value has to be sampled, so rather than observing that number and saying to yourself "what was the probability I would have observed this?" and then being confounded by the answer, pick a number arbitrarily and then draw samples until you get that number. It will never happen. That better illustrates the idea.
By the way, this is purely thought experiment since as far as I can tell it's not actually possible to sample from a continuous distribution, which is really just a mathematical abstraction. (Consider for instance how many supposedly uniform$(0, 1)$ random numbers ever generated have been irrational, an event that is supposed to have probability one.)
|
How is it logically possible to sample a single value from a continuous distribution?
|
It's because zero probability should not be conflated with impossibility. Of course some value has to be sampled, so rather than observing that number and saying to yourself "what was the probability
|
How is it logically possible to sample a single value from a continuous distribution?
It's because zero probability should not be conflated with impossibility. Of course some value has to be sampled, so rather than observing that number and saying to yourself "what was the probability I would have observed this?" and then being confounded by the answer, pick a number arbitrarily and then draw samples until you get that number. It will never happen. That better illustrates the idea.
By the way, this is purely thought experiment since as far as I can tell it's not actually possible to sample from a continuous distribution, which is really just a mathematical abstraction. (Consider for instance how many supposedly uniform$(0, 1)$ random numbers ever generated have been irrational, an event that is supposed to have probability one.)
|
How is it logically possible to sample a single value from a continuous distribution?
It's because zero probability should not be conflated with impossibility. Of course some value has to be sampled, so rather than observing that number and saying to yourself "what was the probability
|
43,099
|
Principal component analysis with group data
|
In general, I wouldn't see a problem why you couldn't do a PCA to visualize and interpret your multivariate dataset (however since you didn't provide data, I cannot say for sure). As for your second question, I would keep the two groups (drought, control) and not subtract them from each other. That way you will be able to see if the component scores (illustrated as points in the plot) will cluster and how the component loadings (illustrated as vectors in the plot) relate to them.
Here an example to illustrate what I mean (also your third question):
Generate an example dataset (based on your description):
set.seed(13)
d <- data.frame(
treatment = rep(c("drought", "control"), each = 15),
y1 = rnorm(30, 3, 1),
y2 = rnorm(30, 6, 3),
y3 = rnorm(30, 4, 2),
y4 = rnorm(30, 9, 4),
y5 = rnorm(30, 5, 2),
y6 = rnorm(30, 12, 5)
)
The following steps can be achieved in a lot of different ways (also perhaps better and more efficient) with different R packages. But here is what usually works for me:
PCA using FactoMineR:
require(FactoMineR)
my.pca = PCA(d[, c(2:7)], scale.unit = T, graph = F)
# EXTRACTING VALUES FROM my.pca FOR PLOT BELOW
PC1.ind <- my.pca$ind$coord[,1]
PC2.ind <- my.pca$ind$coord[,2]
PC1.var <- my.pca$var$coord[,1]
PC2.var <- my.pca$var$coord[,2]
PC1.expl <- round(my.pca$eig[1,2],2)
PC2.expl <- round(my.pca$eig[2,2],2)
Treatment <- factor(d$treatment,levels=c('drought', 'control'))
labs.var<- rownames(my.pca$var$coord)
Build the plot with the ggplot2 package:
require(ggplot2)
require(grid)
ggplot() +
geom_point(aes(x = PC1.ind, y = PC2.ind, fill = Treatment), colour='black', pch = 21,size = 2.2) +
scale_fill_manual(values = c("red", "blue")) +
coord_fixed(ratio = 1) +
geom_segment(aes(x = 0, y = 0, xend = PC1.var*2.8, yend = PC2.var*2.8), arrow = arrow(length = unit(1/2, 'picas')), color = "grey30") +
geom_text(aes(x = PC1.var*3.2, y = PC2.var*3.2),label = labs.var, size = 3) +
xlab(paste('PC1 (',PC1.expl,'%',')', sep ='')) +
ylab(paste('PC2 (',PC2.expl,'%',')', sep ='')) +
ggtitle("Some title")
The vectors represent components loadings, which are the correlations of the principal components with the original variables. The strength of the correlation is indicated by the vector length, and the direction indicates which accessions have high values for the original variables.
Also I would suggest having a look here for more information on how to interpret PCAs in general (if that's needed at all).
Also since you have predetermined groups, i.e. drought and control you might also have a look at linear discriminant analysis (LDA). Both, PCA and LDA, are rotation-based techniques. While PCA tries to maximize total variance explained in the dataset, LDA maximizes the separation (or discriminates) between groups. For more information you could have a look at the candisc function in the candisc package, or the lda() function in the MASS package for example (both in R).
|
Principal component analysis with group data
|
In general, I wouldn't see a problem why you couldn't do a PCA to visualize and interpret your multivariate dataset (however since you didn't provide data, I cannot say for sure). As for your second q
|
Principal component analysis with group data
In general, I wouldn't see a problem why you couldn't do a PCA to visualize and interpret your multivariate dataset (however since you didn't provide data, I cannot say for sure). As for your second question, I would keep the two groups (drought, control) and not subtract them from each other. That way you will be able to see if the component scores (illustrated as points in the plot) will cluster and how the component loadings (illustrated as vectors in the plot) relate to them.
Here an example to illustrate what I mean (also your third question):
Generate an example dataset (based on your description):
set.seed(13)
d <- data.frame(
treatment = rep(c("drought", "control"), each = 15),
y1 = rnorm(30, 3, 1),
y2 = rnorm(30, 6, 3),
y3 = rnorm(30, 4, 2),
y4 = rnorm(30, 9, 4),
y5 = rnorm(30, 5, 2),
y6 = rnorm(30, 12, 5)
)
The following steps can be achieved in a lot of different ways (also perhaps better and more efficient) with different R packages. But here is what usually works for me:
PCA using FactoMineR:
require(FactoMineR)
my.pca = PCA(d[, c(2:7)], scale.unit = T, graph = F)
# EXTRACTING VALUES FROM my.pca FOR PLOT BELOW
PC1.ind <- my.pca$ind$coord[,1]
PC2.ind <- my.pca$ind$coord[,2]
PC1.var <- my.pca$var$coord[,1]
PC2.var <- my.pca$var$coord[,2]
PC1.expl <- round(my.pca$eig[1,2],2)
PC2.expl <- round(my.pca$eig[2,2],2)
Treatment <- factor(d$treatment,levels=c('drought', 'control'))
labs.var<- rownames(my.pca$var$coord)
Build the plot with the ggplot2 package:
require(ggplot2)
require(grid)
ggplot() +
geom_point(aes(x = PC1.ind, y = PC2.ind, fill = Treatment), colour='black', pch = 21,size = 2.2) +
scale_fill_manual(values = c("red", "blue")) +
coord_fixed(ratio = 1) +
geom_segment(aes(x = 0, y = 0, xend = PC1.var*2.8, yend = PC2.var*2.8), arrow = arrow(length = unit(1/2, 'picas')), color = "grey30") +
geom_text(aes(x = PC1.var*3.2, y = PC2.var*3.2),label = labs.var, size = 3) +
xlab(paste('PC1 (',PC1.expl,'%',')', sep ='')) +
ylab(paste('PC2 (',PC2.expl,'%',')', sep ='')) +
ggtitle("Some title")
The vectors represent components loadings, which are the correlations of the principal components with the original variables. The strength of the correlation is indicated by the vector length, and the direction indicates which accessions have high values for the original variables.
Also I would suggest having a look here for more information on how to interpret PCAs in general (if that's needed at all).
Also since you have predetermined groups, i.e. drought and control you might also have a look at linear discriminant analysis (LDA). Both, PCA and LDA, are rotation-based techniques. While PCA tries to maximize total variance explained in the dataset, LDA maximizes the separation (or discriminates) between groups. For more information you could have a look at the candisc function in the candisc package, or the lda() function in the MASS package for example (both in R).
|
Principal component analysis with group data
In general, I wouldn't see a problem why you couldn't do a PCA to visualize and interpret your multivariate dataset (however since you didn't provide data, I cannot say for sure). As for your second q
|
43,100
|
Is the inductive bias a prior?
|
A prior is a property of the data and not the algorithm used on the data.
"Maximum conditional independence: if the hypothesis can be cast in a Bayesian framework, try to maximize conditional independence. This is the [inductive] bias used in the Naive Bayes classifier." - Wikipedia
Inductive biases can be thought of as the assumptions about the data encoded in the learning algorithm.
|
Is the inductive bias a prior?
|
A prior is a property of the data and not the algorithm used on the data.
"Maximum conditional independence: if the hypothesis can be cast in a Bayesian framework, try to maximize conditional indepen
|
Is the inductive bias a prior?
A prior is a property of the data and not the algorithm used on the data.
"Maximum conditional independence: if the hypothesis can be cast in a Bayesian framework, try to maximize conditional independence. This is the [inductive] bias used in the Naive Bayes classifier." - Wikipedia
Inductive biases can be thought of as the assumptions about the data encoded in the learning algorithm.
|
Is the inductive bias a prior?
A prior is a property of the data and not the algorithm used on the data.
"Maximum conditional independence: if the hypothesis can be cast in a Bayesian framework, try to maximize conditional indepen
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.