Different orders of Legendre polynomial were used to describe covariance structure of longitudinal traits such as milk yields or body weight, because when both the additive genetic and permanent environmental components modeled by Legendre polynomial coefficients during time, the prediction of EBV value and variance components become more accurate [

6] and the correlation between parameters are lower than compare to other functions. Results from AIC, BIC, and Log likelihood showed that homogeneous residual variance is not adequate to fit the data while models with step function, fitted the best performance. This indicates that residual variance behaves differently during within and also between different lactations. Some studies [

7,

8] proposed that the residual variance should be homogenous across days in milk due to limitation of program, reducing the number of parameters and dimension of the likelihood but it is better to allow residual variance to vary than to fix it in RRM because an assumption of constant error variance leads to bias in heritability estimates [

9–

11]. In this study, the third order of RRM for additive and permanent environmental effects is the most adequate for fitting this data set. The result is in agreement with the result of [

12] which showed that the better performance of equal orders of additive and permanent environmental effects (third order) in random regression analysis of total milk yield over multiple parities in buffaloes. They also proposed a step function with 5 classes of residual variances for finding the best result. The finding indicates that with increasing of step function classes to ten and the order of fit to three for the additive genetic and permanent environmental effects, the Log likelihood increased. Our result disagrees with the finding of Guo et al [

3] who reported that residual variance is constant in milking records of Danish jersey cows from the first to seventh parity. The performance of LE33het10 and LE34het10 models were similar to each other (LE33het10 is more parsimonious than LE34het10 model) but completely different and better than repeatability model (which suggested that the 305-day milk yields of different parties should not be treated as a repeated measurements of the same trait) but the genetic and permanent environmental covariances should change gradually using the optimum orders of orthogonal Legendre polynomial in random regression analysis. This means that the effects of environmental variance during different parties are considerable and one should not assume fixed during lactations in the multi-trait analysis. Most of the results reported from the multi-trait analysis are restricted to only the first three lactations. The results showed that the additive genetic and permanent environmental variance were lower at the youngest and oldest ages (around 20 and after 120 months of calving). The highest additive genetic and permanent environmental variances were observed in around 80 months of calving (fifth parity). But the patterns of phenotypic and residual variances are completely different during different parities as these components increased from the first parity to the seventh parity in LE33het10 model (

Figure 1). The similar result was reported by Guo et al [

3] about increasing of the phenotypic variance of total 305- day milk yield from lactation one to seven. In LE33het10 model, the residual variance estimates increased with the improvement of age at calving in consecutive parities too. It seems that the main reason of increasing of phenotypic variance after 80 months of calving is attributed to the residual part not additive and permanent environmental variances. Heritability estimates for 305-day milk yields, in seven lactations, ranged from 0.17 to 0.28 and showed the same trend as those observed for additive genetic variance estimates. But the heritability of 305-day milk yield with repeatability model was 0.23 (

Figure 2). Estimates of heritability of 305-day milk yield were reported in the first three lactations in many studies. Hammami et al [

4] and Muir et al [

13] reported these values 0.17, 0.18, 0.18 and 0.29, 0.30, 0.32 for the first three lactations respectively. Heritability estimates with LE33het10 increased to 80 months of calving and then decreased till the end of calving ages. Our study showed that the variation in heritability mainly affected by additive genetic variance during lactation. Moreover, the heritability of 305- day milk yield is the highest in 4 to 5 years and then because of decreasing the number of records or increasing phenotypic variance, the value of heritability decreased. It expected that individual breeding values for total milk production change with parity number and reach a maximum around the fourth-fifth parity in Iranian Holstein cows. Maybe these results indicate that cows in later lactations express their genetic potential differently [

4]. Yang et al [

14] reported that the heritability of 305-day milk yield from 1st to 6–8th parity in Chinese Simmental cattle were 0.28, 0.30, 0.32, 0.32, 0.32, and 0.31 respectively. Estimates of genetic and phenotypic correlations between 305-d milk yield in different parities indicate that total milk yield in close parities was high compare with milk yields at parities that were further apart (

Table 3). The largest generic correlations occur between yields in adjacent lactations resulting from a multiple trait random regression analysis [

15]. Genetic correlations over parities were greater than corresponding phenotypic correlations as the largest genetic correlations occurred between 78 and 108 months of calving while the lowest were between 20 and 140 months of calving respectively. Despite closer genetic correlation from unity in adjacent ages, these values are different in various ages at calving, and it should necessary to consider 305-day milk yield in each parity, as different traits. Eigenvalues represent the amount of variation explained by the corresponding eigenfunction [

16]. For each eigenfunction, a specific eigenvalue is associated as the first two eigenvalues for additive genetic and permanent environmental effects account for more than 98% of the total variation while the first three eigenvalues of the additive genetics and permanent covariance function accounted for at least 99.5% of the variations. Togashi et al [

17] showed that the main three eigenvalues and associated eigenfunction explain the highest additive genetic variance independent of polynomial order should be utilized in the analysis of test day records of dairy cattle. The finding stated that third order of fit for genetic and permanent environmental effects was sufficient in the fitting of total 305-day milk yield in different parities using RRM. Based on eigenvalues for random effects, LE33het10 model reveals the best order of fit and more accurate in the dataset. Moreover, it seems that, the order of Legendre polynomial needs to be equal for additive genetics and permanent environmental effects to produce the equal chance for these effects during different parities. Trends of EBV showed clearly that significant progress was achieved during consecutive lactations. The fluctuation of EBV is high in the first and latter parities. Quadratic regression quantified this progress as 23.5 kg/parity during lactation one to seven. In many studies, genetic and phenotypic trends were reported based on test day milk yields or 305-day milk yield in the first lactation. These trends showed an annual increase during different calving years. Moreover, Reents et al [

18] reported that the genetic trend from test- day models is higher than lactation models. But in our study, the maximum value for EBV was obtained in fourth and fifth parities. Similar trends were obtained in heritability and EBV 305-day milk yield and it indicates that the role of increasing total milk yield and additive genetic effects till the fourth and fifth parities are responsible for the improvement of breeding values but after these ages, the role of residual variance or temporary variance effects is determinative in Iranian Holstein cows.