AI GENERATED CONTENT — POSTED AS IS. Questions and topic outlines were adapted from Open Education source posts (attributed to this site and, where identified there, Sayed Ahmed). Newly AI-generated explanations, original synthetic graphics and code are offered for reuse without copyright restrictions asserted by this blog. Third-party rights remain applicable; AI can make mistakes.
Advanced Data Visualization – 001: course index · Source articles: Post 16057 · Post 16176 · Post 76580 · Post 78189
Learning goals: Comparing distributions is more informative than comparing means alone. The original site includes boxplots, outliers, violin charts and multivariate statistical graphics; this lesson explains when each can mislead.

Theory and practical decisions
A boxplot summarizes five-number statistics under a convention for whiskers; a violin combines kernel density estimation with a symmetric silhouette. KDE bandwidth strongly changes shape, especially for small samples, so display raw observations where practical.
An empirical cumulative distribution function (ECDF) reports the share of observations at or below x. It avoids arbitrary histogram bins and makes percentiles visible, but does not by itself encode time order.
Mathematical model
ECDF Fₙ(x)=(1/n)Σ1[xᵢ≤x]. A conventional outlier fence is Q1−1.5·IQR and Q3+1.5·IQR; these are descriptive flags, not proof of error.
Python example and plot
import numpy as np, matplotlib.pyplot as plt
a=np.array([8,9,10,11,12,12,13,14,40])
b=np.array([8,8,9,10,10,11,12,13,14])
fig,axes=plt.subplots(1,2,figsize=(9,4))
axes[0].boxplot([a,b],tick_labels=["A","B"])
axes[0].set_title("Boxplots and outlier")
for x,label in [(a,"A"),(b,"B")]:
sorted_x=np.sort(x)
axes[1].step(sorted_x,np.arange(1,len(x)+1)/len(x),
where="post",label=label)
axes[1].set(xlabel="Value",ylabel="ECDF",title="Empirical CDF")
axes[1].legend()
plt.tight_layout();plt.show()
R example and plot
library(ggplot2)
d <- data.frame(group=rep(c("A","B"),each=9),
value=c(8,9,10,11,12,12,13,14,40,
8,8,9,10,10,11,12,13,14))
ggplot(d,aes(group,value,fill=group))+
geom_violin(alpha=.3,trim=FALSE)+
geom_boxplot(width=.14,outlier.shape=NA)+
geom_jitter(width=.08,height=0)+theme_minimal()
ggplot(d,aes(value,colour=group))+stat_ecdf()+
labs(title="ECDF comparisons")+theme_minimal()
Expected output and interpretation
Group A has a high outlying observation (40), while Group B is compact. Their means differ substantially, even though many central values are close. The ECDF exposes the jump near 40.
Questions and answers
Q1. Can boxplot outliers always be discarded?
Answer. No. They may be legitimate rare events; investigate measurement and collection processes first.
Q2. Why use ECDF over a histogram?
Answer. It directly shows quantiles without arbitrary bin boundaries.
Q3. What limits a violin plot?
Answer. Kernel smoothing can invent apparent modes or hide gaps, especially with small datasets.
Assessment
Visualize the same two groups with boxplots, violin plots and ECDFs; argue which plot best communicates an extreme observation.
Translated to Bengali / বাংলায় অনুবাদ
বাংলা অনুবাদ: উপরের ব্যাখ্যামূলক পাঠ ও প্রশ্নোত্তরের সহজ ও শুদ্ধ বাংলা রূপ এখানে দেওয়া হলো। কোডের Python ও R সিনট্যাক্স অপরিবর্তিত।
শেখার লক্ষ্য: শুধু গড় তুলনা না করে সম্পূর্ণ বণ্টন তুলনা করলে বেশি তথ্য পাওয়া যায়। সাইটের মূল লেখায় বক্সপ্লট, ব্যতিক্রমী মান ও ভায়োলিন চার্ট আছে; এগুলোর সীমাবদ্ধতা বুঝে ব্যবহার করা জরুরি।
বক্সপ্লটে পাঁচ-সংখ্যার সারাংশ দেখানো হয়; ভায়োলিন চার্টে ঘনত্বের আকার দেখানো হয়। KDE-এর ব্যান্ডউইডথ বদলালে আকৃতি অনেক বদলাতে পারে, বিশেষত ছোট নমুনায়। সম্ভব হলে আসল বিন্দুগুলোও দেখান।
ECDF কোনো মান x-এর সমান বা কম পর্যবেক্ষণের অনুপাত দেখায়। এতে হিস্টোগ্রামের মতো বিন নির্বাচন করতে হয় না এবং শতাংশক দেখা সহজ; তবে সময়ের ক্রম জানা যায় না।
গাণিতিক ধারণা: ECDF হলো Fₙ(x)=(1/n)Σ1[xᵢ≤x]। প্রচলিত ব্যতিক্রম-সীমা Q1−1.5·IQR থেকে Q3+1.5·IQR। সীমার বাইরে হলেই তথ্য ভুল—এমন সিদ্ধান্ত নেওয়া যাবে না।
প্রত্যাশিত ফল: A গোষ্ঠীতে ৪০ একটি অনেক বেশি মান, আর B তুলনামূলকভাবে সন্নিবিষ্ট। গড়ের পার্থক্য বড় হলেও অনেক মধ্যবর্তী মান কাছাকাছি। ECDF-তে ৪০-এর কাছে বড় লাফ দেখা যায়।
প্রশ্ন 1. বক্সপ্লটের ব্যতিক্রমী মান কি সবসময় বাদ দেব?
উত্তর: না। এগুলো সত্যিকারের বিরল ঘটনা হতে পারে; আগে পরিমাপ ও সংগ্রহ-পদ্ধতি পরীক্ষা করুন।
প্রশ্ন 2. হিস্টোগ্রামের বদলে ECDF কেন ব্যবহার করব?
উত্তর: বিনের সীমানা নির্ধারণ ছাড়াই শতাংশক বোঝা যায়।
প্রশ্ন 3. ভায়োলিন চার্টের সীমাবদ্ধতা কী?
উত্তর: মসৃণকরণে কৃত্রিম শীর্ষবিন্দু দেখা দিতে পারে কিংবা ফাঁক ঢাকা পড়তে পারে।
বাংলা অনুশীলন
একই দুই গোষ্ঠীকে বক্সপ্লট, ভায়োলিন ও ECDF-তে দেখান। চরম মান বোঝানোর জন্য কোনটি ভালো, যুক্তি দিন।
মূল উৎসগুলোর লিংক উপরে আছে। এআই-তৈরি নিজস্ব ব্যাখ্যা ও চিত্র পুনর্ব্যবহারে এই ব্লগ থেকে কপিরাইটের বিধিনিষেধ দেওয়া হচ্ছে না। তৃতীয় পক্ষের অধিকার আলাদা। এআই ভুল করতে পারে, তাই যাচাই করুন।
Discover more from Open Education
Subscribe to get the latest posts sent to your email.
