Displaying 20 results from an estimated 3000 matches similar to: "Poisson distribution help requested"
1999 Apr 09
7
Error in ppois function (PR#161)
Full_Name: Murray H Smith
Version: 0.63.3
OS: Windows NT
Submission from: (NULL) (130.216.5.57)
The ppois function is displaced by -0.5.
Try:
> ppois(-0.5,1)
[1] 0.3678794
> ppois(-0.51,1)
[1] 0
> ppois(0,1)
[1] 0.3678794
and
> par(mfrow=c(2,1))
> x<-seq(-1,5,0.01)
> plot(x,ppois(x,1),type="s",ylab="F(x)",main="Poisson CDF?")
>
2017 Aug 04
2
Latin hypercube sampling from a non-uniform distribution
Hello,
I am performing a sensitivity analysis using a Latin Hypercube sampling. However, I have difficulty to draw a Hypercube sample for one variable. I?ve generated this variable from a Poisson distribution as follows:
set.seed(5)
mortality_probability <- round(ppois(seq(0, 7, by = 1), lambda = 0.9), 2)
barplot(mortality_probability, names.arg = seq(0, 7, by = 1), xlab = "Age
2017 Aug 07
0
Latin hypercube sampling from a non-uniform distribution
> How can I draw a Hypercube sample for the variable mortality_probability so
> that this variable exhibits the same pattern as the observed distribution?
One simple way is to use the uniform random output of randomLHS as input to the quantile function for your desired distribution(s).
For example:
q <- randomLHS(1000, 3)
colnames(q) <- c("A", "B",
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
2009 Jan 15
1
Confidence Intervals for Poisson
Hi folks!
I run the following code to get a CI for a Poisson with lambda=12.73
library(MASS)
set.seed(125)
x <- rpois(100,12.73)
lambda_hat<-fitdistr(x, dpois, list(lambda=12))$estimate
#Confidence Intervals - Normal Approx.
alpha<-c(.05,.025,.01)
for(n in 1:length(alpha)) {
LowerCI<-mean(x)-(qnorm(1-alpha[n]/2, mean = 0, sd =
1)*sqrt(var(x)/length(x)))
2007 May 31
1
Problems when linking to R shared library
Folks,
I'm fairly sure that I'm doing something stupid, but I'm getting a few
really strange results from *some* of the distributions, but by no means
all,
when I link directly to the R shared library.
I've tried this on both Windows with the precompiled Mingw binary of R-2.5.0
(compiling my code with MinGW-3.4.2), and by building R-2.5.0 on Mandriva
Linux with gcc-3.4.4 and
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about
how I can get R to use all 8 cores of a mac pro would be most useful
and very appreciated...
(2) spent the last few hours trying to get pnmath to compile under os-
x 10.5.4...
using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from
CRAN, xcode 3.0...
...xcode 3.1 installed over top of above after
2018 Dec 04
3
Bug report: Function ppois(0:20, lambda=0.9) does not generate a non-decreasing result.
Le 04/12/2018 ? 11:27, I?aki Ucar a ?crit?:
> On Tue, 4 Dec 2018 at 11:12, <qweytr1 at mail.ustc.edu.cn> wrote:
>> function ppois is a function calculate the CDF of Poisson distribution, it should generate a non-decreasing result, but what I got is:
>>
>>> any(diff(ppois(0:19,lambda=0.9))<0)
>> [1] TRUE
>>
>> Actually,
>>
>>>
2007 Jun 13
1
Normal and Poisson tail area expectations in R
I am interested in R functions for the following integrals / sums (expressed best I can in text) -
Normal: G_u(k) = Integration_{Lower limit=k}^{Upper limit=infinity} [(u -k) f(u) d(u)], where where u is N(0,1), and f(u) is the density function.
Poisson: G(lambda,k) = Sum_{Lower limit=k}^{Upper limit=infinity} [(x-k) p(x, lambda)] where P(x,lambda) is the Poisson prob function with parameter
2018 Dec 03
2
Bug report: Function ppois(0:20, lambda=0.9) does not generate a non-decreasing result.
function ppois is a function calculate the CDF of Poisson distribution, it should generate a non-decreasing result, but what I got is:
> any(diff(ppois(0:19,lambda=0.9))<0)
[1] TRUE
Actually,
> ppois(19,lambda=0.9)<ppois(18,lambda=0.9)
[1] TRUE
Which could not be TRUE.
Code is tested in both R 3.5.1 and Microsoft R Open 3.5.1.
_
2008 Nov 06
2
Confidence limits for the parameter of the Poisson distribution
Hi all,
So far I only know one way to get the confidence limit for the Poisson
distribution is to use the look-up table given by the 2 parameter (the
number of observation x and the confidence level, e.g. 95%) and the table is
limit by the maximum number of observations (x <= 50).
I know the formula to compute the CI, however, mathematically it is not
easy to do it. So, anyone know an R
2004 Jan 15
1
Exactness of ppois
Hello,
by checking the precision of a convolution algorithm, we found the
following "inexactness":
We work with R Version 1.8.1 (2003-11-21) on Windows systems (NT, 2000,
XP).
Try the code:
## Kolmogorov distance between two methods to
## determine P(Poisson(lambda)<=x)
Kolm.dist <- function(lam, eps){
x <- seq(0,qpois(1-eps, lambda=lam), by=1)
max(abs(ppois(x,
2010 Jun 13
1
Simulating a Poisson Process in R by calling C Code over .Call
Hi
I want to write a C function for the R Code below and call it with .Call:
SimPoisson <- function(lambda,tgrid,T2M)
#Simulation eines Poissonprozesses
{
NT <- 0
Ni <- rep(0,length(tgrid))
tau <- 0
sign <- 0
if(lambda != 0)
{
i=1
j=1
while (1)
{
EVar <- rexp(1,lambda)
sign <- sign + EVar
if (sign > T2M)
{
break
}
tau[i] <- sign
2017 Aug 07
2
Latin hypercube sampling from a non-uniform distribution
Thanks for your answer.
However, my variable is simulated from the cumulative distribution function of the Poisson distribution. So, the pattern obtained from the function "qpois" is not the same as the observed pattern (i.e., obtained from the function "ppois")
set.seed(5)
mortality_probability <- round(ppois(seq(0, 7, by = 1), lambda = 0.9), 2)
2009 Jul 28
4
How to do poisson distribution test like this?
Dear R-listers,
I want to reperfrom a poisson distribution test that presented in a
recent-published biological research paper (Plant Physiology 2008, vol 148,
pp. 1189-1200). That test is about the occurrence number of a kind of gene
in separate chromosomes.
For instance:
The observed gene number in chromosome A is 36.
The expected gene number in chromosome A is 30.
Then, the authors got a
2009 Mar 17
3
R does not compile any more on FreeBSD 8.0-CURRENT
On a recent FreeBSD 8.0-CURRENT (i386) building R (any version) breaks
with the following messages:
----------------------------------------------------------------------
[...snip...]
gcc -std=gnu99 -I. -I../../src/include -I../../src/include
-I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wilcox.c -o wilcox.o
gcc -std=gnu99 -I. -I../../src/include -I../../src/include
-I/usr/local/include
1998 Mar 25
1
R-beta: qpois help
version .62:
---------------------------------------------
> ?qpois
The Poisson Distribution
dpois(x, lambda)
ppois(q, lambda)
qpois(p, lambda)
rpois(n, lambda)
Arguments:
x: vector of (positive) quantiles.
p: vector of probabilities.
n: number of random values to return.
lambda: vector of positive means.
2004 Jun 20
3
Greater than 1 or less than 1?
I have problem evaluating the expression h = exp(x)/(exp(exp(x))-1) for
large negative x. This expression is actually the probability
that y = 1 when y is a Poisson random variable truncated at 0, hence
must satisfy 0 <= h <= 1. However, when
x < -18, I may get an h value that is larger than 1 while the true
value should be a quantity that is smaller than but very close to 1.
For
1997 Jun 25
3
R-alpha: lbeta, ctrl-C and crashes
1. lbeta and beta do not work properly: lbeta returns its first
argument and beta gives the lbeta result.
In names.c lines 245-6, the codes for these should be 2 and 3 instead
of 1 and 2
2. crtl-C does not work (except the first time) on Red Hat elf Linux
(which has many many other problems as well) nor on the previous
version of Linux for Amiga. It worked on Slackware aout Linux and now
works