Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. library(ald)
  2. sseq = seq(-8,8,0.01)
  3. dens = dALD(y=sseq,mu=0,sigma=1,p=0.25)
  4. dens2= dALD(y=sseq,mu=0,sigma=1,p=0.5)
  5. plot(sseq,dens,type="l",lwd=2,col="red",xlab="u",ylab=parse(text="f[p](u)"), main="ALD Density function")
  6.  
  7. legend("topright", legend=c("ALD for p=0.5"),lty=c(1),
  8. lwd=c(1),col=c("red"),title="Values for different quantiles:")
  9.  
  10. library(ggplot2)
  11. ggplot(data.frame(sseq, dens, dens2)) +
  12. geom_line(aes(sseq, dens, color = 'ALD for p=0.5')) +
  13. geom_line(aes(sseq, dens2, color = 'ALD for p=0.25')) +
  14. labs(x="u",y=parse(text="f[p](u)"),
  15. title="ALD Density function") +
  16. scale_color_discrete(name="Values for different quantiles:") +
  17. theme_minimal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement