!WORKSPACE 1800 !NOGRAPHICS !DEBUG !LOGFILE !RENAME !ARGS 1 2 // !DOPART $1 DHGLM model animal !P sire dam herd hys Am Asl Av x #!-1 E PE Pheno Gval !=Pheno !-0.0 !*V12 Ywt !=1. Gwt !=1. ped.dat cows_repeated.dat !maxit 100 !DOPART $1 !PART 1 # normal model #Pheno ~ mu !r animal ide(animal) Pheno ~ mu !r animal residual units !Part 2 !ASUV !EXTRA 100 !SLOW # in odd iterations, we use the predicted weights for the primary response !IF ODD !CALC W1=EXP(R2-Y2) #redefine weights for Y1 !IF EVEN !CALC S1=1./W1; H0=MIN(H1/S1, .9999); Z2=MAX(R1*R1,.0001)/(1-H0) !IF EVEN !CALC Y2=LOG(S1)+(Z2-S1)/S1 #redefine Y2 !IF EVEN !CALC W2=(1-H0)/2 #redefine weights for Y2 !ASSIGN gen 0.3 0.005 0.1 !ASSIGN perm 0.1 0.0 0.01 #Pheno Gval !Weight Ywt !WT Gwt ~ Trait !r us(Trait,$gen).animal us(Trait,$perm).ide(animal) !f mv Pheno Gval !Weight Ywt !WT Gwt ~ Trait !r us(Trait,$gen).animal !f mv residual units.id(Trait) !VARIANCESCALE