Several studies using test-day models show clear heterogeneity of residual
variance along lactation. A changepoint technique to account for this heter
ogeneity is proposed. The data set included 100 744 test-day records of 10
869 Holstein-Friesian cows from northern Spain. A three-stage hierarchical
model using the Wood lactation function was employed. Two unknown changepoi
nts at times T-1 and T-2, (0 < T-1 < T-2 < t(max)), with continuity of resi
dual variance at these points, were assumed. Also, a nonlinear relationship
between residual variance and the number of days of milking t was postulat
ed. The residual variance at a time t (sigma(et)(2)) in the lactation phase
i was modeled as: sigma(et)(2) = t(lambda i) sigma(ei)(2) for (i = 1, 2, 3
), where lambda(i) is a phase-specific parameter. A Bayesian analysis using
Gibbs sampling and the Metropolis-Hastings algorithm for marginalization w
as implemented. After a burn-in of 20 000 iterations, 40 000 samples were d
rawn to estimate posterior features. The posterior modes of T-1, T-2, lambd
a(1), lambda(2), lambda(3), sigma(e1)(2), sigma(e2)(2), sigma(e3)(2) were 5
3.2 and 248.2 days; 0.575, -0.406, 0.797 and 0.702, 34.63 and 0.0455 kg(2),
respectively. The residual variance predicted using these point estimates
were 2.64, 6.88, 3.59 and 4.35 kg(2) at days of milking 10, 53, 248 and 305
, respectively. This technique requires less restrictive assumptions and th
e model has fewer parameters than other methods proposed to account for the
heterogeneity of residual variance during lactation.