The following plots take the Weibull distribution (Weber distribution, Weibull distribution) as an example
For Weibull distribution (Weber distribution, Weibull distribution), please refer to my blog http://www.cnblogs.com/wwxbi/p/6141501.html
Library (GGPLOT2)
# both D and Y here are in order of size
d<-seq (0, 5, length.out=10000)
Y<-dweibull (d, shape=5, scale=1, log = FALSE)
Df<-data.frame (X=d,y)
Ggplot (Df,aes (x=d,y)) +
Geom_line (colour= "green") +
Ggtitle ("Weibull distribution \ n probability density map")
# Here's H no size order
H <-rweibull (100000, shape=5, scale=1)
Ggplot (Null,aes (x=h)) +
Geom_histogram (binwidth = 0.01,fill= "White", colour= "red") +
Ggtitle ("Weibull distribution \ n Histogram")
Ggplot (Null,aes (x=h)) +
Geom_density (colour= "green") +
Ggtitle ("Weibull distribution \ n probability density map")
Ggplot (Null,aes (x=h)) +
Geom_line (stat= "Density", colour= "green") +
Ggtitle ("Weibull distribution \ n probability density map")
Library (SQLDF)
Library (GGPLOT2)
d<-seq (0, 5, length.out=10000)
Df2<-data.frame (Num=seq (0,5,length=10000), groupid= "Λ=1,k=1", Rw=dweibull (d, scale=1,shape=1))
Df3<-data.frame (Num=seq (0,5,length=10000), groupid= "λ=1,k=1.5", Rw=dweibull (d, scale=1,shape=1.5))
Df4<-data.frame (Num=seq (0,5,length=10000), groupid= "Λ=1,k=5", Rw=dweibull (d, scale=1,shape=5))
Df<-sqldf ("
Select NUM,GROUPID,RW from DF2
UNION ALL
Select NUM,GROUPID,RW from Df3
UNION ALL
Select NUM,GROUPID,RW from Df4 ")
Ggplot (Df,aes (X=num,y=rw,group=factor (GroupID), Colour=factor (GroupID))) +
Geom_line () +
Ggtitle ("Weibull distribution \ n probability density map")
library (sqldf)
library (Ggplot2)
df2<-data.frame (Num=seq (0,5,length=10000), groupid= "Λ=1,k=1", rw= Rweibull (10000, scale=1,shape=1))
df3<-data.frame (Num=seq (0,5,length =10000), groupid= "λ=1,k=1.5", Rw=rweibull (10000, scale=1,shape=1.5))
df4 <-data.frame (Num=seq (0,5,length=10000), groupid= "Λ=1,k=5", Rw=rweibull (10000, scale=1,shape=5))
Df<-sqldf ("
Select NUM,GROUPID,RW from DF2
UNION ALL
Select NUM,GROUPID,RW from Df3
UNION ALL
Select NUM,GROUPID,RW from Df4 ")
Ggplot (Df,aes (X=rw,group=factor (GroupID), Colour=factor (GroupID))) +
Geom_density () +
Ggtitle ("Weibull distribution \ n probability density map")
Ggplot2 plotting probability density graphs