similar to: Poisson Regression - Query

Displaying 20 results from an estimated 1000 matches similar to: "Poisson Regression - Query"

2009 Oct 27
1
Poisson dpois value is too small for double precision thus corrupts loglikelihood
Hi - I have a likelihood function that involves sums of two possions: L = a*dpois(Xi,theta1)*dpois(Yi,theta2)+b*(1-c)*a*dpois(Xi,theta1+theta3)*dpois(Yi,theta2) where a,b,c,theta1,theta2,theta3 are parameters to be estimated. (Xi,Yi) are observations. However, Xi and Yi are usually big (> 20000). This causes dpois to returns 0 depending on values of theta1, theta2 and theta3. My first
2008 Nov 14
2
GAM and Poisson distribution
Hi -I'm running a GAM with 7 explanatory variables with a Poisson error structure. All of the variables are continuous so I'm getting error messages in R. cod.fall.full.gam.model<-gam(Kept.CPUE~s(HOUR)+s(LAT_dec)+s(LONG_dec)+s(meantemp_C)+s(meandepth_fa)+s(change_depth)+s(seds), data=cod.fall.version2,family=poisson) In dpois(y, mu, log = TRUE) ... : non-integer x = 5.325517
2009 Dec 12
1
About zero-inflation poisson model
Hello all, I am Xiongqing Zhang, come from Beijing of China. I know you from the web site: http://finzi.psych.upenn.edu/Rhelp08/2008-February/154627.html. I am not very clear about the R-project software. But I want to estimate the parameters and errors of zero-inflation poisson model. Can?you help me? Data is in the attachement. Thank you. I will be very appreciated if you can help me. Best
2015 Nov 03
1
Fwd: Rcpp sugar dpois
Hi. Here is a piece of cpp code. It works, but I do not understand the rational for the use of "R::dpois" to call the function dpois since in the examples I have always found directly "dpois" or "Rcpp::dpois" that both do not work in my code. Could anyone be so patient to explain me why should it be like that? Thaks a lot, Enrico #include <Rcpp.h> using
2018 May 31
3
Understanding the sequence of events when calling the R dpois function
Hello all, I am trying to get a better understanding of the underlying code for the stats::dpois function in R and, specifically, what happens under the hood when it is called. I finally managed to track down the C course at: https://github.com/wch/r-source/blob/trunk/src/nmath/dpois.c. It would seem that the dpois C function is taking a double for each of the x and lambda arguments so I am a bit
2011 Nov 14
7
Very simple loop
I'm very new to R and am trying to create my first loop. I have: x <-c(0:200) A <- dpois(x,exp(4.5355343)) B <- dpois(x,exp(4.5355343 + 0.0118638)) C <- dpois(x,exp(4.5355343 -0.0234615)) D <- dpois(x,exp(4.5355343 + 0.0316557)) E <- dpois(x,exp(4.5355343 + 0.0004716)) F <- dpois(x,exp(4.5355343 + 0.056437)) G <- dpois(x,exp(4.5355343 + 0.1225822)) and would like to
2011 Aug 08
3
on "do.call" function
Dear all, Even though one of R users answered my question, I cannot understand, so I re-ask this question. I am trying to use "do.call", but I don't think I totally understand this function. Here is an simple example. -------------------------------------------- > B <- matrix(c(.5,.1,.2,.3),2,2) > B [,1] [,2] [1,] 0.5 0.2 [2,] 0.1 0.3 > x <- c(.1,.2) >
2011 Aug 08
1
problem in do.call function
Dear all, I am trying to use "do.call", but I don't think I totally understand this function. Here is an simple example. -------------------------------------------- > B <- matrix(c(.5,.1,.2,.3),2,2) > B [,1] [,2] [1,] 0.5 0.2 [2,] 0.1 0.3 > x <- c(.1,.2) > X <- cbind(1,x) > X x [1,] 1 0.1 [2,] 1 0.2 > > lt <-
2011 Sep 19
2
Poisson-Gamma computation (parameters and likelihood)
Good afternoon/morning readers. This is the first time I am trying to run some Bayesian computation in R, and am experiencing a few problems. I am working on a Poisson model for cancer rates which has a conjugate Gamma prior. 1) The first question is precisely how I work out the parameters. #Suppose I assign values to theta with *seq()* *theta<-seq(0,1,len=500)* #Then I try out the
2001 Feb 07
3
Goodness of fit to Poisson / NegBinomial
All, I have some data on parasites on apple leaves and want to do a goodness of fit test to a Poisson distribution. This seems to do it: mites <- c(rep(0,70), rep(1,38), rep(2,17), rep(3,10), rep(4,9), rep(5,3), rep(6,2), rep(7,1)) tab <- table(mites) NSU <- length(mites) N <-
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)))
2010 Feb 01
1
Help with multiple poisson regression with MLE2
Hi, I'm trying to make multiple poisson regressions with the MLE2 command. I have used the following expression, but I receive an error message: poisfit <- mle2(y ~ dpois(exp(b0 + b1*x1 + b2*x2)), start=list(b0=1, b1=1, b2=1), data=data1) Error in optim(par = c(1, 1, 1), fn = function (p) : non-finite initial value 'vmmin' I have changed initial values using coefficient values
2012 Jul 05
3
Maximum Likelihood Estimation Poisson distribution mle {stats4}
Hi everyone! I am using the mle {stats4} to estimate the parameters of distributions by MLE method. I have a problem with the examples they provided with the mle{stats4} html files. Please check the example and my question below! *Here is the mle html help file * http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html
2000 Feb 25
1
lambda==0 in dpois() (PR#459)
The nice new log=TRUE option in dpois appears to mess up the case where lambda=0 (I was trying to calculate the likelihood of a saturated model). Because the behavior is now always to calculate the probability in terms of exp(log(prob)), there's a test for lambda<=0 which really needs to be only lambda<0. dpois(0:5,0) ought to give 1 0 0 0 0 but gives NaNs instead. Here's
2001 Aug 01
1
glm() with non-integer responses
A question about the inner workings of glm() and dpois(): Suppose I call glm(y ~ x, family=poisson, weights = w) where y contains NON-INTEGER (but still nonnegative) values. (a) Does glm() still correctly maximise the weighted Poisson loglikelihood ? (i.e. the function given by the same formal expression as the weighted loglikelihood of independent Poisson variables Y_i except that the
2007 Jan 26
1
Bayesian inference: Poisson distribution with normal (!) prior
Hello, for a frequency modelling problem I want to combine expert knowledge with incoming real-life data (which is not available up to now). The frequency has to be modelled with a poisson distribution. The parameter lambda has to be normal distributed (for certain reasons we did not NOT choose gamma althoug it would make everything easier). I've started with the subsequent two functions to
2010 Nov 15
2
Zero truncated Poisson distribution & R2WinBUGS
I am using a binomial mixture model to estimate abundance (N) and detection probability (p) using simulated count data: -Each site has a simulated abundance that follow a Poisson distribution with lambda = 5 -There are 200 simulated sampled sites -3 repeated counts at each site - only 50 percent of the animals are counted during each count (i.e, detection probability p =0.5, see codes) We removed
2011 Apr 27
3
Kolmogorov-Smirnov test
Hi, I have a problem with Kolmogorov-Smirnov test fit. I try fit distribution to my data. Actualy I create two test: - # First Kolmogorov-Smirnov Tests fit - # Second Kolmogorov-Smirnov Tests fit see below. This two test return difrent result and i don't know which is properly. Which result is properly? The first test return lower D = 0.0234 and lower p-value = 0.00304. The lower 'D'
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2007 Dec 06
1
suggested modification to the 'mle' documentation?
Hello: I wish to again express my appreciation to all who have contributed to making R what it is today. At this moment, I'm particularly grateful for whoever modified the 'mle' code so data no longer need be passed via global variables. I remember struggling with this a couple of years ago, and I only today discovered that it is no longer the case. I'd