library(handwriter) library(magick)
The questioned document is shown in Figure \@ref(fig:qd).
qd_path <- list.files(file.path(params$main_dir, "data", "questioned_docs"), pattern = ".png", full.names = TRUE) qd_image <- magick::image_read(qd_path) qd_image
The handwriter R package processed a PNG scan of the QD by
handwriter::plotNodes(params$qd_doc)
Figure \@ref(fig:qdgraphs) shows the processed QD split into graphs.
Next, handwriter estimated a writer profile for the QD by assigning its graphs to the cluster template and counting the number of graphs in each cluster. The writer profile estimated from the QD is shown in Figure \@ref(fig:qdprofile)
handwriter::plot_cluster_fill_counts(params$analysis)
Three known writing samples were collected from each person of interest. The scanned PNG files of the known writing samples are listed in Table 1.
known_docs <- data.frame("files"=params$known_docs) knitr::kable( known_docs, booktabs = TRUE, caption = 'Known writing samples from persons of interest.' )
Each known writing sample was processed with the handwriter package with the same steps as the questioned document:
Next, handwriter estimated a writer profile each person of interest by first assigning the graphs from the known writing samples to the cluster template and counting the number of graphs in each cluster. Then handwriter fit a statistical model, called a Bayesian hierarchical model, to the cluster fill counts of all known writing samples to estimate the true writer profile of each person of interest. The estimated writer profiles of the persons of interest are displayed in Figure \@ref(fig:knownprofiles).
handwriter::plot_credible_intervals(params$model, facet=TRUE)
Using the estimated writer profiles of each person of interest and the writer profile from the QD, handwriter calculates the posterior probability that each person of interest wrote the QD. The posterior probabilities of writership are listed in Table 2.
pp <- params$analysis$posterior_probabilities colnames(pp) <- c("Person of Interest", "Posterior Probability of Writership") pp <- pp %>% dplyr::mutate(`Posterior Probability of Writership`=paste0(100*`Posterior Probability of Writership`, "%")) knitr::kable( pp, booktabs = TRUE, caption = 'The posterior probability that each person of interest wrote the questioned document.' )
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.