के साथ फिटडिस्ट प्लॉट बनाना fitdistrplus
पैकेज से fitdist
फ़ंक्शन के साथ सामान्य वितरण को फिट किया गया। denscomp
, qqcomp
, cdfcomp
और ppcomp
का उपयोग करके हम histogram against fitted density functions
, theoretical quantiles against empirical ones
, the empirical cumulative distribution against fitted distribution functions
, और theoretical probabilities against empirical ones
क्रमशः नीचे दिए गए अनुसार प्लॉट कर सकते हैं।ggplot2
set.seed(12345)
df <- rnorm(n=10, mean = 0, sd =1)
library(fitdistrplus)
fm1 <-fitdist(data = df, distr = "norm")
summary(fm1)
denscomp(ft = fm1, legendtext = "Normal")
qqcomp(ft = fm1, legendtext = "Normal")
cdfcomp(ft = fm1, legendtext = "Normal")
ppcomp(ft = fm1, legendtext = "Normal")
मैं ggplot2
के साथ इन fitdist
प्लॉट बनाने में उत्सुकता से रूचि रखता हूं। मेगावाट के नीचे है:
qplot(df, geom = 'blank') +
geom_line(aes(y = ..density.., colour = 'Empirical'), stat = 'density') +
geom_histogram(aes(y = ..density..), fill = 'gray90', colour = 'gray40') +
geom_line(stat = 'function', fun = dnorm,
args = as.list(fm1$estimate), aes(colour = 'Normal')) +
scale_colour_manual(name = 'Density', values = c('red', 'blue'))
ggplot(data=df, aes(sample = df)) + stat_qq(dist = "norm", dparam = fm1$estimate)
मैं अत्यधिक सराहना करते हैं अगर कोई मुझे ggplot2
के साथ इन fitdist
भूखंडों बनाने के लिए संकेत दे चाहते हैं। धन्यवाद
यदि यह एक बाउंटी संलग्न नहीं था तो मैं बहुत व्यापक रूप से बंद करने के लिए वोट दूंगा। प्रत्येक ग्राफ एक अलग सवाल होना चाहिए (हालांकि आपको प्रत्येक ग्राफ के लिए पूछने की आवश्यकता नहीं हो सकती है यदि आपके पास उनमें से एक या दो का जवाब था)। – Roland