Book Image

Simulation for Data Science with R

By : Matthias Templ
Book Image

Simulation for Data Science with R

By: Matthias Templ

Overview of this book

Data Science with R aims to teach you how to begin performing data science tasks by taking advantage of Rs powerful ecosystem of packages. R being the most widely used programming language when used with data science can be a powerful combination to solve complexities involved with varied data sets in the real world. The book will provide a computational and methodological framework for statistical simulation to the users. Through this book, you will get in grips with the software environment R. After getting to know the background of popular methods in the area of computational statistics, you will see some applications in R to better understand the methods as well as gaining experience of working with real-world data and real-world problems. This book helps uncover the large-scale patterns in complex systems where interdependencies and variation are critical. An effective simulation is driven by data generating processes that accurately reflect real physical populations. You will learn how to plan and structure a simulation project to aid in the decision-making process as well as the presentation of results. By the end of this book, you reader will get in touch with the software environment R. After getting background on popular methods in the area, you will see applications in R to better understand the methods as well as to gain experience when working on real-world data and real-world problems.
Table of Contents (18 chapters)
Simulation for Data Science with R
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Summary


Generally, in science, every result should be reproducible, especially in quantitative analysis. This is possible by setting the seed of a deterministic pseudo random number generator. Secondly, and also very crucial, is to have a well-working random number generator to simulate random numbers from a uniform distribution. R's default random number generator, the Mersenne-Twister register-based algorithm, works pretty well. Simulated random numbers should possibly not be auto-correlated, and they should have a very long period. Otherwise, results might be biased and not trustable.

Based on uniform random numbers, random numbers from other distributions can be simulated. The important methods are the inversion method and rejection sampling. Especially rejection sampling, which can be broadly used and results in independent identical distributed random numbers.

For very specific tasks, this i.i.d. assumption must be rejected, and other methods are the only way to simulate (multivariate...