idx
int64 1
56k
| question
stringlengths 15
155
| answer
stringlengths 2
29.2k
⌀ | question_cut
stringlengths 15
100
| answer_cut
stringlengths 2
200
⌀ | conversation
stringlengths 47
29.3k
| conversation_cut
stringlengths 47
301
|
|---|---|---|---|---|---|---|
43,501
|
Negative variance from inverse Hessian matrix
|
The variance covariance matrix can be aproximated by the inverse of the negative Hessian H (matrix of second order partial derivatives). May be the reason is that you are approximating using the inverse $H$, when it should be the inverse of the negative H.
|
Negative variance from inverse Hessian matrix
|
The variance covariance matrix can be aproximated by the inverse of the negative Hessian H (matrix of second order partial derivatives). May be the reason is that you are approximating using the inver
|
Negative variance from inverse Hessian matrix
The variance covariance matrix can be aproximated by the inverse of the negative Hessian H (matrix of second order partial derivatives). May be the reason is that you are approximating using the inverse $H$, when it should be the inverse of the negative H.
|
Negative variance from inverse Hessian matrix
The variance covariance matrix can be aproximated by the inverse of the negative Hessian H (matrix of second order partial derivatives). May be the reason is that you are approximating using the inver
|
43,502
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
|
This question is a little old, but maybe it is still relevant.
As far as I understand your question, if you have $T$ data available, and are trying to predict observations in the future, surely you're "cheating" if you're using the whole data to "predict" $y_{t}$ with $t<T$. Indeed, what you're doing there is smoothing, not prediction. As in other ML tasks, choose a given amount of training observations $T_{learn}<T$, then predict $y_{T_{learn}+k}$ (as far ahead in the future as you need) and evaluate performance. It seems to me that your setup is doing this: by sliding $T_{learn}$ you're learning more informed model and you should be able to show that your predictions get better.
So, I don't think that that FFBS has an intrinsic "look-ahead bias". It just depends on how you use it. I think MCMC with Gibbs sampling should work well in estimating your model.
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
|
This question is a little old, but maybe it is still relevant.
As far as I understand your question, if you have $T$ data available, and are trying to predict observations in the future, surely you're
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
This question is a little old, but maybe it is still relevant.
As far as I understand your question, if you have $T$ data available, and are trying to predict observations in the future, surely you're "cheating" if you're using the whole data to "predict" $y_{t}$ with $t<T$. Indeed, what you're doing there is smoothing, not prediction. As in other ML tasks, choose a given amount of training observations $T_{learn}<T$, then predict $y_{T_{learn}+k}$ (as far ahead in the future as you need) and evaluate performance. It seems to me that your setup is doing this: by sliding $T_{learn}$ you're learning more informed model and you should be able to show that your predictions get better.
So, I don't think that that FFBS has an intrinsic "look-ahead bias". It just depends on how you use it. I think MCMC with Gibbs sampling should work well in estimating your model.
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
This question is a little old, but maybe it is still relevant.
As far as I understand your question, if you have $T$ data available, and are trying to predict observations in the future, surely you're
|
43,503
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
|
If the parameters you are estimating do not vary over time, you may split the observed time series $y_{1:T}$ in two series, $y_{1:k}$ and $y_{k+1:T}$. Then you would apply MCMC on $y_{1:k}$ in order to sample from the posterior distribution of your parameters. After that, you could fix your parameters at some estimate taken from the posterior, e.g. the posterior mean or maximum, and evaluate the predictions on $y_{k+1:T}$.
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
|
If the parameters you are estimating do not vary over time, you may split the observed time series $y_{1:T}$ in two series, $y_{1:k}$ and $y_{k+1:T}$. Then you would apply MCMC on $y_{1:k}$ in order t
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
If the parameters you are estimating do not vary over time, you may split the observed time series $y_{1:T}$ in two series, $y_{1:k}$ and $y_{k+1:T}$. Then you would apply MCMC on $y_{1:k}$ in order to sample from the posterior distribution of your parameters. After that, you could fix your parameters at some estimate taken from the posterior, e.g. the posterior mean or maximum, and evaluate the predictions on $y_{k+1:T}$.
|
Forward Filtering Backwards Sampling (FFBS) and Look-Ahead Bias
If the parameters you are estimating do not vary over time, you may split the observed time series $y_{1:T}$ in two series, $y_{1:k}$ and $y_{k+1:T}$. Then you would apply MCMC on $y_{1:k}$ in order t
|
43,504
|
How to estimate the point of divergence between two continuous time survival curves?
|
There is some ambiguity in what the OP means by the "pair of survival curves" obtained from each of the "N samples."
If the "survival curves" are changes in the value of some continuous variable as a function of time from a maximum initial value down to zero for two cases or two groups within each of the N samples, then any of a variety of change-point approaches could work in principle, as suggested in another answer. The task would be simplified if there were an underlying theoretical model, such as exponential decay with a time constant that changes for one of the pair during the period of observation.
If the "survival curves" are time-to-event data for two groups distinguished within each of the N samples, then the problem is more complicated. A survey of change-point packages in R found only one that accepts survival models, with an approach that is "not guaranteed to work," according to its manual, for model types other than lm or glm. Even that package does not meet the requirements of the OP, as it looks for change-points for regression coefficients within values of a continuous predictor variable, not for change points in time as the OP seeks.
So for time-to-event data what's needed is a way to search for the time of a step change in the relationship between the group membership within each sample and survival. For a Cox survival model that would be the time of a step change in the regression coefficient for group, where group represents which pair within a sample the data are from. The flexible survival regression approaches provided by the timereg package seem to be designed for coefficients that are continuous functions of time rather than step functions, but might serve this purpose. Alternatively, there might be ways to adapt the approach to step-function coefficient changes described in the time-dependent vignette for the R survival package. As that splits data into strata based on the suspected time of the step change there would have to be some iterative approach to estimate the actual divergence time, and I'm not sure what would need to be done to estimate confidence intervals or to avoid overfitting with that approach.
Finally, for distinguishing when Kaplan-Meier survival curves diverge, the bpcp package uses the individual KM curves to estimate their differences and associated CI at fixed times. Applied over a set of times, that approach could be used to determine estimated survival differences over time. Change-point analysis might then identify a time of divergence from 0 difference. Bootstrapping could presumably "statistically validate" the results.
|
How to estimate the point of divergence between two continuous time survival curves?
|
There is some ambiguity in what the OP means by the "pair of survival curves" obtained from each of the "N samples."
If the "survival curves" are changes in the value of some continuous variable as a
|
How to estimate the point of divergence between two continuous time survival curves?
There is some ambiguity in what the OP means by the "pair of survival curves" obtained from each of the "N samples."
If the "survival curves" are changes in the value of some continuous variable as a function of time from a maximum initial value down to zero for two cases or two groups within each of the N samples, then any of a variety of change-point approaches could work in principle, as suggested in another answer. The task would be simplified if there were an underlying theoretical model, such as exponential decay with a time constant that changes for one of the pair during the period of observation.
If the "survival curves" are time-to-event data for two groups distinguished within each of the N samples, then the problem is more complicated. A survey of change-point packages in R found only one that accepts survival models, with an approach that is "not guaranteed to work," according to its manual, for model types other than lm or glm. Even that package does not meet the requirements of the OP, as it looks for change-points for regression coefficients within values of a continuous predictor variable, not for change points in time as the OP seeks.
So for time-to-event data what's needed is a way to search for the time of a step change in the relationship between the group membership within each sample and survival. For a Cox survival model that would be the time of a step change in the regression coefficient for group, where group represents which pair within a sample the data are from. The flexible survival regression approaches provided by the timereg package seem to be designed for coefficients that are continuous functions of time rather than step functions, but might serve this purpose. Alternatively, there might be ways to adapt the approach to step-function coefficient changes described in the time-dependent vignette for the R survival package. As that splits data into strata based on the suspected time of the step change there would have to be some iterative approach to estimate the actual divergence time, and I'm not sure what would need to be done to estimate confidence intervals or to avoid overfitting with that approach.
Finally, for distinguishing when Kaplan-Meier survival curves diverge, the bpcp package uses the individual KM curves to estimate their differences and associated CI at fixed times. Applied over a set of times, that approach could be used to determine estimated survival differences over time. Change-point analysis might then identify a time of divergence from 0 difference. Bootstrapping could presumably "statistically validate" the results.
|
How to estimate the point of divergence between two continuous time survival curves?
There is some ambiguity in what the OP means by the "pair of survival curves" obtained from each of the "N samples."
If the "survival curves" are changes in the value of some continuous variable as a
|
43,505
|
How to estimate the point of divergence between two continuous time survival curves?
|
One method that might be useful is change point detection.
https://en.wikipedia.org/wiki/Change_detection
There are many variants, but in general you partition the data into two sets and compute a test statistic, such as the Kolmogov-Smirnov, to determine whether the two distributions are the same. If null hypothesis is rejected, there is a break or "change point" at time t. In order to determine all such times, the test is repeated for each time step.
|
How to estimate the point of divergence between two continuous time survival curves?
|
One method that might be useful is change point detection.
https://en.wikipedia.org/wiki/Change_detection
There are many variants, but in general you partition the data into two sets and compute a tes
|
How to estimate the point of divergence between two continuous time survival curves?
One method that might be useful is change point detection.
https://en.wikipedia.org/wiki/Change_detection
There are many variants, but in general you partition the data into two sets and compute a test statistic, such as the Kolmogov-Smirnov, to determine whether the two distributions are the same. If null hypothesis is rejected, there is a break or "change point" at time t. In order to determine all such times, the test is repeated for each time step.
|
How to estimate the point of divergence between two continuous time survival curves?
One method that might be useful is change point detection.
https://en.wikipedia.org/wiki/Change_detection
There are many variants, but in general you partition the data into two sets and compute a tes
|
43,506
|
Good (2d) visualization of a mixture model clustering
|
Try visualization methods, such as surface plots and other techniques for high-dimensional data visualization, described in the paper "mclust Version 4 for R: Normal Mixture Modeling for Model-Based Clustering, Classification, and Density Estimation" by Chris Fraley, Adrian E. Raftery, T. Brendan Murphy and Luca Scrucca (http://www.stat.washington.edu/research/reports/2012/tr597.pdf). Specifically, check section 8 (pp. 35-43) and plotting functions summary on p. 52.
|
Good (2d) visualization of a mixture model clustering
|
Try visualization methods, such as surface plots and other techniques for high-dimensional data visualization, described in the paper "mclust Version 4 for R: Normal Mixture Modeling for Model-Based C
|
Good (2d) visualization of a mixture model clustering
Try visualization methods, such as surface plots and other techniques for high-dimensional data visualization, described in the paper "mclust Version 4 for R: Normal Mixture Modeling for Model-Based Clustering, Classification, and Density Estimation" by Chris Fraley, Adrian E. Raftery, T. Brendan Murphy and Luca Scrucca (http://www.stat.washington.edu/research/reports/2012/tr597.pdf). Specifically, check section 8 (pp. 35-43) and plotting functions summary on p. 52.
|
Good (2d) visualization of a mixture model clustering
Try visualization methods, such as surface plots and other techniques for high-dimensional data visualization, described in the paper "mclust Version 4 for R: Normal Mixture Modeling for Model-Based C
|
43,507
|
Understanding vec2var conversion in R
|
The vec2var() function will provide an object of class vec2var.
You cannot convert it further to the class varest for standard VAR, but there are still many methods that will work on it, check it with:
methods(class = "vec2var")
Will return:
[1] fevd fitted irf logLik Phi plot predict print Psi residuals
So you can run irf(), fevd() and so on, to "perform VAR analyses on this output" as you want. For exampe, if you want to run the IRF, do:
plot(irf(vec2var(x)))
The only thing you cannot get easily are standard errors for the coefficients of the (constrained) VAR representation.
|
Understanding vec2var conversion in R
|
The vec2var() function will provide an object of class vec2var.
You cannot convert it further to the class varest for standard VAR, but there are still many methods that will work on it, check it wit
|
Understanding vec2var conversion in R
The vec2var() function will provide an object of class vec2var.
You cannot convert it further to the class varest for standard VAR, but there are still many methods that will work on it, check it with:
methods(class = "vec2var")
Will return:
[1] fevd fitted irf logLik Phi plot predict print Psi residuals
So you can run irf(), fevd() and so on, to "perform VAR analyses on this output" as you want. For exampe, if you want to run the IRF, do:
plot(irf(vec2var(x)))
The only thing you cannot get easily are standard errors for the coefficients of the (constrained) VAR representation.
|
Understanding vec2var conversion in R
The vec2var() function will provide an object of class vec2var.
You cannot convert it further to the class varest for standard VAR, but there are still many methods that will work on it, check it wit
|
43,508
|
Zero-inflation on steroids: choose among Poisson, negative binomial and zero-inflated regressions
|
You have 13 observations that are non-zero and only 3 observations that are greater than 1. Hence, I believe the best thing you can do is to use a binary regression only (0 vs > 0). Possibly it could help to add some form of regularization for that as well, e.g. bias reduction (see package brglm), because non-zeros are so rare.
Furthermore, I would recommend to bring the predict variables to a similar scale, e.g., dividing predict2 by 1e6 or so. Otherwise, numerical optimization algorithms have problems. This might improve convergence for glm.nb and zeroinfl (which by the way does not return nothing - there are coefficients but the covariance matrix estimate does not seem valid).
|
Zero-inflation on steroids: choose among Poisson, negative binomial and zero-inflated regressions
|
You have 13 observations that are non-zero and only 3 observations that are greater than 1. Hence, I believe the best thing you can do is to use a binary regression only (0 vs > 0). Possibly it could
|
Zero-inflation on steroids: choose among Poisson, negative binomial and zero-inflated regressions
You have 13 observations that are non-zero and only 3 observations that are greater than 1. Hence, I believe the best thing you can do is to use a binary regression only (0 vs > 0). Possibly it could help to add some form of regularization for that as well, e.g. bias reduction (see package brglm), because non-zeros are so rare.
Furthermore, I would recommend to bring the predict variables to a similar scale, e.g., dividing predict2 by 1e6 or so. Otherwise, numerical optimization algorithms have problems. This might improve convergence for glm.nb and zeroinfl (which by the way does not return nothing - there are coefficients but the covariance matrix estimate does not seem valid).
|
Zero-inflation on steroids: choose among Poisson, negative binomial and zero-inflated regressions
You have 13 observations that are non-zero and only 3 observations that are greater than 1. Hence, I believe the best thing you can do is to use a binary regression only (0 vs > 0). Possibly it could
|
43,509
|
Are Restricted Boltzmann Machines better than Stacked Auto encoders and why?
|
Auto-encoders typically feature many hidden layers. This causes a variety of problems for the common backpropagation-style training methods, because the backpropagated errors become very small in the first few layers.
A solution is to do pretraining, e.g. use initial weights that approximate the final solution. One pretraining technique treats a set of two layers like an RBM to obtain a good set of starting weights which are then fine-tuned using backpropagation. RBMs are useful here because contrastive divergence does not suffer from the same issues as backpropagation.
|
Are Restricted Boltzmann Machines better than Stacked Auto encoders and why?
|
Auto-encoders typically feature many hidden layers. This causes a variety of problems for the common backpropagation-style training methods, because the backpropagated errors become very small in the
|
Are Restricted Boltzmann Machines better than Stacked Auto encoders and why?
Auto-encoders typically feature many hidden layers. This causes a variety of problems for the common backpropagation-style training methods, because the backpropagated errors become very small in the first few layers.
A solution is to do pretraining, e.g. use initial weights that approximate the final solution. One pretraining technique treats a set of two layers like an RBM to obtain a good set of starting weights which are then fine-tuned using backpropagation. RBMs are useful here because contrastive divergence does not suffer from the same issues as backpropagation.
|
Are Restricted Boltzmann Machines better than Stacked Auto encoders and why?
Auto-encoders typically feature many hidden layers. This causes a variety of problems for the common backpropagation-style training methods, because the backpropagated errors become very small in the
|
43,510
|
Constants in a DLM Model R
|
If you set the last three terms of m0 equal to zero and the variances in C0 and W equal to 10^-7, you don't give $\mu$ much of a chance to take off from zero. Not surprising that they come out as zero.
|
Constants in a DLM Model R
|
If you set the last three terms of m0 equal to zero and the variances in C0 and W equal to 10^-7, you don't give $\mu$ much of a chance to take off from zero. Not surprising that they come out as zero
|
Constants in a DLM Model R
If you set the last three terms of m0 equal to zero and the variances in C0 and W equal to 10^-7, you don't give $\mu$ much of a chance to take off from zero. Not surprising that they come out as zero.
|
Constants in a DLM Model R
If you set the last three terms of m0 equal to zero and the variances in C0 and W equal to 10^-7, you don't give $\mu$ much of a chance to take off from zero. Not surprising that they come out as zero
|
43,511
|
Why can we use entropy to measure the quality of a language model?
|
(For more info, please check here: https://stackoverflow.com/questions/22933412/why-can-we-use-entropy-to-measure-the-quality-of-language-model)
After I re-digested the mentioned NLP book. I think I can explain it now.
What I calculated is actually the entropy of the language model distribution. It cannot be used to evaluate the effectiveness of a language model.
To evaluate a language model, we should measure how much surprise it gives us for real sequences in that language. For each real word encountered, the language model will give a probability p. And we use -log(p) to quantify the surprise. And we average the total surprise over a long enough sequence. So, in case of a 1000-letter sequence with 500 A and 500 B, the surprise given by the 1/3-2/3 model will be:
[-500log(1/3) - 500log(2/3)]/1000 = 1/2 * Log(9/2)
While the correct 1/2-1/2 model will give:
[-500log(1/2) - 500log(1/2)]/1000 = 1/2 * Log(8/2)
So, we can see, the 1/3, 2/3 model gives more surprise, which indicates it is worse than the correct model.
Only when the sequence is long enough, the average effect will mimic the expectation over the 1/2-1/2 distribution. If the sequence is short, it won't give a convincing result.
I didn't mention the cross-entropy here since I think this jargon is too intimidating and not much helpful to reveal the root cause.
ADD 1
I'd like to share a bit more about my understanding of the surprise mentioned in last paragraph.
The word surprise here is actually a synonym to the information gain. But it is very abstract and subjective say how much information we gained through some experience. So we need a concrete and objective measure of that. This measure is the $-log(p)$.
Well, among so many mathematical options, why do we choose this very function? I read about Psychophysics where it mentions the logarithmic rule that relate physical stimuli to the contents of consciousness. So I think this explains why we choose the $log(p)$. As to why we add - to it, I think it's because human tends to use positive numbers as measure, such as length, area. And probability is a value between [0-1], which leads to negative values in raw $log(p)$ function. Also, this measure design is consistent with our common sense that less possible things give more info/surprise. So that's it.
Put it simply, we use mathematics to describe/model the world. And mathematics just reflect our instinct ultimately.
|
Why can we use entropy to measure the quality of a language model?
|
(For more info, please check here: https://stackoverflow.com/questions/22933412/why-can-we-use-entropy-to-measure-the-quality-of-language-model)
After I re-digested the mentioned NLP book. I think I c
|
Why can we use entropy to measure the quality of a language model?
(For more info, please check here: https://stackoverflow.com/questions/22933412/why-can-we-use-entropy-to-measure-the-quality-of-language-model)
After I re-digested the mentioned NLP book. I think I can explain it now.
What I calculated is actually the entropy of the language model distribution. It cannot be used to evaluate the effectiveness of a language model.
To evaluate a language model, we should measure how much surprise it gives us for real sequences in that language. For each real word encountered, the language model will give a probability p. And we use -log(p) to quantify the surprise. And we average the total surprise over a long enough sequence. So, in case of a 1000-letter sequence with 500 A and 500 B, the surprise given by the 1/3-2/3 model will be:
[-500log(1/3) - 500log(2/3)]/1000 = 1/2 * Log(9/2)
While the correct 1/2-1/2 model will give:
[-500log(1/2) - 500log(1/2)]/1000 = 1/2 * Log(8/2)
So, we can see, the 1/3, 2/3 model gives more surprise, which indicates it is worse than the correct model.
Only when the sequence is long enough, the average effect will mimic the expectation over the 1/2-1/2 distribution. If the sequence is short, it won't give a convincing result.
I didn't mention the cross-entropy here since I think this jargon is too intimidating and not much helpful to reveal the root cause.
ADD 1
I'd like to share a bit more about my understanding of the surprise mentioned in last paragraph.
The word surprise here is actually a synonym to the information gain. But it is very abstract and subjective say how much information we gained through some experience. So we need a concrete and objective measure of that. This measure is the $-log(p)$.
Well, among so many mathematical options, why do we choose this very function? I read about Psychophysics where it mentions the logarithmic rule that relate physical stimuli to the contents of consciousness. So I think this explains why we choose the $log(p)$. As to why we add - to it, I think it's because human tends to use positive numbers as measure, such as length, area. And probability is a value between [0-1], which leads to negative values in raw $log(p)$ function. Also, this measure design is consistent with our common sense that less possible things give more info/surprise. So that's it.
Put it simply, we use mathematics to describe/model the world. And mathematics just reflect our instinct ultimately.
|
Why can we use entropy to measure the quality of a language model?
(For more info, please check here: https://stackoverflow.com/questions/22933412/why-can-we-use-entropy-to-measure-the-quality-of-language-model)
After I re-digested the mentioned NLP book. I think I c
|
43,512
|
Linearly dependent features
|
A little late but...
There's a measure called Pearson correlation that can be used to find linear correlation (dependence) between two variables X and Y. In short it is the covariance of the two variables divided by the product of their standard deviations:
The result is a value between +1 and −1 inclusive, where 1 is total positive correlation, 0 is no correlation, and −1 is total negative correlation.
Using it you can find which columns correlate and ignore (some of) them.
|
Linearly dependent features
|
A little late but...
There's a measure called Pearson correlation that can be used to find linear correlation (dependence) between two variables X and Y. In short it is the covariance of the two vari
|
Linearly dependent features
A little late but...
There's a measure called Pearson correlation that can be used to find linear correlation (dependence) between two variables X and Y. In short it is the covariance of the two variables divided by the product of their standard deviations:
The result is a value between +1 and −1 inclusive, where 1 is total positive correlation, 0 is no correlation, and −1 is total negative correlation.
Using it you can find which columns correlate and ignore (some of) them.
|
Linearly dependent features
A little late but...
There's a measure called Pearson correlation that can be used to find linear correlation (dependence) between two variables X and Y. In short it is the covariance of the two vari
|
43,513
|
Linearly dependent features
|
One approach would be to use an incomplete Cholesky factorisation, I have some MATLAB code here, see the paper by Fine and Scheinberg mentioned on that page for details.
|
Linearly dependent features
|
One approach would be to use an incomplete Cholesky factorisation, I have some MATLAB code here, see the paper by Fine and Scheinberg mentioned on that page for details.
|
Linearly dependent features
One approach would be to use an incomplete Cholesky factorisation, I have some MATLAB code here, see the paper by Fine and Scheinberg mentioned on that page for details.
|
Linearly dependent features
One approach would be to use an incomplete Cholesky factorisation, I have some MATLAB code here, see the paper by Fine and Scheinberg mentioned on that page for details.
|
43,514
|
Linearly dependent features
|
Yes, rank roughly tells you how many column-vectors (features) are independent.
No, you can't remove arbitrary columns. You can try removing random columns and calculating the rank of a result — you'll see different numbers. You need to remove only those features that are dependent.
Or, suppose that you generated data in a way that only the last 12 columns depend on the first ones. Can you still delete any 12 columns?
What you can do, though, is to perform PCA with number of components equal to the rank. This will not only reduce the dimension of your space, but will also decorrelate your features. The drawback of such transformation is a (possible) loss of interpretability, but it's not a mathematical thing, if you want to preserve it, you should delete features based on your insight.
Suppose your data matrix is of form $(X; Y)$ where $X$ and $X$ are submatrices of form n_rows × (n_cols - 12) and n_rows × 12, respectively. That means, that $X$ and $Y$ are submatrices formed by slicing out last 12 columns. If you want to find 12 linear combinations of $X$ to get $Y$, you actually want to solve 12 systems of linear equations of the form
$$ X b_i = Y_i $$
Where $Y_i$ is $i$th column of $Y$. Now unite all these equations into one by gluing together all the $b_i$ into a matrix $B$ of shape (n_cols - 12) × 12. The equations then become
$X B = Y$
Note that X is not square, thus is not invertible. Fortunately, the solution still exists, and is given by pseudoinversion:
$$B = (X^T X)^{-1} X Y$$
Note: now somebody thoughtful enough might notice that the way I provided the above formula looks like we can express any set of columns of original data matrix as the linear combination of the rest. How can it be? Does it mean that any set of columns is linear dependent on all others? This sounds crazy!
Of course, there is an important note about $X$ here. Notice $X^T X$ that is inverted. In order to invert a matrix it needs to be of a full rank. That means that $X$ has to have full column rank, that is, have rank equal to the number of columns.
Another interesting thing is a case when some of $Y_i$ are actually independent of $X$. Clearly, there's no place for the formula to break, but what's the meaning of a result, what have we got? In that case the result $b_i$ is a coefficient vector of an orthogonal projection of $Y_i$ onto space spawned by columns of $X$. In a sense it's a closest linear combination of $X$.
|
Linearly dependent features
|
Yes, rank roughly tells you how many column-vectors (features) are independent.
No, you can't remove arbitrary columns. You can try removing random columns and calculating the rank of a result — you'l
|
Linearly dependent features
Yes, rank roughly tells you how many column-vectors (features) are independent.
No, you can't remove arbitrary columns. You can try removing random columns and calculating the rank of a result — you'll see different numbers. You need to remove only those features that are dependent.
Or, suppose that you generated data in a way that only the last 12 columns depend on the first ones. Can you still delete any 12 columns?
What you can do, though, is to perform PCA with number of components equal to the rank. This will not only reduce the dimension of your space, but will also decorrelate your features. The drawback of such transformation is a (possible) loss of interpretability, but it's not a mathematical thing, if you want to preserve it, you should delete features based on your insight.
Suppose your data matrix is of form $(X; Y)$ where $X$ and $X$ are submatrices of form n_rows × (n_cols - 12) and n_rows × 12, respectively. That means, that $X$ and $Y$ are submatrices formed by slicing out last 12 columns. If you want to find 12 linear combinations of $X$ to get $Y$, you actually want to solve 12 systems of linear equations of the form
$$ X b_i = Y_i $$
Where $Y_i$ is $i$th column of $Y$. Now unite all these equations into one by gluing together all the $b_i$ into a matrix $B$ of shape (n_cols - 12) × 12. The equations then become
$X B = Y$
Note that X is not square, thus is not invertible. Fortunately, the solution still exists, and is given by pseudoinversion:
$$B = (X^T X)^{-1} X Y$$
Note: now somebody thoughtful enough might notice that the way I provided the above formula looks like we can express any set of columns of original data matrix as the linear combination of the rest. How can it be? Does it mean that any set of columns is linear dependent on all others? This sounds crazy!
Of course, there is an important note about $X$ here. Notice $X^T X$ that is inverted. In order to invert a matrix it needs to be of a full rank. That means that $X$ has to have full column rank, that is, have rank equal to the number of columns.
Another interesting thing is a case when some of $Y_i$ are actually independent of $X$. Clearly, there's no place for the formula to break, but what's the meaning of a result, what have we got? In that case the result $b_i$ is a coefficient vector of an orthogonal projection of $Y_i$ onto space spawned by columns of $X$. In a sense it's a closest linear combination of $X$.
|
Linearly dependent features
Yes, rank roughly tells you how many column-vectors (features) are independent.
No, you can't remove arbitrary columns. You can try removing random columns and calculating the rank of a result — you'l
|
43,515
|
Bonferroni correction for two different tests on the same dataset
|
In general it shouldn't matter how the p-values were calculated (ie which particular test statistic they came from). A $p < .05$ type decision still has a $5\%$ chance of a false positive, so if you did three hypothesis tests you should correct for three hypothesis tests.
|
Bonferroni correction for two different tests on the same dataset
|
In general it shouldn't matter how the p-values were calculated (ie which particular test statistic they came from). A $p < .05$ type decision still has a $5\%$ chance of a false positive, so if you d
|
Bonferroni correction for two different tests on the same dataset
In general it shouldn't matter how the p-values were calculated (ie which particular test statistic they came from). A $p < .05$ type decision still has a $5\%$ chance of a false positive, so if you did three hypothesis tests you should correct for three hypothesis tests.
|
Bonferroni correction for two different tests on the same dataset
In general it shouldn't matter how the p-values were calculated (ie which particular test statistic they came from). A $p < .05$ type decision still has a $5\%$ chance of a false positive, so if you d
|
43,516
|
How do I estimate the average size of objects
|
This is the kind of problem treated in finite population sampling theory, as presented in the book http://www.amazon.com/Finite-Population-Sampling-Inference-Prediction/dp/0471293415/ref=sr_1_1?s=books&ie=UTF8&qid=1401276486&sr=1-1&keywords=finite+population+sampling+theory
(and many others).
First of all, you will want a practical way to do the sampling! So we will need to know how your physical files are stored! You should also think about if they are stored in completely random order, or in some other definite order (alphabetical? chronological? what???). A simple random sampling will often be impractical --- could be practical if you have some list of all the files in your collection, wheather that list is on a computer or on paper (and if it is practical to access the files out of order). If the answer to that question is NO, so simple random sampling is impractical, you can use some kind of cluster or stratified sampling. You can find explanations of this and related terms here: https://en.wikipedia.org/wiki/Statistical_sampling
Without knowing more about the practical situation, only some brief hints: sampling could be on the level of
--- shelfes
--- drawers
or some other units in which the physical storage is organized. You should think about questions such as: If the storage is is say, chronological order, might there be some trend in document size with time? Or some cyclical variation, that is , in some parts of the year, documents of a specific type are produced, which typically differs in length?
We can help more if you tell us more about the situation!
(Then, depending on the sampling plan choosen, there will be some specific formulas/methods to use to construct estimates and confidence intervals)
|
How do I estimate the average size of objects
|
This is the kind of problem treated in finite population sampling theory, as presented in the book http://www.amazon.com/Finite-Population-Sampling-Inference-Prediction/dp/0471293415/ref=sr_1_1?s=book
|
How do I estimate the average size of objects
This is the kind of problem treated in finite population sampling theory, as presented in the book http://www.amazon.com/Finite-Population-Sampling-Inference-Prediction/dp/0471293415/ref=sr_1_1?s=books&ie=UTF8&qid=1401276486&sr=1-1&keywords=finite+population+sampling+theory
(and many others).
First of all, you will want a practical way to do the sampling! So we will need to know how your physical files are stored! You should also think about if they are stored in completely random order, or in some other definite order (alphabetical? chronological? what???). A simple random sampling will often be impractical --- could be practical if you have some list of all the files in your collection, wheather that list is on a computer or on paper (and if it is practical to access the files out of order). If the answer to that question is NO, so simple random sampling is impractical, you can use some kind of cluster or stratified sampling. You can find explanations of this and related terms here: https://en.wikipedia.org/wiki/Statistical_sampling
Without knowing more about the practical situation, only some brief hints: sampling could be on the level of
--- shelfes
--- drawers
or some other units in which the physical storage is organized. You should think about questions such as: If the storage is is say, chronological order, might there be some trend in document size with time? Or some cyclical variation, that is , in some parts of the year, documents of a specific type are produced, which typically differs in length?
We can help more if you tell us more about the situation!
(Then, depending on the sampling plan choosen, there will be some specific formulas/methods to use to construct estimates and confidence intervals)
|
How do I estimate the average size of objects
This is the kind of problem treated in finite population sampling theory, as presented in the book http://www.amazon.com/Finite-Population-Sampling-Inference-Prediction/dp/0471293415/ref=sr_1_1?s=book
|
43,517
|
How do I estimate the average size of objects
|
An interval for the mean will
(i) be probabilistic - that is, with random sampling, you could compute a mean that's no more than 20% off 99% of the time (or some other percentage) -- but not 100% unless your sample is your population.
(ii) depend on the standard deviation of the number of pages; since this will be unknown, you'll need some information about that (perhaps an upper bound, perhaps an estimate from a pilot sample) before you can calculate an estimate of the required sample size.
|
How do I estimate the average size of objects
|
An interval for the mean will
(i) be probabilistic - that is, with random sampling, you could compute a mean that's no more than 20% off 99% of the time (or some other percentage) -- but not 100% unl
|
How do I estimate the average size of objects
An interval for the mean will
(i) be probabilistic - that is, with random sampling, you could compute a mean that's no more than 20% off 99% of the time (or some other percentage) -- but not 100% unless your sample is your population.
(ii) depend on the standard deviation of the number of pages; since this will be unknown, you'll need some information about that (perhaps an upper bound, perhaps an estimate from a pilot sample) before you can calculate an estimate of the required sample size.
|
How do I estimate the average size of objects
An interval for the mean will
(i) be probabilistic - that is, with random sampling, you could compute a mean that's no more than 20% off 99% of the time (or some other percentage) -- but not 100% unl
|
43,518
|
How do I estimate the average size of objects
|
I would explore graphically the population by construncting some random samples of documents from your repository, then plot histograms of the number of pages for each document in the sample.
If the distributions do not resembles like a normal distribution, the mean alone is not so informative (as said in comments) and maybe you should need to estimate higher order moments like variance, kurtosis and skewness.
Another good tool to get a feel of the distributions are boxplots.
If data does not fit any theoretical distribution, you can still estimate these moments at some confidence interval by bootstrap.
|
How do I estimate the average size of objects
|
I would explore graphically the population by construncting some random samples of documents from your repository, then plot histograms of the number of pages for each document in the sample.
If the
|
How do I estimate the average size of objects
I would explore graphically the population by construncting some random samples of documents from your repository, then plot histograms of the number of pages for each document in the sample.
If the distributions do not resembles like a normal distribution, the mean alone is not so informative (as said in comments) and maybe you should need to estimate higher order moments like variance, kurtosis and skewness.
Another good tool to get a feel of the distributions are boxplots.
If data does not fit any theoretical distribution, you can still estimate these moments at some confidence interval by bootstrap.
|
How do I estimate the average size of objects
I would explore graphically the population by construncting some random samples of documents from your repository, then plot histograms of the number of pages for each document in the sample.
If the
|
43,519
|
Post-stratification & quantitative variables
|
Here is a short answer that I am happy for someone to edit and expand on (might do it myself if I get time).
Your first idea represents the most common approach, and would get you results that are fine. A variant on the first idea, if not all 16 groups of the 2x2 combination are well represented in the sample, is to use raking, so you just are matching the marginal totals for each of your two variables.
Implementing your second idea is much rarer and involves more risks and decision-making (eg exactly how do you cluster them? and you want to be careful you don't involve your target variable in the clustering or that will render your post-stratification scheme invalid for a variety of complicated reasons).
A third alternative - probably superior as it makes better use of the information available, but slightly more complex to implement - is to use the original quantitative variables (or at least one of them - spend springs to mind). This can be done through calibration or GREG estimation - see Thomas Lumley's page for an example of doing this in R.
|
Post-stratification & quantitative variables
|
Here is a short answer that I am happy for someone to edit and expand on (might do it myself if I get time).
Your first idea represents the most common approach, and would get you results that are fin
|
Post-stratification & quantitative variables
Here is a short answer that I am happy for someone to edit and expand on (might do it myself if I get time).
Your first idea represents the most common approach, and would get you results that are fine. A variant on the first idea, if not all 16 groups of the 2x2 combination are well represented in the sample, is to use raking, so you just are matching the marginal totals for each of your two variables.
Implementing your second idea is much rarer and involves more risks and decision-making (eg exactly how do you cluster them? and you want to be careful you don't involve your target variable in the clustering or that will render your post-stratification scheme invalid for a variety of complicated reasons).
A third alternative - probably superior as it makes better use of the information available, but slightly more complex to implement - is to use the original quantitative variables (or at least one of them - spend springs to mind). This can be done through calibration or GREG estimation - see Thomas Lumley's page for an example of doing this in R.
|
Post-stratification & quantitative variables
Here is a short answer that I am happy for someone to edit and expand on (might do it myself if I get time).
Your first idea represents the most common approach, and would get you results that are fin
|
43,520
|
Logistic regression and maximum entropy
|
TLDR; the logistic function can originate from an exponential function for different outcomes
$$p(y;x) \propto \text{exp}(f(y,x))$$
and with the normalisation using the sum $\sum_{\forall y} p(y;x)$ it becomes a logistic function
$$p(y;x) = \frac{\text{exp}(f(y,x))}{\text{other stuff}+\text{exp}(f(y,x))}$$
The connection with entropy is in the exponential function $p(y;x) \propto \text{exp}(f(y,x))$ which is similar to the Boltzmann distribution.
We want to estimate a probability distribution $$\hat{f}(y|x_1,x_2) = \begin{cases}p(y;x_1,x_2) &\quad \text{if $y=1$}\\
1-p(y;x_1,x_2) &\quad \text{if $y=0$}\end{cases}$$
where $y$ is a binary outcome variable and the $x_i$ are predictors.
Say we want to find a $\hat{f}$ that maximizes the entropy
$$H = E[-\log(\hat{f}(y,x_1,x_2)]$$
where $\hat{f}(y,x_1,x_2) = \hat{f}(y;x_1,x_2)f(x_1,x_2)$
with constraints
$$E[y \cdot x_1] = \frac{1}{N} \sum_{j=1}^N y_j x_{1j}\\
E[y \cdot x_2] = \frac{1}{N} \sum_{j=1}^N y_j x_{2j}$$
where the expectations are computed based on the empirical distribution/frequency of a sample $x_{1j}$ and $x_{2j}$ of size $N$.
Then the distribution will be of the form
$$ \hat{f}(y,x_1,x_2) = \frac{1}{Z} \text{exp}\left(\alpha_1 y \cdot x_1 + \alpha_2 y \cdot x_2\right) $$
where $Z$ is a normalisation constant.
The ratio of the conditional distribution will be
$$\frac{\hat{f}(1|x_1,x_2)}{\hat{f}(0|x_1,x_2)} = \frac{\hat{f}(1,x_1,x_2)}{\hat{f}(0,x_1,x_2)} = \frac{ \text{exp}\left(\alpha_1 1 \cdot x_1 + \alpha_2 1 \cdot x_2\right)}{\text{exp}\left(\alpha_1 0 \cdot x_1 + \alpha_2 0 \cdot x_2\right)} = \text{exp}\left(\alpha_1 \cdot x_1 + \alpha_2 \cdot x_2\right) $$
Then if you take the logarithm
$$\text{log} \left( \frac{\hat{f}(1|x_1,x_2)}{\hat{f}(0|x_1,x_2)} \right) = \text{log} \left( \frac{\hat{f}(1|x_1,x_2)}{1-\hat{f}(1,x_1,x_2)} \right) = \left(\alpha_1 \cdot x_1 + \alpha_2 \cdot x_2\right) $$
you get the logit function.
The parameters $\alpha_i$ will need to be found by optimizing the entropy (and this turns out to be the same as optimizing the likelihood).
|
Logistic regression and maximum entropy
|
TLDR; the logistic function can originate from an exponential function for different outcomes
$$p(y;x) \propto \text{exp}(f(y,x))$$
and with the normalisation using the sum $\sum_{\forall y} p(y;x)$ i
|
Logistic regression and maximum entropy
TLDR; the logistic function can originate from an exponential function for different outcomes
$$p(y;x) \propto \text{exp}(f(y,x))$$
and with the normalisation using the sum $\sum_{\forall y} p(y;x)$ it becomes a logistic function
$$p(y;x) = \frac{\text{exp}(f(y,x))}{\text{other stuff}+\text{exp}(f(y,x))}$$
The connection with entropy is in the exponential function $p(y;x) \propto \text{exp}(f(y,x))$ which is similar to the Boltzmann distribution.
We want to estimate a probability distribution $$\hat{f}(y|x_1,x_2) = \begin{cases}p(y;x_1,x_2) &\quad \text{if $y=1$}\\
1-p(y;x_1,x_2) &\quad \text{if $y=0$}\end{cases}$$
where $y$ is a binary outcome variable and the $x_i$ are predictors.
Say we want to find a $\hat{f}$ that maximizes the entropy
$$H = E[-\log(\hat{f}(y,x_1,x_2)]$$
where $\hat{f}(y,x_1,x_2) = \hat{f}(y;x_1,x_2)f(x_1,x_2)$
with constraints
$$E[y \cdot x_1] = \frac{1}{N} \sum_{j=1}^N y_j x_{1j}\\
E[y \cdot x_2] = \frac{1}{N} \sum_{j=1}^N y_j x_{2j}$$
where the expectations are computed based on the empirical distribution/frequency of a sample $x_{1j}$ and $x_{2j}$ of size $N$.
Then the distribution will be of the form
$$ \hat{f}(y,x_1,x_2) = \frac{1}{Z} \text{exp}\left(\alpha_1 y \cdot x_1 + \alpha_2 y \cdot x_2\right) $$
where $Z$ is a normalisation constant.
The ratio of the conditional distribution will be
$$\frac{\hat{f}(1|x_1,x_2)}{\hat{f}(0|x_1,x_2)} = \frac{\hat{f}(1,x_1,x_2)}{\hat{f}(0,x_1,x_2)} = \frac{ \text{exp}\left(\alpha_1 1 \cdot x_1 + \alpha_2 1 \cdot x_2\right)}{\text{exp}\left(\alpha_1 0 \cdot x_1 + \alpha_2 0 \cdot x_2\right)} = \text{exp}\left(\alpha_1 \cdot x_1 + \alpha_2 \cdot x_2\right) $$
Then if you take the logarithm
$$\text{log} \left( \frac{\hat{f}(1|x_1,x_2)}{\hat{f}(0|x_1,x_2)} \right) = \text{log} \left( \frac{\hat{f}(1|x_1,x_2)}{1-\hat{f}(1,x_1,x_2)} \right) = \left(\alpha_1 \cdot x_1 + \alpha_2 \cdot x_2\right) $$
you get the logit function.
The parameters $\alpha_i$ will need to be found by optimizing the entropy (and this turns out to be the same as optimizing the likelihood).
|
Logistic regression and maximum entropy
TLDR; the logistic function can originate from an exponential function for different outcomes
$$p(y;x) \propto \text{exp}(f(y,x))$$
and with the normalisation using the sum $\sum_{\forall y} p(y;x)$ i
|
43,521
|
How can I test the difference of two Weibull distributions?
|
If I understand you correctly, the fact that both datasets are Weibull is really irrelevant. You are more interested in testing the two sets of results and some measure of confidence if they are from the same distribution.
In this case, the simplest approach would probably be to use a distribution-free test, such as a Wilcoxon rank-sum test or a Kruskal-Wallis.
What may be a better test would be to use a two-sample empirical distribution function test such as a Cramer-von-Mises or Anderson-Darling test.
|
How can I test the difference of two Weibull distributions?
|
If I understand you correctly, the fact that both datasets are Weibull is really irrelevant. You are more interested in testing the two sets of results and some measure of confidence if they are from
|
How can I test the difference of two Weibull distributions?
If I understand you correctly, the fact that both datasets are Weibull is really irrelevant. You are more interested in testing the two sets of results and some measure of confidence if they are from the same distribution.
In this case, the simplest approach would probably be to use a distribution-free test, such as a Wilcoxon rank-sum test or a Kruskal-Wallis.
What may be a better test would be to use a two-sample empirical distribution function test such as a Cramer-von-Mises or Anderson-Darling test.
|
How can I test the difference of two Weibull distributions?
If I understand you correctly, the fact that both datasets are Weibull is really irrelevant. You are more interested in testing the two sets of results and some measure of confidence if they are from
|
43,522
|
How can I test the difference of two Weibull distributions?
|
I would first suggest that you think about what you really need. If your intent is to address failure rates, than construct a sample estimate of the observed Weibull based failure rates over time. A regression of the observed natural log of the failure rates (also called hazard rates) should be linear versus the log of time, with the slope equaling the shape parameter minus one. For a two parameter Weibull distribution, the implied scale parameter can be determined by dividing the shape parameter by exp(regression intercept) and taking the result to the power (1/shape parameter). Source, per Wikipedia on the Weibull distribution, to quote: "Linear regression can also be used to numerically assess goodness of fit and estimate the parameters of the Weibull distribution. The gradient informs one directly about the shape parameter k and the scale parameter lambda can also be inferred".
I would argue there are a couple of advantages with this regression approach in addition to numerical simplicity over the MLE and being able to visualize the appropriateness of failure hazard rate model. One comment above notes a possible issue in auto correlated errors, which can be readily addressed in a regression setting. There is also a more subtle difference relating to experimental design with a possible significant increase in efficiency of parameter estimates. While the log regression is linear, the plot of the failure rate law itself for the Weibull can be highly nonlinear in time in the early phase for a shape parameter different from one (see, for example, the graph of the hazard rate for various shape parameters at http://www.weibull.com/hotwire/issue14/relbasics14.htm ). This suggests to me, based on experience, the need for more observations in this early phase to gain a more accurate estimate of the scale parameter (as derived from the estimate of the regression intercept). Such a censored sampling scheme in reducing tail observations could also reduce the possible introduction of other unwanted noise distributions (for example, a Weibull model of web browsing time until exiting the website could have noise introduced from the likes of a phone call, door bell,..,causing an inflated estimate of the actual browsing time).
Conveniently, regression theory provides the basis for confidence intervals for the parameters and even prediction intervals for future failures. One can also compare slope estimates for related regression regimes.
For those sticking with MLE, here is reference showing a derivation via MLE on the hazard rate (see http://www.weibull.com/hotwire/issue131/relbasics131.htm ). Note, in general, one can also compute MLE in the case of censored data.
[Edit] Nonparametric techniques are sensitive to violation of the independence assumption. Also, as hazard rates plots can confirm the validity of the well known versatile Weibull distribution as an appropriate failure distribution in this case, the argument for the use of nonparametric models is suspect, in my opinion.
|
How can I test the difference of two Weibull distributions?
|
I would first suggest that you think about what you really need. If your intent is to address failure rates, than construct a sample estimate of the observed Weibull based failure rates over time. A r
|
How can I test the difference of two Weibull distributions?
I would first suggest that you think about what you really need. If your intent is to address failure rates, than construct a sample estimate of the observed Weibull based failure rates over time. A regression of the observed natural log of the failure rates (also called hazard rates) should be linear versus the log of time, with the slope equaling the shape parameter minus one. For a two parameter Weibull distribution, the implied scale parameter can be determined by dividing the shape parameter by exp(regression intercept) and taking the result to the power (1/shape parameter). Source, per Wikipedia on the Weibull distribution, to quote: "Linear regression can also be used to numerically assess goodness of fit and estimate the parameters of the Weibull distribution. The gradient informs one directly about the shape parameter k and the scale parameter lambda can also be inferred".
I would argue there are a couple of advantages with this regression approach in addition to numerical simplicity over the MLE and being able to visualize the appropriateness of failure hazard rate model. One comment above notes a possible issue in auto correlated errors, which can be readily addressed in a regression setting. There is also a more subtle difference relating to experimental design with a possible significant increase in efficiency of parameter estimates. While the log regression is linear, the plot of the failure rate law itself for the Weibull can be highly nonlinear in time in the early phase for a shape parameter different from one (see, for example, the graph of the hazard rate for various shape parameters at http://www.weibull.com/hotwire/issue14/relbasics14.htm ). This suggests to me, based on experience, the need for more observations in this early phase to gain a more accurate estimate of the scale parameter (as derived from the estimate of the regression intercept). Such a censored sampling scheme in reducing tail observations could also reduce the possible introduction of other unwanted noise distributions (for example, a Weibull model of web browsing time until exiting the website could have noise introduced from the likes of a phone call, door bell,..,causing an inflated estimate of the actual browsing time).
Conveniently, regression theory provides the basis for confidence intervals for the parameters and even prediction intervals for future failures. One can also compare slope estimates for related regression regimes.
For those sticking with MLE, here is reference showing a derivation via MLE on the hazard rate (see http://www.weibull.com/hotwire/issue131/relbasics131.htm ). Note, in general, one can also compute MLE in the case of censored data.
[Edit] Nonparametric techniques are sensitive to violation of the independence assumption. Also, as hazard rates plots can confirm the validity of the well known versatile Weibull distribution as an appropriate failure distribution in this case, the argument for the use of nonparametric models is suspect, in my opinion.
|
How can I test the difference of two Weibull distributions?
I would first suggest that you think about what you really need. If your intent is to address failure rates, than construct a sample estimate of the observed Weibull based failure rates over time. A r
|
43,523
|
Test incorrect functional form when residuals have non-normal distribution
|
The Ramsey Test relies on the assumption of normally distributed residuals to justify the use of the F-test for exact finite sample inference for testing nested models (the linear model versus the saturated polynomial model). When the normality assumption is violated, few if any other distributions yield cogent, testable ratio statistics. This is a general result for inference from linear models.
A workaround is to use the asymptotic test. When the sample size is decently large, the chi-square approximation to the likelihood ratio statistic performs decently well. The asymptotic test has good power and is of correct size in all sample sizes, so its use is justified over a variety of scenarios.
Yet another approach that is justified here is to make use of robust standard errors to test nested models. Inference using robust standard errors does not rely on either homogeneity or identical distribution of error terms. This is an important consideration because, if model misspecification is present, then the apparent "error" term is a mixture of the inherent error (which may or may not follow a known distribution) and the unmeasured contribution of uncaptured variation in Y. It seems to me that's the issue that's alluded to in the cited "forthcoming" paper: but I find it hard to believe that any useful results could be stated in general since the extent of model misspecification could generate data following almost any form. A downside to using these types of "sandwich" standard errors is that they require a larger sample size than in the exact finite sample inference case.
|
Test incorrect functional form when residuals have non-normal distribution
|
The Ramsey Test relies on the assumption of normally distributed residuals to justify the use of the F-test for exact finite sample inference for testing nested models (the linear model versus the sat
|
Test incorrect functional form when residuals have non-normal distribution
The Ramsey Test relies on the assumption of normally distributed residuals to justify the use of the F-test for exact finite sample inference for testing nested models (the linear model versus the saturated polynomial model). When the normality assumption is violated, few if any other distributions yield cogent, testable ratio statistics. This is a general result for inference from linear models.
A workaround is to use the asymptotic test. When the sample size is decently large, the chi-square approximation to the likelihood ratio statistic performs decently well. The asymptotic test has good power and is of correct size in all sample sizes, so its use is justified over a variety of scenarios.
Yet another approach that is justified here is to make use of robust standard errors to test nested models. Inference using robust standard errors does not rely on either homogeneity or identical distribution of error terms. This is an important consideration because, if model misspecification is present, then the apparent "error" term is a mixture of the inherent error (which may or may not follow a known distribution) and the unmeasured contribution of uncaptured variation in Y. It seems to me that's the issue that's alluded to in the cited "forthcoming" paper: but I find it hard to believe that any useful results could be stated in general since the extent of model misspecification could generate data following almost any form. A downside to using these types of "sandwich" standard errors is that they require a larger sample size than in the exact finite sample inference case.
|
Test incorrect functional form when residuals have non-normal distribution
The Ramsey Test relies on the assumption of normally distributed residuals to justify the use of the F-test for exact finite sample inference for testing nested models (the linear model versus the sat
|
43,524
|
Selecting optimal set of eigenvectors for Principal Components Regression
|
This is not possible in general. If $\boldsymbol x_i \in R^N$ is a multivariate input and $\boldsymbol y_i$ is a corresponding output. There is no a priori reason why the optimal linear relationship between the $y$s and the $\boldsymbol x$s should be a function of of the first $k$ PCs.
A counter example would be suppose $\boldsymbol e_j$ were the standard basis vectors for $\mathbb R^N$. Suppose the data were constructed as $\boldsymbol x = \sum_{i=1}^N \frac{z_i}{i} \boldsymbol e_i$ where the $z_i$ were standard normals and $y_i = z_i \boldsymbol \beta' \boldsymbol e_N$. In any decent sample size $\boldsymbol e_N$ will not be one of the principal basis vectors for choice of some $k<N$. Hence PCR would throw out the useful information, because it is based on a method that pays no attention to the $y_i$ (i.e. to the things you're trying to regress).
Ridge regression, on the other hand is actually a regression technique.
|
Selecting optimal set of eigenvectors for Principal Components Regression
|
This is not possible in general. If $\boldsymbol x_i \in R^N$ is a multivariate input and $\boldsymbol y_i$ is a corresponding output. There is no a priori reason why the optimal linear relationship b
|
Selecting optimal set of eigenvectors for Principal Components Regression
This is not possible in general. If $\boldsymbol x_i \in R^N$ is a multivariate input and $\boldsymbol y_i$ is a corresponding output. There is no a priori reason why the optimal linear relationship between the $y$s and the $\boldsymbol x$s should be a function of of the first $k$ PCs.
A counter example would be suppose $\boldsymbol e_j$ were the standard basis vectors for $\mathbb R^N$. Suppose the data were constructed as $\boldsymbol x = \sum_{i=1}^N \frac{z_i}{i} \boldsymbol e_i$ where the $z_i$ were standard normals and $y_i = z_i \boldsymbol \beta' \boldsymbol e_N$. In any decent sample size $\boldsymbol e_N$ will not be one of the principal basis vectors for choice of some $k<N$. Hence PCR would throw out the useful information, because it is based on a method that pays no attention to the $y_i$ (i.e. to the things you're trying to regress).
Ridge regression, on the other hand is actually a regression technique.
|
Selecting optimal set of eigenvectors for Principal Components Regression
This is not possible in general. If $\boldsymbol x_i \in R^N$ is a multivariate input and $\boldsymbol y_i$ is a corresponding output. There is no a priori reason why the optimal linear relationship b
|
43,525
|
Post-hoc test in two-way ANOVA
|
I'm not sure whether there's a better way but perhaps you can run one-way anovas on factor 1 for each category group of factor 2 separately?
You would use split files ... for this.
Try it and see whether that duplicates Andy's results.
|
Post-hoc test in two-way ANOVA
|
I'm not sure whether there's a better way but perhaps you can run one-way anovas on factor 1 for each category group of factor 2 separately?
You would use split files ... for this.
Try it and see whe
|
Post-hoc test in two-way ANOVA
I'm not sure whether there's a better way but perhaps you can run one-way anovas on factor 1 for each category group of factor 2 separately?
You would use split files ... for this.
Try it and see whether that duplicates Andy's results.
|
Post-hoc test in two-way ANOVA
I'm not sure whether there's a better way but perhaps you can run one-way anovas on factor 1 for each category group of factor 2 separately?
You would use split files ... for this.
Try it and see whe
|
43,526
|
Hausman-Newey test for serial correlation in Poisson with Fixed Effects
|
I still don't see the simple regression to get this LM test, but I just started coding and got through it. It looks like, yes, the $U_i(\hat{\beta})$ are the score function for each firm $i$ from the multinomial likelihood in 2.5. If you assume they're column vectors, then the math goes through. My results make sense at least.
|
Hausman-Newey test for serial correlation in Poisson with Fixed Effects
|
I still don't see the simple regression to get this LM test, but I just started coding and got through it. It looks like, yes, the $U_i(\hat{\beta})$ are the score function for each firm $i$ from the
|
Hausman-Newey test for serial correlation in Poisson with Fixed Effects
I still don't see the simple regression to get this LM test, but I just started coding and got through it. It looks like, yes, the $U_i(\hat{\beta})$ are the score function for each firm $i$ from the multinomial likelihood in 2.5. If you assume they're column vectors, then the math goes through. My results make sense at least.
|
Hausman-Newey test for serial correlation in Poisson with Fixed Effects
I still don't see the simple regression to get this LM test, but I just started coding and got through it. It looks like, yes, the $U_i(\hat{\beta})$ are the score function for each firm $i$ from the
|
43,527
|
Assessing associations between many categorical variable pairs
|
If you really want to test pairwise associations than you should perform any test in pairwise manner. In such situation there are no problem with chi-squared test. However, I suppose you want to score and compare sizes of association but not their significances. So there are several different measures for that purpose. Here is a useful discussion about them.
|
Assessing associations between many categorical variable pairs
|
If you really want to test pairwise associations than you should perform any test in pairwise manner. In such situation there are no problem with chi-squared test. However, I suppose you want to score
|
Assessing associations between many categorical variable pairs
If you really want to test pairwise associations than you should perform any test in pairwise manner. In such situation there are no problem with chi-squared test. However, I suppose you want to score and compare sizes of association but not their significances. So there are several different measures for that purpose. Here is a useful discussion about them.
|
Assessing associations between many categorical variable pairs
If you really want to test pairwise associations than you should perform any test in pairwise manner. In such situation there are no problem with chi-squared test. However, I suppose you want to score
|
43,528
|
Simulating Monte Carlo with different standard deviations and interval confidence
|
Finish 10.000 MC runs and then start computing your confidence intervals. Compute e.g. the median value, which divides your probability distribution (PD) into two parts, where each part corresponds to 50% probability or area of your PD. Integrate your PD from -infinity to the z value covering 2.5% area of your PD, and integrate from zero to the z value covering 97.5% area of your PD. In total you then have the z values, which enclose 95% of your PD. This is denoted the 95 percentile. You can then compute something like a standard deviation by: z1=z975-median and z2=median-z025. Maybe have a look at "confidence.pro" (IDL language).
|
Simulating Monte Carlo with different standard deviations and interval confidence
|
Finish 10.000 MC runs and then start computing your confidence intervals. Compute e.g. the median value, which divides your probability distribution (PD) into two parts, where each part corresponds to
|
Simulating Monte Carlo with different standard deviations and interval confidence
Finish 10.000 MC runs and then start computing your confidence intervals. Compute e.g. the median value, which divides your probability distribution (PD) into two parts, where each part corresponds to 50% probability or area of your PD. Integrate your PD from -infinity to the z value covering 2.5% area of your PD, and integrate from zero to the z value covering 97.5% area of your PD. In total you then have the z values, which enclose 95% of your PD. This is denoted the 95 percentile. You can then compute something like a standard deviation by: z1=z975-median and z2=median-z025. Maybe have a look at "confidence.pro" (IDL language).
|
Simulating Monte Carlo with different standard deviations and interval confidence
Finish 10.000 MC runs and then start computing your confidence intervals. Compute e.g. the median value, which divides your probability distribution (PD) into two parts, where each part corresponds to
|
43,529
|
Weights argument in glmer() when predicting proportion data: why is it needed when all weights are around the same?
|
Even though this seems to be an old topic, and the main discussion was whether it is code or computing question, I think I could try to answer this question in some way, at least. But also with some uncertainty, though (maybe someone else could jump in with more detailed or mathematically founded answer).
Disclaimer: I am no methematician or something similar, and I also have my issues with understanding answers like this. But I am "just" an ecologist and can just talk from my practical experience point of view. Therefore, my answer is just a weak try to explain the practical part.
Following Zuur et. al (2009), you should include the basis of each proportion as a weight in your glm. I don't see any reason why this does not account for a glmer.
How I would explain this point for myself, is, that the basis of your proportion matters for the "power" of your estimation.
Pretend you have a survival rate of 20 %. It matters whether it is 20 % of 5 (which means one observation), or whether it is 20 % of 100 (which means 20 observations). The probability of one false positive is much higher than of 20.
Thus, it seems natural, that the outcome should be different between both versions.
However, what I don't know, and why I actually found this question is, whether the R function really considers this point or whether the weight only matters in case of imbalanced observations (i.e., in one case the basis is 100 and in another it is just 50), and if I could leave out the weight parameter in case I have a balanced situation.
It would be nice, if one with more profound mathematical or informatics background could add something about that.
|
Weights argument in glmer() when predicting proportion data: why is it needed when all weights are a
|
Even though this seems to be an old topic, and the main discussion was whether it is code or computing question, I think I could try to answer this question in some way, at least. But also with some u
|
Weights argument in glmer() when predicting proportion data: why is it needed when all weights are around the same?
Even though this seems to be an old topic, and the main discussion was whether it is code or computing question, I think I could try to answer this question in some way, at least. But also with some uncertainty, though (maybe someone else could jump in with more detailed or mathematically founded answer).
Disclaimer: I am no methematician or something similar, and I also have my issues with understanding answers like this. But I am "just" an ecologist and can just talk from my practical experience point of view. Therefore, my answer is just a weak try to explain the practical part.
Following Zuur et. al (2009), you should include the basis of each proportion as a weight in your glm. I don't see any reason why this does not account for a glmer.
How I would explain this point for myself, is, that the basis of your proportion matters for the "power" of your estimation.
Pretend you have a survival rate of 20 %. It matters whether it is 20 % of 5 (which means one observation), or whether it is 20 % of 100 (which means 20 observations). The probability of one false positive is much higher than of 20.
Thus, it seems natural, that the outcome should be different between both versions.
However, what I don't know, and why I actually found this question is, whether the R function really considers this point or whether the weight only matters in case of imbalanced observations (i.e., in one case the basis is 100 and in another it is just 50), and if I could leave out the weight parameter in case I have a balanced situation.
It would be nice, if one with more profound mathematical or informatics background could add something about that.
|
Weights argument in glmer() when predicting proportion data: why is it needed when all weights are a
Even though this seems to be an old topic, and the main discussion was whether it is code or computing question, I think I could try to answer this question in some way, at least. But also with some u
|
43,530
|
How do I calculate random baseline?
|
The formula that you refer to can be used when the distribution of classes is the same in the training and test set (which is commonly assumed with machine learning).
Take 7 classes: A, B, C, D, E, F, G. There will be #A instances with label A in your data set. And of course, #A + #B + #C + #D + #E + #F + #G = X
The chance of encountering an instance with label A, i.e. the probability of class A, pA, equals #A/X.
Now, if you consider a random baseline system, this system will assign labels to instances according to these probabilities. Because labels are assigned according to probabilities, each time you let the system label the instances a different result will be produced. A majority system or your SVM-based system will produce the same result, no matter how often they are applied. With an infinite number of runs of the random baseline system, on average, the following will happen:
Given an instance with gold label A, this instance will be labelled pA times as A, pB times as B, etc. This means that we have a (fractional) true positive count equal to the probability pA. There are #A instances with gold label A, the total true positive count for label A becomes #A*pA. This can be done for each label. The total number of true positives, TP, becomes:
TP = #A*pA + #B*pB + #C*pC + #D*pD + #E*pE + #F*pF + #G*pG
And the average accuracy of this baseline system becomes acc = TP/X
acc = 1/X * (#A*pA + #B*pB + #C*pC + #D*pD + #E*pE + #F*pF + #G*pG)
If the X is distributed over the different terms, and using the definition of the probabilities, this becomes:
acc = pA*pA + pB*pB + pC*pC + pD*pD + pE*pE + pF*pF + pG*pG
which is the formula that you refer to.
As noted before, for an SVM-based system or a majority system, the average accuracy is equal to the accuracy of a single run. Meaning that the accuracies of a single run can be compared with the outcome of the random baseline formula.
If your machine learner produces slightly different results with each run (because it contains an element of randomness), you should compute the average accuracy for an infinite number of runs. But this is the ideal situation, and it may be impossible to compute. In practice, differences will be probably very small and most people stick to comparing using the outcome of a single run.
|
How do I calculate random baseline?
|
The formula that you refer to can be used when the distribution of classes is the same in the training and test set (which is commonly assumed with machine learning).
Take 7 classes: A, B, C, D, E, F,
|
How do I calculate random baseline?
The formula that you refer to can be used when the distribution of classes is the same in the training and test set (which is commonly assumed with machine learning).
Take 7 classes: A, B, C, D, E, F, G. There will be #A instances with label A in your data set. And of course, #A + #B + #C + #D + #E + #F + #G = X
The chance of encountering an instance with label A, i.e. the probability of class A, pA, equals #A/X.
Now, if you consider a random baseline system, this system will assign labels to instances according to these probabilities. Because labels are assigned according to probabilities, each time you let the system label the instances a different result will be produced. A majority system or your SVM-based system will produce the same result, no matter how often they are applied. With an infinite number of runs of the random baseline system, on average, the following will happen:
Given an instance with gold label A, this instance will be labelled pA times as A, pB times as B, etc. This means that we have a (fractional) true positive count equal to the probability pA. There are #A instances with gold label A, the total true positive count for label A becomes #A*pA. This can be done for each label. The total number of true positives, TP, becomes:
TP = #A*pA + #B*pB + #C*pC + #D*pD + #E*pE + #F*pF + #G*pG
And the average accuracy of this baseline system becomes acc = TP/X
acc = 1/X * (#A*pA + #B*pB + #C*pC + #D*pD + #E*pE + #F*pF + #G*pG)
If the X is distributed over the different terms, and using the definition of the probabilities, this becomes:
acc = pA*pA + pB*pB + pC*pC + pD*pD + pE*pE + pF*pF + pG*pG
which is the formula that you refer to.
As noted before, for an SVM-based system or a majority system, the average accuracy is equal to the accuracy of a single run. Meaning that the accuracies of a single run can be compared with the outcome of the random baseline formula.
If your machine learner produces slightly different results with each run (because it contains an element of randomness), you should compute the average accuracy for an infinite number of runs. But this is the ideal situation, and it may be impossible to compute. In practice, differences will be probably very small and most people stick to comparing using the outcome of a single run.
|
How do I calculate random baseline?
The formula that you refer to can be used when the distribution of classes is the same in the training and test set (which is commonly assumed with machine learning).
Take 7 classes: A, B, C, D, E, F,
|
43,531
|
How to visualize a low-rank matrix decomposition?
|
The most effective tactic I've seen here is to compute a tSNE embedding where each observation is a row of U, then plot columns of U individually as color intensity on the tSNE embedding.
|
How to visualize a low-rank matrix decomposition?
|
The most effective tactic I've seen here is to compute a tSNE embedding where each observation is a row of U, then plot columns of U individually as color intensity on the tSNE embedding.
|
How to visualize a low-rank matrix decomposition?
The most effective tactic I've seen here is to compute a tSNE embedding where each observation is a row of U, then plot columns of U individually as color intensity on the tSNE embedding.
|
How to visualize a low-rank matrix decomposition?
The most effective tactic I've seen here is to compute a tSNE embedding where each observation is a row of U, then plot columns of U individually as color intensity on the tSNE embedding.
|
43,532
|
Discrepancy between ANOVA analyses
|
What you're trying to do here is estimate the difference between women & men in the difference between the job-applicant & no-instructions conditions in emotional intelligence score. Differences of differences are interaction effects, & must be analysed as such—it's the whole point of setting up a controlled experiment as you have done.
Consider:
Filtering for only the job applicant condition, an ANOVA reveals that women score significantly higher on EI than men (p=0.049)
Filtering for only the honest condition, an ANOVA shows that there are no significant differences in EI scores between men and women (p=0.051)
The two effects could be almost the same size.
NB No significant interaction does not suggest no differences in faking. It only means your experiment was unable to tell you at a given significance level whether women or men fake more. Look at the confidence interval for the interaction effect to assess whether there may or may not be any important difference between women & men in this respect.
|
Discrepancy between ANOVA analyses
|
What you're trying to do here is estimate the difference between women & men in the difference between the job-applicant & no-instructions conditions in emotional intelligence score. Differences of di
|
Discrepancy between ANOVA analyses
What you're trying to do here is estimate the difference between women & men in the difference between the job-applicant & no-instructions conditions in emotional intelligence score. Differences of differences are interaction effects, & must be analysed as such—it's the whole point of setting up a controlled experiment as you have done.
Consider:
Filtering for only the job applicant condition, an ANOVA reveals that women score significantly higher on EI than men (p=0.049)
Filtering for only the honest condition, an ANOVA shows that there are no significant differences in EI scores between men and women (p=0.051)
The two effects could be almost the same size.
NB No significant interaction does not suggest no differences in faking. It only means your experiment was unable to tell you at a given significance level whether women or men fake more. Look at the confidence interval for the interaction effect to assess whether there may or may not be any important difference between women & men in this respect.
|
Discrepancy between ANOVA analyses
What you're trying to do here is estimate the difference between women & men in the difference between the job-applicant & no-instructions conditions in emotional intelligence score. Differences of di
|
43,533
|
How to think of features in NLP problems
|
Indeed to have an efficient NER you need a lot of features. If you start from scratch (what I did first as well) it's really hard to figure out what features could be used other than obvious ones you mentionned. But what really boosted my scores on the one I built was introducing context grammar, tagging and parsing the sentence and use it. You can also add a word vectorial representation. Last, it seems important to add some word-specific features when you encounter difficult cases (e.g. the New-York Times, you can add a feature specially for this). You should also add big dictionnaries and have dimensions of your feature vector that tell if the word belongs to a specific dictionary...
Good luck, it's a really hard problem to get a good NER and building feature is most of the time linguistic knowledge more than mathematical ones!
|
How to think of features in NLP problems
|
Indeed to have an efficient NER you need a lot of features. If you start from scratch (what I did first as well) it's really hard to figure out what features could be used other than obvious ones you
|
How to think of features in NLP problems
Indeed to have an efficient NER you need a lot of features. If you start from scratch (what I did first as well) it's really hard to figure out what features could be used other than obvious ones you mentionned. But what really boosted my scores on the one I built was introducing context grammar, tagging and parsing the sentence and use it. You can also add a word vectorial representation. Last, it seems important to add some word-specific features when you encounter difficult cases (e.g. the New-York Times, you can add a feature specially for this). You should also add big dictionnaries and have dimensions of your feature vector that tell if the word belongs to a specific dictionary...
Good luck, it's a really hard problem to get a good NER and building feature is most of the time linguistic knowledge more than mathematical ones!
|
How to think of features in NLP problems
Indeed to have an efficient NER you need a lot of features. If you start from scratch (what I did first as well) it's really hard to figure out what features could be used other than obvious ones you
|
43,534
|
Does trigram guarantee to perform more accurately than bigram?
|
As whuber explained in his comment, it depends on many factors, the most important one I believe being the information that the train set contains. E.g. if the train set is small, you're likely to have unseen trigrams, which will cause issues when tagging the test set. The choice of the size of n-gram can be seen as a bias–variance compromise .
|
Does trigram guarantee to perform more accurately than bigram?
|
As whuber explained in his comment, it depends on many factors, the most important one I believe being the information that the train set contains. E.g. if the train set is small, you're likely to hav
|
Does trigram guarantee to perform more accurately than bigram?
As whuber explained in his comment, it depends on many factors, the most important one I believe being the information that the train set contains. E.g. if the train set is small, you're likely to have unseen trigrams, which will cause issues when tagging the test set. The choice of the size of n-gram can be seen as a bias–variance compromise .
|
Does trigram guarantee to perform more accurately than bigram?
As whuber explained in his comment, it depends on many factors, the most important one I believe being the information that the train set contains. E.g. if the train set is small, you're likely to hav
|
43,535
|
Does trigram guarantee to perform more accurately than bigram?
|
In bigram we consider past one words and in trigram we consider past two words. It can be happened that past two words itself happen less time and when it happens it contains all those probable words in same, more or less frequency. In my train set, trigram probability were same for two words where bigram probability were different with a great difference. So, it depends on the train set and test set which model will give the best answer.
|
Does trigram guarantee to perform more accurately than bigram?
|
In bigram we consider past one words and in trigram we consider past two words. It can be happened that past two words itself happen less time and when it happens it contains all those probable words
|
Does trigram guarantee to perform more accurately than bigram?
In bigram we consider past one words and in trigram we consider past two words. It can be happened that past two words itself happen less time and when it happens it contains all those probable words in same, more or less frequency. In my train set, trigram probability were same for two words where bigram probability were different with a great difference. So, it depends on the train set and test set which model will give the best answer.
|
Does trigram guarantee to perform more accurately than bigram?
In bigram we consider past one words and in trigram we consider past two words. It can be happened that past two words itself happen less time and when it happens it contains all those probable words
|
43,536
|
How are optional stopping rules based on e.g. sample confidence (width of confidence interval) biased?
|
Jan Vanhove presented simulations showing that optional stopping based on the width of a confidence interval does not introduce biases. He simulated a situation where the null hypothesis was true, and simulated thousands of experiments that continued adding n until the confidence interval was narrower than a prespecified limit. Since the null hypothesis is known to be true, the p-values ought to be evenly spaced between 0 and 1, and this is exactly what he saw (figure below). Optional stopping did not bias the p-value.
In those simulations, each p-value at each sample size was computed as if the study was planned to use the sample size at that point. Kruschke points out the problem that each calculated p-value, in this case, depends on assumptions that aren't correct when the data are reanalyzed repeatedly as new data are added. But the simulations seem to show this method works fine. I am not sure how to tackle this discrepancy.
|
How are optional stopping rules based on e.g. sample confidence (width of confidence interval) biase
|
Jan Vanhove presented simulations showing that optional stopping based on the width of a confidence interval does not introduce biases. He simulated a situation where the null hypothesis was true, and
|
How are optional stopping rules based on e.g. sample confidence (width of confidence interval) biased?
Jan Vanhove presented simulations showing that optional stopping based on the width of a confidence interval does not introduce biases. He simulated a situation where the null hypothesis was true, and simulated thousands of experiments that continued adding n until the confidence interval was narrower than a prespecified limit. Since the null hypothesis is known to be true, the p-values ought to be evenly spaced between 0 and 1, and this is exactly what he saw (figure below). Optional stopping did not bias the p-value.
In those simulations, each p-value at each sample size was computed as if the study was planned to use the sample size at that point. Kruschke points out the problem that each calculated p-value, in this case, depends on assumptions that aren't correct when the data are reanalyzed repeatedly as new data are added. But the simulations seem to show this method works fine. I am not sure how to tackle this discrepancy.
|
How are optional stopping rules based on e.g. sample confidence (width of confidence interval) biase
Jan Vanhove presented simulations showing that optional stopping based on the width of a confidence interval does not introduce biases. He simulated a situation where the null hypothesis was true, and
|
43,537
|
Comparing regression coefficients across models with standardized dependent variables
|
No, you cannot state that an independent variable has twice as large an impact on one DV (dependent variable) as another DV merely by comparing coefficients in the models. Why? Because your dependent variables are not measuring comparable quantities in all four cases above.
Let's take a different example to highlight the strangeness: in one model, rainfall predicts annual crop yield in tonnes of grain/acre/year (coef = 0.5) and in a separate model, it also predicts population density in people/acre (coef = 20). Does this mean that rainfall has a stronger influence on population density than on crop yield? Well, suppose you instead measured annual crop yield in kilograms of grain/acre/year, your rainfall coefficient would be 500 (0.5 * 1000, because 1 tonne = 1000 kg). This change in unit would reverse the hierarchy and your conclusions, which obviously does not make sense. So the basic problem is that annual crop yield and population density are not in comparable units.
This could be addressed by standardizing the dependent variables, in which case the coefficient interpretation would be that a unit change in rainfall leads to a change of $x$ standard deviations in either crop yield or population density. A larger coefficient in one model can then be interpreted as evidence for rainfall having a stronger effect on one quantity, given the variation in your data.
Now, you do actually have two DVs that are in comparable units: % poor people by poverty lines A and B. So in principle, you can make the comparison you've asked about for these two cases (but not the others). But you should probably be careful when interpreting this, since both measure precisely the same quantity but with different cutoffs. Differences in the effect of your independent variable are telling you something about the cutoff, which should perhaps be evident before you fitted your model.
|
Comparing regression coefficients across models with standardized dependent variables
|
No, you cannot state that an independent variable has twice as large an impact on one DV (dependent variable) as another DV merely by comparing coefficients in the models. Why? Because your dependent
|
Comparing regression coefficients across models with standardized dependent variables
No, you cannot state that an independent variable has twice as large an impact on one DV (dependent variable) as another DV merely by comparing coefficients in the models. Why? Because your dependent variables are not measuring comparable quantities in all four cases above.
Let's take a different example to highlight the strangeness: in one model, rainfall predicts annual crop yield in tonnes of grain/acre/year (coef = 0.5) and in a separate model, it also predicts population density in people/acre (coef = 20). Does this mean that rainfall has a stronger influence on population density than on crop yield? Well, suppose you instead measured annual crop yield in kilograms of grain/acre/year, your rainfall coefficient would be 500 (0.5 * 1000, because 1 tonne = 1000 kg). This change in unit would reverse the hierarchy and your conclusions, which obviously does not make sense. So the basic problem is that annual crop yield and population density are not in comparable units.
This could be addressed by standardizing the dependent variables, in which case the coefficient interpretation would be that a unit change in rainfall leads to a change of $x$ standard deviations in either crop yield or population density. A larger coefficient in one model can then be interpreted as evidence for rainfall having a stronger effect on one quantity, given the variation in your data.
Now, you do actually have two DVs that are in comparable units: % poor people by poverty lines A and B. So in principle, you can make the comparison you've asked about for these two cases (but not the others). But you should probably be careful when interpreting this, since both measure precisely the same quantity but with different cutoffs. Differences in the effect of your independent variable are telling you something about the cutoff, which should perhaps be evident before you fitted your model.
|
Comparing regression coefficients across models with standardized dependent variables
No, you cannot state that an independent variable has twice as large an impact on one DV (dependent variable) as another DV merely by comparing coefficients in the models. Why? Because your dependent
|
43,538
|
When would maximum likelihood estimates equal least squares estimates?
|
When the statistical properties of the underlying data-generating process are "normal", i.e., error terms are Gaussian distributed and iid. In this case, the maximum likelihood estimator is equivalent to the least-squares estimator.
|
When would maximum likelihood estimates equal least squares estimates?
|
When the statistical properties of the underlying data-generating process are "normal", i.e., error terms are Gaussian distributed and iid. In this case, the maximum likelihood estimator is equivalent
|
When would maximum likelihood estimates equal least squares estimates?
When the statistical properties of the underlying data-generating process are "normal", i.e., error terms are Gaussian distributed and iid. In this case, the maximum likelihood estimator is equivalent to the least-squares estimator.
|
When would maximum likelihood estimates equal least squares estimates?
When the statistical properties of the underlying data-generating process are "normal", i.e., error terms are Gaussian distributed and iid. In this case, the maximum likelihood estimator is equivalent
|
43,539
|
When would maximum likelihood estimates equal least squares estimates?
|
In MLE there is no L2 norm. Imagine doing logistic regression (LR). This is an MLE problem. The objective function for this, and for any MLE problem, is the likelihood or the probability of Y, given X (N x p) and beta. The responses for LR are N-dimensional sequences of {H, T} or {T, F}. There is no natural way to calculate the distance between a sequence {H, H, T} and a vector of conditional means (these are what you generate from every choice of beta). Some folks will code the responses as {0, 1}, but that is artificial. The true sample space is whatever is in the problem. If it's {T, F}, then the sample space is a sequence of {T, F}'s. Add to that folks using the coded values {0, 1} as scalars in the likelihood calculation. The way I think about LR is that for every beta you generate an N-dimensional conditional mean vector. So each beta generates a pmf on the true space of responses...no coding needed. Each value is the probability of observing, to be specific, an "H". So the range of the design matrix, X, is, through the link function, a p-dimensional manifold completely contained in the open unit cube (0, 1)^N. Every point in the range of X is a pmf. Thought of in this manner, the corners of the unit cube correspond to exactly the 2^N set of possible responses. But the correspondence is that the corners are point mass pmf's that place probability 1 on the corner. They are not vectors of 0's and 1's. Finally note that the set of all pmf's on a sample space is a metric space. There are many norms available, but use total variation. What pmf in the range of X is "closest" to the point mass pmf for Y...It's the MLE. So MLE and OLS are related, but in OLS you imagine the range of X and the responses as vectors in N-dimensional euclidean space. Once you move to the glm, you use MLE to define the range of X as an N-dimensional space of pmf's with a norm (total variation). It's not a vector space since you can't add pmf's, but it is a metric space. The response, Y, points to a pmf on a corner. The pmf in the range of X that is closest to the pmf for Y tells us the MLE..just find the corresponding beta.
|
When would maximum likelihood estimates equal least squares estimates?
|
In MLE there is no L2 norm. Imagine doing logistic regression (LR). This is an MLE problem. The objective function for this, and for any MLE problem, is the likelihood or the probability of Y, give
|
When would maximum likelihood estimates equal least squares estimates?
In MLE there is no L2 norm. Imagine doing logistic regression (LR). This is an MLE problem. The objective function for this, and for any MLE problem, is the likelihood or the probability of Y, given X (N x p) and beta. The responses for LR are N-dimensional sequences of {H, T} or {T, F}. There is no natural way to calculate the distance between a sequence {H, H, T} and a vector of conditional means (these are what you generate from every choice of beta). Some folks will code the responses as {0, 1}, but that is artificial. The true sample space is whatever is in the problem. If it's {T, F}, then the sample space is a sequence of {T, F}'s. Add to that folks using the coded values {0, 1} as scalars in the likelihood calculation. The way I think about LR is that for every beta you generate an N-dimensional conditional mean vector. So each beta generates a pmf on the true space of responses...no coding needed. Each value is the probability of observing, to be specific, an "H". So the range of the design matrix, X, is, through the link function, a p-dimensional manifold completely contained in the open unit cube (0, 1)^N. Every point in the range of X is a pmf. Thought of in this manner, the corners of the unit cube correspond to exactly the 2^N set of possible responses. But the correspondence is that the corners are point mass pmf's that place probability 1 on the corner. They are not vectors of 0's and 1's. Finally note that the set of all pmf's on a sample space is a metric space. There are many norms available, but use total variation. What pmf in the range of X is "closest" to the point mass pmf for Y...It's the MLE. So MLE and OLS are related, but in OLS you imagine the range of X and the responses as vectors in N-dimensional euclidean space. Once you move to the glm, you use MLE to define the range of X as an N-dimensional space of pmf's with a norm (total variation). It's not a vector space since you can't add pmf's, but it is a metric space. The response, Y, points to a pmf on a corner. The pmf in the range of X that is closest to the pmf for Y tells us the MLE..just find the corresponding beta.
|
When would maximum likelihood estimates equal least squares estimates?
In MLE there is no L2 norm. Imagine doing logistic regression (LR). This is an MLE problem. The objective function for this, and for any MLE problem, is the likelihood or the probability of Y, give
|
43,540
|
Non-linear modelling with several variables including a categorical variable [duplicate]
|
I apologize for the incredibly late response, but I came across the same problem recently. I found that it is possible to code categorical variables with nls(), simply by multiplying true/false vectors into your equation. Example:
# null model (no difference between groups; all have the same coefficients)
nls.null <- nls(formula = percent_on_cells ~ vmax*(Time/(Time+km)),
data = mehg,
start = list(vmax = 0.6, km = 10))
# alternative model (each group has different coefficients)
nls.alt <- nls(formula = percent_on_cells ~
as.numeric(DOC==0)*(vmax1)*(Time/(Time+(km1)))
+ as.numeric(DOC==1)*(vmax2)*(Time/(Time+(km2)))
+ as.numeric(DOC==10)*(vmax3)*(Time/(Time+(km3)))
+ as.numeric(DOC==100)*(vmax4)*(Time/(Time+(km4))),
data = mehg,
start = list(vmax1=0.63, km1=3.6,
vmax2=0.64, km2=3.6,
vmax3=0.50, km3=3.2,
vmax4= 0.40, km4=9.7))
Although, with 4 different categorical variables, this could get tedious to code. You would have to be very careful with your design matrices.
|
Non-linear modelling with several variables including a categorical variable [duplicate]
|
I apologize for the incredibly late response, but I came across the same problem recently. I found that it is possible to code categorical variables with nls(), simply by multiplying true/false vector
|
Non-linear modelling with several variables including a categorical variable [duplicate]
I apologize for the incredibly late response, but I came across the same problem recently. I found that it is possible to code categorical variables with nls(), simply by multiplying true/false vectors into your equation. Example:
# null model (no difference between groups; all have the same coefficients)
nls.null <- nls(formula = percent_on_cells ~ vmax*(Time/(Time+km)),
data = mehg,
start = list(vmax = 0.6, km = 10))
# alternative model (each group has different coefficients)
nls.alt <- nls(formula = percent_on_cells ~
as.numeric(DOC==0)*(vmax1)*(Time/(Time+(km1)))
+ as.numeric(DOC==1)*(vmax2)*(Time/(Time+(km2)))
+ as.numeric(DOC==10)*(vmax3)*(Time/(Time+(km3)))
+ as.numeric(DOC==100)*(vmax4)*(Time/(Time+(km4))),
data = mehg,
start = list(vmax1=0.63, km1=3.6,
vmax2=0.64, km2=3.6,
vmax3=0.50, km3=3.2,
vmax4= 0.40, km4=9.7))
Although, with 4 different categorical variables, this could get tedious to code. You would have to be very careful with your design matrices.
|
Non-linear modelling with several variables including a categorical variable [duplicate]
I apologize for the incredibly late response, but I came across the same problem recently. I found that it is possible to code categorical variables with nls(), simply by multiplying true/false vector
|
43,541
|
How to encode an n-level categorical variable as dummies, for glmnet?
|
"In the extreme case of k identical predictors, they each get identical coefficients with 1=kth the size that any single one would get if t alone. From a Bayesian point of view, the ridge penalty is ideal if there are many predictors, and all have non-zero coefficients (drawn from a Gaussian distribution).
Lasso, on the other hand, is somewhat indifferent to very correlated predictors, and will tend to pick one and ignore the rest. In the extreme case above, the lasso problem breaks down. The Lasso penalty corresponds to a Laplace prior, which expects many coefficients to be close to zero, and a small subset to be larger and nonzero."
Page 4, Regularization Paths for Generalized Linear Models via Coordinate Descent, Jerome Friedman, Trevor Hastie, Rob Tibshirani.
So, you can leave all of them in--since Ridge guarantees that the (X'X) matrix is invertible---but I wouldn't recommend it.
|
How to encode an n-level categorical variable as dummies, for glmnet?
|
"In the extreme case of k identical predictors, they each get identical coefficients with 1=kth the size that any single one would get if t alone. From a Bayesian point of view, the ridge penalty is i
|
How to encode an n-level categorical variable as dummies, for glmnet?
"In the extreme case of k identical predictors, they each get identical coefficients with 1=kth the size that any single one would get if t alone. From a Bayesian point of view, the ridge penalty is ideal if there are many predictors, and all have non-zero coefficients (drawn from a Gaussian distribution).
Lasso, on the other hand, is somewhat indifferent to very correlated predictors, and will tend to pick one and ignore the rest. In the extreme case above, the lasso problem breaks down. The Lasso penalty corresponds to a Laplace prior, which expects many coefficients to be close to zero, and a small subset to be larger and nonzero."
Page 4, Regularization Paths for Generalized Linear Models via Coordinate Descent, Jerome Friedman, Trevor Hastie, Rob Tibshirani.
So, you can leave all of them in--since Ridge guarantees that the (X'X) matrix is invertible---but I wouldn't recommend it.
|
How to encode an n-level categorical variable as dummies, for glmnet?
"In the extreme case of k identical predictors, they each get identical coefficients with 1=kth the size that any single one would get if t alone. From a Bayesian point of view, the ridge penalty is i
|
43,542
|
How to encode an n-level categorical variable as dummies, for glmnet?
|
The question seems have little thing to do with glmnet, but factor encoding and interpretation on coefficient in general.
I would suggest to look at logistic regression that uses categorical variables as a start. R Library: Contrast Coding Systems for categorical variables a great resource to learn different types of encoding and interpretation. The key is "comparing to base level". For example, if we want to encode days of weeks. We can use Sunday as a base level, and all other days will compare against it.
|
How to encode an n-level categorical variable as dummies, for glmnet?
|
The question seems have little thing to do with glmnet, but factor encoding and interpretation on coefficient in general.
I would suggest to look at logistic regression that uses categorical variable
|
How to encode an n-level categorical variable as dummies, for glmnet?
The question seems have little thing to do with glmnet, but factor encoding and interpretation on coefficient in general.
I would suggest to look at logistic regression that uses categorical variables as a start. R Library: Contrast Coding Systems for categorical variables a great resource to learn different types of encoding and interpretation. The key is "comparing to base level". For example, if we want to encode days of weeks. We can use Sunday as a base level, and all other days will compare against it.
|
How to encode an n-level categorical variable as dummies, for glmnet?
The question seems have little thing to do with glmnet, but factor encoding and interpretation on coefficient in general.
I would suggest to look at logistic regression that uses categorical variable
|
43,543
|
Population model to model year to year dynamics
|
Baker 2012 (Journal of Applied Ecology) used similar model. I was asking him and he replied he uses normal glm()! He inspired me to use the following transformation (that he actually used in the linked article) - just recursively substitute the $\mbox{log} (\mu_{i,j})$, until you get this:
$$\mbox{log} ( \mu_{i,j+1} ) = \mbox{log} ( \mu_{i,1} ) + \sum\limits_{t=1}^{j} R_{t} + \sum\limits_{k} \alpha_k \sum\limits_{t=1}^{j}x_{k,t}$$
and then, $\mbox{log}(\mu_{i,1})$ can be simply taken as a site-specific intercept:
$$\begin{eqnarray}
\mbox{log} ( \mu_{i,j+1} ) &=& \alpha_i + \sum\limits_{t=1}^{j} R_{t} + \sum\limits_{k} \alpha_k \sum\limits_{t=1}^{j}x_{k,t} \\
\mbox{log} ( \mu_{i,1} ) &=& \alpha_i
\end{eqnarray}$$
so this can be easily solved by classic GLM. It is trivial to see that the transformed equations are equivalent to the original model. I do not trivially see that the whole fit proccess including poisson errors will also be equivalent, but this is probably more limitation of my brain than an actual problem :).
The transformed model is of course very easily fitted using glm()! Including overdispersion using the quasipoisson family.
|
Population model to model year to year dynamics
|
Baker 2012 (Journal of Applied Ecology) used similar model. I was asking him and he replied he uses normal glm()! He inspired me to use the following transformation (that he actually used in the linke
|
Population model to model year to year dynamics
Baker 2012 (Journal of Applied Ecology) used similar model. I was asking him and he replied he uses normal glm()! He inspired me to use the following transformation (that he actually used in the linked article) - just recursively substitute the $\mbox{log} (\mu_{i,j})$, until you get this:
$$\mbox{log} ( \mu_{i,j+1} ) = \mbox{log} ( \mu_{i,1} ) + \sum\limits_{t=1}^{j} R_{t} + \sum\limits_{k} \alpha_k \sum\limits_{t=1}^{j}x_{k,t}$$
and then, $\mbox{log}(\mu_{i,1})$ can be simply taken as a site-specific intercept:
$$\begin{eqnarray}
\mbox{log} ( \mu_{i,j+1} ) &=& \alpha_i + \sum\limits_{t=1}^{j} R_{t} + \sum\limits_{k} \alpha_k \sum\limits_{t=1}^{j}x_{k,t} \\
\mbox{log} ( \mu_{i,1} ) &=& \alpha_i
\end{eqnarray}$$
so this can be easily solved by classic GLM. It is trivial to see that the transformed equations are equivalent to the original model. I do not trivially see that the whole fit proccess including poisson errors will also be equivalent, but this is probably more limitation of my brain than an actual problem :).
The transformed model is of course very easily fitted using glm()! Including overdispersion using the quasipoisson family.
|
Population model to model year to year dynamics
Baker 2012 (Journal of Applied Ecology) used similar model. I was asking him and he replied he uses normal glm()! He inspired me to use the following transformation (that he actually used in the linke
|
43,544
|
Population model to model year to year dynamics
|
Population growth models often use Poisson modeling framework. In R, fitting a Poisson GLM is easy. See ?glm. An example is:
f <- glm(N ~ x + R, family=poisson)
To estimate: $\log(\mu | x) = \beta_0 + \beta_1 x + \beta_2 R$. $\beta_1$ is interpreted as a relative rate comparing the rate (or Poisson lambda) for $N$ differing by 1 unit in $x$. This may be desirable when $x$ is an experimental condition with controlled values, or completely unconditional. I would agree it doesn't immediately suggest to me a good model for $x$ being time, because inferring the previous year's population from the current is much different than inferring the next year's population from the last. Let's hold on to the question of whether a fixed effect is adequate for modeling baseline time trends.
Intuitively, we have some notion that there is correlation in these data since population growth is exponential. In horseshoe crabs, for instance, higher population means more mingling and higher fertility rates (see Agresti Categorical Data Analysis 2nd ed). This motivates the use of a quasilikelihood, or quasipoisson model to account for overdispersion if our interest lies specifically in measuring the relative rates for some exposure accounting for time.
However, neither of these approaches really answer the question we're truly interested in: "What is the relative rate for $N$ comparing values of $x$ differing by 1 unit for a standardized population?". That is, for every thousand subjects, say, if we were to observe $x$ taking a different value, how would that affect seasonal trends? The way to account for this is the use of an offset.
Offsets are constrained parameters in the model that can account for lagged effects in time and standardize a denominator of growth. For instance, consider the following linear model:
$\log \left( N_{i} / N_{i-1} \right) = \beta_0 + \beta_1 x$
$N_{i-1}$ (the previous year's rates) are considered fixed and known. However, if $x$ is correlated with $N_{i-1}$, adjusting for the lagged effect in the linear model will lead to biased estimates of $\beta_1$. So we rewrite the model as:
$\log N_{i} = \beta_0 + \beta_1 x + 1 \cdot \log N_{i-1}$.
This allows us to account for the previous years' volume while estimating the association between $x$ and the current years' incremental growth.
|
Population model to model year to year dynamics
|
Population growth models often use Poisson modeling framework. In R, fitting a Poisson GLM is easy. See ?glm. An example is:
f <- glm(N ~ x + R, family=poisson)
To estimate: $\log(\mu | x) = \beta_0 +
|
Population model to model year to year dynamics
Population growth models often use Poisson modeling framework. In R, fitting a Poisson GLM is easy. See ?glm. An example is:
f <- glm(N ~ x + R, family=poisson)
To estimate: $\log(\mu | x) = \beta_0 + \beta_1 x + \beta_2 R$. $\beta_1$ is interpreted as a relative rate comparing the rate (or Poisson lambda) for $N$ differing by 1 unit in $x$. This may be desirable when $x$ is an experimental condition with controlled values, or completely unconditional. I would agree it doesn't immediately suggest to me a good model for $x$ being time, because inferring the previous year's population from the current is much different than inferring the next year's population from the last. Let's hold on to the question of whether a fixed effect is adequate for modeling baseline time trends.
Intuitively, we have some notion that there is correlation in these data since population growth is exponential. In horseshoe crabs, for instance, higher population means more mingling and higher fertility rates (see Agresti Categorical Data Analysis 2nd ed). This motivates the use of a quasilikelihood, or quasipoisson model to account for overdispersion if our interest lies specifically in measuring the relative rates for some exposure accounting for time.
However, neither of these approaches really answer the question we're truly interested in: "What is the relative rate for $N$ comparing values of $x$ differing by 1 unit for a standardized population?". That is, for every thousand subjects, say, if we were to observe $x$ taking a different value, how would that affect seasonal trends? The way to account for this is the use of an offset.
Offsets are constrained parameters in the model that can account for lagged effects in time and standardize a denominator of growth. For instance, consider the following linear model:
$\log \left( N_{i} / N_{i-1} \right) = \beta_0 + \beta_1 x$
$N_{i-1}$ (the previous year's rates) are considered fixed and known. However, if $x$ is correlated with $N_{i-1}$, adjusting for the lagged effect in the linear model will lead to biased estimates of $\beta_1$. So we rewrite the model as:
$\log N_{i} = \beta_0 + \beta_1 x + 1 \cdot \log N_{i-1}$.
This allows us to account for the previous years' volume while estimating the association between $x$ and the current years' incremental growth.
|
Population model to model year to year dynamics
Population growth models often use Poisson modeling framework. In R, fitting a Poisson GLM is easy. See ?glm. An example is:
f <- glm(N ~ x + R, family=poisson)
To estimate: $\log(\mu | x) = \beta_0 +
|
43,545
|
Which statistical test to use with multiple response variables and continuous predictors?
|
I would suggest you to clearly mention you the number and measurement scale (metric or non-metric) response and predictor variables in order to make others understand the problem correctly.
If I understood correctly, you have multivariate multiple regression problem. One possible solution is to use MANCOVA (multivariate analysis of co-variance).
Edit: R package jmv (The 'jamovi' Analyses) may be useful.
Refer: This and this
|
Which statistical test to use with multiple response variables and continuous predictors?
|
I would suggest you to clearly mention you the number and measurement scale (metric or non-metric) response and predictor variables in order to make others understand the problem correctly.
If I under
|
Which statistical test to use with multiple response variables and continuous predictors?
I would suggest you to clearly mention you the number and measurement scale (metric or non-metric) response and predictor variables in order to make others understand the problem correctly.
If I understood correctly, you have multivariate multiple regression problem. One possible solution is to use MANCOVA (multivariate analysis of co-variance).
Edit: R package jmv (The 'jamovi' Analyses) may be useful.
Refer: This and this
|
Which statistical test to use with multiple response variables and continuous predictors?
I would suggest you to clearly mention you the number and measurement scale (metric or non-metric) response and predictor variables in order to make others understand the problem correctly.
If I under
|
43,546
|
Importance sampling of finite path of stochastic difference equation
|
This isn't a direct answer to your question, but what you have described sounds very much like a hidden Markov model and particle filtering. I'm not sure if you are familiar with filtering theory, but here is a particle filtering tutorial that I have found helpful in the past. If you don't have access to that paper, the title is 'A Tutorial on Particle Filters for Online Nonlinear/Non-Gaussian Bayesian Tracking'; you may be able to find it elsewhere.
Notice that equation (1) of the paper describes the process exactly as you have in your equation (1). Also, section V deals with importance sampling algorithms for this problem.
|
Importance sampling of finite path of stochastic difference equation
|
This isn't a direct answer to your question, but what you have described sounds very much like a hidden Markov model and particle filtering. I'm not sure if you are familiar with filtering theory, but
|
Importance sampling of finite path of stochastic difference equation
This isn't a direct answer to your question, but what you have described sounds very much like a hidden Markov model and particle filtering. I'm not sure if you are familiar with filtering theory, but here is a particle filtering tutorial that I have found helpful in the past. If you don't have access to that paper, the title is 'A Tutorial on Particle Filters for Online Nonlinear/Non-Gaussian Bayesian Tracking'; you may be able to find it elsewhere.
Notice that equation (1) of the paper describes the process exactly as you have in your equation (1). Also, section V deals with importance sampling algorithms for this problem.
|
Importance sampling of finite path of stochastic difference equation
This isn't a direct answer to your question, but what you have described sounds very much like a hidden Markov model and particle filtering. I'm not sure if you are familiar with filtering theory, but
|
43,547
|
Starting coefficient vector for GLM
|
R's glm does not (by default) start with an initial value for $\beta$, it starts with an initial value for $\mu$. The initial value for $\mu$ depends on the family; it is close to $y$ but chosen to be in the domain of the likely link function. For example, for binomial, with $y=r/n$,
$$\mu=\frac{r+1/2}{n-r+1/2}$$
and for Poisson, $\mu=y+0.1$, and for Gamma, $\mu=y$.
The initialising value for $\mu$ is used to compute the working response and working weights, and these are used to compute the first value of $\beta$ (after the first iteration)
You can specify an initial beta, and for some link/variance combinations you have to (eg, binomial(log), where the obvious $\beta=0$ doesn't work but $\beta^T=(-1,0,0,\dots,0)$ does)
|
Starting coefficient vector for GLM
|
R's glm does not (by default) start with an initial value for $\beta$, it starts with an initial value for $\mu$. The initial value for $\mu$ depends on the family; it is close to $y$ but chosen to b
|
Starting coefficient vector for GLM
R's glm does not (by default) start with an initial value for $\beta$, it starts with an initial value for $\mu$. The initial value for $\mu$ depends on the family; it is close to $y$ but chosen to be in the domain of the likely link function. For example, for binomial, with $y=r/n$,
$$\mu=\frac{r+1/2}{n-r+1/2}$$
and for Poisson, $\mu=y+0.1$, and for Gamma, $\mu=y$.
The initialising value for $\mu$ is used to compute the working response and working weights, and these are used to compute the first value of $\beta$ (after the first iteration)
You can specify an initial beta, and for some link/variance combinations you have to (eg, binomial(log), where the obvious $\beta=0$ doesn't work but $\beta^T=(-1,0,0,\dots,0)$ does)
|
Starting coefficient vector for GLM
R's glm does not (by default) start with an initial value for $\beta$, it starts with an initial value for $\mu$. The initial value for $\mu$ depends on the family; it is close to $y$ but chosen to b
|
43,548
|
Starting coefficient vector for GLM
|
Well, after much searching and going through papers on the theory behind GLM, I found this algorithm for the initial values, which numerically agrees with R using maxit = 1 to force R to output its initial coefficient estimates.
|
Starting coefficient vector for GLM
|
Well, after much searching and going through papers on the theory behind GLM, I found this algorithm for the initial values, which numerically agrees with R using maxit = 1 to force R to output its in
|
Starting coefficient vector for GLM
Well, after much searching and going through papers on the theory behind GLM, I found this algorithm for the initial values, which numerically agrees with R using maxit = 1 to force R to output its initial coefficient estimates.
|
Starting coefficient vector for GLM
Well, after much searching and going through papers on the theory behind GLM, I found this algorithm for the initial values, which numerically agrees with R using maxit = 1 to force R to output its in
|
43,549
|
Randomly distributed residuals or not?
|
I see you use a categorical variable as a continuous. You should distinguish each case with three dummy variables. A longer explanation is provided here.
That being said, I would re-estimate your model and check the residuals once more, with a better specified model.
The DW statistics is used for time-series. Is it the case ? For a discussion on the DW statistics, see this link, and that link. At any rate, you should check in the tables for the critical values of the DW test, and not guess with "it is close to 2".
|
Randomly distributed residuals or not?
|
I see you use a categorical variable as a continuous. You should distinguish each case with three dummy variables. A longer explanation is provided here.
That being said, I would re-estimate your mode
|
Randomly distributed residuals or not?
I see you use a categorical variable as a continuous. You should distinguish each case with three dummy variables. A longer explanation is provided here.
That being said, I would re-estimate your model and check the residuals once more, with a better specified model.
The DW statistics is used for time-series. Is it the case ? For a discussion on the DW statistics, see this link, and that link. At any rate, you should check in the tables for the critical values of the DW test, and not guess with "it is close to 2".
|
Randomly distributed residuals or not?
I see you use a categorical variable as a continuous. You should distinguish each case with three dummy variables. A longer explanation is provided here.
That being said, I would re-estimate your mode
|
43,550
|
What do you consider a new model versus an updated model (time series)?
|
The question you raise is quite important. WE have implemented the CHOW Test for constancy of parameters in order to test the hypothesis that the parameters haven't changed significantly at one or more points in time. If we detect a significant change then we can then use the most recent data set to develop a new model. This test requires ( at least for us who know time series ) that any anamolous data points have been rectified/corrected via Intervention Detection procedures ( see R. Tsay's work ). If you want to pursue this topic please feel free to contact me off line and I will try and help you.
|
What do you consider a new model versus an updated model (time series)?
|
The question you raise is quite important. WE have implemented the CHOW Test for constancy of parameters in order to test the hypothesis that the parameters haven't changed significantly at one or mor
|
What do you consider a new model versus an updated model (time series)?
The question you raise is quite important. WE have implemented the CHOW Test for constancy of parameters in order to test the hypothesis that the parameters haven't changed significantly at one or more points in time. If we detect a significant change then we can then use the most recent data set to develop a new model. This test requires ( at least for us who know time series ) that any anamolous data points have been rectified/corrected via Intervention Detection procedures ( see R. Tsay's work ). If you want to pursue this topic please feel free to contact me off line and I will try and help you.
|
What do you consider a new model versus an updated model (time series)?
The question you raise is quite important. WE have implemented the CHOW Test for constancy of parameters in order to test the hypothesis that the parameters haven't changed significantly at one or mor
|
43,551
|
What exactly is the equation for SVM classification for new example?
|
Burges's A Tutorial on Support Vector Machines for Pattern Recognition provides you a very detailed introduction to SVMs. Just compare it to logistic regression, the decision function of SVMs for the binary classification case is
$$
f(\mathbf{x}) = \text{sgn} (\mathbf{w}^T \mathbf{x} + b)
$$
where $\mathbf{w} = \sum_i \alpha_i y_i \mathbf{x}_i$, $\alpha_i$ is zero for all cases, but the support vectors (those lying exactly at the separating hyperplane), and $y_i \in \{1, -1\}$ are the labels.
The reference gives in addition very clear and intuitive geometrical interpretations of these results. See that you it does not provide any score like logistic regression does. It does not model a (conditional) probability density. Please refere to the scikit-learn documentation for a description of this issue, and ways to deal with it.
|
What exactly is the equation for SVM classification for new example?
|
Burges's A Tutorial on Support Vector Machines for Pattern Recognition provides you a very detailed introduction to SVMs. Just compare it to logistic regression, the decision function of SVMs for the
|
What exactly is the equation for SVM classification for new example?
Burges's A Tutorial on Support Vector Machines for Pattern Recognition provides you a very detailed introduction to SVMs. Just compare it to logistic regression, the decision function of SVMs for the binary classification case is
$$
f(\mathbf{x}) = \text{sgn} (\mathbf{w}^T \mathbf{x} + b)
$$
where $\mathbf{w} = \sum_i \alpha_i y_i \mathbf{x}_i$, $\alpha_i$ is zero for all cases, but the support vectors (those lying exactly at the separating hyperplane), and $y_i \in \{1, -1\}$ are the labels.
The reference gives in addition very clear and intuitive geometrical interpretations of these results. See that you it does not provide any score like logistic regression does. It does not model a (conditional) probability density. Please refere to the scikit-learn documentation for a description of this issue, and ways to deal with it.
|
What exactly is the equation for SVM classification for new example?
Burges's A Tutorial on Support Vector Machines for Pattern Recognition provides you a very detailed introduction to SVMs. Just compare it to logistic regression, the decision function of SVMs for the
|
43,552
|
Choosing one variable from each of 3 buckets of variables
|
Since you have three categorical variables with $20$ categories each, plus gender and age, that gives you a total of $3 \times 19+1 = 58$ binary variables and one continuous variable. If you are willing to proceed without interaction effects, that gives you a model with $60$ coefficients (including an intercept term). That is a relatively manageable number of terms, and with a reasonable-sized data set, you should have an adequate number of residual degrees-of-freedom, and get reasonable estimates of your parameters.
Your problem emerges if you decide you want to include interaction effects between the categorical variables. Adding two- and three-way interactions between your three categorical variables, gives you $20^3 = 8000$ parameters in your model instead of $57$. (If you also interact with gender and age this quadruples again.) That is a large number of parameters, and you would need a large amount of data to ensure that you have an adequate number of residual degrees-of-freedom. Even if you have sufficient data for this, it is dubious to cherry-pick interaction terms from categorical variables in the manner you are describing - that is a classic example of data-dredging. Instead of doing this, you should either include the whole set of interaction terms for a categorical interaction, or remove the whole set of interaction terms. It is not legitimate to cherry-pick interaction terms from within indicator values for a broad categorical variable.
|
Choosing one variable from each of 3 buckets of variables
|
Since you have three categorical variables with $20$ categories each, plus gender and age, that gives you a total of $3 \times 19+1 = 58$ binary variables and one continuous variable. If you are will
|
Choosing one variable from each of 3 buckets of variables
Since you have three categorical variables with $20$ categories each, plus gender and age, that gives you a total of $3 \times 19+1 = 58$ binary variables and one continuous variable. If you are willing to proceed without interaction effects, that gives you a model with $60$ coefficients (including an intercept term). That is a relatively manageable number of terms, and with a reasonable-sized data set, you should have an adequate number of residual degrees-of-freedom, and get reasonable estimates of your parameters.
Your problem emerges if you decide you want to include interaction effects between the categorical variables. Adding two- and three-way interactions between your three categorical variables, gives you $20^3 = 8000$ parameters in your model instead of $57$. (If you also interact with gender and age this quadruples again.) That is a large number of parameters, and you would need a large amount of data to ensure that you have an adequate number of residual degrees-of-freedom. Even if you have sufficient data for this, it is dubious to cherry-pick interaction terms from categorical variables in the manner you are describing - that is a classic example of data-dredging. Instead of doing this, you should either include the whole set of interaction terms for a categorical interaction, or remove the whole set of interaction terms. It is not legitimate to cherry-pick interaction terms from within indicator values for a broad categorical variable.
|
Choosing one variable from each of 3 buckets of variables
Since you have three categorical variables with $20$ categories each, plus gender and age, that gives you a total of $3 \times 19+1 = 58$ binary variables and one continuous variable. If you are will
|
43,553
|
Choosing one variable from each of 3 buckets of variables
|
If you have 60 possible covariates, and just want to be able to use the model to build predictions and are not that concerned with interpretability, you might build a random forest on a training set of your data and see what kind of predictive power you could get from the model it builds. The package randomForest in r can help you with this.
|
Choosing one variable from each of 3 buckets of variables
|
If you have 60 possible covariates, and just want to be able to use the model to build predictions and are not that concerned with interpretability, you might build a random forest on a training set o
|
Choosing one variable from each of 3 buckets of variables
If you have 60 possible covariates, and just want to be able to use the model to build predictions and are not that concerned with interpretability, you might build a random forest on a training set of your data and see what kind of predictive power you could get from the model it builds. The package randomForest in r can help you with this.
|
Choosing one variable from each of 3 buckets of variables
If you have 60 possible covariates, and just want to be able to use the model to build predictions and are not that concerned with interpretability, you might build a random forest on a training set o
|
43,554
|
Dimensionality Reduction Algorithm for Large Dataset?
|
Random forests are robust. They are not impacted by outliers.
Gradient boosted trees are great at fitting or over fitting the data.
The combination is fast, handles classical or categorical data, and can handle very large data.
Random forests of gradient boosted trees easily handle problems of this complexity and size. http://dl.acm.org/citation.cfm?id=1755828
|
Dimensionality Reduction Algorithm for Large Dataset?
|
Random forests are robust. They are not impacted by outliers.
Gradient boosted trees are great at fitting or over fitting the data.
The combination is fast, handles classical or categorical data, and
|
Dimensionality Reduction Algorithm for Large Dataset?
Random forests are robust. They are not impacted by outliers.
Gradient boosted trees are great at fitting or over fitting the data.
The combination is fast, handles classical or categorical data, and can handle very large data.
Random forests of gradient boosted trees easily handle problems of this complexity and size. http://dl.acm.org/citation.cfm?id=1755828
|
Dimensionality Reduction Algorithm for Large Dataset?
Random forests are robust. They are not impacted by outliers.
Gradient boosted trees are great at fitting or over fitting the data.
The combination is fast, handles classical or categorical data, and
|
43,555
|
Are GAMMs/GLM the best choice for calculating number of germs on hands?
|
I think the model is incomplete. Why not consider her hands as a forest of SIR models? There are some things that "die on the vine" and for that "R" applies.
Here are links on SIR:
http://www.maa.org/publications/periodicals/loci/joma/the-sir-model-for-spread-of-disease-the-differential-equation-model
http://www.iaeng.org/IJAM/issues_v44/issue_2/IJAM_44_2_06.pdf
http://en.wikipedia.org/wiki/Epidemic_model
It seems that lognormal distributions may apply to some limited set of special cases of disease, but they are not general enough for unilateral applicability.
I have my head in random forests and a forest of SIR models (see IJAM link) is going to account for variation, give you robust answers, and have a basis that is generally applicable to the problem.
|
Are GAMMs/GLM the best choice for calculating number of germs on hands?
|
I think the model is incomplete. Why not consider her hands as a forest of SIR models? There are some things that "die on the vine" and for that "R" applies.
Here are links on SIR:
http://www.maa
|
Are GAMMs/GLM the best choice for calculating number of germs on hands?
I think the model is incomplete. Why not consider her hands as a forest of SIR models? There are some things that "die on the vine" and for that "R" applies.
Here are links on SIR:
http://www.maa.org/publications/periodicals/loci/joma/the-sir-model-for-spread-of-disease-the-differential-equation-model
http://www.iaeng.org/IJAM/issues_v44/issue_2/IJAM_44_2_06.pdf
http://en.wikipedia.org/wiki/Epidemic_model
It seems that lognormal distributions may apply to some limited set of special cases of disease, but they are not general enough for unilateral applicability.
I have my head in random forests and a forest of SIR models (see IJAM link) is going to account for variation, give you robust answers, and have a basis that is generally applicable to the problem.
|
Are GAMMs/GLM the best choice for calculating number of germs on hands?
I think the model is incomplete. Why not consider her hands as a forest of SIR models? There are some things that "die on the vine" and for that "R" applies.
Here are links on SIR:
http://www.maa
|
43,556
|
Checking for outliers in a glmer (lme4 package) with 3 random factors
|
try the romr.fnc in the LMERConvenienceFunctions to remove outliers
df3.trimmed = romr.fnc(m, df3, trim = 2.5)
df3.trimmed = df3.trimmed$data
update initial model on trimmed data
mB = update(m1)
|
Checking for outliers in a glmer (lme4 package) with 3 random factors
|
try the romr.fnc in the LMERConvenienceFunctions to remove outliers
df3.trimmed = romr.fnc(m, df3, trim = 2.5)
df3.trimmed = df3.trimmed$data
update initial model on trimmed data
mB = update(m1)
|
Checking for outliers in a glmer (lme4 package) with 3 random factors
try the romr.fnc in the LMERConvenienceFunctions to remove outliers
df3.trimmed = romr.fnc(m, df3, trim = 2.5)
df3.trimmed = df3.trimmed$data
update initial model on trimmed data
mB = update(m1)
|
Checking for outliers in a glmer (lme4 package) with 3 random factors
try the romr.fnc in the LMERConvenienceFunctions to remove outliers
df3.trimmed = romr.fnc(m, df3, trim = 2.5)
df3.trimmed = df3.trimmed$data
update initial model on trimmed data
mB = update(m1)
|
43,557
|
What are the assumptions for checking the stationarity of a time series?
|
ADF is a parametric test and KPSS is a non-parametric test of unit root. That being said, the chosen lag order in the ADF should be such that residuals are white noise.
|
What are the assumptions for checking the stationarity of a time series?
|
ADF is a parametric test and KPSS is a non-parametric test of unit root. That being said, the chosen lag order in the ADF should be such that residuals are white noise.
|
What are the assumptions for checking the stationarity of a time series?
ADF is a parametric test and KPSS is a non-parametric test of unit root. That being said, the chosen lag order in the ADF should be such that residuals are white noise.
|
What are the assumptions for checking the stationarity of a time series?
ADF is a parametric test and KPSS is a non-parametric test of unit root. That being said, the chosen lag order in the ADF should be such that residuals are white noise.
|
43,558
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
|
You might want to take a look at two-part (aka hurdle) count data models. A good place to start is Chapter 17 of Cameron and Trivedi's Microeconometrics using Stata. In fact, your smoking example is the one they use to motivate this. Essentially, you have one model to determine if a person takes up smoking, and then another one that determines how much if they decide to do it.
Another good source for overdispersed hurdle count data is Farbmacher (2011) SJ paper (scroll down to find it). Overdispersion happens when the (conditional) variance of your outcome exceeds the (conditional) mean, which is often the case with data like this.
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
|
You might want to take a look at two-part (aka hurdle) count data models. A good place to start is Chapter 17 of Cameron and Trivedi's Microeconometrics using Stata. In fact, your smoking example is t
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
You might want to take a look at two-part (aka hurdle) count data models. A good place to start is Chapter 17 of Cameron and Trivedi's Microeconometrics using Stata. In fact, your smoking example is the one they use to motivate this. Essentially, you have one model to determine if a person takes up smoking, and then another one that determines how much if they decide to do it.
Another good source for overdispersed hurdle count data is Farbmacher (2011) SJ paper (scroll down to find it). Overdispersion happens when the (conditional) variance of your outcome exceeds the (conditional) mean, which is often the case with data like this.
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
You might want to take a look at two-part (aka hurdle) count data models. A good place to start is Chapter 17 of Cameron and Trivedi's Microeconometrics using Stata. In fact, your smoking example is t
|
43,559
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
|
Think about the construct of interest
I'd think about the construct you are trying to measure. As Macro mentioned, it may be that your variable is largely reflecting the fact that people are either smokers or not smokers. If they are smokers, they will tend to smoke every day of the week, and if they are not smokers, they wont.
There might also be a third category of casual or occasional smokers. That said, your single item measure might not be the best way of discriminating between these three categories. So, if you are interested in the distinction between regular and casual smokers, then I'd look at incorporating some other indicators of casual smoking.
If you are interested in frequency or intensity of smoking, then your item is poor at measuring that. You would be better off asking about average frequency of smoking per day or some similar question.
General recommendations
Thus, I'd consider thinking more deeply about what you want to measure. But if you're stuck with the data you have, you might want to do one of a few different things:
Recode the variable to none or one or more and predict using binary logistic regression.
Recode the variable to none, one to six, and 7 and predict using multinomial logistic regression.
Do no recoding and predict the variable using something like an ordered probit or ordered logistic regression.
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
|
Think about the construct of interest
I'd think about the construct you are trying to measure. As Macro mentioned, it may be that your variable is largely reflecting the fact that people are either sm
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
Think about the construct of interest
I'd think about the construct you are trying to measure. As Macro mentioned, it may be that your variable is largely reflecting the fact that people are either smokers or not smokers. If they are smokers, they will tend to smoke every day of the week, and if they are not smokers, they wont.
There might also be a third category of casual or occasional smokers. That said, your single item measure might not be the best way of discriminating between these three categories. So, if you are interested in the distinction between regular and casual smokers, then I'd look at incorporating some other indicators of casual smoking.
If you are interested in frequency or intensity of smoking, then your item is poor at measuring that. You would be better off asking about average frequency of smoking per day or some similar question.
General recommendations
Thus, I'd consider thinking more deeply about what you want to measure. But if you're stuck with the data you have, you might want to do one of a few different things:
Recode the variable to none or one or more and predict using binary logistic regression.
Recode the variable to none, one to six, and 7 and predict using multinomial logistic regression.
Do no recoding and predict the variable using something like an ordered probit or ordered logistic regression.
|
How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?
Think about the construct of interest
I'd think about the construct you are trying to measure. As Macro mentioned, it may be that your variable is largely reflecting the fact that people are either sm
|
43,560
|
Comparing coefficients of time series models
|
The Chow Test can be used to test the equivalence of two (or more ) time series models.
|
Comparing coefficients of time series models
|
The Chow Test can be used to test the equivalence of two (or more ) time series models.
|
Comparing coefficients of time series models
The Chow Test can be used to test the equivalence of two (or more ) time series models.
|
Comparing coefficients of time series models
The Chow Test can be used to test the equivalence of two (or more ) time series models.
|
43,561
|
Program yourself or use data mining toolkit?
|
I think I agree, drag/drop approach for data mining is not want you need. I think you need something similar to Python-like scripting language. If you think about such approach to statistics, you can try ScaVis program that use Python for statistics. Another option is SciPy or similar.
|
Program yourself or use data mining toolkit?
|
I think I agree, drag/drop approach for data mining is not want you need. I think you need something similar to Python-like scripting language. If you think about such approach to statistics, you can
|
Program yourself or use data mining toolkit?
I think I agree, drag/drop approach for data mining is not want you need. I think you need something similar to Python-like scripting language. If you think about such approach to statistics, you can try ScaVis program that use Python for statistics. Another option is SciPy or similar.
|
Program yourself or use data mining toolkit?
I think I agree, drag/drop approach for data mining is not want you need. I think you need something similar to Python-like scripting language. If you think about such approach to statistics, you can
|
43,562
|
Logistic Regression with dependent observations
|
You could always come up with a set of transformed variables that aggregate the data from 3 months into one observation for each patient (e.g., average blood pressure across the prior 3 months, 3-month exercise hours/cigarette, etc.). Then you have independent observations (1 per patient), and you could build the model. This kind of defeats the purpose of having monthly granularity, but you could evaluate a logistic regression like this against a legitimate longitudinal method.
|
Logistic Regression with dependent observations
|
You could always come up with a set of transformed variables that aggregate the data from 3 months into one observation for each patient (e.g., average blood pressure across the prior 3 months, 3-mont
|
Logistic Regression with dependent observations
You could always come up with a set of transformed variables that aggregate the data from 3 months into one observation for each patient (e.g., average blood pressure across the prior 3 months, 3-month exercise hours/cigarette, etc.). Then you have independent observations (1 per patient), and you could build the model. This kind of defeats the purpose of having monthly granularity, but you could evaluate a logistic regression like this against a legitimate longitudinal method.
|
Logistic Regression with dependent observations
You could always come up with a set of transformed variables that aggregate the data from 3 months into one observation for each patient (e.g., average blood pressure across the prior 3 months, 3-mont
|
43,563
|
Is it valid to take a mean of p-values during cross-validation, when comparing the predicted output of a model to the actual output? [closed]
|
How about using Fisher's method or Stouffer's method for combining independent p-values to reject the global null hypothesis ? In your case, I reckon the global null hypothesis is the training and test data follows the same distribution. For more information, you can visit the following pages
When combining p-values, why not just averaging?
Combining multiple p-values
|
Is it valid to take a mean of p-values during cross-validation, when comparing the predicted output
|
How about using Fisher's method or Stouffer's method for combining independent p-values to reject the global null hypothesis ? In your case, I reckon the global null hypothesis is the training and tes
|
Is it valid to take a mean of p-values during cross-validation, when comparing the predicted output of a model to the actual output? [closed]
How about using Fisher's method or Stouffer's method for combining independent p-values to reject the global null hypothesis ? In your case, I reckon the global null hypothesis is the training and test data follows the same distribution. For more information, you can visit the following pages
When combining p-values, why not just averaging?
Combining multiple p-values
|
Is it valid to take a mean of p-values during cross-validation, when comparing the predicted output
How about using Fisher's method or Stouffer's method for combining independent p-values to reject the global null hypothesis ? In your case, I reckon the global null hypothesis is the training and tes
|
43,564
|
How to test for outliers in an mlogit model in R
|
I assume that what you want is a diagnostic plot of some sort that examines residuals against fitted values. Typically model outliers are observations whose fitted values $\hat{y}$ are very different from their observed values $y$. In other words, they have an abnormally large residual $\epsilon = y - \hat{y}$.
The trick is that multinomial logit models rely on a latent, unobserved $y^*$ instead of $y$. So the entire model is based on the assumption that the error terms have an independent and identical extreme value distribution, an assumption that doesn't leave room for the concept of an "outlier." If you think your data are not IID-EV, you should use a different model.
Also, remember that the ultimate output of an MNL model is a probability; just because you observe someone "choosing" a category without the highest probability doesn't mean you have an "outlier."
Having said all of this, you can still do a leverage points analysis to determine if some observations are unique to the extent that they can affect your likelihood estimates.
|
How to test for outliers in an mlogit model in R
|
I assume that what you want is a diagnostic plot of some sort that examines residuals against fitted values. Typically model outliers are observations whose fitted values $\hat{y}$ are very different
|
How to test for outliers in an mlogit model in R
I assume that what you want is a diagnostic plot of some sort that examines residuals against fitted values. Typically model outliers are observations whose fitted values $\hat{y}$ are very different from their observed values $y$. In other words, they have an abnormally large residual $\epsilon = y - \hat{y}$.
The trick is that multinomial logit models rely on a latent, unobserved $y^*$ instead of $y$. So the entire model is based on the assumption that the error terms have an independent and identical extreme value distribution, an assumption that doesn't leave room for the concept of an "outlier." If you think your data are not IID-EV, you should use a different model.
Also, remember that the ultimate output of an MNL model is a probability; just because you observe someone "choosing" a category without the highest probability doesn't mean you have an "outlier."
Having said all of this, you can still do a leverage points analysis to determine if some observations are unique to the extent that they can affect your likelihood estimates.
|
How to test for outliers in an mlogit model in R
I assume that what you want is a diagnostic plot of some sort that examines residuals against fitted values. Typically model outliers are observations whose fitted values $\hat{y}$ are very different
|
43,565
|
Confusion related to semisupervised learning in random walk
|
Consider you have $n$ data points (or examples) of which $l$ are labeled and $u$ are unlabeled with $l \ll n$ and $ n = l + u $. Also, assume you have $m$ classes. Let us assign an $m$-dimensional label vector $\mathbf{y}_i \in [1, 0]^m$ with data point $i$. You can interpret the $j$th element of $\mathbf{y}_i$ as the probability of point $i$ belonging to class $j$. For labeled examples, you can set $y_{ij} = 1.0$ if $j$ is the label and $0$ otherwise. For unlabeled examples, in theory, it really does not matter what you initialize. Let $\mathbf{Y} \in [0, 1]^{n\times m}$ represent label vectors for the entire dataset (labeled and unlabeled). Further, let's use a superscript notation $\mathbf{Y}^{(k)}$ to denote this label matrix for iteration $k$.
We can start with $\mathbf{Y}^{(0)}$ as described above. The power-iteration method will let us calculate the value of this label matrix at iteration $t+1$ from its value at iteration $t$ as follows:
$\mathbf{Y}^{(t+1)} = \mathbf{P}\mathbf{Y}^{(t)}$
Let $\hat{\mathbf{Y}}$ be the value of this label matrix after convergence or, as is the practice, after a finite number of iterations. The $i$th row of this matrix represents the learnt label vector for example $i$, also known as the label posterior. The MAP label assignment for example $i$ would be:
$\hat{k} = \arg\max_{\displaystyle k} \hat{\mathbf{Y}}_{ik}$.
|
Confusion related to semisupervised learning in random walk
|
Consider you have $n$ data points (or examples) of which $l$ are labeled and $u$ are unlabeled with $l \ll n$ and $ n = l + u $. Also, assume you have $m$ classes. Let us assign an $m$-dimensional lab
|
Confusion related to semisupervised learning in random walk
Consider you have $n$ data points (or examples) of which $l$ are labeled and $u$ are unlabeled with $l \ll n$ and $ n = l + u $. Also, assume you have $m$ classes. Let us assign an $m$-dimensional label vector $\mathbf{y}_i \in [1, 0]^m$ with data point $i$. You can interpret the $j$th element of $\mathbf{y}_i$ as the probability of point $i$ belonging to class $j$. For labeled examples, you can set $y_{ij} = 1.0$ if $j$ is the label and $0$ otherwise. For unlabeled examples, in theory, it really does not matter what you initialize. Let $\mathbf{Y} \in [0, 1]^{n\times m}$ represent label vectors for the entire dataset (labeled and unlabeled). Further, let's use a superscript notation $\mathbf{Y}^{(k)}$ to denote this label matrix for iteration $k$.
We can start with $\mathbf{Y}^{(0)}$ as described above. The power-iteration method will let us calculate the value of this label matrix at iteration $t+1$ from its value at iteration $t$ as follows:
$\mathbf{Y}^{(t+1)} = \mathbf{P}\mathbf{Y}^{(t)}$
Let $\hat{\mathbf{Y}}$ be the value of this label matrix after convergence or, as is the practice, after a finite number of iterations. The $i$th row of this matrix represents the learnt label vector for example $i$, also known as the label posterior. The MAP label assignment for example $i$ would be:
$\hat{k} = \arg\max_{\displaystyle k} \hat{\mathbf{Y}}_{ik}$.
|
Confusion related to semisupervised learning in random walk
Consider you have $n$ data points (or examples) of which $l$ are labeled and $u$ are unlabeled with $l \ll n$ and $ n = l + u $. Also, assume you have $m$ classes. Let us assign an $m$-dimensional lab
|
43,566
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the incidence rate ratio?
|
This link provides a decent discussion of this: https://www.ctspedia.org/do/view/CTSpedia/SampleIncidence
Your answer is yes, conditionally. If you are using incidence density sampling (that is that controls are sampled from the risk set each time a case is diagnosed) which effectively matches cases and controls for time at risk, you are indeed estimating the incidence rate ratio. This article might also be of interest.
Yes, if you can do this, logistic regression would be appropriate.
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the inci
|
This link provides a decent discussion of this: https://www.ctspedia.org/do/view/CTSpedia/SampleIncidence
Your answer is yes, conditionally. If you are using incidence density sampling (that is that c
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the incidence rate ratio?
This link provides a decent discussion of this: https://www.ctspedia.org/do/view/CTSpedia/SampleIncidence
Your answer is yes, conditionally. If you are using incidence density sampling (that is that controls are sampled from the risk set each time a case is diagnosed) which effectively matches cases and controls for time at risk, you are indeed estimating the incidence rate ratio. This article might also be of interest.
Yes, if you can do this, logistic regression would be appropriate.
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the inci
This link provides a decent discussion of this: https://www.ctspedia.org/do/view/CTSpedia/SampleIncidence
Your answer is yes, conditionally. If you are using incidence density sampling (that is that c
|
43,567
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the incidence rate ratio?
|
I'm not sure that your approach would give a valid $IRR$ approximation. First, you would be "looking into the future" to determine the person-time at risk through this approach, since you know cases/controls. Generally speaking, looking into the future like that causes all sorts of problems. Second, there is a stipulation to the rare-disease assumption, and that is that every strata is rare (generally defined as 10%). That means each strata of month/year (along with any other variables you stratify by) would need to satisfy the assumption. Third, if the rare-disease assumption is met, then the $RR$ will approximate the $IRR$ following from $RR \le IRR \le OR$ when $RR \ge 1$.
Instead of the above approach, I would recommend revising the control selection procedure since you have a nested case-control study. Depending on how controls are selected, the case-control $OR$ (abbreviated $ccOR$ hereafter) can approximate different cohort measures. There are three approaches I will briefly detail; case-cohort, density, and cumulative control sampling. (note: case-cohort and density sampling require careful determination of what the start time is)
For case-cohort sampling, controls are sampled from baseline of the cohort study irrespective of later case status. Under this scenario $ccOR$ is the cohort $RR$
For density sampling (this is the one you will want to use), controls are selected at every time point when a case occurs, irrespective of later case status. As an example, consider case-1 occurs at $t=0.5$. From all individuals who are not cases at $t \le 5$, you randomly select a control from that group. In this way, the control selection mimics person-time in the cohort study, and $ccOR$ approximates the $IRR$
Lastly, is cumulative sampling where controls are selected at the final follow-up time, where controls cannot be cases. In this scenario, the $ccOR$ approximates the cohort $OR$, which under the rare disease assumption the cohort $OR$ approximates the cohort $RR$
Finally, based on the matching procedure you would need to use conditional logistic regression. However, I would forgo matching since it will not necessarily improve efficiency and you will still need to include the matching criteria in your regression model despite matching. I would skip matching and directly include month/year of entry in the conditional logistic model
Sources / Further Reading
Case-control selection:
Modern Epidemiology 3rd Edition pg 121-126
Matching in case-control:
Pearce 2016,
Mansournia 2018
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the inci
|
I'm not sure that your approach would give a valid $IRR$ approximation. First, you would be "looking into the future" to determine the person-time at risk through this approach, since you know cases/c
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the incidence rate ratio?
I'm not sure that your approach would give a valid $IRR$ approximation. First, you would be "looking into the future" to determine the person-time at risk through this approach, since you know cases/controls. Generally speaking, looking into the future like that causes all sorts of problems. Second, there is a stipulation to the rare-disease assumption, and that is that every strata is rare (generally defined as 10%). That means each strata of month/year (along with any other variables you stratify by) would need to satisfy the assumption. Third, if the rare-disease assumption is met, then the $RR$ will approximate the $IRR$ following from $RR \le IRR \le OR$ when $RR \ge 1$.
Instead of the above approach, I would recommend revising the control selection procedure since you have a nested case-control study. Depending on how controls are selected, the case-control $OR$ (abbreviated $ccOR$ hereafter) can approximate different cohort measures. There are three approaches I will briefly detail; case-cohort, density, and cumulative control sampling. (note: case-cohort and density sampling require careful determination of what the start time is)
For case-cohort sampling, controls are sampled from baseline of the cohort study irrespective of later case status. Under this scenario $ccOR$ is the cohort $RR$
For density sampling (this is the one you will want to use), controls are selected at every time point when a case occurs, irrespective of later case status. As an example, consider case-1 occurs at $t=0.5$. From all individuals who are not cases at $t \le 5$, you randomly select a control from that group. In this way, the control selection mimics person-time in the cohort study, and $ccOR$ approximates the $IRR$
Lastly, is cumulative sampling where controls are selected at the final follow-up time, where controls cannot be cases. In this scenario, the $ccOR$ approximates the cohort $OR$, which under the rare disease assumption the cohort $OR$ approximates the cohort $RR$
Finally, based on the matching procedure you would need to use conditional logistic regression. However, I would forgo matching since it will not necessarily improve efficiency and you will still need to include the matching criteria in your regression model despite matching. I would skip matching and directly include month/year of entry in the conditional logistic model
Sources / Further Reading
Case-control selection:
Modern Epidemiology 3rd Edition pg 121-126
Matching in case-control:
Pearce 2016,
Mansournia 2018
|
Can I validly expand the odds ratio analogously to the relationship between relative risk & the inci
I'm not sure that your approach would give a valid $IRR$ approximation. First, you would be "looking into the future" to determine the person-time at risk through this approach, since you know cases/c
|
43,568
|
How do you interpret the results from ridge regression?
|
Some things to look at when fitting the ridge regression
regression coefficients for this fit:
round(gridge$coef[, which(gridge$lambda ==.02)], 2)
ordinary least square fit:
round(gridge$coef[, which(gridge$lambda == 0)], 2)
The ridge regression centers and scales the predictors so you need to do the same when calculating the fit. You can add back the mean of the response.
more info on ridge regression: http://tamino.wordpress.com/2011/02/12/ridge-regression/
|
How do you interpret the results from ridge regression?
|
Some things to look at when fitting the ridge regression
regression coefficients for this fit:
round(gridge$coef[, which(gridge$lambda ==.02)], 2)
ordinary least square fit:
round(gridge$coef[, w
|
How do you interpret the results from ridge regression?
Some things to look at when fitting the ridge regression
regression coefficients for this fit:
round(gridge$coef[, which(gridge$lambda ==.02)], 2)
ordinary least square fit:
round(gridge$coef[, which(gridge$lambda == 0)], 2)
The ridge regression centers and scales the predictors so you need to do the same when calculating the fit. You can add back the mean of the response.
more info on ridge regression: http://tamino.wordpress.com/2011/02/12/ridge-regression/
|
How do you interpret the results from ridge regression?
Some things to look at when fitting the ridge regression
regression coefficients for this fit:
round(gridge$coef[, which(gridge$lambda ==.02)], 2)
ordinary least square fit:
round(gridge$coef[, w
|
43,569
|
Prediction interval for robust regression with MM-estimator
|
It would be easier to answer the question if we had the actual formula for the estimator. But generally speaking the exact distribution of the estimator should depend on the error distribution. However the covariance matrix can be estimated from the data. An exact prediction interval would seem to depend on the distribution of the error term and hence cannot be determined without specifying the error distribution. But that doesn't mean that you could not get an approximate prediction interval (note that the problem is the same for confidence intervals). For the example where beta is one-dimensional the covariance matrix is just a single variance. In the case where beta is multidimensional then there would be covariance terms. I think the result in the book deals with a robust estimator in the more general multidimensional case.
Going back to the one-dimensional case the estimates standard deviation could be estimated from the data and the asymptotic normal distribution could be used to get approximate confidence and prediction intervals which the theory says would have the approximate confidence level for large n.
|
Prediction interval for robust regression with MM-estimator
|
It would be easier to answer the question if we had the actual formula for the estimator. But generally speaking the exact distribution of the estimator should depend on the error distribution. Howe
|
Prediction interval for robust regression with MM-estimator
It would be easier to answer the question if we had the actual formula for the estimator. But generally speaking the exact distribution of the estimator should depend on the error distribution. However the covariance matrix can be estimated from the data. An exact prediction interval would seem to depend on the distribution of the error term and hence cannot be determined without specifying the error distribution. But that doesn't mean that you could not get an approximate prediction interval (note that the problem is the same for confidence intervals). For the example where beta is one-dimensional the covariance matrix is just a single variance. In the case where beta is multidimensional then there would be covariance terms. I think the result in the book deals with a robust estimator in the more general multidimensional case.
Going back to the one-dimensional case the estimates standard deviation could be estimated from the data and the asymptotic normal distribution could be used to get approximate confidence and prediction intervals which the theory says would have the approximate confidence level for large n.
|
Prediction interval for robust regression with MM-estimator
It would be easier to answer the question if we had the actual formula for the estimator. But generally speaking the exact distribution of the estimator should depend on the error distribution. Howe
|
43,570
|
Convergence of MCMC for ill-behaved functions
|
There are different routes suggested in the literature, but none of them is foolproof to check that
one has reached stationarity in the sense that $X_t\sim\pi(x)$ marginally;
one has explored the stationary distribution in the sense that$$\frac{1}{T}\sum_{t=1}^T h(X_t)\approx\mathbb{E}^\pi[h(X)]\tag{2}$$
(which are two different notions of convergence). Among these, for problem 1.
coupling the Markov chain with a perfect sampling version (expensive)
using renewal events (expensive)
comparing MCMC implementations with different parameterisations (no guarantee)
using control variates like the score function (no guarantee)
estimating the visited mass of the visited $\pi$ over the visited region (requires normalisation constant)
using tempering with particle systems to compare the range of the values of the target $\pi$ visited (no guarantee)
The convergence of the average (2) can be assessed by blocking or subsampling assuming the CLT holds.
|
Convergence of MCMC for ill-behaved functions
|
There are different routes suggested in the literature, but none of them is foolproof to check that
one has reached stationarity in the sense that $X_t\sim\pi(x)$ marginally;
one has explored the sta
|
Convergence of MCMC for ill-behaved functions
There are different routes suggested in the literature, but none of them is foolproof to check that
one has reached stationarity in the sense that $X_t\sim\pi(x)$ marginally;
one has explored the stationary distribution in the sense that$$\frac{1}{T}\sum_{t=1}^T h(X_t)\approx\mathbb{E}^\pi[h(X)]\tag{2}$$
(which are two different notions of convergence). Among these, for problem 1.
coupling the Markov chain with a perfect sampling version (expensive)
using renewal events (expensive)
comparing MCMC implementations with different parameterisations (no guarantee)
using control variates like the score function (no guarantee)
estimating the visited mass of the visited $\pi$ over the visited region (requires normalisation constant)
using tempering with particle systems to compare the range of the values of the target $\pi$ visited (no guarantee)
The convergence of the average (2) can be assessed by blocking or subsampling assuming the CLT holds.
|
Convergence of MCMC for ill-behaved functions
There are different routes suggested in the literature, but none of them is foolproof to check that
one has reached stationarity in the sense that $X_t\sim\pi(x)$ marginally;
one has explored the sta
|
43,571
|
How could I extract the distribution of one RV when given a set of sums of two RVs?
|
If $X$ has density $f$ and $Y$ has density $g$ and $X$ and $Y$ are independent then $Z=X+Y$ has a density called the convolution of $f$ and $g$.
$$H(z)=P(Z\le z) = \int \int f(x) g(y)dy dx$$
where $x$ runs from $-\infty$ to $\infty$ and $y$ from $-\infty$ to $z-x$. Then $h(z)=H^\prime(z)$.
So the question becomes if you know $H$ and $f$ can you deconvolve to get $g$?
Here is a wikipedia article that describes deconvolution and gives you an idea of how the FFT enters into it: http://en.wikipedia.org/wiki/Deconvolution
|
How could I extract the distribution of one RV when given a set of sums of two RVs?
|
If $X$ has density $f$ and $Y$ has density $g$ and $X$ and $Y$ are independent then $Z=X+Y$ has a density called the convolution of $f$ and $g$.
$$H(z)=P(Z\le z) = \int \int f(x) g(y)dy dx$$
where $
|
How could I extract the distribution of one RV when given a set of sums of two RVs?
If $X$ has density $f$ and $Y$ has density $g$ and $X$ and $Y$ are independent then $Z=X+Y$ has a density called the convolution of $f$ and $g$.
$$H(z)=P(Z\le z) = \int \int f(x) g(y)dy dx$$
where $x$ runs from $-\infty$ to $\infty$ and $y$ from $-\infty$ to $z-x$. Then $h(z)=H^\prime(z)$.
So the question becomes if you know $H$ and $f$ can you deconvolve to get $g$?
Here is a wikipedia article that describes deconvolution and gives you an idea of how the FFT enters into it: http://en.wikipedia.org/wiki/Deconvolution
|
How could I extract the distribution of one RV when given a set of sums of two RVs?
If $X$ has density $f$ and $Y$ has density $g$ and $X$ and $Y$ are independent then $Z=X+Y$ has a density called the convolution of $f$ and $g$.
$$H(z)=P(Z\le z) = \int \int f(x) g(y)dy dx$$
where $
|
43,572
|
Distribution of a centered standardized sample
|
EDIT: I guess you wanted a finite-sample result, not an asymptotic one. But if $n$ is large, the argument below shows why you'll be close to independent Normals.
Isn't this just an application of Slutsky's Theorem? Write:
$$\frac{X - m}{s} = \frac{\sigma}{s}\frac{X - \mu}{\sigma} + \frac{\sigma}{s}\frac{\mu - m}{\sigma}$$
Then note that $\frac{\sigma}{s} \rightarrow 1$, $\mu - m \rightarrow 0$, and $\frac{X - \mu}{\sigma} \sim N(0,1)$.
|
Distribution of a centered standardized sample
|
EDIT: I guess you wanted a finite-sample result, not an asymptotic one. But if $n$ is large, the argument below shows why you'll be close to independent Normals.
Isn't this just an application of Slut
|
Distribution of a centered standardized sample
EDIT: I guess you wanted a finite-sample result, not an asymptotic one. But if $n$ is large, the argument below shows why you'll be close to independent Normals.
Isn't this just an application of Slutsky's Theorem? Write:
$$\frac{X - m}{s} = \frac{\sigma}{s}\frac{X - \mu}{\sigma} + \frac{\sigma}{s}\frac{\mu - m}{\sigma}$$
Then note that $\frac{\sigma}{s} \rightarrow 1$, $\mu - m \rightarrow 0$, and $\frac{X - \mu}{\sigma} \sim N(0,1)$.
|
Distribution of a centered standardized sample
EDIT: I guess you wanted a finite-sample result, not an asymptotic one. But if $n$ is large, the argument below shows why you'll be close to independent Normals.
Isn't this just an application of Slut
|
43,573
|
Distribution of a centered standardized sample
|
Answering to myself : I no longer think that this problem is (directly) solvable, because the transformation I study (i. e. centering and standardizing) is not a bijection : $Z=\alpha{}X$ will have the same image as $X$ (whenever $\alpha\neq{}0$, of course), as well as $T=X+\gamma$. Therefore, the classic "Jacobian" results do not (can not !) apply : the reverse transformation is not defined...
More sophisticated methods (e. g. moment-generating functions) hint (strongly) in the direction of a normal(0, 1) as a limit for a sample size going to infinity. I am not sophisticated enough (good enough) to push in this direction in the finite case.
Sorry for a question that should have appear either stupid or non-solvable at first glance...
|
Distribution of a centered standardized sample
|
Answering to myself : I no longer think that this problem is (directly) solvable, because the transformation I study (i. e. centering and standardizing) is not a bijection : $Z=\alpha{}X$ will have th
|
Distribution of a centered standardized sample
Answering to myself : I no longer think that this problem is (directly) solvable, because the transformation I study (i. e. centering and standardizing) is not a bijection : $Z=\alpha{}X$ will have the same image as $X$ (whenever $\alpha\neq{}0$, of course), as well as $T=X+\gamma$. Therefore, the classic "Jacobian" results do not (can not !) apply : the reverse transformation is not defined...
More sophisticated methods (e. g. moment-generating functions) hint (strongly) in the direction of a normal(0, 1) as a limit for a sample size going to infinity. I am not sophisticated enough (good enough) to push in this direction in the finite case.
Sorry for a question that should have appear either stupid or non-solvable at first glance...
|
Distribution of a centered standardized sample
Answering to myself : I no longer think that this problem is (directly) solvable, because the transformation I study (i. e. centering and standardizing) is not a bijection : $Z=\alpha{}X$ will have th
|
43,574
|
Differences between poisson.test and E-test when testing Poisson parameters
|
The p-value of a hypothesis test or a corresponding confidence interval depends on the treatment or choice of 2 issues:
1. Treatment of nuisance parameter
To preserve the size at the exact level, the type 1 error needs to be less than or equal to alpha for all possible values of the nuisance parameter.
The null hypothesis that the rates are equal, does not constrain the value itself, so it is a nuisance parameter.
Conditional tests like the exact conditional Poisson test or Fisher's exact test remove the nuisance parameter by conditioning on a summary statistic.
Unconditional exact test need to assert that the size is correct by using the max or sup over all possible values of the nuisance parameter.
Berger-Boos test limits the space of nuisance parameter for the max but adds a factor to make it exact, i.e. preserves the size alpha.
The Poisson E-test is not an exact test in this sense. It uses the "exact" distribution but it uses the estimated value of the nuisance parameter.
2. Location of two-sided rejection region
A two-sided test has rejection region in both lower and upper tail. The requirement that the sixe of the test is at most alpha, is a requirement on the probability to be in one of the tails, but it does not pin down the probability in each tail separately.
"central" or equal tail methods limit the probability of the each tail to be less than or equal to half the size, alpha / 2.
"minlike" uses the likelihood value (based on likelihood ratio test) to find the non-rejection region. The corresponding profile confidence interval will not have equal tails in skewed distributions like Poisson or Binomial.
One point that Michael P. Fay points out and emphasizes is the hypothesis tests and confidence interval are often not consistent with each other.
For example the exact poisson test in R uses "minlike" hypothesis test and exact pvalue, but reports exact "central" or equal-tail confidence intervals.
In one-sided test, the location is fixed and this distinction between "minlike" and "central" becomes irrelevant. Because there is only one tail, an exact test needs to preserve the size for that tail at level alpha.
|
Differences between poisson.test and E-test when testing Poisson parameters
|
The p-value of a hypothesis test or a corresponding confidence interval depends on the treatment or choice of 2 issues:
1. Treatment of nuisance parameter
To preserve the size at the exact level, the
|
Differences between poisson.test and E-test when testing Poisson parameters
The p-value of a hypothesis test or a corresponding confidence interval depends on the treatment or choice of 2 issues:
1. Treatment of nuisance parameter
To preserve the size at the exact level, the type 1 error needs to be less than or equal to alpha for all possible values of the nuisance parameter.
The null hypothesis that the rates are equal, does not constrain the value itself, so it is a nuisance parameter.
Conditional tests like the exact conditional Poisson test or Fisher's exact test remove the nuisance parameter by conditioning on a summary statistic.
Unconditional exact test need to assert that the size is correct by using the max or sup over all possible values of the nuisance parameter.
Berger-Boos test limits the space of nuisance parameter for the max but adds a factor to make it exact, i.e. preserves the size alpha.
The Poisson E-test is not an exact test in this sense. It uses the "exact" distribution but it uses the estimated value of the nuisance parameter.
2. Location of two-sided rejection region
A two-sided test has rejection region in both lower and upper tail. The requirement that the sixe of the test is at most alpha, is a requirement on the probability to be in one of the tails, but it does not pin down the probability in each tail separately.
"central" or equal tail methods limit the probability of the each tail to be less than or equal to half the size, alpha / 2.
"minlike" uses the likelihood value (based on likelihood ratio test) to find the non-rejection region. The corresponding profile confidence interval will not have equal tails in skewed distributions like Poisson or Binomial.
One point that Michael P. Fay points out and emphasizes is the hypothesis tests and confidence interval are often not consistent with each other.
For example the exact poisson test in R uses "minlike" hypothesis test and exact pvalue, but reports exact "central" or equal-tail confidence intervals.
In one-sided test, the location is fixed and this distinction between "minlike" and "central" becomes irrelevant. Because there is only one tail, an exact test needs to preserve the size for that tail at level alpha.
|
Differences between poisson.test and E-test when testing Poisson parameters
The p-value of a hypothesis test or a corresponding confidence interval depends on the treatment or choice of 2 issues:
1. Treatment of nuisance parameter
To preserve the size at the exact level, the
|
43,575
|
Primitive length measurements
|
Assuming the only known thing for a combination i,j is whether it is a 1 (iu+e is bigger) or a 0 (otherwise);
Suppose you put the observations in a matrix (I,J) (top left element is 1,1 bottom left is I,1)
Here is the idea that I have. Unfortunately I cannot prove it mathematically, but it might give you some direction.
If you take the biggest possible square submatrix from the top left and calculate the average, it may be a decent estimator of x/u.
Furthermore the variance will be higher if the 'changeover' from 0 to 1 does not show a nice pattern and/or if you often see that there is no changeover (example 000110111). However, i do not even dare to suggest an estimator for the variance.
|
Primitive length measurements
|
Assuming the only known thing for a combination i,j is whether it is a 1 (iu+e is bigger) or a 0 (otherwise);
Suppose you put the observations in a matrix (I,J) (top left element is 1,1 bottom left is
|
Primitive length measurements
Assuming the only known thing for a combination i,j is whether it is a 1 (iu+e is bigger) or a 0 (otherwise);
Suppose you put the observations in a matrix (I,J) (top left element is 1,1 bottom left is I,1)
Here is the idea that I have. Unfortunately I cannot prove it mathematically, but it might give you some direction.
If you take the biggest possible square submatrix from the top left and calculate the average, it may be a decent estimator of x/u.
Furthermore the variance will be higher if the 'changeover' from 0 to 1 does not show a nice pattern and/or if you often see that there is no changeover (example 000110111). However, i do not even dare to suggest an estimator for the variance.
|
Primitive length measurements
Assuming the only known thing for a combination i,j is whether it is a 1 (iu+e is bigger) or a 0 (otherwise);
Suppose you put the observations in a matrix (I,J) (top left element is 1,1 bottom left is
|
43,576
|
What exactly is the "wid" argument in the ezANOVA function in the R package "ez"?
|
First off, are you familiar with R's help system? Typing ?ezANOVA will bring up the documentation for that function, where you can read that the wid argument is a:
.() object specifying the column in data that contains the variable specifying the case/Ss identifier.
Based on how you've specified your model so far, your design seems to be a within-subjects one, where each subject (is this a plot/plant/area?) is assigned to each of the levels of Genotype and Treatment. Your wid argument would then be the column that identifies the individual plant/plot, eg. wid=.(plant.number).
If none of this seems to match up with your experimental design, then it may be that one or both of your Genotype and Treatment factors are actually between-subjects variables, and you should be including them in the between = .() argument instead.
|
What exactly is the "wid" argument in the ezANOVA function in the R package "ez"?
|
First off, are you familiar with R's help system? Typing ?ezANOVA will bring up the documentation for that function, where you can read that the wid argument is a:
.() object specifying the column in
|
What exactly is the "wid" argument in the ezANOVA function in the R package "ez"?
First off, are you familiar with R's help system? Typing ?ezANOVA will bring up the documentation for that function, where you can read that the wid argument is a:
.() object specifying the column in data that contains the variable specifying the case/Ss identifier.
Based on how you've specified your model so far, your design seems to be a within-subjects one, where each subject (is this a plot/plant/area?) is assigned to each of the levels of Genotype and Treatment. Your wid argument would then be the column that identifies the individual plant/plot, eg. wid=.(plant.number).
If none of this seems to match up with your experimental design, then it may be that one or both of your Genotype and Treatment factors are actually between-subjects variables, and you should be including them in the between = .() argument instead.
|
What exactly is the "wid" argument in the ezANOVA function in the R package "ez"?
First off, are you familiar with R's help system? Typing ?ezANOVA will bring up the documentation for that function, where you can read that the wid argument is a:
.() object specifying the column in
|
43,577
|
Whether to stratify or do a simple random sampling from a set of papers to be compared?
|
(1) If you can stratify on the delivery method, do so.
(2) If you can stratify on the targets, do so; come up with a meaningful stratification strategy that would give you mutually exclusive categories. (You would have to tell more about how the categories overlap for us to provide meaningful advice.)
(3) If you can stratify on both of these variables, stratify on the pair-wise cells.
Whatever strata you produce, consider proportional allocations between strata (unless you have reasons to expect that some of the variables of interest have certain behaviors associated with stratification). That is, the sampling rates within strata should be the same: if you decide you want to have a sample size of 50, then you might want to have the sampling rate of 1/7 in each strata. This would also mean that each strata should have at least 14 units in the population, so that you could sample at least 2 papers, in other to be able to produce variance estimates (you can't do that with just 1 observation in a stratum). Thus you may have to combine the strata that are too small.
The sample size issue is entirely up to you. This is a trade-off between accuracy and cost, and both of these are probably in your head only. If you had just one target variable of interest, and had an idea about the effect size you are trying to capture, there would have been a way to conduct some power analysis and try to figure out the sample size. If you have several response variables and no clue about how they behave in your population of papers, then basically you would want to sample until you get tired of reading these papers.
|
Whether to stratify or do a simple random sampling from a set of papers to be compared?
|
(1) If you can stratify on the delivery method, do so.
(2) If you can stratify on the targets, do so; come up with a meaningful stratification strategy that would give you mutually exclusive categorie
|
Whether to stratify or do a simple random sampling from a set of papers to be compared?
(1) If you can stratify on the delivery method, do so.
(2) If you can stratify on the targets, do so; come up with a meaningful stratification strategy that would give you mutually exclusive categories. (You would have to tell more about how the categories overlap for us to provide meaningful advice.)
(3) If you can stratify on both of these variables, stratify on the pair-wise cells.
Whatever strata you produce, consider proportional allocations between strata (unless you have reasons to expect that some of the variables of interest have certain behaviors associated with stratification). That is, the sampling rates within strata should be the same: if you decide you want to have a sample size of 50, then you might want to have the sampling rate of 1/7 in each strata. This would also mean that each strata should have at least 14 units in the population, so that you could sample at least 2 papers, in other to be able to produce variance estimates (you can't do that with just 1 observation in a stratum). Thus you may have to combine the strata that are too small.
The sample size issue is entirely up to you. This is a trade-off between accuracy and cost, and both of these are probably in your head only. If you had just one target variable of interest, and had an idea about the effect size you are trying to capture, there would have been a way to conduct some power analysis and try to figure out the sample size. If you have several response variables and no clue about how they behave in your population of papers, then basically you would want to sample until you get tired of reading these papers.
|
Whether to stratify or do a simple random sampling from a set of papers to be compared?
(1) If you can stratify on the delivery method, do so.
(2) If you can stratify on the targets, do so; come up with a meaningful stratification strategy that would give you mutually exclusive categorie
|
43,578
|
Does it make sense to "cluster" when you use a regression discontinuity?
|
Whether you take into account clustering or not only affects the standard errors of your estimates. In a situation like yours, I would not focus too much on the standard errors. It is much more important that you can justify the use of the regression discontinuity framework, and you have to be able to show that it allows recovering the parameter(s) you are interested in. Once you are sure about this you can go a step further.
This next step would be the following. If you are concerned about these class effects, you should have a look at multilevel regression models. It should be possible to implement a regression discontinuity strategy within a multilevel model.
|
Does it make sense to "cluster" when you use a regression discontinuity?
|
Whether you take into account clustering or not only affects the standard errors of your estimates. In a situation like yours, I would not focus too much on the standard errors. It is much more import
|
Does it make sense to "cluster" when you use a regression discontinuity?
Whether you take into account clustering or not only affects the standard errors of your estimates. In a situation like yours, I would not focus too much on the standard errors. It is much more important that you can justify the use of the regression discontinuity framework, and you have to be able to show that it allows recovering the parameter(s) you are interested in. Once you are sure about this you can go a step further.
This next step would be the following. If you are concerned about these class effects, you should have a look at multilevel regression models. It should be possible to implement a regression discontinuity strategy within a multilevel model.
|
Does it make sense to "cluster" when you use a regression discontinuity?
Whether you take into account clustering or not only affects the standard errors of your estimates. In a situation like yours, I would not focus too much on the standard errors. It is much more import
|
43,579
|
Does it make sense to "cluster" when you use a regression discontinuity?
|
Is it a regular linear regression model or not?
In Quantitative finance we have the same problem. we use a GARCH model to estimate volatility, however volatility does not seem to be normally distributed and seems to cluster. for this we use a switching garch model. this "switching" model differentiates and switches between different clustering regions.
you could look into this switching it might be usefull...
|
Does it make sense to "cluster" when you use a regression discontinuity?
|
Is it a regular linear regression model or not?
In Quantitative finance we have the same problem. we use a GARCH model to estimate volatility, however volatility does not seem to be normally distribut
|
Does it make sense to "cluster" when you use a regression discontinuity?
Is it a regular linear regression model or not?
In Quantitative finance we have the same problem. we use a GARCH model to estimate volatility, however volatility does not seem to be normally distributed and seems to cluster. for this we use a switching garch model. this "switching" model differentiates and switches between different clustering regions.
you could look into this switching it might be usefull...
|
Does it make sense to "cluster" when you use a regression discontinuity?
Is it a regular linear regression model or not?
In Quantitative finance we have the same problem. we use a GARCH model to estimate volatility, however volatility does not seem to be normally distribut
|
43,580
|
Testing for trends in partial proportional odds models
|
Unfortunately, I don't know the partial proportional odds model. I do know that Agresti--discussing other situations (eg, PO)--has suggested that people go ahead & make up values for your categories and run them as though they were continuous. I find this somewhat discomfiting, but his argument is that unless you're way off, the induced bias will be small. (N.b., there will be bias induced, as a function of the nature and magnitude of the misrepresentation, but it is likely to be small.) Hope this helps.
|
Testing for trends in partial proportional odds models
|
Unfortunately, I don't know the partial proportional odds model. I do know that Agresti--discussing other situations (eg, PO)--has suggested that people go ahead & make up values for your categories a
|
Testing for trends in partial proportional odds models
Unfortunately, I don't know the partial proportional odds model. I do know that Agresti--discussing other situations (eg, PO)--has suggested that people go ahead & make up values for your categories and run them as though they were continuous. I find this somewhat discomfiting, but his argument is that unless you're way off, the induced bias will be small. (N.b., there will be bias induced, as a function of the nature and magnitude of the misrepresentation, but it is likely to be small.) Hope this helps.
|
Testing for trends in partial proportional odds models
Unfortunately, I don't know the partial proportional odds model. I do know that Agresti--discussing other situations (eg, PO)--has suggested that people go ahead & make up values for your categories a
|
43,581
|
Testing for trends in partial proportional odds models
|
I think this is a reasonable way of assessing trend. The key boils down to the interpretation of the coefficient or effect that is estimated by the model. What you estimate is, in effect, an odds ratio for endorsing a unit higher $Y$ response comparing groups differing by 1 unit in $V$.
The proportional odds model usually requires the analyst to inspect the proportional odds assumption by either a significance test or by graphical inspection. I favor the latter. To inspect proportional odds graphically, one can directly fit logistic models for each of the cumulative responses and ensure the 95% CIs for the OR overlap with the "grand" OR estimated in the proportional odds model. If the overlap is consistent, we can be assured that any possible finding in the proportional odds model is not necessarily driven by one particular level of cumulative Y responses.
An alternative to this of course is just fitting the linear regression model with ordinal $Y$ response and ordinal $V$ response. This can be visually inspected with a scatterplot to assess the same assumptions, and the trend line can be compared to a more flexible cubic smoothing spline. To ensure consistent inference due to a possible mean-variance relationship, inference on the trend-line can be made robust using sandwich based standard errors. The similarity between proportional odds models and linear regression with an ordinal outcome has been discussed in The Importance of Normality Assumptions in Large Public Health Datasets by Lumley, Dier, Emerson, and Chen.
|
Testing for trends in partial proportional odds models
|
I think this is a reasonable way of assessing trend. The key boils down to the interpretation of the coefficient or effect that is estimated by the model. What you estimate is, in effect, an odds rati
|
Testing for trends in partial proportional odds models
I think this is a reasonable way of assessing trend. The key boils down to the interpretation of the coefficient or effect that is estimated by the model. What you estimate is, in effect, an odds ratio for endorsing a unit higher $Y$ response comparing groups differing by 1 unit in $V$.
The proportional odds model usually requires the analyst to inspect the proportional odds assumption by either a significance test or by graphical inspection. I favor the latter. To inspect proportional odds graphically, one can directly fit logistic models for each of the cumulative responses and ensure the 95% CIs for the OR overlap with the "grand" OR estimated in the proportional odds model. If the overlap is consistent, we can be assured that any possible finding in the proportional odds model is not necessarily driven by one particular level of cumulative Y responses.
An alternative to this of course is just fitting the linear regression model with ordinal $Y$ response and ordinal $V$ response. This can be visually inspected with a scatterplot to assess the same assumptions, and the trend line can be compared to a more flexible cubic smoothing spline. To ensure consistent inference due to a possible mean-variance relationship, inference on the trend-line can be made robust using sandwich based standard errors. The similarity between proportional odds models and linear regression with an ordinal outcome has been discussed in The Importance of Normality Assumptions in Large Public Health Datasets by Lumley, Dier, Emerson, and Chen.
|
Testing for trends in partial proportional odds models
I think this is a reasonable way of assessing trend. The key boils down to the interpretation of the coefficient or effect that is estimated by the model. What you estimate is, in effect, an odds rati
|
43,582
|
How to handle changing definitions of regions over time in data?
|
I may be wrong, but why don't you forecast each store by itself and then aggregate them to the current "major break".
|
How to handle changing definitions of regions over time in data?
|
I may be wrong, but why don't you forecast each store by itself and then aggregate them to the current "major break".
|
How to handle changing definitions of regions over time in data?
I may be wrong, but why don't you forecast each store by itself and then aggregate them to the current "major break".
|
How to handle changing definitions of regions over time in data?
I may be wrong, but why don't you forecast each store by itself and then aggregate them to the current "major break".
|
43,583
|
Is there a way to specify a lme model with more than one within-subjects factor?
|
I found an answer to my question on this thread: Repeated measures ANOVA with lme in R for two within-subject factors (somehow this thread was already one of my favorites, I must have forgotten about it). The specification is a little unhandy.
m6 <- lme(mean ~ condition*group*problem*topic,
random = list(code=pdBlocked(list(~1, pdIdent(~problem-1), pdIdent(~topic-1)))), data = d)
anova(m6)
However, the denominator dfs are still wrong, as noted in the thread and apparent in comparisons between the ANOVA and lme dfs.
data.frame(effect = rownames(anova(m6)), denDf= anova(m6)$denDF)
m4$ANOVA[,c("Effect", "DFd")]
As long as there are no other ideas, I think I will need to do the analysis in lme4, for which I wil need to post another question.
|
Is there a way to specify a lme model with more than one within-subjects factor?
|
I found an answer to my question on this thread: Repeated measures ANOVA with lme in R for two within-subject factors (somehow this thread was already one of my favorites, I must have forgotten about
|
Is there a way to specify a lme model with more than one within-subjects factor?
I found an answer to my question on this thread: Repeated measures ANOVA with lme in R for two within-subject factors (somehow this thread was already one of my favorites, I must have forgotten about it). The specification is a little unhandy.
m6 <- lme(mean ~ condition*group*problem*topic,
random = list(code=pdBlocked(list(~1, pdIdent(~problem-1), pdIdent(~topic-1)))), data = d)
anova(m6)
However, the denominator dfs are still wrong, as noted in the thread and apparent in comparisons between the ANOVA and lme dfs.
data.frame(effect = rownames(anova(m6)), denDf= anova(m6)$denDF)
m4$ANOVA[,c("Effect", "DFd")]
As long as there are no other ideas, I think I will need to do the analysis in lme4, for which I wil need to post another question.
|
Is there a way to specify a lme model with more than one within-subjects factor?
I found an answer to my question on this thread: Repeated measures ANOVA with lme in R for two within-subject factors (somehow this thread was already one of my favorites, I must have forgotten about
|
43,584
|
Find the minimum of an expensive-to-sample noisy paraboloid
|
One approach is to reparametrize your model, revealing a completely boring OLS regression. You can then find the covariance of the parameters as a function of $z$, convert it back to get the covariance of $x_{min}$, and optimize some function of it.
Reparameterizing
If $y_i = (x_i^T-x_{min})^Ta(x_i^T-x_{min}) + c + \epsilon_i$, then $y_i = z_i \beta $ for some $z=g(x)$ and $\beta = h(a, x_{min}, c)$.
Define $b \equiv -2ax_{min}$. The conversions are:
$$z = [x_1^2, 2x_1x_2, x_2^2, x_1, x_2, 1]$$
$$\beta = [a_{11}, a_{12}, a_{22}, b_1, b_2, c]$$.
$$x_{min, 1} = \frac{ a_{22} b_1 - a_{21}b_2}{a_{22} a_{11} + a_{21}^2}$$
$$x_{min, 2} = \frac{-a_{21} b_1 + a_{11}b_2}{a_{22} a_{11} + a_{21}^2}$$
Finding the variance and covariance
For a typical OLS regression, the estimate of $\beta$ is $\hat \beta =
(Z^TZ)^{-1}Z^TY$, and the covariance of $\hat \beta$ is $\sigma^2(Z^TZ)^{-1}$. An unbiased estimator for error variance $\sigma^2$ is $\frac{1}{n-6}||Y - Z(Z^TZ)^{-1}Z^TY||_2^2$. This answers one of OP's sub-questions: how would a statistician integrate their 500 samples to estimate $\sigma^2$?
We still need to quantify the uncertainty in the original parameters. Using the delta rule, the covariance of $x_{min}$ is approximately proportional to $\phi^T(Z^TZ)^{-1}\phi$, where $\phi$ is the Jacobian of $x_{min}$ w.r.t. $\beta$ evaluated at the true $\beta$. This Jacobian's components are:
yucky but calculable, for $a$
elements of $a^{-1}$, for $b$
zeroes, for $c$.
This allows you to quantify uncertainty in $x_{min}$ for a given dataset or to choose good $x_i$'s for a given set of parameters.
When the parameters are completely unknown
One reasonable approach in this situation is to minimize the maximum penalty you could incur. If the penalty you want to minimize is the norm of the covariance of $x_{min}$, i.e. $||\phi^T(Z^TZ)^{-1}\phi||_F$, then there is no minimum. It decreases as long as $Z^TZ$ gets bigger. At this point, I wonder if there are other considerations to take into account --
do you really want $z_i$'s at each corner of the known universe? What if $f$ is not ... quite ... a parabola?
|
Find the minimum of an expensive-to-sample noisy paraboloid
|
One approach is to reparametrize your model, revealing a completely boring OLS regression. You can then find the covariance of the parameters as a function of $z$, convert it back to get the covarianc
|
Find the minimum of an expensive-to-sample noisy paraboloid
One approach is to reparametrize your model, revealing a completely boring OLS regression. You can then find the covariance of the parameters as a function of $z$, convert it back to get the covariance of $x_{min}$, and optimize some function of it.
Reparameterizing
If $y_i = (x_i^T-x_{min})^Ta(x_i^T-x_{min}) + c + \epsilon_i$, then $y_i = z_i \beta $ for some $z=g(x)$ and $\beta = h(a, x_{min}, c)$.
Define $b \equiv -2ax_{min}$. The conversions are:
$$z = [x_1^2, 2x_1x_2, x_2^2, x_1, x_2, 1]$$
$$\beta = [a_{11}, a_{12}, a_{22}, b_1, b_2, c]$$.
$$x_{min, 1} = \frac{ a_{22} b_1 - a_{21}b_2}{a_{22} a_{11} + a_{21}^2}$$
$$x_{min, 2} = \frac{-a_{21} b_1 + a_{11}b_2}{a_{22} a_{11} + a_{21}^2}$$
Finding the variance and covariance
For a typical OLS regression, the estimate of $\beta$ is $\hat \beta =
(Z^TZ)^{-1}Z^TY$, and the covariance of $\hat \beta$ is $\sigma^2(Z^TZ)^{-1}$. An unbiased estimator for error variance $\sigma^2$ is $\frac{1}{n-6}||Y - Z(Z^TZ)^{-1}Z^TY||_2^2$. This answers one of OP's sub-questions: how would a statistician integrate their 500 samples to estimate $\sigma^2$?
We still need to quantify the uncertainty in the original parameters. Using the delta rule, the covariance of $x_{min}$ is approximately proportional to $\phi^T(Z^TZ)^{-1}\phi$, where $\phi$ is the Jacobian of $x_{min}$ w.r.t. $\beta$ evaluated at the true $\beta$. This Jacobian's components are:
yucky but calculable, for $a$
elements of $a^{-1}$, for $b$
zeroes, for $c$.
This allows you to quantify uncertainty in $x_{min}$ for a given dataset or to choose good $x_i$'s for a given set of parameters.
When the parameters are completely unknown
One reasonable approach in this situation is to minimize the maximum penalty you could incur. If the penalty you want to minimize is the norm of the covariance of $x_{min}$, i.e. $||\phi^T(Z^TZ)^{-1}\phi||_F$, then there is no minimum. It decreases as long as $Z^TZ$ gets bigger. At this point, I wonder if there are other considerations to take into account --
do you really want $z_i$'s at each corner of the known universe? What if $f$ is not ... quite ... a parabola?
|
Find the minimum of an expensive-to-sample noisy paraboloid
One approach is to reparametrize your model, revealing a completely boring OLS regression. You can then find the covariance of the parameters as a function of $z$, convert it back to get the covarianc
|
43,585
|
Are two empirically estimated Markov chains statistically different?
|
Since the two chains are assumed to be comparable, they should have the same state space. That leaves the transition matrices, comparing which can be done by a divergence-based hypothesis test, as explained on pg. 139 of Statistical inference based on divergence measures By Leandro Pardo Llorente
|
Are two empirically estimated Markov chains statistically different?
|
Since the two chains are assumed to be comparable, they should have the same state space. That leaves the transition matrices, comparing which can be done by a divergence-based hypothesis test, as exp
|
Are two empirically estimated Markov chains statistically different?
Since the two chains are assumed to be comparable, they should have the same state space. That leaves the transition matrices, comparing which can be done by a divergence-based hypothesis test, as explained on pg. 139 of Statistical inference based on divergence measures By Leandro Pardo Llorente
|
Are two empirically estimated Markov chains statistically different?
Since the two chains are assumed to be comparable, they should have the same state space. That leaves the transition matrices, comparing which can be done by a divergence-based hypothesis test, as exp
|
43,586
|
Are two empirically estimated Markov chains statistically different?
|
Here's half-baked idea. Please tell me why it's wrong. :)
Choose randomly a state sequence from dataset A, and leave it out when constructing the chain for that dataset.
Construct the chains for datasets A and B.
Run the sequence through chains A and B, and record the predicted final state.
Repeat 1-3 lots of times.
Report the percentage of times that the chains predict the same final state.
|
Are two empirically estimated Markov chains statistically different?
|
Here's half-baked idea. Please tell me why it's wrong. :)
Choose randomly a state sequence from dataset A, and leave it out when constructing the chain for that dataset.
Construct the chains for data
|
Are two empirically estimated Markov chains statistically different?
Here's half-baked idea. Please tell me why it's wrong. :)
Choose randomly a state sequence from dataset A, and leave it out when constructing the chain for that dataset.
Construct the chains for datasets A and B.
Run the sequence through chains A and B, and record the predicted final state.
Repeat 1-3 lots of times.
Report the percentage of times that the chains predict the same final state.
|
Are two empirically estimated Markov chains statistically different?
Here's half-baked idea. Please tell me why it's wrong. :)
Choose randomly a state sequence from dataset A, and leave it out when constructing the chain for that dataset.
Construct the chains for data
|
43,587
|
How to calculate standard errors in OLS without inverting the X'X matrix?
|
I had the same problem as I wanted to use the most efficient solvers available in my econometrics package. I developed an algorithm to solve for both the $\beta$ and the inverse of the linear predictor (normal matrix) for linear least squares (it also applies to WLS, Ridge regression, etc.)
So here is the pseudo-code,
Given $X$ and $y$,
1) use an efficient solver to estimate $\beta$.
2) Store $X^{\top}X + \Gamma \Gamma^{\top}$
3) Create a new $Ax=b$ problem with:
x = vector of values of values that fully characterize $\left(X^{\top}X + \Gamma \Gamma^{\top}\right)^{-1}$. It is symmetric so there are $\left(\frac{k (k + 1)}{2}\right)$
b = vec($\beta$, vec($I_{k}$))
A = Linear predictor that establishes the following restrictions:
$A X^{\top} y = \beta$
$\left(X^{\top}X + \Gamma \Gamma^{\top}\right)^{-1}\left(X^{\top}X + \Gamma \Gamma^{\top}\right) = I$
Lastly, solve the new $Ax=b$ for $x$ using an efficient solver and recreate $A$ with it.
This way, you don't have to calculate the Cholesky decomposition or anything. A good solver could be lsmr which can give more precision and a more efficient implementation.
|
How to calculate standard errors in OLS without inverting the X'X matrix?
|
I had the same problem as I wanted to use the most efficient solvers available in my econometrics package. I developed an algorithm to solve for both the $\beta$ and the inverse of the linear predicto
|
How to calculate standard errors in OLS without inverting the X'X matrix?
I had the same problem as I wanted to use the most efficient solvers available in my econometrics package. I developed an algorithm to solve for both the $\beta$ and the inverse of the linear predictor (normal matrix) for linear least squares (it also applies to WLS, Ridge regression, etc.)
So here is the pseudo-code,
Given $X$ and $y$,
1) use an efficient solver to estimate $\beta$.
2) Store $X^{\top}X + \Gamma \Gamma^{\top}$
3) Create a new $Ax=b$ problem with:
x = vector of values of values that fully characterize $\left(X^{\top}X + \Gamma \Gamma^{\top}\right)^{-1}$. It is symmetric so there are $\left(\frac{k (k + 1)}{2}\right)$
b = vec($\beta$, vec($I_{k}$))
A = Linear predictor that establishes the following restrictions:
$A X^{\top} y = \beta$
$\left(X^{\top}X + \Gamma \Gamma^{\top}\right)^{-1}\left(X^{\top}X + \Gamma \Gamma^{\top}\right) = I$
Lastly, solve the new $Ax=b$ for $x$ using an efficient solver and recreate $A$ with it.
This way, you don't have to calculate the Cholesky decomposition or anything. A good solver could be lsmr which can give more precision and a more efficient implementation.
|
How to calculate standard errors in OLS without inverting the X'X matrix?
I had the same problem as I wanted to use the most efficient solvers available in my econometrics package. I developed an algorithm to solve for both the $\beta$ and the inverse of the linear predicto
|
43,588
|
Is there a way to compare linear regression slopes by permutation tests?
|
In principle, you can use a permutation test on any function on data of two groups. To compare regression slopes, you simply pick to species, shuffle the data points between the groups randomly, but instead of comparing the mean value of each permuted group, compare the regression slope. You may have to center your data before computing the regressor (which may be linear or custom built, as long as it can be described by a single parameter after centering the data). I'm not sure how to deal with multiple comparisons in permutation test -- for a few categories, Bonferroni correction will do the trick, but I guess with several dozen species that will kill any effect... Ideas on this?
|
Is there a way to compare linear regression slopes by permutation tests?
|
In principle, you can use a permutation test on any function on data of two groups. To compare regression slopes, you simply pick to species, shuffle the data points between the groups randomly, but i
|
Is there a way to compare linear regression slopes by permutation tests?
In principle, you can use a permutation test on any function on data of two groups. To compare regression slopes, you simply pick to species, shuffle the data points between the groups randomly, but instead of comparing the mean value of each permuted group, compare the regression slope. You may have to center your data before computing the regressor (which may be linear or custom built, as long as it can be described by a single parameter after centering the data). I'm not sure how to deal with multiple comparisons in permutation test -- for a few categories, Bonferroni correction will do the trick, but I guess with several dozen species that will kill any effect... Ideas on this?
|
Is there a way to compare linear regression slopes by permutation tests?
In principle, you can use a permutation test on any function on data of two groups. To compare regression slopes, you simply pick to species, shuffle the data points between the groups randomly, but i
|
43,589
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I perform?
|
The answer depends on the type of inference you wish to make. Do you wish to make statements about each ROI or do you want to quantify the distribution of effect over ROIs?
If you wish to infer on each ROI, multiplicity correction is the way to go. The fact that you do not need to define the exact dependence between the test statistics at each ROI isan generally an advantage. Unless, of course, you still lack power. Assuming you are able to quantify the exact dependence between ROIs, you can look for a rejection region that controls the FDR at the desired level using simulation (deriving it analytically might be rather hard). If you are pleased with your findings using "vanilla" Benjamini-Hochberg, I would use it as is.
On the other hand, if you wish to infer over all ROIs, there is a point in assuming the distribution of effects over ROIs. In which case you could indeed compute the mean activation over ROIs and the conditional distribution of the effect given the observed. Personally, I find this sort of analysis hard to interpret. Especially since the ROIs are defined only within your study (as such, they are random entities). I do suspect that en empirical Bayesian (such as Gelman) might disagree with me on this point.
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I p
|
The answer depends on the type of inference you wish to make. Do you wish to make statements about each ROI or do you want to quantify the distribution of effect over ROIs?
If you wish to infer on eac
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I perform?
The answer depends on the type of inference you wish to make. Do you wish to make statements about each ROI or do you want to quantify the distribution of effect over ROIs?
If you wish to infer on each ROI, multiplicity correction is the way to go. The fact that you do not need to define the exact dependence between the test statistics at each ROI isan generally an advantage. Unless, of course, you still lack power. Assuming you are able to quantify the exact dependence between ROIs, you can look for a rejection region that controls the FDR at the desired level using simulation (deriving it analytically might be rather hard). If you are pleased with your findings using "vanilla" Benjamini-Hochberg, I would use it as is.
On the other hand, if you wish to infer over all ROIs, there is a point in assuming the distribution of effects over ROIs. In which case you could indeed compute the mean activation over ROIs and the conditional distribution of the effect given the observed. Personally, I find this sort of analysis hard to interpret. Especially since the ROIs are defined only within your study (as such, they are random entities). I do suspect that en empirical Bayesian (such as Gelman) might disagree with me on this point.
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I p
The answer depends on the type of inference you wish to make. Do you wish to make statements about each ROI or do you want to quantify the distribution of effect over ROIs?
If you wish to infer on eac
|
43,590
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I perform?
|
In case your approach is not look at the volume of a particular ROI but to "screen through" the whole brain to look for differences associated with cannabis use, maybe running voxel-based morphometry (http://dbm.neuro.uni-jena.de/vbm/) would be a more sensitive approach?
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I p
|
In case your approach is not look at the volume of a particular ROI but to "screen through" the whole brain to look for differences associated with cannabis use, maybe running voxel-based morphometry
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I perform?
In case your approach is not look at the volume of a particular ROI but to "screen through" the whole brain to look for differences associated with cannabis use, maybe running voxel-based morphometry (http://dbm.neuro.uni-jena.de/vbm/) would be a more sensitive approach?
|
Large number of correlations with MRI region of interest (ROI) variables: What adjustment should I p
In case your approach is not look at the volume of a particular ROI but to "screen through" the whole brain to look for differences associated with cannabis use, maybe running voxel-based morphometry
|
43,591
|
What are the top statistic conferences to follow for applications in machine learning?
|
The Joint Statistical Meetings are large annual statistical conferences. To quote their site,
"JSM (the Joint Statistical Meetings) is the largest gathering of
statisticians held in North America. It is held jointly with the
American Statistical Association, the International Biometric Society
(ENAR and WNAR), the Institute of Mathematical Statistics, the
Statistical Society of Canada, and the International Chinese
Statistical Association, and the International Indian Statistical
Association"
If you search "machine learning" in their 2011 program, you get 68 hits.
Two other annual conferences are the meeting of the Eastern North American Region (ENAR) of the International Biometric Society and the meeting of its western counterpart WNAR. Talks, posters, and sessions on machine learning have become a larger presence at these conferences over the last decade (you can find past years' programs in the links above -- the links to the actual programs weren't working for me this morning, however).
|
What are the top statistic conferences to follow for applications in machine learning?
|
The Joint Statistical Meetings are large annual statistical conferences. To quote their site,
"JSM (the Joint Statistical Meetings) is the largest gathering of
statisticians held in North America
|
What are the top statistic conferences to follow for applications in machine learning?
The Joint Statistical Meetings are large annual statistical conferences. To quote their site,
"JSM (the Joint Statistical Meetings) is the largest gathering of
statisticians held in North America. It is held jointly with the
American Statistical Association, the International Biometric Society
(ENAR and WNAR), the Institute of Mathematical Statistics, the
Statistical Society of Canada, and the International Chinese
Statistical Association, and the International Indian Statistical
Association"
If you search "machine learning" in their 2011 program, you get 68 hits.
Two other annual conferences are the meeting of the Eastern North American Region (ENAR) of the International Biometric Society and the meeting of its western counterpart WNAR. Talks, posters, and sessions on machine learning have become a larger presence at these conferences over the last decade (you can find past years' programs in the links above -- the links to the actual programs weren't working for me this morning, however).
|
What are the top statistic conferences to follow for applications in machine learning?
The Joint Statistical Meetings are large annual statistical conferences. To quote their site,
"JSM (the Joint Statistical Meetings) is the largest gathering of
statisticians held in North America
|
43,592
|
Comparison of areas under curves
|
While my comment that ideally more information should be given holds, if this really is all you have to go on you could at least say something by performing a permutation test. In other words: calculate AUC1 - AUC2 for all random re-labelings of gender and see where the value you actually observed falls within that distribution.
|
Comparison of areas under curves
|
While my comment that ideally more information should be given holds, if this really is all you have to go on you could at least say something by performing a permutation test. In other words: calcula
|
Comparison of areas under curves
While my comment that ideally more information should be given holds, if this really is all you have to go on you could at least say something by performing a permutation test. In other words: calculate AUC1 - AUC2 for all random re-labelings of gender and see where the value you actually observed falls within that distribution.
|
Comparison of areas under curves
While my comment that ideally more information should be given holds, if this really is all you have to go on you could at least say something by performing a permutation test. In other words: calcula
|
43,593
|
Two-way unsupervised learning
|
You might want to have a look at these papers:
F. Bach, M. I. Jordan. A probabilistic interpretation of canonical correlation analysis. Technical Report 688, Department of Statistics, University of California, Berkeley, 2005
and
Cédric Archambeau, Nicolas Delannay, and Michel Verleysen. 2006. Robust probabilistic projections. In Proceedings of the 23rd international conference on Machine learning (ICML '06).
They both give graphical model interpretations of CCA, form it as (slightly different) probabilistic models, and show how these can be solved using the EM algorithm.
Whilst it might not exactly match your requirements, it seems that your problem could be formulated as a graphical model in this way. Depending how the resulting model looks, you might be able to use off-the-shelf methods to solve it - see e.g. this list of software packages
|
Two-way unsupervised learning
|
You might want to have a look at these papers:
F. Bach, M. I. Jordan. A probabilistic interpretation of canonical correlation analysis. Technical Report 688, Department of Statistics, University of Ca
|
Two-way unsupervised learning
You might want to have a look at these papers:
F. Bach, M. I. Jordan. A probabilistic interpretation of canonical correlation analysis. Technical Report 688, Department of Statistics, University of California, Berkeley, 2005
and
Cédric Archambeau, Nicolas Delannay, and Michel Verleysen. 2006. Robust probabilistic projections. In Proceedings of the 23rd international conference on Machine learning (ICML '06).
They both give graphical model interpretations of CCA, form it as (slightly different) probabilistic models, and show how these can be solved using the EM algorithm.
Whilst it might not exactly match your requirements, it seems that your problem could be formulated as a graphical model in this way. Depending how the resulting model looks, you might be able to use off-the-shelf methods to solve it - see e.g. this list of software packages
|
Two-way unsupervised learning
You might want to have a look at these papers:
F. Bach, M. I. Jordan. A probabilistic interpretation of canonical correlation analysis. Technical Report 688, Department of Statistics, University of Ca
|
43,594
|
How do I adjust standard errors in a research study in which the control group is constructed via matching with replacement?
|
Frankly, I don't think there is any justifiable way to compute the standard errors. The bootstrap appears to be a commonly used method, but Abadie and Imbens (2008 Econometrica) paper demonstrated the problems the bootstrap runs into. For a method as complicated as PS matching, I am not entirely sure 100 is a sufficiently large sample size to give you the asymptotically normal distribution. – StasK
If balance is good, and covariate matching is used as well as propensity score matching, the sample is plenty large enough for non-parametric estimators such as the Wilcoxon's sign-rank test. With the non-parametric estimator, the confidence interval coverage will be correct. An additional advantage of this approach is that sensitivity to the random assignment assumption can be tested with Rosenbaum bounds. See Paul Rosenbaum's Observational Studies or Design of Observational Studies, the latter being an easier introduction. – Jason Morgan
|
How do I adjust standard errors in a research study in which the control group is constructed via ma
|
Frankly, I don't think there is any justifiable way to compute the standard errors. The bootstrap appears to be a commonly used method, but Abadie and Imbens (2008 Econometrica) paper demonstrated the
|
How do I adjust standard errors in a research study in which the control group is constructed via matching with replacement?
Frankly, I don't think there is any justifiable way to compute the standard errors. The bootstrap appears to be a commonly used method, but Abadie and Imbens (2008 Econometrica) paper demonstrated the problems the bootstrap runs into. For a method as complicated as PS matching, I am not entirely sure 100 is a sufficiently large sample size to give you the asymptotically normal distribution. – StasK
If balance is good, and covariate matching is used as well as propensity score matching, the sample is plenty large enough for non-parametric estimators such as the Wilcoxon's sign-rank test. With the non-parametric estimator, the confidence interval coverage will be correct. An additional advantage of this approach is that sensitivity to the random assignment assumption can be tested with Rosenbaum bounds. See Paul Rosenbaum's Observational Studies or Design of Observational Studies, the latter being an easier introduction. – Jason Morgan
|
How do I adjust standard errors in a research study in which the control group is constructed via ma
Frankly, I don't think there is any justifiable way to compute the standard errors. The bootstrap appears to be a commonly used method, but Abadie and Imbens (2008 Econometrica) paper demonstrated the
|
43,595
|
How to get the correlation between two large (sparse) matrices?
|
You can simply take random samples (i.e. submatrices) and estimate the Mantel test statistic. With enough samples, this should converge on the same conclusion. In this way, you can avoid having to cook up a method for accessing all of the data.
However, as these are sparse matrices, it's better to go after a method for accessing the data via coordinate object lists (COO representation), i.e. (row, column, value), and implement a simple calculation for tabulating the test statistic across the two matrices. You can merge the two matrices' COO versions or perform more complex tabulations using the data.table package.
Ultimately, it depends on how many values exist in your matrices (i.e. how dense they are). Attacking them in sparse matrix formats may be best if they're very sparse. Using a subsampling method may be better if they're not super sparse.
|
How to get the correlation between two large (sparse) matrices?
|
You can simply take random samples (i.e. submatrices) and estimate the Mantel test statistic. With enough samples, this should converge on the same conclusion. In this way, you can avoid having to c
|
How to get the correlation between two large (sparse) matrices?
You can simply take random samples (i.e. submatrices) and estimate the Mantel test statistic. With enough samples, this should converge on the same conclusion. In this way, you can avoid having to cook up a method for accessing all of the data.
However, as these are sparse matrices, it's better to go after a method for accessing the data via coordinate object lists (COO representation), i.e. (row, column, value), and implement a simple calculation for tabulating the test statistic across the two matrices. You can merge the two matrices' COO versions or perform more complex tabulations using the data.table package.
Ultimately, it depends on how many values exist in your matrices (i.e. how dense they are). Attacking them in sparse matrix formats may be best if they're very sparse. Using a subsampling method may be better if they're not super sparse.
|
How to get the correlation between two large (sparse) matrices?
You can simply take random samples (i.e. submatrices) and estimate the Mantel test statistic. With enough samples, this should converge on the same conclusion. In this way, you can avoid having to c
|
43,596
|
Selecting regression model for a non-negative integer response
|
Your model is fully saturated, because you have indicators for every possible combination of categories. As such you have correctly specified the conditional expectation.
Any MLE estimate based on a distribution in the linear exponential family is consistent when the conditional expectation is correctly specified. Therefore you can use Poisson or a number of other distributions.
As whuber implies though, this problem reduces to estimating means and testing for their differences, which could conveniently be done in a regression framework.
|
Selecting regression model for a non-negative integer response
|
Your model is fully saturated, because you have indicators for every possible combination of categories. As such you have correctly specified the conditional expectation.
Any MLE estimate based on a d
|
Selecting regression model for a non-negative integer response
Your model is fully saturated, because you have indicators for every possible combination of categories. As such you have correctly specified the conditional expectation.
Any MLE estimate based on a distribution in the linear exponential family is consistent when the conditional expectation is correctly specified. Therefore you can use Poisson or a number of other distributions.
As whuber implies though, this problem reduces to estimating means and testing for their differences, which could conveniently be done in a regression framework.
|
Selecting regression model for a non-negative integer response
Your model is fully saturated, because you have indicators for every possible combination of categories. As such you have correctly specified the conditional expectation.
Any MLE estimate based on a d
|
43,597
|
What does inverse-chi-square in Fisher method (classifying) exactly do?
|
This document extensively answers your question :
Why Chi?, Motivations for the Use of Fisher's Inverse Chi-Square Procedure in Spam Classification, by Gary Robinson
|
What does inverse-chi-square in Fisher method (classifying) exactly do?
|
This document extensively answers your question :
Why Chi?, Motivations for the Use of Fisher's Inverse Chi-Square Procedure in Spam Classification, by Gary Robinson
|
What does inverse-chi-square in Fisher method (classifying) exactly do?
This document extensively answers your question :
Why Chi?, Motivations for the Use of Fisher's Inverse Chi-Square Procedure in Spam Classification, by Gary Robinson
|
What does inverse-chi-square in Fisher method (classifying) exactly do?
This document extensively answers your question :
Why Chi?, Motivations for the Use of Fisher's Inverse Chi-Square Procedure in Spam Classification, by Gary Robinson
|
43,598
|
Distribution family for a ratio dependent variable in a generalized estimating equation
|
maximum entropy is a good way to go here. With maximum entropy, you specify the "structure" that your model is to depend on, and it does the rest. It has a very similar form to a generalised estimating equation. So we have an unknown (or "random") variable $x$ that is the object of inference (may be a vector). It can take on $n$ values $x_1,x_2,\dots,x_n$. We have $m$ "model functions" $g_{k}(x)$ $(k=1,\dots,m)$ and $G_{k}$ "constraints" and the two are related by:
$$\sum_{i=1}^{n}p_i g_{k}(x_i)=G_{k}$$
Where $p_i=Pr(x=x_i)$ is the "unknown" (more appropriately "unassigned") probability distribution. By choosing the distribution with maximum entropy $-\sum_i p_i log(p_i)$ you get:
$$Pr(x=x_i||G_{1},\dots,G_{m})=p_i=exp\left(-\lambda_0-\sum_{k=1}^{m}\lambda_{k}g_{k}(x_i)\right)$$
Where $\lambda_{k}$ are chosen so that the above constraints are satisfied, and that the $p_i$ sum to $1$. This requires discrete sample space, for continuous case, it is the same form with 2 exceptions:
The summation is replaced by an integral with respect to $dx$
The probability is multiplied by the invariant measure $m(x)$, which in your case is the probability transform of the improper $Dir(0,\dots,0)$ into "odds" form.
So you have:
$$p(x|G_{1},\dots,G_{m})=m(x)exp\left(-\lambda_0-\sum_{k=1}^{m}\lambda_{k}g_{k}(x)\right)dx$$
Now what you will find is that in solving for the lagrange multipliers $\lambda_{k}$ you will get a set of equations which look identical to the GEE equations. Thus the MaxEnt algorithm basically tells you "which probability model" is the most likely to be consistent with your GEE equations. You can then use this distribution to make predictions and give an indication of their accuracy.
Note if the constraints $G_{k}$ are not known, this is solved by multiplying the above $p(x||G_{1},\dots,G_{m})$ by a prior density for $G_{k}$ and then integrating out $G_{k}$ from the probability - this allows for the structure induced by $G_{k}$ to be incorporated into the model, as well as the uncertainty about the true value of $G_{k}$.
|
Distribution family for a ratio dependent variable in a generalized estimating equation
|
maximum entropy is a good way to go here. With maximum entropy, you specify the "structure" that your model is to depend on, and it does the rest. It has a very similar form to a generalised estimat
|
Distribution family for a ratio dependent variable in a generalized estimating equation
maximum entropy is a good way to go here. With maximum entropy, you specify the "structure" that your model is to depend on, and it does the rest. It has a very similar form to a generalised estimating equation. So we have an unknown (or "random") variable $x$ that is the object of inference (may be a vector). It can take on $n$ values $x_1,x_2,\dots,x_n$. We have $m$ "model functions" $g_{k}(x)$ $(k=1,\dots,m)$ and $G_{k}$ "constraints" and the two are related by:
$$\sum_{i=1}^{n}p_i g_{k}(x_i)=G_{k}$$
Where $p_i=Pr(x=x_i)$ is the "unknown" (more appropriately "unassigned") probability distribution. By choosing the distribution with maximum entropy $-\sum_i p_i log(p_i)$ you get:
$$Pr(x=x_i||G_{1},\dots,G_{m})=p_i=exp\left(-\lambda_0-\sum_{k=1}^{m}\lambda_{k}g_{k}(x_i)\right)$$
Where $\lambda_{k}$ are chosen so that the above constraints are satisfied, and that the $p_i$ sum to $1$. This requires discrete sample space, for continuous case, it is the same form with 2 exceptions:
The summation is replaced by an integral with respect to $dx$
The probability is multiplied by the invariant measure $m(x)$, which in your case is the probability transform of the improper $Dir(0,\dots,0)$ into "odds" form.
So you have:
$$p(x|G_{1},\dots,G_{m})=m(x)exp\left(-\lambda_0-\sum_{k=1}^{m}\lambda_{k}g_{k}(x)\right)dx$$
Now what you will find is that in solving for the lagrange multipliers $\lambda_{k}$ you will get a set of equations which look identical to the GEE equations. Thus the MaxEnt algorithm basically tells you "which probability model" is the most likely to be consistent with your GEE equations. You can then use this distribution to make predictions and give an indication of their accuracy.
Note if the constraints $G_{k}$ are not known, this is solved by multiplying the above $p(x||G_{1},\dots,G_{m})$ by a prior density for $G_{k}$ and then integrating out $G_{k}$ from the probability - this allows for the structure induced by $G_{k}$ to be incorporated into the model, as well as the uncertainty about the true value of $G_{k}$.
|
Distribution family for a ratio dependent variable in a generalized estimating equation
maximum entropy is a good way to go here. With maximum entropy, you specify the "structure" that your model is to depend on, and it does the rest. It has a very similar form to a generalised estimat
|
43,599
|
Minimal number of samples/conversions for statistical validity
|
I am not be able to answer your question completely, but are you looking for this:
Power analysis - http://www.statmethods.net/stats/power.html
|
Minimal number of samples/conversions for statistical validity
|
I am not be able to answer your question completely, but are you looking for this:
Power analysis - http://www.statmethods.net/stats/power.html
|
Minimal number of samples/conversions for statistical validity
I am not be able to answer your question completely, but are you looking for this:
Power analysis - http://www.statmethods.net/stats/power.html
|
Minimal number of samples/conversions for statistical validity
I am not be able to answer your question completely, but are you looking for this:
Power analysis - http://www.statmethods.net/stats/power.html
|
43,600
|
What is the default covariance structure in glmer and can I change it?
|
I do not know about SAS, but variance in glmer is controlled by family argument. If you want to change correlation structure then I suspect you will have to use nlme from nlme package.
|
What is the default covariance structure in glmer and can I change it?
|
I do not know about SAS, but variance in glmer is controlled by family argument. If you want to change correlation structure then I suspect you will have to use nlme from nlme package.
|
What is the default covariance structure in glmer and can I change it?
I do not know about SAS, but variance in glmer is controlled by family argument. If you want to change correlation structure then I suspect you will have to use nlme from nlme package.
|
What is the default covariance structure in glmer and can I change it?
I do not know about SAS, but variance in glmer is controlled by family argument. If you want to change correlation structure then I suspect you will have to use nlme from nlme package.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.