### INTRODUCTION

### MATERIALS AND METHODS

_{ijmprt}are records on trait r of cow m in lactation p on days in milk (DIM) t, CG

_{i}is the effect of contemporary group defined as herd test date recording; AS

_{j}is the fixed effect of the jth subclass of age at calving-season of calving (nested within parity). Four seasons were defined (September to November, December to February, March to May, and June to July); z

_{tq}= is the qth Legendre polynomial corresponding to day t of lactation; a

_{mpq}= random additive genetic coefficients of cow m corresponding to polynomial q of parity p; pe

_{mpq}= random permanent environmental coefficients of cow m corresponding to polynomial q of parity p; e

_{ijmprt}was the residual effect for each observation. The choice of the third-order polynomials used in this study was inferred from the study by Hammami et al [12] who reported that the constant, linear, and quadratic polynomials were highly related to the first three eigenvalues, and explained more than 95% of the variance components for all three random effects.

**y**= the vector of TD record for milk, fat, and protein yields for the first three lactations;

**b**= vector of fixed effects;

**a**= vector of random regression coefficients for genetic additive animal effects;

**p**= vector of random regression coefficients for permanent environmental effects;

**e**= vector of residual effects.

**X**,

**Z**, and

**W**= incidence matrices that relate observations to their respective effects. The phenotypic covariance matrix

**V**of the observations is given by.

**G**, and

**P**are the random regression (co)variances matrices for the genetic and permanent environmental effects, respectively.

**I**= identity matrix and ⊗ is the Kronecker product.

**A**is the additive genetic covariance matrix among all animals, and

**R**is the diagonal matrix of the residual variance. Residual variance was assumed to be constant within DIM intervals. Variance components for additive genetic and permanent environmental random regression were performed by the Bayesian method using the GIBBS3F90 program [13]. Posterior means of the parameters of interest were calculated using 100,000 samples after discarding the 20,000 iterations as a burn-in period. Convergence of Gibbs chains was determined based on inspection of plots of realizations of selected parameters. The genetic variance matrix for all DIM was obtained as

**G* = ΨGΨ′**where

**G***is a 301 by 301 genetic (co)variance matrix for all DIMs ranging from 5 to 305 days.

**Ψ**is a 301 by 36 matrix with the values of the 12 coefficients of the 3 order Legendre polynomial for each DIM from 5 to 305 days. The same operation was applied to

**P**. Genetic parameters for complete 305-d lactations for all traits can be computed by using

**G**, and

**P**(co)variance matrices and 305-d vectors of Legendre polynomials

**Ψ**

**. Vector of Legendre polynomials was obtained by summing up the four coefficients from 5 to 305 d for genetic and permanent environmental effects. As an example, the genetic additive variance for 305 d milk, fat, and protein yield was defined as:**

_{305}

*G*_{(}

_{i, j}_{)}are the genetic (co)variance matrix for i and j.