Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [statistics]

Consider whether your question would be better asked at CrossValidated, a Stack Exchange site for probability, statistics, data analysis, data mining, and machine learning. Code Review questions on statistics should be about implementation and working program review, not about theoretical discussions of statistics or research design.

38 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
102 views

Pivot-friendly binning of arbitrary vector

I frequently get a situation in which I want a pretty binned column from a vector of values, so that I divide the vector in approximately even ranges and choose 'sensible' values so that it looks ...
MattV's user avatar
  • 698
5 votes
0 answers
169 views

Kernel density regression in Julia

Here is a naive implementation of a kernel density regression algorithm in Julia. The code works, but there is quite a bit of room for improvement though. First, there is not an optimal bandwidth ...
Vincent's user avatar
  • 561
4 votes
0 answers
96 views

Estimate area of cropped circle with Monte Carlo

I looking around and not finding anything, I developed a simple function for estimating the area of a possibly cropped circle inside a frame. It uses a very basic MC implementation. It is pretty fast ...
Gabriel's user avatar
  • 575
4 votes
0 answers
110 views

Download and analyze PDFs of Congressional records

This is built with Python 2.7.15. The goal of this script is to count the number of words spoken by each Senator on the floor of Congress between given dates. It pulls from the Congressional Record, ...
Sebastian's user avatar
  • 141
4 votes
0 answers
2k views

Pandas/Numpy statistical odds ratio test

I'm looking for a faster way to do odds ratio tests on a large dataset. I have about 1200 variables (see var_col) I want to test against each other for mutual exclusion/ co-occurrence. An odds ratio ...
XyledMonkey's user avatar
4 votes
0 answers
4k views

Calculate relationship between 2 categorical variables in a pandas Dataset with chi square test

I'm working on a Machine Learning project and I'm in Data Exploration step, and my dataset has both categorical and continuous attributes. I decided to compute a chi square test between 2 categorical ...
Espoir Murhabazi's user avatar
4 votes
0 answers
168 views

Vectorize Fisher's Exact Test

I have two data frames/ lists of data, humanSplit and ratSplit, and they are of the form ...
melatonin15's user avatar
3 votes
0 answers
78 views

Python program that analyzes a corpus for randomword generation

I play a lot of old-school western CRPGs, and most of them (if not all) require the player to generate an avatar at the start of a new game, including naming the character (with names that will never ...
Ξένη Γήινος's user avatar
3 votes
0 answers
87 views

Sampling distribution of the sample mean

This program generates the entire sample distribution of the sample mean. The parent population has elements that have N distinct values. Samples of size n are drawn, with replacement. When N and n ...
Wilson's user avatar
  • 31
3 votes
0 answers
759 views

Simple Kivy App for Bootstrap Algorithm

I have a very simlpe app built using Kivy, for performing bootstrap algorithm (statistics). We must input some samples in the form x1,x2,...,xn (these will be ...
Redsbefall's user avatar
  • 1,132
3 votes
0 answers
64 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. ...
Daniel's user avatar
  • 31
3 votes
0 answers
56 views

'Weighted sample' from overlapping categories

I wish to write a function, that will sample from various (potentially overlapping) categories \$C_1, C_2, \ldots C_k\$, such that the sampled values are in the ratio \$r_1:r_2:\ldots: r_k\$ or as ...
tim-mccurrach's user avatar
3 votes
0 answers
383 views

PCA, LDA and Logistic Regression

Based on the great blog by Joel Grus, I implemented LogisticRegression, PCA, and LDA. I'd appreciate feedback as I'm not sure that the logistic classifier is good enough (as it supposed to achieve ...
oba2311's user avatar
  • 197
3 votes
0 answers
2k views

A Simple K-Means Cluster Analyzer v0.1

[NOTE] This question can be depreciated in favor of version 0.2. This code works well. This my first attempt at creating a robust, computationally lean K-Means Cluster analyzer. I first saw this ...
Miller's user avatar
  • 533
3 votes
0 answers
273 views

Naive implementation of Naive Bayes in Haskell

A simple implementation of Naive Bayes, as I'm a Haskell beginner I've tried to put an emphasis on clarity and documentation. I've tried to incorporate the feedback from a similar question. This is ...
dimid's user avatar
  • 303
3 votes
0 answers
308 views

Read in file, Filter out records, output results

I have been working on a project for some time and have let one Python file grow into a huge file that tries to do everything. The structure is pretty flat and I don't like it. I've used other ...
skaz's user avatar
  • 211
3 votes
0 answers
185 views

Nonlinear Nonparametric Regression

I explain the nonlinear correlation coefficients in this paper and provided the code in this post. The nonlinear nonparametric regression is an extension of this work and its description can be found ...
Fred Viole's user avatar
3 votes
0 answers
141 views

Correlation and Dependence

It is well known that 0 dependence implies 0 correlation, while 0 correlation does not imply 0 dependence. I have a paper here illustrating nonlinear correlation coefficients from relationship subsets ...
Fred Viole's user avatar
3 votes
0 answers
181 views

Computing pairwise distance covariances for a symmetric matrix

I wrote a non-vectorized, non-parallel wrapper function for computing the pairwise distance covariances (Wikipedia) (original paper) in a data frame: ...
shadowtalker's user avatar
2 votes
0 answers
50 views

Plot ellipse hypothesis plots with confidence intervals for multiple models

I have developed a function to graphically plot between two predictors of interest their confidence interval regions on an ellipse. It states whether the null hypotheses have been accepted for the one-...
Working dollar's user avatar
2 votes
0 answers
244 views

Mean, median and mode GUI

This program takes x numbers and displays the mean, median and mode. My goal here was to use classes and class properties the best i could to make the code shorter (honestly i may have just made it ...
Tommaso's user avatar
  • 93
2 votes
0 answers
53 views

Using python to estimate the range of unstructured data

I have unstructured input-output data, f=f(x). I want to estimate the range of f as a function of x, given limited sampled. So, I tried to discretize the data use small bins in x to estimate the ...
kilojoules's user avatar
2 votes
0 answers
80 views

Bias-corrected percentile Bootstrapping Optimization

I have never posted to this forum, but was referred here. I need some help printing key iterations as well as optimizing my code for run time. If someone had some time to help/explain how to correct ...
J Bacon's user avatar
  • 31
2 votes
0 answers
71 views

Simple linear regression of two variables

This is the code I built to implement a simple linear regression to check the impact of variable A on B. I am not interested in predicting that's why the statistical approach is important for me to ...
AhmAch's user avatar
  • 21
2 votes
0 answers
105 views

Regression on Pandas DataFrame

I am working on the following assignment and I am a bit lost: Build a regression model that will predict the rating score of each product based on attributes which correspond to some very common ...
Stefano Pozzi's user avatar
2 votes
0 answers
468 views

A Simple K-Means Cluster Analyzer v0.2

This code is a revision of a previous post and works well. This my first attempt at creating a robust, computationally lean K-Means Cluster analyzer. I first saw this algorithm in an intermediate ...
Miller's user avatar
  • 533
2 votes
0 answers
104 views

Getting the math right for a Hidden Markov Model in Java

In an effort to learn and use hidden markov models, I am writing my own code to implement them. I am using this wiki article to help with my work. I do not wish to resort to pre-written libraries, ...
Toasty's user avatar
  • 21
2 votes
0 answers
57 views

MCMC Metropolis Hastings for German Tank Puzzle

I have implemented the following MCMC algorithm for the german tank puzzle found here I just want to make sure everything is legit and that I am not getting the right answer by chance. ...
user2879934's user avatar
2 votes
0 answers
2k views

KS-Statistic in C++

Consider the MCG with parameters: a = 23, M = 10^8 + 1, and let the seed be 47594118. (This is the original MCG proposed by Lehmer in 1948.) Apply the Kolmogorov-Smirnov test to the first 1000 random ...
Scooby's user avatar
  • 29
2 votes
0 answers
96 views

Survey adjusted contingency table with Taylor Series linearization

I am an R programmer who is learning C++/Rcpp. I wrote some code to recreate survey adjusted contingency tables a la SAS's surveyfreq procedure using Taylor Series linearization to generate standard ...
Carl's user avatar
  • 121
1 vote
0 answers
43 views

A JavaFX program to find out the mouse refresh rate v3

(This post is the continuation of A JavaFX program to find out the mouse refresh rate v2.) After taking @J_H's suggestions into account, I ended up here: ...
coderodde's user avatar
  • 28.4k
1 vote
0 answers
28 views

ADO wiki stats generator charting

I'm planning on adding an automated process to generate some stats once a week from a git repository, generates a markdown file with some stats, but looking for some suggestions for generating some ...
Josh Knutson's user avatar
1 vote
0 answers
29 views

Statistical bootstrapping in Python - is my code correct?

I wonder if my code for bootstrapping in Python is correctly coded or if there are logical flaws in it. It uses a 95% confidence interval. The code basically does the following for two datasets that ...
Philipp's user avatar
  • 111
1 vote
0 answers
40 views

Python 3 script for statistiscal analysis of English vocabulary

This is a Python 3 script that statistically analyzes 105,230 words with a total of 913,935 characters, its results will be used for pseudoword generation purposes. You will need this file for it to ...
Ξένη Γήινος's user avatar
1 vote
0 answers
38 views

Block Bootstrap Estimation in Java - Part 3

This is an extension of Block Bootstrap Estimation in Java - Part 2. The text file text.txt can be found at https://drive.google.com/open?id=1vLBoNmFyh4alDZt1eoJpavuEwWlPZSKX (please download the file ...
Clarinetist's user avatar
1 vote
0 answers
41 views

Flagging out-of-stock items

I wrote a function that iterates over 3 parameters to spot out-of-stock items. To illustrate this I'll draw an example: suppose that the product 10 in store 2 for an offer named "super5" is following ...
A.w's user avatar
  • 11
1 vote
0 answers
856 views

PHP rating function for getting the average value of column

I created a function to add and return the average rating. Rating Function ...
Ayaz Ali Shah's user avatar
0 votes
1 answer
105 views

Finding the mean using RxJava

I'm learning RxJava and this is what I attempted to find the mean of 'n' transactions. ...
Ragunath Jawahar's user avatar