All Questions
11
questions
1
vote
1
answer
700
views
Exponentially-weighted moving mean and standard deviation of an irregularly-spaced weighted time series
The following numpy/python function computes exponentially-weighted moving mean and standard deviation of an irregularly-spaced weighted time series. I want to make it faster by getting rid of the ...
4
votes
1
answer
308
views
Evaluate joint probability density function of a Markov random field
The following code evaluates probability mass function for all possible states of a model.
...
3
votes
1
answer
97
views
Select optimal piecewise regression fit
I'm making a program which fits a piecewise linear regression with up to 4-5 breakpoints in the data, and then deciding how many breakpoints is best to prevent over and underfitting. However, my code ...
2
votes
3
answers
130
views
Speed up weighted average for Leela Chess Zero
Problem: Given a vector of about 40 values m with normal error sd compute the weighted average of the values weighted by the ...
4
votes
1
answer
134
views
Calculating difference statistics over a moving window
I'd like to calculate some statistics of given data (frequencies of difference among elements on various distances in percent multiplied by 10) using moving window within that data. Is it possible to ...
7
votes
1
answer
656
views
Optimized computation of pairwise correlations in Python
Given a set of discrete locations (e.g. "sites") that are pairwise related in some categorical ways (e.g. general proximity) and contains local level data (e.g. population size), I wish to efficiently ...
4
votes
1
answer
4k
views
Fastest computation of N likelihoods on normal distributions
In the context of a Gibbs sampler, I profiled my code and my major bottleneck is the following:
I need to compute the likelihood of N points assuming they have been drawn from N normal distributions ...
6
votes
1
answer
3k
views
Improve performance of Gaussian kernel function evaluation
I need to improve the performance of a function that calculates the integral of a two-dimensional kernel density estimate (obtained using the function stats.gaussian_kde) where the domain of ...
2
votes
1
answer
170
views
How to reduce runtime of gene data processing program?
This program takes a huge data set as input, processes it, calculates and then writes the output to an array. Most calculations may be quite simple, such as summation. In the input file, there are ...
4
votes
1
answer
1k
views
Statistical samples and distributions
It is usually inefficient to find bugs in a longer code. Unfortunately, after spending too much time in debugging my code, I realize that a good programming habit is important. Please give me some ...
3
votes
2
answers
566
views
Specialized version of the cross correlation function
I am writing a specialized version of the cross correlation function as used in neuroscience. The function below is supposed to take a time series data and ask how ...