欢迎来到天天文库
浏览记录
ID:7299037
大小:730.12 KB
页数:18页
时间:2018-02-10
《reilly media] r cookbook probability》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、CHAPTER8ProbabilityIntroductionProbabilitytheoryisthefoundationofstatistics,andRhasplentyofmachineryforworkingwithprobability,probabilitydistributions,andrandomvariables.Therecipesinthischaptershowyouhowtocalculateprobabilitiesfromquantiles,calculatequ
2、an-tilesfromprobabilities,generaterandomvariablesdrawnfromdistributions,plotdis-tributions,andsoforth.NamesofDistributionsRhasanabbreviatednameforeveryprobabilitydistribution.Thisnameisusedtoidentifythefunctionsassociatedwiththedistribution.Forexample,
3、thenameoftheNormaldistributionis“norm”,whichistherootofthesefunctionnames:FunctionPurposednormNormaldensitypnormNormaldistributionfunctionqnormNormalquantilefunctionrnormNormalrandomvariatesTable8-1describessomecommondiscretedistributions,andTable8-2de
4、scribessev-eralcommoncontinuousdistributions.Table8-1.DiscretedistributionsDiscretedistributionRnameParametersBinomialbinomn=numberoftrials;p=probabilityofsuccessforonetrialGeometricgeomp=probabilityofsuccessforonetrialHypergeometrichyperm=numberofwhit
5、eballsinurn;n=numberofblackballsinurn;k=numberofballsdrawnfromurn177DiscretedistributionRnameParametersNegativebinomial(NegBinomial)nbinomsize=numberofsuccessfultrials;eitherprob=probabilityofsuccessfultrialormu=meanPoissonpoislambda=meanTable8-2.Conti
6、nuousdistributionsContinuousdistributionRnameParametersBetabetashape1;shape2Cauchycauchylocation;scaleChi-squared(Chisquare)chisqdf=degreesoffreedomExponentialexprateFfdf1anddf2=degreesoffreedomGammagammarate;eitherrateorscaleLog-normal(Lognormal)lnorm
7、meanlog=meanonlogarithmicscale;sdlog=standarddeviationonlogarithmicscaleLogisticlogislocation;scaleNormalnormmean;sd=standarddeviationStudent’st(TDist)tdf=degreesoffreedomUniformunifmin=lowerlimit;max=upperlimitWeibullweibullshape;scaleWilcoxonwilcoxm=
8、numberofobservationsinfirstsample;n=numberofobservationsinsecondsampleAlldistribution-relatedfunctionsrequiredistributionalparameters,suchassizeandprobforthebinomialorprobforthegeometric.Thebig“gotcha”isthatthedistributionalparametersma
此文档下载收益归作者所有