Questions tagged [statistical-sampling]
33 questions
5
votes
1 answer
What does it mean to have a transient state or a transient phase in an Ising model?
I downloaded a simple implementation of the Ising model in C# from this link.
I have understood more or less the entire code except the following routine:
private static void transient_results(double T)
{
for (int a = 1; a <=…

user366312
- 16,949
- 65
- 235
- 452
5
votes
1 answer
Math overflow error in scipy Anderson-Darling test for k-samples
I would like to compare pairs of samples with both Kolmogorov-Smirnov (KS) and Anderson-Darling (AD) tests. I implemented this with scipy.stats.ks_2samp and scipy.stats.anderson_ksamp respectively. I would expect a low statistic for similar samples…

michael
- 371
- 3
- 12
4
votes
1 answer
Sample to Create Uniform Distribution from Non-Uniform Data
Given a dataset with a non-uniform distribution (highly peaked) I want to resample to create a new dataset with an approximately uniform distribution. My approach:
Divide the data into bins.
Target bin level = Smallest number of samples per bin,…

Ron Cohen
- 2,815
- 5
- 30
- 45
3
votes
2 answers
Evaluating the resulted simulated data
I am simulating data using the Rejection method where the density function of X is given by f(x)= C * e^(x) for all x in [0,1]. I defined g(x) = 1 and C to be the maximum of f(x) which is equal to 1/(e-1).
I used the following code to simulate…

adam
- 43
- 5
2
votes
2 answers
Turing.jl estimators show proposal will be rejected due to numerical errors
Model in Turing.jl seems to be stuck in errors with
Warning: The current proposal will be rejected due to numerical error(s).
│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)
for NUTS(), HMCDA() and sometimes HMC() sampling methods. I…

Kevin
- 149
- 6
2
votes
1 answer
How to implement rejection sampling in R?
I have a dataset of rows of genes each with their gene length, I am looking to sample from these genes by their gene length distribution using rejection sampling - as I have too many genes in this dataset that are too small to enter further analysis…

DN1
- 234
- 1
- 13
- 38
2
votes
0 answers
PyMC3 Bayesian Inference with NUTS initialization
I'm trying to implement a simple Bayesian Inference using a ODE model. I want to use the NUTS algorithm to sample but it gives me an initialization error. I do not know much about the PyMC3 as I'm new to this. Please take a look and tell me what is…

Arjun Devdas
- 59
- 5
2
votes
2 answers
Multiple sampling inside an R function
I am trying to make a function that in the end will run multiple machine learning algorithms on my data set. I have the first little bit of my function below and a small sample of data.
The problem i am running into is with sampling my data into…

Clinton Woods
- 249
- 1
- 2
- 11
2
votes
2 answers
How to take a Probability Proportional to Size (PPS) Unequal Probability sample using R?
I have very little programming experience, but I'm working on a statistics project and would like to generate an unequal probability sample where the inclusion probability of a unit is based on its size (PPS).
Basically, I have two datasets:
ds1…

Jessica Wu
- 21
- 3
2
votes
1 answer
Acceptance-rejection for beta distribution R code
I’m using the acceptance-rejection method for beta distribution with g(x) = 1, 0 ≤ x ≤ 1.
The function is:
f(x) = 100x^3(1-x)^2.
I want to create an algorithm to generate data from this density function.
How can I estimate P(0 ≤ X ≤ 0.8) with k =…

Mark
- 23
- 1
- 4
2
votes
1 answer
Random sampling without replacement in longitudinal data
My data is longitudinal.
VISIT ID VAR1
1 001 ...
1 002 ...
1 003 ...
1 004 ...
...
2 001 ...
2 002 ...
2 003 ...
2 004 ...
Our end goal is picking out 10% each visit to run a test. I tried to use proc…

Sailynette Garcia
- 113
- 5
2
votes
0 answers
Finding dirichlet priors of a dataset with PyMC3
How to find the dirichlet priors using pymc3?
I've tried the following:
import pymc3 as pm
import numpy as np
population = [139212, 70192, 50000, 21000, 16000, 5000, 2000, 500, 600, 100, 10, 5, 5, 5, 5]
with pm.Model() as model:
zipfy =…

alvas
- 115,346
- 109
- 446
- 738
1
vote
0 answers
Implementation of a multigrid Montecarlo algorithm for a 2D Ising model
In the paper "Monte Carlo Methods in Statistical Mechanics: Fundation and New Algorithms", the author A.D. Sokal explain how to merge the Montecarlo Markov Chain algorithmic approach with the multigrid one.
Summarily the author explains firstly the…

pter26
- 111
- 3
1
vote
0 answers
Is there any difference between using WeightedRandomSampler with a big num_samples or doing more epoch with a num_samples lower?
I don't understand when the sampling is make:
Does the first mini batch will be the same for each epoch?
Or there no difference at all?

Fractale
- 1,503
- 3
- 19
- 34
1
vote
3 answers
How to solve error "Too few observations." when using ROSE to balancing data in R?
I try to use ROSE library on R to rebalancing target variable in my dataset.
Here is my information of my dataset.
My original dataset have total 132056 records.
There are total 279 cases (0.21%) of minor class in target variable.
There are total…

Hattori
- 11
- 1
- 2