All Questions
37 questions
1
vote
1
answer
712
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
706
views
Function to calculate the GC content variation in a sequence
I came across this BMC Genomics paper:
Analysis of intra-genomic GC content homogeneity within prokaryotes
And I implemented some Python functions to make this available as part of a personal project.
...
1
vote
1
answer
2k
views
Remove outliers from N dimensional data
I have created a function that will remove outliers from a series of data. Generally the data n dimensional. Loosely, an outlier is considered an outlier if it +/- deviates by 1.5 standard_deviation's ...
4
votes
1
answer
319
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
2
answers
1k
views
Calculate mean and standard error of a generator in Python
The goal of the following code is to calculate the mean and the standard error of vectors of randomly-generated numbers. I am looking for feedback both on the correctness of the calculation, and on ...
8
votes
2
answers
5k
views
Generating Latin hypercube samples with numpy
I wrote some code to generate Latin hypercube samples for interpolation over high-dimensional parameter spaces. Latin hypercubes are essentially collections of points on a hypercube that are placed on ...
3
votes
1
answer
111
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 ...
3
votes
0
answers
71
views
TensorFlow regressor to predict probability of winning, given a current score
This is a TensorFlow regressor that tells me that if you get x score, you will have x% to win a game in x game(game is not important).
Doing this as a project to learn tensorflow.
...
6
votes
1
answer
215
views
Monte Carlo errors estimation routine
I would value your opinion on the following piece of code. I am rather new to both Python and Monte Carlo analysis, so I was wondering whether the routine makes sense to more experienced and ...
8
votes
1
answer
116
views
Python implementation of approximating the chance a particle is at a location after n steps in the cardinal directions
Recently, I became very interested in a probability practice problem in my textbook for my class. I decided to implement it in code and I think I got most of it implemented. Right now, I'm hoping to ...
2
votes
3
answers
143
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
97
views
Python program computing some statistics on Scottish geographic areas
This simple script computes some basic descriptive statistics, like mean, standard deviation, kurtosis, etc. on data column imported from a CSV file with use of ...
3
votes
1
answer
93
views
Statistics and calculations
I went through a series of lessons in data science using pandas and numpy.
I have attempted to replicate some of the more common algorithms based on maths forumlas and psuedocode, except for the <...
3
votes
1
answer
84
views
Regularised regression code
I wrote some code to do regularised linear regression and it works, but I don't like the fact that I've had to double call the functions when plotting, nor the fact that I've sliced those calls to get ...
6
votes
1
answer
3k
views
Computing the autocorrelation between 2D time series arrays in python
I have a list of 2D arrays which comes from a time evolution PDE (in \$(x, y, t)\$) that I solved numerically. There are \$k\$ arrays, which all have the same dimensions, and the arrays correspond to ...