Questions tagged [scipy.stats]

297 questions
0
votes
1 answer

How to Plot confidence intervals in this particular population proportion?

I am trying to plot a confidence interval for df called 'Sex'. But the confidence interval seems to touch the x axis and it does'nt seem to be right.Can someone help me here? The dataframe is basically binary with either Male or Female. This is the…
0
votes
0 answers

hypothesis test success rates between two samples with binomial distributions

I'm trying to compare success rates in two samples. I'm treating each sample as a binomial distribution, then trying to compare the success rates with a two tailed hypothesis test. (x1 is the number of successes in sample 1, and n1 is the total…
user3476463
  • 3,967
  • 22
  • 57
  • 117
0
votes
1 answer

Problem in generating heatmap in python, when generating grid statistics using scipy.stats.binned_statistic_2d

I am trying to create a heatmap in Python for deviation in actual and target cake length that comes out of the oven after the baking process The raw data for actual and target cake length is available at my GitHub -…
Masoom Kumar
  • 129
  • 1
  • 8
0
votes
0 answers

binom_test results compared to hypothesis test with normally distributed test statistic

I have two samples with different numbers of trials in each sample, and different number of successes in each sample. I'm trying to compare the success rate between the two samples to see if there is a significant difference. I seem to get very…
user3476463
  • 3,967
  • 22
  • 57
  • 117
0
votes
0 answers

Curve Fitting a Levy-Stable Distribution to Histogram

I'm trying to fit a Levy-Stable distribution on to a histogram that I've already plotted: Histogram of data The "daily change" values were calculated from a pandas dataframe, using df.diff(), so that it returned a set of values containing the…
0
votes
0 answers

scipy.stats.binned_statistic_2d is there a quicker pythonic way to know which bin each rows unique_id went into?

I have a dataframe that has Latitude, Longitude, and a unique_id for each row. df = df[['unique_id','Latitude','Longitude']] I am using stats.binned_statistic_2d to create bins that lat/long will correspond with. stats, yedges, xedges, binnumbers =…
jrange27
  • 1
  • 1
0
votes
0 answers

How can the 2 sample K-S test be implemented in Python?

I have a data-set of experimental data (y_observed, t whereby y_observed represents measured values and t represents the time in seconds since start of the measurement). I perform a Gaussian fitting to this data, but want to assess whether it makes…
0
votes
0 answers

operands could not be broadcast together with shapes (37,32,2) (2,2) getting pdf from Scipy Stats?

I have the code below, which is modeling the return and volatility of a stock using a bivariate Gaussian distribution. It keeps failing at the variable pdf, getting the error operands could not be broadcast together with shapes (37,32,2) (2,2) . How…
quant4u
  • 35
  • 4
0
votes
0 answers

Scipy WrappedCauchy isn't wrapping when loc != 0

I want to plot the PDF of a wrapped Cauchy distribution, but when I set a value for the location, the entire distribution gets shifted, rather than wrapped. When I run this: from scipy.stats import wrapcauchy import numpy as np c = 0.3 rv =…
Liam F-A
  • 135
  • 11
0
votes
1 answer

Type check scipy.stats distributions with isinstance

I have several scipy.stats distributions in a list. I want to check if each distribution is e.g. uniform, normal or something else by isinstance. However, the type of all these distributions seem to be…
0
votes
0 answers

Getting an error message (No module named "scipy")

I've run into a problem whilst writing a hedging algorithm in python in my conda environment. Getting this message while debugging the file: Exception has occurred: ModuleNotFoundError No module named 'scipy' File "/Users/michael/Library/Mobile…
micfold
  • 1
  • 1
0
votes
1 answer

Why is scipy's probability density function not accepting size of my mean?

I am using a function to calculate a likelihood density. I am running through two xs which are vectors of length 7. def lhd(x0, x1, dt): #Define a function to calculate the likelihood density given two values. d = len(x0) #Save the length of…
Ria Dunn
  • 21
  • 1
  • 2
0
votes
0 answers

scipy.stats.multivariate_normal generates samples but their cdf is zero

I use scipy.stats.multivariate_normal to generate random samples of dimension (1, 9). However, when i compute the cdf of said samples, it is always zero. import numpy as np from scipy.stats import multivariate_normal mean =…
Rima
  • 3
  • 2
0
votes
1 answer

Why a norm distribution does not plot a line on stats.probplot()?

The problem is with the resultant graph of function scipy.stats.probplot(). Samples from a normal distribution doesn't produce a line as expected. I am trying to normalize some data using graphs as guidance. However, after some strange results…
0
votes
1 answer

scipy.stats.multivariate_normal error: input matrix must be symmetric positive definite

i'm trying to compute the cumulative distribution function of a multivariate normal using scipy. i'm having trouble with the "input matrix must be symmetric positive definite" error. to my knowledge, a diagonal matrix with positive diagonal entries…
Rima
  • 3
  • 2