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
1 vote
0 answers
5 views

ABC (Approximate Bayesian Computation) Sampling, Simulating data from Complex models

In ABC sampling methods, Rejection, MCMC and SMC, when we sample potential parameter values from the prior/proposal, we then use those parameters on our model and simulate data values. This can be ...
0 votes
0 answers
14 views

Sample from a piecewise exponential distribution

Given a distribution $p(x)\propto \exp(\min_{i=1}^N [a_i^Tx + b_i])$, where $x$ and $a_i$ are both D-dimensional vectors, $b_i$ is a scalar, and $(a_i,b_i)$ are known. How can I sample from it? This ...
1 vote
1 answer
63 views

Generate Correlated Bernoulli Samples in Python

Suppose I have $M$ Bernoulli distributions with parameters $p_i$, pairwise correlation $\rho_{ij}$ for $i\neq j$. I would like to generate $N$ samples from the joint distribution. The case of $M=2$ ...
2 votes
1 answer
27 views

Sampling a mortality table

I have some mortality table: age_range_0 yearly_probability_0 age_range_1 yearly_probability_1 ... age_range_k yearly_probability_k over_range_k yearly_probability_over For example: [35,45) 0.001 [45-...
0 votes
0 answers
16 views

Calculating true/population standard deviation from bootstrap standard deviation/standard error

I am using the coffee_ratings dataset to do a proof-of-concept calculation to estimate the population (i.e., coffee_ratings) ...
3 votes
1 answer
234 views

Gibbs Sampling vs. Using Raw Probability in Contrastive Divergence

In Hinton's Practical Guide to Training Restricted Boltzmann Machines, Section 3, he discusses different situations in which one should take a sample from the Gibbs sampling process, and other ...
5 votes
1 answer
176 views

Sampling with specified covariance matrix and distribution

Given a positive semi-definite $n\times n$ matrix $C$ I would like to construct $n$ random variables $X_1,\dots,X_n$ drawn from $n$ fixed distributions such that $\mathrm{corr}(X_i,X_j) = C_{ij}$. I ...
7 votes
4 answers
1k views

Is Central Limit Theorem about multiple samples or just one?

I've studied CLT and my understanding is that multiple samples will generate a normal distribution centered in the mean of the population. However, today, one post in Linkedin was saying that "...
0 votes
1 answer
49 views

permutation test in edgeR

I have a simple RNA-seq experiment with treatment and control, each with 3 biological repeats. I run my data through edgeR and obtained differentially expressed genes (DEGs). Due to the low sample ...
0 votes
0 answers
30 views

Sampling from a binomial and get stuck in boundaries

I am trying to use the Metropolis-Hasting in order to obtain a sample for X that is a vector of length N of values that go from 0 to K (in this case K=3). So X ~ Binom(K, p) and p ~ Beta(1,1). For ...
0 votes
0 answers
12 views

Predict quality of a product, from production line, by looking at a sample instead of the whole batch

I have a machine that produces cartons. Every batch that is produced is of 3000 cartons. I want to determine what percentage of cartons are GOOD and what percentage are NOT GOOD ( marks on the carton, ...
0 votes
1 answer
84 views

Why weighted importance sampling is a biased estimator?

By simple math, we can have $$ E_P[f(X)] = \sum_X f(x)p(x) = \sum_X f(x)\frac{p(x)}{q(x)}q(x) = E_Q[f(X)\frac{P(X)}{Q(X)}], $$ which can be approximated by Monte Carlo sampling in two ways. 1. Normal (...
0 votes
0 answers
6 views

Sample from a population such that it follows a given Dirichlet distribution

I have a store of probability scores (~ around 2 million scores) in the following format - [[0.1,0.2,0.7],[0.4,0.15,0.45], ...] I want to sample from these scores ...
0 votes
1 answer
334 views

Two-sample t-test between coefficient from regression on two different samples

I am trying to perform a two sample t-test on the regression coefficients for event dummies between two portfolio's (portfolio 1: Top portfolio and portfolio 2: Bad portfolio) The Do file I wrote for ...
2 votes
1 answer
15 views

Estimating Marketing Contribution from Opted-In Users

I'm trying to estimate how much marketing contributes to the usage of our product, but because of consent requirements, I can only collect data on a subset of users - the ones who have consented to us ...
0 votes
0 answers
9 views

Sampling: when is multivariate random variable interpretation dissimilar to repeated realization of single random variable interpretation

After reading many different posts on this site regarding the relationship between random variables and samples, I still have one lingering question (my apologies if I've missed any post explicitly ...
0 votes
0 answers
117 views

Solutions to downsampling imbalanced time series dataset in time series forecasting for regression model

I have an imbalanced time series dataset for use in a time series forecasting problem for regression (forecast 1 video of 24 hour data (144 7x7 images) given a 1 video of 24 hour data (144 7x7 images))...
0 votes
0 answers
27 views

Do I use $P(y_t|y_{1:t-1})$ instead of $P(y_t|z_{t},y_{1:t-1})$ for prediction in a Hidden Markov Model?

I am confused what to sample for getting the prediction $y_{t}$ if I have access to the previous observations $y_{1:t-1}$ and the hidden states $z_{1:t}$. I want to predict the observation at time $t$ ...
2 votes
1 answer
121 views

Generate Gamma distributed values with upper bound

I need to generate N random numbers from a Gamma distribution, but with an upper bound Pmax using Matlab. Right now, I see two ...
2 votes
1 answer
29 views

Biased Sampling from a Non-Normal Dataset

For my analysis, I'm interested in a particular subset from a non-normally distributed population. I would therefore like to generate a sample from that population. The sample will have drastically ...
1 vote
4 answers
292 views

Compare two datasets and whether they agree

I have two datasets and they both have the same set of independent variables: 9 of them are on scale from 0 till 100 3 of them are categorical(1 with two types categories, 1 with three types of ...
2 votes
0 answers
144 views

Metropolis-Hastings to sample from dependent random variables

Imagine the goal is sampling from $p(X,Y)$ and X and Y are dependent real-valued random variables, i.e. $p(X|Y)\neq p(X)$. Now the question is how can we apply Metropolis-Hastings algorithm on the ...
0 votes
0 answers
17 views

How to sample with the 1-norm?

I am currently working on ridge regression, which can be interpreted using Bayesian statistics (DOI: 10.1016/j.electacta.2015.03.123). In particular, I know that the maximum-a-posteriori (MAP) ...
1 vote
0 answers
46 views

Sampling from a very high dimensional Gaussian

I would like to a sample from a Gaussian $N(0,K)$ where $K$ is a kernel gram matrix, so that $K=[K_{ij}]$ with $K_{ij} = k(x_i,x_j)$ for some positive definite function $k$. The first issue is that ...
1 vote
1 answer
252 views

Why can stratified sampling to testing/training sets on strata that contain less than 10% of the entire dataset be statistically risky?

I'm trying to split my data into a testing and a training set. There are lots of variables that I want to ensure are well represented in both the training and testing sets (say, 15 covariates). But ...
0 votes
0 answers
17 views

Sampling in case of imbalanced dataset [duplicate]

From a course of AI for Medical Diagnosis, it is explained that validation and test sets should be balanced, 50-50 cases of both cases 0 and 1, so that the performance of the model can be assessed. ...
1 vote
1 answer
23 views

randomisation issue/crisis

I have randomized into three groups using a randomization aid and groups were examined at 2 time points. however in the analysis found that there was a significant difference at baseline in one of the ...
2 votes
1 answer
1k views

Using SMOTE with grouped, paneled, or categorical data?

Let's say that I am building a classifier on imbalanced data. A sample of the data set looks like: ...
14 votes
1 answer
3k views

How to generate 2 correlated Beta random variables

I was wondering if it might be possible to generate 2 correlated $Beta$ random variables? In other words, I want to generate two Beta random variables which can be said to have come from two Beta ...
8 votes
5 answers
1k views

Why do Denoising Diffusion Probabilistic Models (DDPM) add noise according to $\sigma_t$ during sampling?

Reading about Denoising Diffusion Probabilistic Models (DDPM) the paper (algorithm 2 - sampling) states that the sampling goes according to... $$ x_{t-1} = \frac{1}{\sqrt{\alpha_t}}\left( x_t - \frac{...
2 votes
1 answer
163 views

Can Random Sampling Help Improve Data Quality Problems?

I am working with a hospital dataset. Patients come in and provide information (i.e. var1, var2, var3) about themselves and their partner (if they have one). Later, their partner also come and provide ...
0 votes
0 answers
15 views

Is this a correct way of resampling the MCMC chain?

Please understand I am not familiar to the statistical languages. All I want is to resample a probability distribution from an existing sample drawn from another distribution using MCMC, without ...
1 vote
0 answers
11 views

Can I use a subset defined from characteristics of individuals from original sample as a sample itself?

I have stratified random sample of individuals which represents a large geography. Some of these individuals are self-employed. Can I take subset of these surveyed individuals who are self-employed ...
0 votes
1 answer
92 views

How on earth is a random sample representative of the entire population?

Suppose there are 10k people in the population. You want to find out how many of them brush their teeth. You take 1k of them entirely randomly. They all say "yes". But the rest 9k say "...
2 votes
1 answer
36 views

Random Sampling from Distribution

I have data of lengths ranging from 25 to 135 and I would like to determine the distribution of this data so that I can randomly generate values from this distribution. My data contains 443 values, ...
2 votes
1 answer
51 views

How to get sample size for purposive sampling?

How do I get a sample size if I'm using purposive sampling for my study? It's a sensory evaluation for a food product development but there are exclusion criteria so my adviser suggested to use ...
5 votes
1 answer
490 views

Does the Law of Large Numbers work better for some Distributions? [closed]

Here are two popular principles in Statistics: 1) Law of Large Numbers: If $X$ is a random variable with a probability density function $f(x)$ and an expected value $E[X] = \mu$. If we take a sample ...
2 votes
1 answer
28 views

Should I normalise my dependent variable by a measured variable that I want to be constant?

This is a question about the validity of applying the results of a statistical test, and unfortunately will require some explanation of the experiment in question. Essentially, I want to measure how ...
5 votes
1 answer
1k views

Is it valid to use latin-hypercube sampling in parallel sampling?

I am sampling from a model 10 times in series, doing this in 50 parallel processes. I am using LHS to generate samples each set of ten samples, although each of the 50 parallel runs' samples are ...
3 votes
3 answers
369 views

Gaps in a histogram in sampling distribution

This histogram shows the sampling distribution of 5000 sample proportions each based on 50 persons. Why are there gaps between the bars in the histogram?
1 vote
1 answer
395 views

Can you use the isolation forest algorithm on a large sample size?

I've been using the scikit learn sklearn.ensemble.IsolationForest implementation of the isolation forest to detect anomalies in my datasets that range from 100s of ...
5 votes
2 answers
3k views

Linear regression - iterative approach

I have a single output variable $y$ and a number of inputs $x_1$, $x_2$, etc. These are time series. Each $x_i$ explains the changes in $y$ in specific circumstances, and the goal is to have a linear ...
5 votes
3 answers
1k views

Why is random sampling good?

First, is there any theory for random sampling being optimal? Second, consider the following example. Suppose there are two balls in an urn. Their colors can be either white or red. So there are three ...
1 vote
3 answers
873 views

What is meant by practical significance and statistical significance? How do we distinguish these concepts? [duplicate]

I am unable to understand content reported in : Practical vs Statistical significance Statistical significance-testing implies whether a sample-statistic matches with population estimate of effect-...
3 votes
3 answers
515 views

Why class stratified sampling is not compatible for naïve bayesian modeling, if sampling is used?

I read a book recently and it mentioned related to prior probability of naïve bayesian: "Since the probability of an outcome is calculated from the data set, it is important that the data set ...
2 votes
2 answers
73 views

Is R's weighted sample without replacement function misleading?

Background The 2023 article "Remarks on some misconceptions about unequal probability sampling without replacement" by Tillé suggests the sample function ...
0 votes
1 answer
47 views

Statistical testing on non-random sample?

I am working with a non-random sample in an observational study but would like to do statistical testing to show certain trends and processes. Statistical tests assume random sampling, which is not ...
0 votes
1 answer
267 views

Sampling from distribution using MATLAB / statistical packages like R

I am trying to read Latent Dirichlet Allocation model for Topic modeling. But I am not able to understand how they sample values from a distribution, draw a distribution from a process. In particular ...
1 vote
1 answer
65 views

Sample many correlated random matrices all with the same pairwise correlation coefficient

I am looking to generate $K$ different correlated random matrices, of which the elements all have the same pairwise correlation coefficient. That is, let $A_1, A_2, \ldots, A_K$ be $N \times N$ random ...
6 votes
2 answers
610 views

Producing samples from exponential family conditional on minimal sufficient statistic

Suppose I have a distribution which belongs to an exponential family, of the form $$p(x) = \frac{\exp(-\sum_k \eta_k T_k(x))}{Z},$$ where $T_k(x)$ are a fixed set of sufficient statistics, $\eta_k$ ...

1
2 3 4 5
65