Questions tagged [distribution]
This tag concerns statistical distributions, their implementations, and properties.
3,148
questions
0
votes
1
answer
46
views
Seaborn's histplot doesn't match Matplotlib's hist when using log_scale=True
I'm probably making a stupid mistake, but here's how to reproduce:
Generate random variables based on log-normal distribution
Fit a log-normal distribution to the synthetic data
Compute the ...
0
votes
0
answers
9
views
estimating parameter using fitdistr function
I have this original pdf... and I'm trying to estimate the parameters required in both dgamma and dnbinomial. my professor implied It'd be better if I use the fitdistr function according to the paper ...
0
votes
0
answers
24
views
How to generate plot of pdf of Log Logistic Erlang random variable
g(x) is how the pdf is defined, and parameter values are shown in the picture.
I want to generate the plots corresponding this pdf using those parameters in R. I did search for a couple of examples ...
0
votes
1
answer
46
views
C_qf function - base stats packages [duplicate]
I have been running a piece of code which uses the gamlss qEGB2() function. However, it has been producing the following warning message:
In qf(p, 2 * nu, 2 * tau) : full precision may not have been ...
0
votes
0
answers
49
views
Sweep Line algorithm for distributing rectangles randomly with minimum overlap
I currently have a webpage where I randomly place rectangles of different sizes, using just randomly chosen point for their starting positions. They currently overlap a lot.
I'd like to find an ...
0
votes
1
answer
42
views
How to plot raw data (geom_point()) on an axis with a distribution (stat_halfeye) in R
In this fictitious example, I have predicted distributions for grasshoppers by age in months, but want to add raw data. How does one do this when working with rvar data?
I tried to convert my ...
0
votes
0
answers
34
views
How to Sample from a DataFrame in Pandas to Match a Target Distribution with Specific Variables
I'm working with a large DataFrame in Pandas, containing about 800,000 observations. I need to create a sample from this DataFrame that approximates a target distribution. The sample size should be ...
1
vote
0
answers
30
views
Need help determining the zero-inflated distribution of my data to be able to use it in a GLMM in R [closed]
I am working in R with a data set which includes a column of Shannon Indexes per location code. I would like to perform a GLMM using this column as the response variable. Treatment would be my fixed ...
0
votes
0
answers
13
views
Adjusting numbers in a list based on constraints
I have a list of numbers and confidences in this numbers, for ex.
[(24, 0.2), (23, 0.3), (21, 0.3), (19, 0.1), (18, 0.15), (18, 0.2), (17, 0.3), (13, 0.3), (12, 0.2), (12, 0.3), (11, 0.2), (11, 0.1), (...
1
vote
1
answer
25
views
Is there a way to print Proc Univariate output for Fitted distribution?
I have a dataset of observed data and I want to test if they are ~ LogNormal (μ;σ)
I have used the following:
Proc Univariate data=myData;
var Var1;
histogram / LogNormal;
run;
I have, as an output, ...
0
votes
0
answers
56
views
Getting Parameters of fitted pareto and normal distributions
I want to fit a normal and a pareto distribution to some data I collected. I will insert the codes for all three types of fitting below. You will notice that they are quite similar, as the concept of ...
0
votes
0
answers
31
views
Enormous difference in the number of Hash Table collisions with linear probing based on input data
I am running performance tests on a Hash Table while trying two different data sets and array sizes.
The first data set contains 100 000 random Integers converted to strings fe. "-52917" &...
0
votes
0
answers
25
views
info on partitioning in survival trees
I'm hoping to use survival trees for my dataset, where so far I mainly used proportional hazards models. I'm interested in obtaining quantiles of the survival function. I'm struggling a bit to ...
1
vote
1
answer
66
views
monte carlo methods (how to get mixed distribution from density function)
Can somebody please help me understand how to do this task:
Use mixture distribution concept to generate 4900 pseudo-random numbers
f(x) = 0 when x<-6, 4 when -6<=x<0, 3exp(-2.1x) + 2exp(-1....
0
votes
0
answers
28
views
dwp package gives me Error in FUN(X[[i]], ...) : !anyNA(x) is not TRUE
I am using the dwp package to "Account for the Fraction of Carcasses outside the Searched Area
and the Estimation of Bird and Bat Fatalities at Wind Energy Facilities"
I add 3 shapefiles ...
0
votes
0
answers
16
views
How to simulate bimodal disitribution with already known D90, D50 and D10?
I am trying to simulate partile distribution which has double bell shape. Until now, I have found some methods such as: combining two normal distribution, Lambert Generalized Bimodal distribution
...
0
votes
0
answers
17
views
Is it possible to do reliability analysis using lifeline library python using nevada data?
I have done some practices for reliability analysis using other libraries in python but I have to find the beta and eta values using lifeline library for nevada data
I need to know the format of input ...
1
vote
3
answers
78
views
A neat way in R to get mean and 5 and 95 percentiles given a probability distribution in a string format?
I would like to write a function that takes a string as an input. To be exact this input represents a probability distribution and the output would be 5 percentile, mean, and 95 percentile as a vector ...
0
votes
0
answers
89
views
How to draw a normal distribution with only integer values within a set range
I am trying to draw a normal distribution with only integers within a range. I tried reading other posts here in stackoverflow, although some are somewhat related, I still can't find the answer. I ...
2
votes
2
answers
102
views
How to calculate mean (Expected Value) of a custom continuous distribution from the probability density in R
The probability density and the calculation for the mean "by hand" are given below:
I have coded the probability density function as:
myfunc <- function(x){
ifelse(x >= 0 & x &...
0
votes
0
answers
22
views
How can I improve the following Python code to fit pseudo-Voigt profile to asymmetric peak?
I would like to fit a pseudo-Voigt profile to an asymmetric curve in order to determine the FWHM. I tried to follow the mathematical method laid out in a paper (DOI: 10.1039/c8an00710a) which outlines ...
-3
votes
1
answer
154
views
How to randomly distribute mines for a Minesweeper program
I've gotten up to Test 9/10 of the autochecker and have made my programming now 333 lines of Java code, as per the course requirement (being written in Java, not over XXX amount of lines). Basically, ...
0
votes
1
answer
27
views
MathNet.Numerics Negative Binomial - Median not Calculating
I am trying to access the Median property of the Negative Binomial Distribution via MathNet.Numerics;
var NegBin = new MathNet.Numerics.Distributions.NegativeBinomial(30, 0.03);
var median = NegBin....
0
votes
0
answers
14
views
Plotting CDF and sample distribution together in Python Plot [duplicate]
I am quite new to Python and still learning. I have time series attribute and I'd like to plot the CDF curve and sample distribution together in the chart like below. Which Python library I should be ...
0
votes
1
answer
47
views
Distribution plot for categorical variable
I have the following data table dt and want to construct/create a density plot of nrOrders for each unique delivYear:
structure(list(delivYear = c("2018", "2018", "2018", ...
1
vote
1
answer
83
views
Generating a connected and directed network in R
I am trying to generate a directed and connected scale-free network in R, such that, the in- and out-degrees of the network follow a power-law. I tried the below methods,
g<-sample_fitness_pl(...
2
votes
2
answers
170
views
In R, how to impute right-censored missing data to follow the assumed distribution?
Earlier on, random imputation of left-censored data to follow the assumed distribution has been explained here in Stack Overflow. Than can be easily achieved with the censlm package.
But what if I ...
0
votes
0
answers
43
views
Random Choices - Weighting Errors
I am trying to build a lottery system for admissions and the code keeps throwing up the weights error: The code is appended below -
import tkinter as tk
from tkinter import filedialog, messagebox
...
0
votes
1
answer
20
views
Group splunk logs by flag value
I have Splunk logs that look like this:
2023-08-15 11:51:32.148 INFO default task-107 com.company.project.log.LogService - createEvent: actionFlag: 1; orderNumber: 2000000; current DateTime: Tue Aug ...
1
vote
1
answer
88
views
Parameterizing a log normal distribution in Sheets
I'm trying to run some monte carlo simulations in Sheets, and want the option of specifying a lognormal distribution. I want to parameterize this based on the mean and 25th percentile i.e. when I run ...
0
votes
0
answers
77
views
How do I set a different prior distribution for each Numpyro Component
I'm building mixture model in Numpyro, and would like to set each component with a different prior. So far I have this where n == the number of components in the mixture.
def model(data, n):
...
0
votes
1
answer
50
views
How to pass parameters in stat_function() ggplot2
Lets say I have the following code:
get_histogram <- function(data_set, column_name, bin_width, attribute_name) {
ggplot(data_set, aes(x= {{column_name}})) +
geom_histogram(aes(y= ..density..)...
1
vote
0
answers
173
views
Bayesian framework: Plot prior predictive and posterior predictive distribution with arviz
I'm attempting to replicate the example in Figure 1.5 from this source, which illustrates the prior predictive and posterior predictive distributions. However, I'm facing difficulty comprehending what ...
1
vote
1
answer
55
views
Fit pareto distribution on amounts
I want to fit a Pareto distribution on a list of amounts (10 amounts from $400K to $10M).
But I notice that the mean formula doesn't seem to work for large numbers? I don't see where I'm making a ...
0
votes
0
answers
12
views
Include in a multivariate analysis a variable with a strong skewness in the distribution?
Good morning,
I have a doubt. In building a model on R, where I have a dichotomous dependent variable (in the multivariate analysis I then use a logistic regression), I would like to use a variable ...
1
vote
1
answer
70
views
Better Understanding Log-Normal with SciPy
I know that are plenty of questions about the log-normal in scipy as this, this, this, and this But I still have doubts.
I'm trying to reproduce this example with SciPy, because I can understand the ...
0
votes
3
answers
40
views
Calculate the mass of a distribution around a point, python
I have the following data:
ll = [25.553885868617463,
1.4285714285714288,
5.0,
14.142857142857142,
2.714285430908202,
-4.428571428571429,
3.428571428571429,
2.8571428571428568,
5....
0
votes
1
answer
29
views
Fit expected values between 2 values in pandas dataframe?
I have a timeseries dataset which I want to train using LSTM. The target column in my dataset is a measurement of a liquid at a certain timestep during an experiment.
For Example: at the 0th timestep (...
1
vote
1
answer
62
views
Generating correlated beta-distributed values in R
I have the written the following code in R with an aim to generate correlated random variables which follow the beta distribution
#objective is to generated correlated
#beta distributed data
...
0
votes
1
answer
88
views
How to get the figure produced by the fitter package?
I am using the fitter package to fit many distributions simultaneously and visualize the outcome (documentation). However, I want access to the figure it produces.
from fitter import Fitter
f = Fitter(...
0
votes
0
answers
43
views
Pulling a specific output from a function using sapply?
I'm looking to run the fitDist function on columns in a dataframe using sapply and save the output to a dataframe, using something like the following:
data.frame(sapply(df, fitDist))
Run singularly, ...
0
votes
2
answers
55
views
R distr: * operator and multiplication of random variables
For a simulation, I need to compute the distribution of the product of two discrete random variables. Although I could implement it from scratch, I thought that the distr package already provides this ...
1
vote
0
answers
113
views
Equation for rotated 2D flat-top Gaussian distribution
I'm in need for an equation for rotated 2D flat-top Gaussian distribution.
What is my problem: I have data images that look like this (image on the left):
What I'm trying to do is to fit a function ...
0
votes
1
answer
44
views
How to Calculate and Plot the Fitted Straight Line on a Probability Plot?
I am currently working on plotting a Probability Plot by using Plotly.JS , where the percentiles are represented on the y-axis and the corresponding values are plotted on the x-axis. I am aiming to ...
0
votes
0
answers
99
views
How to sample from a PyTorch/Pyro distribution with some known values? (conditional sampling)
I would like to sample from a multivariate PyTorch distribution.
This is a complex learned distribution and not a standard distribution (specifically, a TransformedDistribution created with pyro).
...
0
votes
0
answers
30
views
Where can I find the implementation of truncated normal distribution in the Tensorflow codebase?
I want to determine how truncated normal distribution is implemented in the Tensorflow code.
Essentially, I'm looking for the source code for this:
import tensorflow as tf
tf.random.truncated_normal([...
2
votes
2
answers
73
views
Truncated distribution in R with percentage above certain value?
I need a random distribution with 300 samples that vary between values of 0 and approx. 150.
Additionally, 20% of the samples should have values above 50.
I have tried something like this:
# my ...
2
votes
1
answer
37
views
Different Random Generators for different processes
I have several delays that are all distributed. These distributions involve random number generation.
I want each processing station to have its own RNG. According to anylogic I can simply create an ...
1
vote
1
answer
45
views
How to support the convergence of student-t distribution fits (stdFit and sstdFit) from fGarch package in R?
I want to fit a student-t and a skewed student-t distribution to log returns.
For this purpose I use the stdFit and sstdFit function from the fGarch package (would also use something else if someone ...
1
vote
1
answer
114
views
Laplace distribution for fitdist
I am trying to apply fitdistrplus::fitdist with Laplace distribution. I have seen the example given in this post by @Ben Bolker. However, I am having a hard time figuring out the corresponding ...