Skip to content

Add sensitivity analysis support for exponential distribution#18

Draft
nehill197 wants to merge 4 commits intomainfrom
dexp-sensitivity
Draft

Add sensitivity analysis support for exponential distribution#18
nehill197 wants to merge 4 commits intomainfrom
dexp-sensitivity

Conversation

@nehill197
Copy link
Copy Markdown
Member

No description provided.

@nehill197 nehill197 requested a review from joethorley June 1, 2023 19:49
@nehill197 nehill197 marked this pull request as draft June 1, 2023 19:49
@nehill197 nehill197 marked this pull request as ready for review June 2, 2023 16:56
@nehill197
Copy link
Copy Markdown
Member Author

To increase the sd of the exponential distribution, we need to divide the rate parameter by a factor:

x <- seq(0, 50, by = 0.01)

rate <- 2
plot(x, dexp(x, rate), type = "l")
lines(x, dexp(x, rate * 10), type = "l", col = "blue")
lines(x, dexp(x, rate / 10), type = "l", col = "red")

n <- 10000
ran <- rexp(n, rate)
sd(ran)
mean(ran)

ran_mult <- rexp(n, rate * 10)
sd(ran_mult)
mean(ran_mult)

ran_div <- rexp(n, rate / 10)
sd(ran_div)
mean(ran_div)

@nehill197
Copy link
Copy Markdown
Member Author

Fix regex to have it correctly modify the form dexp(1/10)

@nehill197 nehill197 marked this pull request as draft June 5, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant