tttjjj/elt_bench huggingface dataset:
Correction: the factor of 2 is because I rounded up 1.96 to 2 (deliberately, since you're approximating); not because it's two tailed. The unrounded calculation is $[1/(0.05/1.96)^2]/\\mu$
I thinks this is more suitable for http://quant.stackexchange.com/. You could model the series with some sort of autoregressive model, but I doubt the out of sample prediction would be accurate. You can account for seasonality or cyclical movements by adding deterministic terms to the regression.
All that page 3 and onward describes is latin hypercube sampling in general. There is no proposed solution in there for the case of finite discrete sets.
You can simply use something like this to generate your AR(1): ts.sim <- arima.sim(list(order = c(1,1,0), ar = 0.9), n = 1000)
I fixed a whole lot of apparent typographical errors.  Please check over the question and correct any misunderstandings I might have introduced. With the statistics you give, $H_0$ should *not* be rejected.
Depends on the sampling distribution (likelihood). A table showing the conjugate prior of various likelihood models is shown on wikipedia: http://en.wikipedia.org/wiki/Conjugate_prior
However, with that small sample sizes even if a decent classifier can be derived, it cannot be shown that the classifier works well. You may want to have a look on our paper discussing this problem:  Beleites, C. *et al.*: Sample size planning for classification models., Anal Chim Acta, 760, 25-33 (2013). DOI: 10.1016/j.aca.2012.11.007](http://dx.doi.org/10.1016/j.aca.2012.11.007). Briefly, the problem is that with a total of 34 cases you won't even be able to get a useful estimate of the learning curve because of the small test sample size ($\\leq 34$).
The rationale for that strategy is unclear, and data splitting greatly reduces power unless the sample size is enormous.
@Denis Probably merits a question of its own as I think it's both data and application dependent. These fractional metrics with $q=1/p$ aren't really metrics in the formal sense for $p>1$ (the sense of the triangle inequality gets reversed for example, so they are non-convex) and as $p$ increases you're converging on the $l_0$ `metric'. I'd start with $p=1$ since $l_{1}$ is not as problematic to work with as $l_{q=1/p}$ when $p>1$, and fit the parameter $p$ from data. Possibly someone has found an automated way to do this by now, but I don't know.
Thanks very much. Sir.
Any book on statistical theory or mathematical statistics. E.g. http://www.amazon.com/Statistical-Theory-Concise-Introduction-Chapman/dp/1439851840
Why not just compute thresholds with the quantile functions?
@Glen_b I updated my question adding an example that one could eventually use to answer the question. Thank you
.../...more detail would be needed. (**4**) Note that in your particular example, with no randomness, the state evolution is completely deterministic and for any sequence of visited states you will, at some point, in less than 100 steps return to a previously visited state. From that point on you'd simply move in a cycle, making the "distribution" over the partition easy to calculate. For example, if we start at 1, we get the sequence: 2  9  0  1  4 25 76 29  0 and henceforth you'd cycle through 0 1 4 24 76 and 29 in order. So, the distribution would be 5/6 on $[0,50)$ and 1/6 on $[50,99)$.
@whuber - Had another look at this ... one can get apparently general solutions for the 1st and 2nd order stats, for arbitrary $n$. This is rather fortunate, because whereas calculating the $(k= 2, n = 4)$ case takes just 1.7 seconds to evaluate, the $(k= 2, n = 6)$ case already takes 750 seconds!
@mpiktas I can also transform the 95% confidence bounds back in the same way. So, how do I compute the statistics from the linear model given one of the two parameters has been `exp`-ed?
It doesn't, except under a broad interpretation of "fourier basis." Do you think you could focus this question and make it more generally answerable by stating what you mean by "translation-invariant," "signal," and "fourier basis"?
Nice way to visualize. Thanks. But how would you quantify this? Maybe there is not a way. Don't get me wrong, I'm not trying to be difficult, I just have no idea.
I really don't understand what "with some concept of statistical significance." is meant to suggest here. It doesn't seem to fit with my understanding of the phrase "statistical significance"
You could also use a bagged tree model for imputation, but that requires more processing power.
In GLMs you condition on the $X$'s, so their specific distributional form shouldn't generally matter.
@Jonathan , thanks for your reply. Sorry, it's a very vague question! I have summary statistics and vote estimates from the polls. I do not have respondent level data, so I'm not sure I can apply a Gelman-style hierarchical model. I'm thinking now about how to incorporate hierarchical information into a [Simon Jackman](http://bit.ly/18WpscJ)-style model.  There is lots of missing data at the state level, infact it's mostly missing! I have polls from approximately 1/6 of the states, but these are the most variable states.
Yes, you are right, the methods use slightly different models, I was not aware of that. Thanks for the hint. (I will explain the differences more detailedly in a separate answer)
Good to hear. I was going to suggest PCA, but thought a less technical approach might help with getting started.
Then there is no regression left to do apart from finding the constant term, which will be the mean of `y - 0.4*predictor1 - 0.2*predictor2 - 0.1*predictor3`.
Post an example dataset and we can do an indepthOr this one which has real data http://www.autobox.com/cms/index.php/blog/entry/you-paid-that-much
I doubt there's gonna be any good answers to the question. The problem is that the you're assuming this graph was generated "from data". The data in this case are speeds and vehicle flow rates. The categories that are placed over them cannot be mapped by analytical function. I'd guess the edges were created fairly arbitrarily, based on expert judgement. Hard to know without the original context. You COULD create a mapping, but it'd just be a massive block of "IF" statements, combined with linear functions, which would be just as arbitrary. For the name, no idea, would be interested to find out
"In practice, that is recreating the wheel, but since you are new to octave (and maybe regression?) I thought it might be helpful." It's extremely helpful. Thank you very much. I'm going to spend some time with this now and do some tests with more data.
I don't think I'm following. It seems to me like under the usual specification of the test, the alternative hypothesis can be true (e.g., the -5 value) yet the series won't be stationary (as in the case with -5). How exactly are these reconciled?
+1 Weighted regression is a nice idea.  Some adjustment of the output statistics, such as estimates of RMS error, might be needed.
Please indicate what *specific* help you need with this problem: where are you stuck?
@CarlosAccioly This question was posed to me in an examination on Sunday. Just wanted to verify my answer.
Dear mpiktas, thanks a lot, I hope I can figure it out now with your help! Best m
I think that it is improving and that we will soon be able to commit to maintaining it.
@Dennis, cool??
Excellent example, but technically PCA can't find the body mass explanation as it can only find linear explanations, that is weighted sums of the original variables. However, if you take logs of your input variables, the ratio becomes a difference, and if it is the right explanation, PCA will be able to find it.
This question appears to be off-topic because it is about asking for R code / packages.
This question is difficult because the notation doesn't make sense. Presumably, $h=g$. (If not, what is $h$?) Convolution is an operation on *functions* whereas expressions like $h(\\tau)$ and $h(-\\tau)$ are *numbers.* Thus, for instance, it makes sense to write expressions like $$(h * r_X)(t)=\\int_\\mathbb{R}h(t-u)r_X(u)du$$ but this is *not* equal to "$h(t)*r_X(t)$," which has no meaning. Because of this confusion, after a good start to the solution things begin to go awry at the second step when "$*$" first appears. If you straighten out this notation you might find the problem is simple.
To clarify, my regression should be stunting ~ insurance + water + insurance*water? thanks,
Thank you for your reply, I very much appreciate it! Happy new year!
... should **not** read ...
It's good practice to answer your own question if you have an answer as good or better than anyone else's, which here is true. However, the idea of a "linear correlation" between temperature and latitude, whatever that means precisely is at best only a local approximation. Globally, even at the very crudest level the tropics being warmer than the poles means that the relation is not even monotonic.
Simply searching for an R function is off-topic for CV (see ou [help page](http://stats.stackexchange.com/help/on-topic)). However, as written this Q will be off-topic on [Stack Overflow](http://stackoverflow.com/) as well. What you need is an overview of clustering. For starters, try reading through some of the threads categorized under the [tag:clustering] tag.
actually I have more than 2 groups, I reported only two as an example.
A pre-post, experimental-control group design is extremely common in psychology. I agree that few people seem to be aware of the comparatively complicated and strict assumptions. Mixed models often seem to be beyond the statistical horizon.
This may be data specific -- if the data has a poor fit to your model, then God only knows where the parameter estimates could go. Can you show your iterated values as well?
Thank you for the detailed and helpful answer! The real data is very unevenly spaced, e.g. 4 posts made in the morning, and no posts until the late evening. How would you recommend to proceed with that? I think resampling will lead to data loss.
@whuber At point 4, I am talking about the [joint entropy](http://en.wikipedia.org/wiki/Joint_entropy) which is the entropy of $(X, Y)$ (a bivariate normal) and that I show to be equal to the entropy of $X+Y$ (a univariate Normal). Note that I am allowed to compare entropies of bivariate and univariate distributions since that is just a scalar value. So, I am not confusing distributions here just saying that entropy of bivariate is equal to entropy of univariate (and wondering why?)
I am not sure what your question is.
**"Under MAR, there are generally no benefits to impute the outcome"** - I have seen this mentioned before, but I don't have any reference for it - can you provide one please ?
This question is mystifying. What exactly are $k$ and $n$? What do they mean? What do you mean by the "p" of a distribution?  How exactly is $k$ "derived" from a pmf?  What do you mean by "the curve"?
@BCLC, yes your version will work too. Let's be reasonable here, you are looking for a descriptive model, but sometimes you simply give up when it's impossible to find an acceptable model to describe the data. If I asked you to give me a model of waiting time on a bus station, it's likely you'd come up with something very simple like a constant, say "15 minutes".
There are several questions with discussions on this site about including interactions in a model when main effects are not found to be statistically significant.  You will find arguments on both sides of the issue.  I think there are situations where including just an interaction term might make sense.
@DoctorAmbient, I'll let you judge the severity.

In one data set, the counts across 4 cells are 16, 17, 13, 30. 
In another data set, the counts across 4 cells are 13, 10, 8, 14.
Good :). If you put it in form of answer i will give you a +1.
:) fixed above, thanks @Glen_b
In addition to @ken 's answer, another method is to use a different ODS destination, such as an rtf file.
The mean of the _same_ list should be the same, no matter what way you calculate it (given that your calculations are correct).  I have not read through the equations, but there seems to be a mistake somewhere.
Confidence Interval, that was a typo.
The naive approximation is formalized and justified by computing the KDE by means of an FFT. To do this, the sample has to be discretized. Since the FFT is so fast, even discretization into millions of bins is not normally an issue. At this point implementation details come to the fore and they suggest that additional information about your situation is essential for choosing a good algorithm. For instance, how do the samples vary from each other? Will they fall into known ranges (allowing bins to be precomputed)? How accurate and precise must the KDE be?  *Etc, etc.*
@Nameless That's not actually a confidence interval, though.
Apparently a solution had been founded on the OR exchange forum (http://www.or-exchange.com/questions/695/analytical-solutions-to-limits-of-correlation-stress-testing). Edward:> Maybe you should repost mark this question as solved
$\\Delta$ represents a $1\\sigma$ deviation as often as a 100% confidence interval. In any event, the difference is only a factor of $\\sqrt{12}$ for discretized sampling (a worthwhile exercise in and of itself). The problem is that you are inconsistent with using $\\Delta X_\\mathrm{sys}$. Is it a discretization error (a type of random error) due to a digital instrument's resolution (as claimed in the text), or is it a true systematic error varying from tree to tree but constant (and unknown) for all measurements for a given tree (as suggested by the use in equations)?
I may be wrong, but you can't just use percentiles in order to get confidence intervals. I think that what you are trying to do is to create the so-called distribution-free confidence intervals (although somewhat modified this time). I think you'll like this blogpost: http://probabilityandstats.wordpress.com/2010/02/22/confidence-intervals-for-percentiles as it has references and a very nice explaination of what you are trying to do ;-).
As a side note, I'll say that the DLM approach to time-series modeling is nice, but it reminds me of C programming: you can do anything, but you can cut your hand off easily as well. The dlm package makes it easy to assemble your matrices, but you've got to figure out what each resulting column means and if you change something, you can easily get crazy results because the columns changed.
I am sorry, the "clear difference" you see is not apparent to me. All I see is that your data are *stored* in a format that differs from the two-column one; I do not read anything that suggests this is a different *statistical* problem from ordinary regression.
I don't think a standard sequence tagger (such as an HMM of CRF) is going to produce very good results in this situation. This is due the restrictions that the tags groups be contiguous and that each tag only occurs once per sequence. I don't think you can easily modify the search to incorporate this information either due to the dependence on past/future tags of arbitrary distance (I could be wrong about this though).
(+1) I can imagine that with a 1400+ pages book the authors offer several chapters to AN(C)OVA :) BTW, there are SAS and Stata code for most of the chapters on UCLA, http://www.ats.ucla.edu/stat/sas/examples/alsm/
Quick note for anyone considering closure: I believe this question is completely on topic here; it's about statistical algorithms
The crucial idea in the first figure is that those points lie in a three-dimensional space, w/ the red circles on a flat plane at the computer screen, the blue triangles on a parallel plane a little in front of the screen & the green pluses on a plane a little in front of that. The regression plane tilts downward to the right, but slopes upward as it moves out from the screen towards you. Note that this phenomenon occurs because X1 & X2 are correlated, if they were uncorrelated, the estimated betas would be the same.
Hi, thanks for your answer! The paper you refer to is about MIC, which is I'm believe is a bit more than MI. I have implemented the distance correlation measure and I don't think it be simpler than the MI for the elemental case of discrete categorical variables. Then again one thing that I have learned is that DCM is well defined and well behaved for continuous variables, but with MI you need to do binning or fancy stuff ala MIC.
@Aaron - My overall aim is to find a relationship between two datasets of mass that I have. So, if I have a value for DI, I am able to find out the corresponding value of II.
You might get useful answers by disclosing some information about your data. In general you cannot expect solid estimates of variogram parameters due to very high correlations among them; it can take hundreds of points with nicely behaved data. Thus, it would also help for you to share the specifics of the solutions you are getting, including the parameter estimates and their variances.
I think the residual error and the rest of the variance components will be jointly unidentifiable.
*maxima* is plural, *maximum* is singular. Finding out if a function is [unimodal](http://en.wikipedia.org/wiki/Unimodality#Unimodal_function) is often straightforward for simple functions, but not necessarily a trivial exercise in general.
Have you compared your code to `stats:::wilcox.test.default`?
Thanks @abaumann, is there a tool which will already have something like this built-in, or should I make my own Excel formula?
I knew this couldn't be that hard. Note, whuber's link above gives a more general answer.
(PS I am not suggesting that your answer should be changed or removed; it's a suggestion for similar questions in future)
I understand that, but I wonder if there is any important theoretical reason to use exp(-X^2). Could I just calculate the likelihood ratio as X^2_old/X^2new?
So do the coin tosses sort of lump in the middle around the half-way point of the number of coins?  That's my intuition from what I've seen but I'm looking for hard numbers.
@Jonathan thanks . Here is my new question
I have a considerable qualm, but there's a reason not to retreat from the things that incites it: the indicator variable I've chosen was of course itself suggested by the data.  BUT in the situation that Scheffé considered, the validity of the estimate of error variability was undisturbed by the fact that one of those contrasts might actually be far from zero.  Not so in this example.  Is that a major difficulty that arises in this problem but not in the problem that Scheffé solved?
Why not construct a linesr model where the variance is inversely proportional to the group sample size?
I think you're suggesting doing simulations under the null hypothesis of no true difference with a large sample size and looking at the $p$-values. I can tell you without doing the simulations that $<.001$ proportion of the resulting $p$-values will be as small as the one the original poster observed. This is true for any sample size. This is the definition of a $p$-value.
Welcome to the site, @BenM. From your answer, I think it'll be nice having you around (although I don't know enough about PCA beyond the basics to evaluate your claims). One question, you note that these positions have been well established, could you list a couple of representative publications where the interested reader could find more detail?
I was not aware of that recommendation of a minimum of 20 participants per cell -- good to know. Also that power primer looks useful and probably easier than downloading and dealing with GPower.
However, a few appropriate edits (as long as you let me know) may turn my -1 to a +1 on your answer.
@Zach My point was that bagging, or in particular RFs, prevent from overfitting (to a certain extent) provided you remain in the same toolchain. If you use the results from RFs and then go see how another model would perform with the same data, then you break the CV loop. But why not use directly RFs for classification? Another solution would be to use RFs on a training sample and then apply the GLM on an held-out sample (that could potentially be cross-validated too).
That would be my interpretation: the bivariate correlation is obscured by noise that is cleaned up in the first step of the regression model.
@ EpiGrad  Yes, as I am trying to predict the probability of developing an adverse event for each individual in the survival analysis, i.e. the cumulative probability of an event at the time point where the follow up period ends.
Note that $Y>a$ almost surely, hence the interval $[y_l,y_u]$  contains the parameter $a$ with probability zero. In fact your argument works if what you are estimating is $\\theta=a+\\frac12$.
Do not understand what you mean... f1 is standing for a factor with the three levels A, B and C. I used A=0, B=1, C=2.
*A* and *B* are correlation matrices.  They are quite similar, but not identical.
Thanks.  That got me headed in the right direction.  I got a copy of _Extending the Linear Model with R_ (Faraway 2006), which has a chapter on multinomial data.  I'll post my findings once I've had a chance to work with the data.
Apologies, I focused on the execution time and didn't pay attention to the warnings. Is it possible that the problem comes from the `o` function? When I run it with a equal to either 0.2, 0.4, 0.6, and 0.8 the function returns NA. Shouldn't the argument `t` used in call of `croston`  be defined in the function `o` or passed as an argument?
@whuber many thanks for the link(s) I think I can get where I want to be with that. Cheers.
Check with your teacher if you can use an improper prior for $\\Lambda$. I've just added that to the answer.
I don't think this has to do with scientific rigor, but rather with the difficulty of the task.  If predicting how many days someone has to live, the $R^2$ will be quite low (thank goodness).
Does this question have any statistical content?
In your Q2, do you mean `cex.lab` instead of `cex.axis`?
When is the decision to assign treatment A or B is made? If at the beginning, then you want to calculate the propensity only based on covariates present at the beginning.
@robin But here you can't tear those apart. The most of algorithms mentions in that question were created to address this issue -- forward selection is to remove correlated features, backward elimination is to stabilize the importance measure, mcmc is to include correlated features...
Recall that $Var(u|x)=E(u^2|x)-E(u|x)^2$. If the second term is zero, as is assumed here, then we must have $Var(u|x)=E(u^2|x)$, for any $x$. Under $H_0$ we assume that $Var(u|x)=\\sigma^2$. Putting these together, under $H_0$ we must have that $E(u^2|x)=\\sigma^2$, for any $x$.
Also, because the responses are counts, they likely have inherent variability. Thus more than an estimate of the midpoint (aka "LD50" in another setting) is needed: it would be good to derive a standard error of that estimate. This all suggests applying a poisson GLM, perhaps with logistic link, using time (or splines thereof) as explanatory variables, and then working out that middle time using methods of "inverse regression." Somehow it is starting to look like a statistics question :-).
Do you mean different approaches _to classification_ in LDA for two groups? If yes do by Fisher's approach you mean _Fisher's linear classification functions_ and by Bayes's approach you mean [this](http://stats.stackexchange.com/questions/31366/linear-discriminant-analysis-and-bayes-rule/31384#31384) one?
Because, as the messages say, it is off topic here: it asks only how to program something in `R`. Please consult our [faq] for more information.
Can the downvoter explains its downvote ?
@Andy Because then it becomes very difficult to consider an holdout sample and/or class imbalance with very limited sample size ($13<n<25$) generally yields larger classification error rate when applying CV; some individuals might be considered as outliers when studying bivariate distributions; and measures gathered on instruments with their own measurement error are less reliable (small $n$, large $\\sigma$). In a certain sense, it is sometimes difficult to disentangle an unexpected relationship from an artifact.
It is mathematically convenient. I do not think there is any deeper reason, even more, because of the equivalence.