{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Generation and analysis of conference designs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this notebook, we show how to generate conference designs and calculate properties of these designs. For details on conference designs and their properties, see [Properties of conference designs](https://oapackage.readthedocs.io/en/latest/properties.html#properties-of-conference-designs) and [A Classification Criterion for Definitive Screening Designs](https://www.e-publications.org/ims/submission/AOS/user/submissionFile/34633?confirm=9594b2c3), Schoen et al., 2018 and [Enumeration and Classification of Definitive Screening Designs] (in preparation)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load required libraries and define the class of conference designs to enumerate." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "conference class: number of rows 12, number of columns 6\n" ] } ], "source": [ "import oapackage\n", "\n", "conference_class = oapackage.conference_t(12, 6, 0)\n", "print(conference_class)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define the root array and extend the lists of conference designs." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "extension resulted in 9 designs with 4 columns\n", "extension resulted in 42 designs with 5 columns\n", "extension resulted in 123 designs with 6 columns\n", "extension resulted in 184 designs with 7 columns\n" ] } ], "source": [ "conference_designs = [[conference_class.create_root_three_columns()]]\n", "\n", "for ii, ncols in enumerate(range(4, 8)):\n", " arrays = oapackage.extend_conference(conference_designs[ii], conference_class, verbose=0)\n", " conference_designs.append(arrays)\n", " print(\"extension resulted in %d designs with %d columns\" % (len(arrays), ncols))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Calculate properties of conference designs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here, we show how to calculate relevant properties of conference designs. Select a 12-run 7-factor conference design generated previously." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "array:\n", " 0 1 1 1 1 1 1\n", " 1 0 -1 -1 -1 -1 -1\n", " 1 1 0 -1 -1 1 1\n", " 1 1 1 0 1 -1 -1\n", " 1 1 1 -1 0 -1 1\n", " 1 1 -1 1 1 0 -1\n", " 1 1 -1 1 -1 1 0\n", " 1 -1 1 1 -1 1 -1\n", " 1 -1 1 1 -1 -1 1\n", " 1 -1 1 -1 1 1 -1\n", " 1 -1 -1 1 1 -1 1\n", " 1 -1 -1 -1 1 1 1\n" ] } ], "source": [ "design = conference_designs[4][0]\n", "design.showarray()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A sensible criterion to evaluate conference designs is the so-called $F_4$-vector ([Schoen et al., 2019](https://doi.org/10.1214/18-AOS1723)). We can compute the $F_4$-vector of a conference design as follows." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(0, 25, 10)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "design.FvaluesConference(4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[Schoen et al., 2019](https://doi.org/10.1214/18-AOS1723) showed that conference designs are good building blocks for definitive screening designs ([Xiao et al. 2012](https://doi.org/10.1080/00224065.2012.11917877)). The Orthogonal Array package can construct a definitive screening design from a conference design." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "array:\n", " 0 1 1 1 1 1 1\n", " 1 0 -1 -1 -1 -1 -1\n", " 1 1 0 -1 -1 1 1\n", " 1 1 1 0 1 -1 -1\n", " 1 1 1 -1 0 -1 1\n", " 1 1 -1 1 1 0 -1\n", " 1 1 -1 1 -1 1 0\n", " 1 -1 1 1 -1 1 -1\n", " 1 -1 1 1 -1 -1 1\n", " 1 -1 1 -1 1 1 -1\n", " 1 -1 -1 1 1 -1 1\n", " 1 -1 -1 -1 1 1 1\n", " 0 -1 -1 -1 -1 -1 -1\n", " -1 0 1 1 1 1 1\n", " -1 -1 0 1 1 -1 -1\n", " -1 -1 -1 0 -1 1 1\n", " -1 -1 -1 1 0 1 -1\n", " -1 -1 1 -1 -1 0 1\n", " -1 -1 1 -1 1 -1 0\n", " -1 1 -1 -1 1 -1 1\n", " -1 1 -1 -1 1 1 -1\n", " -1 1 -1 1 -1 -1 1\n", " -1 1 1 -1 -1 1 -1\n", " -1 1 1 1 -1 -1 -1\n", " 0 0 0 0 0 0 0\n" ] } ], "source": [ "dsd = oapackage.conference2DSD(design)\n", "dsd.showarray()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For the resulting definitive screening design, the Orthogonal Array package can compute some statistical properties based on projections into a smaller number of factors." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "conferenceProjectionStatistics: projection to 4 columns: PEC 0.286 PIC 3.111 PPC 0.458 \n" ] } ], "source": [ "PEC4, PIC4, PPC4 = oapackage.conference.conferenceProjectionStatistics(design, ncolumns=4, verbose=1)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.8" } }, "nbformat": 4, "nbformat_minor": 4 }