17 votes

Why is random sampling good?

You seem to be conflating the idea of random sampling with the separate question of whether objects are sampled with our without replacement. The first method you describe is a simple-random-sample ...
user avatar
  • 94.6k
13 votes

What distribution to sample X from to get an uniform distribution in Y?

maybe i misunderstand your question, but why don't you sample from a uniform distribution and set X to the arccos of your samples? in R, this would be ...
user avatar
  • 391
12 votes

What distribution to sample X from to get an uniform distribution in Y?

I suspect the difficulty you are having is in the generation of $x$ from $f(x) \propto |\sin(x)|$. I have coded a very simple acceptance-rejection random number generator in R that will do the job: <...
user avatar
  • 32.8k
7 votes

Can I take a random sample of my very large data set to overcome non-independence?

I will add a couple of points to Tim's answer, focussing on the original question, which was "My question is - is this valid? Am I missing anything here?". I think the approach can be valid, ...
user avatar
4 votes
Accepted

How to sample from a custom heavy tailed (e.g. custom Cauchy) distribution?

Because $Z$ is symmetric around $0$ and $|Z|$ has a generalized beta prime distribution, there is a simple algorithm to obtain random values of $Z$ efficiently: Step 1: Draw a random value $Y$ from a ...
user avatar
  • 287k
4 votes
Accepted

Can I take a random sample of my very large data set to overcome non-independence?

If you downsample time-series data it would not remove the dependence, it would just dilute it. Say that your data follows the relationship $$ y_{t+1} = f(y_{t}) + \varepsilon_{t+1} $$ so the current ...
user avatar
  • 113k
3 votes

Markov Chain Monte Carlo with known normalisation

Another way of looking at the issue of approximating$$\mathfrak I = \sum_{x\in\mathfrak X} p(x)O(x)$$by stochastic techniques is to aim at adding primarily large values of $p(x)O(x)$. Assuming no ...
user avatar
  • 91.9k
3 votes

Why is random sampling good?

The Central Limit Theorem may be the theory you're looking for. It shows that random sample means follow a Normal distribution (even if the population isn't Normally distributed) and that allows us ...
user avatar
  • 139
3 votes
Accepted

Logistic regression simulation with respect to event occurrence (prevalence)

You have an array of explanatory variables $(x_1, x_2, \ldots, x_n)$ ($n=20000$) and a model that assigns a probability to each $x_i.$ You seek a subarray of these variables that has a mean ...
user avatar
  • 287k
2 votes

Why is random sampling good?

A non-random sample may be good for a particular purpose, or it may be bad. A random sample can be shown with high probability to be "good" for many purposes. In particular, in statistics, ...
user avatar
  • 610
1 vote

What distribution to sample X from to get an uniform distribution in Y?

The question doesn't require a specific programming language, which is fine, but I noted that the OP's plot looks like the default style of matplotlib. @jbowman has given a useful r implementation. ...
user avatar
  • 3,466
1 vote
Accepted

Choosing an equal number of samples from each strata - what is this called?

This would be a type of "disproportional sampling". In particular it would be "equal allocation". I've never tried it, but from this Stack Overflow question, https://stackoverflow....
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible