26 lines
898 B
R
26 lines
898 B
R
|
## Exemples de courbes de densité
|
||
|
library(MASS)
|
||
|
source("fonctions.r")
|
||
|
dGAL1 <- function(x) dGALkappa(x,param=c(0,1,1,1))
|
||
|
dGAL2 <- function(x) dGALkappa(x,param=c(0,1,2,1))
|
||
|
dGAL3 <- function(x) dGALkappa(x,param=c(0,1,2,2))
|
||
|
dGAL4 <- function(x) dGALkappa(x,param=c(0,1,.5,1))
|
||
|
pdf("dGAL-exemples.pdf")
|
||
|
curve(dGAL1,from=-5,to=5,n=500,xlab="y",ylab="f(y)")
|
||
|
curve(dGAL2,from=-5,to=5,n=500,add=TRUE)
|
||
|
curve(dGAL3,from=-5,to=5,n=500,add=TRUE)
|
||
|
curve(dGAL4,from=-5,to=5,n=500,add=TRUE)
|
||
|
points(-2,dGAL1(-2),pch=21)
|
||
|
points(1,dGAL1(1),pch=21)
|
||
|
points(-2,dGAL2(-2),pch=22)
|
||
|
points(0.49,dGAL2(0.49),pch=22)
|
||
|
points(-2,dGAL3(-2),pch=15)
|
||
|
points(0.25,dGAL3(0.25),pch=15)
|
||
|
points(-2,dGAL4(-2),pch=16)
|
||
|
points(1.5,dGAL4(1.5),pch=16)
|
||
|
pchgraph <- c(21,22,15,16)
|
||
|
noms <- c("GAL(x; 0, 1, 1, 1)","GAL(x; 0, 1, 2, 1)","GAL(x; 0, 1, 2, 2)","GAL(x; 0, 1, 0.5, 1)")
|
||
|
legend(-5, 0.7, noms, cex=1.0,
|
||
|
pch=pchgraph, lty=1)
|
||
|
dev.off()
|