优化营销平台流程_第1页
优化营销平台流程_第2页
优化营销平台流程_第3页
优化营销平台流程_第4页
优化营销平台流程_第5页
已阅读5页,还剩33页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ExampleAstudentattemptsamultiplechoiceexam(optionsAtoFforeachquestion),buthavingdonenowork,selectshisanswerstoeachquestionbyrollingafairdie(A=1,B=2,etc.).Iftheexamcontains100questions,whatistheprobabilityofobtainingamarkbelow20?SimulationNow,letussimulatealargenumberofrealisationsofstudentsusingthisrandommethodofansweringmultiplechoicequestions.WestillrequirethesameBinomialdistributionwithn=100anda=ThiscanbedoneonRusingthecommandrbinom.Forexample,let’ssimulate1000students.>xsim=rbinom(1000,100,1/6)>xsim

[1]18229171820211681811161613161425151617[21]1325112417161321101718101718191719151312[41]1511212319141925231920171715161413161714[61]242119818202216152019171315132122121212[81]111411121616172117161714917161712201617[101]1813151612151716172618142115102312161612[121]1718221718141922131721152116171616281617[141]1819161114181618181420131919222213171917[161]182011221925151517185151413181517152017[181]1614231716101216213016132214151617141618[201]1420161925141524221915172210201310151422[221]171216192017152114132111199212216131312[241]14131881418101610122118151716819171118[261]2317201612201116221716132220151520172214[281]1823182020161916151918171422152417151722

[301]1822101924211614111420152111171620191314[321]1717191517131823161225131321191620271918[341]1824152313131415231319151119171215151714[361]1820171316141320181518161720141921121317[381]221719161418161812161315169151618221416[401]1417121621162113141918181619171717131711[421]1616131026122017111918121514142015151511[441]1823202313121822121613212214182117121916[461]171815222220151613121922162019191681512[481]2926191620151122152021141613171510131712[501]1820171413192311271917161720211520202119[521]211613211619139102012181413181922192118[541]617171919222318131217162116182119132219

[561]2017181517151510181323171423221018111118[581]161714139121414212324191215171811141919[601]191617131315171817139191822171314221323[621]231919162414171817131612715171618221915[641]161818132018126151116191213111711151119

[661]1716162112182019161418171614111717161717[681]171816181218182019131216141313615121914[701]201716142119152617201224131119211813916[721]916171615121121211319131316111715192219[741]1113141620151612181412142112232119102417[761]1719191518121414142012201221192021201718[781]1512162316161915121421251219202217162120[801]232417201719142220251012151671414182210[821]1522231812101418151518102111201520101316[841]161722191916820171321162516131714171921[861]1719142220181419172320181411161826242418[881]2116232014161513141112131416181716171320[901]228171716161422171818211511202118151921[921]1622141216201621111319142312121714152617[941]1814211714242112211320221120101616151913[961]161516179141112191716152114151415171516[981]1911151717171118211415171816112219161415Itmakessensenowtolookatpropertiesofthese1000simulationswhichhavebeenplacedinthevector“xsim”.>mean(xsim)[1]16.624>median(xsim)[1]17>sd(xsim)[1]3.778479>var(xsim)[1]14.2769>Nowcomparetheactualvaluesfromthesimulations,withthetheoreticalvaluesfromtheprobabilitydistribution.

SIMULATION

THEORETICALMEAN 16.624

16.66667VARIANCE 14.2769

13.88889Afullsummaryoftheresultsofthesimulationisgivenwith:>table(xsim)xsim

567891011121314151617132710214057728082118118

1819202122232425262728293085836155462514962111>AHistogramcanalsobeplottedofthis:>hist(xsim)NoticethataBARPLOTofxsimdoesNOTproduceausefulgraph!>barplot(xsim)AbarplotoftheTABLEofxsimdoeswork,though.>barplot(table(xsim))PoissonDistributionThePoissondistributionisusedtomodelthenumberofeventsoccurringwithinagiventimeinterval.TheformulaforthePoissonprobabilitydensity(mass)functionisistheshapeparameterwhichindicatestheaveragenumberofeventsinthegiventimeinterval.Someeventsareratherrare-theydon'thappenthatoften.Forinstance,caraccidentsaretheexceptionratherthantherule.Still,overaperiodoftime,wecansaysomethingaboutthenatureofrareevents.Anexampleistheimprovementoftrafficsafety,wherethegovernmentwantstoknowwhetherseatbeltsreducethenumberofdeathincaraccidents.Here,thePoissondistributioncanbeausefultooltoanswerquestionsaboutbenefitsofseatbeltuse.OtherphenomenathatoftenfollowaPoissondistributionaredeathofinfants,thenumberofmisprintsinabook,thenumberofcustomersarriving,andthenumberofactivationsofaGeigercounter.ThedistributionwasderivedbytheFrenchmathematicianSimééonPoissonin1837,andthefirstapplicationwasthedescriptionofthenumberofdeathsbyhorsekickinginthePrussianarmy.ExampleArrivalsatabus-stopfollowaPoissondistributionwithanaverageof4.5everyquarterofanhour.Obtainabarplotofthedistribution(assumeamaximumof20arrivalsinaquarterofanhour)andcalculatetheprobabilityoffewerthan3arrivalsinaquarterofanhour.Theprobabilitiesof0upto2arrivalscanbecalculateddirectlyfromtheformulawith=4.5Sop(0)=0.01111Similarlyp(1)=0.04999andp(2)=0.11248Sotheprobabilityoffewerthan3arrivalsis0.01111+0.04999+0.11248=0.17358RCodeAswiththeBinomialdistribution,thecodesdpoisandppoiswilldothecalculationsforyou.>x=dpois(0:20,4.5)>x[1]1.110900e-024.999048e-021.124786e-011.687179e-011.898076e-01[6]1.708269e-011.281201e-018.236295e-024.632916e-022.316458e-02[21]5.294202e-08>>barplot(x,names=0:20)Nowcheckthatppoisgivesthesameanswer(ppoisisacumulativedistribution).>ppois(2,4.5)[1]0.1735781>Consideracollectionofgraphsfordifferentvaluesof=3=4=5=6=10Inthelastcase,theprobabilityof20arrivalsisnolongernegligible,soval

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论