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
Filter by
Sorted by
Tagged with
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: ...
alpaca's user avatar
  • 1,231
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 ...
Ben's user avatar
  • 459
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 ...
Jean-Philippe Fontaine's user avatar
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 ...
Philipp D.'s user avatar
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 ...
Long Le Minh's user avatar
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 ...
21k's user avatar
  • 409
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 ...
Jonas Lindeløv's user avatar
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 ...
Killermud's user avatar
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 ...
Asif's user avatar
  • 735
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 ...
AnneH's user avatar
  • 31
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, ...
Desc133's user avatar
  • 41
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/(...
adam's user avatar
  • 43
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 ...
Euler_Salter's user avatar
  • 3,469
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. ...
Marty's user avatar
  • 53
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 ...
Erika_Hammerl246's user avatar
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 ...
jldmn's user avatar
  • 31
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 ...
Manish Kapasiya's user avatar
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 ...
DevbyArlindo's user avatar
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 ...
ereOn's user avatar
  • 54.6k
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, ...
Aron's user avatar
  • 31
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,...
SpeedEX505's user avatar
  • 2,006
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....
hanswe's user avatar
  • 113
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 ...
mxy's user avatar
  • 331
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 ...
user496854's user avatar
  • 6,670
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 ...
rigon's user avatar
  • 1,370
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( (&...
29antonioac's user avatar
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 ...
kjc's user avatar
  • 31
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?
A J's user avatar
  • 57
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 ...
Robbe's user avatar
  • 121
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 ...
Filip's user avatar
  • 786
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 ...
Matteo Crotta's user avatar
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 ...
Pop's user avatar
  • 51
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 ...
monoazul's user avatar
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. ...
Rspacer's user avatar
  • 2,409
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 ...
Adrien's user avatar
  • 53
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 ...
DN1's user avatar
  • 256
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 ...
Mee's user avatar
  • 1,561
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 ...
Chris's user avatar
  • 25
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 ...
VoxelPrismatic's user avatar
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 (...
David's user avatar
  • 487
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")...
Venkata Anusha's user avatar
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 ...
Dexter1611's user avatar
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 ...
ken wang's user avatar
  • 165
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. ...
zeus300's user avatar
  • 1,027
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 ...
Jensen Fan's user avatar
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 ...
Nel's user avatar
  • 63
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 ...
VISHAL VYAS's user avatar
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 ...
Pawan Rao's user avatar
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 ...
Christopher Loynes's user avatar
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 ...
joaoal's user avatar
  • 1,932

1
2 3 4 5
12