-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* cleaning up dbetabinom * removed rounding, not needed * rmarkdown language and assert for dbetabinom * changed x and m to number instead of numeric * test * pbetaMix function and test * added new tests and changed documentation * upper case for test_that comments and more tests for qbeta * test_thats for pbetaMix and qbetaMix * tidy syntax and last checks * tidy syntax and last checks * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * [skip actions] Roxygen Man Pages Auto Update * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update examples/pbetaMix.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * p and q inputs * q,p changes * Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * [skip actions] Roxygen Man Pages Auto Update * documentation to reflect p and q changes * amending qt * intro x-> q * amented postprob file * amended postprob file * fixed mistake on x * qbetaMix was in postprobDist * trying to find R CMD check error * [skip actions] Roxygen Man Pages Auto Update * manual of ocPostprobDist * fixing roxygen type to p * see if this fixes the CMD check * see if fixes CMD check error * xi removed * example post prob works * clean * assert_number * in postprobDist, I changed p-> q * change p to q * change q to p * fix postprobDist (for now) --------- Co-authored-by: Daniel Sabanes Bove <[email protected]> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Daniel Sabanes Bove <[email protected]>
- Loading branch information
1 parent
e649e9c
commit 168f3e4
Showing
11 changed files
with
262 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,16 @@ | ||
## Calculating the CDF of a mixture | ||
## of beta densities at x, x = 0.3; a = 0.2; b = 0.4 | ||
## | ||
## | ||
## Only 1 mixture component, i.e., weights = 1 | ||
## Compare to pbeta(0.3,0.2,0.4) = 0.5947341 | ||
## | ||
pbetaMix(x = 0.3, par = rbind(c(0.2, 0.4)), weights = 1) | ||
pbetaMix(q = 0.3, par = rbind(c(0.2, 0.4)), weights = 1) | ||
|
||
## Can get the one minus CDF values | ||
## Need to specify lower.tail = FALSE, 1 - 0.5947341 = 0.4052659 | ||
## | ||
## | ||
pbetaMix(x = 0.3, par = rbind(c(0.2, 0.4)), weights = 1, lower.tail = FALSE) | ||
# Can get the one minus CDF values. | ||
pbetaMix(q = 0.3, par = rbind(c(0.2, 0.4)), weights = 1, lower.tail = FALSE) | ||
|
||
## With 2 mixture components | ||
## Weight 0.6 for component 1; a = 0.2, b = 0.4 | ||
## Weight 0.4 for component 2; a = 1.0, b = 1.0 | ||
## Compare to 0.6*pbeta(0.3,0.2,0.4) + 0.4*pbeta(0.3,1,1) = 0.4768404 | ||
## | ||
pbetaMix( | ||
x = 0.3, par = rbind(c(0.2, 0.4), c(1, 1)), | ||
q = 0.3, par = rbind(c(0.2, 0.4), c(1, 1)), | ||
weights = c(0.6, 0.4) | ||
) | ||
|
||
## Can also specify x as a vector, x = seq(0,1,.01) | ||
## | ||
## | ||
## Can also specify x as a vector. | ||
pbetaMix( | ||
x = seq(0, 1, .01), par = rbind(c(0.2, 0.4), c(1, 1)), | ||
q = seq(0, 1, .01), par = rbind(c(0.2, 0.4), c(1, 1)), | ||
weights = c(0.6, 0.4) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
## Calculating the quantile (inverse CDF) of a mixture | ||
## of beta densities at x where q = 0.6; a = 0.2; b = 0.4 | ||
## | ||
## | ||
## Only 1 mixture component, i.e., weights = 1 | ||
## Compare to qbeta(0.6,0.2,0.4) = 0.3112065 | ||
## | ||
qbetaMix(q = 0.60, par = rbind(c(0.2, 0.4)), weights = 1) | ||
qbetaMix( | ||
p = 0.60, | ||
par = rbind(c(0.2, 0.4)), | ||
weights = 1 | ||
) | ||
|
||
## With 2 mixture components | ||
## Weight 0.6 for component 1; a = 0.2, b = 0.4 | ||
## Weight 0.4 for component 2; a = 1.0, b = 1.0 | ||
## | ||
qbetaMix( | ||
q = 0.6, par = rbind(c(0.2, 0.4), c(1, 1)), | ||
p = 0.6, par = rbind(c(0.2, 0.4), c(1, 1)), | ||
weights = c(0.6, 0.4) | ||
) | ||
|
||
## Can also specify q as a vector : q = seq(0,1,.01) | ||
## | ||
## | ||
## Can also specify q as a vector | ||
qbetaMix( | ||
q = seq(0, 1, .01), par = rbind(c(0.2, 0.4), c(1, 1)), | ||
p = seq(0, 1, .01), | ||
par = rbind(c(0.2, 0.4), c(1, 1)), | ||
weights = c(0.6, 0.4) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3239,6 +3239,7 @@ resizable | |
ResourceRef | ||
responder | ||
responders | ||
ret | ||
rf | ||
rG | ||
RG | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.