Questions tagged [poisson]

The Poisson distribution is a statistical discrete distribution for describing events occurring at random intervals. It is defined on the non-negative integers that has the property in which the mean is equal to the variance.

The Poisson probability distribution is used to model the probability of a number of events occurring during a specified time interval.

The Poisson distribution is characterized by an expected arrival rate, usually designated by the Greek lower-case letter lambda.

A discrete random variable X has a Poisson distribution indexed by a parameter λ if it has probability mass function as following:

enter image description here

Useful links:

Wikipedia entry for the Poisson distribution.

How do I generate discrete random events with a Poisson distribution?

699 questions
2
votes
1 answer

Improved inverse transform method for Poisson random variable generation in R

I am reading Section 4.2 in Simulation (2006, 4ed., Elsevier) by Sheldon M. Ross, which introducing generating a Poisson random variable by the inverse transform method. Denote pi =P(X=xi)=e^{-λ} λ^i/i!, i=0,1,... and F(i)=P(X<=i)=Σ_{k=0}^i pi to…
John Stone
  • 635
  • 4
  • 13
2
votes
1 answer

How to use non-integers in a poisson GLM?

I currently have a GLM with a poisson family but my dependent variable is not an integer. Although R gives results I get warnings. So I tried with the quasi poisson family and this did not give any warnings. Therefore I am wondering if I can use the…
jondow0404
  • 21
  • 5
2
votes
2 answers

base_margin or init_score for catboost regressor

I would like to use a CatBoost regressor for insurance applications (Poisson objective). As I need to fix the exposure, how can I set the offset of log_exposure? When using xgboost I use "base_margin", while for lightgbm I use the "init_score"…
Giorgio Spedicato
  • 2,413
  • 3
  • 31
  • 45
2
votes
0 answers

Is there a way to specify the number of segments crossings when creating random pattern of line segments?

I have been using the spatstat package to determine if a point pattern is clustered, random or regular by comparing it to relative frequency distribution of nearest-neighbor distances generated under complete spatial randomness (CSR). Code is as…
RFrap
  • 21
  • 2
2
votes
1 answer

Creating vector with Poisson increments

If we start with a vector between 0 and 1 with M = 100 increments z = np.linspace(0,10,M) this vector has equal increments from 0 to 1. I want to create a new vector where the increments z_{n+1}-z_n are distributed according to the Poisson…
rami_salazar
  • 165
  • 1
  • 7
2
votes
1 answer

How to calculate arrival rate per hour using poisson distribution in R?

I have a data frame with 66K rows and 4 columns i.e, customer ID, Customer checkin time,customer checkin hour and customer checkout time. First 6 rows of the data: cust_ID cust_checkin_time cust_checkout_time checkin hour 12345 …
Navya
  • 307
  • 3
  • 15
2
votes
1 answer

Fastest way to generate ~10^9 poisson random numbers in python/numpy

I would like to find the fastest way to generate ~10^9 poisson random numbers in python/numpy—for instance, say I have a mean Poisson parameter (calculated elsewhere) of shape (1000, 2000), and I need 500 independent samples. This is a bottleneck in…
Jayson Vavrek
  • 55
  • 1
  • 4
2
votes
2 answers

AER dispersiontest() contradict negative binomial dispersion in R

I am analyzing the Poisson regression of a data count. Poisson requires that the variance and mean is equal, so I am checking the dispersion to ensure this. For the dispersion I am using two methods: dispersiontest() by AER package. check the…
jentila
  • 35
  • 5
2
votes
1 answer

Truncating Poisson distribution on desired support in Matlab

I want to construct a 3-dimensional Poisson distribution in Matlab with lambda parameters [0.4, 0.2, 0.6] and I want to truncate it to have support in [0;1;2;3;4;5]. The 3 components are independent. This is what I do clear n=3; %number components…
TEX
  • 2,249
  • 20
  • 43
2
votes
0 answers

Additive poisson noise to an image

I have written a function to add poisson noise to an image using numpy with np.random.poisson(..). The image is already in numpy array form, using grayscale (0-255). I am wandering if it makes more physical sense to provide the numpy function with…
pierresegonne
  • 436
  • 1
  • 4
  • 15
2
votes
0 answers

How to interpret results of hurdle model that seem unusual?

I have discrete count data (trap_catch) for two groups withing the variable in_tree (1 = trap in a tree, or 0 = trap not in a tree), and I want to see if counts were different between these two groups. The data is overdispersed and there are many…
moth_lady
  • 21
  • 1
2
votes
1 answer

How can I generate an array of samples from a poisson distribution in python using jax (jit)?

I am using jax (https://github.com/google/jax) to code up a neural network, and to simulate my inputs I would like to generate an array of samples from a poisson distribution. How can I do this given jax's restrictions? I have already tried using…
I. Stone
  • 61
  • 1
  • 3
2
votes
1 answer

why scipy poisson do not have a pdf (probability density function) method?

I want to plot the probability density function of a Poisson distribution in python created using scipy. If I want to plot the pdf of a beta distribution, I would do something like the following: x = np.linspace(0, 1, 200) alphas = 4 betas = 10 pdf…
DarioB
  • 1,349
  • 2
  • 21
  • 44
2
votes
1 answer

Error when running a gam with poisson family and offset

I'm trying to run a gam in R and I'm getting a strange error message. Generally, I have some number of counts, per volume of water sampled, and I want to correct by that number of counts. I'm trying to generate a smooth function that fits the counts…
ohnoplus
  • 1,205
  • 1
  • 17
  • 29
2
votes
1 answer

Using python to extract regression coefficients

I performed a poisson regression in python and then did poisson.fit().summary to get the following output: poisson.fit().summary() """ Generalized Linear Model Regression Results …
J.Doe
  • 103
  • 2
  • 7