Id
stringlengths
1
6
PostTypeId
stringclasses
7 values
AcceptedAnswerId
stringlengths
1
6
ParentId
stringlengths
1
6
Score
stringlengths
1
4
ViewCount
stringlengths
1
7
Body
stringlengths
0
38.7k
Title
stringlengths
15
150
ContentLicense
stringclasses
3 values
FavoriteCount
stringclasses
3 values
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
stringlengths
1
6
OwnerUserId
stringlengths
1
6
Tags
list
4272
1
4274
null
97
43469
In what circumstances should one consider using regularization methods (ridge, lasso or least angles regression) instead of OLS? In case this helps steer the discussion, my main interest is improving predictive accuracy.
When to use regularization methods for regression?
CC BY-SA 2.5
null
2010-11-06T17:53:05.250
2018-01-20T17:03:16.403
2017-07-24T12:24:36.363
11887
439
[ "regression", "least-squares", "lasso", "ridge-regression", "fused-lasso" ]
4273
2
null
4272
23
null
A theoretical justification for the use of ridge regression is that its solution is the posterior mean given a normal prior on the coefficients. That is, if you care about squared error and you believe in a normal prior, the ridge estimates are optimal. Similarly, the lasso estimate is the posterior mode under a doubl...
null
CC BY-SA 2.5
null
2010-11-06T18:22:43.530
2010-11-06T18:22:43.530
null
null
1815
null
4274
2
null
4272
87
null
Short answer: Whenever you are facing one of these situations: - large number of variables or low ratio of no. observations to no. variables (including the $n\ll p$ case), - high collinearity, - seeking for a sparse solution (i.e., embed feature selection when estimating model parameters), or - accounting for va...
null
CC BY-SA 3.0
null
2010-11-06T19:09:19.687
2018-01-20T17:03:16.403
2018-01-20T17:03:16.403
128677
930
null
4275
2
null
4267
4
null
For NNMF, Lee and Seung describe an iterative algorithm which is very simple to implement. Actually they give two similar algorithms, one for minimizing Frobenius norm of residual, the other for minimizing Kullback-Leibler Divergence of the approximation and original matrix. - Daniel Lee, H. Sebastian Seung, Algorithm...
null
CC BY-SA 2.5
null
2010-11-06T19:47:38.620
2010-11-06T19:47:38.620
null
null
795
null
4276
1
null
null
9
2329
I have a sensor which is capturing accelerometer data as a person walks. What I'm interested in extracting is each signal fragment when a step is taken. The Z-axis is what is used since only one axis is required to detect changes in steps. The images below illustrates a sample Z-axis gait signal (for 400 iterations).![...
Using autocorrelation to find commonly occurring signal fragments
CC BY-SA 2.5
null
2010-11-06T21:12:01.923
2011-03-26T00:45:12.177
2011-03-26T00:45:12.177
null
1224
[ "matlab", "autocorrelation", "signal-processing", "markov-process" ]
4277
2
null
4252
5
null
In addition to the above answer, if there are many entries (say n), then first sorting them takes time O(n log n). However, there is a linear-time solution. - Compute the P-quantile L and (1-P)-quantile U. There is a simple (quicksort-like) algorithm for this that runs in expected linear time. There is also a more com...
null
CC BY-SA 2.5
null
2010-11-06T23:16:32.310
2010-11-06T23:16:32.310
null
null
null
null
4279
1
null
null
5
21992
I would like build a web application using R. I am using Windows Vista and have an Apache server. I have tried [Rpad](http://rpad.googlecode.com/svn-history/r76/Rpad_homepage/index.html), but I was not able to correctly configure it. How do I set up Rpad as I am not that well off with PHP and Apache server? Or are ther...
How can I integrate R with PHP?
CC BY-SA 2.5
null
2010-11-07T05:23:12.080
2014-03-23T18:42:35.027
2011-02-03T21:30:15.487
509
1886
[ "r" ]
4280
2
null
4279
11
null
Here is the easiest way to do it that I found: This implementation of PHP and R consists of only two files. One written in PHP, and the other an R script. The PHP returns a form which uses the GET method to send a variable N to the server. When the form is submitted, the PHP will then execute an R script from the shell...
null
CC BY-SA 2.5
null
2010-11-07T05:42:05.297
2010-11-07T08:50:19.673
2010-11-07T08:50:19.673
930
1808
null
4281
2
null
3713
12
null
You can't know in advance which clustering algorithm would be better, but there are some clues, for example if you want to cluster images there are certain algorithms you should try first like Fuzzy Art, or if you want to group faces you should start with (GGCI) global geometric clustering for image. Anyway this does n...
null
CC BY-SA 2.5
null
2010-11-07T07:12:45.540
2010-11-07T07:12:45.540
null
null
1808
null
4282
2
null
2717
0
null
Before you try running the clustering on the matrix you can try doing one of the factor analysis techniques, and keep just the most important variables to compute the distance matrix. Another thing you can do is to try use fuzzy-methods which tend to work better (at least in my experience) in this kind of cases, try fi...
null
CC BY-SA 2.5
null
2010-11-07T07:18:14.823
2010-11-07T07:18:14.823
null
null
1808
null
4283
2
null
4279
8
null
If you ever think to switch to Linux, the best way would be to use [RApache](http://rapache.net/), which is an Apache module that embeds an R interpreter (`mod_R`) in the webserver
null
CC BY-SA 2.5
null
2010-11-07T08:21:28.343
2010-11-07T08:21:28.343
null
null
582
null
4284
1
4287
null
61
26565
I am looking for an intuitive explanation of the bias-variance tradeoff, both in general and specifically in the context of linear regression.
Intuitive explanation of the bias-variance tradeoff?
CC BY-SA 3.0
null
2010-11-07T10:57:29.053
2021-06-23T18:55:38.060
2021-05-31T01:29:56.287
11887
439
[ "regression", "variance", "bias", "intuition", "bias-variance-tradeoff" ]
4285
2
null
4261
2
null
David, before discussing the implementation, I'd discuss question #1. I think the approach "makes sense", if you mean by this that the approach is intuitive. However, from the perspective of bootstrapping, the approach probably won't work. One well-known failure of bootstrap is in fact in the case of maxima and minima....
null
CC BY-SA 2.5
null
2010-11-07T12:25:30.237
2010-11-07T12:25:30.237
null
null
30
null
4286
1
4289
null
4
428
I have the following setting. I have n Hermitian Positive Semidefinite (HPSD) matrices, and a metric induced by a matrix norm. I am primarily interested in the Frobenius norm and the operator norm. I want to extract the principal "principal component" for this set of observations, i.e., a 1-dimensional subspace in HPSD...
Principal Component Analysis among matrices
CC BY-SA 2.5
null
2010-11-07T12:54:08.700
2010-11-07T14:19:31.577
null
null
30
[ "pca", "dimensionality-reduction" ]
4287
2
null
4284
27
null
Imagine some 2D data--let's say height versus weight for students at a high school--plotted on a pair of axes. Now suppose you fit a straight line through it. This line, which of course represents a set of predicted values, has zero statistical variance. But the bias is (probably) high--i.e., it doesn't fit the data ve...
null
CC BY-SA 4.0
null
2010-11-07T13:21:12.523
2020-11-12T05:52:30.277
2020-11-12T05:52:30.277
29617
438
null
4288
1
4546
null
3
207
When trying to estimate the number of sampling units with an attribute, is there a good algebraic way to aggregate over propensity scores for that attribute which each have their own error? For example, when the propensity scores may be calculated with varying amounts of information from each sampling unit and each has...
Aggregation of propensity scores with varying reliability
CC BY-SA 2.5
null
2010-11-07T13:51:20.053
2011-02-15T06:22:56.137
2010-11-16T17:26:48.193
1893
1893
[ "distributions", "probability", "beta-binomial-distribution", "propensity-scores" ]
4289
2
null
4286
6
null
I don't know if this is exactly what you are looking for (esp. I don't know how large is $n$ and what you intend to do with these results), however I have successfully used [coinertia analysis](http://pbil.univ-lyon1.fr/R/articles/arti113.pdf) when I was working with two data sets (same observations in rows), and for m...
null
CC BY-SA 2.5
null
2010-11-07T14:19:31.577
2010-11-07T14:19:31.577
null
null
930
null
4290
2
null
2419
7
null
You can use R decision tree library using Rpy(http://rpy.sourceforge.net/). Also check the article "building decision trees using python"(http://onlamp.com/pub/a/python/2...). there is also [http://opencv.willowgarage.com/documentation/index.html](http://opencv.willowgarage.com/documentation/index.html) [http://researc...
null
CC BY-SA 2.5
null
2010-11-07T14:57:07.923
2010-11-07T14:57:07.923
null
null
1808
null
4291
2
null
2419
1
null
[JBoost](http://jboost.sourceforge.net/) is an awesome library. It is definitely not written in Python, however It is somewhat language agnostic, because it can be executed from the command line and such so it can be "driven" from Python. I've used it in the past and liked it a lot, particularly the visualization stuff...
null
CC BY-SA 2.5
null
2010-11-07T15:04:46.763
2010-11-07T15:04:46.763
null
null
1540
null
4292
1
4293
null
5
2841
Here is a look at my data. We asked the same respondents (n=~400) to provide us with their current and future consumption as a proportion of total expenditure. Plotted here are the mean proportions of total expenditure for each category for "Now" and "Later", respectively current and future. What I'm looking for is a...
How to test if change is significant across multiple categories?
CC BY-SA 2.5
null
2010-11-07T17:28:27.877
2010-11-07T18:44:42.407
2010-11-07T18:05:08.847
776
776
[ "hypothesis-testing", "statistical-significance" ]
4293
2
null
4292
6
null
There are subtle issues involving the difference between designed comparisons and post-hoc comparisons, of which this likely is an example. If, before collecting the data, you anticipated this kind of pattern, you could employ a simple nonparametric test. The null hypothesis would be that all changes are due to chance...
null
CC BY-SA 2.5
null
2010-11-07T17:50:01.673
2010-11-07T17:50:01.673
null
null
919
null
4294
1
4299
null
4
3083
I'm taking a graduate course in regression analysis and I'm suck on a particular homework question that should be very simple to me! I have the following model: ``` E(y) = B0 + B1x1 + B2x2 + B3x3 + B4x1x3 + B5x2x3 ``` `x3` is coded as `1` if "smoker" and `0` if "non-smoker". Therefore the regression equations are: ```...
How to test for parallelism for two linear models?
CC BY-SA 2.5
null
2010-11-07T18:32:20.763
2010-11-07T21:35:04.993
2010-11-07T20:21:28.377
1894
1894
[ "hypothesis-testing", "regression", "self-study" ]
4295
2
null
4292
1
null
Given the additional information you've subsequently posted I'm not sure any statistical test is going to be that informative. If you had a strong prediction of a pattern such as this or similar, this is such a low probability event that you're pretty much set just getting these data. With an N of 400 almost any test...
null
CC BY-SA 2.5
null
2010-11-07T18:44:42.407
2010-11-07T18:44:42.407
null
null
601
null
4296
1
null
null
27
37169
Does anybody have a good example for Time Series Forecasting/smoothing using Kalman Filter in R?
R code for time series forecasting using Kalman filter
CC BY-SA 3.0
null
2010-11-07T20:08:22.533
2019-11-02T15:03:53.750
2011-09-27T08:34:49.010
2116
1896
[ "r", "time-series", "kalman-filter" ]
4297
2
null
4296
29
null
Have you looked at [Time Series](http://cran.r-project.org/web/views/TimeSeries.html) Task View at CRAN? It lists several entries for packages covering Kalman filtering: - dlm - FKF - KFAS and more as this is a pretty common techique for time series estimation.
null
CC BY-SA 4.0
null
2010-11-07T20:22:24.477
2019-11-02T15:03:53.750
2019-11-02T15:03:53.750
1381
334
null
4298
1
4314
null
10
8382
This question is a follow up to my earlier question [here](https://stats.stackexchange.com/questions/4220/probability-distribution-over-1-is-ok) and is also related, in intent, to [this question](https://stats.stackexchange.com/questions/3316/statistical-similarity-of-time-series). On [this wiki page](http://en.wikipe...
Use of kernel density estimate in Naive Bayes Classifier?
CC BY-SA 2.5
null
2010-11-07T21:23:52.657
2010-11-08T14:55:21.340
2017-04-13T12:44:41.493
-1
226
[ "bayesian", "kde" ]
4299
2
null
4294
4
null
I am bit unsure what exactly you mean by 'parallelism' but perhaps you mean that you want to test if the interaction terms are significant or not in which case you would do a joint test that B4=0 and B5=0.
null
CC BY-SA 2.5
null
2010-11-07T21:35:04.993
2010-11-07T21:35:04.993
null
null
null
null
4300
2
null
4296
10
null
For good examples look at the [dlm vignette](http://cran.r-project.org/web/packages/dlm/vignettes/dlm.pdf) I would avoid all the other packages if you don't have a clear idea of what you want to do and how.
null
CC BY-SA 2.5
null
2010-11-07T22:25:28.340
2010-11-07T22:25:28.340
null
null
300
null
4301
2
null
726
58
null
> Tout le monde y croit cependant, me disait un jour M. Lippmann, car les expérimentateurs s'imaginent que c'est un théorème de mathématiques, et les mathématiciens que c'est un fait expérimental. Henri Poincaré, Calcul des probabilités (2nd ed., 1912), p. 171. In English: > Everybody believes in the exponential la...
null
CC BY-SA 3.0
null
2010-11-07T22:41:34.370
2017-06-04T19:01:29.570
2017-06-04T19:01:29.570
14076
919
null
4302
2
null
726
86
null
> Statistics - A subject which most statisticians find difficult but which many physicians are experts on. "Stephen S. Senn"
null
CC BY-SA 3.0
null
2010-11-07T23:16:13.807
2017-07-27T07:26:24.357
2017-07-27T07:26:24.357
28740
null
null
4303
1
null
null
6
20343
I wish to analyze the following : Predictor Variable (IV): Satisfaction of sexual needs as important (4 items scale and respond based on 4 point likert scale. Sum up to get the item score.) Response Variable (DV): Condom usagae (2 options : never or sometime) Questions: - Should I use binary logistic or multinomial lo...
Binary or Multinomial Logistic Regression?
CC BY-SA 2.5
null
2010-11-08T09:03:46.017
2012-09-01T13:12:07.450
2010-11-08T12:14:02.673
183
null
[ "logistic", "spss" ]
4304
2
null
4296
16
null
In addition to the packages mentioned in other answers, you may want to look at package [forecast](http://cran.r-project.org/package=forecast) which deals with a particular class of models cast in state-space form and package [MARSS](http://cran.r-project.org/package=MARSS) with examples and applications in biology (s...
null
CC BY-SA 2.5
null
2010-11-08T09:13:11.370
2010-11-08T09:23:42.357
2010-11-08T09:23:42.357
159
892
null
4305
1
4309
null
9
21603
Is there a recommendation on the number of times that an experiment should be replicated? As many of you know, is not always possible to make many replicas. What would be the recommended minimum? Is there some references to support it? In my particular case (animal reproduction), for reasons of seasonality, I can only ...
At least, how many times an experiment should be replicated?
CC BY-SA 2.5
null
2010-11-08T09:40:03.757
2017-03-15T08:13:43.787
2010-11-08T12:56:21.207
449
221
[ "estimation", "sample-size", "experiment-design" ]
4306
2
null
2419
0
null
I have experienced the similar situation with you, I find Orange is hard to tune (maybe it is my problem). In the end, I used Peter Norivig's code for his famous book, in there he provided a well written code framework for tree, all you need is to add boosting in it. This way, you can code anything you like.
null
CC BY-SA 2.5
null
2010-11-08T10:30:23.147
2010-11-08T10:30:23.147
null
null
806
null
4308
1
4311
null
6
350
I was just wondering-- is it possible/practical to apply bayes' theorem without an analytical expression for the prior, only samples? For example, say you have sufficient draws from a posterior distribution from a previous experiment via MCMC methods, and you'd like to use that posterior as the prior for a new one. Y...
Is it possible to apply Bayes Theorem with only samples from the prior?
CC BY-SA 2.5
null
2010-11-08T12:01:22.877
2010-11-09T09:34:18.210
null
null
1795
[ "bayesian", "markov-chain-montecarlo" ]
4309
2
null
4305
7
null
There is no such thing as a minimum (or maximum) sample size rule. It depends on the size of the effect you are trying to measure. Your description of the experiment is slightly unclear, but consider this example, if you measured blood pressure in three different people, what could you conclude about blood pressure in ...
null
CC BY-SA 2.5
null
2010-11-08T12:07:50.973
2010-11-08T12:07:50.973
null
null
8
null
4310
2
null
4303
11
null
Binary or Multinomial: Perhaps the following rules will simplify the choice: - If you have only two levels to your dependent variable then you use binary logistic regression. - If you have three or more unordered levels to your dependent variable, then you'd look at multinomial logistic regression. A few points: ...
null
CC BY-SA 2.5
null
2010-11-08T12:09:59.670
2010-11-08T12:09:59.670
null
null
183
null
4311
2
null
4308
8
null
The short answer is yes. Have a look at [sequential MCMC/ particle filters](http://en.wikipedia.org/wiki/Particle_filter). Essentially, your prior consists of a bunch of particles ($M$). So to sample from your prior, just select a particle with probability $1/M$. Since each particle has equal probability of being chose...
null
CC BY-SA 2.5
null
2010-11-08T12:14:57.690
2010-11-09T09:34:18.210
2010-11-09T09:34:18.210
8
8
null
4312
1
4321
null
1
2845
This is related to another [question](https://stats.stackexchange.com/questions/4175/resampling-binomial-z-and-t-test-help-with-real-data) I asked recently. To recap: [I had 30 people call a number and then roll a 5 sided die. If the call matches the subsequent face then the trial is a hit, else it is a miss. Each subj...
Help with a one-sample permutation z-test
CC BY-SA 2.5
null
2010-11-08T13:03:59.743
2010-11-09T01:25:20.130
2017-04-13T12:44:55.360
-1
1614
[ "r", "permutation-test" ]
4313
2
null
726
12
null
"After 17 years of interacting with physicians, I have come to realize that many of them are adherents of a religion they call Statistics... Like any good religion, it involves vague mysteries capable of contradictory and irrational interpretation. It has a priesthood and a class of mendicant friars. And it provides Sa...
null
CC BY-SA 2.5
null
2010-11-08T14:12:20.500
2010-11-08T14:12:20.500
null
null
919
null
4314
2
null
4298
6
null
I have read both the first linked earlier question, especially the answer of whuber and the comments on this. The answer is yes, you can do that, i.e. using the density from a kde of a numeric variable as conditional probability ($P(X=x|C=c)$ in the bayes theorem. $P(C=c|X=x)=P(C=c)*P(X=x|C=c)/P(X=x)$ By assuming that...
null
CC BY-SA 2.5
null
2010-11-08T14:55:21.340
2010-11-08T14:55:21.340
null
null
264
null
4315
2
null
726
15
null
> It would be illogical to assume that all conditions remain stable ~ Spock, "The Enterprise Incident",stardata 5027.3
null
CC BY-SA 2.5
null
2010-11-08T15:05:19.573
2010-11-08T15:05:19.573
null
null
264
null
4316
1
null
null
14
83428
The context of this question is within a health framework i.e. looking at one or more therapies in the treatment of a condition. It appears that even well respected researchers confuse the terms efficacy and effectiveness, using the terms interchangeably. - How can one think of efficacy versus effectiveness in a way ...
What is the difference between effectiveness and efficacy in determining the benefit of therapy 'A' on condition 'B'?
CC BY-SA 3.0
null
2010-11-08T15:58:52.233
2015-10-24T18:51:40.493
2011-10-08T00:37:34.597
183
431
[ "epidemiology", "causality", "clinical-trials", "definition", "instrumental-variables" ]
4317
2
null
4258
7
null
Here is one approach at the automation. Feedback much appreciated. This is an attempt to replace initial visual inspection with computation, followed by subsequent visual inspection, in keeping with standard practice. This solution actually incorporates two potential solutions, first, calculate burn-in to remove the l...
null
CC BY-SA 2.5
null
2010-11-08T16:03:39.950
2010-11-10T00:17:12.523
2017-05-23T12:39:26.203
-1
1381
null
4318
2
null
726
49
null
> On two occasions I have been asked [by members of Parliament], ‘Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?’ I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. Charles Babbage
null
CC BY-SA 2.5
null
2010-11-08T16:06:40.543
2010-11-08T16:06:40.543
null
null
1614
null
4319
2
null
4312
3
null
Caveat: I'm not sure I fully understand your question. With this in mind, your solution does, IMHO, not provide a one-sample permutation z-Test, as it does not use the original data while performing some re-labeling of the experimental units consistent with the Null hypothesis in the given experimental design. Actually...
null
CC BY-SA 2.5
null
2010-11-08T16:13:13.950
2010-11-08T16:13:13.950
null
null
1909
null
4320
1
4323
null
2
51428
(1) I am looking for a package for computing the power of a matrix. If you have some good recommendation please let me know. (2) I searched on the internet and followed what some said to install a package called "Malmig" in R but after selecting the mirror site, it failed: > In install.packages("Malmig") : package ‘Ma...
Compute the power of a matrix in R
CC BY-SA 2.5
null
2010-11-08T16:18:53.253
2016-08-21T23:14:54.437
2010-11-08T17:12:47.230
null
1005
[ "r" ]
4321
2
null
4312
2
null
I don't think it is going a one sample Z; to me it looks like it is a test against a certain set of priors. I'm confused, why are you doing a one sample Z using binomial data as your source data? You could simply create a distribution of N successes and see what quantile your actual data was in. However the above met...
null
CC BY-SA 2.5
null
2010-11-08T16:27:25.407
2010-11-08T17:18:47.030
2010-11-08T17:18:47.030
196
196
null
4322
2
null
4316
11
null
I'm not a specialist of this domain in epidemiological studies, but it seems to me that efficacy has to do with the observed effect in a controlled setting, like a randomized controlled trial, whereas effectiveness has more to do with a larger range of outcomes or environmental factors (potentially unobserved or non ma...
null
CC BY-SA 3.0
null
2010-11-08T16:46:18.607
2012-10-24T14:19:15.780
2012-10-24T14:19:15.780
930
930
null
4323
2
null
4320
9
null
Package expm provides the matrix %^% number operator notation for its function matpow(): ``` > library(expm) > mat <- matrix(1:9, nrow=3) > mat %^% 2 [,1] [,2] [,3] [1,] 30 66 102 [2,] 36 81 126 [3,] 42 96 150 # check > mat %*% mat [,1] [,2] [,3] [1,] 30 66 102 [2,] 36 81 126 [3,...
null
CC BY-SA 2.5
null
2010-11-08T17:03:27.557
2010-11-08T17:03:27.557
null
null
1909
null
4324
2
null
4175
2
null
Answer #1: binom.test is in some ways a "more correct" test because it doesn't assume normality; yes - you'll get more power out of the normality assumption, and it might be reasonable - but to any extent you violate the assumptions of the test you may increase your type-I error rate. Explanation #1: Though with a hi...
null
CC BY-SA 2.5
null
2010-11-08T17:07:23.140
2010-11-08T17:07:23.140
2017-04-13T12:44:29.013
-1
196
null
4325
1
null
null
3
335
There are some cases where I would like to correct for multiple comparisons where the null hypotheses vary. For example, if I am performing a chi-squared test or a fisher's exact test on multiple contingency tables of different sizes, the null hypotheses vary from table to table. Can I still apply the Benjamini-Hochber...
Do the null hypotheses used for benjamini-hochberg have to be identical?
CC BY-SA 2.5
null
2010-11-08T17:46:28.193
2010-11-08T18:11:16.983
null
null
null
[ "multiple-comparisons", "statistical-significance" ]
4326
2
null
4325
6
null
No, there is no such restriction. The only restriction is whether the tests themselves are independent or not, and there is even some wiggle room there: if the tests are positively correlated, you can pretend they are independent. See e.g [False Discovery Rate](http://en.wikipedia.org/wiki/False_discovery_rate) or the ...
null
CC BY-SA 2.5
null
2010-11-08T18:11:16.983
2010-11-08T18:11:16.983
null
null
795
null
4327
2
null
4200
0
null
[http://en.wikipedia.org/wiki/Granger_causality](http://en.wikipedia.org/wiki/Granger_causality) Barrett, Barnett & Seth have a paper which extends the idea of Granger causality to the multivariate case.
null
CC BY-SA 2.5
null
2010-11-08T18:17:46.173
2010-11-08T18:17:46.173
null
null
1349
null
4328
1
4330
null
14
7739
Does anyone know of some well written code (in Matlab or R) for reversible jump MCMC? Preferably a simple demo application to compliment papers on the subject, that would be useful in understanding the process.
Reversible jump MCMC code (Matlab or R)
CC BY-SA 3.0
null
2010-11-08T18:58:46.730
2017-05-16T21:57:13.097
2013-09-09T14:37:17.570
27581
1913
[ "r", "matlab", "references", "markov-chain-montecarlo" ]
4329
2
null
4316
6
null
A standard, but not fully online, dictionary is the Dictionary of Epidemiology sponsored by the [International Epidemiological Association](http://ieaweb.org). The latest edition is the fifth, but the fourth edition appears to be latest [partly available online via Amazon](http://rads.stackoverflow.com/amzn/click/01951...
null
CC BY-SA 2.5
null
2010-11-08T19:10:33.560
2010-11-08T19:10:33.560
null
null
449
null
4330
2
null
4328
12
null
RJMCMC was introduced by [Peter Green](http://www.stats.bris.ac.uk/~peter/Welcome.html) in a [1995 paper](http://dx.doi.org/10.1093/biomet/82.4.711) that is a citation classic. He wrote a Fortran program called [AutoRJ](http://www.stats.bris.ac.uk/~peter/AutoRJ/) for automatic RJMCMC; his page on this links to David Ha...
null
CC BY-SA 2.5
null
2010-11-08T19:30:49.540
2010-11-08T19:30:49.540
null
null
449
null
4331
1
null
null
3
5567
I've got a data-set which I assume is uniformly distributed. Say I've got `N=20000` samples and a suspected `p=0.25`. This means that I would expect each option to show up roughly `5000` times. How do I calculate the following interval `[5000 - x, 5000 + x]` such that I can say with a certain confidence that the data-s...
Uniform Distribution Test
CC BY-SA 2.5
null
2010-11-08T20:11:55.963
2010-11-09T02:56:51.557
2010-11-08T22:38:18.940
null
null
[ "distributions", "hypothesis-testing", "uniform-distribution" ]
4332
2
null
4331
4
null
You might try assuming--as your null hypothesis--that the distribution is discrete uniform independent of string position. Then tabulate the frequencies of each letter by position in a 4 x 13 contingency table. You can then test for non-independence with a simple chi-square test; with n=20,000 observations in your on...
null
CC BY-SA 2.5
null
2010-11-09T02:56:51.557
2010-11-09T02:56:51.557
null
null
5792
null
4333
2
null
4320
1
null
There is the following code you can write: > library(Biodem) png(filename="images/mtx.exp_%03d.png" ,width=480, height=480) Name: mtx.exp Title: Calculates the n-th power of a matrix Aliases: mtx.exp Keywords: array manip methods ** Examples test<-matrix(c(1:16), 4,4) pow.test<-mtx.exp(test,10) pow.test for mo...
null
CC BY-SA 2.5
null
2010-11-09T05:55:40.453
2010-11-09T05:55:40.453
null
null
1808
null
4334
1
4456
null
4
2309
I would like to implement the model proposed in [Dynamic modeling of mean-reverting spreads](http://ideas.repec.org/p/arx/papers/0808.1710.html) (Kostas Triantafyllopoulos, Giovanni Montana). They propose to model a time serie Y_t with the following equations: ``` (1) Y_t = A_t + B_t * Y_(t-1) + e_t (2) A_t = Phi1 * ...
State space form of time varying AR(1)
CC BY-SA 2.5
null
2010-11-09T07:30:15.237
2010-12-24T13:12:37.723
2010-11-10T01:59:02.990
1709
1709
[ "r", "bayesian", "dynamic-regression" ]
4335
1
4342
null
37
3750
I just discovered the `comment` function in R. Example: ``` x <- matrix(1:12, 3,4) comment(x) <- c("This is my very important data from experiment #0234", "Jun 5, 1998") x comment(x) ``` This is the first time I came by this function and was wondering what are common/useful uses of it. Since it is qui...
What is a good use of the 'comment' function in R?
CC BY-SA 3.0
null
2010-11-09T08:55:58.867
2022-03-09T15:11:17.130
2011-12-08T07:39:24.997
930
253
[ "r" ]
4336
2
null
4335
14
null
One thing I often find myself doing in my R scripts for a particular data analysis task is to include comments in the script about the units of variables in my data frames. I work with environmental data and chemists and ecologists seem to enjoy using a wide range of different units for the same things (mg L$^{-1}$ vs ...
null
CC BY-SA 2.5
null
2010-11-09T09:09:25.487
2010-11-09T09:09:25.487
null
null
1390
null
4337
1
4340
null
10
867
I need to do an experiment. First let me describe present situation. The company that I work for is a cinema. It has a gaming section where people who are waiting for movies can pass time by playing games. People can pay only by using prepaid membership card. Unfortunately this gaming section is not generating enough s...
What to do with confounding variables?
CC BY-SA 2.5
null
2010-11-09T09:23:00.533
2010-11-11T13:12:53.023
null
null
1922
[ "experiment-design" ]
4338
2
null
4328
8
null
The book [Bayesian Analysis for Population Ecology](http://rads.stackoverflow.com/amzn/click/1439811873) by King et al. describes RJMCMC in the context of population ecology. I found there description very clear and they provide the R code in the appendix. The book also has an associated [webpage](http://lemur.mcs.st-a...
null
CC BY-SA 3.0
null
2010-11-09T09:27:58.247
2013-01-22T21:31:24.653
2013-01-22T21:31:24.653
8
8
null
4339
2
null
4335
7
null
Similar facilities exist in other packages, such as the [-notes- command in Stata](http://www.stata.com/help.cgi?notes). We use this to document full details of a variable, e.g. details of assay for a biochemical measurement, or exact wording of the question asked for questionnaire data. This is often too much info for...
null
CC BY-SA 2.5
null
2010-11-09T09:33:50.550
2010-11-09T09:33:50.550
null
null
449
null
4340
2
null
4337
6
null
Here are some suggestions relating your to bullet points above: - What about using the daily takings as an explanatory variable? What you need to do is form an equation where you predict gaming sales given a number of other factors. There factors will include things you are interested in such as whether they used a p...
null
CC BY-SA 2.5
null
2010-11-09T10:58:27.400
2010-11-09T11:51:48.430
2010-11-09T11:51:48.430
8
8
null
4341
1
null
null
8
214249
I do have a big list of numeric values (including duplicates) and I do want to group them into ranges in order to see if how do they distribute. Let's say there are 1000 values ranging from 0 to 2.000.000 and I do want to group them. How can I achieve this, preferably in Excel or SQL.
How do I group a list of numeric values into ranges?
CC BY-SA 2.5
null
2010-11-09T11:36:58.940
2016-08-20T14:31:05.390
2010-11-09T13:00:22.120
null
1901
[ "excel", "sql" ]
4342
2
null
4335
15
null
To second @Gavin, Frank Harrell has developed efficient ways to handle annotated data.frame in R in his [Hmisc](http://cran.r-project.org/web/packages/Hmisc/index.html) package. For example, the `label()` and `units()` functions allow to add dedicated attributes to R objects. I find them very handy when producing summa...
null
CC BY-SA 3.0
null
2010-11-09T11:54:24.230
2011-12-08T07:39:06.230
2011-12-08T07:39:06.230
930
930
null
4343
2
null
4341
8
null
I'll assume that you've already determined the number of categories you'll use. Let's say you want to use 20 categories. Then they will be: - Category 1: [0 - 100,000) - Category 2: [100,000 - 200,000) - Category 3: [200,000 - 300,000) - ... - Category 19: [1,800,000 - 1,900,000) - Category 20: [1,900,000 - 2,000...
null
CC BY-SA 2.5
null
2010-11-09T12:25:21.007
2010-11-09T12:56:17.023
2010-11-09T12:56:17.023
666
666
null
4345
2
null
4341
9
null
Why group them? Instead, how about estimate the probability density function (PDF) of the distributions from which the data arise? Here's an R-based example: ``` set.seed(123) dat <- c(sample(2000000, 500), rnorm(100, 1000000, 1000), rnorm(150, 1500000, 100),rnorm(150, 500000, 10), rnorm(180, 10000, ...
null
CC BY-SA 2.5
null
2010-11-09T13:00:47.157
2010-11-09T13:57:35.120
2010-11-09T13:57:35.120
1390
1390
null
4347
1
4423
null
7
1820
From what you have read or heard about, which is a good book on fuzzy logic/sets/systems? I'm interested in basic of fuzzy systems, fuzzification/defuzzification, etc.
Fuzzy textbooks
CC BY-SA 3.0
null
2010-11-09T14:58:56.320
2017-01-30T11:56:40.843
2017-01-30T11:56:40.843
28666
976
[ "references", "fuzzy" ]
4348
2
null
4341
3
null
You have requested an Excel or SQL solution. The easiest way in Excel is to use its "Analysis" add-in to create a histogram. It will automatically create the bins (ranges of values) but, optionally, accepts a list of bin cutpoints as input and uses them. The output includes a parallel list of bin counts. This is es...
null
CC BY-SA 2.5
null
2010-11-09T15:08:16.407
2010-11-13T01:32:33.880
2010-11-13T01:32:33.880
919
919
null
4350
1
null
null
3
414
I am trying to use R to conduct community division within my weighted network (based from an association matrix). I tried with igraph but I encountered some problems. I usually use the program Socprog (Whitehead 2009) for my analysis, but as I would like to conduct a community division with Newman modularity (2006) on ...
How to conduct community division of a social network with R?
CC BY-SA 2.5
null
2010-11-09T15:34:36.077
2016-05-23T17:35:54.197
2016-05-23T17:35:54.197
114327
null
[ "r", "clustering", "networks", "igraph", "modularity" ]
4353
1
null
null
2
1213
when fitting GAMM with R, I would like to know why when the smooth function is linear, the confidence interval is zero around the middle (the dotted lines are crossing each other at the middle)
Fitting GAMM model in R
CC BY-SA 2.5
null
2010-11-09T17:43:49.160
2010-11-09T19:04:51.730
2010-11-09T17:54:31.160
5
null
[ "r", "mixed-model", "fitting" ]
4354
1
4355
null
36
6813
I was wondering if there are any distributions besides the normal where the mean and variance are independent of each other (or in other words, where the variance is not a function of the mean).
Distributions other than the normal where mean and variance are independent
CC BY-SA 2.5
null
2010-11-09T18:27:48.047
2022-12-28T16:15:40.340
2022-12-28T16:15:40.340
11887
1934
[ "distributions", "mathematical-statistics", "normal-distribution", "variance", "mean" ]
4355
2
null
4354
13
null
Note: Please read answer by @G. Jay Kerns, and see [Carlin and Lewis 1996](http://rads.stackoverflow.com/amzn/click/1584881704) or your favorite probability reference for background on the calculation of mean and variance as the expectated value and second moment of a random variable. A quick scan of Appendix A in Carl...
null
CC BY-SA 2.5
null
2010-11-09T18:52:16.460
2010-11-12T17:08:50.283
2010-11-12T17:08:50.283
1381
1381
null
4356
1
5802
null
8
8066
I know that R's `rpart` function keeps the data it would need to implement multivariate split, but I don't know if it's actually performing multivariate splits. I've tried researching it online looking at the `rpart` docs, but I don't see any information that it can do it or is doing it. Anyone know for sure?
Does rpart use multivariate splits by default?
CC BY-SA 2.5
null
2010-11-09T18:55:17.830
2010-12-30T06:31:03.853
2010-11-09T19:22:47.847
null
1929
[ "r", "multivariate-analysis", "cart" ]
4357
2
null
7
1
null
Usage Over Time A very large Excel spreadsheet available for download containing data points for all online activities, with user demographics, over time. Please read Tip Sheet (below) before downloading or using this spreadsheet. [http://pewinternet.org/Trend-Data/Usage-Over-Time.aspx](http://pewinternet.org/Trend-Da...
null
CC BY-SA 2.5
null
2010-11-09T19:00:39.677
2010-11-09T19:00:39.677
null
null
253
null
4358
2
null
4353
5
null
It is due to the default for argument `'seWithMean'` in `plot.gam()`, which is `FALSE`. This plots confidence intervals purely for the centred smooth function only, and there is no uncertainty at 0. If we add in the uncertainty in the mean then you get the more familiar confidence interval. Here's an example, but using...
null
CC BY-SA 2.5
null
2010-11-09T19:04:51.730
2010-11-09T19:04:51.730
null
null
1390
null
4359
2
null
4354
30
null
In fact, the answer is "no". Independence of the sample mean and variance characterizes the normal distribution. This was shown by Eugene Lukacs in ["A Characterization of the Normal Distribution", The Annals of Mathematical Statistics, Vol. 13, No. 1 (Mar., 1942), pp. 91-93.](http://www.jstor.org/stable/2236166) I d...
null
CC BY-SA 2.5
null
2010-11-09T19:09:47.093
2010-11-09T19:32:28.120
2010-11-09T19:32:28.120
null
null
null
4360
1
4362
null
12
1142
Let's say we are repeatedly tossing a fair coin, and we know number of heads and tails should be roughly equal. When we see a result like 10 heads and 10 tails for a total of 20 tosses, we believe the results and are inclined to believe the coin is fair. Well when you see a result like 10000 heads and 10000 tails for a...
Statistical argument for why 10,000 heads from 20,000 tosses suggests invalid data
CC BY-SA 2.5
null
2010-11-09T19:23:19.233
2010-12-12T17:50:29.487
2010-11-23T17:05:19.157
8
578
[ "confidence-interval", "binomial-distribution" ]
4361
2
null
4356
1
null
As fas as I know, it doesn't; but have not used it for a while. If I understand you well, you might want to look at package [mvpart](http://cran.at.r-project.org/package=mvpart) instead.
null
CC BY-SA 2.5
null
2010-11-09T19:31:10.937
2010-11-09T19:31:10.937
null
null
892
null
4362
2
null
4360
21
null
Assuming a fair coin the outcome of 10000 heads and 10000 tails is actually more likely than an outcome of 10093 heads and 9907 tails. However, when you say that a real experimenter is unlikely to obtain an equal number of heads and tails, you are implicitly invoking Bayes theorem. Your prior belief about a real exper...
null
CC BY-SA 2.5
null
2010-11-09T19:37:13.950
2010-11-09T19:37:13.950
null
null
null
null
4363
2
null
4356
1
null
Your terminology is confusing. Due you mean splits using more than one variable, or a tree that allows for a multivariate (as opposed to a univariate) response? I presume the latter. F. Tusell has pointed you to the mvpart package, which adds a multivariate criterion for node impurity that is evaluated for all possible...
null
CC BY-SA 2.5
null
2010-11-09T20:03:11.627
2010-11-09T20:03:11.627
null
null
1390
null
4364
1
4373
null
67
11408
A standardized Gaussian distribution on $\mathbb{R}$ can be defined by giving explicitly its density: $$ \frac{1}{\sqrt{2\pi}}e^{-x^2/2}$$ or its characteristic function. As recalled in [this](https://stats.stackexchange.com/questions/4354/distributions-other-than-the-normal-where-mean-and-variance-are-independent) q...
What is the most surprising characterization of the Gaussian (normal) distribution?
CC BY-SA 3.0
null
2010-11-09T20:19:21.667
2017-11-27T22:36:43.827
2017-11-27T22:36:43.827
128677
223
[ "probability", "normal-distribution", "mathematical-statistics", "characteristic-function" ]
4365
2
null
4364
19
null
Gaussian distributions are the only [sum-stable](http://en.wikipedia.org/wiki/Stable_distribution) distributions with finite variance.
null
CC BY-SA 2.5
null
2010-11-09T20:30:11.373
2010-11-09T20:30:11.373
null
null
795
null
4366
2
null
4364
30
null
The continuous distribution with fixed variance which maximizes [differential entropy](http://en.wikipedia.org/wiki/Differential_entropy) is the Gaussian distribution.
null
CC BY-SA 2.5
null
2010-11-09T20:36:44.480
2010-11-09T20:36:44.480
null
null
795
null
4367
1
4369
null
10
6117
I believe $p[x]$ is a probability distribution, where \begin{equation} p[x] = \frac{1}{\pi (1+x^2)} \end{equation} since it's positive everywhere and integrates to 1 on $-\infty, \infty$. The mean is 0 by symmetry, even though integrating $xp[x]$ on $-\infty, \infty$ does not converge. This is "suspicious" since $p...
Can a probability distribution have infinite standard deviation?
CC BY-SA 2.5
null
2010-11-09T20:59:38.060
2017-01-21T00:51:18.200
2010-11-10T09:57:21.213
8
null
[ "distributions", "standard-deviation" ]
4368
1
4370
null
2
5572
Why in the white test, we estimate auxiliary regression model of the squared residuals (in the original model) and not just plain residuals?
Auxiliary Model in the White Test
CC BY-SA 2.5
null
2010-11-09T21:05:20.573
2010-11-17T04:00:28.513
null
null
333
[ "heteroscedasticity" ]
4369
2
null
4367
12
null
To answer your question title: Yes, a probability distribution can have infinite standard deviation (see below). Your example is a special case of the [Cauchy distribution](http://en.wikipedia.org/wiki/Cauchy_distribution) whose mean or variance does not exist. Set the location parameter to 0 and the scale to 1 for the...
null
CC BY-SA 2.5
null
2010-11-09T21:07:46.350
2010-11-09T21:07:46.350
null
null
null
null
4370
2
null
4368
1
null
Because the White's test examines for heteroscedasticity by assuming that: $\sigma^2 = \beta_0 + x_1 \beta_1 + x_2 \beta_2 + ...$ (include squares and cross-product of covariates on the right hand side) In other words, White's test investigates if the error variance is heteroscedastic by regressing an estimate of $\si...
null
CC BY-SA 2.5
null
2010-11-09T21:41:21.690
2010-11-09T21:46:44.320
2010-11-09T21:46:44.320
null
null
null
4371
1
null
null
16
3227
In "The Elements of Statistical Learning" (2nd ed), p63, the authors give the following two formulations of the ridge regression problem: $$ \hat{\beta}^{ridge} = \underset{\beta}{\operatorname{argmin}} \left\{ \sum_{i=1}^N(y_i-\beta_0-\sum_{j=1}^p x_{ij} \beta_j)^2 + \lambda \sum_{j=1}^p \beta_j^2 \right\} $$ and $$ \...
Lagrangian relaxation in the context of ridge regression
CC BY-SA 2.5
null
2010-11-09T22:45:45.627
2010-11-10T08:58:59.530
null
null
439
[ "ridge-regression" ]
4372
2
null
4334
5
null
This is a very unusual state space model because the dynamics are included in both the observation equation (1') and the state equation (2'). Usually, the dynamics are only in the state equation and the observation equation is a linear function of the state vector. I don't think any of the state space implementations i...
null
CC BY-SA 2.5
null
2010-11-09T22:54:54.083
2010-11-09T22:54:54.083
null
null
159
null
4373
2
null
4364
45
null
My personal most surprising is the one about the sample mean and variance, but here is another (maybe) surprising characterization: if $X$ and $Y$ are IID with finite variance with $X+Y$ and $X-Y$ independent, then $X$ and $Y$ are normal. Intuitively, we can usually identify when variables are not independent with a sc...
null
CC BY-SA 2.5
null
2010-11-09T23:09:28.487
2010-11-09T23:09:28.487
null
null
null
null
4375
2
null
4360
12
null
I like Srikant's explanation, and I think the Bayesian idea is probably the best way to approach a problem like this. But here is another way to see it without Bayes: (in R) ``` dbinom(10, size = 20, prob = 0.5)/dbinom(10000, 20000, 0.5) ``` which is about 31.2 on my system. In other words, it is over 30 times more ...
null
CC BY-SA 2.5
null
2010-11-09T23:44:11.400
2010-11-09T23:44:11.400
null
null
null
null
4377
1
4378
null
1
848
I want to model the probability of a binary variable x given some predictor, d. It needs two parameters: - One parameter that sets the "break point", at which p(x=1 | d) = 0.5. - One parameter that sets the "softness", i.e. how abruptly the probability changes around the break point. (Sorry I'm sure there's standa...
Logistic regression with non-negative parameter
CC BY-SA 2.5
null
2010-11-10T02:00:03.560
2010-11-10T02:36:38.237
2010-11-10T02:29:39.833
1938
1938
[ "logistic", "classification" ]
4378
2
null
4377
5
null
Logistic regression satisfies your requirements -- two parameters controlling the mid-point and the rate of change. But there is no restriction on the domain of predictors. You can just fit a logistic regression using d as it is. However, if d is highly skewed (as it might be with that domain), then taking a log of d m...
null
CC BY-SA 2.5
null
2010-11-10T02:36:38.237
2010-11-10T02:36:38.237
null
null
159
null
4379
2
null
4371
3
null
The correspondence can most easily be shown using the [Envelope Theorem](http://books.google.com/books?id=NiQw5ZEw2IIC&lpg=PA177&dq=envelope%20theorem%20shadow%20price&pg=PA177#v=onepage&q=envelope%20theorem%20shadow%20price&f=false). First, the standard Lagrangian will have an additional $\lambda \cdot t$ term. This w...
null
CC BY-SA 2.5
null
2010-11-10T03:54:06.940
2010-11-10T03:54:06.940
null
null
493
null
4382
2
null
4364
-1
null
The expectation plus minus the standard deviation are the saddle points of the function.
null
CC BY-SA 2.5
null
2010-11-10T11:57:37.740
2010-11-10T11:57:37.740
null
null
253
null