Articles of sampling

estimate population percentage within an interval, given a small sample

Given a small sample from a normally-distributed population, how do I calculate the confidence that a specified percentage of the population is within some bounds [A,B]? To make it concrete, if I get a sample of [50,51,52] from a normally-distributed set, I should be able to calculate a fairly high confidence that 50% of the […]

Sampling from a $2$d normal with a given covariance matrix

How would one sample from the $2$-dimensional normal distribution with mean $0$ and covariance matrix $$\begin{bmatrix} a & b\\b & c \end{bmatrix}$$ given the ability to sample from the standard ($1$-dimensional) normal distribution? This seems like it should be quite simple, but I can’t actually find an answer anywhere.

Estimate function f(x) in high-dimensional space

I’m working on a problem of estimating a function $y=f(x): \mathbb{R}^d \rightarrow \mathbb{R}$. Namely, I have an unknown function $f(x)$ (like a black box), what I can do is to input $x^{(i)}$ to it, and obtain $y^{(i)}$ ($i=1,2,\cdots, N$). Then I get a dataset $(x^{(i)}, y^{(i)})$ and am able to fit a function on it. […]

Sampling $Q$ uniformly where $Q^TQ=I$

(This is related to this question) $Q \in \mathbb{R}^{n\times k}$ is a random matrix where $k<n$ and the columns of $Q$ are orthogonal (i.e. $Q^T Q = I$). To examine $E(QQ^T)$, I conducted monte carlo simulations (using matlab): [Q R] = qr(randn(n,k),0); In other words, I just sampled a $\mathbb{R}^{n\times k}$ matrix from a standard […]

Why is there a difference between a population variance and a sample variance

Sorry if this answer is simple but I was wondering why is there a difference between a population variance and a sample variance? I understand The variance is calculated as: $$\text{Var} = \frac{1}{N}(x_i-\mu)^2$$ and the sample variance is computed as $$\text{Var}_s = \frac{1}{N-1}(x_i-\mu)^2$$ In real world data sets would you use the sample variance most […]

What does it mean to sample, in measure theoretic terms?

Suppose I have some random variable $X$ defined on some probability space $(\Omega, \mathcal{F}, \mathbb{P})$. What does it mean, in measure theoretic terms, to draw a sample from $X$? When $\Omega$ is finite, things make sense: we might say nature rolls its dice and draws an $\omega \in \Omega$ according to $\mathbb{P}$, and our sample […]

Sampling error with weighted mean

I am studying statistics and I am wondering when it comes to standard error or a sampling if the calculation changes when there are weights added. I have a weighted mean: $$\mu_{w} = \dfrac{\sum_{i=1}^Nw_ix_i}{\sum_{i=1}^Nw_i}$$ and a weighted variance calculated by: $$s^2_{w}=\dfrac{\sum_{i=1}^Nw_i}{(\sum_{i=1}^Nw_i)^2-\sum_{i=1}^Nw_i^2}\cdot \sum_{i=1}^N(x_i-\mu)^2$$ is the sampling error still calculated as $$\text{SE}=\sqrt{\dfrac{s^2_{w}}{n}}$$

Uniform sampling of points on a simplex

I have this problem: I’m trying to sample the relation $$ \sum_{i=1}^N x_i = 1 $$ in the domain where $x_i>0\ \forall i$. Right now I’m just extracting $N$ random numbers $u_i$ from a uniform distribution $[0,1]$ and then I transform them into $x_i$ by using $$ x_i = \frac{u_i}{\sum_{i=1}^N{u_i}}. $$ This is correct but […]

What is the distribution of gaps?

Randomly select $n$ numbers from the universe $\{1,2\dots,m\}$ with or without replacement, and sort the numbers in ascending order. We can get a list of number $\{a_1,a_2,\dots,a_n\}$, and then we can get the difference between two consecutive numbers and get the gap list: $\{a_1, a_2-a_1,\dots ,a_n-a_{n-1}\}$ So my question is: what is the distribution of […]

Probability to choose specific item in a “weighted sampling without replacement” experiment

Given $n$ items with weight $w_n$ each — what is the probability that item $i$ is chosen in a $k$-out-of-$n$ “weighted random sampling without replacement” experiment? Can a closed-form solution that depends only on $w_i / w_\cdot$ be derived ($w_\cdot = \sum_j w_j$.)? EDIT: A solution that depends only on $w_i / w_\cdot$ is impossible. […]