错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Simulation Experiments

  • Jim Albert,
  • Maria Rizzo

摘要

Simulation is a versatile tool to investigate the probability distribution of an outcome of a random event or experiment. In this chapter we focus on R functions that simplify the design and implementation of common types of simulation studies. Two functions that are used throughout are the sample() function for drawing random samples with or without replacement, and the replicate() function to easily repeat blocks of code including the sampling. The examples include some famous probability problems such as the collector’s problem and the hat-check problem, and the streaky patterns found among hitters in a baseball game. Simulations are summarized with suitable plots in R graphics and ggplot graphics.