rpoistweedie: Random generation for the Poisson-Tweedie family of...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Random generation for the Poisson-Tweedie family of distributions

Usage

1
rpoistweedie(n, p, mu, lambda, theta0)

Arguments

n

number of random values to return.

p

vector of probabilities.

mu

the mean.

lambda

the dispersion parameter.

theta0

the canonical parameter.

Details

The Poisson-Tweedie family of distributions belong to the class of exponential dispersion models (EDMs), famous for their role in generalized linear models.

Value

random sample (rpoistweedie) for the given Poisson-Tweedie distribution with parameters

Author(s)

Cactha David Pechel, Laure Pauline Fotso and Celestin C Kokonendji Maintainer: Cactha David Pechel ( <davidpechel@yahoo.fr>)

See Also

varpt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
   
## --------------- function rpoistweedie()---------------- ##
layout(matrix(2 :1, 2,1))
layout.show(2) 
power<-exp(30) 
mu<-10
lambda <- 10
theta0<--10
prob<-1-(mu/(1+mu))
lambda1<-100
n<-10
set.seed(123)
x1<-rpoistweedie(n,power,mu,lambda,theta0)
set.seed(123)
x2<-rpois(n,lambda1)
hist(x1, xlim = c(min(x1),max(x1)), probability = FALSE,
  col ='blue',xlab="modalit\'{e}s: x1",ylab="effectifs ",
  nclass = max(x1) - min(x1),main="Histogramme de x1 
 (lambda=100, n=10)")
hist(x2, xlim = c(min(x2),max(x2)), probability = FALSE, 
  col ='blue',xlab="modalit\'{e}s: x2 ",ylab="effectifs ",
  nclass = max(x2) - min(x2),main="Histogramme de x2 
  (lambda1=100, n=10)")
sum(x2-x1)



 






 

poistweedie documentation built on Jan. 27, 2021, 5:11 p.m.