
qqplot[data_]:=
Show[
Plot[x,{x,0,1},PlotStyle->{Red,Dashed}],
ListPlot[Transpose@{N@Range[Length@data]/Length[data],
CDF[NormalDistribution[Mean@data,StandardDeviation@data],#]&/@Sort[data]},
PlotStyle->PointSize[0.01],Joined->True,
Mesh->All],
Axes->None,Frame->True,AspectRatio->1,
FrameLabel->{Text[Style["Empirical Probability",FontSize->14]],
Text[Style["Theoretical Probability",FontSize->14]]}]
(* 觀察t分配在自由度與常態分配的關係 *)
Manipulate[qqplot[RandomReal[ChiSquareDistribution[z],500]],{z,1,200,5}]
(* 使用Mathematica8內建的QuantilePlot *)
Manipulate[
QuantilePlot[RandomReal[StudentTDistribution[z],500]],{z,1,200,5}]
Tags:
Mathematica 教學,
Mathematica 教學 畫圖,
Teaching
讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~