Questions tagged [sampling]
In signal processing, sampling is the reduction of a continuous signal to a discrete signal. In statistics, sampling is the selection of a subset of individuals from within a statistical population to estimate characteristics of the whole population.
sampling
570
questions with no upvoted or accepted answers
8
votes
0
answers
888
views
Sampling from a joint distribution in Pyro
I understand how to sample from multidimensional categorical, or multivariate normal (with dependence within each column). For example, for a multivariate categorical, this can be done as below:
...
5
votes
0
answers
410
views
Fast geospatial sampling in R
I have a large set of polygons (about 20k) that I want to sample points from. I use the st_sample function from the sf package in R, but it's pretty slow. It takes about 5 minutes to sample from all ...
5
votes
1
answer
375
views
sampling a multimensional posterior distribution using MCMC Metropolis-Hastings algo in R
I am quite new in sampling posterior distributions(so therefore Bayesian approach) using a MCMC technique based on Metropolis-Hastings algorithm.
I am using the mcmc library in R for this. My ...
4
votes
2
answers
953
views
Why does my train loss jump down when a new epoch starts?
When I train a neural network consisting of 2 convolutional and 2 fully connected layers on the MNIST handwritten digits task, I receive the following train loss curve:
The datasets contains 235 ...
4
votes
0
answers
568
views
Negative Sampling in Tensorflow without sampled_softmax_loss function
Is there a function that allow me to do negative sampling without using sampled_softmax_loss ( Tensorflow negative sampling)
I am looking for negative sampling method that takes frequency of a label ...
4
votes
0
answers
1k
views
Is it possible to render to texture's mipmap level 1 while sampling from level 0? (opengl, texture 2d)
Is it possible to render to one of RenderTexture's mipmap level while sampling from other levels?
The situation is i want to downscale a texture 4 times using shader, i could put all these ...
4
votes
0
answers
184
views
Get representative values from 2d density
How do you get N pairs of values, which represent a joint probability (2d density) of a much larger pairs of values?
I do MCMC sampling on parameters of a function, and I want to visualize the ...
4
votes
0
answers
176
views
OpenGL Texture Squares
I have been having some issues with sampling a texture and sampling outside the bounds of the texture. I have set the texture to GL_CLAMP_TO_EDGE for wrapping, so when the texture goes out of bounds ...
3
votes
0
answers
129
views
Antithetic Sampling for variance reduction in graph convolutional network (GCN)
I am trying to implement Antithetic Sampling to sample vertices of the graph and train the downstream graph convolutional network (GCN) model on the sampled graph.
Antithetic Sampling is a variance ...
3
votes
2
answers
309
views
Misconceptions about the Shannon-Nyquist theorem
I am a student working with time-series data which we feed into a neural network for classification (my task is to build and train this NN).
We're told to use a band-pass filter of 10 Hz to 150 Hz ...
3
votes
0
answers
424
views
Change audio sampling rate without affecting playback speed
I'm just trying to change the sampling rate of a audio dataset (in .wav format) from 32000Hz to 44100Hz but, doing this, the playback speed is changed too (very acceptable and logical).
My point is, ...
3
votes
2
answers
83
views
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/(...
3
votes
0
answers
560
views
Random Walk Metropolis Hastings implementation in R using log scale
Context
I looked literally everywhere but I couldn't find a complete implementation of the Random Walk Metropolis-Hastings algorithm using the log scale. By log scale I mean that we are working with ...
3
votes
0
answers
230
views
model function including a large time loop (PYCM3)
I'm trying to run a baysian calibration of a dynamic model with PYMC3.
My model function includes a large time loop, thus when the model is compiled with Theano, the RAM memory exceeds the capacity. ...
3
votes
0
answers
75
views
How to sample from data given criterions, permutation methods
I'm performing permutations on my data by using sample() and loops.
I have data for 400 cases and 1000 controls from 90 hospitals. I have ran a logistic regression for this data. Now I want to do ...
3
votes
1
answer
2k
views
How to create a custom layer for Sampling in Keras Tensorflow?
I'm building a CNN in Keras with a Tensorflow backend, and I'd like to introduce a custom layer that should perform the following:
Output a tensor of same shape and dtype as the input tensor.
The ...
3
votes
1
answer
2k
views
Perform GC and CPU monitoring is disabled in VisualVM
I am monitoring Java web application running on tomcat server on localhost using VisualVM tool.
The problem I am facing is the perform GC button in sampler is disabled. Why I want explicit Perform GC ...
3
votes
0
answers
557
views
Frequency Detection on iOS
I want to be able to detect a high frequency (60 - 70 kHz) on a iOS application written in Swift. However, I don't know where I should start. I know that on a typical iPhone the sampling rate is about ...
3
votes
0
answers
37
views
How to get the last executed thread identifier?
I'm currently developing a sampling profiling tool for our online service written in Python.
My approach so far is to have a dedicated thread that, at regular intervals, looks at all the running ...
3
votes
0
answers
760
views
Slow sampling of STAN compared to BUGS
I am trying to make a switch from WinBugs to Stan, since I like the programming language and usage in R is better for Stan than WinBugs. I recoded my hierarchical Bayesian model to the Stan language, ...
3
votes
0
answers
876
views
Stratified Sampling in matlab
Can you please help me to make my random sample function to be stratified sampling?
%data has dimension m x 1000
%labels are in dimension m x 1
function [ sample_data, sample_labels ] = sample(data,...
3
votes
1
answer
601
views
Android accelerometer sampling rate random spikes
I am doing experiments on sensor sampling in Android. I'm sampling the accelerometer sensor at 10HZ via the native API in Android. I'm using two different galaxyS3 (4.0.4 and 4.1.2) and two xperias (2....
3
votes
0
answers
1k
views
How to get FFT units for spatial 1D signal?
Note : Answers with dimensions (cy/mm) instead of (Hz) would be greatly appreciated!
I have looked into unit of fft(DFT) x axis and units on x axis after FFT , but I couldn't find exactly what I'm ...
3
votes
1
answer
4k
views
Any way to change the sampling frequency of a WAV (or MP3) in Android or just Java?
I'm trying to get files played through a mono (SCO) BT headset in Android. The files have to have an 8000 Hz frequency, but the ones I have are 44100 Hz. The files are MP3s, but I've already created ...
3
votes
1
answer
1k
views
Accessing audio samples from linphone
I'm using linphonec (without gtk interface, only command line) in Linux and I want to access incoming and outgoing sound samples, but I don't know what file should I edit to access them.
Can anybody ...
3
votes
1
answer
993
views
Same behaviour Scala Spark Sample and SampleBy
I'm trying to perform stratified sampling in a Spark Dataframe, but the behaviour of the sampleBy function is (oddly) similar to sample.
Spark version 3.0.1
import spark.implicits._
val data = Seq( (&...
3
votes
2
answers
132
views
Randomly sample rows from a file based on times in columns
This is a bit complex, and I greatly appreciate any help! I am trying to randomly sample rows from a .csv file. Essentially, I want a resulting file of unique locations (Locations are specified by ...
2
votes
0
answers
22
views
Probability 0 in Importance Sampling
I have a general question about the methods that use importance sampling in RL. What happens when the probability of either one of the policies is 0?
2
votes
0
answers
54
views
JavaFX use Nearest Texture Sampling on Material
As a small easter-egg in a school project I'm trying to add a simple Minecraft-Clone into a JavaFX-UI programme.
While the rendering and technology is working absolutely fine, troubles are appearing ...
2
votes
0
answers
393
views
Bootstrap sampling in Pandas with weighting on multiple levels
Bootstrap sampling in Pandas with weighting on multiple levels
Given a table as the one in the example below (with possible additional columns), I want to bootstrap samples where countries and fruits ...
2
votes
0
answers
79
views
R - partitionsSample - Error message saying n exceeds the maximum number of possible results
I am trying to split a number X into a defined number of random values so that the sum of this set of randomly generated values is X; this is done under the rule that none of the randomly generated ...
2
votes
0
answers
68
views
Stratified sampling getting odd proportion of factor levels
I'm experimenting with the Dry Bean dataset from UCI machine learning repo. I want to iterate through the dataset, repeatedly removing samples and running classifiers to see how accuracy changes as ...
2
votes
0
answers
140
views
R calculation of inverse sample probabilities required for inverse probability bootstrap sampling from complex survey data
I am trying to implement in R the formula used by Nahorniak et al. (2015) to calculate inverse sample probabilities. But, unfortunately, I don't have the necessary knowledge to do it. For context, the ...
2
votes
1
answer
127
views
How to sample from smaller data frame with multiple conditions to a larger data frame?
I have a main dataset df.main with 3 sites and each site has 3 subsites, that were samlpled over three months. I have a separate dataset with some abiotic variables ONLY for a single month df.sample. ...
2
votes
0
answers
318
views
How to create the sampling matrixes for Sobol sensitivity analysis in R (package "sensitivity")
I would like to perform a Sobol sensitivity analysis in R
The package "sensitivity" should allow me to do so, but I don't understand how to generate the sampling matrixes (X1, X2). I have a ...
2
votes
1
answer
426
views
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 ...
2
votes
0
answers
48
views
having different values in the sampled data
I have a very large data of 4 million rows, I decided to take the first 25% of the data by this line of code.
df_sample= df.head(int(df.values.shape[0]*0.25))
then I decided to check how many values ...
2
votes
1
answer
1k
views
Sampling analog signals on the ESP32 at different rates using I2S
I need to read high freq. analog signal data from one ADC1 channel and read low freq. data from other ADC1 pins.
I use I2S for the high freq. data read, which runs perfectly, but as soon as I2S is ...
2
votes
0
answers
1k
views
How to listen to audio output by application
Background
I'm working on a music player, and want any sort of audio visualizer to be part of it. I've already made a previous post specifically targeting python-vlc, but I guess not too many people ...
2
votes
1
answer
570
views
Python Pandas - Sampling: putting a limit on number of items on a Random selection
Say that I have a dataframe that looks like:
id_1 id_2
aa 123
bb 123
cc 234
dd 123
ee 678
FF 456
gg 123
How do I do sampling with the condition that we can only have up to 3 (...
2
votes
1
answer
2k
views
Azure App insights Adaptive Sampling includedTypes not working
I want to sample apply Adaptive Sampling only to "Dependency" itemType. I used the below code to achieve this,
builder.UseAdaptiveSampling(maxTelemetryItemsPerSecond: 250, includedTypes: "Dependency")...
2
votes
1
answer
222
views
Stratified Sampling to mimic Population Distribution
I am new to R, I recently used stratified sampling for train and test split to ensure target label is in equal proportion for both now I want to use down-sample the training data such that the ...
2
votes
1
answer
453
views
How to estimate the accuracy on a large dataset?
Given that I have a deep learning model(handover from former colleague). For some reason, the train/dev set was missing.
In my situation, I want to classify my dataset into 100 categories. The ...
2
votes
1
answer
3k
views
LabVIEW DAQ sampling rate
I am trying to sample myDAQ NI module at 1 Hz with the below code, but for some reason, no matter what I set as sampling rate, it seems to be sampling at the same rate, much faster than 1 Hz.
...
2
votes
0
answers
2k
views
How Oracle SAMPLE clause work?
My group is doing a data evaluation request from client. We planed to use SAMPLE clause to extract some rows randomly from a table in our Oracle 11g database. After some research, we found there are ...
2
votes
0
answers
3k
views
SSIS - Pass variable in OleDB Command (Row Sampling to Update Existing Row)
In OleDB command, how to pass the variable to update the table?
I wanna use SSIS to load big volume of testing data, the file name and code are unique, but the other details could be repetitive (so I ...
2
votes
0
answers
462
views
dividing my dataset (csv format) using Stratified k-fold sampling and saving the output of each fold in separate csv file.
My dataset has around 5000 samples and 3 classes (one hot encoded) and I am interested in creating samples using stratified K fold. Moreover, in the end, I want to split each output file (from the K ...
2
votes
0
answers
675
views
Mongo random sampling on huge data very slow
We have a collection with more than 20 million documents.
These documents store all the user activity related data for over a year and are around 2 - 3kb on average.
When we count based on a specific ...
2
votes
0
answers
272
views
Resolving Sample Bias in Text Classification - Python - ADASYN
I am currently working on a project where I have scraped reviews relating to a retailer from a review website. The aim is to use a Random Forest classifier to classify each review in the dataset by ...
2
votes
0
answers
598
views
How to perform a normality test for stratified samples with different weights in R
Let's assume a stratified sampling design where some groups are over- and others underrepresented for theoretical purposes.
For all test-statistics and regression type models we can use the survey ...