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
5,401
AIC guidelines in model selection
I generally never use AIC or BIC objectively to describe adequate fit for a model. I do use these ICs to compare the relative fit of two predictive models. As far as whether an AIC of "2" or "4" is concerned, it's completely contextual. If you want to get a sense of how a "good" model fits, you can (should) always use a simulation. Your understanding of the AIC is right. AIC receives a positive contribution from the parameters and a negative contribution from the likelihood. What you're trying to do is maximize the likelihood without loading up your model with a bunch of parameters. So, my bubble bursting opinion is that cut offs for AIC are no good out of context.
AIC guidelines in model selection
I generally never use AIC or BIC objectively to describe adequate fit for a model. I do use these ICs to compare the relative fit of two predictive models. As far as whether an AIC of "2" or "4" is co
AIC guidelines in model selection I generally never use AIC or BIC objectively to describe adequate fit for a model. I do use these ICs to compare the relative fit of two predictive models. As far as whether an AIC of "2" or "4" is concerned, it's completely contextual. If you want to get a sense of how a "good" model fits, you can (should) always use a simulation. Your understanding of the AIC is right. AIC receives a positive contribution from the parameters and a negative contribution from the likelihood. What you're trying to do is maximize the likelihood without loading up your model with a bunch of parameters. So, my bubble bursting opinion is that cut offs for AIC are no good out of context.
AIC guidelines in model selection I generally never use AIC or BIC objectively to describe adequate fit for a model. I do use these ICs to compare the relative fit of two predictive models. As far as whether an AIC of "2" or "4" is co
5,402
AIC guidelines in model selection
Here is a related question when-is-it-appropriate-to-select-models-by-minimising-the-aic?. It gives you a general idea of what people not unrecognizable in academic world consider appropriate to write and what references to leave in as important. Generally, it is the differences between the likelihoods or AICs that matter, not their absolute values. You have missed the important word "difference" in your "BIC: 0-2 is weak" in the question - check Raftery's TABLE 6 - and it's strange that no-one wants to correct that. I myself have been taught to look for MAICE (Minimum AIC Estimate - as Akaike called it). So what? Here is what one famous person wrote to an unknown lady: Dear Miss -- I have read about sixteen pages of your manuscript ... I suffered exactly the same treatment at the hands of my teachers who disliked me for my independence and passed over me when they wanted assistants ... keep your manuscript for your sons and daughters, in order that they may derive consolation from it and not give a damn for what their teachers tell them or think of them. ... There is too much education altogether. My teachers never heard of papers with titles like "A test whether two AIC's differ significantly" and I can't even remember they ever called AIC a statistic, that would have a sampling distribution and other properties. I was taught AIC is a criterion to be minimized, if possible in some automatic fashion. Yet another important issue, which I think have been expressed here a few years ago by IrishStat (from memory so apologies if I am wrong as I failed to find that answer) is that AIC, BIC and other criteria have been derived for different purposes and under different conditions (assumptions) so you often can't use them interchangeably if your purpose is forecasting, say. You can't just prefer something inappropriate. My sources show that I used a quote to Burnham and Anderson (2002, p.70) to write that delta (AIC differences) within 0-2 has a substantial support; delta within 4-7 considerably less support and delta greater than 10 essentially no support. Also, I wrote that "the authors also discussed conditions under which these guidelines may be useful". The book is cited in the answer by Stat, which I upvoted as most relevant.
AIC guidelines in model selection
Here is a related question when-is-it-appropriate-to-select-models-by-minimising-the-aic?. It gives you a general idea of what people not unrecognizable in academic world consider appropriate to write
AIC guidelines in model selection Here is a related question when-is-it-appropriate-to-select-models-by-minimising-the-aic?. It gives you a general idea of what people not unrecognizable in academic world consider appropriate to write and what references to leave in as important. Generally, it is the differences between the likelihoods or AICs that matter, not their absolute values. You have missed the important word "difference" in your "BIC: 0-2 is weak" in the question - check Raftery's TABLE 6 - and it's strange that no-one wants to correct that. I myself have been taught to look for MAICE (Minimum AIC Estimate - as Akaike called it). So what? Here is what one famous person wrote to an unknown lady: Dear Miss -- I have read about sixteen pages of your manuscript ... I suffered exactly the same treatment at the hands of my teachers who disliked me for my independence and passed over me when they wanted assistants ... keep your manuscript for your sons and daughters, in order that they may derive consolation from it and not give a damn for what their teachers tell them or think of them. ... There is too much education altogether. My teachers never heard of papers with titles like "A test whether two AIC's differ significantly" and I can't even remember they ever called AIC a statistic, that would have a sampling distribution and other properties. I was taught AIC is a criterion to be minimized, if possible in some automatic fashion. Yet another important issue, which I think have been expressed here a few years ago by IrishStat (from memory so apologies if I am wrong as I failed to find that answer) is that AIC, BIC and other criteria have been derived for different purposes and under different conditions (assumptions) so you often can't use them interchangeably if your purpose is forecasting, say. You can't just prefer something inappropriate. My sources show that I used a quote to Burnham and Anderson (2002, p.70) to write that delta (AIC differences) within 0-2 has a substantial support; delta within 4-7 considerably less support and delta greater than 10 essentially no support. Also, I wrote that "the authors also discussed conditions under which these guidelines may be useful". The book is cited in the answer by Stat, which I upvoted as most relevant.
AIC guidelines in model selection Here is a related question when-is-it-appropriate-to-select-models-by-minimising-the-aic?. It gives you a general idea of what people not unrecognizable in academic world consider appropriate to write
5,403
AIC guidelines in model selection
With regard to information criteria, here is what SAS says: "Note that information criteria such as Akaike's (AIC), Schwarz's (SC, BIC), and QIC can be used to compare competing nonnested models, but do not provide a test of the comparison. Consequently, they cannot indicate whether one model is significantly better than another. The GENMOD, LOGISTIC, GLIMMIX, MIXED, and other procedures provide information criteria measures." There are two comparative model testing procedure: a) Vuong test and b) non-parametric Clarke test. See this paper for details.
AIC guidelines in model selection
With regard to information criteria, here is what SAS says: "Note that information criteria such as Akaike's (AIC), Schwarz's (SC, BIC), and QIC can be used to compare competing nonnested models, b
AIC guidelines in model selection With regard to information criteria, here is what SAS says: "Note that information criteria such as Akaike's (AIC), Schwarz's (SC, BIC), and QIC can be used to compare competing nonnested models, but do not provide a test of the comparison. Consequently, they cannot indicate whether one model is significantly better than another. The GENMOD, LOGISTIC, GLIMMIX, MIXED, and other procedures provide information criteria measures." There are two comparative model testing procedure: a) Vuong test and b) non-parametric Clarke test. See this paper for details.
AIC guidelines in model selection With regard to information criteria, here is what SAS says: "Note that information criteria such as Akaike's (AIC), Schwarz's (SC, BIC), and QIC can be used to compare competing nonnested models, b
5,404
Simple examples of uncorrelated but not independent $X$ and $Y$
Let $X\sim U(-1,1)$. Let $Y=X^2$. The variables are uncorrelated but dependent. Alternatively, consider a discrete bivariate distribution consisting of probability at 3 points (-1,1),(0,-1),(1,1) with probability 1/4, 1/2, 1/4 respectively. Then variables are uncorrelated but dependent. Consider bivariate data uniform in a diamond (a square rotated 45 degrees). The variables will be uncorrelated but dependent. Those are about the simplest cases I can think of.
Simple examples of uncorrelated but not independent $X$ and $Y$
Let $X\sim U(-1,1)$. Let $Y=X^2$. The variables are uncorrelated but dependent. Alternatively, consider a discrete bivariate distribution consisting of probability at 3 points (-1,1),(0,-1),(1,1) with
Simple examples of uncorrelated but not independent $X$ and $Y$ Let $X\sim U(-1,1)$. Let $Y=X^2$. The variables are uncorrelated but dependent. Alternatively, consider a discrete bivariate distribution consisting of probability at 3 points (-1,1),(0,-1),(1,1) with probability 1/4, 1/2, 1/4 respectively. Then variables are uncorrelated but dependent. Consider bivariate data uniform in a diamond (a square rotated 45 degrees). The variables will be uncorrelated but dependent. Those are about the simplest cases I can think of.
Simple examples of uncorrelated but not independent $X$ and $Y$ Let $X\sim U(-1,1)$. Let $Y=X^2$. The variables are uncorrelated but dependent. Alternatively, consider a discrete bivariate distribution consisting of probability at 3 points (-1,1),(0,-1),(1,1) with
5,405
Simple examples of uncorrelated but not independent $X$ and $Y$
I think the essence of some of the simple counterexamples can be seen by starting with a continuous random variable $X$ centred on zero, i.e. $E[X]=0$. Suppose the pdf of $X$ is even and defined on an interval of the form $(-a,a)$, where $a>0$. Now suppose $Y=f(X)$ for some function $f$. We now ask the question: for what kind of functions $f(X)$ can we have $Cov(X,f(X))=0$? We know that $Cov(X,f(X))=E[Xf(X)]-E[X]E[f(X)]$. Our assumption that $E[X]=0$ leads us straight to $Cov(X,f(X))=E[Xf(X)]$. Denoting the pdf of $X$ via $p(\cdot)$, we have $Cov(X,f(X))=E[Xf(X)]=\int_{-a}^{a}xf(x)p(x)dx$. We want $Cov(X,f(X))=0$ and one way of achieving this is by ensuring $f(x)$ is an even function, which implies $xf(x)p(x)$ is an odd function. It then follows that $\int_{-a}^{a}xf(x)p(x)dx=0$, and so $Cov(X,f(X))=0$. This way, we can see that the precise distribution of $X$ is unimportant as along as the pdf is symmetric around some point and any even function $f(\cdot)$ will do for defining $Y$. Hopefully, this can help students see how people come up with these types of counterexamples.
Simple examples of uncorrelated but not independent $X$ and $Y$
I think the essence of some of the simple counterexamples can be seen by starting with a continuous random variable $X$ centred on zero, i.e. $E[X]=0$. Suppose the pdf of $X$ is even and defined on an
Simple examples of uncorrelated but not independent $X$ and $Y$ I think the essence of some of the simple counterexamples can be seen by starting with a continuous random variable $X$ centred on zero, i.e. $E[X]=0$. Suppose the pdf of $X$ is even and defined on an interval of the form $(-a,a)$, where $a>0$. Now suppose $Y=f(X)$ for some function $f$. We now ask the question: for what kind of functions $f(X)$ can we have $Cov(X,f(X))=0$? We know that $Cov(X,f(X))=E[Xf(X)]-E[X]E[f(X)]$. Our assumption that $E[X]=0$ leads us straight to $Cov(X,f(X))=E[Xf(X)]$. Denoting the pdf of $X$ via $p(\cdot)$, we have $Cov(X,f(X))=E[Xf(X)]=\int_{-a}^{a}xf(x)p(x)dx$. We want $Cov(X,f(X))=0$ and one way of achieving this is by ensuring $f(x)$ is an even function, which implies $xf(x)p(x)$ is an odd function. It then follows that $\int_{-a}^{a}xf(x)p(x)dx=0$, and so $Cov(X,f(X))=0$. This way, we can see that the precise distribution of $X$ is unimportant as along as the pdf is symmetric around some point and any even function $f(\cdot)$ will do for defining $Y$. Hopefully, this can help students see how people come up with these types of counterexamples.
Simple examples of uncorrelated but not independent $X$ and $Y$ I think the essence of some of the simple counterexamples can be seen by starting with a continuous random variable $X$ centred on zero, i.e. $E[X]=0$. Suppose the pdf of $X$ is even and defined on an
5,406
Simple examples of uncorrelated but not independent $X$ and $Y$
We can define a discrete random variable $X\in\{-1,0,1\}$ with $\mathbb{P}(X=-1)=\mathbb{P}(X=0)=\mathbb{P}(X=1)=\frac{1}{3}$ and then define $Y=\begin{cases}1,\quad\text{if}\quad X=0\\0,\quad\text{otherwise}\end{cases}$ It can be easily verified that $X$ and $Y$ are uncorrelated but not independent.
Simple examples of uncorrelated but not independent $X$ and $Y$
We can define a discrete random variable $X\in\{-1,0,1\}$ with $\mathbb{P}(X=-1)=\mathbb{P}(X=0)=\mathbb{P}(X=1)=\frac{1}{3}$ and then define $Y=\begin{cases}1,\quad\text{if}\quad X=0\\0,\quad\text{ot
Simple examples of uncorrelated but not independent $X$ and $Y$ We can define a discrete random variable $X\in\{-1,0,1\}$ with $\mathbb{P}(X=-1)=\mathbb{P}(X=0)=\mathbb{P}(X=1)=\frac{1}{3}$ and then define $Y=\begin{cases}1,\quad\text{if}\quad X=0\\0,\quad\text{otherwise}\end{cases}$ It can be easily verified that $X$ and $Y$ are uncorrelated but not independent.
Simple examples of uncorrelated but not independent $X$ and $Y$ We can define a discrete random variable $X\in\{-1,0,1\}$ with $\mathbb{P}(X=-1)=\mathbb{P}(X=0)=\mathbb{P}(X=1)=\frac{1}{3}$ and then define $Y=\begin{cases}1,\quad\text{if}\quad X=0\\0,\quad\text{ot
5,407
Simple examples of uncorrelated but not independent $X$ and $Y$
Be the counterexample (i.e. hard-working student)! With that said: I was trying to think of a real world example and this was the first that came to my mind. This will not be the mathematically simplest case (but if you understand this example, you should be able to find a simpler example with urns and balls or something). According to some research, the average IQ of men and women is the same, but the variance of male IQ is greater than the variance of female IQ. For concreteness, let's say that male IQ follows $N(100, \sigma^2)$ and female IQ follows $N(100, \alpha \sigma^2)$ with $\alpha<1$. Half the population is male and half the population is female. Assuming that this research is correct: What is the correlation of gender and IQ? Is gender and IQ independent?
Simple examples of uncorrelated but not independent $X$ and $Y$
Be the counterexample (i.e. hard-working student)! With that said: I was trying to think of a real world example and this was the first that came to my mind. This will not be the mathematically simple
Simple examples of uncorrelated but not independent $X$ and $Y$ Be the counterexample (i.e. hard-working student)! With that said: I was trying to think of a real world example and this was the first that came to my mind. This will not be the mathematically simplest case (but if you understand this example, you should be able to find a simpler example with urns and balls or something). According to some research, the average IQ of men and women is the same, but the variance of male IQ is greater than the variance of female IQ. For concreteness, let's say that male IQ follows $N(100, \sigma^2)$ and female IQ follows $N(100, \alpha \sigma^2)$ with $\alpha<1$. Half the population is male and half the population is female. Assuming that this research is correct: What is the correlation of gender and IQ? Is gender and IQ independent?
Simple examples of uncorrelated but not independent $X$ and $Y$ Be the counterexample (i.e. hard-working student)! With that said: I was trying to think of a real world example and this was the first that came to my mind. This will not be the mathematically simple
5,408
Simple examples of uncorrelated but not independent $X$ and $Y$
I ran across the example of a short straddle in this "Mini-lesson" by Nassim Taleb. The payoff has the shape of an inverted V with the peak when the price of the underlying security at expiration is the strike price at which both the call and the put are sold. The idea is that if at the last closing Microsoft shares were \$248.15 and we sell a \$247.50 call for May 21, and a put at the same price and same date, the purchasers will be betting on the price going up (call) or down (put) - i.e. their bets are in opposite directions, but each is betting in the price to move even higher than today's (since the option strike price above the current price will be priced into the option), in the case of the call purchaser; or lower than the strike price (put). If the price of Microsoft is the strike price the seller of the short straddle cashes in the maximum profit from both unexercised options. There is a clear dependency between the price of the underlying stock and the profit for the options trader, yet there is a zero correlation because both components move in symmetrical and opposite directions.
Simple examples of uncorrelated but not independent $X$ and $Y$
I ran across the example of a short straddle in this "Mini-lesson" by Nassim Taleb. The payoff has the shape of an inverted V with the peak when the price of the underlying security at expiration is t
Simple examples of uncorrelated but not independent $X$ and $Y$ I ran across the example of a short straddle in this "Mini-lesson" by Nassim Taleb. The payoff has the shape of an inverted V with the peak when the price of the underlying security at expiration is the strike price at which both the call and the put are sold. The idea is that if at the last closing Microsoft shares were \$248.15 and we sell a \$247.50 call for May 21, and a put at the same price and same date, the purchasers will be betting on the price going up (call) or down (put) - i.e. their bets are in opposite directions, but each is betting in the price to move even higher than today's (since the option strike price above the current price will be priced into the option), in the case of the call purchaser; or lower than the strike price (put). If the price of Microsoft is the strike price the seller of the short straddle cashes in the maximum profit from both unexercised options. There is a clear dependency between the price of the underlying stock and the profit for the options trader, yet there is a zero correlation because both components move in symmetrical and opposite directions.
Simple examples of uncorrelated but not independent $X$ and $Y$ I ran across the example of a short straddle in this "Mini-lesson" by Nassim Taleb. The payoff has the shape of an inverted V with the peak when the price of the underlying security at expiration is t
5,409
Simple examples of uncorrelated but not independent $X$ and $Y$
Try this (R code): x=c(1,0,-1,0); y=c(0,1,0,-1); cor(x,y); [1] 0 This is from the equation of circle $x^2+y^2-r^2=0$ $Y$ is not correlated with $x$, but it is functionally dependent (deterministic).
Simple examples of uncorrelated but not independent $X$ and $Y$
Try this (R code): x=c(1,0,-1,0); y=c(0,1,0,-1); cor(x,y); [1] 0 This is from the equation of circle $x^2+y^2-r^2=0$ $Y$ is not correlated with $x$, but it is functionally dependent (determi
Simple examples of uncorrelated but not independent $X$ and $Y$ Try this (R code): x=c(1,0,-1,0); y=c(0,1,0,-1); cor(x,y); [1] 0 This is from the equation of circle $x^2+y^2-r^2=0$ $Y$ is not correlated with $x$, but it is functionally dependent (deterministic).
Simple examples of uncorrelated but not independent $X$ and $Y$ Try this (R code): x=c(1,0,-1,0); y=c(0,1,0,-1); cor(x,y); [1] 0 This is from the equation of circle $x^2+y^2-r^2=0$ $Y$ is not correlated with $x$, but it is functionally dependent (determi
5,410
Simple examples of uncorrelated but not independent $X$ and $Y$
The only general case when lack of correlation implies independence is when the joint distribution of X and Y is Gaussian.
Simple examples of uncorrelated but not independent $X$ and $Y$
The only general case when lack of correlation implies independence is when the joint distribution of X and Y is Gaussian.
Simple examples of uncorrelated but not independent $X$ and $Y$ The only general case when lack of correlation implies independence is when the joint distribution of X and Y is Gaussian.
Simple examples of uncorrelated but not independent $X$ and $Y$ The only general case when lack of correlation implies independence is when the joint distribution of X and Y is Gaussian.
5,411
Simple examples of uncorrelated but not independent $X$ and $Y$
A two-sentence answer: the clearest case of uncorrelated statistical dependence is a non-linear function of a RV, say Y = X^n. The two RVs are clearly dependent but yet not correlated, because correlation is a linear relationship.
Simple examples of uncorrelated but not independent $X$ and $Y$
A two-sentence answer: the clearest case of uncorrelated statistical dependence is a non-linear function of a RV, say Y = X^n. The two RVs are clearly dependent but yet not correlated, because correla
Simple examples of uncorrelated but not independent $X$ and $Y$ A two-sentence answer: the clearest case of uncorrelated statistical dependence is a non-linear function of a RV, say Y = X^n. The two RVs are clearly dependent but yet not correlated, because correlation is a linear relationship.
Simple examples of uncorrelated but not independent $X$ and $Y$ A two-sentence answer: the clearest case of uncorrelated statistical dependence is a non-linear function of a RV, say Y = X^n. The two RVs are clearly dependent but yet not correlated, because correla
5,412
Dice-coefficient loss function vs cross-entropy
One compelling reason for using cross-entropy over dice-coefficient or the similar IoU metric is that the gradients are nicer. The gradients of cross-entropy wrt the logits is something like $p - t$, where $p$ is the softmax outputs and $t$ is the target. Meanwhile, if we try to write the dice coefficient in a differentiable form: $\frac{2pt}{p^2+t^2}$ or $\frac{2pt}{p+t}$, then the resulting gradients wrt $p$ are much uglier: $\frac{2t(t^2-p^2)}{(p^2+t^2)^2}$ and $\frac{2t^2}{(p+t)^2}$. It's easy to imagine a case where both $p$ and $t$ are small, and the gradient blows up to some huge value. In general, it seems likely that training will become more unstable. The main reason that people try to use dice coefficient or IoU directly is that the actual goal is maximization of those metrics, and cross-entropy is just a proxy which is easier to maximize using backpropagation. In addition, Dice coefficient performs better at class imbalanced problems by design: However, class imbalance is typically taken care of simply by assigning loss multipliers to each class, such that the network is highly disincentivized to simply ignore a class which appears infrequently, so it's unclear that Dice coefficient is really necessary in these cases. I would start with cross-entropy loss, which seems to be the standard loss for training segmentation networks, unless there was a really compelling reason to use Dice coefficient.
Dice-coefficient loss function vs cross-entropy
One compelling reason for using cross-entropy over dice-coefficient or the similar IoU metric is that the gradients are nicer. The gradients of cross-entropy wrt the logits is something like $p - t$,
Dice-coefficient loss function vs cross-entropy One compelling reason for using cross-entropy over dice-coefficient or the similar IoU metric is that the gradients are nicer. The gradients of cross-entropy wrt the logits is something like $p - t$, where $p$ is the softmax outputs and $t$ is the target. Meanwhile, if we try to write the dice coefficient in a differentiable form: $\frac{2pt}{p^2+t^2}$ or $\frac{2pt}{p+t}$, then the resulting gradients wrt $p$ are much uglier: $\frac{2t(t^2-p^2)}{(p^2+t^2)^2}$ and $\frac{2t^2}{(p+t)^2}$. It's easy to imagine a case where both $p$ and $t$ are small, and the gradient blows up to some huge value. In general, it seems likely that training will become more unstable. The main reason that people try to use dice coefficient or IoU directly is that the actual goal is maximization of those metrics, and cross-entropy is just a proxy which is easier to maximize using backpropagation. In addition, Dice coefficient performs better at class imbalanced problems by design: However, class imbalance is typically taken care of simply by assigning loss multipliers to each class, such that the network is highly disincentivized to simply ignore a class which appears infrequently, so it's unclear that Dice coefficient is really necessary in these cases. I would start with cross-entropy loss, which seems to be the standard loss for training segmentation networks, unless there was a really compelling reason to use Dice coefficient.
Dice-coefficient loss function vs cross-entropy One compelling reason for using cross-entropy over dice-coefficient or the similar IoU metric is that the gradients are nicer. The gradients of cross-entropy wrt the logits is something like $p - t$,
5,413
Dice-coefficient loss function vs cross-entropy
As summarized by @shimao and @cherub, one cannot say apriori which one will work better on a particular dataset. The correct way is to try both and compare the results. Also, note that when it comes to segmentation, it is not so easy to "compare the results": IoU based measures like dice coefficient cover only some aspects of the quality of the segmentation; in some applications, different measures such as mean surface distance or Hausdorff surface distance need to be used. As you see, not even the choice of the correct quality metric is trivial, let alone the choice of the best cost function. I personally have very good experience with the dice coefficient; it really does wonders when it comes to class imbalance (some segments occupy less pixels/voxels than others). On the other hand, the training error curve becomes a total mess: it gave me absolutely no information about the convergence, so in this regard cross-entropy wins. Of course, this can/should be bypassed by checking the validation error anyways.
Dice-coefficient loss function vs cross-entropy
As summarized by @shimao and @cherub, one cannot say apriori which one will work better on a particular dataset. The correct way is to try both and compare the results. Also, note that when it comes t
Dice-coefficient loss function vs cross-entropy As summarized by @shimao and @cherub, one cannot say apriori which one will work better on a particular dataset. The correct way is to try both and compare the results. Also, note that when it comes to segmentation, it is not so easy to "compare the results": IoU based measures like dice coefficient cover only some aspects of the quality of the segmentation; in some applications, different measures such as mean surface distance or Hausdorff surface distance need to be used. As you see, not even the choice of the correct quality metric is trivial, let alone the choice of the best cost function. I personally have very good experience with the dice coefficient; it really does wonders when it comes to class imbalance (some segments occupy less pixels/voxels than others). On the other hand, the training error curve becomes a total mess: it gave me absolutely no information about the convergence, so in this regard cross-entropy wins. Of course, this can/should be bypassed by checking the validation error anyways.
Dice-coefficient loss function vs cross-entropy As summarized by @shimao and @cherub, one cannot say apriori which one will work better on a particular dataset. The correct way is to try both and compare the results. Also, note that when it comes t
5,414
Dice-coefficient loss function vs cross-entropy
I would recommend you to use Dice loss when faced with class imbalanced datasets, which is common in the medicine domain, for example. Also, Dice loss was introduced in the paper "V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation" and in that work the authors state that Dice loss worked better than mutinomial logistic loss with sample re-weighting
Dice-coefficient loss function vs cross-entropy
I would recommend you to use Dice loss when faced with class imbalanced datasets, which is common in the medicine domain, for example. Also, Dice loss was introduced in the paper "V-Net: Fully Convolu
Dice-coefficient loss function vs cross-entropy I would recommend you to use Dice loss when faced with class imbalanced datasets, which is common in the medicine domain, for example. Also, Dice loss was introduced in the paper "V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation" and in that work the authors state that Dice loss worked better than mutinomial logistic loss with sample re-weighting
Dice-coefficient loss function vs cross-entropy I would recommend you to use Dice loss when faced with class imbalanced datasets, which is common in the medicine domain, for example. Also, Dice loss was introduced in the paper "V-Net: Fully Convolu
5,415
How to calculate a confidence level for a Poisson distribution?
For Poisson, the mean and the variance are both $\lambda$. If you want the confidence interval around lambda, you can calculate the standard error as $\sqrt{\lambda / n}$. The 95-percent confidence interval is $\hat{\lambda} \pm 1.96\sqrt{\hat{\lambda} / n}$.
How to calculate a confidence level for a Poisson distribution?
For Poisson, the mean and the variance are both $\lambda$. If you want the confidence interval around lambda, you can calculate the standard error as $\sqrt{\lambda / n}$. The 95-percent confidence i
How to calculate a confidence level for a Poisson distribution? For Poisson, the mean and the variance are both $\lambda$. If you want the confidence interval around lambda, you can calculate the standard error as $\sqrt{\lambda / n}$. The 95-percent confidence interval is $\hat{\lambda} \pm 1.96\sqrt{\hat{\lambda} / n}$.
How to calculate a confidence level for a Poisson distribution? For Poisson, the mean and the variance are both $\lambda$. If you want the confidence interval around lambda, you can calculate the standard error as $\sqrt{\lambda / n}$. The 95-percent confidence i
5,416
How to calculate a confidence level for a Poisson distribution?
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. Patil & Kulkarni (2012, "Comparison of Confidence Intervals for the Poisson Mean: Some New Aspects", REVSTAT - Statistical Journal) discuss 19 different ways to calculate a confidence interval for the mean of a Poisson distribution.
How to calculate a confidence level for a Poisson distribution?
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.
How to calculate a confidence level for a Poisson distribution? 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. Patil & Kulkarni (2012, "Comparison of Confidence Intervals for the Poisson Mean: Some New Aspects", REVSTAT - Statistical Journal) discuss 19 different ways to calculate a confidence interval for the mean of a Poisson distribution.
How to calculate a confidence level for a Poisson distribution? 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.
5,417
How to calculate a confidence level for a Poisson distribution?
In addition to the answers that others have provided, another approach to this problem is achieved through a model based approach. The central limit theorem approach is certainly valid, and the bootstrapped estimates offer a lot of protection from small sample and mode misspecification issues. For sheer efficiency, you can get a better confidence interval for $\lambda$ by using a regression model based approach. No need to go through derivations, but a simple calculation in R goes like this: x <- rpois(100, 14) exp(confint(glm(x ~ 1, family=poisson))) This is a non-symmetric interval estimate, mind you, since the natural parameter of the poisson glm is the log relative rate! This is an advantage since there is a tendency for count data to be skewed to the right. The above approach has a formula and it is : $$\exp\left( \log \hat{\lambda} \pm \sqrt{\frac{1}{n\hat{\lambda} }}\right)$$ This confidence interval is "efficient" in the sense that it comes from maximum likelihood estimation on the natural parameter (log) scale for Poisson data, and provides a tighter confidence interval than the one based on the count scale while maintaining the nominal 95% coverage.
How to calculate a confidence level for a Poisson distribution?
In addition to the answers that others have provided, another approach to this problem is achieved through a model based approach. The central limit theorem approach is certainly valid, and the bootst
How to calculate a confidence level for a Poisson distribution? In addition to the answers that others have provided, another approach to this problem is achieved through a model based approach. The central limit theorem approach is certainly valid, and the bootstrapped estimates offer a lot of protection from small sample and mode misspecification issues. For sheer efficiency, you can get a better confidence interval for $\lambda$ by using a regression model based approach. No need to go through derivations, but a simple calculation in R goes like this: x <- rpois(100, 14) exp(confint(glm(x ~ 1, family=poisson))) This is a non-symmetric interval estimate, mind you, since the natural parameter of the poisson glm is the log relative rate! This is an advantage since there is a tendency for count data to be skewed to the right. The above approach has a formula and it is : $$\exp\left( \log \hat{\lambda} \pm \sqrt{\frac{1}{n\hat{\lambda} }}\right)$$ This confidence interval is "efficient" in the sense that it comes from maximum likelihood estimation on the natural parameter (log) scale for Poisson data, and provides a tighter confidence interval than the one based on the count scale while maintaining the nominal 95% coverage.
How to calculate a confidence level for a Poisson distribution? In addition to the answers that others have provided, another approach to this problem is achieved through a model based approach. The central limit theorem approach is certainly valid, and the bootst
5,418
How to calculate a confidence level for a Poisson distribution?
Given an observation from a Poisson distribution, the number of events counted is n. the mean ($\lambda$) and variance ($\sigma^2$) are equal. Step by step, The estimate for the mean is $\hat \lambda = n \approx \lambda$ Assuming the number of events is big enough ($n \gt 20$), the standard error is the standard deviation $\sigma$, which we can also estimate, $$stderr = \sigma = \sqrt{\lambda} \approx \sqrt{n} $$ Now, the 95% confidence interval is, $$ I = \hat \lambda \pm 1.96 \space stderr = n \pm 1.96 \space \sqrt{n}$$ [Edited] Some calculations based on the question data, Assuming the $\lambda$ indicated in the question has been externally checked or was given to us, i.e., it is a good piece of information not an estimation. I am making this assumption as the original question does not provide any context about the experiment or how the data was obtained (which is of the utmost importance when manipulating statistical data). The 95% confidence interval is, for the particular case, $$ I = \lambda \pm 1.96 \space stderr = \lambda \pm 1.96 \space \sqrt{\lambda} = 47.18182 \pm 1.96 \space \sqrt{47.18182} \approx [33.72, 60.64] $$ Hence, as the measurement (n=88 events) is outside the 95% confidence interval, we conclude that, The process does not follow a Poisson process, or, The $\lambda$ we have been given is not correct. Important note: the first accepted answer above is wrong, as it incorrectly states that the standard error for a Poisson observation is $\sqrt{\lambda/n}$. That is the standard error for a Sample Mean (Survey Sample) process.
How to calculate a confidence level for a Poisson distribution?
Given an observation from a Poisson distribution, the number of events counted is n. the mean ($\lambda$) and variance ($\sigma^2$) are equal. Step by step, The estimate for the mean is $\hat \lamb
How to calculate a confidence level for a Poisson distribution? Given an observation from a Poisson distribution, the number of events counted is n. the mean ($\lambda$) and variance ($\sigma^2$) are equal. Step by step, The estimate for the mean is $\hat \lambda = n \approx \lambda$ Assuming the number of events is big enough ($n \gt 20$), the standard error is the standard deviation $\sigma$, which we can also estimate, $$stderr = \sigma = \sqrt{\lambda} \approx \sqrt{n} $$ Now, the 95% confidence interval is, $$ I = \hat \lambda \pm 1.96 \space stderr = n \pm 1.96 \space \sqrt{n}$$ [Edited] Some calculations based on the question data, Assuming the $\lambda$ indicated in the question has been externally checked or was given to us, i.e., it is a good piece of information not an estimation. I am making this assumption as the original question does not provide any context about the experiment or how the data was obtained (which is of the utmost importance when manipulating statistical data). The 95% confidence interval is, for the particular case, $$ I = \lambda \pm 1.96 \space stderr = \lambda \pm 1.96 \space \sqrt{\lambda} = 47.18182 \pm 1.96 \space \sqrt{47.18182} \approx [33.72, 60.64] $$ Hence, as the measurement (n=88 events) is outside the 95% confidence interval, we conclude that, The process does not follow a Poisson process, or, The $\lambda$ we have been given is not correct. Important note: the first accepted answer above is wrong, as it incorrectly states that the standard error for a Poisson observation is $\sqrt{\lambda/n}$. That is the standard error for a Sample Mean (Survey Sample) process.
How to calculate a confidence level for a Poisson distribution? Given an observation from a Poisson distribution, the number of events counted is n. the mean ($\lambda$) and variance ($\sigma^2$) are equal. Step by step, The estimate for the mean is $\hat \lamb
5,419
Intuitive explanation for density of transformed variable?
PDFs are heights but they are used to represent probability by means of area. It therefore helps to express a PDF in a way that reminds us that area equals height times base. Initially the height at any value $x$ is given by the PDF $f_X(x)$. The base is the infinitesimal segment $dx$, whence the distribution (that is, the probability measure as opposed to the distribution function) is really the differential form, or "probability element," $$\operatorname{PE}_X(x) = f_X(x) \, dx.$$ This, rather than the PDF, is the object you want to work with both conceptually and practically, because it explicitly includes all the elements needed to express a probability. When we re-express $x$ in terms of $y = x^2$, the base segments $dx$ get stretched (or squeezed): by squaring both ends of the interval from $x$ to $x + dx$ we see that the base of the $y$ area must be an interval of length $$dy = (x + dx)^2 - x^2 = 2 x \, dx + (dx)^2.$$ Because the product of two infinitesimals is negligible compared to the infinitesimals themselves, we conclude $$dy = 2 x \, dx, \text{ whence }dx = \frac{dy}{2x} = \frac{dy}{2\sqrt{y}}.$$ Having established this, the calculation is trivial because we just plug in the new height and the new width: $$\operatorname{PE}_X(x) = f_X(x) \, dx = f_X(\sqrt{y}) \frac{dy}{2\sqrt{y}} = \operatorname{PE}_Y(y).$$ Because the base, in terms of $y$, is $dy$, whatever multiplies it must be the height, which we can read directly off the middle term as $$\frac{1}{2\sqrt{y}}f_X(\sqrt{y}) = f_Y(y).$$ This equation $\operatorname{PE}_X(x) = \operatorname{PE}_Y(y)$ is effectively a conservation of area (=probability) law. This graphic accurately shows narrow (almost infinitesimal) pieces of two PDFs related by $y=x^2$. Probabilities are represented by the shaded areas. Due to the squeezing of the interval $[0.32, 0.45]$ via squaring, the height of the red region ($y$, at the left) has to be proportionally expanded to match the area of the blue region ($x$, at the right).
Intuitive explanation for density of transformed variable?
PDFs are heights but they are used to represent probability by means of area. It therefore helps to express a PDF in a way that reminds us that area equals height times base. Initially the height at
Intuitive explanation for density of transformed variable? PDFs are heights but they are used to represent probability by means of area. It therefore helps to express a PDF in a way that reminds us that area equals height times base. Initially the height at any value $x$ is given by the PDF $f_X(x)$. The base is the infinitesimal segment $dx$, whence the distribution (that is, the probability measure as opposed to the distribution function) is really the differential form, or "probability element," $$\operatorname{PE}_X(x) = f_X(x) \, dx.$$ This, rather than the PDF, is the object you want to work with both conceptually and practically, because it explicitly includes all the elements needed to express a probability. When we re-express $x$ in terms of $y = x^2$, the base segments $dx$ get stretched (or squeezed): by squaring both ends of the interval from $x$ to $x + dx$ we see that the base of the $y$ area must be an interval of length $$dy = (x + dx)^2 - x^2 = 2 x \, dx + (dx)^2.$$ Because the product of two infinitesimals is negligible compared to the infinitesimals themselves, we conclude $$dy = 2 x \, dx, \text{ whence }dx = \frac{dy}{2x} = \frac{dy}{2\sqrt{y}}.$$ Having established this, the calculation is trivial because we just plug in the new height and the new width: $$\operatorname{PE}_X(x) = f_X(x) \, dx = f_X(\sqrt{y}) \frac{dy}{2\sqrt{y}} = \operatorname{PE}_Y(y).$$ Because the base, in terms of $y$, is $dy$, whatever multiplies it must be the height, which we can read directly off the middle term as $$\frac{1}{2\sqrt{y}}f_X(\sqrt{y}) = f_Y(y).$$ This equation $\operatorname{PE}_X(x) = \operatorname{PE}_Y(y)$ is effectively a conservation of area (=probability) law. This graphic accurately shows narrow (almost infinitesimal) pieces of two PDFs related by $y=x^2$. Probabilities are represented by the shaded areas. Due to the squeezing of the interval $[0.32, 0.45]$ via squaring, the height of the red region ($y$, at the left) has to be proportionally expanded to match the area of the blue region ($x$, at the right).
Intuitive explanation for density of transformed variable? PDFs are heights but they are used to represent probability by means of area. It therefore helps to express a PDF in a way that reminds us that area equals height times base. Initially the height at
5,420
Intuitive explanation for density of transformed variable?
How about, if I manufacture objects that are always square and I know the distribution of the side lengths of the squares; what can I say about the distribution of the areas of the squares? In particular, if I know the distribution of a random variable $X$, what can I say about $Y = X^{2}$? One thing that you can say is $$\eqalign{ F_{Y} (c) & = & P( Y \le c ) \\ & = & P( X^{2} \le c ) \\ & = & P ( - \sqrt{c} \le X \le \sqrt{c}) \\ & = & F_{X}( \sqrt{c} ) - F_{X}( - \sqrt{c} ). \\ }$$ So a relationship is established between the CDF of $Y$ and CDF of $X$; what is the relationship between their PDFs? We need calculus for that. Taking the derivatives of both sides gives you the results you wanted.
Intuitive explanation for density of transformed variable?
How about, if I manufacture objects that are always square and I know the distribution of the side lengths of the squares; what can I say about the distribution of the areas of the squares? In particu
Intuitive explanation for density of transformed variable? How about, if I manufacture objects that are always square and I know the distribution of the side lengths of the squares; what can I say about the distribution of the areas of the squares? In particular, if I know the distribution of a random variable $X$, what can I say about $Y = X^{2}$? One thing that you can say is $$\eqalign{ F_{Y} (c) & = & P( Y \le c ) \\ & = & P( X^{2} \le c ) \\ & = & P ( - \sqrt{c} \le X \le \sqrt{c}) \\ & = & F_{X}( \sqrt{c} ) - F_{X}( - \sqrt{c} ). \\ }$$ So a relationship is established between the CDF of $Y$ and CDF of $X$; what is the relationship between their PDFs? We need calculus for that. Taking the derivatives of both sides gives you the results you wanted.
Intuitive explanation for density of transformed variable? How about, if I manufacture objects that are always square and I know the distribution of the side lengths of the squares; what can I say about the distribution of the areas of the squares? In particu
5,421
Intuitive explanation for density of transformed variable?
Imagine we have a population and $Y$ is a summary of that population. Then $P(Y \in (y, y + \Delta y))$ is counting the proportion of individuals that have variable $Y$ in the range $(y, y + \Delta y)$. You can consider this as a "bin" of size $\Delta y$ and we are counting how many individuals are inside that bin. Now let us re-express those individuals in terms of another variable, $X$. Given that we know that $Y$ and $X$ are related as $Y = X^2$, the event $Y\in (y, y + \Delta y)$ is the same as the event $X^2 \in (x^2, (x + \Delta x)^2)$ which is the same as the event $ X \in (|x|, |x| + \Delta x)~ \text{or}~ X \in (- |x| -\Delta x, -|x| )$. Thus, the individuals that are in the bin $(y, y + \Delta y)$ must also be in the bins $(|x|, |x| + \Delta x)$ and $ (- |x| -\Delta x, -|x| )$. In other words, those bins must have the same proportion of individuals, \begin{align} P(Y \in (y, y + \Delta y)) &=P\left( X \in (|x|, |x| + \Delta x) \right) + P\left( X \in (- |x| -\Delta x, -|x| )\right) \end{align} Ok, now let's get to the density. First, we need to define what a probability density is. As the name suggests, it is the proportion of individuals per area. That is, we count the share of individuals on that bin and divide by the size of the bin. Since we have established that the proportions of people are the same here, but the size of the bins have changed, we conclude the density will be different. But different by how much? As we said, the probability density is the proportion of people in the bin divided by the size of the bin, thus the density of $Y$ is given by $f_Y(y):=\frac{P(Y \in (y, y + \Delta y))}{\Delta y}$. Analogously, the probability density of $X$ is given by $f_X(x):=\frac{P(X \in (x, x + \Delta x))}{\Delta x}$. From our previous result that the population in each bin is the same we then have that, \begin{align} f_Y(y):=\frac{P(Y \in (y, y + \Delta y))}{\Delta y} &= \frac{P\left( X \in (|x|, |x| + \Delta x) \right) + P\left( X \in (- |x| - \Delta x, -|x| )\right)}{\Delta y} \\ &= \frac{f_X(|x|)\Delta x + f_{X}(-|x|)\Delta x}{\Delta y}\\ &= \frac{\Delta x}{\Delta y} \left(f_X(|x|) + f_{X}(-|x|) \right)\\ &= \frac{\Delta x}{\Delta y} \left(f_X(\sqrt{y}) + f_{X}(-\sqrt{y}) \right) \end{align} That is, the density $f_X(\sqrt{y}) + f_{X}(-\sqrt{y})$ changes by the factor $\frac{\Delta x}{\Delta y}$, which is the relative size of stretching or squeezing the bin size. In our case, since $y = x^2$ we have that $y + \Delta y = (x + \Delta x )^2 = x^2 + 2x \Delta x + \Delta x^2$. If $\Delta x$ is tiny enough we can ignore $\Delta x ^2$, which implies $\Delta y = 2x \Delta x$ and $\frac{\Delta x}{\Delta y} = \frac{1}{2x} = \frac{1}{2 \sqrt{y}}$, and that is why the factor $\frac{1}{2 \sqrt{y}}$ shows up in the transformation.
Intuitive explanation for density of transformed variable?
Imagine we have a population and $Y$ is a summary of that population. Then $P(Y \in (y, y + \Delta y))$ is counting the proportion of individuals that have variable $Y$ in the range $(y, y + \Delta y)
Intuitive explanation for density of transformed variable? Imagine we have a population and $Y$ is a summary of that population. Then $P(Y \in (y, y + \Delta y))$ is counting the proportion of individuals that have variable $Y$ in the range $(y, y + \Delta y)$. You can consider this as a "bin" of size $\Delta y$ and we are counting how many individuals are inside that bin. Now let us re-express those individuals in terms of another variable, $X$. Given that we know that $Y$ and $X$ are related as $Y = X^2$, the event $Y\in (y, y + \Delta y)$ is the same as the event $X^2 \in (x^2, (x + \Delta x)^2)$ which is the same as the event $ X \in (|x|, |x| + \Delta x)~ \text{or}~ X \in (- |x| -\Delta x, -|x| )$. Thus, the individuals that are in the bin $(y, y + \Delta y)$ must also be in the bins $(|x|, |x| + \Delta x)$ and $ (- |x| -\Delta x, -|x| )$. In other words, those bins must have the same proportion of individuals, \begin{align} P(Y \in (y, y + \Delta y)) &=P\left( X \in (|x|, |x| + \Delta x) \right) + P\left( X \in (- |x| -\Delta x, -|x| )\right) \end{align} Ok, now let's get to the density. First, we need to define what a probability density is. As the name suggests, it is the proportion of individuals per area. That is, we count the share of individuals on that bin and divide by the size of the bin. Since we have established that the proportions of people are the same here, but the size of the bins have changed, we conclude the density will be different. But different by how much? As we said, the probability density is the proportion of people in the bin divided by the size of the bin, thus the density of $Y$ is given by $f_Y(y):=\frac{P(Y \in (y, y + \Delta y))}{\Delta y}$. Analogously, the probability density of $X$ is given by $f_X(x):=\frac{P(X \in (x, x + \Delta x))}{\Delta x}$. From our previous result that the population in each bin is the same we then have that, \begin{align} f_Y(y):=\frac{P(Y \in (y, y + \Delta y))}{\Delta y} &= \frac{P\left( X \in (|x|, |x| + \Delta x) \right) + P\left( X \in (- |x| - \Delta x, -|x| )\right)}{\Delta y} \\ &= \frac{f_X(|x|)\Delta x + f_{X}(-|x|)\Delta x}{\Delta y}\\ &= \frac{\Delta x}{\Delta y} \left(f_X(|x|) + f_{X}(-|x|) \right)\\ &= \frac{\Delta x}{\Delta y} \left(f_X(\sqrt{y}) + f_{X}(-\sqrt{y}) \right) \end{align} That is, the density $f_X(\sqrt{y}) + f_{X}(-\sqrt{y})$ changes by the factor $\frac{\Delta x}{\Delta y}$, which is the relative size of stretching or squeezing the bin size. In our case, since $y = x^2$ we have that $y + \Delta y = (x + \Delta x )^2 = x^2 + 2x \Delta x + \Delta x^2$. If $\Delta x$ is tiny enough we can ignore $\Delta x ^2$, which implies $\Delta y = 2x \Delta x$ and $\frac{\Delta x}{\Delta y} = \frac{1}{2x} = \frac{1}{2 \sqrt{y}}$, and that is why the factor $\frac{1}{2 \sqrt{y}}$ shows up in the transformation.
Intuitive explanation for density of transformed variable? Imagine we have a population and $Y$ is a summary of that population. Then $P(Y \in (y, y + \Delta y))$ is counting the proportion of individuals that have variable $Y$ in the range $(y, y + \Delta y)
5,422
SVM, Overfitting, curse of dimensionality
In practice, the reason that SVMs tend to be resistant to over-fitting, even in cases where the number of attributes is greater than the number of observations, is that it uses regularization. They key to avoiding over-fitting lies in careful tuning of the regularization parameter, $C$, and in the case of non-linear SVMs, careful choice of kernel and tuning of the kernel parameters. The SVM is an approximate implementation of a bound on the generalization error, that depends on the margin (essentially the distance from the decision boundary to the nearest pattern from each class), but is independent of the dimensionality of the feature space (which is why using the kernel trick to map the data into a very high dimensional space isn't such a bad idea as it might seem). So in principle SVMs should be highly resistant to over-fitting, but in practice this depends on the careful choice of $C$ and the kernel parameters. Sadly, over-fitting can also occur quite easily when tuning the hyper-parameters as well, which is my main research area, see G. C. Cawley and N. L. C. Talbot, Preventing over-fitting in model selection via Bayesian regularisation of the hyper-parameters, Journal of Machine Learning Research, volume 8, pages 841-861, April 2007. (www) and G. C. Cawley and N. L. C. Talbot, Over-fitting in model selection and subsequent selection bias in performance evaluation, Journal of Machine Learning Research, 2010. Research, vol. 11, pp. 2079-2107, July 2010. (www) Both of those papers use kernel ridge regression, rather than the SVM, but the same problem arises just as easily with SVMs (also similar bounds apply to KRR, so there isn't that much to choose between them in practice). So in a way, SVMs don't really solve the problem of over-fitting, they just shift the problem from model fitting to model selection. It is often a temptation to make life a bit easier for the SVM by performing some sort of feature selection first. This generally makes matters worse, as unlike the SVM, feature selection algorithms tend to exhibit more over-fitting as the number of attributes increases. Unless you want to know which are the informative attributes, it is usually better to skip the feature selection step and just use regularization to avoid over-fitting the data. In short, there is no inherent problem with using an SVM (or other regularised model such as ridge regression, LARS, Lasso, elastic net etc.) on a problem with 120 observations and thousands of attributes, provided the regularisation parameters are tuned properly.
SVM, Overfitting, curse of dimensionality
In practice, the reason that SVMs tend to be resistant to over-fitting, even in cases where the number of attributes is greater than the number of observations, is that it uses regularization. They k
SVM, Overfitting, curse of dimensionality In practice, the reason that SVMs tend to be resistant to over-fitting, even in cases where the number of attributes is greater than the number of observations, is that it uses regularization. They key to avoiding over-fitting lies in careful tuning of the regularization parameter, $C$, and in the case of non-linear SVMs, careful choice of kernel and tuning of the kernel parameters. The SVM is an approximate implementation of a bound on the generalization error, that depends on the margin (essentially the distance from the decision boundary to the nearest pattern from each class), but is independent of the dimensionality of the feature space (which is why using the kernel trick to map the data into a very high dimensional space isn't such a bad idea as it might seem). So in principle SVMs should be highly resistant to over-fitting, but in practice this depends on the careful choice of $C$ and the kernel parameters. Sadly, over-fitting can also occur quite easily when tuning the hyper-parameters as well, which is my main research area, see G. C. Cawley and N. L. C. Talbot, Preventing over-fitting in model selection via Bayesian regularisation of the hyper-parameters, Journal of Machine Learning Research, volume 8, pages 841-861, April 2007. (www) and G. C. Cawley and N. L. C. Talbot, Over-fitting in model selection and subsequent selection bias in performance evaluation, Journal of Machine Learning Research, 2010. Research, vol. 11, pp. 2079-2107, July 2010. (www) Both of those papers use kernel ridge regression, rather than the SVM, but the same problem arises just as easily with SVMs (also similar bounds apply to KRR, so there isn't that much to choose between them in practice). So in a way, SVMs don't really solve the problem of over-fitting, they just shift the problem from model fitting to model selection. It is often a temptation to make life a bit easier for the SVM by performing some sort of feature selection first. This generally makes matters worse, as unlike the SVM, feature selection algorithms tend to exhibit more over-fitting as the number of attributes increases. Unless you want to know which are the informative attributes, it is usually better to skip the feature selection step and just use regularization to avoid over-fitting the data. In short, there is no inherent problem with using an SVM (or other regularised model such as ridge regression, LARS, Lasso, elastic net etc.) on a problem with 120 observations and thousands of attributes, provided the regularisation parameters are tuned properly.
SVM, Overfitting, curse of dimensionality In practice, the reason that SVMs tend to be resistant to over-fitting, even in cases where the number of attributes is greater than the number of observations, is that it uses regularization. They k
5,423
SVM, Overfitting, curse of dimensionality
I will start with the second and last questions. The problem of generalization is obviously important, because if the results of machine learning cannot be generalized, then they are completely useless. The methods of ensuring generalization come from statistics. We usually assume, that data is generated from some probability distribution that originates in reality. For example if you're a male born in year 2000, then there is a probability distribution of what is your weight / height / eye colour when you reach 10, which results from available gene pool at year 2000, possible environmental factors etc. If we have lots of data, we can say something about those underlying distributions, for example that with high probability they are gaussian or multinomial. If we have accurate picture of distributions, then given height , weight and eye colour of a 10 year old kid in 2010, we can get a good approximation of the probability of the kid being male. And if the probability is close to 0 or 1 we can get a good shot at what the kids sex really is. The most important part of this whole thing is: we assume there is some probability distribution that generates both training data, test data, and the real world data we would like to use our algorithm on. More formally, we usually try to say that if the training error is $k$ then with high probability ($\delta$) the error on some data generated from the same distribution will be less than $k + \epsilon$. There are known relations between size of the training set, epsilon and the probability of test error exceeding $k+ \epsilon$. The approach I introduced here is known as Probably Approximately Correct Learning, and is an important part of computational learning theory which deals with the problem of generalization of learning algorithms. There are also number of other factors that can lower epsilon and increase delta in those bounds, ie. complexity of hypothesis space. Now back to SVM. If you don't use kernels, or use kernels that map into finite dimensional spaces, the so called Vapnik-Chervonenkis dimension which is a measure of hypothesis space complexity, is finite, and with that and enough training examples you can get that with high probability the error on the test set won't be much bigger than the error on training set. If you use kernels that map into infinite-dimensional feature spaces, then the Vapnik-Chervonenkis dimension is infinite as well, and what's worse the training samples alone cannot guarantee good generalization, no matter the number of them. Fortunately, the size of the margin of an SVM turn out to be a good parameter for ensuring generalization. With big margin and training set, you can guarantee that the test error won't be much bigger than training error as well.
SVM, Overfitting, curse of dimensionality
I will start with the second and last questions. The problem of generalization is obviously important, because if the results of machine learning cannot be generalized, then they are completely useles
SVM, Overfitting, curse of dimensionality I will start with the second and last questions. The problem of generalization is obviously important, because if the results of machine learning cannot be generalized, then they are completely useless. The methods of ensuring generalization come from statistics. We usually assume, that data is generated from some probability distribution that originates in reality. For example if you're a male born in year 2000, then there is a probability distribution of what is your weight / height / eye colour when you reach 10, which results from available gene pool at year 2000, possible environmental factors etc. If we have lots of data, we can say something about those underlying distributions, for example that with high probability they are gaussian or multinomial. If we have accurate picture of distributions, then given height , weight and eye colour of a 10 year old kid in 2010, we can get a good approximation of the probability of the kid being male. And if the probability is close to 0 or 1 we can get a good shot at what the kids sex really is. The most important part of this whole thing is: we assume there is some probability distribution that generates both training data, test data, and the real world data we would like to use our algorithm on. More formally, we usually try to say that if the training error is $k$ then with high probability ($\delta$) the error on some data generated from the same distribution will be less than $k + \epsilon$. There are known relations between size of the training set, epsilon and the probability of test error exceeding $k+ \epsilon$. The approach I introduced here is known as Probably Approximately Correct Learning, and is an important part of computational learning theory which deals with the problem of generalization of learning algorithms. There are also number of other factors that can lower epsilon and increase delta in those bounds, ie. complexity of hypothesis space. Now back to SVM. If you don't use kernels, or use kernels that map into finite dimensional spaces, the so called Vapnik-Chervonenkis dimension which is a measure of hypothesis space complexity, is finite, and with that and enough training examples you can get that with high probability the error on the test set won't be much bigger than the error on training set. If you use kernels that map into infinite-dimensional feature spaces, then the Vapnik-Chervonenkis dimension is infinite as well, and what's worse the training samples alone cannot guarantee good generalization, no matter the number of them. Fortunately, the size of the margin of an SVM turn out to be a good parameter for ensuring generalization. With big margin and training set, you can guarantee that the test error won't be much bigger than training error as well.
SVM, Overfitting, curse of dimensionality I will start with the second and last questions. The problem of generalization is obviously important, because if the results of machine learning cannot be generalized, then they are completely useles
5,424
SVM, Overfitting, curse of dimensionality
There are at least two major sources of overfitting you might wish to consider. Overfitting from an algorithm which has inferred too much from the available training samples. This is best guarded against empirically by using a measure of the generalisation ability of the model. Cross validation is one such popular method. Overfitting because the underlying distribution is undersampled. Usually there is little that can be done about this unless you can gather more data or add domain knowledge about the problem to your model. With 120 samples and a large number of features you are very likely to fall foul of 2 and may also be prone to 1. You can do something about 1 by careful observation of the effect of model complexity on the test and training errors.
SVM, Overfitting, curse of dimensionality
There are at least two major sources of overfitting you might wish to consider. Overfitting from an algorithm which has inferred too much from the available training samples. This is best guarded aga
SVM, Overfitting, curse of dimensionality There are at least two major sources of overfitting you might wish to consider. Overfitting from an algorithm which has inferred too much from the available training samples. This is best guarded against empirically by using a measure of the generalisation ability of the model. Cross validation is one such popular method. Overfitting because the underlying distribution is undersampled. Usually there is little that can be done about this unless you can gather more data or add domain knowledge about the problem to your model. With 120 samples and a large number of features you are very likely to fall foul of 2 and may also be prone to 1. You can do something about 1 by careful observation of the effect of model complexity on the test and training errors.
SVM, Overfitting, curse of dimensionality There are at least two major sources of overfitting you might wish to consider. Overfitting from an algorithm which has inferred too much from the available training samples. This is best guarded aga
5,425
When should I balance classes in a training data set?
The intuitive reasoning has been explained in the blogpost: If our goal is Prediction, this will cause a definite bias. And worse, it will be a permanent bias, in the sense that we will not have consistent estimates as the sample size grows. So, arguably the problem of (artificially) balanced data is worse than the unbalanced case. Balanced data are good for classification, but you obviously loose information about appearance frequencies, which is going to affect accuracy metrics themselves, as well as production performance. Let's say you're recognizing hand-written letters from English alphabet (26 letters). Overbalancing every letter appearance will give every letter a probability of being classified (correctly or not) roughly 1/26, so classifier will forget about actual distribution of letters in the original sample. And it's ok when classifier is able to generalize and recognize every letter with high accuracy. But if accuracy and most importantly generalization isn't "so high" (I can't give you a definition - you can think of it just as a "worst case") - the misclassified points will most-likely equally distribute among all letters, something like: "A" was misclassified 10 times "B" was misclassified 10 times "C" was misclassified 11 times "D" was misclassified 10 times ...and so on As opposed to without balancing (assuming that "A" and "C" have much higher probabilities of appearance in text) "A" was misclassified 3 times "B" was misclassified 14 times "C" was misclassified 3 times "D" was misclassified 14 times ...and so on So frequent cases will get fewer misclassifications. Whether it's good or not depends on your task. For natural text recognition, one could argue that letters with higher frequencies are more viable, as they would preserve semantics of the original text, bringing the recognition task closer to prediction (where semantics represent tendencies). But if you're trying to recognize something like screenshot of ECDSA-key (more entropy -> less prediction) - keeping data unbalanced wouldn't help. So, again, it depends. The most important distinction is that the accuracy estimate is, itself, getting biased (as you can see in the balanced alphabet example), so you don't know how the model's behavior is getting affected by most rare or most frequent points. P.S. You can always track performance of unbalanced classification with Precision/Recall metrics first and decide whether you need to add balancing or not. EDIT: There is additional confusion that lies in estimation theory precisely in the difference between sample mean and population mean. For instance, you might know (arguably) actual distribution of English letters in the alphabet $p(x_i | \theta)$, but your sample (training set) is not large enough to estimate it correctly (with $p(x_i | \hat \theta)$). So in order to compensate for a $\hat \theta_i - \theta_i$, it is sometimes recommended to rebalance classes according to either population itself or parameters known from a larger sample (thus better estimator). However, in practice there is no guarantee that "larger sample" is identically distributed due to risk of getting biased data on every step (let's say English letters collected from technical literature vs fiction vs the whole library) so balancing could still be harmful. This answer should also clarify applicability criteria for balancing: The class imbalance problem is caused by there not being enough patterns belonging to the minority class, not by the ratio of positive and negative patterns itself per se. Generally if you have enough data, the "class imbalance problem" doesn't arise As a conclusion, artificial balancing is rarely useful if training set is large enough. Absence of statistical data from a larger identically distributed sample also suggests no need for artificial balancing (especially for prediction), otherwise the quality of estimator is as good as "probability to meet a dinosaur": What is the probability to meet a dinosaur out in the street? 1/2 you either meet a dinosaur or you do not meet a dinosaur
When should I balance classes in a training data set?
The intuitive reasoning has been explained in the blogpost: If our goal is Prediction, this will cause a definite bias. And worse, it will be a permanent bias, in the sense that we will not have
When should I balance classes in a training data set? The intuitive reasoning has been explained in the blogpost: If our goal is Prediction, this will cause a definite bias. And worse, it will be a permanent bias, in the sense that we will not have consistent estimates as the sample size grows. So, arguably the problem of (artificially) balanced data is worse than the unbalanced case. Balanced data are good for classification, but you obviously loose information about appearance frequencies, which is going to affect accuracy metrics themselves, as well as production performance. Let's say you're recognizing hand-written letters from English alphabet (26 letters). Overbalancing every letter appearance will give every letter a probability of being classified (correctly or not) roughly 1/26, so classifier will forget about actual distribution of letters in the original sample. And it's ok when classifier is able to generalize and recognize every letter with high accuracy. But if accuracy and most importantly generalization isn't "so high" (I can't give you a definition - you can think of it just as a "worst case") - the misclassified points will most-likely equally distribute among all letters, something like: "A" was misclassified 10 times "B" was misclassified 10 times "C" was misclassified 11 times "D" was misclassified 10 times ...and so on As opposed to without balancing (assuming that "A" and "C" have much higher probabilities of appearance in text) "A" was misclassified 3 times "B" was misclassified 14 times "C" was misclassified 3 times "D" was misclassified 14 times ...and so on So frequent cases will get fewer misclassifications. Whether it's good or not depends on your task. For natural text recognition, one could argue that letters with higher frequencies are more viable, as they would preserve semantics of the original text, bringing the recognition task closer to prediction (where semantics represent tendencies). But if you're trying to recognize something like screenshot of ECDSA-key (more entropy -> less prediction) - keeping data unbalanced wouldn't help. So, again, it depends. The most important distinction is that the accuracy estimate is, itself, getting biased (as you can see in the balanced alphabet example), so you don't know how the model's behavior is getting affected by most rare or most frequent points. P.S. You can always track performance of unbalanced classification with Precision/Recall metrics first and decide whether you need to add balancing or not. EDIT: There is additional confusion that lies in estimation theory precisely in the difference between sample mean and population mean. For instance, you might know (arguably) actual distribution of English letters in the alphabet $p(x_i | \theta)$, but your sample (training set) is not large enough to estimate it correctly (with $p(x_i | \hat \theta)$). So in order to compensate for a $\hat \theta_i - \theta_i$, it is sometimes recommended to rebalance classes according to either population itself or parameters known from a larger sample (thus better estimator). However, in practice there is no guarantee that "larger sample" is identically distributed due to risk of getting biased data on every step (let's say English letters collected from technical literature vs fiction vs the whole library) so balancing could still be harmful. This answer should also clarify applicability criteria for balancing: The class imbalance problem is caused by there not being enough patterns belonging to the minority class, not by the ratio of positive and negative patterns itself per se. Generally if you have enough data, the "class imbalance problem" doesn't arise As a conclusion, artificial balancing is rarely useful if training set is large enough. Absence of statistical data from a larger identically distributed sample also suggests no need for artificial balancing (especially for prediction), otherwise the quality of estimator is as good as "probability to meet a dinosaur": What is the probability to meet a dinosaur out in the street? 1/2 you either meet a dinosaur or you do not meet a dinosaur
When should I balance classes in a training data set? The intuitive reasoning has been explained in the blogpost: If our goal is Prediction, this will cause a definite bias. And worse, it will be a permanent bias, in the sense that we will not have
5,426
When should I balance classes in a training data set?
Consistent with @kjetil-b-halvorsen's comment, the rapid adoption of machine learning has confused researchers about prediction vs. classification. As I described in more detail here, classification is only appropriate in a minority of cases. When the outcome is rare (or too common), probabilities are everything because in that case one can only reasonably speak about tendencies, not about predicting individual occurrences. In statistics, we learned a while back that any method that requires one to exclude some of the data is highly suspect. So the goal of balancing outcomes is misplaced. Prediction of tendencies (probabilities) does not require it. And once you estimate a probability you can make an optimal decision by applying the utility/cost/loss function to the predicted risk.
When should I balance classes in a training data set?
Consistent with @kjetil-b-halvorsen's comment, the rapid adoption of machine learning has confused researchers about prediction vs. classification. As I described in more detail here, classification
When should I balance classes in a training data set? Consistent with @kjetil-b-halvorsen's comment, the rapid adoption of machine learning has confused researchers about prediction vs. classification. As I described in more detail here, classification is only appropriate in a minority of cases. When the outcome is rare (or too common), probabilities are everything because in that case one can only reasonably speak about tendencies, not about predicting individual occurrences. In statistics, we learned a while back that any method that requires one to exclude some of the data is highly suspect. So the goal of balancing outcomes is misplaced. Prediction of tendencies (probabilities) does not require it. And once you estimate a probability you can make an optimal decision by applying the utility/cost/loss function to the predicted risk.
When should I balance classes in a training data set? Consistent with @kjetil-b-halvorsen's comment, the rapid adoption of machine learning has confused researchers about prediction vs. classification. As I described in more detail here, classification
5,427
When should I balance classes in a training data set?
Depends on what you want to achieve from the classification? Say it is cancer v/s non cancer, then detecting cancer is vital. However since non-cancer will form majority of your data the classifier can essentially send all cases to non-cancer class and get very high accuracy. But we can't afford that, so we essentially down sample non-cancer cases, essentially moving the decision boundary away from cancer region into the non-cancer region. Even in use cases where accuracy is our only aim, balancing can be essential if the test time balance is expected to be different from train time. For example say you want to classify mangoes and oranges, you have a training dataset with 900 mangoes and 30 oranges, but you expect to deploy it in a marketplace with equal mangoes and oranges, then ideally you should sample in the expected sample ratio to maximize accuracy.
When should I balance classes in a training data set?
Depends on what you want to achieve from the classification? Say it is cancer v/s non cancer, then detecting cancer is vital. However since non-cancer will form majority of your data the classifier ca
When should I balance classes in a training data set? Depends on what you want to achieve from the classification? Say it is cancer v/s non cancer, then detecting cancer is vital. However since non-cancer will form majority of your data the classifier can essentially send all cases to non-cancer class and get very high accuracy. But we can't afford that, so we essentially down sample non-cancer cases, essentially moving the decision boundary away from cancer region into the non-cancer region. Even in use cases where accuracy is our only aim, balancing can be essential if the test time balance is expected to be different from train time. For example say you want to classify mangoes and oranges, you have a training dataset with 900 mangoes and 30 oranges, but you expect to deploy it in a marketplace with equal mangoes and oranges, then ideally you should sample in the expected sample ratio to maximize accuracy.
When should I balance classes in a training data set? Depends on what you want to achieve from the classification? Say it is cancer v/s non cancer, then detecting cancer is vital. However since non-cancer will form majority of your data the classifier ca
5,428
When should I balance classes in a training data set?
When your data is balanced you can prefer to check the metric accuracy. But when such a situation your data is unbalanced your accuracy is not consistent for different iterations. You need to concentrate more metrics like Precision(PPR), Recall(sensitivity). This two metrics should be balanced when compare. Also you should have to check F1-Score which is harmonic mean of Precision and recall. This is applicable for all the machine learning algorithms
When should I balance classes in a training data set?
When your data is balanced you can prefer to check the metric accuracy. But when such a situation your data is unbalanced your accuracy is not consistent for different iterations. You need to concentr
When should I balance classes in a training data set? When your data is balanced you can prefer to check the metric accuracy. But when such a situation your data is unbalanced your accuracy is not consistent for different iterations. You need to concentrate more metrics like Precision(PPR), Recall(sensitivity). This two metrics should be balanced when compare. Also you should have to check F1-Score which is harmonic mean of Precision and recall. This is applicable for all the machine learning algorithms
When should I balance classes in a training data set? When your data is balanced you can prefer to check the metric accuracy. But when such a situation your data is unbalanced your accuracy is not consistent for different iterations. You need to concentr
5,429
Is a time series the same as a stochastic process?
Because many troubling discrepancies are showing up in comments and answers, let's refer to some authorities. James Hamilton does not even define a time series, but he is clear about what one is: ... this set of $T$ numbers is only one possible outcome of the underlying stochastic process that generated the data. Indeed, even if we were to imagine having observed the process for an infinite period of time, arriving at the sequence $$\{y_t\}_{t=\infty}^\infty = \{\ldots, y_{-1}, y_0, y_1, y_2, \ldots, y_T, y_{T+1}, y_{T+2}, \ldots, \},$$ the infinite sequence $\{y_t\}_{t=\infty}^\infty$ would still be viewed as a single realization from a time series process. ... Imagine a battery of $I$ ... computers generating sequences $\{y_t^{(1)}\}_{t=-\infty}^{\infty},$ $\{y_t^{(2)}\}_{t=-\infty}^{\infty}, \ldots,$ $ \{y_t^{(I)}\}_{t=-\infty}^{\infty}$, and consider selecting the observation associated with date $t$ from each sequence: $$\{y_t^{(1)}, y_t^{(2)}, \ldots, y_t^{(I)}\}.$$ This would be described as a sample of $I$ realizations of the random variable $Y_t$. ... (Time Series Analysis, Chapter 3.) Thus, a "time series process" is a set of random variables $\{Y_t\}$ indexed by integers $t$. In Stochastic Differential Equations, Bernt Øksendal provides a standard mathematical definition of a general stochastic process: Definition 2.1.4. A stochastic process is a parametrized collection of random variables $$\{X_t\}_{t\in T}$$ defined on a probability space $(\Omega, \mathcal{F}, \mathcal{P})$ and assuming values in $\mathbb{R}^n$. The parameter space $T$ is usually (as in this book) the halfline $[0,\infty)$, but it may also be an interval $[a,b]$, the non-negative integers, and even subsets of $\mathbb{R}^n$ for $n\ge 1$. Putting the two together, we see that a time series process is a stochastic process indexed by integers. Some people use "time series" to refer to a realization of a time series process (as in the Wikipedia article). We can see in Hamilton's language a reasonable effort to distinguish the process from the realization by his use of "time series process," so that he can use "time series" to refer to realizations (or even data).
Is a time series the same as a stochastic process?
Because many troubling discrepancies are showing up in comments and answers, let's refer to some authorities. James Hamilton does not even define a time series, but he is clear about what one is: ...
Is a time series the same as a stochastic process? Because many troubling discrepancies are showing up in comments and answers, let's refer to some authorities. James Hamilton does not even define a time series, but he is clear about what one is: ... this set of $T$ numbers is only one possible outcome of the underlying stochastic process that generated the data. Indeed, even if we were to imagine having observed the process for an infinite period of time, arriving at the sequence $$\{y_t\}_{t=\infty}^\infty = \{\ldots, y_{-1}, y_0, y_1, y_2, \ldots, y_T, y_{T+1}, y_{T+2}, \ldots, \},$$ the infinite sequence $\{y_t\}_{t=\infty}^\infty$ would still be viewed as a single realization from a time series process. ... Imagine a battery of $I$ ... computers generating sequences $\{y_t^{(1)}\}_{t=-\infty}^{\infty},$ $\{y_t^{(2)}\}_{t=-\infty}^{\infty}, \ldots,$ $ \{y_t^{(I)}\}_{t=-\infty}^{\infty}$, and consider selecting the observation associated with date $t$ from each sequence: $$\{y_t^{(1)}, y_t^{(2)}, \ldots, y_t^{(I)}\}.$$ This would be described as a sample of $I$ realizations of the random variable $Y_t$. ... (Time Series Analysis, Chapter 3.) Thus, a "time series process" is a set of random variables $\{Y_t\}$ indexed by integers $t$. In Stochastic Differential Equations, Bernt Øksendal provides a standard mathematical definition of a general stochastic process: Definition 2.1.4. A stochastic process is a parametrized collection of random variables $$\{X_t\}_{t\in T}$$ defined on a probability space $(\Omega, \mathcal{F}, \mathcal{P})$ and assuming values in $\mathbb{R}^n$. The parameter space $T$ is usually (as in this book) the halfline $[0,\infty)$, but it may also be an interval $[a,b]$, the non-negative integers, and even subsets of $\mathbb{R}^n$ for $n\ge 1$. Putting the two together, we see that a time series process is a stochastic process indexed by integers. Some people use "time series" to refer to a realization of a time series process (as in the Wikipedia article). We can see in Hamilton's language a reasonable effort to distinguish the process from the realization by his use of "time series process," so that he can use "time series" to refer to realizations (or even data).
Is a time series the same as a stochastic process? Because many troubling discrepancies are showing up in comments and answers, let's refer to some authorities. James Hamilton does not even define a time series, but he is clear about what one is: ...
5,430
Is a time series the same as a stochastic process?
Defining a stochastic process Let $(\Omega, \mathcal{F}, P)$ be a probability space. Let $S$ be another measurable space (such as the space of real numbers $\mathbb{R}$). Speaking somewhat imprecisely: A random variable is a measurable function from $\Omega$ to $S$. A stochastic process is a family of random variables indexed by time $t$. For any time $t \in \mathcal{T}$, $X_t$ is a random variable For any outcome $\omega \in \Omega$, $X(\omega)$ is a realization of the stochastic process, a possible path taken by $X$ over time. Defining a time series While a stochastic process has a crystal clear, mathematical definition. A time series is a less precise notion, and people use time series to refer to two related but different objects: As WHuber describes, a stochastic process indexed by integers or some regular, incremental unit of time that can in a sense by mapped to integers (eg. monthly data). A variable observed over time (often at regular intervals). This could be the realization of a stochastic process. Sometimes this is referred to as time series data. Example: two flips of a tack Let $\Omega = \{ \omega_{HH}, \omega_{HT}, \omega_{TH}, \omega_{TT}\}$. Let $X_1, X_2$ be the result of flip 1 and 2 respectively. $$ X_1(\omega) = \left\{ \begin{array}{rr} 1: & \omega \in \{ \omega_{HH}, \omega_{HT}\} \\ 0: & \omega \in \{\omega_{TH}, \omega_{TT} \}\end{array} \right. $$ $$ X_2(\omega) = \left\{ \begin{array}{rr} 1: & \omega \in \{ \omega_{HH}, \omega_{TH}\} \\ 0: & \omega \in \{\omega_{HT}, \omega_{TT} \}\end{array} \right. $$ So clearly $\{X_1, X_2\}$ is a stochastic process. People may also call it a time series since the indexing is by integers. People may also call the realization of $X$, eg. $X(\omega_{HH}) = (H, H)$, a time series or time series data.
Is a time series the same as a stochastic process?
Defining a stochastic process Let $(\Omega, \mathcal{F}, P)$ be a probability space. Let $S$ be another measurable space (such as the space of real numbers $\mathbb{R}$). Speaking somewhat imprecisely
Is a time series the same as a stochastic process? Defining a stochastic process Let $(\Omega, \mathcal{F}, P)$ be a probability space. Let $S$ be another measurable space (such as the space of real numbers $\mathbb{R}$). Speaking somewhat imprecisely: A random variable is a measurable function from $\Omega$ to $S$. A stochastic process is a family of random variables indexed by time $t$. For any time $t \in \mathcal{T}$, $X_t$ is a random variable For any outcome $\omega \in \Omega$, $X(\omega)$ is a realization of the stochastic process, a possible path taken by $X$ over time. Defining a time series While a stochastic process has a crystal clear, mathematical definition. A time series is a less precise notion, and people use time series to refer to two related but different objects: As WHuber describes, a stochastic process indexed by integers or some regular, incremental unit of time that can in a sense by mapped to integers (eg. monthly data). A variable observed over time (often at regular intervals). This could be the realization of a stochastic process. Sometimes this is referred to as time series data. Example: two flips of a tack Let $\Omega = \{ \omega_{HH}, \omega_{HT}, \omega_{TH}, \omega_{TT}\}$. Let $X_1, X_2$ be the result of flip 1 and 2 respectively. $$ X_1(\omega) = \left\{ \begin{array}{rr} 1: & \omega \in \{ \omega_{HH}, \omega_{HT}\} \\ 0: & \omega \in \{\omega_{TH}, \omega_{TT} \}\end{array} \right. $$ $$ X_2(\omega) = \left\{ \begin{array}{rr} 1: & \omega \in \{ \omega_{HH}, \omega_{TH}\} \\ 0: & \omega \in \{\omega_{HT}, \omega_{TT} \}\end{array} \right. $$ So clearly $\{X_1, X_2\}$ is a stochastic process. People may also call it a time series since the indexing is by integers. People may also call the realization of $X$, eg. $X(\omega_{HH}) = (H, H)$, a time series or time series data.
Is a time series the same as a stochastic process? Defining a stochastic process Let $(\Omega, \mathcal{F}, P)$ be a probability space. Let $S$ be another measurable space (such as the space of real numbers $\mathbb{R}$). Speaking somewhat imprecisely
5,431
Is a time series the same as a stochastic process?
A stochastic process is a set or collection of random variables $\left\{X_t\right\}$ (not necessarily independent), where the index t takes values in a certain set, this set is ordered and corresponds to the moment of time. example random walk. Time series Is the realisation of the stochastic process.
Is a time series the same as a stochastic process?
A stochastic process is a set or collection of random variables $\left\{X_t\right\}$ (not necessarily independent), where the index t takes values in a certain set, this set is ordered and corresponds
Is a time series the same as a stochastic process? A stochastic process is a set or collection of random variables $\left\{X_t\right\}$ (not necessarily independent), where the index t takes values in a certain set, this set is ordered and corresponds to the moment of time. example random walk. Time series Is the realisation of the stochastic process.
Is a time series the same as a stochastic process? A stochastic process is a set or collection of random variables $\left\{X_t\right\}$ (not necessarily independent), where the index t takes values in a certain set, this set is ordered and corresponds
5,432
Is a time series the same as a stochastic process?
The difference between a stochastic process and a time series is somewhat like the difference between a cat on a keyboard and an answer on Stack Exchange: Cats on keyboards can produce answers, but cats on keyboards are not answers. Furthermore, not every answer is produced by a cat on a keyboard. A time series can be understood as a collection of time-value–data-point pairs. A stochastic process on the other hand is a mathematical model or a mathematical description of a distribution of time series¹. Some time series are a realisation of stochastic processes (of either kind). Or, from another point of view: I can use a stochastic process as a model to generate a time series. Furthermore, time series can also be generated in other ways: They can be the result of observations and are thus generated by reality. While I can model reality as a stochastic process (I could also say that I regard reality as a stochastic process), reality is not a stochastic process in the same way that the interior of a box is not a set of points (though we often regard the two equivalent in modelling contexts). They can be generated by deterministic processes. Now, strictly speaking, we could (and arguably should) define stochastic processes and deterministic processes in a way that the latter are special cases of the former, but we very rarely make use of this and speaking of deterministic processes as special cases of stochastic processes may cause some confusion – you could compare it to calling $x=2$ a system of non-linear equations. ¹ If it is a discrete-time stochastic process. Continuous-time stochastic process are distributions of functions rather than time series.
Is a time series the same as a stochastic process?
The difference between a stochastic process and a time series is somewhat like the difference between a cat on a keyboard and an answer on Stack Exchange: Cats on keyboards can produce answers, but ca
Is a time series the same as a stochastic process? The difference between a stochastic process and a time series is somewhat like the difference between a cat on a keyboard and an answer on Stack Exchange: Cats on keyboards can produce answers, but cats on keyboards are not answers. Furthermore, not every answer is produced by a cat on a keyboard. A time series can be understood as a collection of time-value–data-point pairs. A stochastic process on the other hand is a mathematical model or a mathematical description of a distribution of time series¹. Some time series are a realisation of stochastic processes (of either kind). Or, from another point of view: I can use a stochastic process as a model to generate a time series. Furthermore, time series can also be generated in other ways: They can be the result of observations and are thus generated by reality. While I can model reality as a stochastic process (I could also say that I regard reality as a stochastic process), reality is not a stochastic process in the same way that the interior of a box is not a set of points (though we often regard the two equivalent in modelling contexts). They can be generated by deterministic processes. Now, strictly speaking, we could (and arguably should) define stochastic processes and deterministic processes in a way that the latter are special cases of the former, but we very rarely make use of this and speaking of deterministic processes as special cases of stochastic processes may cause some confusion – you could compare it to calling $x=2$ a system of non-linear equations. ¹ If it is a discrete-time stochastic process. Continuous-time stochastic process are distributions of functions rather than time series.
Is a time series the same as a stochastic process? The difference between a stochastic process and a time series is somewhat like the difference between a cat on a keyboard and an answer on Stack Exchange: Cats on keyboards can produce answers, but ca
5,433
Is a time series the same as a stochastic process?
I appreciate all contributed discussions/comments on the subject of Time series vs Stochastic process. Here is my understanding of the difference: Time series is a phenomenon observed, recorded as a series of numbers that is indexed with the time at observation; it is most likely a series of observations of a real life phenomenon such as stock prices on the New York Stock Exchange. On the other hand, stochastic process is as always understood as a mathematical representation (not a production) of the time-series.
Is a time series the same as a stochastic process?
I appreciate all contributed discussions/comments on the subject of Time series vs Stochastic process. Here is my understanding of the difference: Time series is a phenomenon observed, recorded as a s
Is a time series the same as a stochastic process? I appreciate all contributed discussions/comments on the subject of Time series vs Stochastic process. Here is my understanding of the difference: Time series is a phenomenon observed, recorded as a series of numbers that is indexed with the time at observation; it is most likely a series of observations of a real life phenomenon such as stock prices on the New York Stock Exchange. On the other hand, stochastic process is as always understood as a mathematical representation (not a production) of the time-series.
Is a time series the same as a stochastic process? I appreciate all contributed discussions/comments on the subject of Time series vs Stochastic process. Here is my understanding of the difference: Time series is a phenomenon observed, recorded as a s
5,434
Is a time series the same as a stochastic process?
A random variable is a random variable A vector of random variables is a random vector A set of random variables is a random field Like random vector, we need to give the random variables an index to identify that variable. Using different indexing schemas result in different real life applications, for example: If we index the random variables in the random field with rows and columns of pixel positions, then this random field can be used to represent images; If we index the random variables in the random field with discrete time labels, then the random field can be used to represent time series. To your question, stochastic processes are about random fields, so the answer is yes.
Is a time series the same as a stochastic process?
A random variable is a random variable A vector of random variables is a random vector A set of random variables is a random field Like random vector, we need to give the random variables an index to
Is a time series the same as a stochastic process? A random variable is a random variable A vector of random variables is a random vector A set of random variables is a random field Like random vector, we need to give the random variables an index to identify that variable. Using different indexing schemas result in different real life applications, for example: If we index the random variables in the random field with rows and columns of pixel positions, then this random field can be used to represent images; If we index the random variables in the random field with discrete time labels, then the random field can be used to represent time series. To your question, stochastic processes are about random fields, so the answer is yes.
Is a time series the same as a stochastic process? A random variable is a random variable A vector of random variables is a random vector A set of random variables is a random field Like random vector, we need to give the random variables an index to
5,435
Combining probabilities/information from different sources
You ask about three things: (a) how to combine several forecasts to get single forecast, (b) if Bayesian approach can be used in here, and (c) how to deal with zero-probabilities. Combining forecasts, is a common practice. If you have several forecasts than if you take average of those forecasts the resulting combined forecast should be better in terms of accuracy than any of the individual forecasts. To average them you could use weighted average where weights are based on inverse errors (i.e. precision), or information content. If you had knowledge on reliability of each source you could assign weights that are proportional to reliability of each source, so more reliable sources have greater impact on the final combined forecast. In your case you do not have any knowledge about their reliability so each of the forecasts have the same weight and so you can use simple arithmetic mean of the three forecasts $$ 0\%\times.33+50\%\times.33+100\%\times.33 = (0\%+50\%+100\%)/3=50\% $$ As was suggested in comments by @AndyW and @ArthurB., other methods besides simple weighted mean are available. Many such methods are described in literature about averaging expert forecasts, that I was not familiar with before, so thanks guys. In averaging expert forecasts sometimes we want to correct for the fact that experts tend to regress to the mean (Baron et al, 2013), or make their forecasts more extreme (Ariely et al, 2000; Erev et al, 1994). To achieve this one could use transformations of individual forecasts $p_i$, e.g. logit function $$ \mathrm{logit}(p_i) = \log\left( \frac{p_i}{1-p_i} \right) \tag{1} $$ odds to the $a$-th power $$ g(p_i) = \left( \frac{p_i}{1-p_i} \right)^a \tag{2} $$ where $0 < a < 1$, or more general transformation of form $$ t(p_i) = \frac{p_i^a}{p_i^a + (1-p_i)^a} \tag{3} $$ where if $a=1$ no transformation is applied, if $a>1$ individual forecasts are made more extreme, if $0 < a<1$ forecasts are made less extreme, what is shown on picture below (see Karmarkar, 1978; Baron et al, 2013). After such transformation forecasts are averaged (using arithmetic mean, median, weighted mean, or other method). If equations (1) or (2) were used results need to be back-transformed using inverse logit for (1) and inverse odds for (2). Alternatively, geometric mean can be used (see Genest and Zidek, 1986; cf. Dietrich and List, 2014) $$ \hat p = \frac{ \prod_{i=1}^N p_i^{w_i} }{ \prod_{i=1}^N p_i^{w_i} + \prod_{i=1}^N (1 - p_i)^{w_i} } \tag{4}$$ or approach proposed by Satopää et al (2014) $$ \hat p = \frac{ \left[ \prod_{i=1}^N \left(\frac{p_i}{1-p_i} \right)^{w_i} \right]^a }{ 1 + \left[ \prod_{i=1}^N \left(\frac{p_i}{1-p_i} \right)^{w_i} \right]^a } \tag{5}$$ where $w_i$ are weights. In most cases equal weights $w_i = 1/N$ are used unless a priori information that suggests other choice exists. Such methods are used in averaging expert forecasts so to correct for under- or overconfidence. In other cases you should consider if transforming forecasts to more, or less extreme is justified since it can make resulting aggregate estimate fall out of the boundaries marked by the lowest and the greatest individual forecast. If you have a priori knowledge about rain probability you can apply Bayes theorem to update the forecasts given the a priori probability of rain in similar fashion as described in here. There is also a simple approach that could be applied, i.e. calculate weighted average of your $p_i$ forecasts (as described above) where prior probability $\pi$ is treated as additional data point with some prespecified weight $w_{\pi}$ as in this IMDB example (see also source, or here and here for discussion; cf. Genest and Schervish, 1985), i.e. $$ \hat p = \frac{ \left(\sum_{i=1}^N p_i w_i \right) + \pi w_{\pi} }{ \left(\sum_{i=1}^N w_i \right) + w_{\pi} } \tag{6}$$ From your question however it does not follow that you have any a priori knowledge about your problem so you would probably use uniform prior, i.e. assume a priori $50\%$ chance of rain and this does not really change much in case of example that you provided. For dealing with zeros, there are several different approaches possible. First you should notice that $0\%$ chance of rain is not really reliable value, since it says that it is impossible that it will rain. Similar problems often occur in natural language processing when in your data you do not observe some values that possibly can occur (e.g. you count frequencies of letters and in your data some uncommon letter does not occur at all). In this case the classical estimator for probability, i.e. $$ p_i = \frac{n_i}{\sum_i n_i} $$ where $n_i$ is a number of occurrences of $i$th value (out of $d$ categories), gives you $p_i = 0$ if $n_i = 0$. This is called zero-frequency problem. For such values you know that their probability is nonzero (they exist!), so this estimate is obviously incorrect. There is also a practical concern: multiplying and dividing by zeros leads to zeros or undefined results, so zeros are problematic in dealing with. The easy and commonly applied fix is, to add some constant $\beta$ to your counts, so that $$ p_i = \frac{n_i + \beta}{(\sum_i n_i) + d\beta} $$ The common choice for $\beta$ is $1$, i.e. applying uniform prior based on Laplace's rule of succession, $1/2$ for Krichevsky-Trofimov estimate, or $1/d$ for Schurmann-Grassberger (1996) estimator. Notice however that what you do here is you apply out-of-data (prior) information in your model, so it gets subjective, Bayesian flavor. With using this approach you have to remember of assumptions you made and take them into consideration. The fact that we have strong a priori knowledge that there should not be any zero probabilities in our data directly justifies the Bayesian approach in here. In your case you do not have frequencies but probabilities, so you would be adding some very small value so to correct for zeros. Notice however that in some cases this approach may have bad consequences (e.g. when dealing with logs) so it should be used with caution. Schurmann, T., and P. Grassberger. (1996). Entropy estimation of symbol sequences. Chaos, 6, 41-427. Ariely, D., Tung Au, W., Bender, R.H., Budescu, D.V., Dietz, C.B., Gu, H., Wallsten, T.S. and Zauberman, G. (2000). The effects of averaging subjective probability estimates between and within judges. Journal of Experimental Psychology: Applied, 6(2), 130. Baron, J., Mellers, B.A., Tetlock, P.E., Stone, E. and Ungar, L.H. (2014). Two reasons to make aggregated probability forecasts more extreme. Decision Analysis, 11(2), 133-145. Erev, I., Wallsten, T.S., and Budescu, D.V. (1994). Simultaneous over-and underconfidence: The role of error in judgment processes. Psychological review, 101(3), 519. Karmarkar, U.S. (1978). Subjectively weighted utility: A descriptive extension of the expected utility model. Organizational behavior and human performance, 21(1), 61-72. Turner, B.M., Steyvers, M., Merkle, E.C., Budescu, D.V., and Wallsten, T.S. (2014). Forecast aggregation via recalibration. Machine learning, 95(3), 261-289. Genest, C., and Zidek, J. V. (1986). Combining probability distributions: a critique and an annotated bibliography. Statistical Science, 1, 114–135. Satopää, V.A., Baron, J., Foster, D.P., Mellers, B.A., Tetlock, P.E., and Ungar, L.H. (2014). Combining multiple probability predictions using a simple logit model. International Journal of Forecasting, 30(2), 344-356. Genest, C., and Schervish, M. J. (1985). Modeling expert judgments for Bayesian updating. The Annals of Statistics, 1198-1212. Dietrich, F., and List, C. (2014). Probabilistic Opinion Pooling. (Unpublished)
Combining probabilities/information from different sources
You ask about three things: (a) how to combine several forecasts to get single forecast, (b) if Bayesian approach can be used in here, and (c) how to deal with zero-probabilities. Combining forecasts,
Combining probabilities/information from different sources You ask about three things: (a) how to combine several forecasts to get single forecast, (b) if Bayesian approach can be used in here, and (c) how to deal with zero-probabilities. Combining forecasts, is a common practice. If you have several forecasts than if you take average of those forecasts the resulting combined forecast should be better in terms of accuracy than any of the individual forecasts. To average them you could use weighted average where weights are based on inverse errors (i.e. precision), or information content. If you had knowledge on reliability of each source you could assign weights that are proportional to reliability of each source, so more reliable sources have greater impact on the final combined forecast. In your case you do not have any knowledge about their reliability so each of the forecasts have the same weight and so you can use simple arithmetic mean of the three forecasts $$ 0\%\times.33+50\%\times.33+100\%\times.33 = (0\%+50\%+100\%)/3=50\% $$ As was suggested in comments by @AndyW and @ArthurB., other methods besides simple weighted mean are available. Many such methods are described in literature about averaging expert forecasts, that I was not familiar with before, so thanks guys. In averaging expert forecasts sometimes we want to correct for the fact that experts tend to regress to the mean (Baron et al, 2013), or make their forecasts more extreme (Ariely et al, 2000; Erev et al, 1994). To achieve this one could use transformations of individual forecasts $p_i$, e.g. logit function $$ \mathrm{logit}(p_i) = \log\left( \frac{p_i}{1-p_i} \right) \tag{1} $$ odds to the $a$-th power $$ g(p_i) = \left( \frac{p_i}{1-p_i} \right)^a \tag{2} $$ where $0 < a < 1$, or more general transformation of form $$ t(p_i) = \frac{p_i^a}{p_i^a + (1-p_i)^a} \tag{3} $$ where if $a=1$ no transformation is applied, if $a>1$ individual forecasts are made more extreme, if $0 < a<1$ forecasts are made less extreme, what is shown on picture below (see Karmarkar, 1978; Baron et al, 2013). After such transformation forecasts are averaged (using arithmetic mean, median, weighted mean, or other method). If equations (1) or (2) were used results need to be back-transformed using inverse logit for (1) and inverse odds for (2). Alternatively, geometric mean can be used (see Genest and Zidek, 1986; cf. Dietrich and List, 2014) $$ \hat p = \frac{ \prod_{i=1}^N p_i^{w_i} }{ \prod_{i=1}^N p_i^{w_i} + \prod_{i=1}^N (1 - p_i)^{w_i} } \tag{4}$$ or approach proposed by Satopää et al (2014) $$ \hat p = \frac{ \left[ \prod_{i=1}^N \left(\frac{p_i}{1-p_i} \right)^{w_i} \right]^a }{ 1 + \left[ \prod_{i=1}^N \left(\frac{p_i}{1-p_i} \right)^{w_i} \right]^a } \tag{5}$$ where $w_i$ are weights. In most cases equal weights $w_i = 1/N$ are used unless a priori information that suggests other choice exists. Such methods are used in averaging expert forecasts so to correct for under- or overconfidence. In other cases you should consider if transforming forecasts to more, or less extreme is justified since it can make resulting aggregate estimate fall out of the boundaries marked by the lowest and the greatest individual forecast. If you have a priori knowledge about rain probability you can apply Bayes theorem to update the forecasts given the a priori probability of rain in similar fashion as described in here. There is also a simple approach that could be applied, i.e. calculate weighted average of your $p_i$ forecasts (as described above) where prior probability $\pi$ is treated as additional data point with some prespecified weight $w_{\pi}$ as in this IMDB example (see also source, or here and here for discussion; cf. Genest and Schervish, 1985), i.e. $$ \hat p = \frac{ \left(\sum_{i=1}^N p_i w_i \right) + \pi w_{\pi} }{ \left(\sum_{i=1}^N w_i \right) + w_{\pi} } \tag{6}$$ From your question however it does not follow that you have any a priori knowledge about your problem so you would probably use uniform prior, i.e. assume a priori $50\%$ chance of rain and this does not really change much in case of example that you provided. For dealing with zeros, there are several different approaches possible. First you should notice that $0\%$ chance of rain is not really reliable value, since it says that it is impossible that it will rain. Similar problems often occur in natural language processing when in your data you do not observe some values that possibly can occur (e.g. you count frequencies of letters and in your data some uncommon letter does not occur at all). In this case the classical estimator for probability, i.e. $$ p_i = \frac{n_i}{\sum_i n_i} $$ where $n_i$ is a number of occurrences of $i$th value (out of $d$ categories), gives you $p_i = 0$ if $n_i = 0$. This is called zero-frequency problem. For such values you know that their probability is nonzero (they exist!), so this estimate is obviously incorrect. There is also a practical concern: multiplying and dividing by zeros leads to zeros or undefined results, so zeros are problematic in dealing with. The easy and commonly applied fix is, to add some constant $\beta$ to your counts, so that $$ p_i = \frac{n_i + \beta}{(\sum_i n_i) + d\beta} $$ The common choice for $\beta$ is $1$, i.e. applying uniform prior based on Laplace's rule of succession, $1/2$ for Krichevsky-Trofimov estimate, or $1/d$ for Schurmann-Grassberger (1996) estimator. Notice however that what you do here is you apply out-of-data (prior) information in your model, so it gets subjective, Bayesian flavor. With using this approach you have to remember of assumptions you made and take them into consideration. The fact that we have strong a priori knowledge that there should not be any zero probabilities in our data directly justifies the Bayesian approach in here. In your case you do not have frequencies but probabilities, so you would be adding some very small value so to correct for zeros. Notice however that in some cases this approach may have bad consequences (e.g. when dealing with logs) so it should be used with caution. Schurmann, T., and P. Grassberger. (1996). Entropy estimation of symbol sequences. Chaos, 6, 41-427. Ariely, D., Tung Au, W., Bender, R.H., Budescu, D.V., Dietz, C.B., Gu, H., Wallsten, T.S. and Zauberman, G. (2000). The effects of averaging subjective probability estimates between and within judges. Journal of Experimental Psychology: Applied, 6(2), 130. Baron, J., Mellers, B.A., Tetlock, P.E., Stone, E. and Ungar, L.H. (2014). Two reasons to make aggregated probability forecasts more extreme. Decision Analysis, 11(2), 133-145. Erev, I., Wallsten, T.S., and Budescu, D.V. (1994). Simultaneous over-and underconfidence: The role of error in judgment processes. Psychological review, 101(3), 519. Karmarkar, U.S. (1978). Subjectively weighted utility: A descriptive extension of the expected utility model. Organizational behavior and human performance, 21(1), 61-72. Turner, B.M., Steyvers, M., Merkle, E.C., Budescu, D.V., and Wallsten, T.S. (2014). Forecast aggregation via recalibration. Machine learning, 95(3), 261-289. Genest, C., and Zidek, J. V. (1986). Combining probability distributions: a critique and an annotated bibliography. Statistical Science, 1, 114–135. Satopää, V.A., Baron, J., Foster, D.P., Mellers, B.A., Tetlock, P.E., and Ungar, L.H. (2014). Combining multiple probability predictions using a simple logit model. International Journal of Forecasting, 30(2), 344-356. Genest, C., and Schervish, M. J. (1985). Modeling expert judgments for Bayesian updating. The Annals of Statistics, 1198-1212. Dietrich, F., and List, C. (2014). Probabilistic Opinion Pooling. (Unpublished)
Combining probabilities/information from different sources You ask about three things: (a) how to combine several forecasts to get single forecast, (b) if Bayesian approach can be used in here, and (c) how to deal with zero-probabilities. Combining forecasts,
5,436
Combining probabilities/information from different sources
There are two way to think of the problem. One is to say that the sources observe a noisy version of the latent variable "it will rain / it will not rain". For instance, we could say that each source draws its estimates from a $Beta(a+b,a)$ distribution if it will rain, and a $Beta(a,a+b)$ distribution if it will not. In this case, the $a$ parameter drops out and the three forecast, $x$, $y$, and $z$ would be combined as $$p = \frac{1}{1+\left(\frac{1}{x}-1\right)^b\left(\frac{1}{y}-1\right)^b\left(\frac{1}{z}-1\right)^b}$$ $b$ is a parameter controlling how under ($b>1$) or over ($b<1$) confident the sources are. If we assume that the sources estimates are unbiased, then $b = 1$ and the estimate simplifies as $$\frac{p}{1-p} = \frac{x}{1-x} \frac{y}{1-y} \frac{z}{1-z}$$ Which is just saying: the odds of rain is the product of the odds given by each source. Note that it is not well defined if a source gives an estimate of exactly $1$ and another gives an estimate of exactly $0$, but under our model, this never happens, the sources are never that confident. Of course we could patch the model to allow for this to happen. This model works better if you're thinking of three people telling you whether or not it rained yesterday. In practice, we know that there is an irreducible random component in the weather, and so it might be better to assume that nature first picks a probability of rain, which is noisily observed by the sources, and then flips a biased coin to decide whether or not it is going to rain. In that case, the combined estimate would look much more like an average between the different estimates.
Combining probabilities/information from different sources
There are two way to think of the problem. One is to say that the sources observe a noisy version of the latent variable "it will rain / it will not rain". For instance, we could say that each source
Combining probabilities/information from different sources There are two way to think of the problem. One is to say that the sources observe a noisy version of the latent variable "it will rain / it will not rain". For instance, we could say that each source draws its estimates from a $Beta(a+b,a)$ distribution if it will rain, and a $Beta(a,a+b)$ distribution if it will not. In this case, the $a$ parameter drops out and the three forecast, $x$, $y$, and $z$ would be combined as $$p = \frac{1}{1+\left(\frac{1}{x}-1\right)^b\left(\frac{1}{y}-1\right)^b\left(\frac{1}{z}-1\right)^b}$$ $b$ is a parameter controlling how under ($b>1$) or over ($b<1$) confident the sources are. If we assume that the sources estimates are unbiased, then $b = 1$ and the estimate simplifies as $$\frac{p}{1-p} = \frac{x}{1-x} \frac{y}{1-y} \frac{z}{1-z}$$ Which is just saying: the odds of rain is the product of the odds given by each source. Note that it is not well defined if a source gives an estimate of exactly $1$ and another gives an estimate of exactly $0$, but under our model, this never happens, the sources are never that confident. Of course we could patch the model to allow for this to happen. This model works better if you're thinking of three people telling you whether or not it rained yesterday. In practice, we know that there is an irreducible random component in the weather, and so it might be better to assume that nature first picks a probability of rain, which is noisily observed by the sources, and then flips a biased coin to decide whether or not it is going to rain. In that case, the combined estimate would look much more like an average between the different estimates.
Combining probabilities/information from different sources There are two way to think of the problem. One is to say that the sources observe a noisy version of the latent variable "it will rain / it will not rain". For instance, we could say that each source
5,437
Combining probabilities/information from different sources
In the framework of Transferable Belief Model (TBM), it is possible to combine different predictions using for instance the "conjunctive rule of combination". In order to apply this rule, you need to transform the probabilities of the predictions into basic belief assignments. This can be achieved with the so-called Least-Committed-Principle. In R: library(ibelief) #probabilities p1 <- c(0.99, 0.01) # bad results for 0 and 1 p2 <- c(0.01, 0.99) p3 <- c(0.5, 0.5) # basic belief assignment, # each row represents a subset of (rain, not rain) # each column represents one prediction Mat <- LCPrincple(rbind(p1,p2,p3)) # combine beliefs m <- DST(Mat, 1) # resulting probability distribution (pignistic probability) mtobetp(m) # returns 0.5 and 0.5 For the second example of three independent predictions of 0.75, this approach returns a higher value: p4 <- c(0.75, 0.25) Mat <- LCPrincple(rbind(p4,p4,p4)) m <- DST(Mat, 1) mtobetp(m) #returns 0.9375 0.0625 This is not very far from the Bayesian approach shown in Arthur B's answer.
Combining probabilities/information from different sources
In the framework of Transferable Belief Model (TBM), it is possible to combine different predictions using for instance the "conjunctive rule of combination". In order to apply this rule, you need to
Combining probabilities/information from different sources In the framework of Transferable Belief Model (TBM), it is possible to combine different predictions using for instance the "conjunctive rule of combination". In order to apply this rule, you need to transform the probabilities of the predictions into basic belief assignments. This can be achieved with the so-called Least-Committed-Principle. In R: library(ibelief) #probabilities p1 <- c(0.99, 0.01) # bad results for 0 and 1 p2 <- c(0.01, 0.99) p3 <- c(0.5, 0.5) # basic belief assignment, # each row represents a subset of (rain, not rain) # each column represents one prediction Mat <- LCPrincple(rbind(p1,p2,p3)) # combine beliefs m <- DST(Mat, 1) # resulting probability distribution (pignistic probability) mtobetp(m) # returns 0.5 and 0.5 For the second example of three independent predictions of 0.75, this approach returns a higher value: p4 <- c(0.75, 0.25) Mat <- LCPrincple(rbind(p4,p4,p4)) m <- DST(Mat, 1) mtobetp(m) #returns 0.9375 0.0625 This is not very far from the Bayesian approach shown in Arthur B's answer.
Combining probabilities/information from different sources In the framework of Transferable Belief Model (TBM), it is possible to combine different predictions using for instance the "conjunctive rule of combination". In order to apply this rule, you need to
5,438
Combining probabilities/information from different sources
I think it's worthwhile to look at the weighting scheme based on inverse errors mentioned in one of the answers. If the sources are truly independent and we constrain the weights to sum to one, the weights are given by $$ w_1 = {{\sigma_2^2 \sigma_3^2} \over {\sigma_1^2 \sigma_2^2 + \sigma_1^2 \sigma_3^2 + \sigma_2^2 \sigma_3^2}},\ w_2 = {{\sigma_1^2 \sigma_3^2} \over {\sigma_1^2 \sigma_2^2 + \sigma_1^2 \sigma_3^2 + \sigma_2^2 \sigma_3^2}},\ w_3 ={{\sigma_1^2 \sigma_2^2} \over {\sigma_1^2 \sigma_2^2 + \sigma_1^2 \sigma_3^2 + \sigma_2^2 \sigma_3^2}}. $$ If, as the OP states, the forecasts are equally reliable, then all weights will simplify to $\frac{1}{3}$ and the combined forecast for the given example will be 50%. Note that the values of $\sigma_i$ do not need to be known if their relative proportions are known. So if $\sigma_1^2 : \sigma_2^2 : \sigma_3^2 = 1:2:4,$ then the forecast in the example would be $$f = { {{8} \over {14}}*(0) + {{4} \over {14}}*(1) + {{2} \over {14}}*(0.5) } = 0.3571 $$
Combining probabilities/information from different sources
I think it's worthwhile to look at the weighting scheme based on inverse errors mentioned in one of the answers. If the sources are truly independent and we constrain the weights to sum to one, the we
Combining probabilities/information from different sources I think it's worthwhile to look at the weighting scheme based on inverse errors mentioned in one of the answers. If the sources are truly independent and we constrain the weights to sum to one, the weights are given by $$ w_1 = {{\sigma_2^2 \sigma_3^2} \over {\sigma_1^2 \sigma_2^2 + \sigma_1^2 \sigma_3^2 + \sigma_2^2 \sigma_3^2}},\ w_2 = {{\sigma_1^2 \sigma_3^2} \over {\sigma_1^2 \sigma_2^2 + \sigma_1^2 \sigma_3^2 + \sigma_2^2 \sigma_3^2}},\ w_3 ={{\sigma_1^2 \sigma_2^2} \over {\sigma_1^2 \sigma_2^2 + \sigma_1^2 \sigma_3^2 + \sigma_2^2 \sigma_3^2}}. $$ If, as the OP states, the forecasts are equally reliable, then all weights will simplify to $\frac{1}{3}$ and the combined forecast for the given example will be 50%. Note that the values of $\sigma_i$ do not need to be known if their relative proportions are known. So if $\sigma_1^2 : \sigma_2^2 : \sigma_3^2 = 1:2:4,$ then the forecast in the example would be $$f = { {{8} \over {14}}*(0) + {{4} \over {14}}*(1) + {{2} \over {14}}*(0.5) } = 0.3571 $$
Combining probabilities/information from different sources I think it's worthwhile to look at the weighting scheme based on inverse errors mentioned in one of the answers. If the sources are truly independent and we constrain the weights to sum to one, the we
5,439
Combining probabilities/information from different sources
There are a lot of complicated answers given to this question, but what about the Inverse Variance Weighted Mean: https://en.wikipedia.org/wiki/Inverse-variance_weighting Instead of n repeated measurements with one instrument, if the experimenter makes n of the same quantity with n different instruments with varying quality of measurements... Each random variable is weighted in inverse proportion to its variance. The inverse-variance weighted average seems very straightforward to calculate and as a bonus has the least variance among all weighted averages.
Combining probabilities/information from different sources
There are a lot of complicated answers given to this question, but what about the Inverse Variance Weighted Mean: https://en.wikipedia.org/wiki/Inverse-variance_weighting Instead of n repeated measur
Combining probabilities/information from different sources There are a lot of complicated answers given to this question, but what about the Inverse Variance Weighted Mean: https://en.wikipedia.org/wiki/Inverse-variance_weighting Instead of n repeated measurements with one instrument, if the experimenter makes n of the same quantity with n different instruments with varying quality of measurements... Each random variable is weighted in inverse proportion to its variance. The inverse-variance weighted average seems very straightforward to calculate and as a bonus has the least variance among all weighted averages.
Combining probabilities/information from different sources There are a lot of complicated answers given to this question, but what about the Inverse Variance Weighted Mean: https://en.wikipedia.org/wiki/Inverse-variance_weighting Instead of n repeated measur
5,440
Combining probabilities/information from different sources
Their numbers for rain likelihood is only half the story, as we'd have to temper their predictions with the probability that they are accurate when making guesses. Because something like rain is mutually exclusive(it's either raining or isn't, in this setup), they cannot all simultaneously be correct with 75% probability as Karsten suggested (I think, hard to tell with the confusion I hear about what it means to find "combined probability"). Taking into consideration their individual abilities to predict the weather, we could take a stab (a la Thomas Bayes, as in a generally blind shot in the dark) at what the chance of rain is tomorrow. Station 1 is correct in their predictions 60% of the time, the second 30% of the time, and the last station a poor 10% of the time. E[rain]=PxX+PyY+Pz*Z is the form we're looking at here: (.6)(0)+(.3)(1)+(.1)(.5) = E[rain] = 35% chance of rain with made up prediction accuracies.
Combining probabilities/information from different sources
Their numbers for rain likelihood is only half the story, as we'd have to temper their predictions with the probability that they are accurate when making guesses. Because something like rain is mutua
Combining probabilities/information from different sources Their numbers for rain likelihood is only half the story, as we'd have to temper their predictions with the probability that they are accurate when making guesses. Because something like rain is mutually exclusive(it's either raining or isn't, in this setup), they cannot all simultaneously be correct with 75% probability as Karsten suggested (I think, hard to tell with the confusion I hear about what it means to find "combined probability"). Taking into consideration their individual abilities to predict the weather, we could take a stab (a la Thomas Bayes, as in a generally blind shot in the dark) at what the chance of rain is tomorrow. Station 1 is correct in their predictions 60% of the time, the second 30% of the time, and the last station a poor 10% of the time. E[rain]=PxX+PyY+Pz*Z is the form we're looking at here: (.6)(0)+(.3)(1)+(.1)(.5) = E[rain] = 35% chance of rain with made up prediction accuracies.
Combining probabilities/information from different sources Their numbers for rain likelihood is only half the story, as we'd have to temper their predictions with the probability that they are accurate when making guesses. Because something like rain is mutua
5,441
Combining probabilities/information from different sources
For combining reliability, my go-to formula is r1xr2xr3÷(r1xr2xr3+(1-r1)x(1-r2)x(1-r3). So for the 3 sources of reliability 75% all saying the same thing, i would have .75^3 ÷ (.75^3 + .25^3) => 96% reliability of the combined response
Combining probabilities/information from different sources
For combining reliability, my go-to formula is r1xr2xr3÷(r1xr2xr3+(1-r1)x(1-r2)x(1-r3). So for the 3 sources of reliability 75% all saying the same thing, i would have .75^3 ÷ (.75^3 + .25^3) => 96% r
Combining probabilities/information from different sources For combining reliability, my go-to formula is r1xr2xr3÷(r1xr2xr3+(1-r1)x(1-r2)x(1-r3). So for the 3 sources of reliability 75% all saying the same thing, i would have .75^3 ÷ (.75^3 + .25^3) => 96% reliability of the combined response
Combining probabilities/information from different sources For combining reliability, my go-to formula is r1xr2xr3÷(r1xr2xr3+(1-r1)x(1-r2)x(1-r3). So for the 3 sources of reliability 75% all saying the same thing, i would have .75^3 ÷ (.75^3 + .25^3) => 96% r
5,442
Taking the expectation of Taylor series (especially the remainder)
You are right to be skeptical of this approach. The Taylor series method does not work in general, although the heuristic contains a kernel of truth. To summarize the technical discussion below, Strong concentration implies that the Taylor series method works for nice functions Things can and will go dramatically wrong for heavy-tailed distributions or not-so-nice functions As Alecos's answer indicates, this suggests that the Taylor-series method should be scrapped if your data might have heavy tails. (Finance professionals, I'm looking at you.) As Elvis noted, key problem is that the variance does not control higher moments. To see why, let's simplify your question as much as possible to get to the main idea. Suppose we have a sequence of random variables $X_n$ with $\sigma(X_n)\to 0$ as $n\to \infty$. Q: Can we guarantee that $\mathbb{E}[|X_n-\mu|^3] = o(\sigma^2(X_n))$ as $n\to \infty?$ Since there are random variables with finite second moments and infinite third moments, the answer is emphatically no. Therefore, in general, the Taylor series method fails even for 3rd degree polynomials. Iterating this argument shows you cannot expect the Taylor series method to provide accurate results, even for polynomials, unless all moments of your random variable are well controlled. What, then, are we to do? Certainly the method works for bounded random variables whose support converges to a point, but this class is far too small to be interesting. Suppose instead that the sequence $X_n$ comes from some highly concentrated family that satisfies (say) $$\mathbb{P}\left\{ |X_n-\mu|> t\right\} \le \mathrm{e}^{- C n t^2} \tag{1}$$ for every $t>0$ and some $C>0$. Such random variables are surprisingly common. For example when $X_n$ is the empirical mean $$ X_n := \frac{1}{n} \sum_{i=1}^n Y_i$$ of nice random variables $Y_i$ (e.g., iid and bounded), various concentration inequalities imply that $X_n$ satisfies (1). A standard argument (see p. 10 here) bounds the $p$th moments for such random variables: $$ \mathbb{E}[|X_n-\mu|^p] \le \left(\frac{p}{2 C n}\right)^{p/2}.$$ Therefore, for any "sufficiently nice" analytic function $f$ (see below), we can bound the error $\mathcal{E}_m$ on the $m$-term Taylor series approximation using the triangle inequality $$ \mathcal{E}_m:=\left|\mathbb{E}[f(X_n)] - \sum_{p=0}^m \frac{f^{(p)}(\mu)}{p!} \mathbb{E}(X_n-\mu)^p\right|\le \tfrac{1}{(2 C n)^{(m+1)/2}} \sum_{p=m+1}^\infty |f^{(p)}(\mu)| \frac{p^{p/2}}{p!}$$ when $n>C/2$. Since Stirling's approximation gives $p! \approx p^{p-1/2}$, the error of the truncated Taylor series satisfies $$ \mathcal{E}_m = O(n^{-(m+1)/2}) \text{ as } n\to \infty\quad \text{whenever} \quad \sum_{p=0}^\infty p^{(1-p)/2 }|f^{(p)}(\mu)| < \infty \tag{2}.$$ Hence, when $X_n$ is strongly concentrated and $f$ is sufficiently nice, the Taylor series approximation is indeed accurate. The inequality appearing in (2) implies that $f^{(p)}(\mu)/p! = O(p^{-p/2})$, so that in particular our condition requires that $f$ is entire. This makes sense because (1) does not impose any boundedness assumptions on $X_n$. Let's see what can go wrong when $f$ is has a singularity (following whuber's comment). Suppose that we choose $f(x)=1/x$. If we take $X_n$ from the $\mathrm{Normal}(1,1/n)$ distribution truncated between zero and two, then $X_n$ is sufficiently concentrated but $\mathbb{E}[f(X_n)] = \infty$ for every $n$. In other words, we have a highly concentrated, bounded random variable, and still the Taylor series method fails when the function has just one singularity. A few words on rigor. I find it nicer to present the condition appearing in (2) as derived rather than a deus ex machina that's required in a rigorous theorem/proof format. In order to make the argument completely rigorous, first note that the right-hand side in (2) implies that $$\mathbb{E}[|f(X_n)|] \le \sum_{i=0}^\infty \frac{|f^{(p)}(\mu)|}{p!} \mathbb{E}[|X_n-\mu|^p]< \infty$$ by the growth rate of subgaussian moments from above. Thus, Fubini's theorem provides $$ \mathbb{E}[f(X_n)] = \sum_{i=0}^\infty \frac{f^{(p)}(\mu)}{p!} \mathbb{E}[(X_n-\mu)^p]$$ The rest of the proof proceeds as above.
Taking the expectation of Taylor series (especially the remainder)
You are right to be skeptical of this approach. The Taylor series method does not work in general, although the heuristic contains a kernel of truth. To summarize the technical discussion below, Stro
Taking the expectation of Taylor series (especially the remainder) You are right to be skeptical of this approach. The Taylor series method does not work in general, although the heuristic contains a kernel of truth. To summarize the technical discussion below, Strong concentration implies that the Taylor series method works for nice functions Things can and will go dramatically wrong for heavy-tailed distributions or not-so-nice functions As Alecos's answer indicates, this suggests that the Taylor-series method should be scrapped if your data might have heavy tails. (Finance professionals, I'm looking at you.) As Elvis noted, key problem is that the variance does not control higher moments. To see why, let's simplify your question as much as possible to get to the main idea. Suppose we have a sequence of random variables $X_n$ with $\sigma(X_n)\to 0$ as $n\to \infty$. Q: Can we guarantee that $\mathbb{E}[|X_n-\mu|^3] = o(\sigma^2(X_n))$ as $n\to \infty?$ Since there are random variables with finite second moments and infinite third moments, the answer is emphatically no. Therefore, in general, the Taylor series method fails even for 3rd degree polynomials. Iterating this argument shows you cannot expect the Taylor series method to provide accurate results, even for polynomials, unless all moments of your random variable are well controlled. What, then, are we to do? Certainly the method works for bounded random variables whose support converges to a point, but this class is far too small to be interesting. Suppose instead that the sequence $X_n$ comes from some highly concentrated family that satisfies (say) $$\mathbb{P}\left\{ |X_n-\mu|> t\right\} \le \mathrm{e}^{- C n t^2} \tag{1}$$ for every $t>0$ and some $C>0$. Such random variables are surprisingly common. For example when $X_n$ is the empirical mean $$ X_n := \frac{1}{n} \sum_{i=1}^n Y_i$$ of nice random variables $Y_i$ (e.g., iid and bounded), various concentration inequalities imply that $X_n$ satisfies (1). A standard argument (see p. 10 here) bounds the $p$th moments for such random variables: $$ \mathbb{E}[|X_n-\mu|^p] \le \left(\frac{p}{2 C n}\right)^{p/2}.$$ Therefore, for any "sufficiently nice" analytic function $f$ (see below), we can bound the error $\mathcal{E}_m$ on the $m$-term Taylor series approximation using the triangle inequality $$ \mathcal{E}_m:=\left|\mathbb{E}[f(X_n)] - \sum_{p=0}^m \frac{f^{(p)}(\mu)}{p!} \mathbb{E}(X_n-\mu)^p\right|\le \tfrac{1}{(2 C n)^{(m+1)/2}} \sum_{p=m+1}^\infty |f^{(p)}(\mu)| \frac{p^{p/2}}{p!}$$ when $n>C/2$. Since Stirling's approximation gives $p! \approx p^{p-1/2}$, the error of the truncated Taylor series satisfies $$ \mathcal{E}_m = O(n^{-(m+1)/2}) \text{ as } n\to \infty\quad \text{whenever} \quad \sum_{p=0}^\infty p^{(1-p)/2 }|f^{(p)}(\mu)| < \infty \tag{2}.$$ Hence, when $X_n$ is strongly concentrated and $f$ is sufficiently nice, the Taylor series approximation is indeed accurate. The inequality appearing in (2) implies that $f^{(p)}(\mu)/p! = O(p^{-p/2})$, so that in particular our condition requires that $f$ is entire. This makes sense because (1) does not impose any boundedness assumptions on $X_n$. Let's see what can go wrong when $f$ is has a singularity (following whuber's comment). Suppose that we choose $f(x)=1/x$. If we take $X_n$ from the $\mathrm{Normal}(1,1/n)$ distribution truncated between zero and two, then $X_n$ is sufficiently concentrated but $\mathbb{E}[f(X_n)] = \infty$ for every $n$. In other words, we have a highly concentrated, bounded random variable, and still the Taylor series method fails when the function has just one singularity. A few words on rigor. I find it nicer to present the condition appearing in (2) as derived rather than a deus ex machina that's required in a rigorous theorem/proof format. In order to make the argument completely rigorous, first note that the right-hand side in (2) implies that $$\mathbb{E}[|f(X_n)|] \le \sum_{i=0}^\infty \frac{|f^{(p)}(\mu)|}{p!} \mathbb{E}[|X_n-\mu|^p]< \infty$$ by the growth rate of subgaussian moments from above. Thus, Fubini's theorem provides $$ \mathbb{E}[f(X_n)] = \sum_{i=0}^\infty \frac{f^{(p)}(\mu)}{p!} \mathbb{E}[(X_n-\mu)^p]$$ The rest of the proof proceeds as above.
Taking the expectation of Taylor series (especially the remainder) You are right to be skeptical of this approach. The Taylor series method does not work in general, although the heuristic contains a kernel of truth. To summarize the technical discussion below, Stro
5,443
Taking the expectation of Taylor series (especially the remainder)
Although my answer will nowhere approach the level of mathematical sophistication of the other answers, I decided to post it because I believe it has something to contribute -although the result will be "negative", as they say. In a light tone, I would say that the OP is "risk-averse", (as most people are, as well as science itself), because the OP requires a sufficient condition for the 2nd-order Taylor series expansion approximation to "be acceptable". But it is not a necessary condition. Firstly, a necessary but not sufficient pre-requisite for the expected value of the Remainder to be of lower order than the variance of the r.v., as the OP requires, is that the series converges in the first place. Should we just assume convergence? No. The general expression we examine is $$ E\Big[g(Y)\Big] = \int_{-\infty}^{\infty}f_Y(y)\Big[\sum_{i=0}^{\infty}g^{(i)}(\mu)\frac{(y-\mu)^i}{i!}\Big]dy \qquad [1]$$ As Loistl (1976) states, referencing Gemignani's "Calculus and Statistics" book (1978, p. 170), a condition for convergence of the infinite sum is (an application of the ratio test for convergence) $$y-\mu < |y-\mu|<\lim_{i\rightarrow \infty}\left | \left(\frac {g^{(i)}(\mu)}{g^{(i+1)}(\mu)}(i+1)\right)\right| \qquad [2]$$ ...where $\mu$ is the mean of the r.v. Although this too is a sufficient condition (the ratio test is inconclusive if the above relation holds with equality), the series will diverge if the inequality holds in the other direction. Loistl examined three specific functional forms for $g()$, the exponential, the power, and the logarithm (his paper is in the field of Expected Utility and Portfolio Choice, so he tested the standard functional forms used to represent a concave utility function). For these functional forms, he found that only for the exponential functional form no restrictions on $y-\mu$ were imposed. On the contrary, for the power, and for the logarithmic case (where we already have $0 <y$), we find that the validity of inequality $[2]$ is equivalent to $$y-\mu < \mu \Rightarrow 0 < y < 2\mu$$ This means that if our variable varies outside this range, the Taylor expansion having as expansion center the variable's mean will diverge. So: for some functional forms, the value of a function at some point of its domain equals its infinite Taylor expansion, no matter how far this point is from the expansion center. For other functional forms (logarithm included), the point of interest should lie somewhat "close" to the chosen center of expansion. In the case where we have a r.v., this translates to a restriction on the theoretical support of the variable (or an examination of its empirically observed range). Loitl, using numerical examples, showed also that increasing the order of the expansion before truncation could make matters worse for the accuracy of the approximation. We must note that empirically, time-series of observed variables in the financial sector do exhibit variability larger than the one required by the inequality. So Loitl went on to advocate that the Taylor series approximation methodology should be scrapped entirely, regarding Portfolio Choice Theory. The rebound came 18 years later from Hlawitschka (1994). The valuable insight and result here was, and I quote ...although a series may ultimately converge, little can be said about any of its partial series; convergence of a series does not imply that the terms immediately decrease in size or that any particular term is sufficiently small to be ignored. Indeed, it is possible, as demonstrated here, that a series may appear to diverge before ultimately converging in the limit. The quality of moment approximations to expected utility that are based upon the first few terms of a Taylor series, therefore, cannot be determined by the convergence properties of the infinite series. This is an empirical issue, and empirically, two-moment approximations to the utility functions studied here perform well for the task of portfolio selection. Hlawitschka (1994) By example, Hlawitschka showed that the 2nd-order approximation was "successful" whether the Taylor series converged or not, but he also verified Lotl's result, that increasing the order of the approximation may make it worse. But there is a qualifier for this success: In Portfolio Choice, Expected Utility is used to rank securities and other financial products. It is an ordinal measure, not cardinal. So what Hlawitschka found is that the 2nd-order approximation preserved the ranking of different securities, compared to the ranking stemming from the exact value of $E(g(Y)$, and not that it always gave quantitative results that where sufficiently close to this exact value (see his table A1 in p. 718). So where does that leave us? In limbo, I'd say. It appears that both in theory and in empirics, the acceptability of the 2nd-order Taylor approximation depends critically on many different aspects of the specific phenomenon under study and the scientific methodology employed -it depends on the theoretical assumptions, on the functional forms used, on the observed variability of the series... But let's end this positively: nowadays, computer power substitutes for a lot of things. So we could simulate and test the validity of the 2nd-order approximation, for a wide range of values of the variable cheaply, whether we work on a theoretical, or an empirical problem.
Taking the expectation of Taylor series (especially the remainder)
Although my answer will nowhere approach the level of mathematical sophistication of the other answers, I decided to post it because I believe it has something to contribute -although the result will
Taking the expectation of Taylor series (especially the remainder) Although my answer will nowhere approach the level of mathematical sophistication of the other answers, I decided to post it because I believe it has something to contribute -although the result will be "negative", as they say. In a light tone, I would say that the OP is "risk-averse", (as most people are, as well as science itself), because the OP requires a sufficient condition for the 2nd-order Taylor series expansion approximation to "be acceptable". But it is not a necessary condition. Firstly, a necessary but not sufficient pre-requisite for the expected value of the Remainder to be of lower order than the variance of the r.v., as the OP requires, is that the series converges in the first place. Should we just assume convergence? No. The general expression we examine is $$ E\Big[g(Y)\Big] = \int_{-\infty}^{\infty}f_Y(y)\Big[\sum_{i=0}^{\infty}g^{(i)}(\mu)\frac{(y-\mu)^i}{i!}\Big]dy \qquad [1]$$ As Loistl (1976) states, referencing Gemignani's "Calculus and Statistics" book (1978, p. 170), a condition for convergence of the infinite sum is (an application of the ratio test for convergence) $$y-\mu < |y-\mu|<\lim_{i\rightarrow \infty}\left | \left(\frac {g^{(i)}(\mu)}{g^{(i+1)}(\mu)}(i+1)\right)\right| \qquad [2]$$ ...where $\mu$ is the mean of the r.v. Although this too is a sufficient condition (the ratio test is inconclusive if the above relation holds with equality), the series will diverge if the inequality holds in the other direction. Loistl examined three specific functional forms for $g()$, the exponential, the power, and the logarithm (his paper is in the field of Expected Utility and Portfolio Choice, so he tested the standard functional forms used to represent a concave utility function). For these functional forms, he found that only for the exponential functional form no restrictions on $y-\mu$ were imposed. On the contrary, for the power, and for the logarithmic case (where we already have $0 <y$), we find that the validity of inequality $[2]$ is equivalent to $$y-\mu < \mu \Rightarrow 0 < y < 2\mu$$ This means that if our variable varies outside this range, the Taylor expansion having as expansion center the variable's mean will diverge. So: for some functional forms, the value of a function at some point of its domain equals its infinite Taylor expansion, no matter how far this point is from the expansion center. For other functional forms (logarithm included), the point of interest should lie somewhat "close" to the chosen center of expansion. In the case where we have a r.v., this translates to a restriction on the theoretical support of the variable (or an examination of its empirically observed range). Loitl, using numerical examples, showed also that increasing the order of the expansion before truncation could make matters worse for the accuracy of the approximation. We must note that empirically, time-series of observed variables in the financial sector do exhibit variability larger than the one required by the inequality. So Loitl went on to advocate that the Taylor series approximation methodology should be scrapped entirely, regarding Portfolio Choice Theory. The rebound came 18 years later from Hlawitschka (1994). The valuable insight and result here was, and I quote ...although a series may ultimately converge, little can be said about any of its partial series; convergence of a series does not imply that the terms immediately decrease in size or that any particular term is sufficiently small to be ignored. Indeed, it is possible, as demonstrated here, that a series may appear to diverge before ultimately converging in the limit. The quality of moment approximations to expected utility that are based upon the first few terms of a Taylor series, therefore, cannot be determined by the convergence properties of the infinite series. This is an empirical issue, and empirically, two-moment approximations to the utility functions studied here perform well for the task of portfolio selection. Hlawitschka (1994) By example, Hlawitschka showed that the 2nd-order approximation was "successful" whether the Taylor series converged or not, but he also verified Lotl's result, that increasing the order of the approximation may make it worse. But there is a qualifier for this success: In Portfolio Choice, Expected Utility is used to rank securities and other financial products. It is an ordinal measure, not cardinal. So what Hlawitschka found is that the 2nd-order approximation preserved the ranking of different securities, compared to the ranking stemming from the exact value of $E(g(Y)$, and not that it always gave quantitative results that where sufficiently close to this exact value (see his table A1 in p. 718). So where does that leave us? In limbo, I'd say. It appears that both in theory and in empirics, the acceptability of the 2nd-order Taylor approximation depends critically on many different aspects of the specific phenomenon under study and the scientific methodology employed -it depends on the theoretical assumptions, on the functional forms used, on the observed variability of the series... But let's end this positively: nowadays, computer power substitutes for a lot of things. So we could simulate and test the validity of the 2nd-order approximation, for a wide range of values of the variable cheaply, whether we work on a theoretical, or an empirical problem.
Taking the expectation of Taylor series (especially the remainder) Although my answer will nowhere approach the level of mathematical sophistication of the other answers, I decided to post it because I believe it has something to contribute -although the result will
5,444
Taking the expectation of Taylor series (especially the remainder)
Not an actual answer, but an example to show that things are not so nice, and that extra hypotheses are needed to make this result true. Define $X_n$ as a mixture between a uniform $U\left( \left[ -{1\over n} ; {1\over n} \right] \right)$ and a normal $\mathcal N({n \over n-1}, {1\over n})$, the uniform component being chosen with probability $1\over n$, and the normal with probability $1 -{1\over n} = {n-1 \over n}$. You have $E(X_n) = 1$ and its variance converges to $0$ when $n$ goes to infinity, as $$E\left(X_n^2\right) = {1\over 3 n^2} \times {1\over n} + \left(\left({n \over n-1}\right)^2+{1\over n}\right)\times{n-1 \over n},$$ if I am not mistaking. Now define $f(x) = 1/x$ (and $f(0) = 0$ or whatever). The random variables $f(X_n)$ are well defined but does not have an expected value, as $$ \int_{-{1\over n}}^{1\over n} {1\over x} \mathrm dx$$ is not defined, no matter how big $n$ is. My conclusion is that you clearly need hypotheses on either the global behavior of $f$ or – more likely, more elegantly – on the speed at which the density of $X_n$ decays when you’re far from the expected value. I am sure that such hypotheses can be found in the classic literature (and even in textbooks), unfortunately my training was not in statistics and I still struggle with the literature myself... anyway I hope this helped. PS. Isn’t this example a counter-example to Nick’s answer? Who’s wrong then?
Taking the expectation of Taylor series (especially the remainder)
Not an actual answer, but an example to show that things are not so nice, and that extra hypotheses are needed to make this result true. Define $X_n$ as a mixture between a uniform $U\left( \left[ -{1
Taking the expectation of Taylor series (especially the remainder) Not an actual answer, but an example to show that things are not so nice, and that extra hypotheses are needed to make this result true. Define $X_n$ as a mixture between a uniform $U\left( \left[ -{1\over n} ; {1\over n} \right] \right)$ and a normal $\mathcal N({n \over n-1}, {1\over n})$, the uniform component being chosen with probability $1\over n$, and the normal with probability $1 -{1\over n} = {n-1 \over n}$. You have $E(X_n) = 1$ and its variance converges to $0$ when $n$ goes to infinity, as $$E\left(X_n^2\right) = {1\over 3 n^2} \times {1\over n} + \left(\left({n \over n-1}\right)^2+{1\over n}\right)\times{n-1 \over n},$$ if I am not mistaking. Now define $f(x) = 1/x$ (and $f(0) = 0$ or whatever). The random variables $f(X_n)$ are well defined but does not have an expected value, as $$ \int_{-{1\over n}}^{1\over n} {1\over x} \mathrm dx$$ is not defined, no matter how big $n$ is. My conclusion is that you clearly need hypotheses on either the global behavior of $f$ or – more likely, more elegantly – on the speed at which the density of $X_n$ decays when you’re far from the expected value. I am sure that such hypotheses can be found in the classic literature (and even in textbooks), unfortunately my training was not in statistics and I still struggle with the literature myself... anyway I hope this helped. PS. Isn’t this example a counter-example to Nick’s answer? Who’s wrong then?
Taking the expectation of Taylor series (especially the remainder) Not an actual answer, but an example to show that things are not so nice, and that extra hypotheses are needed to make this result true. Define $X_n$ as a mixture between a uniform $U\left( \left[ -{1
5,445
Taking the expectation of Taylor series (especially the remainder)
This is not a complete answer, just a different way of arriving at the second order approximation. I think the best way to go is to use Cauchy's mean value theorem, rather than work with the remainder term of a Taylor series. If we apply it one time we have $$f(X)=f(\mu)+f'(\xi_1)(X-\mu)$$ for some $X\leq\xi_1 \leq \mu$ when $X \leq \mu$ or $X\geq\xi_1 \geq \mu$ when $X \geq \mu$. We now apply the mean value theorem again to $ f'(\xi_1)$ and we have $$ f'(\xi_1)= f'(\mu) + f''(\xi_2)( \xi_1-\mu)$$ for some $X\leq\xi_1\leq\xi_2\leq\mu$ when $X\leq\mu$ or $X\geq\xi_1\geq \xi_2 \geq\mu$ when $X\geq\mu$. putting this into the first fomula gives $$f(X)=f(\mu)+ f'(\mu) (X-\mu) + f''(\xi_2)( \xi_1-\mu) (X-\mu)$$ Note that this result only requires that $f$ is continuous and twice differentiable between $X$ and $\mu$. However this applies only for a fixed $X$, and changing $X$ will mean a corresponding change in $\xi_i$. The second order delta method can be seen as making the global assumption that $\xi_1-\mu=\frac{1}{2}(X-\mu)$ and $\xi_2=\mu$ over the entire range of the support of $X$, or at least over the region of high probability mass.
Taking the expectation of Taylor series (especially the remainder)
This is not a complete answer, just a different way of arriving at the second order approximation. I think the best way to go is to use Cauchy's mean value theorem, rather than work with the remainder
Taking the expectation of Taylor series (especially the remainder) This is not a complete answer, just a different way of arriving at the second order approximation. I think the best way to go is to use Cauchy's mean value theorem, rather than work with the remainder term of a Taylor series. If we apply it one time we have $$f(X)=f(\mu)+f'(\xi_1)(X-\mu)$$ for some $X\leq\xi_1 \leq \mu$ when $X \leq \mu$ or $X\geq\xi_1 \geq \mu$ when $X \geq \mu$. We now apply the mean value theorem again to $ f'(\xi_1)$ and we have $$ f'(\xi_1)= f'(\mu) + f''(\xi_2)( \xi_1-\mu)$$ for some $X\leq\xi_1\leq\xi_2\leq\mu$ when $X\leq\mu$ or $X\geq\xi_1\geq \xi_2 \geq\mu$ when $X\geq\mu$. putting this into the first fomula gives $$f(X)=f(\mu)+ f'(\mu) (X-\mu) + f''(\xi_2)( \xi_1-\mu) (X-\mu)$$ Note that this result only requires that $f$ is continuous and twice differentiable between $X$ and $\mu$. However this applies only for a fixed $X$, and changing $X$ will mean a corresponding change in $\xi_i$. The second order delta method can be seen as making the global assumption that $\xi_1-\mu=\frac{1}{2}(X-\mu)$ and $\xi_2=\mu$ over the entire range of the support of $X$, or at least over the region of high probability mass.
Taking the expectation of Taylor series (especially the remainder) This is not a complete answer, just a different way of arriving at the second order approximation. I think the best way to go is to use Cauchy's mean value theorem, rather than work with the remainder
5,446
What is the derivative of the ReLU activation function?
The derivative is: $$ f(x)= \begin{cases} 0 & \text{if } x < 0 \\ 1 & \text{if } x > 0 \\ \end{cases} $$ And undefined in $x=0$. The reason for it being undefined at $x=0$ is that its left- and right derivative are not equal.
What is the derivative of the ReLU activation function?
The derivative is: $$ f(x)= \begin{cases} 0 & \text{if } x < 0 \\ 1 & \text{if } x > 0 \\ \end{cases} $$ And undefined in $x=0$. The reason for it being undefined at $x=0$ is that its left- and r
What is the derivative of the ReLU activation function? The derivative is: $$ f(x)= \begin{cases} 0 & \text{if } x < 0 \\ 1 & \text{if } x > 0 \\ \end{cases} $$ And undefined in $x=0$. The reason for it being undefined at $x=0$ is that its left- and right derivative are not equal.
What is the derivative of the ReLU activation function? The derivative is: $$ f(x)= \begin{cases} 0 & \text{if } x < 0 \\ 1 & \text{if } x > 0 \\ \end{cases} $$ And undefined in $x=0$. The reason for it being undefined at $x=0$ is that its left- and r
5,447
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Be sure to read the full example on the UCLA site that you linked. Regarding 1: Using a multivariate model helps you (formally, inferentially) compare coefficients across outcomes. In that linked example, they use the multivariate model to test whether the write coefficient is significantly different for the locus_of_control outcome vs for the self_concept outcome. I'm no psychologist, but presumably it's interesting to ask whether your writing ability affects/predicts two different psych variables in the same way. (Or, if we don't believe the null, it's still interesting to ask whether you have collected enough data to demonstrate convincingly that the effects really do differ.) If you ran separate univariate analyses, it would be harder to compare the write coefficient across the two models. Both estimates would come from the same dataset, so they would be correlated. The multivariate model accounts for this correlation. Also, regarding 4: There are some very commonly-used multivariate models, such as Repeated Measures ANOVA . With an appropriate study design, imagine that you give each of several drugs to every patient, and measure each patient's health after every drug. Or imagine you measure the same outcome over time, as with longitudinal data, say children's heights over time. Then you have multiple outcomes for each unit (even when they're just repeats of "the same" type of measurement). You'll probably want to do at least some simple contrasts: comparing the effects of drug A vs drug B, or the average effects of drugs A and B vs placebo. For this, Repeated Measures ANOVA is an appropriate multivariate statistical model/analysis.
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Be sure to read the full example on the UCLA site that you linked. Regarding 1: Using a multivariate model helps you (formally, inferentially) compare coefficients across outcomes. In that linked exam
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Be sure to read the full example on the UCLA site that you linked. Regarding 1: Using a multivariate model helps you (formally, inferentially) compare coefficients across outcomes. In that linked example, they use the multivariate model to test whether the write coefficient is significantly different for the locus_of_control outcome vs for the self_concept outcome. I'm no psychologist, but presumably it's interesting to ask whether your writing ability affects/predicts two different psych variables in the same way. (Or, if we don't believe the null, it's still interesting to ask whether you have collected enough data to demonstrate convincingly that the effects really do differ.) If you ran separate univariate analyses, it would be harder to compare the write coefficient across the two models. Both estimates would come from the same dataset, so they would be correlated. The multivariate model accounts for this correlation. Also, regarding 4: There are some very commonly-used multivariate models, such as Repeated Measures ANOVA . With an appropriate study design, imagine that you give each of several drugs to every patient, and measure each patient's health after every drug. Or imagine you measure the same outcome over time, as with longitudinal data, say children's heights over time. Then you have multiple outcomes for each unit (even when they're just repeats of "the same" type of measurement). You'll probably want to do at least some simple contrasts: comparing the effects of drug A vs drug B, or the average effects of drugs A and B vs placebo. For this, Repeated Measures ANOVA is an appropriate multivariate statistical model/analysis.
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Be sure to read the full example on the UCLA site that you linked. Regarding 1: Using a multivariate model helps you (formally, inferentially) compare coefficients across outcomes. In that linked exam
5,448
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Think about all the false and sometimes dangerous conclusions that come from simply multiplying probabilities, thinking events are independent. Because of all the built-in redundant safeguards, we put into our nuclear power plants experts using the independence assumption told us that the chance of a major nuclear accident was infinitesimal. But as we saw at Three Mile Island, humans make correlated errors especially when they are in a panic because of one initial error which quickly can compound itself. It might be difficult to construct a realistic multivariate model that characterizes human behavior, but realizing the effect of a horrible model (independent errors) is clear. There are many other examples possible. I will take the Challenger Shuttle disaster as another possible example. The question was whether or not to launch under low-temperature conditions. There was some data to suggest that the o-rings could fail at low temperatures. But there was not a lot of data from past missions to make it clear how high the risk was. NASA has always been concerned with the safety of the astronauts and many redundancies were engineered into the spacecraft and launch vehicles to make the missions safe. Yet prior to 1986, there were some system failures and near failures probably due to not identifying all possible failure modes (a difficult task). Reliability modeling is a difficult business. But that is another story. In the case of the shuttle, the manufacturer of the o-rings (Morton Thiokol) had done some testing of the o-rings that indicated the possibility of failure at low temperatures. But the data on a limited number of missions did show some relationship between temperature and failure but because redundancy led some administrators to think multiple o-ring failures would not happen, they put pressure on NASA to launch. Of course, there were many other factors that led to the decision. Remember how President Reagan was so anxious to put a teacher in space so as to demonstrate that it was now safe enough that ordinary people who were not astronauts could safely travel on the shuttle? So political pressure was another big factor affecting the decision. In this case with enough data and a multivariate model, the risk could have been better demonstrated. NASA use to try to err on the side of caution. In this case, putting off the launch for a few days until the weather warmed up in Florida would have been prudent. Post-disaster commissions, engineers, scientists and statisticians did a great deal of analysis and papers were published. Their views may differ from mine. Edward Tufte showed in one of his series of books on graphics that good graphics might have been more convincing. But in the end, although these analyses all have merit I think the politics would have still won out. The moral of these stories is not that these disasters motivated the use of multivariate methods but rather that poor analyses that ignored dependence sometimes lead to gross underestimates of risk. This can lead to overconfidence which can be dangerous. As jwimberley pointed out in the first comment to this thread "Separate univariate models ignore correlations."
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Think about all the false and sometimes dangerous conclusions that come from simply multiplying probabilities, thinking events are independent. Because of all the built-in redundant safeguards, we pu
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Think about all the false and sometimes dangerous conclusions that come from simply multiplying probabilities, thinking events are independent. Because of all the built-in redundant safeguards, we put into our nuclear power plants experts using the independence assumption told us that the chance of a major nuclear accident was infinitesimal. But as we saw at Three Mile Island, humans make correlated errors especially when they are in a panic because of one initial error which quickly can compound itself. It might be difficult to construct a realistic multivariate model that characterizes human behavior, but realizing the effect of a horrible model (independent errors) is clear. There are many other examples possible. I will take the Challenger Shuttle disaster as another possible example. The question was whether or not to launch under low-temperature conditions. There was some data to suggest that the o-rings could fail at low temperatures. But there was not a lot of data from past missions to make it clear how high the risk was. NASA has always been concerned with the safety of the astronauts and many redundancies were engineered into the spacecraft and launch vehicles to make the missions safe. Yet prior to 1986, there were some system failures and near failures probably due to not identifying all possible failure modes (a difficult task). Reliability modeling is a difficult business. But that is another story. In the case of the shuttle, the manufacturer of the o-rings (Morton Thiokol) had done some testing of the o-rings that indicated the possibility of failure at low temperatures. But the data on a limited number of missions did show some relationship between temperature and failure but because redundancy led some administrators to think multiple o-ring failures would not happen, they put pressure on NASA to launch. Of course, there were many other factors that led to the decision. Remember how President Reagan was so anxious to put a teacher in space so as to demonstrate that it was now safe enough that ordinary people who were not astronauts could safely travel on the shuttle? So political pressure was another big factor affecting the decision. In this case with enough data and a multivariate model, the risk could have been better demonstrated. NASA use to try to err on the side of caution. In this case, putting off the launch for a few days until the weather warmed up in Florida would have been prudent. Post-disaster commissions, engineers, scientists and statisticians did a great deal of analysis and papers were published. Their views may differ from mine. Edward Tufte showed in one of his series of books on graphics that good graphics might have been more convincing. But in the end, although these analyses all have merit I think the politics would have still won out. The moral of these stories is not that these disasters motivated the use of multivariate methods but rather that poor analyses that ignored dependence sometimes lead to gross underestimates of risk. This can lead to overconfidence which can be dangerous. As jwimberley pointed out in the first comment to this thread "Separate univariate models ignore correlations."
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Think about all the false and sometimes dangerous conclusions that come from simply multiplying probabilities, thinking events are independent. Because of all the built-in redundant safeguards, we pu
5,449
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Consider this quote from p. 36 of Darcy Olsen's book The Right to Try [1]: But about sixteen weeks after the [eteplirsen] infusions began, Jenn started noticing changes in [her son] Max. "The kid stopped wanting to use his wheelchair," she says. A few weeks later, he was asking to play outside — something he had not done in years. Then Max started regaining his fine motor skills. He was able to open containers again — a skill he had lost as his [Duchenne muscular dystrophy] had progressed. Max's mother Jenn is building a coherent picture of his improvement, by pulling together evidence from multiple outcomes that individually might be dismissed as 'noise', but that together are quite compelling. (This evidence synthesis principle is part of the reason pediatricians as a rule never dismiss a parent's instinctive inferences that "something is wrong with my child". Parents have access to a 'multivariate longitudinal analysis' of their kids far richer than the 'oligovariate' cross-sectional analysis accessible to a clinician during a single, brief clinical encounter.) Abstracting away from the particular case of eteplirsen, consider a hypothetical situation where only a small fraction of study subjects were benefitting from an experimental therapy, let's say because of some shared genetic factor not yet known to science. It's quite possible that for those few subjects, a statistical argument corresponding to Jenn's multivariate story could clearly identify them as 'responders', whereas multiple separate analyses of the faint signals contained in individual outcomes would each yield $p>0.05$, driving a 'null' summative conclusion. Achieving such evidence synthesis is the core rationale for multivariate outcomes analysis in clinical trials. Statistical Methods in Medical Research had a special issue a few years back [2] devoted to 'Joint Modeling' of multivariate outcomes. Olsen, Darcy. The Right to Try: How the Federal Government Prevents Americans from Getting the Life-Saving Treatments They Need. First edition. New York, NY: Harper, an imprint of HarperCollins Publishers, 2015. Rizopoulos, Dimitris, and Emmanuel Lesaffre. “Introduction to the Special Issue on Joint Modelling Techniques.” Statistical Methods in Medical Research 23, no. 1 (February 1, 2014): 3–10. doi:10.1177/0962280212445800.
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Consider this quote from p. 36 of Darcy Olsen's book The Right to Try [1]: But about sixteen weeks after the [eteplirsen] infusions began, Jenn started noticing changes in [her son] Max. "The kid sto
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Consider this quote from p. 36 of Darcy Olsen's book The Right to Try [1]: But about sixteen weeks after the [eteplirsen] infusions began, Jenn started noticing changes in [her son] Max. "The kid stopped wanting to use his wheelchair," she says. A few weeks later, he was asking to play outside — something he had not done in years. Then Max started regaining his fine motor skills. He was able to open containers again — a skill he had lost as his [Duchenne muscular dystrophy] had progressed. Max's mother Jenn is building a coherent picture of his improvement, by pulling together evidence from multiple outcomes that individually might be dismissed as 'noise', but that together are quite compelling. (This evidence synthesis principle is part of the reason pediatricians as a rule never dismiss a parent's instinctive inferences that "something is wrong with my child". Parents have access to a 'multivariate longitudinal analysis' of their kids far richer than the 'oligovariate' cross-sectional analysis accessible to a clinician during a single, brief clinical encounter.) Abstracting away from the particular case of eteplirsen, consider a hypothetical situation where only a small fraction of study subjects were benefitting from an experimental therapy, let's say because of some shared genetic factor not yet known to science. It's quite possible that for those few subjects, a statistical argument corresponding to Jenn's multivariate story could clearly identify them as 'responders', whereas multiple separate analyses of the faint signals contained in individual outcomes would each yield $p>0.05$, driving a 'null' summative conclusion. Achieving such evidence synthesis is the core rationale for multivariate outcomes analysis in clinical trials. Statistical Methods in Medical Research had a special issue a few years back [2] devoted to 'Joint Modeling' of multivariate outcomes. Olsen, Darcy. The Right to Try: How the Federal Government Prevents Americans from Getting the Life-Saving Treatments They Need. First edition. New York, NY: Harper, an imprint of HarperCollins Publishers, 2015. Rizopoulos, Dimitris, and Emmanuel Lesaffre. “Introduction to the Special Issue on Joint Modelling Techniques.” Statistical Methods in Medical Research 23, no. 1 (February 1, 2014): 3–10. doi:10.1177/0962280212445800.
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Consider this quote from p. 36 of Darcy Olsen's book The Right to Try [1]: But about sixteen weeks after the [eteplirsen] infusions began, Jenn started noticing changes in [her son] Max. "The kid sto
5,450
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Let's make a simple analogy, since that's all I can really try to contribute. Instead of univariate versus multivariate regression, let's consider univariate (marginal) versus multivariate (joint) distributions. Say I have the following data and I want to find "outliers". As a first approach, I might use the two marginal ("univariate") distributions and draw lines at the lower 2.5% and upper 2.5% of each independently. Points falling outside of the resulting lines are considered to be outliers. But two things: 1) what do we think of points that are outside of the lines for one axis but inside of the lines for the other axis? Are they "partial outliers" or something? And 2) the resulting box doesn't look like it's really doing what we want. The reason is, of course, the the two variables are correlated, and what we intuitively want is to find outliers that are unusual considering the variables in combination. In this case, we look at the joint distribution, and I've color-coded the points by whether their Mahalanobis distance from the center is within the upper 5% or not. The black points look much more like outliers, even though some outliers lie within both sets of green lines and some non-outliers (red) lie outside of both sets of green lines. In both cases, we're delimiting the 95% versus the 5%, but the second technique accounts for the joint distribution. I believe multivariate regression is like this, where you substitute "regression" for "distribution". I don't totally get it, and have had no need (that I understand) to do multivariate regression myself, but this is the way I think about it. [The analogy has issues: the Mahalanobis distance reduces two variables to a single number -- something like the way a univariate regregression takes a set of independent variables and can, with the right techniques, take into account covariances among the independent variables, and results in a single dependent variable -- while a multivariate regression results in multiple dependent variables. So it's sort-of backwards, but hopefully forwards-enough to give some intuition.]
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
Let's make a simple analogy, since that's all I can really try to contribute. Instead of univariate versus multivariate regression, let's consider univariate (marginal) versus multivariate (joint) dis
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Let's make a simple analogy, since that's all I can really try to contribute. Instead of univariate versus multivariate regression, let's consider univariate (marginal) versus multivariate (joint) distributions. Say I have the following data and I want to find "outliers". As a first approach, I might use the two marginal ("univariate") distributions and draw lines at the lower 2.5% and upper 2.5% of each independently. Points falling outside of the resulting lines are considered to be outliers. But two things: 1) what do we think of points that are outside of the lines for one axis but inside of the lines for the other axis? Are they "partial outliers" or something? And 2) the resulting box doesn't look like it's really doing what we want. The reason is, of course, the the two variables are correlated, and what we intuitively want is to find outliers that are unusual considering the variables in combination. In this case, we look at the joint distribution, and I've color-coded the points by whether their Mahalanobis distance from the center is within the upper 5% or not. The black points look much more like outliers, even though some outliers lie within both sets of green lines and some non-outliers (red) lie outside of both sets of green lines. In both cases, we're delimiting the 95% versus the 5%, but the second technique accounts for the joint distribution. I believe multivariate regression is like this, where you substitute "regression" for "distribution". I don't totally get it, and have had no need (that I understand) to do multivariate regression myself, but this is the way I think about it. [The analogy has issues: the Mahalanobis distance reduces two variables to a single number -- something like the way a univariate regregression takes a set of independent variables and can, with the right techniques, take into account covariances among the independent variables, and results in a single dependent variable -- while a multivariate regression results in multiple dependent variables. So it's sort-of backwards, but hopefully forwards-enough to give some intuition.]
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? Let's make a simple analogy, since that's all I can really try to contribute. Instead of univariate versus multivariate regression, let's consider univariate (marginal) versus multivariate (joint) dis
5,451
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
1) Nature isn't always simple. In fact, most phenomena (outcome) we study depend on multiple variables, and in a complex manner. An inferential model based on one variable at a time will most likely have a high bias. 2) Univariate models are the simplest model you can build, by definition. It's fine if you are investigating a problem for the first time, and you want to grasp its single, most essential feature. But if you want a deeper understanding of it, an understanding you can actually leverage because you trust what you are doing, you would use multivariate analyses. And among the multivariate ones, you should prefer the ones that do understand correlation patterns, if you care about model accuracy. 3) Sorry no time to read this one. 4) Papers using multivariate techniques are very common these days - even extremely common in some fields. At the CERN experiments using the Large Hadron Collider data (to take an example from particle physics) more than half the hundreds of papers published each year use multivariate techniques in one way or another https://inspirehep.net/search?ln=en&ln=en&p=find+cn+cms+&of=hb&action_search=Search&sf=earliestdate&so=d&rm=&rg=25&sc=0
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
1) Nature isn't always simple. In fact, most phenomena (outcome) we study depend on multiple variables, and in a complex manner. An inferential model based on one variable at a time will most likely
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? 1) Nature isn't always simple. In fact, most phenomena (outcome) we study depend on multiple variables, and in a complex manner. An inferential model based on one variable at a time will most likely have a high bias. 2) Univariate models are the simplest model you can build, by definition. It's fine if you are investigating a problem for the first time, and you want to grasp its single, most essential feature. But if you want a deeper understanding of it, an understanding you can actually leverage because you trust what you are doing, you would use multivariate analyses. And among the multivariate ones, you should prefer the ones that do understand correlation patterns, if you care about model accuracy. 3) Sorry no time to read this one. 4) Papers using multivariate techniques are very common these days - even extremely common in some fields. At the CERN experiments using the Large Hadron Collider data (to take an example from particle physics) more than half the hundreds of papers published each year use multivariate techniques in one way or another https://inspirehep.net/search?ln=en&ln=en&p=find+cn+cms+&of=hb&action_search=Search&sf=earliestdate&so=d&rm=&rg=25&sc=0
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? 1) Nature isn't always simple. In fact, most phenomena (outcome) we study depend on multiple variables, and in a complex manner. An inferential model based on one variable at a time will most likely
5,452
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
My answer depends on what you want to do with the regression. If you are trying to compare the effect of different coefficients, then regression may not be the right tool for you. If you are trying to make predictions using different coefficients that you have proven are independent, then maybe multiple regression is what you should use. Are the factors correlated? If so, a multivariate regression can give you a bad model and you should use a method like VIFs or ridge regression to trim cross-correlations. You should not compare coefficients until the cross-correlated factors are eliminated. Doing so will lead to disaster. If they are not cross-correlated, then multivariate coefficients should be as comparable as univariate coefficients, and this should not be surprising. The outcome might also depend on the software package you are using. I am not joking. Different software packages have different methods for calculating multivariate regression. (Don't believe me? Check out how the standard R regression package calculates R2 with and without forcing the origin as the intercept. Your jaw should hit the floor.) You need to understand how the software package is performing the regression. How is it compensating for cross-correlations? Is it performing a sequential or matrix solution? I've had frustrations with this in the past. I suggest performing your multiple regression on different software packages and see what you get. Another good example here: Note that in this equation, the regression coefficients (or B coefficients) represent the independent contributions of each independent variable to the prediction of the dependent variable. Another way to express this fact is to say that, for example, variable X1 is correlated with the Y variable, after controlling for all other independent variables. This type of correlation is also referred to as a partial correlation (this term was first used by Yule, 1907). Perhaps the following example will clarify this issue. You would probably find a significant negative correlation between hair length and height in the population (i.e., short people have longer hair). At first this may seem odd; however, if we were to add the variable Gender into the multiple regression equation, this correlation would probably disappear. This is because women, on the average, have longer hair than men; they also are shorter on the average than men. Thus, after we remove this gender difference by entering Gender into the equation, the relationship between hair length and height disappears because hair length does not make any unique contribution to the prediction of height, above and beyond what it shares in the prediction with variable Gender. Put another way, after controlling for the variable Gender, the partial correlation between hair length and height is zero. http://www.statsoft.com/Textbook/Multiple-Regression There are so many pitfalls using multiple regression that I try to avoid using it. If you were to use it, be very careful with the outcomes and double check them. You should always plot the data visually to verify the correlation. (Just because your software program said there was no correlation, doesn't mean there isn't one. Interesting Correlations) Always check your results against common sense. If one factor shows a strong correlation in a univariate regression, but none in multivariate, you need to understand why before sharing the results(the gender factor above is a good example).
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)?
My answer depends on what you want to do with the regression. If you are trying to compare the effect of different coefficients, then regression may not be the right tool for you. If you are trying
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? My answer depends on what you want to do with the regression. If you are trying to compare the effect of different coefficients, then regression may not be the right tool for you. If you are trying to make predictions using different coefficients that you have proven are independent, then maybe multiple regression is what you should use. Are the factors correlated? If so, a multivariate regression can give you a bad model and you should use a method like VIFs or ridge regression to trim cross-correlations. You should not compare coefficients until the cross-correlated factors are eliminated. Doing so will lead to disaster. If they are not cross-correlated, then multivariate coefficients should be as comparable as univariate coefficients, and this should not be surprising. The outcome might also depend on the software package you are using. I am not joking. Different software packages have different methods for calculating multivariate regression. (Don't believe me? Check out how the standard R regression package calculates R2 with and without forcing the origin as the intercept. Your jaw should hit the floor.) You need to understand how the software package is performing the regression. How is it compensating for cross-correlations? Is it performing a sequential or matrix solution? I've had frustrations with this in the past. I suggest performing your multiple regression on different software packages and see what you get. Another good example here: Note that in this equation, the regression coefficients (or B coefficients) represent the independent contributions of each independent variable to the prediction of the dependent variable. Another way to express this fact is to say that, for example, variable X1 is correlated with the Y variable, after controlling for all other independent variables. This type of correlation is also referred to as a partial correlation (this term was first used by Yule, 1907). Perhaps the following example will clarify this issue. You would probably find a significant negative correlation between hair length and height in the population (i.e., short people have longer hair). At first this may seem odd; however, if we were to add the variable Gender into the multiple regression equation, this correlation would probably disappear. This is because women, on the average, have longer hair than men; they also are shorter on the average than men. Thus, after we remove this gender difference by entering Gender into the equation, the relationship between hair length and height disappears because hair length does not make any unique contribution to the prediction of height, above and beyond what it shares in the prediction with variable Gender. Put another way, after controlling for the variable Gender, the partial correlation between hair length and height is zero. http://www.statsoft.com/Textbook/Multiple-Regression There are so many pitfalls using multiple regression that I try to avoid using it. If you were to use it, be very careful with the outcomes and double check them. You should always plot the data visually to verify the correlation. (Just because your software program said there was no correlation, doesn't mean there isn't one. Interesting Correlations) Always check your results against common sense. If one factor shows a strong correlation in a univariate regression, but none in multivariate, you need to understand why before sharing the results(the gender factor above is a good example).
Why do we need multivariate regression (as opposed to a bunch of univariate regressions)? My answer depends on what you want to do with the regression. If you are trying to compare the effect of different coefficients, then regression may not be the right tool for you. If you are trying
5,453
Entropy of an image
“What is the most information/physics-theoretical correct way to compute the entropy of an image?“ An excellent and timely question. Contrary to popular belief, it is indeed possible to define an intuitively (and theoretically) natural information-entropy for an image. Consider the following figure: We can see that the differential image has a more compact histogram, therefore its Shannon information-entropy is lower. So we can get lower redundancy by using second order Shannon entropy (i.e. entropy derived from differential data). If we can extend this idea isotropically into 2D, then we might expect good estimates for image information-entropy. A two dimensional histogram of gradients allows the 2D extension. We can formalise the arguments and, indeed, this has been completed recently. Recapping briefly: The observation that the simple definition (see for example MATLAB’s definition of image entropy) ignores spatial structure is crucial. To understand what is going on it is worth returning to the 1D case briefly. It has been long known that using the histogram of a signal to compute its Shannon information/entropy ignores the temporal or spatial structure and gives a poor estimate of the signal’s inherent compressibility or redundancy. The solution was already available in Shannon’s classic text; use the second order properties of the signal, i.e. transition probabilities. The observation in 1971 (Rice & Plaunt) that the best predictor of a pixel value in a raster scan is the value of the preceding pixel immediately leads to a differential predictor and a second order Shannon entropy that aligns with simple compression ideas such as run length encoding. These ideas were refined in the late 80s resulting in some classic lossless image (differential) coding techniques that are still in use (PNG, lossless JPG, GIF, lossless JPG2000) whilst wavelets and DCTs are only used for lossy encoding. Moving now to 2D; researchers found it very hard to extend Shannon’s ideas to higher dimensions without introducing an orientation dependence. Intuitively we might expect the Shannon information-entropy of an image to be independent of its orientation. We also expect images with complicated spatial structure (like the questioner’s random noise example) to have higher information-entropy than images with simple spatial structure (like the questioner’s smooth gray-scale example). It turns out that the reason it was so hard to extend Shannon’s ideas from 1D to 2D is that there is a (one-sided) asymmetry in Shannon’s original formulation that prevents a symmetric (isotropic) formulation in 2D. Once the 1D asymmetry is corrected the 2D extension can proceed easily and naturally. Cutting to the chase (interested readers can check out the detailed exposition in the arXiv preprint at https://arxiv.org/abs/1609.01117 ) where the image entropy is computed from a 2D histogram of gradients (gradient probability density function). First the 2D pdf is computed by binning estimates of the images x and y derivatives. This resembles the binning operation used to generate the more common intensity histogram in 1D. The derivatives can be estimated by 2-pixel finite differences computed in the horizontal and vertical directions. For an NxN square image f(x,y) we compute NxN values of partial derivative fx and NxN values of fy. We scan through the differential image and for every pixel we use (fx,fy) to locate a discrete bin in the destination (2D pdf) array that is then incremented by one. We repeat for all NxN pixels. The resulting 2D pdf must be normalised to have overall unit probability (simply dividing by NxN achieves this). The 2D pdf is now ready for the next stage. The computation of the 2D Shannon information entropy from the 2D gradient pdf is simple. Shannon’s classic logarithmic summation formula applies directly except for a crucial factor of one half which originates from special bandlimited sampling considerations for a gradient image (see arXiv paper for details). The half factor makes the computed 2D entropy even lower compared to other (more redundant) methods for estimating 2D entropy or lossless compression. I’m sorry I haven’t written the necessary equations down here but everything is available in the preprint text. The computations are direct (non-iterative) and the computational complexity is of order (the number of pixels) NxN . The final computed Shannon information-entropy is rotation independent and corresponds precisely with the number of bits required to encode the image in a non-redundant gradient representation. By the way, the new 2D entropy measure predicts an (intuitively pleasing) entropy of 8 bits per pixel for the random image and 0.000 bits per pixel for the smooth gradient image in the original question.
Entropy of an image
“What is the most information/physics-theoretical correct way to compute the entropy of an image?“ An excellent and timely question. Contrary to popular belief, it is indeed possible to define an intu
Entropy of an image “What is the most information/physics-theoretical correct way to compute the entropy of an image?“ An excellent and timely question. Contrary to popular belief, it is indeed possible to define an intuitively (and theoretically) natural information-entropy for an image. Consider the following figure: We can see that the differential image has a more compact histogram, therefore its Shannon information-entropy is lower. So we can get lower redundancy by using second order Shannon entropy (i.e. entropy derived from differential data). If we can extend this idea isotropically into 2D, then we might expect good estimates for image information-entropy. A two dimensional histogram of gradients allows the 2D extension. We can formalise the arguments and, indeed, this has been completed recently. Recapping briefly: The observation that the simple definition (see for example MATLAB’s definition of image entropy) ignores spatial structure is crucial. To understand what is going on it is worth returning to the 1D case briefly. It has been long known that using the histogram of a signal to compute its Shannon information/entropy ignores the temporal or spatial structure and gives a poor estimate of the signal’s inherent compressibility or redundancy. The solution was already available in Shannon’s classic text; use the second order properties of the signal, i.e. transition probabilities. The observation in 1971 (Rice & Plaunt) that the best predictor of a pixel value in a raster scan is the value of the preceding pixel immediately leads to a differential predictor and a second order Shannon entropy that aligns with simple compression ideas such as run length encoding. These ideas were refined in the late 80s resulting in some classic lossless image (differential) coding techniques that are still in use (PNG, lossless JPG, GIF, lossless JPG2000) whilst wavelets and DCTs are only used for lossy encoding. Moving now to 2D; researchers found it very hard to extend Shannon’s ideas to higher dimensions without introducing an orientation dependence. Intuitively we might expect the Shannon information-entropy of an image to be independent of its orientation. We also expect images with complicated spatial structure (like the questioner’s random noise example) to have higher information-entropy than images with simple spatial structure (like the questioner’s smooth gray-scale example). It turns out that the reason it was so hard to extend Shannon’s ideas from 1D to 2D is that there is a (one-sided) asymmetry in Shannon’s original formulation that prevents a symmetric (isotropic) formulation in 2D. Once the 1D asymmetry is corrected the 2D extension can proceed easily and naturally. Cutting to the chase (interested readers can check out the detailed exposition in the arXiv preprint at https://arxiv.org/abs/1609.01117 ) where the image entropy is computed from a 2D histogram of gradients (gradient probability density function). First the 2D pdf is computed by binning estimates of the images x and y derivatives. This resembles the binning operation used to generate the more common intensity histogram in 1D. The derivatives can be estimated by 2-pixel finite differences computed in the horizontal and vertical directions. For an NxN square image f(x,y) we compute NxN values of partial derivative fx and NxN values of fy. We scan through the differential image and for every pixel we use (fx,fy) to locate a discrete bin in the destination (2D pdf) array that is then incremented by one. We repeat for all NxN pixels. The resulting 2D pdf must be normalised to have overall unit probability (simply dividing by NxN achieves this). The 2D pdf is now ready for the next stage. The computation of the 2D Shannon information entropy from the 2D gradient pdf is simple. Shannon’s classic logarithmic summation formula applies directly except for a crucial factor of one half which originates from special bandlimited sampling considerations for a gradient image (see arXiv paper for details). The half factor makes the computed 2D entropy even lower compared to other (more redundant) methods for estimating 2D entropy or lossless compression. I’m sorry I haven’t written the necessary equations down here but everything is available in the preprint text. The computations are direct (non-iterative) and the computational complexity is of order (the number of pixels) NxN . The final computed Shannon information-entropy is rotation independent and corresponds precisely with the number of bits required to encode the image in a non-redundant gradient representation. By the way, the new 2D entropy measure predicts an (intuitively pleasing) entropy of 8 bits per pixel for the random image and 0.000 bits per pixel for the smooth gradient image in the original question.
Entropy of an image “What is the most information/physics-theoretical correct way to compute the entropy of an image?“ An excellent and timely question. Contrary to popular belief, it is indeed possible to define an intu
5,454
Entropy of an image
There is none, it all depends on the context and your prior information. Entropy has many interpretations such as "measurement of order" or "measurement of information", but instead of looking at the interpretations you could just look at what it actually is. Entropy is just a way of expressing the number of states of a system. A system with many states has a high entropy, and a system with few states has a low entropy. You, and the article you link to - states that the two images have the same entropy. This is not correct (for me). The article correctly calculates the entropy is. $$ H = - \sum_k p_k log_2(p_k) $$ For the first image any pixel can have any gray value, $$p_k = \frac{1}{M} = 2^{-n}$$ Therefore the entropy is: $$ H = - \sum_k p_k log_2(p_k) = - \sum_k 2^{-n} log_2(2^{-n}) = - log_2(2^{-n}) = n $$ However, This is not the case for the second image. The entropy can still be calculated as: $$ H = - \sum_k p_k log_2(p_k) $$ but you can not simple say $p_k = \frac{1}{M} = 2^{-n}$, because when you have found $p_1$ to be a value, you know that $p_2, p_3, p_4 \ldots p_{many}$ is the same value. Therefore, the two images do not have the same entropy. It might sound counter intuitive that entropy depends on how you look at the problem. However, you probably know it from compression. The maximum compression of a file is dictated by the Shannon's source coding theorem which sets an upper limit for how well a compression algorithm can compress a file. This limit depends on the entropy of the file. All modern compressors will compress a file close to this limit. However, if you know the file is an audio file you can compress it using FLAC instead of some generic compressor. FLAC is lossless so all information is preserved. FLAC can not get around the Shannon's source coding theorem, that's math, but it can look at the file in a way which reduces the entropy of the file, thus do a better compression. Identically, when I look at you second image I see that the pixels are sorted by gray value, and therefore it doesn't have the same entropy to me as the image with random noise.
Entropy of an image
There is none, it all depends on the context and your prior information. Entropy has many interpretations such as "measurement of order" or "measurement of information", but instead of looking at the
Entropy of an image There is none, it all depends on the context and your prior information. Entropy has many interpretations such as "measurement of order" or "measurement of information", but instead of looking at the interpretations you could just look at what it actually is. Entropy is just a way of expressing the number of states of a system. A system with many states has a high entropy, and a system with few states has a low entropy. You, and the article you link to - states that the two images have the same entropy. This is not correct (for me). The article correctly calculates the entropy is. $$ H = - \sum_k p_k log_2(p_k) $$ For the first image any pixel can have any gray value, $$p_k = \frac{1}{M} = 2^{-n}$$ Therefore the entropy is: $$ H = - \sum_k p_k log_2(p_k) = - \sum_k 2^{-n} log_2(2^{-n}) = - log_2(2^{-n}) = n $$ However, This is not the case for the second image. The entropy can still be calculated as: $$ H = - \sum_k p_k log_2(p_k) $$ but you can not simple say $p_k = \frac{1}{M} = 2^{-n}$, because when you have found $p_1$ to be a value, you know that $p_2, p_3, p_4 \ldots p_{many}$ is the same value. Therefore, the two images do not have the same entropy. It might sound counter intuitive that entropy depends on how you look at the problem. However, you probably know it from compression. The maximum compression of a file is dictated by the Shannon's source coding theorem which sets an upper limit for how well a compression algorithm can compress a file. This limit depends on the entropy of the file. All modern compressors will compress a file close to this limit. However, if you know the file is an audio file you can compress it using FLAC instead of some generic compressor. FLAC is lossless so all information is preserved. FLAC can not get around the Shannon's source coding theorem, that's math, but it can look at the file in a way which reduces the entropy of the file, thus do a better compression. Identically, when I look at you second image I see that the pixels are sorted by gray value, and therefore it doesn't have the same entropy to me as the image with random noise.
Entropy of an image There is none, it all depends on the context and your prior information. Entropy has many interpretations such as "measurement of order" or "measurement of information", but instead of looking at the
5,455
Entropy of an image
Essentially the idea of entropy is something like "number of micro-states consistent with the macrostate". I think the comment by sean507 and the answer by bottiger both point to a common framework. If you represent the image space by a generative model, $p[\,I,h\,]$, then for a given image $I$ you can (in principle) compute a posterior over the hidden states $p[\,h\mid I\,]$ (see also here). Then you can (in principle) compute the entropy of the posterior. So I would agree that any "entropy", even in the "most theoretically correct sense", would seem to depend on both the representation used, and the generative model linking "microstates" ($h$) to "macrostates" ($I$).
Entropy of an image
Essentially the idea of entropy is something like "number of micro-states consistent with the macrostate". I think the comment by sean507 and the answer by bottiger both point to a common framework. I
Entropy of an image Essentially the idea of entropy is something like "number of micro-states consistent with the macrostate". I think the comment by sean507 and the answer by bottiger both point to a common framework. If you represent the image space by a generative model, $p[\,I,h\,]$, then for a given image $I$ you can (in principle) compute a posterior over the hidden states $p[\,h\mid I\,]$ (see also here). Then you can (in principle) compute the entropy of the posterior. So I would agree that any "entropy", even in the "most theoretically correct sense", would seem to depend on both the representation used, and the generative model linking "microstates" ($h$) to "macrostates" ($I$).
Entropy of an image Essentially the idea of entropy is something like "number of micro-states consistent with the macrostate". I think the comment by sean507 and the answer by bottiger both point to a common framework. I
5,456
Entropy of an image
$$ H = - \sum_k p_k log_2(p_k) $$ does NOT work in practice, for the simple reason that it's almost impossible to determine $P_k$. You think that you can do it, as you've done by considering the number of grey levels. Pk is not that. Pk is all possible combinations of grey levels. So you have to create a multi dimensional probability tree considering 1, 2, 3... combinations of pixels. If you read Shannon's work you see him do this calculation for plain English considering a tree depth of 3 letters. It then gets unwieldy without a computer. You proved this yourself with statement 2. That's why your entropy calculation returns the same level of entropy for the two images, even though one is clearly less ordered than the other. There is also no such concept of spatial distribution within entropy calculation. If there was, you'd also have to calculate entropy differently for temporally distributed samples. And what would you do for an 11 dimensional data array? For informational entropy; it is measured in bytes. Just simply compress the images using a compression algorithm. It will output an estimate of the entropy in bytes. It will do this for any image or literally anything else that can be digitised, such as music or Shakespearean plays. So. Your random image contains approximately 114 KBytes, and your ordered image contains approximately 2.2 KBytes. This is what you'd expect, but you already knew this kinda because you saw the image file sizes were of this size. I have reduced the compressed size by 33% to allow for future improvements in compression algorithms. I can't see them improving beyond this as the improvement curve is becoming asymptotic to a true underlying value. P.S. For interest, Shakespeare only produced 1 MByte of entropy in his entire life's work, calculated by this technique. Most of it's quite good though.
Entropy of an image
$$ H = - \sum_k p_k log_2(p_k) $$ does NOT work in practice, for the simple reason that it's almost impossible to determine $P_k$. You think that you can do it, as you've done by considering the numb
Entropy of an image $$ H = - \sum_k p_k log_2(p_k) $$ does NOT work in practice, for the simple reason that it's almost impossible to determine $P_k$. You think that you can do it, as you've done by considering the number of grey levels. Pk is not that. Pk is all possible combinations of grey levels. So you have to create a multi dimensional probability tree considering 1, 2, 3... combinations of pixels. If you read Shannon's work you see him do this calculation for plain English considering a tree depth of 3 letters. It then gets unwieldy without a computer. You proved this yourself with statement 2. That's why your entropy calculation returns the same level of entropy for the two images, even though one is clearly less ordered than the other. There is also no such concept of spatial distribution within entropy calculation. If there was, you'd also have to calculate entropy differently for temporally distributed samples. And what would you do for an 11 dimensional data array? For informational entropy; it is measured in bytes. Just simply compress the images using a compression algorithm. It will output an estimate of the entropy in bytes. It will do this for any image or literally anything else that can be digitised, such as music or Shakespearean plays. So. Your random image contains approximately 114 KBytes, and your ordered image contains approximately 2.2 KBytes. This is what you'd expect, but you already knew this kinda because you saw the image file sizes were of this size. I have reduced the compressed size by 33% to allow for future improvements in compression algorithms. I can't see them improving beyond this as the improvement curve is becoming asymptotic to a true underlying value. P.S. For interest, Shakespeare only produced 1 MByte of entropy in his entire life's work, calculated by this technique. Most of it's quite good though.
Entropy of an image $$ H = - \sum_k p_k log_2(p_k) $$ does NOT work in practice, for the simple reason that it's almost impossible to determine $P_k$. You think that you can do it, as you've done by considering the numb
5,457
Entropy of an image
The entropy of an image can be computed generalizing classical 1D methods to the 2D case. Obviously it must take into account “spatial information”, not just gray levels. Classical approaches used in 1D systems take into account, at least potentially, configurations at all the scales (all the n-grams, also for very large n). The fact that the correct Shannon entropy (of a sequence, or of an image) can be estimated only considering all the possible "n-grams" is a key point that did not sufficiently permeate the literature of image processing. This fundamental idea can be found in the seminal paper "Prediction and entropy of printed English" of Shannon (1952), and it is at the base of the classical methods used for 1D systems, that can be found in: T. Schürmann and P. Grassberger, "Entropy estimation of symbol sequences", Chaos 6, 414 (1996). A recent analysis of 2D generalisations of these methods can be found in: F.N.M. de Sousa Filho, V. G. Pereira de Sá, and E. Brigatti, "Entropy estimation in bidimensional sequences", Phys. Rev E, 105, 054116 (2022): https://www.researchgate.net/publication/361742112_Entropy_estimation_in_bidimensional_sequences where the block-entropies method and lossless compression methods are taken into account.
Entropy of an image
The entropy of an image can be computed generalizing classical 1D methods to the 2D case. Obviously it must take into account “spatial information”, not just gray levels. Classical approaches used in
Entropy of an image The entropy of an image can be computed generalizing classical 1D methods to the 2D case. Obviously it must take into account “spatial information”, not just gray levels. Classical approaches used in 1D systems take into account, at least potentially, configurations at all the scales (all the n-grams, also for very large n). The fact that the correct Shannon entropy (of a sequence, or of an image) can be estimated only considering all the possible "n-grams" is a key point that did not sufficiently permeate the literature of image processing. This fundamental idea can be found in the seminal paper "Prediction and entropy of printed English" of Shannon (1952), and it is at the base of the classical methods used for 1D systems, that can be found in: T. Schürmann and P. Grassberger, "Entropy estimation of symbol sequences", Chaos 6, 414 (1996). A recent analysis of 2D generalisations of these methods can be found in: F.N.M. de Sousa Filho, V. G. Pereira de Sá, and E. Brigatti, "Entropy estimation in bidimensional sequences", Phys. Rev E, 105, 054116 (2022): https://www.researchgate.net/publication/361742112_Entropy_estimation_in_bidimensional_sequences where the block-entropies method and lossless compression methods are taken into account.
Entropy of an image The entropy of an image can be computed generalizing classical 1D methods to the 2D case. Obviously it must take into account “spatial information”, not just gray levels. Classical approaches used in
5,458
Where to start with statistics for an experienced developer
I would suggest you a basic road-map about how to go about it: You can brush up basic math and stats at Khan Academy, and/or take the Intro to Statistics course by Udacity. Then, you can take these two nice courses of Udacity. Descriptive Statistics and Inferential Statistics Then, you can dive into some Bayesian stats. And one of the best-related resource on the web which I have found is the Think Bayes free e-book Then, dive into the basics of Machine Learning. Coursera's Andrew Ng's course is the perfect start. And this resource: Machine Learning for developers is also very useful for skimming through the concepts quickly. Then, you are on your own. You have enough resources and blogs on the internet for building up on these concepts. Bonus: A wonderful site for such road maps is Metacademy, which I personally would vouch as one of the best Data Science resources on the web. Gitxiv is another beautiful site, which connects the Arxiv research papers on Data Science with the relevant open source implementations/libraries.
Where to start with statistics for an experienced developer
I would suggest you a basic road-map about how to go about it: You can brush up basic math and stats at Khan Academy, and/or take the Intro to Statistics course by Udacity. Then, you can take these t
Where to start with statistics for an experienced developer I would suggest you a basic road-map about how to go about it: You can brush up basic math and stats at Khan Academy, and/or take the Intro to Statistics course by Udacity. Then, you can take these two nice courses of Udacity. Descriptive Statistics and Inferential Statistics Then, you can dive into some Bayesian stats. And one of the best-related resource on the web which I have found is the Think Bayes free e-book Then, dive into the basics of Machine Learning. Coursera's Andrew Ng's course is the perfect start. And this resource: Machine Learning for developers is also very useful for skimming through the concepts quickly. Then, you are on your own. You have enough resources and blogs on the internet for building up on these concepts. Bonus: A wonderful site for such road maps is Metacademy, which I personally would vouch as one of the best Data Science resources on the web. Gitxiv is another beautiful site, which connects the Arxiv research papers on Data Science with the relevant open source implementations/libraries.
Where to start with statistics for an experienced developer I would suggest you a basic road-map about how to go about it: You can brush up basic math and stats at Khan Academy, and/or take the Intro to Statistics course by Udacity. Then, you can take these t
5,459
Where to start with statistics for an experienced developer
Have you checked out either Think Stats or Think Bayes--they are both (free) stats books geared towards programmers and with plenty of Python code. Also, if you're interested in learning R then CRAN has a lot of (free) pdfs that you might want to check out, such as Introduction to Probability and Statistics Using R. There's also a Coursera course that uses R which a lot of people really love (they use this textbook, which you might want to check out as well, and have labs on DataCamp, I believe). Also, if you want to brush up on a few Stats topics you can always watch a couple videos on Khan Academy.
Where to start with statistics for an experienced developer
Have you checked out either Think Stats or Think Bayes--they are both (free) stats books geared towards programmers and with plenty of Python code. Also, if you're interested in learning R then CRAN h
Where to start with statistics for an experienced developer Have you checked out either Think Stats or Think Bayes--they are both (free) stats books geared towards programmers and with plenty of Python code. Also, if you're interested in learning R then CRAN has a lot of (free) pdfs that you might want to check out, such as Introduction to Probability and Statistics Using R. There's also a Coursera course that uses R which a lot of people really love (they use this textbook, which you might want to check out as well, and have labs on DataCamp, I believe). Also, if you want to brush up on a few Stats topics you can always watch a couple videos on Khan Academy.
Where to start with statistics for an experienced developer Have you checked out either Think Stats or Think Bayes--they are both (free) stats books geared towards programmers and with plenty of Python code. Also, if you're interested in learning R then CRAN h
5,460
Where to start with statistics for an experienced developer
If you were ever, even in distant past, able to solve problems in this list, then you should attempt to study applied stats "properly". I'll give you a simple two step algorithm. First, get up to speed with probability theory. There are many great books. My favorite is the classic book by Feller. It's called "Introduction" but don't be fooled by the title, it's as deep as you wish to go, yet very well written and simple if you just want to skim the surface. The second step is statistics. Again, there's a ton of great books. I'll give you one that I used, a decent intro text by Gujarati "Basic Econometrics", Fourth Edition. Econometrics is statistics applied to economics. For a reference, a guy who everyone thinks said that data scientist is going to be a sexiest job in next 10 years is Hal Varian, a Berkeley economist. A lot of machine learning stuff is based on basic statistics, regressions etc. All that is covered in this book, and you don't need to read it all, it's written in a way that you can pick chapters in your own order. You'll be surprised to see how many gaps left open after Ng's class are filling out quickly while reading these texts. As a practitioner, you don't need too much theory after these two steps. You can keep learning ML techniques specifically reading the books in this field. It's important not to get too deep in the beginning into probability and stats. Get your code going for ML first, and fill in the gaps as you go.
Where to start with statistics for an experienced developer
If you were ever, even in distant past, able to solve problems in this list, then you should attempt to study applied stats "properly". I'll give you a simple two step algorithm. First, get up to spee
Where to start with statistics for an experienced developer If you were ever, even in distant past, able to solve problems in this list, then you should attempt to study applied stats "properly". I'll give you a simple two step algorithm. First, get up to speed with probability theory. There are many great books. My favorite is the classic book by Feller. It's called "Introduction" but don't be fooled by the title, it's as deep as you wish to go, yet very well written and simple if you just want to skim the surface. The second step is statistics. Again, there's a ton of great books. I'll give you one that I used, a decent intro text by Gujarati "Basic Econometrics", Fourth Edition. Econometrics is statistics applied to economics. For a reference, a guy who everyone thinks said that data scientist is going to be a sexiest job in next 10 years is Hal Varian, a Berkeley economist. A lot of machine learning stuff is based on basic statistics, regressions etc. All that is covered in this book, and you don't need to read it all, it's written in a way that you can pick chapters in your own order. You'll be surprised to see how many gaps left open after Ng's class are filling out quickly while reading these texts. As a practitioner, you don't need too much theory after these two steps. You can keep learning ML techniques specifically reading the books in this field. It's important not to get too deep in the beginning into probability and stats. Get your code going for ML first, and fill in the gaps as you go.
Where to start with statistics for an experienced developer If you were ever, even in distant past, able to solve problems in this list, then you should attempt to study applied stats "properly". I'll give you a simple two step algorithm. First, get up to spee
5,461
Where to start with statistics for an experienced developer
Everyone is recommending Casella & Berger, which is almost universally used in graduate statistics programs. It's not a bad reference book, but I'm not sure I'd do more than scan the first 4-5 chapters. I don't think you need the theory of how to construct a Neyman-Pearson type test before delving into "statistics" i.e. data analysis. Instead, I would focus on learning methods. My graduate program used Applied Linear Statistical Methods for the frequentist tests, and it's a pretty decent comprehensive reference, but might not be the most approachable book from a self-teaching standpoint. A course or two from MIT or coursera might be a better way to start in on that, because you'll get a broader overview with more examples than you might from reading a book. For Bayes, the book I've seen used most often is Doing Bayesian Data Analysis, which comes with puppy pictures (clearly, this makes the book superior to other Bayesian introductory textbooks). I've never used the book myself, but I've paged through it and it seems pretty decent - much better than Gelman's book, which I found somewhat incomprehensible AFTER two classes in Bayesian statistics - the explanations are terrible.
Where to start with statistics for an experienced developer
Everyone is recommending Casella & Berger, which is almost universally used in graduate statistics programs. It's not a bad reference book, but I'm not sure I'd do more than scan the first 4-5 chapter
Where to start with statistics for an experienced developer Everyone is recommending Casella & Berger, which is almost universally used in graduate statistics programs. It's not a bad reference book, but I'm not sure I'd do more than scan the first 4-5 chapters. I don't think you need the theory of how to construct a Neyman-Pearson type test before delving into "statistics" i.e. data analysis. Instead, I would focus on learning methods. My graduate program used Applied Linear Statistical Methods for the frequentist tests, and it's a pretty decent comprehensive reference, but might not be the most approachable book from a self-teaching standpoint. A course or two from MIT or coursera might be a better way to start in on that, because you'll get a broader overview with more examples than you might from reading a book. For Bayes, the book I've seen used most often is Doing Bayesian Data Analysis, which comes with puppy pictures (clearly, this makes the book superior to other Bayesian introductory textbooks). I've never used the book myself, but I've paged through it and it seems pretty decent - much better than Gelman's book, which I found somewhat incomprehensible AFTER two classes in Bayesian statistics - the explanations are terrible.
Where to start with statistics for an experienced developer Everyone is recommending Casella & Berger, which is almost universally used in graduate statistics programs. It's not a bad reference book, but I'm not sure I'd do more than scan the first 4-5 chapter
5,462
Where to start with statistics for an experienced developer
This is not intended to be a complete answer, it's just a suggestion. If you want to learn more about statistics (the foundation), you could read: Casella, G. and R. L. Berger (2002): Statistical Inference, Duxbury This is a pretty standard book for statisticians and it has a lot of interesting results. You don't need to go through all the proofs of the theorems, but you might want to do some exercises in order to feel more secure with the results. If you want to learn more about econometrics (models for data), you could take a look at: Hayashi, F. (2000): Econometrics, Princeton University Press Someone else actually asked something similar to what you asked and got a nice answer: What to do after "Casella & Berger". Furthermore, if you really intend on reading these books, this syllabus of an econometrics course can give you a quite good direction and pace on what to read (CB & Hayashi) and when to read.
Where to start with statistics for an experienced developer
This is not intended to be a complete answer, it's just a suggestion. If you want to learn more about statistics (the foundation), you could read: Casella, G. and R. L. Berger (2002): Statistical Infe
Where to start with statistics for an experienced developer This is not intended to be a complete answer, it's just a suggestion. If you want to learn more about statistics (the foundation), you could read: Casella, G. and R. L. Berger (2002): Statistical Inference, Duxbury This is a pretty standard book for statisticians and it has a lot of interesting results. You don't need to go through all the proofs of the theorems, but you might want to do some exercises in order to feel more secure with the results. If you want to learn more about econometrics (models for data), you could take a look at: Hayashi, F. (2000): Econometrics, Princeton University Press Someone else actually asked something similar to what you asked and got a nice answer: What to do after "Casella & Berger". Furthermore, if you really intend on reading these books, this syllabus of an econometrics course can give you a quite good direction and pace on what to read (CB & Hayashi) and when to read.
Where to start with statistics for an experienced developer This is not intended to be a complete answer, it's just a suggestion. If you want to learn more about statistics (the foundation), you could read: Casella, G. and R. L. Berger (2002): Statistical Infe
5,463
Where to start with statistics for an experienced developer
I'd suggest a new book that came out since the original question: Statistical Rethinking: A Bayesian Course with Examples in R and Stan by Richard McElreath, CRC Press. It's very well written and uses a Bayesian approach. It's very interactive, and you'll want to work the problems or you may get halfway through and begin to get lost. It starts very basic and ends up with multi-level models, and it's aimed at fairly advanced scientists who have some statistical knowledge but don't feel comfortable overall with statistics as it was taught to them. So I can't exactly say it's a beginner's book, but it does start very simply and he has a wonderful arc and style. The "Stan" part of the title is a general-purpose Bayesian sampling tool. Essentially, it's a programming language that compiles automatically to C++ and then gets compiled to an executable. (Bayesian inference is general, unlike alternatives, so you can have a generalized tool.)
Where to start with statistics for an experienced developer
I'd suggest a new book that came out since the original question: Statistical Rethinking: A Bayesian Course with Examples in R and Stan by Richard McElreath, CRC Press. It's very well written and uses
Where to start with statistics for an experienced developer I'd suggest a new book that came out since the original question: Statistical Rethinking: A Bayesian Course with Examples in R and Stan by Richard McElreath, CRC Press. It's very well written and uses a Bayesian approach. It's very interactive, and you'll want to work the problems or you may get halfway through and begin to get lost. It starts very basic and ends up with multi-level models, and it's aimed at fairly advanced scientists who have some statistical knowledge but don't feel comfortable overall with statistics as it was taught to them. So I can't exactly say it's a beginner's book, but it does start very simply and he has a wonderful arc and style. The "Stan" part of the title is a general-purpose Bayesian sampling tool. Essentially, it's a programming language that compiles automatically to C++ and then gets compiled to an executable. (Bayesian inference is general, unlike alternatives, so you can have a generalized tool.)
Where to start with statistics for an experienced developer I'd suggest a new book that came out since the original question: Statistical Rethinking: A Bayesian Course with Examples in R and Stan by Richard McElreath, CRC Press. It's very well written and uses
5,464
Where to start with statistics for an experienced developer
Figured I'd throw this answer in for posterity, even if it's likely too late to be useful to you. Larry Wasserman's All Of Statistics was conceived as a course for people with a background in machine learning, other comp sci disciplines, or math who didn't have any formal statistics training -- i.e., people in pretty much exactly your current situation. Having a similar lack of formal stats, a few friends and I formed a self-study group to go through it in grad school. I think I really benefited from that experience. The extra topics Wasserman throws in beyond the typical "probability and statistical inference" course material, like graphical models and bootstrapping, are particularly relevant to someone working in machine learning. I should say that the book can be pretty terse compared to something like Casella & Berger, so if you want more detail or motivation for certain parts (especially proofs) you may have to supplement it with other reading material. That said, I also found the book to be clearly-written with a good number of practice problems, and it's an excellent quick reference. One month is not a lot of time. If you set a very aggressive pace, though, I think you can certainly get a lot out of this text in one semester: we did our self-study group over the summer, for instance. That's especially true if you're mostly interested in linear modeling, which you'll hit by Ch. 13-14.
Where to start with statistics for an experienced developer
Figured I'd throw this answer in for posterity, even if it's likely too late to be useful to you. Larry Wasserman's All Of Statistics was conceived as a course for people with a background in machine
Where to start with statistics for an experienced developer Figured I'd throw this answer in for posterity, even if it's likely too late to be useful to you. Larry Wasserman's All Of Statistics was conceived as a course for people with a background in machine learning, other comp sci disciplines, or math who didn't have any formal statistics training -- i.e., people in pretty much exactly your current situation. Having a similar lack of formal stats, a few friends and I formed a self-study group to go through it in grad school. I think I really benefited from that experience. The extra topics Wasserman throws in beyond the typical "probability and statistical inference" course material, like graphical models and bootstrapping, are particularly relevant to someone working in machine learning. I should say that the book can be pretty terse compared to something like Casella & Berger, so if you want more detail or motivation for certain parts (especially proofs) you may have to supplement it with other reading material. That said, I also found the book to be clearly-written with a good number of practice problems, and it's an excellent quick reference. One month is not a lot of time. If you set a very aggressive pace, though, I think you can certainly get a lot out of this text in one semester: we did our self-study group over the summer, for instance. That's especially true if you're mostly interested in linear modeling, which you'll hit by Ch. 13-14.
Where to start with statistics for an experienced developer Figured I'd throw this answer in for posterity, even if it's likely too late to be useful to you. Larry Wasserman's All Of Statistics was conceived as a course for people with a background in machine
5,465
Latent Class Analysis vs. Cluster Analysis - differences in inferences?
Latent Class Analysis is in fact an Finite Mixture Model (see here). The main difference between FMM and other clustering algorithms is that FMM's offer you a "model-based clustering" approach that derives clusters using a probabilistic model that describes distribution of your data. So instead of finding clusters with some arbitrary chosen distance measure, you use a model that describes distribution of your data and based on this model you assess probabilities that certain cases are members of certain latent classes. So you could say that it is a top-down approach (you start with describing distribution of your data) while other clustering algorithms are rather bottom-up approaches (you find similarities between cases). Because you use a statistical model for your data model selection and assessing goodness of fit are possible - contrary to clustering. Also, if you assume that there is some process or "latent structure" that underlies structure of your data then FMM's seem to be a appropriate choice since they enable you to model the latent structure behind your data (rather then just looking for similarities). Other difference is that FMM's are more flexible than clustering. Clustering algorithms just do clustering, while there are FMM- and LCA-based models that enable you to do confirmatory, between-groups analysis, combine Item Response Theory (and other) models with LCA, include covariates to predict individuals' latent class membership, and/or even within-cluster regression models in latent-class regression, enable you to model changes over time in structure of your data etc. For more examples see: Hagenaars J.A. & McCutcheon, A.L. (2009). Applied Latent Class Analysis. Cambridge University Press. and the documentation of flexmix and poLCA packages in R, including the following papers: Linzer, D. A., & Lewis, J. B. (2011). poLCA: An R package for polytomous variable latent class analysis. Journal of Statistical Software, 42(10), 1-29. Leisch, F. (2004). Flexmix: A general framework for finite mixture models and latent glass regression in R. Journal of Statistical Software, 11(8), 1-18. Grün, B., & Leisch, F. (2008). FlexMix version 2: finite mixtures with concomitant variables and varying and constant parameters. Journal of Statistical Software, 28(4), 1-35.
Latent Class Analysis vs. Cluster Analysis - differences in inferences?
Latent Class Analysis is in fact an Finite Mixture Model (see here). The main difference between FMM and other clustering algorithms is that FMM's offer you a "model-based clustering" approach that de
Latent Class Analysis vs. Cluster Analysis - differences in inferences? Latent Class Analysis is in fact an Finite Mixture Model (see here). The main difference between FMM and other clustering algorithms is that FMM's offer you a "model-based clustering" approach that derives clusters using a probabilistic model that describes distribution of your data. So instead of finding clusters with some arbitrary chosen distance measure, you use a model that describes distribution of your data and based on this model you assess probabilities that certain cases are members of certain latent classes. So you could say that it is a top-down approach (you start with describing distribution of your data) while other clustering algorithms are rather bottom-up approaches (you find similarities between cases). Because you use a statistical model for your data model selection and assessing goodness of fit are possible - contrary to clustering. Also, if you assume that there is some process or "latent structure" that underlies structure of your data then FMM's seem to be a appropriate choice since they enable you to model the latent structure behind your data (rather then just looking for similarities). Other difference is that FMM's are more flexible than clustering. Clustering algorithms just do clustering, while there are FMM- and LCA-based models that enable you to do confirmatory, between-groups analysis, combine Item Response Theory (and other) models with LCA, include covariates to predict individuals' latent class membership, and/or even within-cluster regression models in latent-class regression, enable you to model changes over time in structure of your data etc. For more examples see: Hagenaars J.A. & McCutcheon, A.L. (2009). Applied Latent Class Analysis. Cambridge University Press. and the documentation of flexmix and poLCA packages in R, including the following papers: Linzer, D. A., & Lewis, J. B. (2011). poLCA: An R package for polytomous variable latent class analysis. Journal of Statistical Software, 42(10), 1-29. Leisch, F. (2004). Flexmix: A general framework for finite mixture models and latent glass regression in R. Journal of Statistical Software, 11(8), 1-18. Grün, B., & Leisch, F. (2008). FlexMix version 2: finite mixtures with concomitant variables and varying and constant parameters. Journal of Statistical Software, 28(4), 1-35.
Latent Class Analysis vs. Cluster Analysis - differences in inferences? Latent Class Analysis is in fact an Finite Mixture Model (see here). The main difference between FMM and other clustering algorithms is that FMM's offer you a "model-based clustering" approach that de
5,466
Latent Class Analysis vs. Cluster Analysis - differences in inferences?
The difference is Latent Class Analysis would use hidden data (which is usually patterns of association in the features) to determine probabilities for features in the class. Then inferences can be made using maximum likelihood to separate items into classes based on their features. Cluster analysis plots the features and uses algorithms such as nearest neighbors, density, or hierarchy to determine which classes an item belongs to. Basically LCA inference can be thought of as "what is the most similar patterns using probability" and Cluster analysis would be "what is the closest thing using distance".
Latent Class Analysis vs. Cluster Analysis - differences in inferences?
The difference is Latent Class Analysis would use hidden data (which is usually patterns of association in the features) to determine probabilities for features in the class. Then inferences can be ma
Latent Class Analysis vs. Cluster Analysis - differences in inferences? The difference is Latent Class Analysis would use hidden data (which is usually patterns of association in the features) to determine probabilities for features in the class. Then inferences can be made using maximum likelihood to separate items into classes based on their features. Cluster analysis plots the features and uses algorithms such as nearest neighbors, density, or hierarchy to determine which classes an item belongs to. Basically LCA inference can be thought of as "what is the most similar patterns using probability" and Cluster analysis would be "what is the closest thing using distance".
Latent Class Analysis vs. Cluster Analysis - differences in inferences? The difference is Latent Class Analysis would use hidden data (which is usually patterns of association in the features) to determine probabilities for features in the class. Then inferences can be ma
5,467
Latent Class Analysis vs. Cluster Analysis - differences in inferences?
A latent class model (or latent profile, or more generally, a finite mixture model) can be thought of as a probablistic model for clustering (or unsupervised classification). The goal is generally the same - to identify homogenous groups within a larger population. I think the main differences between latent class models and algorithmic approaches to clustering are that the former obviously lends itself to more theoretical speculation about the nature of the clustering; and because the latent class model is probablistic, it gives additional alternatives for assessing model fit via likelihood statistics, and better captures/retains uncertainty in the classification. You might find some useful tidbits in this thread, as well as this answer on a related post by chl. There are also parallels (on a conceptual level) with this question about PCA vs factor analysis, and this one too.
Latent Class Analysis vs. Cluster Analysis - differences in inferences?
A latent class model (or latent profile, or more generally, a finite mixture model) can be thought of as a probablistic model for clustering (or unsupervised classification). The goal is generally the
Latent Class Analysis vs. Cluster Analysis - differences in inferences? A latent class model (or latent profile, or more generally, a finite mixture model) can be thought of as a probablistic model for clustering (or unsupervised classification). The goal is generally the same - to identify homogenous groups within a larger population. I think the main differences between latent class models and algorithmic approaches to clustering are that the former obviously lends itself to more theoretical speculation about the nature of the clustering; and because the latent class model is probablistic, it gives additional alternatives for assessing model fit via likelihood statistics, and better captures/retains uncertainty in the classification. You might find some useful tidbits in this thread, as well as this answer on a related post by chl. There are also parallels (on a conceptual level) with this question about PCA vs factor analysis, and this one too.
Latent Class Analysis vs. Cluster Analysis - differences in inferences? A latent class model (or latent profile, or more generally, a finite mixture model) can be thought of as a probablistic model for clustering (or unsupervised classification). The goal is generally the
5,468
What is it meant with the $\sigma$-algebra generated by a random variable?
Consider a random variable $X$. We know that $X$ is nothing but a measurable function from $\left(\Omega, \mathcal{A} \right)$ into $\left(\mathbb{R}, \mathcal{B}(\mathbb{R}) \right)$, where $\mathcal{B}(\mathbb{R})$ are the Borel sets of the real line. By definition of measurability we know that we have $$X^{-1} \left(B \right) \in \mathcal{A}, \quad \forall B \in \mathcal{B}\left(\mathbb{R}\right)$$ But in practice the preimages of the Borel sets may not be all of $\mathcal{A}$ but instead they may constitute a much coarser subset of it. To see this, let us define $$\mathcal{\Sigma} = \left\{ S \in \mathcal{A}: S = X^{-1}(B), \ B \in \mathcal{B}(\mathbb{R}) \right\}$$ Using the properties of preimages, it is not too difficult to show that $\mathcal{\Sigma}$ is a sigma-algebra. It also follows immediately that $\mathcal{\Sigma} \subset \mathcal{A}$, hence $\mathcal{\Sigma}$ is a sub-sigma-algebra. Further, by the definitions it is easy to see that the mapping $X: \left( \Omega, \mathcal{\Sigma} \right) \to \left( \mathbb{R}, \mathcal{B} \left(\mathbb{R} \right) \right)$ is measurable. $\mathcal{\Sigma}$ is in fact the smallest sigma-algebra that makes $X$ a random variable as all other sigma-algebras of that kind would at the very least include $\mathcal{\Sigma}$. For the reason that we are dealing with preimages of the random variable $X$, we call $\mathcal{\Sigma}$ the sigma-algebra induced by the random variable $X$. Here is an extreme example: consider a constant random variable $X$, that is, $X(\omega) \equiv \alpha$. Then $X^{-1} \left(B \right), \ B \in \mathcal{B} \left(\mathbb{R} \right)$ equals either $\Omega$ or $\varnothing$ depending on whether $\alpha \in B$. The sigma-algebra thus generated is trivial and as such, it is definitely included in $\mathcal{A}$. Hope this helps.
What is it meant with the $\sigma$-algebra generated by a random variable?
Consider a random variable $X$. We know that $X$ is nothing but a measurable function from $\left(\Omega, \mathcal{A} \right)$ into $\left(\mathbb{R}, \mathcal{B}(\mathbb{R}) \right)$, where $\mathcal
What is it meant with the $\sigma$-algebra generated by a random variable? Consider a random variable $X$. We know that $X$ is nothing but a measurable function from $\left(\Omega, \mathcal{A} \right)$ into $\left(\mathbb{R}, \mathcal{B}(\mathbb{R}) \right)$, where $\mathcal{B}(\mathbb{R})$ are the Borel sets of the real line. By definition of measurability we know that we have $$X^{-1} \left(B \right) \in \mathcal{A}, \quad \forall B \in \mathcal{B}\left(\mathbb{R}\right)$$ But in practice the preimages of the Borel sets may not be all of $\mathcal{A}$ but instead they may constitute a much coarser subset of it. To see this, let us define $$\mathcal{\Sigma} = \left\{ S \in \mathcal{A}: S = X^{-1}(B), \ B \in \mathcal{B}(\mathbb{R}) \right\}$$ Using the properties of preimages, it is not too difficult to show that $\mathcal{\Sigma}$ is a sigma-algebra. It also follows immediately that $\mathcal{\Sigma} \subset \mathcal{A}$, hence $\mathcal{\Sigma}$ is a sub-sigma-algebra. Further, by the definitions it is easy to see that the mapping $X: \left( \Omega, \mathcal{\Sigma} \right) \to \left( \mathbb{R}, \mathcal{B} \left(\mathbb{R} \right) \right)$ is measurable. $\mathcal{\Sigma}$ is in fact the smallest sigma-algebra that makes $X$ a random variable as all other sigma-algebras of that kind would at the very least include $\mathcal{\Sigma}$. For the reason that we are dealing with preimages of the random variable $X$, we call $\mathcal{\Sigma}$ the sigma-algebra induced by the random variable $X$. Here is an extreme example: consider a constant random variable $X$, that is, $X(\omega) \equiv \alpha$. Then $X^{-1} \left(B \right), \ B \in \mathcal{B} \left(\mathbb{R} \right)$ equals either $\Omega$ or $\varnothing$ depending on whether $\alpha \in B$. The sigma-algebra thus generated is trivial and as such, it is definitely included in $\mathcal{A}$. Hope this helps.
What is it meant with the $\sigma$-algebra generated by a random variable? Consider a random variable $X$. We know that $X$ is nothing but a measurable function from $\left(\Omega, \mathcal{A} \right)$ into $\left(\mathbb{R}, \mathcal{B}(\mathbb{R}) \right)$, where $\mathcal
5,469
What is it meant with the $\sigma$-algebra generated by a random variable?
I will attempt to illustrate the intuition from a different perspective, less technically detailed. Assume 4 random variables $X_1,X_2,X_3$ and $Y=f(X_1,X_2)$ for an arbitrary function $f$. Notice that $Y$ is random, but it's determined completely for fixed $X_1, X_2$, while $X_3$ is not determined for fixed $X_1, X_2$. In other words, the randomness in $Y$ is exclusively due to $X_1$ and $X_2$. Can we express that formally without referencing the function $f$? This is precisely what the notion of the $\sigma$-algebra generated by a random variable captures. Informally, we could say that $\sigma(X)$ restricts the world's probabilism to just $X$, disabling any other source of randomness. In the example above, $\sigma((X_1,X_2))$ contains $\sigma(Y)$ (or $Y$ is $\sigma((X_1,X_2))$-measurable), because the randomness of $(X_1,X_2)$ contains the randomness of $Y$. The converse would be true only if $f$ is a one-to-one mapping.
What is it meant with the $\sigma$-algebra generated by a random variable?
I will attempt to illustrate the intuition from a different perspective, less technically detailed. Assume 4 random variables $X_1,X_2,X_3$ and $Y=f(X_1,X_2)$ for an arbitrary function $f$. Notice th
What is it meant with the $\sigma$-algebra generated by a random variable? I will attempt to illustrate the intuition from a different perspective, less technically detailed. Assume 4 random variables $X_1,X_2,X_3$ and $Y=f(X_1,X_2)$ for an arbitrary function $f$. Notice that $Y$ is random, but it's determined completely for fixed $X_1, X_2$, while $X_3$ is not determined for fixed $X_1, X_2$. In other words, the randomness in $Y$ is exclusively due to $X_1$ and $X_2$. Can we express that formally without referencing the function $f$? This is precisely what the notion of the $\sigma$-algebra generated by a random variable captures. Informally, we could say that $\sigma(X)$ restricts the world's probabilism to just $X$, disabling any other source of randomness. In the example above, $\sigma((X_1,X_2))$ contains $\sigma(Y)$ (or $Y$ is $\sigma((X_1,X_2))$-measurable), because the randomness of $(X_1,X_2)$ contains the randomness of $Y$. The converse would be true only if $f$ is a one-to-one mapping.
What is it meant with the $\sigma$-algebra generated by a random variable? I will attempt to illustrate the intuition from a different perspective, less technically detailed. Assume 4 random variables $X_1,X_2,X_3$ and $Y=f(X_1,X_2)$ for an arbitrary function $f$. Notice th
5,470
How are Random Forests not sensitive to outliers?
Your intuition is correct. This answer merely illustrates it on an example. It is indeed a common misconception that CART/RF are somehow robust to outliers. To illustrate the lack of robustness of RF to the presence of a single outliers, we can (lightly) modify the code used in Soren Havelund Welling's answer above to show that a single 'y'-outliers suffices to completely sway the fitted RF model. For example, if we compute the mean prediction error of the uncontaminated observations as a function of the distance between the outlier and the rest of the data, we can see (image below) that introducing a single outlier (by replacing one of the original observations by an arbitrary value on the 'y'-space) suffices to pull the predictions of the RF model arbitrarily far away from the values they would have had if computed on the original (uncontaminated) data: library(forestFloor) library(randomForest) library(rgl) set.seed(1) X = data.frame(replicate(2,runif(2000)-.5)) y = -sqrt((X[,1])^4+(X[,2])^4) X[1,]=c(0,0); y2<-y rg<-randomForest(X,y) #RF model fitted without the outlier outlier<-rel_prediction_error<-rep(NA,10) for(i in 1:10){ y2[1]=100*i+2 rf=randomForest(X,y2) #RF model fitted with the outlier rel_prediction_error[i]<-mean(abs(rf$predict[-1]-y2[-1]))/mean(abs(rg$predict[-1]-y[-1])) outlier[i]<-y2[1] } plot(outlier,rel_prediction_error,type='l',ylab="Mean prediction error (on the uncontaminated observations) \\\ relative to the fit on clean data",xlab="Distance of the outlier") How far? In the example above, the single outlier has changed the fit so much that the mean prediction error (on the uncontaminated) observations is now 1-2 orders of magnitude bigger than it would have been, had the model been fitted on the uncontaminated data. So it is not true that a single outlier cannot affect the RF fit. Furthermore, as I point out elsewhere, outliers are much harder to deal with when there are potentially several of them (though they don't need to be a large proportion of the data for their effects to show up). Of course, contaminated data can contain more than one outlier; to measure the impact of several outliers on the RF fit, compare the plot on the left obtained from the RF on the uncontaminated data to the plot on the right obtained by arbitrarily shifting 5% of the responses values (the code is below the answer). Finally, in the regression context, it is important to point out that outliers can stand out from the bulk of the data in both the design and response space (1). In the specific context of RF, design outliers will affect the estimation of the hyper-parameters. However, this second effect is more manifest when the number of dimension is large. What we observe here is a particular case of a more general result. The extreme sensitivity to outliers of multivariate data fitting methods based on convex loss functions has been rediscovered many times. See (2) for an illustration in the specific context of ML methods. Edit. Fortunately, while the base CART/RF algorithm is emphatically not robust to outliers, it is possible (and quiet easy) to modify the procedure to impart it robustness to "y"-outliers. I will now focus on regression RF's (since this is more specifically the object of the OP's question). More precisely, writing the splitting criterion for an arbitrary node $t$ as: $$s^∗=\arg\max_{s} [p_L \text{var}(t_L(s))+p_R\text{var}(t_R(s))]$$ where $t_L$ and $t_R$ are emerging child nodes dependent on the choice of $s^∗$ ( $t_L$ and $t_R$ are implicit functions of $s$) and $p_L$ denotes the fraction of data that falls to the left child node $t_L$ and $p_R=1−p_L$ is the share of data in $t_R$. Then, one can impart "y"-space robustness to regression trees (and thus RF's) by replacing the variance functional used in the original definition by a robust alternative. This is in essence the approach used in (4) where the variance is replaced by a robust M-estimator of scale. (1) Unmasking Multivariate Outliers and Leverage Points. Peter J. Rousseeuw and Bert C. van Zomeren Journal of the American Statistical Association Vol. 85, No. 411 (Sep., 1990), pp. 633-639 (2) Random classification noise defeats all convex potential boosters. Philip M. Long and Rocco A. Servedio (2008). http://dl.acm.org/citation.cfm?id=1390233 (3) C. Becker and U. Gather (1999). The Masking Breakdown Point of Multivariate Outlier Identification Rules. (4) Galimberti, G., Pillati, M., & Soffritti, G. (2007). Robust regression trees based on M-estimators. Statistica, LXVII, 173–190. library(forestFloor) library(randomForest) library(rgl) set.seed(1) X<-data.frame(replicate(2,runif(2000)-.5)) y<--sqrt((X[,1])^4+(X[,2])^4) Col<-fcol(X,1:2) #make colour pallete by x1 and x2 #insert outlier2 and colour it black y2<-y;Col2<-Col y2[1:100]<-rnorm(100,200,1); #outliers Col[1:100]="#000000FF" #black #plot training set plot3d(X[,1],X[,2],y,col=Col) rf=randomForest(X,y) #RF on clean data rg=randomForest(X,y2) #RF on contaminated data vec.plot(rg,X,1:2,col=Col,grid.lines=200) mean(abs(rf$predict[-c(1:100)]-y[-c(1:100)])) mean(abs(rg$predict[-c(1:100)]-y2[-c(1:100)]))
How are Random Forests not sensitive to outliers?
Your intuition is correct. This answer merely illustrates it on an example. It is indeed a common misconception that CART/RF are somehow robust to outliers. To illustrate the lack of robustness of RF
How are Random Forests not sensitive to outliers? Your intuition is correct. This answer merely illustrates it on an example. It is indeed a common misconception that CART/RF are somehow robust to outliers. To illustrate the lack of robustness of RF to the presence of a single outliers, we can (lightly) modify the code used in Soren Havelund Welling's answer above to show that a single 'y'-outliers suffices to completely sway the fitted RF model. For example, if we compute the mean prediction error of the uncontaminated observations as a function of the distance between the outlier and the rest of the data, we can see (image below) that introducing a single outlier (by replacing one of the original observations by an arbitrary value on the 'y'-space) suffices to pull the predictions of the RF model arbitrarily far away from the values they would have had if computed on the original (uncontaminated) data: library(forestFloor) library(randomForest) library(rgl) set.seed(1) X = data.frame(replicate(2,runif(2000)-.5)) y = -sqrt((X[,1])^4+(X[,2])^4) X[1,]=c(0,0); y2<-y rg<-randomForest(X,y) #RF model fitted without the outlier outlier<-rel_prediction_error<-rep(NA,10) for(i in 1:10){ y2[1]=100*i+2 rf=randomForest(X,y2) #RF model fitted with the outlier rel_prediction_error[i]<-mean(abs(rf$predict[-1]-y2[-1]))/mean(abs(rg$predict[-1]-y[-1])) outlier[i]<-y2[1] } plot(outlier,rel_prediction_error,type='l',ylab="Mean prediction error (on the uncontaminated observations) \\\ relative to the fit on clean data",xlab="Distance of the outlier") How far? In the example above, the single outlier has changed the fit so much that the mean prediction error (on the uncontaminated) observations is now 1-2 orders of magnitude bigger than it would have been, had the model been fitted on the uncontaminated data. So it is not true that a single outlier cannot affect the RF fit. Furthermore, as I point out elsewhere, outliers are much harder to deal with when there are potentially several of them (though they don't need to be a large proportion of the data for their effects to show up). Of course, contaminated data can contain more than one outlier; to measure the impact of several outliers on the RF fit, compare the plot on the left obtained from the RF on the uncontaminated data to the plot on the right obtained by arbitrarily shifting 5% of the responses values (the code is below the answer). Finally, in the regression context, it is important to point out that outliers can stand out from the bulk of the data in both the design and response space (1). In the specific context of RF, design outliers will affect the estimation of the hyper-parameters. However, this second effect is more manifest when the number of dimension is large. What we observe here is a particular case of a more general result. The extreme sensitivity to outliers of multivariate data fitting methods based on convex loss functions has been rediscovered many times. See (2) for an illustration in the specific context of ML methods. Edit. Fortunately, while the base CART/RF algorithm is emphatically not robust to outliers, it is possible (and quiet easy) to modify the procedure to impart it robustness to "y"-outliers. I will now focus on regression RF's (since this is more specifically the object of the OP's question). More precisely, writing the splitting criterion for an arbitrary node $t$ as: $$s^∗=\arg\max_{s} [p_L \text{var}(t_L(s))+p_R\text{var}(t_R(s))]$$ where $t_L$ and $t_R$ are emerging child nodes dependent on the choice of $s^∗$ ( $t_L$ and $t_R$ are implicit functions of $s$) and $p_L$ denotes the fraction of data that falls to the left child node $t_L$ and $p_R=1−p_L$ is the share of data in $t_R$. Then, one can impart "y"-space robustness to regression trees (and thus RF's) by replacing the variance functional used in the original definition by a robust alternative. This is in essence the approach used in (4) where the variance is replaced by a robust M-estimator of scale. (1) Unmasking Multivariate Outliers and Leverage Points. Peter J. Rousseeuw and Bert C. van Zomeren Journal of the American Statistical Association Vol. 85, No. 411 (Sep., 1990), pp. 633-639 (2) Random classification noise defeats all convex potential boosters. Philip M. Long and Rocco A. Servedio (2008). http://dl.acm.org/citation.cfm?id=1390233 (3) C. Becker and U. Gather (1999). The Masking Breakdown Point of Multivariate Outlier Identification Rules. (4) Galimberti, G., Pillati, M., & Soffritti, G. (2007). Robust regression trees based on M-estimators. Statistica, LXVII, 173–190. library(forestFloor) library(randomForest) library(rgl) set.seed(1) X<-data.frame(replicate(2,runif(2000)-.5)) y<--sqrt((X[,1])^4+(X[,2])^4) Col<-fcol(X,1:2) #make colour pallete by x1 and x2 #insert outlier2 and colour it black y2<-y;Col2<-Col y2[1:100]<-rnorm(100,200,1); #outliers Col[1:100]="#000000FF" #black #plot training set plot3d(X[,1],X[,2],y,col=Col) rf=randomForest(X,y) #RF on clean data rg=randomForest(X,y2) #RF on contaminated data vec.plot(rg,X,1:2,col=Col,grid.lines=200) mean(abs(rf$predict[-c(1:100)]-y[-c(1:100)])) mean(abs(rg$predict[-c(1:100)]-y2[-c(1:100)]))
How are Random Forests not sensitive to outliers? Your intuition is correct. This answer merely illustrates it on an example. It is indeed a common misconception that CART/RF are somehow robust to outliers. To illustrate the lack of robustness of RF
5,471
How are Random Forests not sensitive to outliers?
It is not the Random Forest algorithm itself that is robust to outliers, but the base learner it is based on: the decision tree. Decision trees isolate atypical observations into small leaves (i.e., small subspaces of the original space). Furthermore, decision trees are local models. Unlike linear regression, where the same equation holds for the entire space, a very simple model is fitted locally to each subspace (i.e., to each leaf). In the case of regression, it is generally a very low-order regression model (usually only the average of the observations in the leaf). For classification, it is majority voting. Therefore, for regression for instance, extreme values do not affect the entire model because they get averaged locally. So the fit to the other values is not affected. Actually, this desirable property carries over to other tree-like structures, like dendograms. Hierarchical clustering, for instance, has long been used for data cleaning because it automatically isolates aberrant observations into small clusters. See for instance Loureiro et al. (2004). Outlier detection using clustering methods: a data cleaning application. So, in a nutshell, RF inherits its insensitivity to outliers from recursive partitioning and local model fitting. Note that decision trees are low bias but high variance models: their structure are prone to changing upon a small modification of the training set (removal or addition of a few observations). But this should not be mistaken with sensitivity to outliers, this is a different matter.
How are Random Forests not sensitive to outliers?
It is not the Random Forest algorithm itself that is robust to outliers, but the base learner it is based on: the decision tree. Decision trees isolate atypical observations into small leaves (i.e., s
How are Random Forests not sensitive to outliers? It is not the Random Forest algorithm itself that is robust to outliers, but the base learner it is based on: the decision tree. Decision trees isolate atypical observations into small leaves (i.e., small subspaces of the original space). Furthermore, decision trees are local models. Unlike linear regression, where the same equation holds for the entire space, a very simple model is fitted locally to each subspace (i.e., to each leaf). In the case of regression, it is generally a very low-order regression model (usually only the average of the observations in the leaf). For classification, it is majority voting. Therefore, for regression for instance, extreme values do not affect the entire model because they get averaged locally. So the fit to the other values is not affected. Actually, this desirable property carries over to other tree-like structures, like dendograms. Hierarchical clustering, for instance, has long been used for data cleaning because it automatically isolates aberrant observations into small clusters. See for instance Loureiro et al. (2004). Outlier detection using clustering methods: a data cleaning application. So, in a nutshell, RF inherits its insensitivity to outliers from recursive partitioning and local model fitting. Note that decision trees are low bias but high variance models: their structure are prone to changing upon a small modification of the training set (removal or addition of a few observations). But this should not be mistaken with sensitivity to outliers, this is a different matter.
How are Random Forests not sensitive to outliers? It is not the Random Forest algorithm itself that is robust to outliers, but the base learner it is based on: the decision tree. Decision trees isolate atypical observations into small leaves (i.e., s
5,472
How are Random Forests not sensitive to outliers?
outlier 1a: This outlier has one or more extreme feature values and is placed distant to any other sample. The outlier will influence the initial splits of the trees as any other sample, so no strong influence. It will have low proximity to any other sample, and will only define the model structure in a remote part of feature space. During prediction most new samples are likely not to be similar to this outlier, and will rarely end up in the same terminal node. Moreover decision trees regards features as if they were ordinal(ranking). The value is either smaller/equal to or larger than break point, thus it does not matter if a feature value is an extreme outlier. outlier 1b: For classification one single sample may be regarded as an outlier, when embedded in the middle of many sample of a different class. I described earlier how a default RF model will get influenced by this one sample of odd class, but only very close to the sample. outlier 2: This outlier has an extreme target value perhaps many times higher than any other values, but the feature values are normal. A .631 fraction of the trees will have a terminal node with this sample. The model structure will get affected locally close to the outlier. Notice the model structure is affected mainly parallel to the feature axis, because nodes are split uni-variately. I included a RF-regression simulation of outlier_2. 1999 points drawn from a smooth rounded structure $y=(x_1^4 + x_2^4 )^{\frac 1 2}$ and one outlier with a much higher target value(y=2, $x_1$=0,$x_2$=0). The training set is shown to the left. The learned RF model-structure is shown the the right. library(forestFloor) library(randomForest) library(rgl) set.seed(1) X = data.frame(replicate(2,runif(2000)-.5)) y = -sqrt((X[,1])^4+(X[,2])^4)^1 Col = fcol(X,1:2) #make colour pallete by x1 and x2 #insert outlier2 and colour it black X[1,] = c(0,0);y[1]=2 ;Col[1] = "#000000FF" #black #plot training set plot3d(X[,1],X[,2],y,col=Col) rf = randomForest(X,y) vec.plot(rf,X,1:2,col=Col,grid.lines = 400) EDIT: comment to user603 Yes for extreme outliers on target scale, one should consider to transform target scale before running RF. I added below a robustModel() function which tweaks randomForest. Another solutions would be to log transform before training. . ##---code by user603 library(forestFloor) library(randomForest) library(rgl) set.seed(1) X<-data.frame(replicate(2,runif(2000)-.5)) y<--sqrt((X[,1])^4+(X[,2])^4) Col<-fcol(X,1:2) #make colour pallete by x1 and x2 #insert outlier2 and colour it black y2<-y;Col2<-Col y2[1:100]<-rnorm(100,200,1); #outliers Col2[1:100]="#000000FF" #black ##--- #function to make models robust robustModel = function(model,keep.outliers=TRUE) { f = function(X,y,lim=c(0.1,.9),keep.outliers="dummy",...) { limits = quantile(y,lim) if(keep.outliers) {#keep but reduce outliers y[limits[1]>y] = limits[1] #lower limit y[limits[2]<y] = limits[2] #upper limit } else {#completely remove outliers thrashThese = mapply("||",limits[1]>y,limits[2]>y) y = y[thrashThese] X = X[thrashThese,] } obj = model(x=X,y=y,...) class(obj) = c("robustMod",class(obj)) return(obj) } formals(f)$keep.outliers = keep.outliers return(f) } robustRF = robustModel(randomForest) #make RF robust rh = robustRF(X,y2,sampsize=250) #train robustRF vec.plot(rh,X,1:2,col=Col2) #plot model surface mean(abs(rh$predict[-c(1:100)]-y2[-c(1:100)]))
How are Random Forests not sensitive to outliers?
outlier 1a: This outlier has one or more extreme feature values and is placed distant to any other sample. The outlier will influence the initial splits of the trees as any other sample, so no strong
How are Random Forests not sensitive to outliers? outlier 1a: This outlier has one or more extreme feature values and is placed distant to any other sample. The outlier will influence the initial splits of the trees as any other sample, so no strong influence. It will have low proximity to any other sample, and will only define the model structure in a remote part of feature space. During prediction most new samples are likely not to be similar to this outlier, and will rarely end up in the same terminal node. Moreover decision trees regards features as if they were ordinal(ranking). The value is either smaller/equal to or larger than break point, thus it does not matter if a feature value is an extreme outlier. outlier 1b: For classification one single sample may be regarded as an outlier, when embedded in the middle of many sample of a different class. I described earlier how a default RF model will get influenced by this one sample of odd class, but only very close to the sample. outlier 2: This outlier has an extreme target value perhaps many times higher than any other values, but the feature values are normal. A .631 fraction of the trees will have a terminal node with this sample. The model structure will get affected locally close to the outlier. Notice the model structure is affected mainly parallel to the feature axis, because nodes are split uni-variately. I included a RF-regression simulation of outlier_2. 1999 points drawn from a smooth rounded structure $y=(x_1^4 + x_2^4 )^{\frac 1 2}$ and one outlier with a much higher target value(y=2, $x_1$=0,$x_2$=0). The training set is shown to the left. The learned RF model-structure is shown the the right. library(forestFloor) library(randomForest) library(rgl) set.seed(1) X = data.frame(replicate(2,runif(2000)-.5)) y = -sqrt((X[,1])^4+(X[,2])^4)^1 Col = fcol(X,1:2) #make colour pallete by x1 and x2 #insert outlier2 and colour it black X[1,] = c(0,0);y[1]=2 ;Col[1] = "#000000FF" #black #plot training set plot3d(X[,1],X[,2],y,col=Col) rf = randomForest(X,y) vec.plot(rf,X,1:2,col=Col,grid.lines = 400) EDIT: comment to user603 Yes for extreme outliers on target scale, one should consider to transform target scale before running RF. I added below a robustModel() function which tweaks randomForest. Another solutions would be to log transform before training. . ##---code by user603 library(forestFloor) library(randomForest) library(rgl) set.seed(1) X<-data.frame(replicate(2,runif(2000)-.5)) y<--sqrt((X[,1])^4+(X[,2])^4) Col<-fcol(X,1:2) #make colour pallete by x1 and x2 #insert outlier2 and colour it black y2<-y;Col2<-Col y2[1:100]<-rnorm(100,200,1); #outliers Col2[1:100]="#000000FF" #black ##--- #function to make models robust robustModel = function(model,keep.outliers=TRUE) { f = function(X,y,lim=c(0.1,.9),keep.outliers="dummy",...) { limits = quantile(y,lim) if(keep.outliers) {#keep but reduce outliers y[limits[1]>y] = limits[1] #lower limit y[limits[2]<y] = limits[2] #upper limit } else {#completely remove outliers thrashThese = mapply("||",limits[1]>y,limits[2]>y) y = y[thrashThese] X = X[thrashThese,] } obj = model(x=X,y=y,...) class(obj) = c("robustMod",class(obj)) return(obj) } formals(f)$keep.outliers = keep.outliers return(f) } robustRF = robustModel(randomForest) #make RF robust rh = robustRF(X,y2,sampsize=250) #train robustRF vec.plot(rh,X,1:2,col=Col2) #plot model surface mean(abs(rh$predict[-c(1:100)]-y2[-c(1:100)]))
How are Random Forests not sensitive to outliers? outlier 1a: This outlier has one or more extreme feature values and is placed distant to any other sample. The outlier will influence the initial splits of the trees as any other sample, so no strong
5,473
Pitfalls in time series analysis
Extrapolating a linear regression on a time series, where time is one of the independent variables in the regression. A linear regression may approximate a time series on a short time scale, and may be useful in an analysis, but extrapolating a straight line is foolish. (Time is infinite and ever-increasing.) EDIT: In response to naught101's question about "foolish", my answer may be wrong but it seems to me that most real-world phenomenon don't increase or decrease continuously forever. Most processes having limiting factors: people stop growing in height as they age, stocks don't always go up, populations cannot go negative, you can't fill your house with a billion puppies, etc. Time, unlike most independent variables that come to mind, has infinite support, so you really can imagine your linear model predicting Apple's stock price 10 years from now because 10 years from now will surely exist. (Whereas you wouldn't extrapolate a height-weight regression to predict the weight of 20-meter-tall adult males: they don't and won't exist.) In addition, time series often have cyclical or pseudo-cyclical components, or random walk components. As IrishStat mentions in his answer, you need to consider seasonality (sometimes seasonalities at multiple time scales), level shifts (which will do strange things to linear regressions that don't account for them), etc. A linear regression that ignores cycles will fit over a short-term, but be highly misleading if you extrapolate it. Of course, you can get into trouble whenever you extrapolate, time-series or not. But it seems to me that we too often see someone throw a time series (crimes, stock prices, etc) into Excel, drop a FORECAST or LINEST on it and predict the future via essentially a straight line, as if stock prices would rise continuously (or decline continuously, including going negative).
Pitfalls in time series analysis
Extrapolating a linear regression on a time series, where time is one of the independent variables in the regression. A linear regression may approximate a time series on a short time scale, and may b
Pitfalls in time series analysis Extrapolating a linear regression on a time series, where time is one of the independent variables in the regression. A linear regression may approximate a time series on a short time scale, and may be useful in an analysis, but extrapolating a straight line is foolish. (Time is infinite and ever-increasing.) EDIT: In response to naught101's question about "foolish", my answer may be wrong but it seems to me that most real-world phenomenon don't increase or decrease continuously forever. Most processes having limiting factors: people stop growing in height as they age, stocks don't always go up, populations cannot go negative, you can't fill your house with a billion puppies, etc. Time, unlike most independent variables that come to mind, has infinite support, so you really can imagine your linear model predicting Apple's stock price 10 years from now because 10 years from now will surely exist. (Whereas you wouldn't extrapolate a height-weight regression to predict the weight of 20-meter-tall adult males: they don't and won't exist.) In addition, time series often have cyclical or pseudo-cyclical components, or random walk components. As IrishStat mentions in his answer, you need to consider seasonality (sometimes seasonalities at multiple time scales), level shifts (which will do strange things to linear regressions that don't account for them), etc. A linear regression that ignores cycles will fit over a short-term, but be highly misleading if you extrapolate it. Of course, you can get into trouble whenever you extrapolate, time-series or not. But it seems to me that we too often see someone throw a time series (crimes, stock prices, etc) into Excel, drop a FORECAST or LINEST on it and predict the future via essentially a straight line, as if stock prices would rise continuously (or decline continuously, including going negative).
Pitfalls in time series analysis Extrapolating a linear regression on a time series, where time is one of the independent variables in the regression. A linear regression may approximate a time series on a short time scale, and may b
5,474
Pitfalls in time series analysis
Paying attention to correlation between two non-stationary time series. (It is not unexpected that they will have a high correlation coefficient: search on "non-sense correlation" and "cointegration".) For example, on google correlate, dogs and ear piercings have a correlation coefficient of 0.84. For an older analysis, see Yule's 1926 exploration of the problem
Pitfalls in time series analysis
Paying attention to correlation between two non-stationary time series. (It is not unexpected that they will have a high correlation coefficient: search on "non-sense correlation" and "cointegration".
Pitfalls in time series analysis Paying attention to correlation between two non-stationary time series. (It is not unexpected that they will have a high correlation coefficient: search on "non-sense correlation" and "cointegration".) For example, on google correlate, dogs and ear piercings have a correlation coefficient of 0.84. For an older analysis, see Yule's 1926 exploration of the problem
Pitfalls in time series analysis Paying attention to correlation between two non-stationary time series. (It is not unexpected that they will have a high correlation coefficient: search on "non-sense correlation" and "cointegration".
5,475
Pitfalls in time series analysis
At the top level, Kolmogorov identified independence as a key assumption in statistics - without i.i.d assumption, many important results in statistics aren't true, whether applied to time series or more general analysis tasks. Successive or nearby samples in most real-world discrete-time signals are not independent, so care must be taken to decompose a process into a deterministic model and a stochastic noise component. Even so, the independent increment assumption in classical stochastic calculus is problematic: recall the 1997 econ Nobel, and the 1998 implosion of LTCM which counted the laureates among its principals (though to be fair, the fund's manager Merrywhether likely is more to blame than quant methods).
Pitfalls in time series analysis
At the top level, Kolmogorov identified independence as a key assumption in statistics - without i.i.d assumption, many important results in statistics aren't true, whether applied to time series or m
Pitfalls in time series analysis At the top level, Kolmogorov identified independence as a key assumption in statistics - without i.i.d assumption, many important results in statistics aren't true, whether applied to time series or more general analysis tasks. Successive or nearby samples in most real-world discrete-time signals are not independent, so care must be taken to decompose a process into a deterministic model and a stochastic noise component. Even so, the independent increment assumption in classical stochastic calculus is problematic: recall the 1997 econ Nobel, and the 1998 implosion of LTCM which counted the laureates among its principals (though to be fair, the fund's manager Merrywhether likely is more to blame than quant methods).
Pitfalls in time series analysis At the top level, Kolmogorov identified independence as a key assumption in statistics - without i.i.d assumption, many important results in statistics aren't true, whether applied to time series or m
5,476
Pitfalls in time series analysis
Defining Trend as a Linear growth over time . Although some trends are somehow linear (see Apple stock price), and although time series chart looks like a line chart where you can find linear regression, most trends are not linear. There are Step changes like changes when something happened in a specific point in time that changed the measure behavior ("The bridge collapsed and no cars is going over it since"). Another popular trend is "Buzz" - exponential growth and a similar sharp decline afterward ("Our marketing campaign was a huge success, but the effect faded after couple of weeks"). Knowing the right model (Logistic Regression, etc.) of the trend in the time series is crucial in the ability to detect it in the time series data.
Pitfalls in time series analysis
Defining Trend as a Linear growth over time . Although some trends are somehow linear (see Apple stock price), and although time series chart looks like a line chart where you can find linear regress
Pitfalls in time series analysis Defining Trend as a Linear growth over time . Although some trends are somehow linear (see Apple stock price), and although time series chart looks like a line chart where you can find linear regression, most trends are not linear. There are Step changes like changes when something happened in a specific point in time that changed the measure behavior ("The bridge collapsed and no cars is going over it since"). Another popular trend is "Buzz" - exponential growth and a similar sharp decline afterward ("Our marketing campaign was a huge success, but the effect faded after couple of weeks"). Knowing the right model (Logistic Regression, etc.) of the trend in the time series is crucial in the ability to detect it in the time series data.
Pitfalls in time series analysis Defining Trend as a Linear growth over time . Although some trends are somehow linear (see Apple stock price), and although time series chart looks like a line chart where you can find linear regress
5,477
Pitfalls in time series analysis
Being too certain of your model's results because you use a technique/model (such as OLS) that does not account for a time series' autocorrelation. I don't have a nice graph, but the book "Introductory Time Series with R" (2009, Cowpertwait, et al) gives a reasonable intuitive explanation: If there is a positive autocorrelation, values above or below the mean will tend to persist and be clustered together in time. This leads to a less efficient estimate of the mean, which means that you need more data to estimate the mean to the same accuracy than if the there were zero autocorrelation. You effectively have less data than you think you do. The OLS process (and therefore you) assume that there is no autocorrelation, so you are also assuming that the estimate of the mean is more accurate (for the amount of data you have) than it actually is. Thus, you end up being more confident of your results than you should be. (This can work the other way for negative autocorrelation: your estimate of the mean is actually more efficient than it would be otherwise. I have nothing to prove this, but I'd suggest that positive correlation is more common in most real-world time series than negative correlation.)
Pitfalls in time series analysis
Being too certain of your model's results because you use a technique/model (such as OLS) that does not account for a time series' autocorrelation. I don't have a nice graph, but the book "Introductor
Pitfalls in time series analysis Being too certain of your model's results because you use a technique/model (such as OLS) that does not account for a time series' autocorrelation. I don't have a nice graph, but the book "Introductory Time Series with R" (2009, Cowpertwait, et al) gives a reasonable intuitive explanation: If there is a positive autocorrelation, values above or below the mean will tend to persist and be clustered together in time. This leads to a less efficient estimate of the mean, which means that you need more data to estimate the mean to the same accuracy than if the there were zero autocorrelation. You effectively have less data than you think you do. The OLS process (and therefore you) assume that there is no autocorrelation, so you are also assuming that the estimate of the mean is more accurate (for the amount of data you have) than it actually is. Thus, you end up being more confident of your results than you should be. (This can work the other way for negative autocorrelation: your estimate of the mean is actually more efficient than it would be otherwise. I have nothing to prove this, but I'd suggest that positive correlation is more common in most real-world time series than negative correlation.)
Pitfalls in time series analysis Being too certain of your model's results because you use a technique/model (such as OLS) that does not account for a time series' autocorrelation. I don't have a nice graph, but the book "Introductor
5,478
Pitfalls in time series analysis
The impact of level shifts , seasonal pulses and local time trends ... in addition to one-time pulses. Changes in parameters over time are important to investigate/model. Possible changes in variance of the errors over time have to be investigated. How to determine how Y is impacted by contemporaneous and lagged values of X . How to identify if future values of X can impact current values of Y. How to find out of particular days of the month have an impact. How to model mixed frequency problems where hourly data is impacted by daily values ? naught asked me to provide more specific information/examples on level shifts and pulses. To that end I now include some more discussion. A series that exhibits an ACF suggesting non-stationarity is in effect delivering a "symptom". One suggested remedy is to "difference" the data. An overlooked remedy is to "de-mean" the data. If a series has a "major" level shift in the mean (i.e.intercept) the acf of this entire series can be easily misinterpreted to suggest differencing. I will show an example of a series that exhibits a level shift.If I had accentuated (enlarged) the difference between the two means the acf of the total series would suggest (incorrectly ! ) the need to difference. Untreated Pulses/Level Shifts/Seasonal Pulses/Local Time Trends inflate the variance of the errors obfuscating the importance of model structure and are the cause of flawed parameter estimates and poor forecasts. Now on to an example . This is a list of the 27 monthly values. This is the graph . There are four pulses and 1 level shift AND NO TREND ! and . The residuals from this model suggest a white noise process . Some (most !) commercial and even free forecasting packages deliver the following silliness as a result of assuming a trend model with additive seasonal factors. To conclude and to paraphrase Mark Twain. "There is nonsense and there is nonsense but the most non sensical nonsence of them all is statistical nonsense !" as compared to a more reasonable . Hope this helps !
Pitfalls in time series analysis
The impact of level shifts , seasonal pulses and local time trends ... in addition to one-time pulses. Changes in parameters over time are important to investigate/model. Possible changes in variance
Pitfalls in time series analysis The impact of level shifts , seasonal pulses and local time trends ... in addition to one-time pulses. Changes in parameters over time are important to investigate/model. Possible changes in variance of the errors over time have to be investigated. How to determine how Y is impacted by contemporaneous and lagged values of X . How to identify if future values of X can impact current values of Y. How to find out of particular days of the month have an impact. How to model mixed frequency problems where hourly data is impacted by daily values ? naught asked me to provide more specific information/examples on level shifts and pulses. To that end I now include some more discussion. A series that exhibits an ACF suggesting non-stationarity is in effect delivering a "symptom". One suggested remedy is to "difference" the data. An overlooked remedy is to "de-mean" the data. If a series has a "major" level shift in the mean (i.e.intercept) the acf of this entire series can be easily misinterpreted to suggest differencing. I will show an example of a series that exhibits a level shift.If I had accentuated (enlarged) the difference between the two means the acf of the total series would suggest (incorrectly ! ) the need to difference. Untreated Pulses/Level Shifts/Seasonal Pulses/Local Time Trends inflate the variance of the errors obfuscating the importance of model structure and are the cause of flawed parameter estimates and poor forecasts. Now on to an example . This is a list of the 27 monthly values. This is the graph . There are four pulses and 1 level shift AND NO TREND ! and . The residuals from this model suggest a white noise process . Some (most !) commercial and even free forecasting packages deliver the following silliness as a result of assuming a trend model with additive seasonal factors. To conclude and to paraphrase Mark Twain. "There is nonsense and there is nonsense but the most non sensical nonsence of them all is statistical nonsense !" as compared to a more reasonable . Hope this helps !
Pitfalls in time series analysis The impact of level shifts , seasonal pulses and local time trends ... in addition to one-time pulses. Changes in parameters over time are important to investigate/model. Possible changes in variance
5,479
Pitfalls in time series analysis
In addition to some great points that have already been mentioned, I would add: Failure to spot long cycles or seasonality - by examining only data over 'an insufficiently long' period of time Failure to evaluate the forecasting error for past periods (backtesting) Failure to detect and deal with regime changes These problems are not related to the statistical methods involved but to the design of the study, i.e. which data to include and how to evaluate the results. The tricky part with point 1. is making sure that we have observed a sufficient period of the data in order to make conclusions about the future. During my first lecture on time-series, the professor drew a long sinus curve on the board and pointed out that long cycles look like linear trends when observed over a short window (quite simple, but the lesson stuck with me). Point 2. is especially relevant if the errors of your model have some practical implications. Among other fields, it is being widely used in Finance, but I would argue that evaluating the forecasting errors in past periods makes a lot of sense for all time-series models where the data allows it. Point 3. touches again on the subject of which portion of past data is representative of the future. This is a complex topic with a large amount literature - I will name my personal favorite: Zucchini and MacDonald as an example.
Pitfalls in time series analysis
In addition to some great points that have already been mentioned, I would add: Failure to spot long cycles or seasonality - by examining only data over 'an insufficiently long' period of time Failu
Pitfalls in time series analysis In addition to some great points that have already been mentioned, I would add: Failure to spot long cycles or seasonality - by examining only data over 'an insufficiently long' period of time Failure to evaluate the forecasting error for past periods (backtesting) Failure to detect and deal with regime changes These problems are not related to the statistical methods involved but to the design of the study, i.e. which data to include and how to evaluate the results. The tricky part with point 1. is making sure that we have observed a sufficient period of the data in order to make conclusions about the future. During my first lecture on time-series, the professor drew a long sinus curve on the board and pointed out that long cycles look like linear trends when observed over a short window (quite simple, but the lesson stuck with me). Point 2. is especially relevant if the errors of your model have some practical implications. Among other fields, it is being widely used in Finance, but I would argue that evaluating the forecasting errors in past periods makes a lot of sense for all time-series models where the data allows it. Point 3. touches again on the subject of which portion of past data is representative of the future. This is a complex topic with a large amount literature - I will name my personal favorite: Zucchini and MacDonald as an example.
Pitfalls in time series analysis In addition to some great points that have already been mentioned, I would add: Failure to spot long cycles or seasonality - by examining only data over 'an insufficiently long' period of time Failu
5,480
Pitfalls in time series analysis
Avoid Aliasing in sampled time series. If you are analyzing time series data that is sampled at regular intervals, then the sampling rate must be twice the frequency of the highest frequency component in the data you are sampling. This is the Nyquist sampling theory, and it applies to digital audio, but also to any time series sampled at regular intervals. The way to avoid aliasing is to filter out all frequencies above the nyquist rate, which is half the sampling rate. For example, for digital audio, a sample rate of 48 kHz will require a low-pass filter with a cutoff below 24 kHz. The effect of aliasing can be seen when wheels appear to spin backward, due to a strobiscopic effect where the strobe rate is close to the rate of revolution of the wheel. The slow rate observed is an alias of the actual rate of revolution.
Pitfalls in time series analysis
Avoid Aliasing in sampled time series. If you are analyzing time series data that is sampled at regular intervals, then the sampling rate must be twice the frequency of the highest frequency compone
Pitfalls in time series analysis Avoid Aliasing in sampled time series. If you are analyzing time series data that is sampled at regular intervals, then the sampling rate must be twice the frequency of the highest frequency component in the data you are sampling. This is the Nyquist sampling theory, and it applies to digital audio, but also to any time series sampled at regular intervals. The way to avoid aliasing is to filter out all frequencies above the nyquist rate, which is half the sampling rate. For example, for digital audio, a sample rate of 48 kHz will require a low-pass filter with a cutoff below 24 kHz. The effect of aliasing can be seen when wheels appear to spin backward, due to a strobiscopic effect where the strobe rate is close to the rate of revolution of the wheel. The slow rate observed is an alias of the actual rate of revolution.
Pitfalls in time series analysis Avoid Aliasing in sampled time series. If you are analyzing time series data that is sampled at regular intervals, then the sampling rate must be twice the frequency of the highest frequency compone
5,481
Proof that the coefficients in an OLS model follow a t-distribution with (n-k) degrees of freedom
Since $$\begin{align*} \hat\beta &= (X^TX)^{-1}X^TY \\ &= (X^TX)^{-1}X^T(X\beta + \varepsilon) \\ &= \beta + (X^TX)^{-1}X^T\varepsilon \end{align*}$$ we know that $$\hat\beta-\beta \sim \mathcal{N}(0,\sigma^2 (X^TX)^{-1})$$ and thus we know that for each component $k$ of $\hat\beta$, $$\hat\beta_k -\beta_k \sim \mathcal{N}(0, \sigma^2 S_{kk})$$ where $S_{kk}$ is the $k^\text{th}$ diagonal element of $(X^TX)^{-1}$. Thus, we know that $$z_k = \frac{\hat\beta_k -\beta_k}{\sqrt{\sigma^2 S_{kk}}} \sim \mathcal{N}(0,1).$$ Take note of the statement of the Theorem for the Distribution of an Idempotent Quadratic Form in a Standard Normal Vector (Theorem B.8 in Greene): If $x\sim\mathcal{N}(0,I)$ and $A$ is symmetric and idempotent, then $x^TAx$ is distributed $\chi^2_{\nu}$ where $\nu$ is the rank of $A$. Let $\hat\varepsilon$ denote the regression residual vector and let $$M=I_n - X(X^TX)^{-1}X^T \text{,}$$ which is the residual maker matrix (i.e. $My=\hat\varepsilon$). It's easy to verify that $M$ is symmetric and idempotent. Let $$s^2 = \frac{\hat\varepsilon^T \hat\varepsilon}{n-p}$$ be an estimator for $\sigma^2$. We then need to do some linear algebra. Note these three linear algebra properties: The rank of an idempotent matrix is its trace. $\operatorname{Tr}(A_1+A_2) = \operatorname{Tr}(A_1) + \operatorname{Tr}(A_2)$ $\operatorname{Tr}(A_1A_2) = \operatorname{Tr}(A_2A_1)$ if $A_1$ is $n_1 \times n_2$ and $A_2$ is $n_2 \times n_1$ (this property is critical for the below to work) So $$\begin{align*} \operatorname{rank}(M) = \operatorname{Tr}(M) &= \operatorname{Tr}(I_n - X(X^TX)^{-1}X^T) \\ &= \operatorname{Tr}(I_n) - \operatorname{Tr}\left( X(X^TX)^{-1}X^T) \right) \\ &= \operatorname{Tr}(I_n) - \operatorname{Tr}\left( (X^TX)^{-1}X^TX) \right) \\ &= \operatorname{Tr}(I_n) - \operatorname{Tr}(I_p) \\ &=n-p \end{align*}$$ Then $$\begin{align*} V = \frac{(n-p)s^2}{\sigma^2} = \frac{\hat\varepsilon^T\hat\varepsilon}{\sigma^2} = \left(\frac{\varepsilon}{\sigma}\right)^T M \left(\frac{\varepsilon}{\sigma}\right). \end{align*}$$ Applying the Theorem for the Distribution of an Idempotent Quadratic Form in a Standard Normal Vector (stated above), we know that $V \sim \chi^2_{n-p}$. Since you assumed that $\varepsilon$ is normally distributed, then $\hat\beta$ is independent of $\hat\varepsilon$, and since $s^2$ is a function of $\hat\varepsilon$, then $s^2$ is also independent of $\hat\beta$. Thus, $z_k$ and $V$ are independent of each other. Then, $$\begin{align*} t_k = \frac{z_k}{\sqrt{V/(n-p)}} \end{align*}$$ is the ratio of a standard Normal distribution with the square root of a Chi-squared distribution with the same degrees of freedom (i.e. $n-p$), which is a characterization of the $t$ distribution. Therefore, the statistic $t_k$ has a $t$ distribution with $n-p$ degrees of freedom. It can then be algebraically manipulated into a more familiar form. $$\begin{align*} t_k &= \frac{\frac{\hat\beta_k -\beta_k}{\sqrt{\sigma^2 S_{kk}}}}{\sqrt{\frac{(n-p)s^2}{\sigma^2}/(n-p)}} \\ &= \frac{\frac{\hat\beta_k -\beta_k}{\sqrt{S_{kk}}}}{\sqrt{s^2}} = \frac{\hat\beta_k -\beta_k}{\sqrt{s^2 S_{kk}}} \\ &= \frac{\hat\beta_k -\beta_k}{\operatorname{se}\left(\hat\beta_k \right)} \end{align*}$$
Proof that the coefficients in an OLS model follow a t-distribution with (n-k) degrees of freedom
Since $$\begin{align*} \hat\beta &= (X^TX)^{-1}X^TY \\ &= (X^TX)^{-1}X^T(X\beta + \varepsilon) \\ &= \beta + (X^TX)^{-1}X^T\varepsilon \end{align*}$$ we know that $$\hat\beta-\beta \sim \mathcal{N}(0,
Proof that the coefficients in an OLS model follow a t-distribution with (n-k) degrees of freedom Since $$\begin{align*} \hat\beta &= (X^TX)^{-1}X^TY \\ &= (X^TX)^{-1}X^T(X\beta + \varepsilon) \\ &= \beta + (X^TX)^{-1}X^T\varepsilon \end{align*}$$ we know that $$\hat\beta-\beta \sim \mathcal{N}(0,\sigma^2 (X^TX)^{-1})$$ and thus we know that for each component $k$ of $\hat\beta$, $$\hat\beta_k -\beta_k \sim \mathcal{N}(0, \sigma^2 S_{kk})$$ where $S_{kk}$ is the $k^\text{th}$ diagonal element of $(X^TX)^{-1}$. Thus, we know that $$z_k = \frac{\hat\beta_k -\beta_k}{\sqrt{\sigma^2 S_{kk}}} \sim \mathcal{N}(0,1).$$ Take note of the statement of the Theorem for the Distribution of an Idempotent Quadratic Form in a Standard Normal Vector (Theorem B.8 in Greene): If $x\sim\mathcal{N}(0,I)$ and $A$ is symmetric and idempotent, then $x^TAx$ is distributed $\chi^2_{\nu}$ where $\nu$ is the rank of $A$. Let $\hat\varepsilon$ denote the regression residual vector and let $$M=I_n - X(X^TX)^{-1}X^T \text{,}$$ which is the residual maker matrix (i.e. $My=\hat\varepsilon$). It's easy to verify that $M$ is symmetric and idempotent. Let $$s^2 = \frac{\hat\varepsilon^T \hat\varepsilon}{n-p}$$ be an estimator for $\sigma^2$. We then need to do some linear algebra. Note these three linear algebra properties: The rank of an idempotent matrix is its trace. $\operatorname{Tr}(A_1+A_2) = \operatorname{Tr}(A_1) + \operatorname{Tr}(A_2)$ $\operatorname{Tr}(A_1A_2) = \operatorname{Tr}(A_2A_1)$ if $A_1$ is $n_1 \times n_2$ and $A_2$ is $n_2 \times n_1$ (this property is critical for the below to work) So $$\begin{align*} \operatorname{rank}(M) = \operatorname{Tr}(M) &= \operatorname{Tr}(I_n - X(X^TX)^{-1}X^T) \\ &= \operatorname{Tr}(I_n) - \operatorname{Tr}\left( X(X^TX)^{-1}X^T) \right) \\ &= \operatorname{Tr}(I_n) - \operatorname{Tr}\left( (X^TX)^{-1}X^TX) \right) \\ &= \operatorname{Tr}(I_n) - \operatorname{Tr}(I_p) \\ &=n-p \end{align*}$$ Then $$\begin{align*} V = \frac{(n-p)s^2}{\sigma^2} = \frac{\hat\varepsilon^T\hat\varepsilon}{\sigma^2} = \left(\frac{\varepsilon}{\sigma}\right)^T M \left(\frac{\varepsilon}{\sigma}\right). \end{align*}$$ Applying the Theorem for the Distribution of an Idempotent Quadratic Form in a Standard Normal Vector (stated above), we know that $V \sim \chi^2_{n-p}$. Since you assumed that $\varepsilon$ is normally distributed, then $\hat\beta$ is independent of $\hat\varepsilon$, and since $s^2$ is a function of $\hat\varepsilon$, then $s^2$ is also independent of $\hat\beta$. Thus, $z_k$ and $V$ are independent of each other. Then, $$\begin{align*} t_k = \frac{z_k}{\sqrt{V/(n-p)}} \end{align*}$$ is the ratio of a standard Normal distribution with the square root of a Chi-squared distribution with the same degrees of freedom (i.e. $n-p$), which is a characterization of the $t$ distribution. Therefore, the statistic $t_k$ has a $t$ distribution with $n-p$ degrees of freedom. It can then be algebraically manipulated into a more familiar form. $$\begin{align*} t_k &= \frac{\frac{\hat\beta_k -\beta_k}{\sqrt{\sigma^2 S_{kk}}}}{\sqrt{\frac{(n-p)s^2}{\sigma^2}/(n-p)}} \\ &= \frac{\frac{\hat\beta_k -\beta_k}{\sqrt{S_{kk}}}}{\sqrt{s^2}} = \frac{\hat\beta_k -\beta_k}{\sqrt{s^2 S_{kk}}} \\ &= \frac{\hat\beta_k -\beta_k}{\operatorname{se}\left(\hat\beta_k \right)} \end{align*}$$
Proof that the coefficients in an OLS model follow a t-distribution with (n-k) degrees of freedom Since $$\begin{align*} \hat\beta &= (X^TX)^{-1}X^TY \\ &= (X^TX)^{-1}X^T(X\beta + \varepsilon) \\ &= \beta + (X^TX)^{-1}X^T\varepsilon \end{align*}$$ we know that $$\hat\beta-\beta \sim \mathcal{N}(0,
5,482
Bayesian statistics tutorial
Here's a place to start: ftp://selab.janelia.org/pub/publications/Eddy-ATG3/Eddy-ATG3-reprint.pdf http://blog.oscarbonilla.com/2009/05/visualizing-bayes-theorem/ http://yudkowsky.net/rational/bayes http://www.math.umass.edu/~lavine/whatisbayes.pdf http://en.wikipedia.org/wiki/Bayesian_inference http://en.wikipedia.org/wiki/Bayesian_probability Tutorial_on_Bayesian_Statistics_and_Clinical_Trials
Bayesian statistics tutorial
Here's a place to start: ftp://selab.janelia.org/pub/publications/Eddy-ATG3/Eddy-ATG3-reprint.pdf http://blog.oscarbonilla.com/2009/05/visualizing-bayes-theorem/ http://yudkowsky.net/rational/bayes ht
Bayesian statistics tutorial Here's a place to start: ftp://selab.janelia.org/pub/publications/Eddy-ATG3/Eddy-ATG3-reprint.pdf http://blog.oscarbonilla.com/2009/05/visualizing-bayes-theorem/ http://yudkowsky.net/rational/bayes http://www.math.umass.edu/~lavine/whatisbayes.pdf http://en.wikipedia.org/wiki/Bayesian_inference http://en.wikipedia.org/wiki/Bayesian_probability Tutorial_on_Bayesian_Statistics_and_Clinical_Trials
Bayesian statistics tutorial Here's a place to start: ftp://selab.janelia.org/pub/publications/Eddy-ATG3/Eddy-ATG3-reprint.pdf http://blog.oscarbonilla.com/2009/05/visualizing-bayes-theorem/ http://yudkowsky.net/rational/bayes ht
5,483
Bayesian statistics tutorial
If you'd like to try a few learn by examples, you may be interested in "Bayesian Computation in R" by Jim Albert. Its related R package is called LearnBayes.
Bayesian statistics tutorial
If you'd like to try a few learn by examples, you may be interested in "Bayesian Computation in R" by Jim Albert. Its related R package is called LearnBayes.
Bayesian statistics tutorial If you'd like to try a few learn by examples, you may be interested in "Bayesian Computation in R" by Jim Albert. Its related R package is called LearnBayes.
Bayesian statistics tutorial If you'd like to try a few learn by examples, you may be interested in "Bayesian Computation in R" by Jim Albert. Its related R package is called LearnBayes.
5,484
Bayesian statistics tutorial
Some more depth: http://math.tut.fi/~piche/bayes/notes01.pdf covers Bayes' theorem https://ccrma.stanford.edu/~jos/bayes/bayes.pdf and http://www-personal.une.edu.au/~jvanderw/Introduction_to_Bayesian_Statistics1.pdf are more about statistical applications
Bayesian statistics tutorial
Some more depth: http://math.tut.fi/~piche/bayes/notes01.pdf covers Bayes' theorem https://ccrma.stanford.edu/~jos/bayes/bayes.pdf and http://www-personal.une.edu.au/~jvanderw/Introduction_to_Bayesi
Bayesian statistics tutorial Some more depth: http://math.tut.fi/~piche/bayes/notes01.pdf covers Bayes' theorem https://ccrma.stanford.edu/~jos/bayes/bayes.pdf and http://www-personal.une.edu.au/~jvanderw/Introduction_to_Bayesian_Statistics1.pdf are more about statistical applications
Bayesian statistics tutorial Some more depth: http://math.tut.fi/~piche/bayes/notes01.pdf covers Bayes' theorem https://ccrma.stanford.edu/~jos/bayes/bayes.pdf and http://www-personal.une.edu.au/~jvanderw/Introduction_to_Bayesi
5,485
Bayesian statistics tutorial
These aren't complete tutorials on Bayesian statistics, but rather isolated explanations of individual concepts that I like. Just thought I'd add in case it helps. http://lesswrong.com/lw/2b0/bayes_theorem_illustrated_my_way - Graphical explanation of Bayes' theorem. What's the difference between a confidence interval and a credible interval? - Great example of the difference between confidence intervals and Bayesian credible intervals (and of the difference between frequentist statistics and Bayesian statistics in general). http://behind-the-enemy-lines.blogspot.com/2008/01/are-you-bayesian-or-frequentist-or.html - A simple example of how frequentists and Bayesians approach a problem differently, and how it leads to a different answer.
Bayesian statistics tutorial
These aren't complete tutorials on Bayesian statistics, but rather isolated explanations of individual concepts that I like. Just thought I'd add in case it helps. http://lesswrong.com/lw/2b0/bayes_t
Bayesian statistics tutorial These aren't complete tutorials on Bayesian statistics, but rather isolated explanations of individual concepts that I like. Just thought I'd add in case it helps. http://lesswrong.com/lw/2b0/bayes_theorem_illustrated_my_way - Graphical explanation of Bayes' theorem. What's the difference between a confidence interval and a credible interval? - Great example of the difference between confidence intervals and Bayesian credible intervals (and of the difference between frequentist statistics and Bayesian statistics in general). http://behind-the-enemy-lines.blogspot.com/2008/01/are-you-bayesian-or-frequentist-or.html - A simple example of how frequentists and Bayesians approach a problem differently, and how it leads to a different answer.
Bayesian statistics tutorial These aren't complete tutorials on Bayesian statistics, but rather isolated explanations of individual concepts that I like. Just thought I'd add in case it helps. http://lesswrong.com/lw/2b0/bayes_t
5,486
Bayesian statistics tutorial
I wrote a post on getting started with JAGS for Bayesian modelling. If you're keen to get started quickly then playing around with some variant of BUGS, such as JAGS, is a practical way to get started. To quote the abstract of the post This post provides links to various resources on getting started with Bayesian modelling using JAGS and R. It discusses: (1) what is JAGS; (2) why you might want to perform Bayesian modelling using JAGS; (3) how to install JAGS; (4) where to find further information on JAGS; (5) where to find examples of JAGS scripts in action; (6) where to ask questions; and (7) some interesting psychological applications of Bayesian modelling. In particular, you may find it useful to study some of the example scripts mentioned in the post.
Bayesian statistics tutorial
I wrote a post on getting started with JAGS for Bayesian modelling. If you're keen to get started quickly then playing around with some variant of BUGS, such as JAGS, is a practical way to get started
Bayesian statistics tutorial I wrote a post on getting started with JAGS for Bayesian modelling. If you're keen to get started quickly then playing around with some variant of BUGS, such as JAGS, is a practical way to get started. To quote the abstract of the post This post provides links to various resources on getting started with Bayesian modelling using JAGS and R. It discusses: (1) what is JAGS; (2) why you might want to perform Bayesian modelling using JAGS; (3) how to install JAGS; (4) where to find further information on JAGS; (5) where to find examples of JAGS scripts in action; (6) where to ask questions; and (7) some interesting psychological applications of Bayesian modelling. In particular, you may find it useful to study some of the example scripts mentioned in the post.
Bayesian statistics tutorial I wrote a post on getting started with JAGS for Bayesian modelling. If you're keen to get started quickly then playing around with some variant of BUGS, such as JAGS, is a practical way to get started
5,487
Bayesian statistics tutorial
You could try 'Teaching Bayesian Reasoning In Less Than Two Hours'.
Bayesian statistics tutorial
You could try 'Teaching Bayesian Reasoning In Less Than Two Hours'.
Bayesian statistics tutorial You could try 'Teaching Bayesian Reasoning In Less Than Two Hours'.
Bayesian statistics tutorial You could try 'Teaching Bayesian Reasoning In Less Than Two Hours'.
5,488
Bayesian statistics tutorial
The Bayes' rule guide on Arbital is the best resource I've ever found by a good margin. I like how they emphasize the odds form, include good visualizations, talk about how Bayesianism relates to philosophy, and include different learning paths depending on your background and interests.
Bayesian statistics tutorial
The Bayes' rule guide on Arbital is the best resource I've ever found by a good margin. I like how they emphasize the odds form, include good visualizations, talk about how Bayesianism relates to phil
Bayesian statistics tutorial The Bayes' rule guide on Arbital is the best resource I've ever found by a good margin. I like how they emphasize the odds form, include good visualizations, talk about how Bayesianism relates to philosophy, and include different learning paths depending on your background and interests.
Bayesian statistics tutorial The Bayes' rule guide on Arbital is the best resource I've ever found by a good margin. I like how they emphasize the odds form, include good visualizations, talk about how Bayesianism relates to phil
5,489
First R packages source code to study in preparation for writing own package
I would suggest looking at the zoo package for the following reasons: It has several well-written vignettes; It uses a namespace using useDynLib, import, export, and S3method; It has several unit tests using RUnit; It provides good examples of how to create/document S3 methods; It has some calls to C code via the .Call interface; It contains a (plotting) demo; It aims to be consistent with the core R installation (e.g. functions behave similarly, it doesn't mask / override base functions, etc.) It doesn't use roxygen, which is very handy, but 7 out of 8 ain't bad. ;-) To respond to your criteria: The concept is simple: zoo is a matrix-like class ordered by something. No domain-specific knowledge necessary. zoo does seem to have a few idiosyncratic coding conventions, but nothing over-the-top that prevents understanding the code. zoo aims to be as consistent with R as possible.
First R packages source code to study in preparation for writing own package
I would suggest looking at the zoo package for the following reasons: It has several well-written vignettes; It uses a namespace using useDynLib, import, export, and S3method; It has several unit tes
First R packages source code to study in preparation for writing own package I would suggest looking at the zoo package for the following reasons: It has several well-written vignettes; It uses a namespace using useDynLib, import, export, and S3method; It has several unit tests using RUnit; It provides good examples of how to create/document S3 methods; It has some calls to C code via the .Call interface; It contains a (plotting) demo; It aims to be consistent with the core R installation (e.g. functions behave similarly, it doesn't mask / override base functions, etc.) It doesn't use roxygen, which is very handy, but 7 out of 8 ain't bad. ;-) To respond to your criteria: The concept is simple: zoo is a matrix-like class ordered by something. No domain-specific knowledge necessary. zoo does seem to have a few idiosyncratic coding conventions, but nothing over-the-top that prevents understanding the code. zoo aims to be as consistent with R as possible.
First R packages source code to study in preparation for writing own package I would suggest looking at the zoo package for the following reasons: It has several well-written vignettes; It uses a namespace using useDynLib, import, export, and S3method; It has several unit tes
5,490
First R packages source code to study in preparation for writing own package
I do not consider myself an established R package developer but have recently undergone the process of writing and maintaining a package for my work environment. I had previously been writing / maintaining / updating a set of scripts that I would pass from project to project via the source() function. The end result of this was that I'd end up with mostly redundant scripts hanging out in various places on our network drives. It was never clear where the most up-to-date set of scripts were located. I have since migrated to writing / maintaining a package utilizing roxygen. It has drastically simplified my life and made it easier to share my work with colleagues. Based on your criteria above, I second the recommendation of reviewing the packages that Hadley has written. In particular, I think reading through the devtools wiki would be very helpful. Hadley's code is well documented and several of his packages utilize roxygen. I think writing and maintaining one document for both R functions and R documentation is much easier than having them split out in two locations (.R and .RD files). Hadley's packages also serve some fairly basic concepts and are relatively easy to deparse (imho) if you are looking for pointers on the technical aspect ideas. I find myself digging through the plyr source code when I'm looking for a pointer on roxygen documentation or other fundamental tasks.
First R packages source code to study in preparation for writing own package
I do not consider myself an established R package developer but have recently undergone the process of writing and maintaining a package for my work environment. I had previously been writing / mainta
First R packages source code to study in preparation for writing own package I do not consider myself an established R package developer but have recently undergone the process of writing and maintaining a package for my work environment. I had previously been writing / maintaining / updating a set of scripts that I would pass from project to project via the source() function. The end result of this was that I'd end up with mostly redundant scripts hanging out in various places on our network drives. It was never clear where the most up-to-date set of scripts were located. I have since migrated to writing / maintaining a package utilizing roxygen. It has drastically simplified my life and made it easier to share my work with colleagues. Based on your criteria above, I second the recommendation of reviewing the packages that Hadley has written. In particular, I think reading through the devtools wiki would be very helpful. Hadley's code is well documented and several of his packages utilize roxygen. I think writing and maintaining one document for both R functions and R documentation is much easier than having them split out in two locations (.R and .RD files). Hadley's packages also serve some fairly basic concepts and are relatively easy to deparse (imho) if you are looking for pointers on the technical aspect ideas. I find myself digging through the plyr source code when I'm looking for a pointer on roxygen documentation or other fundamental tasks.
First R packages source code to study in preparation for writing own package I do not consider myself an established R package developer but have recently undergone the process of writing and maintaining a package for my work environment. I had previously been writing / mainta
5,491
First R packages source code to study in preparation for writing own package
Why not take an empirically-driven random sampling approach? Just pick a few and see which work for you. Kidding aside, just look at a few packages you yourself use and are familiar with. Downloading them is easy, or if you prefer you can also view them via a web interface at R-Forge, RForge, or Github. You will most likely end up with different packages for different ideas. Some may help you with the way they integrate, say, a vignette. Some may help with compiled code. Or unit tests. Or Roxygen. There are about 2600 of them, so why obsess over a single best?
First R packages source code to study in preparation for writing own package
Why not take an empirically-driven random sampling approach? Just pick a few and see which work for you. Kidding aside, just look at a few packages you yourself use and are familiar with. Downloadin
First R packages source code to study in preparation for writing own package Why not take an empirically-driven random sampling approach? Just pick a few and see which work for you. Kidding aside, just look at a few packages you yourself use and are familiar with. Downloading them is easy, or if you prefer you can also view them via a web interface at R-Forge, RForge, or Github. You will most likely end up with different packages for different ideas. Some may help you with the way they integrate, say, a vignette. Some may help with compiled code. Or unit tests. Or Roxygen. There are about 2600 of them, so why obsess over a single best?
First R packages source code to study in preparation for writing own package Why not take an empirically-driven random sampling approach? Just pick a few and see which work for you. Kidding aside, just look at a few packages you yourself use and are familiar with. Downloadin
5,492
First R packages source code to study in preparation for writing own package
Another piece of advise might be to look at packages yours will be depending on or interacting with, especially if these implement some items Joshua Ulrich mentioned or have been written by renowned authors. It might be helpful to learn how things are done in your field, to ensure some compatibility. Often people will have thought about certain issues and reading their solution migth be helpful.
First R packages source code to study in preparation for writing own package
Another piece of advise might be to look at packages yours will be depending on or interacting with, especially if these implement some items Joshua Ulrich mentioned or have been written by renowned a
First R packages source code to study in preparation for writing own package Another piece of advise might be to look at packages yours will be depending on or interacting with, especially if these implement some items Joshua Ulrich mentioned or have been written by renowned authors. It might be helpful to learn how things are done in your field, to ensure some compatibility. Often people will have thought about certain issues and reading their solution migth be helpful.
First R packages source code to study in preparation for writing own package Another piece of advise might be to look at packages yours will be depending on or interacting with, especially if these implement some items Joshua Ulrich mentioned or have been written by renowned a
5,493
First R packages source code to study in preparation for writing own package
i would recommend hadley's reshape package. you can find the source at https://github.com/hadley/reshape
First R packages source code to study in preparation for writing own package
i would recommend hadley's reshape package. you can find the source at https://github.com/hadley/reshape
First R packages source code to study in preparation for writing own package i would recommend hadley's reshape package. you can find the source at https://github.com/hadley/reshape
First R packages source code to study in preparation for writing own package i would recommend hadley's reshape package. you can find the source at https://github.com/hadley/reshape
5,494
Does the reciprocal of a probability represent anything?
Yes, it provides a 1-in-$n$ scale for probabilities. For example, the reciprocal of .01 is 100, so an event with probability .01 has a 1 in 100 chance of happening. This is a useful way to represent small probabilities, such as .0023, which is about 1 in 435.
Does the reciprocal of a probability represent anything?
Yes, it provides a 1-in-$n$ scale for probabilities. For example, the reciprocal of .01 is 100, so an event with probability .01 has a 1 in 100 chance of happening. This is a useful way to represent
Does the reciprocal of a probability represent anything? Yes, it provides a 1-in-$n$ scale for probabilities. For example, the reciprocal of .01 is 100, so an event with probability .01 has a 1 in 100 chance of happening. This is a useful way to represent small probabilities, such as .0023, which is about 1 in 435.
Does the reciprocal of a probability represent anything? Yes, it provides a 1-in-$n$ scale for probabilities. For example, the reciprocal of .01 is 100, so an event with probability .01 has a 1 in 100 chance of happening. This is a useful way to represent
5,495
Does the reciprocal of a probability represent anything?
$\frac 1p$ does not mean anything in general (but for a particular meaning for a specific random variable see the answer by Alex R.). However, the logarithm of $\frac 1p$ to base 2, viz., $\log_2 \frac 1p = -\log_2 p$ is the amount of information (measured in bits) that you receive when you are told that the event (of probability $p$) has occurred. If the event has probability $\frac 12$, then you receive one bit of information when you are told that it has occurred. In a different answer, Kodiologist has suggested that if $N$ is chosen as $\left\lfloor\frac 1p\right\rfloor$ or $\left\lceil\frac 1p\right\rceil$, then one can say that $$\textrm{an event of probability } p ~\textrm{has approximately } 1 ~ \textrm{chance in } N ~ \textrm{of occurring}$$ So, since $2^{20} \approx 10^{6}$, the occurrence of an event that has $1$ chance in a million of occurring conveys only 20 bits or so of information to you, far less than is needed to transmit "Cubs win!" in ASCII ! :-)
Does the reciprocal of a probability represent anything?
$\frac 1p$ does not mean anything in general (but for a particular meaning for a specific random variable see the answer by Alex R.). However, the logarithm of $\frac 1p$ to base 2, viz., $\log_2 \fr
Does the reciprocal of a probability represent anything? $\frac 1p$ does not mean anything in general (but for a particular meaning for a specific random variable see the answer by Alex R.). However, the logarithm of $\frac 1p$ to base 2, viz., $\log_2 \frac 1p = -\log_2 p$ is the amount of information (measured in bits) that you receive when you are told that the event (of probability $p$) has occurred. If the event has probability $\frac 12$, then you receive one bit of information when you are told that it has occurred. In a different answer, Kodiologist has suggested that if $N$ is chosen as $\left\lfloor\frac 1p\right\rfloor$ or $\left\lceil\frac 1p\right\rceil$, then one can say that $$\textrm{an event of probability } p ~\textrm{has approximately } 1 ~ \textrm{chance in } N ~ \textrm{of occurring}$$ So, since $2^{20} \approx 10^{6}$, the occurrence of an event that has $1$ chance in a million of occurring conveys only 20 bits or so of information to you, far less than is needed to transmit "Cubs win!" in ASCII ! :-)
Does the reciprocal of a probability represent anything? $\frac 1p$ does not mean anything in general (but for a particular meaning for a specific random variable see the answer by Alex R.). However, the logarithm of $\frac 1p$ to base 2, viz., $\log_2 \fr
5,496
Does the reciprocal of a probability represent anything?
In the case of a geometric distribution, the reciprocal $1/p$ represents the expected number of throws you need to make to see one success. For example if a coin has probability $0.2$ of landing on heads, then you'd need to throw it around 5 times to see one head.
Does the reciprocal of a probability represent anything?
In the case of a geometric distribution, the reciprocal $1/p$ represents the expected number of throws you need to make to see one success. For example if a coin has probability $0.2$ of landing on he
Does the reciprocal of a probability represent anything? In the case of a geometric distribution, the reciprocal $1/p$ represents the expected number of throws you need to make to see one success. For example if a coin has probability $0.2$ of landing on heads, then you'd need to throw it around 5 times to see one head.
Does the reciprocal of a probability represent anything? In the case of a geometric distribution, the reciprocal $1/p$ represents the expected number of throws you need to make to see one success. For example if a coin has probability $0.2$ of landing on he
5,497
Does the reciprocal of a probability represent anything?
What are sometimes called European odds or decimal odds if fair are the reciprocal of the probability of winning, which might be a Bernoulli random variable $P(X=1)$. For example if the quoted odds are "1.25" and you bet $8$ then you get $8 \times 1.25=10$ back if you win (including your original stake, so a gain of $2$) and nothing back if you lose. This would be a fair bet if the probability of winning was $\dfrac{8}{10}=0.8$, which has a reciprocal of $\dfrac{1}{0.8}=1.25$. Similarly if the quoted odds are "5.00" and you bet $8$ then you get $8 \times 5=40$ back if you win (including your original stake, so a gain of $32$) and nothing back if you lose. This would be a fair bet if the probability of winning was $\dfrac{8}{40}=0.2$, which has a reciprocal of $\dfrac{1}{0.2}=5.00$.
Does the reciprocal of a probability represent anything?
What are sometimes called European odds or decimal odds if fair are the reciprocal of the probability of winning, which might be a Bernoulli random variable $P(X=1)$. For example if the quoted odds a
Does the reciprocal of a probability represent anything? What are sometimes called European odds or decimal odds if fair are the reciprocal of the probability of winning, which might be a Bernoulli random variable $P(X=1)$. For example if the quoted odds are "1.25" and you bet $8$ then you get $8 \times 1.25=10$ back if you win (including your original stake, so a gain of $2$) and nothing back if you lose. This would be a fair bet if the probability of winning was $\dfrac{8}{10}=0.8$, which has a reciprocal of $\dfrac{1}{0.8}=1.25$. Similarly if the quoted odds are "5.00" and you bet $8$ then you get $8 \times 5=40$ back if you win (including your original stake, so a gain of $32$) and nothing back if you lose. This would be a fair bet if the probability of winning was $\dfrac{8}{40}=0.2$, which has a reciprocal of $\dfrac{1}{0.2}=5.00$.
Does the reciprocal of a probability represent anything? What are sometimes called European odds or decimal odds if fair are the reciprocal of the probability of winning, which might be a Bernoulli random variable $P(X=1)$. For example if the quoted odds a
5,498
Does the reciprocal of a probability represent anything?
In the context of survey design, the inverse of the probability of being included in the sample is called sampling weight. For example, in a representative sample of some population, a respondent with the weight of 100 has 1/100 chance to be included in the sample, in other words, this respondent represents 100 similar people in the population.
Does the reciprocal of a probability represent anything?
In the context of survey design, the inverse of the probability of being included in the sample is called sampling weight. For example, in a representative sample of some population, a respondent with
Does the reciprocal of a probability represent anything? In the context of survey design, the inverse of the probability of being included in the sample is called sampling weight. For example, in a representative sample of some population, a respondent with the weight of 100 has 1/100 chance to be included in the sample, in other words, this respondent represents 100 similar people in the population.
Does the reciprocal of a probability represent anything? In the context of survey design, the inverse of the probability of being included in the sample is called sampling weight. For example, in a representative sample of some population, a respondent with
5,499
Does the reciprocal of a probability represent anything?
In statistical mechanics, a system has a large number of microstates, and it is a fundamental principle that these are all assumed to be equally likely. The reciprocal of the probability of a particular microstate is therefore the number of possible microstates, and this has a name in physics; it is (confusingly) called the thermodynamic probability. The log of the thermodynamic probability is the entropy of the system, up to a constant.
Does the reciprocal of a probability represent anything?
In statistical mechanics, a system has a large number of microstates, and it is a fundamental principle that these are all assumed to be equally likely. The reciprocal of the probability of a particul
Does the reciprocal of a probability represent anything? In statistical mechanics, a system has a large number of microstates, and it is a fundamental principle that these are all assumed to be equally likely. The reciprocal of the probability of a particular microstate is therefore the number of possible microstates, and this has a name in physics; it is (confusingly) called the thermodynamic probability. The log of the thermodynamic probability is the entropy of the system, up to a constant.
Does the reciprocal of a probability represent anything? In statistical mechanics, a system has a large number of microstates, and it is a fundamental principle that these are all assumed to be equally likely. The reciprocal of the probability of a particul
5,500
Understanding regressions - the role of the model
It helps to view regression as a linear approximation of the true form. Suppose the true relationship is $$y=f(x_1,...,x_k)$$ with $x_1,...,x_k$ factors explaining the $y$. Then first order Taylor approximation of $f$ around zero is: $$f(x_1,...,x_k)=f(0,...,0)+\sum_{i=1}^{k}\frac{\partial f(0)}{\partial x_k}x_k+\varepsilon,$$ where $\varepsilon$ is the approximation error. Now denote $\alpha_0=f(0,...,0)$ and $\alpha_k=\frac{\partial{f}(0)}{\partial x_k}$ and you have a regression: $$y=\alpha_0+\alpha_1 x_1+...+\alpha_k x_k + \varepsilon$$ So although you do not know the true relationship, if $\varepsilon$ is small you get approximation, from which you can still deduce useful conclusions.
Understanding regressions - the role of the model
It helps to view regression as a linear approximation of the true form. Suppose the true relationship is $$y=f(x_1,...,x_k)$$ with $x_1,...,x_k$ factors explaining the $y$. Then first order Taylor ap
Understanding regressions - the role of the model It helps to view regression as a linear approximation of the true form. Suppose the true relationship is $$y=f(x_1,...,x_k)$$ with $x_1,...,x_k$ factors explaining the $y$. Then first order Taylor approximation of $f$ around zero is: $$f(x_1,...,x_k)=f(0,...,0)+\sum_{i=1}^{k}\frac{\partial f(0)}{\partial x_k}x_k+\varepsilon,$$ where $\varepsilon$ is the approximation error. Now denote $\alpha_0=f(0,...,0)$ and $\alpha_k=\frac{\partial{f}(0)}{\partial x_k}$ and you have a regression: $$y=\alpha_0+\alpha_1 x_1+...+\alpha_k x_k + \varepsilon$$ So although you do not know the true relationship, if $\varepsilon$ is small you get approximation, from which you can still deduce useful conclusions.
Understanding regressions - the role of the model It helps to view regression as a linear approximation of the true form. Suppose the true relationship is $$y=f(x_1,...,x_k)$$ with $x_1,...,x_k$ factors explaining the $y$. Then first order Taylor ap