{"id":26772940,"url":"https://github.com/paulgovan/pra","last_synced_at":"2025-04-15T21:25:00.236Z","repository":{"id":244486994,"uuid":"815388332","full_name":"paulgovan/PRA","owner":"paulgovan","description":"Project Risk Analysis","archived":false,"fork":false,"pushed_at":"2025-04-11T18:45:27.000Z","size":4105,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T19:49:28.676Z","etag":null,"topics":["causal-networks","contingency-analysis","monte-carlo-simulation","r","risk-analysis","sensitivity-analysis"],"latest_commit_sha":null,"homepage":"https://paulgovan.github.io/PRA/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulgovan.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-15T02:56:42.000Z","updated_at":"2025-04-11T18:45:31.000Z","dependencies_parsed_at":"2024-08-04T03:37:59.443Z","dependency_job_id":"57e2cc1b-a285-4e3b-98b1-6f102ebc2925","html_url":"https://github.com/paulgovan/PRA","commit_stats":null,"previous_names":["paulgovan/pra"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgovan%2FPRA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgovan%2FPRA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgovan%2FPRA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgovan%2FPRA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulgovan","download_url":"https://codeload.github.com/paulgovan/PRA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249155596,"owners_count":21221635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["causal-networks","contingency-analysis","monte-carlo-simulation","r","risk-analysis","sensitivity-analysis"],"created_at":"2025-03-29T01:30:21.827Z","updated_at":"2025-04-15T21:25:00.229Z","avatar_url":"https://github.com/paulgovan.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n## PRA\n\n![](https://github.com/paulgovan/PRA/blob/main/inst/logo.png?raw=true){width=25%}\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/PRA)](https://CRAN.R-project.org/package=PRA)\n[![CRAN checks](https://badges.cranchecks.info/summary/PRA.svg)](https://cran.r-project.org/web/checks/check_results_PRA.html)\n[![](http://cranlogs.r-pkg.org/badges/grand-total/PRA)](https://cran.r-project.org/package=PRA)\n[![](http://cranlogs.r-pkg.org/badges/last-month/PRA)](https://cran.r-project.org/package=PRA)\n[![](https://img.shields.io/badge/doi-10.32614/CRAN.package.PRA-green.svg)](https://doi.org/10.32614/CRAN.package.PRA)\n\u003c!-- badges: end --\u003e\n\n## Key features:\n\n* Second Moment Analysis\n* Monte Carlo Simulation\n* Contingency Analysis\n* Sensitivity Analysis \n* Earned Value Management\n* Learning Curves\n* Design Structure Matrices\n\n## Installation\n\nTo install the release verion of PRA, use:\n\n``` r\ninstall_packages('PRA')\n```\n\nYou can install the development version of PRA like so:\n\n``` r\ndevtools::install_github('paulgovan/PRA')\n```\n\n## Usage\n\nHere is a basic example which shows you how to solve a common problem using Monte Carlo Simulation.\n\nFirst, load the package:\n\n``` {r}\nlibrary(PRA)\n```\n\nNext, set the number of simulations and describe probability distributions for 3 work packages:\n\n```{r}\nnum_simulations \u003c- 10000\ntask_distributions \u003c- list(\n  list(type = \"normal\", mean = 10, sd = 2),  # Task A: Normal distribution\n  list(type = \"triangular\", a = 5, b = 10, c = 15),  # Task B: Triangular distribution\n  list(type = \"uniform\", min = 8, max = 12)  # Task C: Uniform distribution\n)\n```\n\nThen, set the correlation matrix between the 3 work packages:\n\n```{r}\ncorrelation_matrix \u003c- matrix(c(\n  1, 0.5, 0.3,\n  0.5, 1, 0.4,\n  0.3, 0.4, 1\n), nrow = 3, byrow = TRUE)\n```\n\nFinally, run the simulation using the `mcs` function:\n\n```{r}\nresults \u003c- mcs(num_simulations, task_distributions, correlation_matrix)\n```\n\nTo calculate the mean of the total duration:\n\n```{r, results='asis'}\ncat(\"Mean Total Duration is \", round(results$total_mean, 2))\n```\n\nTo calculate the variance of the total duration:\n\n```{r, results='asis'}\ncat(\"Variance around the Total Duration is \", round(results$total_variance, 2))\n```\n\nTo build a histogram of the total duration:\n\n```{r}\nhist(results$total_distribution, breaks = 50, main = \"Distribution of Total Project Duration\", \n     xlab = \"Total Duration\", col = \"skyblue\", border = \"white\")\n```\n\n## More Resources\n\nMuch of this package is based on the book [Data Analysis for Engineering and Project Risk Managment](https://doi.org/10.1007/978-3-030-14251-3) by Ivan Damnjanovic and Ken Reinschmidt and comes highly recommended.\n\n## Code of Conduct\n  \nPlease note that the PRA project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulgovan%2Fpra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulgovan%2Fpra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulgovan%2Fpra/lists"}