Skip to content

hhpfiona/Estimating-Probabilities-Via-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Estimating Probabilities via Simulation in R [October 2023]

Welcome to my project where I explore RStudio's powerful capabilities and delve into the world of probability estimation using simulation. This project is a deep dive into the fundamentals of R programming, reproducible workflows, and the statistical concepts that shape data science.

Project Overview

This repository contains R Markdown (.Rmd) that detail simulations and experiments designed to estimate probabilities in fun and educational ways. Throughout this project, I use R to simulate random events, test outcomes, and explore concepts like fair and weighted die rolls, conditional probabilities, and combinatorial problems.

What's Inside?

  • R Code Demonstrations: From simulating fair coin tosses to rolling a six-sided die thousands of times, I've coded simple yet enlightening experiments that illustrate the beauty of randomness and probability estimation.
  • Simulation Techniques: Learn how pseudo-random number generators work in R, and discover the importance of reproducibility using functions like set.seed().
  • Combinatorial Calculations: Dive into R’s built-in functions to solve classic combinatorial problems, like computing factorials and combinations, and explore how these apply to real-world probability scenarios.
  • Conditional Probability Experiments: Test and visualize outcomes using simulations, making complex statistical concepts more intuitive.

Key Features

  • Interactive Simulations: The code includes plenty of interactive examples that can be tweaked and run in RStudio to understand probability concepts better.
  • Comprehensive Comments: I’ve added detailed comments throughout the code to explain the logic behind each simulation and how results are interpreted.
  • Reproducibility: By setting seeds and using structured R Markdown workflows, this project ensures that results are consistent, making it easy to follow and replicate.

Getting Started

To try out the simulations yourself, you’ll need to:

  1. Clone this repository to your local machine.
  2. Open the .Rmd file in RStudio.
  3. Run the code chunks by clicking the play button in each chunk or knitting the entire file to a PDF using the “Knit” function.

Learning Outcomes

  • Gain hands-on experience with RStudio and R Markdown.
  • Understand the principles of probability estimation via simulation.
  • Familiarize yourself with R functions like sample(), mean(), factorial(), and choose().
  • Explore the importance of reproducibility in data science using set.seed().

Why This Project?

I embarked on this project to solidify my understanding of R and to build a strong foundation in data analysis and statistical simulation. It's not just a school exercise but a personal challenge to dive deeper into the world of statistics, programming, and reproducible research.

Feel free to explore, run the code, and share your thoughts or ideas for improvement. Let’s make learning R both practical and fun!


Note: Make sure to download and use RStudio to run the R code and explore the PDF outputs generated from this project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors