paley                 package:survey                 R Documentation

_P_a_l_e_y-_t_y_p_e _H_a_d_a_m_a_r_d _m_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes a Hadamard matrix of dimension (p+1)*2^k, where p is a
     prime, and p+1 is a multiple of 4, using the Paley construction.
     Used by 'hadamard'.

_U_s_a_g_e:

     paley(n, nmax = 2 * n, prime=NULL, check=!is.null(prime))

     is.hadamard(H, style=c("0/1","+-"), full.orthogonal.balance=TRUE)

_A_r_g_u_m_e_n_t_s:

       n: Minimum size for matrix

    nmax: Maximum size for matrix. Ignored if 'prime' is specified.

   prime: Optional. A prime at least as large as 'n',  such that
          'prime+1' is divisible by 4.

   check: Check that the resulting matrix is of Hadamard type

       H: Matrix

   style: '"0/1"' for a matrix of 0s and 1s, '"+-"' for a matrix of
          +/-1.

full.orthogonal.balance: Require full orthogonal balance?

_D_e_t_a_i_l_s:

     The Paley construction gives a Hadamard matrix of order p+1 if p
     is prime and p+1 is a multiple of 4.  This is then expanded to
     order (p+1)*2^k using the Sylvester construction.

     'paley' knows primes up to 7919.  The user can specify a prime
     with the 'prime' argument, in which case a matrix of order p+1 is
     constructed.

     If 'check=TRUE' the code uses 'is.hadamard' to check that the
     resulting matrix really is of Hadamard type, in the same way as in
     the example below. As this test takes n^3 time it is preferable to
     just be sure that 'prime' really is prime.

     A Hadamard matrix including a row of 1s gives BRR designs where
     the average of the replicates for a linear statistic is exactly
     the full sample estimate. This property is called full orthogonal
     balance.

_V_a_l_u_e:

     For 'paley', a matrix of zeros and ones, or 'NULL' if no matrix
     smaller than 'nmax' can be found.

     For 'is.hadamard', 'TRUE' if 'H' is a Hadamard matrix.

_R_e_f_e_r_e_n_c_e_s:

     Cameron PJ (2005) Hadamard Matrices.  <URL:
     http://designtheory.org/library/encyc/topics/had.pdf>. In: The
     Encyclopedia of Design Theory <URL:
     http://designtheory.org/library/encyc/>

_S_e_e _A_l_s_o:

     'hadamard'

_E_x_a_m_p_l_e_s:

     M<-paley(11)

     is.hadamard(M)
     ## internals of is.hadamard(M)
     H<-2*M-1
     ## HH^T is diagonal for any Hadamard matrix
     H%*%t(H)

