Questions tagged [sliding-window]

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In SQL in particular, the analytic functions LEAD(), LAG(), and computations OVER() a changing subset of query results involve sliding windows.

In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

583 questions
2
votes
1 answer

BigQuery : is it possible to execute another query inside an UDF?

I have a table that records a row for each unique user per day with some aggregated stats for that user on that day, and I need to produce a report that tells me for each day, the no. of unique users in the last 30 days including that day. eg.…
2
votes
3 answers

Numpy rolling window over 2D array, as a 1D array with nested array as data values

When using np.lib.stride_tricks.as_strided, how can I manage 2D a array with the nested arrays as data values? Is there a preferable efficient approach? Specifically, if I have a 2D np.array looking as follows, where each data item in a 1D array is…
2
votes
2 answers

Finding Specific Vector Entries in a Sliding Window

I am trying to create a function that will return counts of specific adjacent nucleotides (CG beside eachother) within a specific window that I have formatted in a vector. I would like the windows to be 100 nucleotides long and move shift every…
2
votes
3 answers

Summing the counts in a data frame using sliding window

I am new to R. I have a data frame in R like following df <- data.frame(ID=c(rep("A1",10),rep("A2",13),rep("A3",12)), Values=c(10,2,4,23,10,5,20,15,13,21,15,9,19,5,14,25,18,19,31,26,4,21,4,6,7,12,15,18,25,20,16,29,21,19,10)) For…
Carol
  • 367
  • 2
  • 3
  • 18
2
votes
1 answer

R Normalizing a dataset in a specific way

I have a dataset which contains 'hits' at each position in a genome. I want to normalize it in a very specific way: When the column df$HC contains the value 'HC', Take the value from df$pos which contains the position in bp, Sum up df$Hits…
Margins
  • 89
  • 8
2
votes
1 answer

MATLAB Circular sliding window and pixel values on diameters extraction

I'm trying to implement an algorithm that needs a circular sliding window, that goes through all the pixels of the image, and for each window I need to extract only pixels that lay on diameters at different angles of the circle. I try to explain…
BugsFree
  • 540
  • 1
  • 6
  • 24
2
votes
2 answers

MATLAB 3D sliding window on a volume

I have a MxNxD volume and I need a lxhxw sliding window that goes through all the voxels of the volume. In each sliding window I need to compute the Root Mean Square Contrast. Which is the smarter way to do it? I would like to limit the use of for…
BugsFree
  • 540
  • 1
  • 6
  • 24
2
votes
2 answers

Java - How do I implement sliding window for program

I am struggling with how to implement sliding windows to the following problem below. I am writing a program that should ask the location of a file (which has the digits of PI) and the number of digits to parse via the Scanner class from…
Onur Olmez
  • 37
  • 3
2
votes
1 answer

how to make Sliding window model for data stream mining?

we have a situation that a stream (data from sensor or click stream data at server) is coming with sliding window algorithm we have to store the last (say) 500 samples of data in memory. These samples are then used to create histograms, aggregations…
Zia
  • 345
  • 2
  • 5
  • 12
2
votes
1 answer

Sliding window for matlab

The intention is to estimate in a [3 3] sliding window. 0.5*[(A(i)-A(5))^2] is computed where a(i) is the pixels around center pixel a(5). The mean of each of these 8 half square differences is stored in the center pixel's location. To tackle this…
Bharath S
  • 161
  • 1
  • 12
2
votes
0 answers

Sliding window operation with arbitrary slide distance and no loops (matlab)

I am trying to completely vectorize a sliding window operation that involves an arbitrary slide distance in order to minimize the run time for this code. I have two vectors: (1) A time vector which records in sample number a series of event times…
user1860389
  • 101
  • 3
2
votes
1 answer

zlib lz77 sliding window and max match length

I'm trying to find two parameters (sliding window size and max match length) in the LZ77 algorithm (source code: http://www.zlib.net/) in order to analyse different levels of compression. At first, I found the CHUNK value in zpipe.c to be the max…
Elad
  • 21
  • 3
2
votes
1 answer

Can you cascade sliding time windows in sparks streaming

I'm wondering if it's possible to cascade sliding windows into one another with Sparks Streaming. So for example I have counts coming in every 1 second. I want to sum those for windows of 5, 15 and 30 seconds. I'm wondering if it's possible to reuse…
0x26res
  • 11,925
  • 11
  • 54
  • 108
2
votes
2 answers

Shifting and adding more than two arrays with different lengths - MATLAB

I have a list of strings or arrays with different length or size. I want to use the shortest string and compare with other strings by shifting the shortest string window one by one to do comparison. Let's say I want to do addition, I have [2 1 3] as…
Cina
  • 9,759
  • 4
  • 20
  • 36
2
votes
4 answers

comparison and shifting strings/arrays with different length in matlab

I have a list of strings or arrays with different length or size. I want to use the shortest string and compare with other strings by shifting the shortest string window one by one to do comparison. Let's say I want to do addition, I have [2 1 3]…
Cina
  • 9,759
  • 4
  • 20
  • 36