Skip to content

Commit 6c9fc5a

Browse files
updates to vignette and DESCRIPTION
1 parent 4e89f81 commit 6c9fc5a

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

.Rbuildignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
^LICENSE\.md$
2+
^.*\.Rproj$
3+
^\.Rproj\.user$

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
inst/doc
2+
.Rproj.user
3+
*.Rproj

DESCRIPTION

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ BugReports: https://github.com/ntdyjack/fasthplus/
2222
URL: https://github.com/ntdyjack/fasthplus/
2323
Suggests:
2424
knitr,
25-
rmarkdown
25+
rmarkdown,
26+
clusterCrit
2627
VignetteBuilder: knitr

vignettes/fasthplus.Rmd

+24-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "fasthplus vignette"
2+
title: "Metrics of disconcordance with `fasthplus`"
33
author: "Nathan Dyjack and Stephanie Hicks"
44
date: "Last modified: October 6, 2021; Compiled: `r format(Sys.time(), '%B %d, %Y')`"
55
bibliography: biblio.bib
6-
output: rmarkdown::html_vignette
6+
output:
7+
html_document:
8+
toc: true
9+
toc_depth: 2
710
vignette: >
811
%\VignetteEncoding{UTF-8}
912
---
@@ -25,20 +28,31 @@ knitr::opts_chunk$set(
2528
At present, `fasthplus` is only available for installation via github using the `devtools` package.
2629
A `CRAN` distribution is in preparation and this section will be updated to reflect its eventual availability.
2730

28-
```{r, eval=F}
31+
```{r, eval=FALSE}
2932
if(!requireNamespace('devtools')){
3033
install.packages('devtools')
3134
}
3235
```
3336

37+
```{r, eval=FALSE}
38+
devtools::install_github(repo="ntdyjack/fasthplus", ref = "main", build_vignettes = TRUE, subdir = NULL, auth_token = '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')
39+
```
40+
41+
Once the package is installed, you can load the library
42+
43+
```{r}
44+
library(fasthplus)
45+
```
46+
47+
3448
# Introduction
3549

3650
This vignette serves as an introductory example on how to utilize the `fasthplus` package.
37-
We introduce $H_{+}$, a simple modification of $G_{+}$ as first introduced by [@williams1971comparison], re-written in [@rohlf1974methods], and implemented in `R` in the `clusterCrit` pacakge [@desgraupes2018package].
51+
We introduce $H_{+}$, a simple modification of $G_{+}$ as first introduced by [@williams1971comparison], re-written in [@rohlf1974methods], and implemented in `R` in the `clusterCrit` package [@desgraupes2018package].
3852
Both $G_{+}$ and $H_{+}$ are quantifications of disconcordance, which can be thought of as the fitness of a contingency table generated using two label sets for the same observations.
3953
The primary user function is `hpe` (H Plus Estimator), a quick means to estimate $H_{+}$ using two arbitrary vectors $A,B$, or a dissimilarity matrix $D$ and set of labels $L$.
4054
$G_{+}$ and $H_{+}$ are estimators of the same theoretical disconcordance parameter -- $H_{+}$ more explicitly estimates this parameter.
41-
$H_{+}$ can be thought of as the product of two parameters $\gamma_{A},\gamma_{B}$, which lends itself to a simple interpretation for $H_{+}$: $\gamma_{A}\times100\%$ of $a\inA$ are strictly greater than $\gamma_{B}\times100\%$ of $b\inB$.
55+
$H_{+}$ can be thought of as the product of two parameters $\gamma_{A},\gamma_{B}$, which lends itself to a simple interpretation for $H_{+}$: $\gamma_{A}\times100\%$ of $a \in A$ are strictly greater than $\gamma_{B}\times100\%$ of $b \in B$.
4256
For further exploration of disconcordance, these estimators ($G_{+}$ and $H_{+}$), as well as their theoretical properties, please see `RKIV PREPRINT HERE`.
4357

4458

@@ -49,11 +63,11 @@ The user can specify $p$, and `hpe` guarantees accuracy within $\pm \frac{1}{p-1
4963
We provide two equivalent algorithms for this estimation process, with the further benefit that our algorithms yields a range of reasonable values for $\gamma_{A},\gamma_{B}$.
5064

5165

52-
##Formulation examples
66+
## Formulation examples
5367
We provide two simulated examples of `hpe` usage
5468

55-
###$A,B$ formulation
56-
This formulation seeks to quantify the answer a simple question: for two sets $A,B$ how often can we expect that $a>b,a\inA,b\inB$?
69+
### $A,B$ formulation
70+
This formulation seeks to quantify the answer a simple question: for two sets $A,B$ how often can we expect that $a>b,a \in A,b \in B$?
5771
We simulate $A$ and $B$ as $n=10000$ draws from a univariate normal distributions with unit variance and slightly different means ($\mu_{A}=0.5,\mu_{B}=-0.5$).
5872

5973
```{r, fig.width=6,fig.height=4}
@@ -68,7 +82,7 @@ legend('topright',legend=c("A","B"), pch=c(22,22),
6882
col= c('blue','red'),cex=1.5, pt.bg=c('#0000ff64','#ff000064'),bty='n')
6983
```
7084

71-
###$D,L$ formulation
85+
### $D,L$ formulation
7286
We can apply $A,B$ formulation to a dissimilarity matrix $D$ and set of cluster labels $L$.
7387
$L$ can be used to generate a binary adjacency matrix that tells us (for every unique pair of obvservaitons) whether two observations belong to the same group.
7488
This adjacency matrix (more specifically, its upper-triangular elements) can then be used to classify every unique dissimilarity $d\in D$ as corresponding to a pair within the same cluster or not.
@@ -177,4 +191,4 @@ hpe(D=d,L=l) #D,L formulation
177191
intCriteria(traj=t(dat),part=as.integer(l),crit='G_plus')
178192
```
179193

180-
#References
194+
# References

0 commit comments

Comments
 (0)