Sie sind auf Seite 1von 18

Ocenjivanje distribucije u R

okrenju okrenju
Milan Kilibarda
kili@grf.bg.ac.rs
Ispitivanje podataka
Exploratory data analysis can be te first step!
getting descriptive statistics "#ean! standard
deviation! ske$ness! kurtosis! etc.% and using
grapical tecni&ues "istogra#s! density grapical tecni&ues "istogra#s! density
esti#ate! E'()% $ic can suggest te kind of
pdf to use to fit te #odel.
*i#ulirani pri#er
set.seed"++%
x.nor#,-rnor#"n./00!#.+0!sd./%
str(x.norm) # num [1:200] 11.08 8.02 7.18 9.19 10.36 ...
#ean"x.nor#% 1 Mean "average%
#edian"x.nor#% 1 Median "2#iddle value2% #edian"x.nor#% 1 Median "2#iddle value2%
na#es"sort"-table"x.nor#%%%3+4 1 Mode "2Most fre&uently2%
sd"x.nor#% 1 *tandard deviation
var"x.nor#% 1 5ariance
su##ary"x.nor#% 1 *u##ary
(eskriptivna statistika
6istogra#
ist"x.nor#al%
*i#etrija
(eskriptivana statistika - si#etrija
library"f7asics%
ske$ness"x.nor#%
1 8ta na# govori ova vrednost9 1 8ta na# govori ova vrednost9
kurtosis"x.nor#%
1 8ta na# govori vrednost9
)unkcija gustine verovatno:e
plot"density"x.nor#%!#ain.;(ensity esti#ate of data;%
dest ,- density"x.nor#%
ist"x.nor#!probability . <R=E%
lines"dest! lty./%
E'()
plot"ecdf"x.nor#%!#ain.;E#pirical cu#ulative distribution function;%
>apir verovatno:e
?.nor#,-"x.nor#-#ean"x.nor#%%@sd"x.nor#% 11 standardi?ed
data
&&nor#"?.nor#% 11 dra$ing te AAplot
abline"0!+% 11 dra$ing a BC-degree reference line
y - empiriska verovatnoa
x teorijska
Za bilo koju teorijsku funkciju verovatnoe vidi qqplot
komandu
>apir verovatno:e
x.wei<-rweibull(n=200,shape=2.1,scale=1.1)
1 sa#pling fro# a Deibull
1 distribution $it para#eters sape./.+!scale.+.+
x.teo<-rweibull(n=200,shape=2, scale=1)
11 teorical &uantiles fro# a Deibull population
1 $it kno$n para#ters sape./ e scale.+
qqplot(x.teo,x.wei,main="QQ-plot istr. !eibull") 11 AA-plot
abline(0,1) 11 a BC-degree reference line is plotted
OdreEivanje para#etara
librar"(#$%%)
& 'itistr
'itistr(x.wei , "$eibull") 'itistr(x.wei , "$eibull")
( F *apeG ! *cale
'itistr(x.norm, "nor#al")
( - #ean ! sd
Kol#ogorovF*#irnov test
<e Kol#ogorovF*#irnov statistic &uantifies a distance
bet$een te e#pirical distribution function of te
sa#ple and te cu#ulative distribution function of
te reference distribution! or bet$een te e#pirical
distribution functions of t$o sa#ples.
& )s.test
Measures of goodness of fit
)s.test(x.norm, "pnorm",10,2)
One-sa#ple Kol#ogorov-*#irnov test dataG
x.nor#( . 0.0HIJ! p-value . 0.KB0/
alternative ypotesisG t$o-sided
L<e p-value is iger tan significance levels usually used to test L<e p-value is iger tan significance levels usually used to test
statistical ypoteses! $e accept null ypotesis tat is sa#ple
data belong for# a gaussian distribution.M
shapiro.test(x.norm)
*apiro-Dilk nor#ality test dataG x.nor#D . 0.KKC! p-value . 0.IBB/
ks.test"x.wei ,"p$eibull",scale./!sape.+%
>robabilistic approaces to risk by Ns$at
(a#odaran

Das könnte Ihnen auch gefallen