Hi R-users,
I have this code below for tweedie inverse, but I don’t understand why it 
doesn’t give zero for some of r1 values?
 
r1 <- runif(31,0,1)
p0 <- 0.72 ; p <- 1.63; mu <- 1.48; phi <- 9.61
 
tweedie.inv <- function(rand,p0,p,mu,phi)
{  y <- rand
   ind <- rand < p0
   y[ind] <- 0
   y[!ind] <- qtweedie((rand[!ind]-p0)/(1-p0),p,mu,phi)
   cbind (prob=rand,rain.amt=y)
}
 
tweedie.inv(r1,p0,p,mu,phi)
 
Thank you in advance for your attention.


      
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to