Home | Site Map | Contact  
   
     
  about | techniques | resources

|

training | news | contact us  
     
  Resources
  Techniques
  More information
  Resources | Consignment Estimation Software

From this page, visitors can download functions developed by David Lucy for the estimation of illegal items in consignments of seized articles. There's a four sample size estimation application, and a suite of functions to support the computational requirements of Aitken & Lucy (2004) as a solution for the matching problem in reasonably multivariate space.

Use of the software
Could people and organisations who use the consignment estimation software here please send us an e-mail (dlucy@maths.ed.ac.uk) to let us know who they are and what they use it for. We need to know this as we keep being asked who uses this software, and we simply have no idea. We know people are using this software as they've been spotted on UK television, but we could do with knowing officially.

Note: Those who found this page with a search engine but really want information about consignment management should go to the BCSS site.

The usage is for making an estimate of how many units it is necessary for the forensic examiner  to actually inspect in detail to know what proportion of the consignment contained illicit units. For example: if a bin liner full of 500 packets of white powder were found in the possession of a suspect, and it was felt that a proportion of these  packets contained an illegal substance, then the drugs examiner would test  them to see how many were in fact illegal.

About the software
Current sampling strategies tend to be heuristic, being based on measures such as 1/10th the  number of units, or the square root of the number of units. In this case the examiner  would  have to look at 50, or 22 dependent on sample strategy. The problem with this approach is that the answer doesn't tell you if you are 90% sure  that all the consignment is illegal, rather it just says that you are fairly sure the consignment is illegal.

By contrast, the approach used here comes up with an answer which says that one is 95% (or whatever level is selected) that at least so much  of  the consignment is illegal. Not only is this estimative approach more  precise than `rule of thumb' based rules for generating sample sizes, it can get results which require far fewer units in the consignment to be measured.

In the bin liner case above were 4 units found to be illegal,  then it is the case that you are 95% sure that 55% or more of the total consignment is illegal. Were one to sample 8 units, then you could be 95% sure that  at  least 72% of the consignment is illegal, or 99% sure that at least 60% was illegal.

Of course, the use of these functions is not restricted to drug consignment estimation. It could be used to estimate quantities of illegally copied CD-ROMs, containers of firearms on a ship or boat, or even in quality control situations  involving totally legal units. Applications could involve the estimation  of defective items in a batch from a manufacturing process, or the amount of substance produced during production of a chemical.

Installation notes
With the exception of the Excel spreadsheets, which give the right answers, but are a bit buggy, all the software here relies upon having a fully functioning R installation to work. These are R scripts, and they simply tell R what to do. As they're graphical in operation they need a library to provide the features of a GUI. This library is Tcl/Tk (see bottom of page for download and configuration details).

Once R is up and running, and can talk to Tcl/Tk then it is a simple matter to make the working directory the directory with the package files downloaded here,   and run the main .r script from within R. Alternately the .bat files can be pointed towards the R_Home (ie, where R is installed) and they can be run from  the  file manager. If you wish to be really flash you can make a symlink (Windows  calls them shortcuts) from the desktop to the .bat file, adjust the properties so  the calling window runs minimized, then you can run the functions just by clicking on the desktop.

Eventually I shall probably try to make them into proper R packages so they will install in the same way as every other R package. A help file for sorting out getting R to function with Tcl/Tk is available here. Help for getting a little further and getting these functions to run from a desktop icon is available here.

I may try to make next versions of all consignment estimations functions using Luke Tierney's excellent tkrplot() which should make the dynamic parts of the graphics windows a bit smoother, however, the whole lot could do with being rebuilt as a series of binaries.

A final point is that anything which has Tcl/Tk as a dependency will not  port directly to S+ as S+ has it's own set of graphical tools not based upon Tcl.

Beta Beta
This tells you the proportion of illegal units in a consignment, and calculates the beta posterior density function, from a beta prior function. The input parameters are the number of positives and negatives observed  in a sample, and the alpha and beta prior parameters. This is recommended for consignment sizes greater than 50 units.
Thumbnail of beta-beta
Download for R running on *nix
Download for R running on Windows
Download an Excel spreadsheet



Beta binomial
This is pretty much the same as the beta-beta given above, but this time tells you how many of the remaining units in a consignment are likely to be illegal. It is a more precise estimate for consignments with fewer than 50 units.

Thumbnail of beta-beta
Download for R running on *nix
Download for R running on Windows
Download an Excel spreadsheet

T beta binomial
The t-beta-binomial describes the amount of illicit substance in a consignment. If for instance there were 100 packets of suspected illicit material, and the examiner wished to know how much material was in the consignment, rather than how many units , then the t-beta-binomial would be used.

This would give a posterior distribution based on the prior parameters alpha and beta, the mean and standard deviation of the masses of illegal substance found in the units examined, the number of units examined, and the number of units in the consignment.

The t-beta-binomial is limited to about 190 units in a consignment, for larger consignments see the t-beta-beta below. There is no Excel worksheet for the t-beta-binomial as the calculations are a little too complicated for Excel.

Thumbnail of beta-beta
Download for R running on *nix
Download for R running on Windows


T beta beta
The t-beta-beta is more or less the same as the t-beta-binomial, but uses a beta approximation to the binomial. This mean that consignments with large numbers of units can be handled, so far I have tried it up to 3 million. There is no Excel worksheet for the t-beta-binomial as the calculations are a little too complicated for Excel. 

Thumbnail of beta-beta
Download for R running on *nix
Download for R running on Windows

MVRA
These functions support the work done in the paper Evaluation of trace evidence in the form of multivariate data and are our solution to the matching problem when the data are continuous, moderately multi-variate and have two levels of variation and are for experienced R users only.  Just download the zip file to an arbitrary directory for which you have write access. Unzip it and it will produce a sub-directory called glass-analysis. Go into this directory, fire up R and source the file evidence-evaluation.r. The readme file and the script file will give more details of what's going on. 

Thumbnail of beta-beta
Download for R

Supporting software
Tcl/Tk may be downloaded at this site, from this location.  R may be downloaded here. Tcl/Tk is about 13 megabytes, R is at about 20 megabytes, so take this into account when downloading from a slow connection.

 
  About Us
  The Centre
  About Joseph Bell
  People
  Partners
     
© 2005 University of Edinburgh | Legal Policies | Contact Us