As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [sampling]

Creating samples from a well-specified population using a probabilistic method and/or producing random numbers from a specified distribution. As this tag is ambiguous, please consider [survey-sampling] for the former and [monte-carlo] or [simulation] for the latter. For questions regarding creating random samples from known distributions, please consider using the [random-generation] tag.

Filter by
Sorted by
Tagged with
297 votes
16 answers
105k views

Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean?

It seems that through various related questions here, there is consensus that the "95%" part of what we call a "95% confidence interval" refers to the fact that if we were to exactly replicate our ...
Mike Lawrence's user avatar
99 votes
3 answers
63k views

Can someone explain Gibbs sampling in very simple words? [duplicate]

I'm doing some reading on topic modeling (with Latent Dirichlet Allocation) which makes use of Gibbs sampling. As a newbie in statistics―well, I know things like binomials, multinomials, priors, etc.―,...
Thea's user avatar
  • 993
85 votes
5 answers
34k views

Central limit theorem for sample medians

If I calculate the median of a sufficiently large number of observations drawn from the same distribution, does the central limit theorem state that the distribution of medians will approximate a ...
user1728853's user avatar
  • 1,047
63 votes
5 answers
100k views

Is a sample covariance matrix always symmetric and positive definite?

When computing the covariance matrix of a sample, is one then guaranteed to get a symmetric and positive-definite matrix? Currently my problem has a sample of 4600 observation vectors and 24 ...
Morten's user avatar
  • 1,028
57 votes
5 answers
31k views

Statistical inference when the sample "is" the population

Imagine you have to do reporting on the numbers of candidates who yearly take a given test. It seems rather difficult to infer the observed % of success, for instance, on a wider population due to the ...
pbneau's user avatar
  • 1,241
55 votes
8 answers
13k views

Is sampling relevant in the time of 'big data'?

Or more so "will it be"? Big Data makes statistics and relevant knowledge all the more important but seems to underplay Sampling Theory. I've seen this hype around 'Big Data' and can't help wonder ...
PhD's user avatar
  • 14.2k
47 votes
4 answers
86k views

How to sample from a normal distribution with known mean and variance using a conventional programming language?

I've never had a course in statistics, so I hope I'm asking in the right place here. Suppose I have only two data describing a normal distribution: the mean $\mu$ and variance $\sigma^2$. I want to ...
Fixee's user avatar
  • 615
46 votes
1 answer
89k views

Why is the sampling distribution of variance a chi-squared distribution?

The statement The sampling distribution of the sample variance is a chi-squared distribution with degree of freedom equals to $n-1$, where $n$ is the sample size (given that the random variable of ...
Remi.b's user avatar
  • 4,892
45 votes
6 answers
254k views

Why does increasing the sample size lower the (sampling) variance?

Big picture: I'm trying to understand how increasing the sample size increases the power of an experiment. My lecturer's slides explain this with a picture of 2 normal distributions, one for the null-...
user2740's user avatar
  • 1,336
41 votes
1 answer
14k views

Bootstrapping vs Bayesian Bootstrapping conceptually?

I'm having a trouble understanding what a Bayesian Bootstrapping process is, and how that would differ from your normal bootstrapping. And if someone could offer an intuitive/conceptual review and ...
SpicyClubSauce's user avatar
40 votes
3 answers
34k views

Explanation of finite population correction factor?

I understand that when sampling from a finite population and our sample size is more than 5% of the population, we need to make a correction on the sample's mean and standard error using this formula: ...
Sara's user avatar
  • 1,447
38 votes
3 answers
9k views

What percentage of a population needs a test in order to estimate prevalence of a disease? Say, COVID-19

A group of us got to discussing what percentage of a population needs to be tested for COVID-19 in order to estimate the true prevalence of the disease. It got complicated, and we ended the night (...
Industrademic's user avatar
38 votes
5 answers
38k views

Sampling for Imbalanced Data in Regression

There have been good questions on handling imbalanced data in the classification context, but I am wondering what people do to sample for regression. Say the problem domain is very sensitive to the ...
someben's user avatar
  • 768
36 votes
3 answers
32k views

Generating data with a given sample covariance matrix

Given a covariance matrix $\boldsymbol \Sigma_s$, how to generate data such that it would have the sample covariance matrix $\hat{\boldsymbol \Sigma} = \boldsymbol \Sigma_s$? More generally: we are ...
Kees Mulder's user avatar
  • 1,589
34 votes
1 answer
24k views

What is the standard error of the sample standard deviation?

I read from there that the standard error of the sample variance is $$SE_{s^2} = \sqrt{\frac{2 \sigma^4}{N-1}}$$ What is the standard error of the sample standard deviation? I'd be tempted to guess ...
Remi.b's user avatar
  • 4,892
33 votes
7 answers
9k views

What is the name of the statistical fallacy whereby outcomes of previous coin flips influence beliefs about subsequent coin flips?

As we all know, if you flip a coin that has an equal chance of landing heads as it does tails, then if you flip the coin many times, half the time you will get heads and half the time you will get ...
oggmonster's user avatar
33 votes
5 answers
10k views

Why do political polls have such large sample sizes?

When I watch the news I've noticed that the Gallup polls for things like presidential elections have [I assume random] sample sizes of well over 1,000. From what I remember from college statistics ...
samplesize999's user avatar
33 votes
2 answers
20k views

Drawing from Dirichlet distribution

Let's say we have a Dirichlet distribution with $K$-dimensional vector parameter $\vec\alpha = [\alpha_1, \alpha_2,...,\alpha_K]$. How can I draw a sample (a $K$-dimensional vector) from this ...
user1315305's user avatar
  • 1,279
32 votes
11 answers
8k views

The "Amazing Hidden Power" of Random Search?

I have the following question that compares random search optimization with gradient descent optimization: Based on the (amazing) answer provided over here Optimization when Cost Function Slow to ...
stats_noob's user avatar
  • 7,158
32 votes
5 answers
7k views

Strategies for teaching the sampling distribution

The tl;dr version What successful strategies do you employ to teach the sampling distribution (of a sample mean, for example) at an introductory undergraduate level? The background In September I'll ...
smillig's user avatar
  • 2,383
32 votes
3 answers
29k views

What does "independent observations" mean?

I'm trying to understand what the assumption of independent observations means. Some definitions are: "Two events are independent if and only if $P(a \cap b) = P(a) * P(b)$." (Statistical Terms ...
RubenGeert's user avatar
32 votes
2 answers
740 views

StackExchange fires a moderator, and now in response hundreds of moderators resign: is the increase in resignations statistically significant?

I am doing a study on StackExchange. The management of StackExchange has demodded (for unclear reasons) a moderator, and now the network is on fire. Currently many moderators resign or suspend their ...
Sextus Empiricus's user avatar
31 votes
3 answers
28k views

Can non-random samples be analyzed using standard statistical tests?

Many clinical studies are based on non-random samples. However, most standard tests (e.g. t-tests, ANOVA, linear regression, logistic regression) are based on the assumption that samples contain "...
KuJ's user avatar
  • 1,566
30 votes
1 answer
6k views

Computation of the marginal likelihood from MCMC samples

This is a recurring question (see this post, this post and this post), but I have a different spin. Suppose I have a bunch of samples from a generic MCMC sampler. For each sample $\theta$, I know the ...
lacerbi's user avatar
  • 5,096
28 votes
8 answers
5k views

How to estimate how many people attended an event (say, a political rally)?

A student asked me today, "How do they know how many people attended a large group event, for example, the Stewart/Colbert 'Rally to Restore Sanity' in Washington D.C.?" News outlets report estimates ...
user avatar
28 votes
3 answers
9k views

What if your random sample is clearly not representative?

What if you take a random sample and you can see it is clearly not representative, as in a recent question. For example, what if the population distribution is supposed to be symmetric around 0 and ...
Joel W.'s user avatar
  • 3,126
27 votes
4 answers
4k views

Probability of not drawing a word from a bag of letters in Scrabble

Suppose you had a bag with $n$ tiles, each with a letter on it. There are $n_A$ tiles with letter 'A', $n_B$ with 'B', and so on, and $n_*$ 'wildcard' tiles (we have $n = n_A + n_B + \ldots + n_Z + n_*...
shabbychef's user avatar
  • 14.2k
25 votes
7 answers
11k views

Can someone help to explain the difference between independent and random?

In statistics, does independent and random describe the same characteristics? What's the difference between them? We often come across the description like "two independent random variables" or "...
tiantianchen's user avatar
  • 2,021
25 votes
2 answers
5k views

Did I just invent a Bayesian method for analysis of ROC curves?

Preamble This is a long post. If you're re-reading this, please note that I've revised the question portion, though the background material remains the same. Additionally, I believe that I've devised ...
Sycorax's user avatar
  • 86.4k
24 votes
2 answers
1k views

The paradox of i.i.d. data (at least for me)

As far as my aggregate (and scarce) knowledge on statistics permits, I understood that if $X_1, X_2,..., X_n$ are i.i.d. random variables, then as the term implies they are independent and identically ...
Cupitor's user avatar
  • 1,605
24 votes
2 answers
11k views

Gibbs sampling versus general MH-MCMC

I have just been doing some reading on Gibbs sampling and Metropolis Hastings algorithm and have a couple of questions. As I understand it, in the case of Gibbs sampling, if we have a large ...
Luca's user avatar
  • 4,530
23 votes
5 answers
6k views

Why we don’t make use of the t-distribution for constructing a confidence interval for a proportion?

To calculate the confidence-interval (CI) for mean with unknown population standard deviation (sd) we estimate the population standard deviation by employing the t-distribution. Notably, $CI=\bar{X} \...
Abhijit's user avatar
  • 333
23 votes
1 answer
2k views

Should sampling for logistic regression reflect the real ratio of 1's and 0's?

Suppose I want to create logistic regression model which can estimate a probability of occurrence of some animal species living on trees based on characteristics of trees (f.e. height). As always, my ...
Ladislav Naďo's user avatar
22 votes
2 answers
8k views

What are some techniques for sampling two correlated random variables?

What are some techniques for sampling two correlated random variables: if their probability distributions are parameterized (e.g., log-normal) if they have non-parametric distributions. The data are ...
Pete's user avatar
  • 597
22 votes
4 answers
8k views

An unbiased estimate of the median

Suppose we have a random variable $X$ supported on $[0,1]$ from which we can draw samples. How can we come up with an unbiased estimate of the median of $X$? We can, of course, generate some samples ...
robinson's user avatar
  • 413
21 votes
4 answers
20k views

Calculating required sample size, precision of variance estimate?

Background I have a variable with an unknown distribution. I have 500 samples, but I would like demonstrate the precision with which I can calculate variance, e.g. to argue that a sample size of 500 ...
Abe's user avatar
  • 3,781
21 votes
2 answers
5k views

Sampling from von Mises-Fisher distribution in Python?

I am looking for a simple way to sample from a multivariate von Mises-Fisher distribution in Python. I have looked in the stats module in scipy and the numpy module but only found the univariate von ...
mic's user avatar
  • 4,168
21 votes
4 answers
22k views

Are "random sample" and "iid random variable" synonyms?

I have been facing hard time understanding meaning of "random sample" as well as "iid random variable". I tried to find out the meaning from several sources, but just got more and more confused. I am ...
Silent's user avatar
  • 479
21 votes
4 answers
6k views

How can I estimate unique occurrence counts from a random sampling of data?

Let's say I have a large set of $S$ values which sometimes repeat. I wish to estimate the total number of unique values in the large set. If I take a random sample of $T$ values, and determine that ...
sanity's user avatar
  • 370
21 votes
1 answer
14k views

Difference between Randomization test and Permutation test

In the literature the terms Randomization and Permutation are used interchangeably. With many authors stating "Permutation (aka randomization) tests", or vice versa. At best I believe the difference ...
user avatar
21 votes
2 answers
2k views

Simulating time-series given power and cross spectral densities

I am having trouble generating a set of stationary colored time-series, given their covariance matrix (their power spectral densities (PSDs) and cross-power spectral densities (CSDs)). I know that, ...
immarried's user avatar
  • 311
20 votes
3 answers
1k views

How to sample from $c^a d^{a-1} / \Gamma(a)$?

I want to sample according to a density $$ f(a) \propto \frac{c^a d^{a-1}}{\Gamma(a)} 1_{(1,\infty)}(a) $$ where $c$ and $d$ are strictly positive. (Motivation: This could be useful for Gibbs ...
N F's user avatar
  • 828
20 votes
1 answer
11k views

MCMC on a bounded parameter space?

I am trying to apply MCMC on a problem, but my priors(in my case they are $\alpha\in[0,1],\beta\in[0,1]$)) are restricted to an area? Can I use normal MCMC and ignore the samples that fall outside of ...
Cupitor's user avatar
  • 1,605
20 votes
5 answers
25k views

Why at all consider sampling without replacement in a practical application?

Sampling with replacement has two advantages over sampling without replacement as I see it: 1) You don't need to worry about the finite population correction. 2) There is a chance that elements from ...
Raffael's user avatar
  • 1,594
20 votes
1 answer
392 views

Sampling model for crowdsourced data?

I'm working on an open health survey application, planned to be used in developing country. The basic idea is that survey interviews are crowdsourced - they are performed by unorganized volunteers ...
al-Amjad Tawfiq Isstaif's user avatar
19 votes
4 answers
1k views

How to generate a non-integer amount of consecutive Bernoulli successes?

Given: A coin with unknown bias $p$ (Head). A strictly positive real $a > 0$. Problem: Generate a random Bernoulli variate with bias $p^{a}$. Does anyone know how to do this? For instance, when ...
Pedro A. Ortega's user avatar
19 votes
2 answers
50k views

What is the difference between sample variance and sampling variance?

What is the difference between sample variance and sampling variance? They seem same. Aren't they?
ilhan's user avatar
  • 964
19 votes
1 answer
42k views

Generating random samples from a custom distribution

I am trying to generate random samples from a custom pdf using R. My pdf is: $$f_{X}(x) = \frac{3}{2} (1-x^2), 0 \le x \le 1$$ I generated uniform samples and then tried to transform it to my custom ...
Anand's user avatar
  • 1,192
18 votes
3 answers
2k views

Do optimization techniques map to sampling techniques?

From any generic sampling algorithm, one can derive an optimization algorithm. Indeed, to maximize an arbitrary function $f: \textbf{x} \rightarrow f(\textbf{x})$, it suffices to draw samples from $g ...
Arthur B.'s user avatar
  • 2,730
17 votes
3 answers
486 views

Sampling from $x^2\phi(x)$?

Given that $\int_{-\infty}^{\infty}x^2\phi(x)dx < \infty$, where $\phi(x)$ is the standard normal probability density function, we can define the new pdf $$f(x) = \frac{x^2\phi(x)}{\int_{-\infty}^{\...
motto's user avatar
  • 173

1
2 3 4 5
63