Tutorials › Response-Adaptive Randomization › Reading Replacement-Matrix Conventions

Urn Models · Tutorial 50 of 501

Reading Replacement-Matrix Conventions

You will learn to identify a matrix’s indexing and ball-count convention, then write and check the corresponding one-draw state update.

Intermediate 10 min read

What You'll Learn

  • Distinguish rows indexed by the drawn color from columns indexed by the drawn color.
  • Translate a replacement-packet matrix into a one-draw state update.
  • Convert between replacement-packet, additional-ball, and net-change conventions.
  • Handle different replacement matrices for different response outcomes.
  • Check matrix orientation, total urn size, and nonnegative updated counts.

Why Matrix Conventions Matter

A replacement matrix can summarize an urn rule compactly, but its entries do not determine an update until the indexing and counting conventions are known. In particular, a matrix may place the drawn color in its rows or its columns, and its entries may describe the entire packet supplied after a draw or only balls added beyond the drawn ball. Applying a formula from one convention to a matrix written in another can produce an incorrect state even when every entry has been copied correctly.

This tutorial fixes explicit conventions and shows how to translate a verbal rule into a one-draw update. The urn state is a vector of color counts, and each draw selects one color. The response to the assigned treatment can determine which replacement rule applies. The goal here is to read and write the resulting matrix update unambiguously, not to average over possible draws.

Definition: For an urn with \(K\) colors, let \(X\) be the column vector of counts immediately before a draw, with \(X_j\) denoting the number of balls of color \(j\). Let \(e_i\) be the \(K\)-vector with a 1 in position \(i\) and 0 elsewhere. Thus \(e_i\) identifies a draw of color \(i\).

For a concrete urn interpretation, assume the next ball is drawn uniformly from all balls currently present, its color determines the assigned treatment, and the relevant response is observed before the replacement rule is applied. Conditional on the drawn color and response, the replacement packet is specified by the rule. The counts must remain nonnegative integers after each update. A matrix can describe the conditional bookkeeping, but it does not by itself specify how responses are generated.

Convention 1: The Matrix Gives the Whole Replacement Packet

We will use a column-state convention. In a replacement-packet matrix, column \(i\) corresponds to the color drawn, and row \(j\) corresponds to the color of balls in the packet supplied after that draw. The packet includes any ball returned to the urn; if the drawn ball is returned, it is counted in this packet. Let \(B^{(r)}_{ji}\) be the number of color-\(j\) balls in the packet when color \(i\) was drawn and response category \(r\) occurred. Then the one-draw update is:

$$ X_{\mathrm{new}}=X-e_i+B^{(r)}e_i. $$

The subtraction removes the drawn ball from the pre-draw state. Multiplying \(B^{(r)}\) by \(e_i\) selects column \(i\), which is the replacement packet for the draw that occurred. If the drawn ball is included in that packet, it is added back through this selected column. The same update also covers rules that discard the drawn ball and supply a different packet.

Worked Example: Reading a Column-Indexed Replacement Packet

Consider two colors, red and blue, and a success response. The rule is: after drawing red, return the red ball and add two blue balls; after drawing blue, return the blue ball and add one red ball. Write the replacement-packet matrix and update the state \(X=(3,2)^T\) following a red draw and a success.

Rows are replacement colors, and columns are drawn colors, in the order red, blue. After a red draw, the packet contains one red and two blue balls, so column 1 is \((1,2)^T\). After a blue draw, it contains one red and one blue ball, so column 2 is \((1,1)^T\). Therefore:

$$ B^{(\mathrm{success})= \begin{pmatrix} 1 & 1\\ 2 & 1 \end{pmatrix}. $$

A red draw selects \(e_1=(1,0)^T\). The update, with the draw removed and its full replacement packet added, is:

$$ X_{\mathrm{new}} = \begin{pmatrix}3\\2\end{pmatrix} - \begin{pmatrix}1\\0\end{pmatrix} + \begin{pmatrix}1&1\\2&1\end{pmatrix} \begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}3\\2\end{pmatrix} - \begin{pmatrix}1\\0\end{pmatrix} + \begin{pmatrix}1\\2\end{pmatrix} = \begin{pmatrix}3\\4\end{pmatrix}. $$

The final state has three red and four blue balls. The red ball was removed and then returned as part of the packet; the two additional blue balls account for the increase in the blue count.

Rows Indexed by Draws: Transpose Before Using the Column Formula

Some descriptions put the drawn color in the rows and the replacement color in the columns. Such a matrix is not wrong; it is simply oriented for a row-state update. In that convention, row \(i\) records the packet after drawing color \(i\). If \(B_{\mathrm{row}}^{(r)}\) denotes this matrix, then:

$$ B_{\mathrm{row}}^{(r)}=(B^{(r)})^T. $$

With a column state, the selected packet is a column, so the row-indexed matrix must be transposed before applying the column-state formula. Equivalently, if the state is written as a row vector, the row-indexed packet is selected by multiplication on the left.

$$ X_{\mathrm{new}}^T = X^T-e_i^T+e_i^T B_{\mathrm{row}}^{(r)}. $$

Worked Example: Translating a Row-Indexed Table

Suppose a table gives the success-response replacement packets in rows: after drawing red, the packet is one red and two blue balls; after drawing blue, the packet is one red and one blue ball. Starting from \((3,2)^T\), find the state after drawing blue and observing success.

With columns ordered red, blue, this table is:

$$ B_{\mathrm{row}}^{(\mathrm{success})= \begin{pmatrix} 1&2\\ 1&1 \end{pmatrix}. $$

The row for a blue draw is \((1,1)\), so the packet contains one red and one blue ball. Transposing gives the column-oriented matrix, whose blue-draw column is also \((1,1)^T\):

$$ B^{(\mathrm{success})= \begin{pmatrix} 1&1\\ 2&1 \end{pmatrix}, \qquad X_{\mathrm{new}} = \begin{pmatrix}3\\2\end{pmatrix} - \begin{pmatrix}0\\1\end{pmatrix} + \begin{pmatrix}1\\1\end{pmatrix} = \begin{pmatrix}4\\2\end{pmatrix}. $$

The update removes one blue ball, then supplies a packet with one red and one blue ball. The red count rises from 3 to 4, while the blue count remains 2. Using the row-indexed table directly as though its columns represented drawn colors would select the wrong packet.

Convention 2: The Matrix Gives Only the Additional Balls

A different convention records only the balls added beyond an automatic return of the drawn ball. Let \(G^{(r)}_{ji}\) be the number of additional color-\(j\) balls added after drawing color \(i\) and observing response \(r\), with the original drawn ball returned automatically. Then the update is:

$$ X_{\mathrm{new}}=X+G^{(r)}e_i. $$

There is no separate subtraction in this expression because the automatic return cancels the removal of the drawn ball. When the drawn ball is returned in its original color, the replacement-packet matrix and additional-ball matrix have the same orientation and satisfy:

$$ B^{(r)}=I+G^{(r)}. $$

Here \(I\) is the identity matrix: its column \(i\) represents returning one ball of the color drawn. Therefore, the packet update and the additional-ball update agree:

$$ X-e_i+B^{(r)}e_i = X-e_i+(I+G^{(r)})e_i = X+G^{(r)}e_i. $$

This conversion assumes that the original drawn ball is returned in its original color before the extra balls are added. If a rule instead discards the draw or replaces it with a different packet, describe the actual packet directly, or use a net-change matrix. Do not silently treat a removed ball as automatically returned.

Worked Example: Separating Return From Reinforcement

For the two-color rule in the first example, the additional-ball matrix has a zero in each diagonal entry because returning the drawn ball is not counted as an additional ball. After a red draw, add two blue balls; after a blue draw, add one red ball. Find the update from \((3,2)^T\) after drawing red and observing success.

In the row-replacement-color, column-drawn-color orientation:

$$ G^{(\mathrm{success})= \begin{pmatrix} 0&1\\ 2&0 \end{pmatrix}. $$

A red draw selects the first column, \((0,2)^T\). Since the drawn red ball is automatically returned, only the additional balls change the count vector:

$$ X_{\mathrm{new}} = \begin{pmatrix}3\\2\end{pmatrix} + \begin{pmatrix} 0&1\\ 2&0 \end{pmatrix} \begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}3\\2\end{pmatrix} + \begin{pmatrix}0\\2\end{pmatrix} = \begin{pmatrix}3\\4\end{pmatrix}. $$

This matches the replacement-packet calculation. In fact, \(I+G^{(\mathrm{success})}\) is the packet matrix from the first example. Writing the convention next to the matrix prevents the diagonal zero from being mistaken for a rule that removes the drawn ball.

Net-Change Matrices and Outcome-Specific Rules

A third useful representation records the net change in the urn, including the removal of the drawn ball. Define \(D^{(r)}_{ji}\) as the change in the count of color \(j\) after drawing color \(i\) and observing response \(r\). With the same column orientation:

$$ X_{\mathrm{new}}=X+D^{(r)}e_i, \qquad D^{(r)}=B^{(r)}-I. $$

For a rule that automatically returns the drawn ball and adds balls, \(D^{(r)}=G^{(r)}\). For a rule that discards the drawn ball and supplies a packet, \(D^{(r)}=B^{(r)}-I\) still applies, but the packet matrix must describe what is actually supplied. Separate matrices \(B^{(r)}\), \(G^{(r)}\), or \(D^{(r)}\) can be used for different responses; the observed response determines which matrix applies to that update.

Worked Example: Discarding the Drawn Ball After a Failure

A three-color urn has state \(X=(4,3,2)^T\), in the order A, B, C. After a B draw followed by a failure, the rule discards the drawn B ball and supplies two A balls and one C ball. Find the new state using a replacement-packet matrix.

The relevant packet is \((2,0,1)^T\). For clarity, the failure-response matrix is shown with rows A, B, C and columns drawn A, B, C; only its B-draw column is needed here:

$$ B^{(\mathrm{failure})= \begin{pmatrix} 0&2&0\\ 0&0&0\\ 0&1&0 \end{pmatrix}. $$

The B draw selects \(e_2=(0,1,0)^T\). Subtract the drawn ball and add the packet:

$$ X_{\mathrm{new}} = \begin{pmatrix}4\\3\\2\end{pmatrix} - \begin{pmatrix}0\\1\\0\end{pmatrix} + \begin{pmatrix} 0&2&0\\ 0&0&0\\ 0&1&0 \end{pmatrix} \begin{pmatrix}0\\1\\0\end{pmatrix} = \begin{pmatrix}4\\3\\2\end{pmatrix} - \begin{pmatrix}0\\1\\0\end{pmatrix} + \begin{pmatrix}2\\0\\1\end{pmatrix} = \begin{pmatrix}6\\2\\3\end{pmatrix}. $$

The total changes from 9 balls to 11: one ball is removed and three are supplied. Treating the packet as additional balls on top of an automatic return would instead leave the B ball in the urn, contradicting the stated discard rule.

A Short Check of the Translation

The packet and net-change forms are equivalent because the column \(B^{(r)}e_i\) is exactly the packet supplied after the observed draw. Subtracting \(e_i\) first accounts for the ball that left the urn to be drawn. Defining \(D^{(r)}=B^{(r)}-I\) combines those two operations:

$$ X-e_i+B^{(r)}e_i = X+(B^{(r)}-I)e_i = X+D^{(r)}e_i. $$

This also gives a quick size check. Write \(\mathbf{1}^T X\) for the total number of balls before the draw. Under the packet convention, the total afterward is the old total minus one plus the number of balls in the selected packet:

$$ \mathbf{1}^T X_{\mathrm{new}} = \mathbf{1}^T X-1+\mathbf{1}^T B^{(r)}e_i. $$

Under the additional-ball convention, the total rises by the number of additional balls in the selected column. These checks do not replace the color-by-color calculation, but they can reveal a missing subtraction or an incorrectly selected column.

Diagnostics, Comparisons, and Limitations

Before using a replacement matrix, write down four facts: the order of the colors, whether rows or columns index the drawn color, whether entries are whole packets or additional balls, and which response selects the matrix. Then test the convention on a single draw by naming the selected row or column in words. A correct formula should reproduce the stated packet and leave a nonnegative count for every color.

The three representations are bookkeeping alternatives, not different urn mechanisms. A packet matrix is direct when a rule explicitly says what is supplied after the draw. An additional-ball matrix is concise when the drawn ball is always returned and the rule describes only reinforcement. A net-change matrix is convenient when removal and addition are best described together. Their update equations differ, so they cannot be exchanged without converting the entries.

Common failures include using a row-indexed matrix with a column-state formula, subtracting the drawn ball even though the matrix contains only extra balls, and adding the drawn ball back when the packet rule explicitly discards it. A further check is that packet entries must be nonnegative counts; a negative entry signals that the matrix is being used as a net-change matrix rather than as a literal replacement packet. Even a correctly translated matrix does not establish that the stated urn rule is appropriate for a particular study, nor does it specify outcome probabilities or broader trial properties.

Key takeaway: State the matrix orientation and counting convention before calculating. With a column state and a column-indexed replacement-packet matrix, remove the drawn ball and add the selected packet: \(X_{\mathrm{new}}=X-e_i+B^{(r)}e_i\). If entries count only additional balls beyond an automatic return, use \(X_{\mathrm{new}}=X+G^{(r)}e_i\).

Check Your Understanding

For each question, identify the convention before calculating. Complete solutions follow.

  1. A row-indexed packet matrix has row 1 equal to \((2,0)\), with colors A, B in that order. What packet does it specify after an A draw?
  2. A two-color urn has state \((5,4)^T\). A column-indexed additional-ball matrix has first column \((1,3)^T\). What is the state after an A draw, assuming the drawn ball is automatically returned?
  3. A packet matrix column for a B draw is \((0,2)^T\), in A, B order. Starting from \((3,4)^T\), what is the state after drawing B?
  4. Explain why a row-indexed packet matrix should be transposed before it is used in the column-state packet formula.

Solutions. (1) The row gives the packet after drawing A: two A balls and no B balls. (2) The matrix records additional balls and the drawn ball is automatically returned, so add the selected column: \((5,4)^T+(1,3)^T=(6,7)^T\). (3) Remove one B ball and add the selected packet: \((3,4)^T-(0,1)^T+(0,2)^T=(3,5)^T\). (4) A column-state update selects a matrix column using \(e_i\). A row-indexed matrix stores the packet for draw \(i\) in row \(i\), so transposing puts that packet in column \(i\), matching the multiplication \(B e_i\).

Clinical Biostats