3,158 questions
0
votes
0
answers
37
views
Python sklearn Gaussian mixture model does not fit a bimodal distribution very well
I have read around a bit and never asked a question on stackoverflow before.
It seems there is a solution to my problem, but I don't understand the way it is written and computed.
Fit mixture of two ...
1
vote
2
answers
155
views
CUDA: curand_uniform() distribution not as random as expected
My goal is to use curand_uniform() to have every kernel thread generate a single random number. I am testing the randomness my program generates by treating each generated numbers as an index into a ...
0
votes
1
answer
74
views
Problems with fitting the “fitdist” distribution parameters
Good afternoon, dear colleagues. In the process of working on the project we have problems with fitting the parameters of the distribution law using the maximum likelihood method. Please help me to ...
2
votes
1
answer
511
views
Python Error: rv_generic.interval() missing 1 required positional argument: 'confidence' [closed]
I have been trying to run the below code to calculate upper and lower confidence intervals using t distribution, but it keeps throwing the error in the subject. The piece of code is as below:
import ...
1
vote
2
answers
99
views
Distribute total amount to a flat array of "container" elements with predefined limits
I'm trying to split items evenly through groups with a max on each group.
I have a function which receives a $groups array which declares the maximum capacity of each "group" and an $items ...
1
vote
1
answer
74
views
How to sum rectangles between randomly generated circles on a plane?
I am trying to make a program in C# that would generate n number of points, which form centers of non colliding circles with radius r in 200 by 200 plane (coordinates for both x and y are [-100+r, 100 ...
0
votes
1
answer
84
views
How to repeat rbinom() with different size inputs with each draw?
I am attempting to write R code that will draw from a binomial distribution but will repeat for every value in a specified column in a data frame.
I generated a data frame in r such that the first ...
1
vote
0
answers
40
views
Error using elements of D[i] inside a for-loop
I'm encountering an issue when trying to use the elements of the matrix D[i] inside a for loop in my JAGS model. The matrix D[i] is derived from a Wishart distribution, and when I try to use it within ...
0
votes
1
answer
106
views
How to extract values from multiple Monte Carlo simulations and compile these as series of values in R? [closed]
I am doing Monte Carlo simulation using a triangular distribution in R.
rtriangle(n = 10000, a = 9100, b = 13234, c = 11585)
In this example, I am doing 10,000 iterations where 'a' is the minimum ...
0
votes
2
answers
250
views
how to generate specific distribution?
I have a metric with 900K users, and I can't generate a distribution that would roughly repeat the existing one. I need this to quickly generate samples for AA AB tests (with guaranteed uplift).
Here ...
0
votes
1
answer
53
views
Converting np.random.logistic to scipy.stats.fisk
I cannot figure out how to convert np.random.logistic to scipy.stats.fisk, here's my code:
import numpy as np
import numpy.random as npr
import scipy.stats as ss
import matplotlib.pyplot as plt
SEED =...
1
vote
1
answer
118
views
Scipy NLLF Loss has high values for distribution fitting
I'm trying to check if my data is distributed according to some distribution, however I always get NLLF values that doesn't make sense.
For example, here I'm generating 10K data points using a normal ...
1
vote
1
answer
221
views
Estimate Dirichlet parameters from multinomial regression
I am trying to use the predicted probabilities from a multinomial regression using multinom function from the nnet package in R to estimate the parameters for a Dirichlet distribution while taking ...
0
votes
1
answer
182
views
How do you use a custom distribution in a GARCH-model with rugarch in R?
I want to use a distribution that is not built in to the rugarch package in R. More specifically, the EGB2 distribution. If I have the PDF of the distribution, is it then possible to use this ...
0
votes
1
answer
250
views
Solving for Potential due to charge using Poisson Equation using FDM in Python (1D)
Im trying to get electric potential distribution due to charge (or charges) in one plane (1D).
To get it I'm solving Poisson Equation using FDM in Python.
In my example, the Poisson equation looks ...
0
votes
1
answer
157
views
Adding vertical lines using matplotlib
My aim is to first create two plots (which I correctly created), each of them representing the CDF of the number of Puts and Calls still open in the market.
For each plot, I also wanted to draw the ...
2
votes
1
answer
589
views
Correct way to generate random numbers from a log-normal distribution in R
I have a data set of household incomes. I want to fit a log-normal distribution to the data then generate random numbers from that distribution.
The approach below using the MASS package seems to give ...
0
votes
0
answers
172
views
Find best fit common probability density function, if already have a probability density function (Python's Fitter does not suffice)
There are questions about finding best-fit p.d.f.s given some data: How to find probability distribution and parameters for real data? (Python 3), https://medium.com/the-researchers-guide/finding-the-...
0
votes
1
answer
56
views
scipy lognorm does not converge to params
I have manually fitted a lognormal distribution to my data:
from scipy.stats import lognorm
sigma = 0.15
mu = 2
x_fit = np.linspace(x.min(), x.max(), 100)
y_fit = lognorm.pdf(x_fit, sigma, scale=np....
0
votes
0
answers
180
views
C++11 custom uniform integer distribution implementation
I write code in C++ that need to be cross-platform. I need a uniform integer pseudo-random number generator to give the same results on different platforms (not cryptographic strength). As I ...
3
votes
1
answer
107
views
Sampling transformation - rexp vs rweibull
I am working with different sampling functions, and I am wondering why these two formulations do not give the same result
n=2
set.seed(1)
rweibull(n,shape = 1,scale = 1)
# [1] 1.3261078 0.9885284
set....
1
vote
0
answers
40
views
Getting error while running flexsurvreg function
Can anyone help me how to to define the below given custom distribution in flexsurvreg function.
custom_pdf=function(y,b0,b1,b2,b3,sigma,alpha){#pdf of proposed model
z=(y-b0-b1*t2-b2*t3-b3*t4)/...
1
vote
1
answer
57
views
Alternative to nested loop in python
I wrote a function U_p_law which takes 2 probability density functions (L_P and L_Q) of 2 players and 2 integer values that define how often each player one when they played each other.
The ...
0
votes
1
answer
802
views
How to fit "Negative Binomial" Distribution on a histogram using ggplot2()?
I am working with a dataset that I believe follows a "Negative Binomial" distribution. However, when I fit the Negative Binomial distribution, it turns out to be a poor fit. To explore ...
0
votes
1
answer
235
views
Azure Synapse shuffle WITH(DISTRIBUTED_MOVE_FILE='')
Azure Synapse dedicated pool, when doing a join on 2 tables with different distribution, Synapse creates temporary tables (shuffle step in execution plan) with the following syntax:
CREATE TABLE [...