Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ald)
- sseq = seq(-8,8,0.01)
- dens = dALD(y=sseq,mu=0,sigma=1,p=0.25)
- dens2= dALD(y=sseq,mu=0,sigma=1,p=0.5)
- plot(sseq,dens,type="l",lwd=2,col="red",xlab="u",ylab=parse(text="f[p](u)"), main="ALD Density function")
- legend("topright", legend=c("ALD for p=0.5"),lty=c(1),
- lwd=c(1),col=c("red"),title="Values for different quantiles:")
- library(ggplot2)
- ggplot(data.frame(sseq, dens, dens2)) +
- geom_line(aes(sseq, dens, color = 'ALD for p=0.5')) +
- geom_line(aes(sseq, dens2, color = 'ALD for p=0.25')) +
- labs(x="u",y=parse(text="f[p](u)"),
- title="ALD Density function") +
- scale_color_discrete(name="Values for different quantiles:") +
- theme_minimal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement