[vsni.co.uk] Contact us | Site map
Forum | VSN International Forum Index
Author Message
Post new topic

<  ASReml  ~  Modeling block-diagonal residual matrix in RR models

kon
Posted: Mon Jan 30, 2012 10:17 pm Reply with quote
Joined: 24 Jan 2012 Posts: 2
Hello there,

I am trying to run a random regression model with block-diagonal residual matrix.
I cannot figure out the syntax for this situation.
Can anybody help me with the syntax? Attached is my *.as file. Thanks in advance.

Kon


Run1 milk fat protein 3 lactations test data
htd1 9 !m0
htd2 6 !m0
htd3 5 !m0
animal !P
p2 12
age1 !m0
age2 !m0
age3 !m0
testNo 10 !m0
dim1 !m0
dim2 !m0
dim3 !m0
milk1 !m0
fat1 !m0
prot1 !m0
milk2 !m0
fat2 !m0
prot2 !m0
milk3 !m0
fat3 !m0
prot3 !m0
scs1 !m0
scs2 !m0
scs3 !m0

mfp.ped !MAKE
mfp.dat !MVINCLUDE !AISING !ASUV !BLUP
milk1 fat1 prot1 milk2 fat2 prot2 milk3 fat3 prot3 ~ Trait,
at(Tr,1).htd1 at(Tr,2).htd1 at(Tr,3).htd1,
at(Tr,4).htd2 at(Tr,5).htd2 at(Tr,6).htd2,
at(Tr,7).htd3 at(Tr,8).htd3 at(Tr,9).htd3,
!r ![at(Tr,1).leg(dim1,2).animal at(Tr,2).leg(dim1,2).animal at(Tr,3).leg(dim1,2).animal,
at(Tr,4).leg(dim2,2).animal at(Tr,5).leg(dim2,2).animal at(Tr,6).leg(dim2,2).animal,
at(Tr,7).leg(dim3,2).animal at(Tr,8).leg(dim3,2).animal at(Tr,9).leg(dim3,2).animal !],
![at(Tr,1).leg(dim1,2).p2 at(Tr,2).leg(dim1,2).p2 at(Tr,3).leg(dim1,2).p2,
at(Tr,4).leg(dim2,2).p2 at(Tr,5).leg(dim2,2).p2 at(Tr,6).leg(dim2,2).p2,
at(Tr,7).leg(dim3,2).p2 at(Tr,8).leg(dim3,2).p2 at(Tr,9).leg(dim3,2).p2 !] ! mv
3 2 2 !STEP 0.01 ASMV 10
#12 !S2==1

#90 0 DIAG !+90
# 0.657908 0.637942 0.771447 0.657908 0.637942 0.771447 0.657908 0.637942 0.771447
# 0.422727 0.453957 0.526399 0.422727 0.453957 0.526399 0.422727 0.453957 0.526399
# 0.386030 0.402864 0.442875 0.386030 0.402864 0.442875 0.386030 0.402864 0.442875
# 0.320358 0.322828 0.377327 0.320358 0.322828 0.377327 0.320358 0.322828 0.377327
# 0.266839 0.270653 0.303710 0.266839 0.270653 0.303710 0.266839 0.270653 0.303710
# 0.226540 0.221478 0.253297 0.226540 0.221478 0.253297 0.226540 0.221478 0.253297
# 0.230738 0.204920 0.216980 0.230738 0.204920 0.216980 0.230738 0.204920 0.216980
# 0.213249 0.191251 0.202024 0.213249 0.191251 0.202024 0.213249 0.191251 0.202024
# 0.192626 0.164194 0.187223 0.192626 0.164194 0.187223 0.192626 0.164194 0.187223
# 0.188050 0.142975 0.141640 0.188050 0.142975 0.141640 0.188050 0.142975 0.141640


How to model this matrix?

Period I lact II lact II lact
(Test No)

39.31921 22.01876 18.08683 47.19110 18.87644 16.51689 49.50758 14.85227 13.36705
1 22.01876 23.51595 11.28766 18.87644 28.82707 9.22466 14.85227 30.13304 7.53326
18.08683 11.28766 14.03567 16.51689 9.22466 16.21727 13.36705 7.53326 16.82260

27.52344 15.41313 12.66078 33.03377 13.21351 11.56182 34.65530 10.39659 9.35693
2 15.41313 16.46117 7.90136 13.21351 20.17895 6.45726 10.39659 21.09313 5.27328
12.66078 7.90136 9.82497 11.56182 6.45726 11.35209 9.35693 5.27328 11.77582

26.34387 14.75257 12.11818 31.61804 12.64721 11.06631 33.17007 9.95102 8.95592
3 14.75257 15.75569 7.56273 12.64721 19.31414 6.18052 9.95102 20.18914 5.04728
12.11818 7.56273 9.40390 11.06631 6.18052 10.86557 8.95592 5.04728 11.27114

25.16429 14.09200 11.57557 30.20230 12.08092 10.57081 31.68485 9.50545 8.55491
4 14.09200 15.05021 7.22410 12.08092 18.44932 5.90378 9.50545 19.28514 4.82129
11.57557 7.22410 8.98283 10.57081 5.90378 10.37906 8.55491 4.82129 10.76647

23.98472 13.43144 11.03297 28.78657 11.51463 10.07530 30.19962 9.05989 8.15390
5 13.43144 14.34473 6.88547 11.51463 17.58451 5.62704 9.05989 18.38115 4.59529
11.03297 6.88547 8.56176 10.07530 5.62704 9.89254 8.15390 4.59529 10.26179

22.80514 12.77088 10.49036 27.37084 10.94834 9.57979 28.71439 8.61432 7.75289
6 12.77088 13.63925 6.54684 10.94834 16.71970 5.35030 8.61432 17.47716 4.36929
10.49036 6.54684 8.14069 9.57979 5.35030 9.40602 7.75289 4.36929 9.75711

21.62556 12.11032 9.94776 25.95511 10.38204 9.08429 27.22917 8.16875 7.35187
7 12.11032 12.93377 6.20821 10.38204 15.85489 5.07356 8.16875 16.57317 4.14329
9.94776 6.20821 7.71962 9.08429 5.07356 8.91950 7.35187 4.14329 9.25243

20.44599 11.44975 9.40515 24.53937 9.81575 8.58878 25.74394 7.72318 6.95086
8 11.44975 12.22829 5.86958 9.81575 14.99008 4.79682 7.72318 15.66918 3.91729
9.40515 5.86958 7.29855 8.58878 4.79682 8.43298 6.95086 3.91729 8.74775

19.26641 10.78919 8.86255 23.12364 9.24946 8.09327 24.25871 7.27761 6.54985
9 10.78919 11.52282 5.53095 9.24946 14.12526 4.52008 7.27761 14.76519 3.69130
8.86255 5.53095 6.87748 8.09327 4.52008 7.94646 6.54985 3.69130 8.24308

18.08683 10.12863 8.31994 21.70791 8.68316 7.59777 22.77348 6.83205 6.14884
10 10.12863 10.81734 5.19232 8.68316 13.26045 4.24334 6.83205 13.86120 3.46530
8.31994 5.19232 6.45641 7.59777 4.24334 7.45995 6.14884 3.46530 7.73840




at(Tr,1).leg(dim1,2).animal 2
27 0 US
100.51217
-1.04420 18.17910
0.60234 -0.81780 4.93379
0.74988 -0.00779 0.00449 38.70681
-0.00779 0.13563 -0.00610 -0.40212 7.00069
0.00449 -0.00610 0.03681 0.23196 -0.31493 1.89998
1.29391 -0.01344 0.00775 0.91162 -0.00947 0.00546 29.59022
-0.01344 0.23402 -0.01053 -0.00947 0.16488 -0.00742 -0.30741 5.35183
0.00775 -0.01053 0.06351 0.00546 -0.00742 0.04475 0.17733 -0.24076 1.45248
1.16158 -0.01207 0.00696 0.61755 -0.00642 0.00370 1.02925 -0.01069 0.00617 124.65933
-0.01207 0.21009 -0.00945 -0.00642 0.11169 -0.00502 -0.01069 0.18615 -0.00837 -1.29506 22.54646
0.00696 -0.00945 0.05702 0.00370 -0.00502 0.03031 0.00617 -0.00837 0.05052 0.74705 -1.01427 6.11909
0.58814 -0.00611 0.00352 1.20569 -0.01253 0.00723 0.72047 -0.00748 0.00432 0.92632 -0.00962 0.00555 52.00552
-0.00611 0.10637 -0.00479 -0.01253 0.21807 -0.00981 -0.00748 0.13031 -0.00586 -0.00962 0.16754 -0.00754 -0.54028 9.40596
0.00352 -0.00479 0.02887 0.00723 -0.00981 0.05918 0.00432 -0.00586 0.03537 0.00555 -0.00754 0.04547 0.31166 -0.42313 2.55277
0.98513 -0.01023 0.00590 0.79399 -0.00825 0.00476 1.16158 -0.01207 0.00696 1.32332 -0.01375 0.00793 1.07336 -0.01115 0.00643 36.67043
-0.01023 0.17818 -0.00802 -0.00825 0.14360 -0.00646 -0.01207 0.21009 -0.00945 -0.01375 0.23934 -0.01077 -0.01115 0.19413 -0.00873 -0.38096 6.63238
0.00590 -0.00802 0.04836 0.00476 -0.00646 0.03897 0.00696 -0.00945 0.05702 0.00793 -0.01077 0.06496 0.00643 -0.00873 0.05269 0.21976 -0.29836 1.80002
1.02925 -0.01069 0.00617 0.51462 -0.00535 0.00308 0.92632 -0.00962 0.00555 1.26450 -0.01314 0.00758 0.74988 -0.00779 0.00449 1.14687 -0.01191 0.00687 137.75070
-0.01069 0.18615 -0.00837 -0.00535 0.09308 -0.00419 -0.00962 0.16754 -0.00754 -0.01314 0.22870 -0.01029 -0.00779 0.13563 -0.00610 -0.01191 0.20743 -0.00933 -1.43107 24.91423
0.00617 -0.00837 0.05052 0.00308 -0.00419 0.02526 0.00555 -0.00754 0.04547 0.00758 -0.01029 0.06207 0.00449 -0.00610 0.03681 0.00687 -0.00933 0.05630 0.82551 -1.12078 6.76170
0.54403 -0.00565 0.00326 1.10276 -0.01146 0.00661 0.69106 -0.00718 0.00414 0.74988 -0.00779 0.00449 1.23509 -0.01283 0.00740 0.92632 -0.00962 0.00555 0.97043 -0.01008 0.00582 52.50200
-0.00565 0.09840 -0.00443 -0.01146 0.19945 -0.00897 -0.00718 0.12499 -0.00562 -0.00779 0.13563 -0.00610 -0.01283 0.22338 -0.01005 -0.00962 0.16754 -0.00754 -0.01008 0.17552 -0.00790 -0.54543 9.49576
0.00326 -0.00443 0.02670 0.00661 -0.00897 0.05413 0.00414 -0.00562 0.03392 0.00449 -0.00610 0.03681 0.00740 -0.01005 0.06063 0.00555 -0.00754 0.04547 0.00582 -0.00790 0.04764 0.31463 -0.42717 2.57
714
0.83810 -0.00871 0.00502 0.66166 -0.00687 0.00397 1.01454 -0.01054 0.00608 1.08806 -0.01130 0.00652 0.88221 -0.00917 0.00529 1.24980 -0.01298 0.00749 1.32332 -0.01375 0.00793 1.10276 -0.01146 0.00
661 40.42794
-0.00871 0.15158 -0.00682 -0.00687 0.11967 -0.00538 -0.01054 0.18349 -0.00825 -0.01130 0.19679 -0.00885 -0.00917 0.15956 -0.00718 -0.01298 0.22604 -0.01017 -0.01375 0.23934 -0.01077 -0.01146 0.19945 -0.00
897 -0.42000 7.31199
0.00502 -0.00682 0.04114 0.00397 -0.00538 0.03248 0.00608 -0.00825 0.04980 0.00652 -0.00885 0.05341 0.00529 -0.00718 0.04330 0.00749 -0.01017 0.06135 0.00793 -0.01077 0.06496 0.00661 -0.00897 0.05
413 0.24227 -0.32893 1.98447
animal 0 AINV
at(Tr,1).leg(dim1,2).p2 2
27 0 US !GP
143.21391
-1.48783 25.90233
0.85825 -1.16523 7.02987
1.26450 -0.01314 0.00758 48.00642
-0.01314 0.22870 -0.01029 -0.49873 8.68266
0.00758 -0.01029 0.06207 0.28769 -0.39060 2.35647
1.42624 -0.01482 0.00855 1.29391 -0.01344 0.00775 42.58942
-0.01482 0.25796 -0.01160 -0.01344 0.23402 -0.01053 -0.44245 7.70292
0.00855 -0.01160 0.07001 0.00775 -0.01053 0.06351 0.25523 -0.34652 2.09057
0.70577 -0.00733 0.00423 0.58814 -0.00611 0.00352 0.69106 -0.00718 0.00414 168.04500
-0.00733 0.12765 -0.00574 -0.00611 0.10637 -0.00479 -0.00718 0.12499 -0.00562 -1.74579 30.39340
0.00423 -0.00574 0.03464 0.00352 -0.00479 0.02887 0.00414 -0.00562 0.03392 1.00705 -1.36727 8.24874
0.54403 -0.00565 0.00326 0.73518 -0.00764 0.00441 0.60284 -0.00626 0.00361 1.29391 -0.01344 0.00775 55.85395
-0.00565 0.09840 -0.00443 -0.00764 0.13297 -0.00598 -0.00626 0.10903 -0.00490 -0.01344 0.23402 -0.01053 -0.58026 10.10200
0.00326 -0.00443 0.02670 0.00441 -0.00598 0.03609 0.00361 -0.00490 0.02959 0.00775 -0.01053 0.06351 0.33472 -0.45445 2.74167
0.69106 -0.00718 0.00414 0.64695 -0.00672 0.00388 0.73518 -0.00764 0.00441 1.42624 -0.01482 0.00855 1.32332 -0.01375 0.00793 50.09990
-0.00718 0.12499 -0.00562 -0.00672 0.11701 -0.00526 -0.00764 0.13297 -0.00598 -0.01482 0.25796 -0.01160 -0.01375 0.23934 -0.01077 -0.52048 9.06130
0.00414 -0.00562 0.03392 0.00388 -0.00526 0.03176 0.00441 -0.00598 0.03609 0.00855 -0.01160 0.07001 0.00793 -0.01077 0.06496 0.30024 -0.40763 2.45923
0.52933 -0.00550 0.00317 0.39699 -0.00412 0.00238 0.49992 -0.00519 0.00300 0.61755 -0.00642 0.00370 0.48522 -0.00504 0.00291 0.63225 -0.00657 0.00379 175.45904
-0.00550 0.09574 -0.00431 -0.00412 0.07180 -0.00323 -0.00519 0.09042 -0.00407 -0.00642 0.11169 -0.00502 -0.00504 0.08776 -0.00395 -0.00657 0.11435 -0.00514 -1.82281 31.73434
0.00317 -0.00431 0.02598 0.00238 -0.00323 0.01949 0.00300 -0.00407 0.02454 0.00370 -0.00502 0.03031 0.00291 -0.00395 0.02382 0.00379 -0.00514 0.03103 1.05148 -1.42759 8.61267
0.44111 -0.00458 0.00264 0.57344 -0.00596 0.00344 0.48522 -0.00504 0.00291 0.57344 -0.00596 0.00344 0.70577 -0.00733 0.00423 0.64695 -0.00672 0.00388 1.29391 -0.01344 0.00775 60.73098
-0.00458 0.07978 -0.00359 -0.00596 0.10371 -0.00467 -0.00504 0.08776 -0.00395 -0.00596 0.10371 -0.00467 -0.00733 0.12765 -0.00574 -0.00672 0.11701 -0.00526 -0.01344 0.23402 -0.01053 -0.63092 10.98409
0.00264 -0.00359 0.02165 0.00344 -0.00467 0.02815 0.00291 -0.00395 0.02382 0.00344 -0.00467 0.02815 0.00423 -0.00574 0.03464 0.00388 -0.00526 0.03176 0.00775 -0.01053 0.06351 0.36395 -0.49413 2.
98107
0.52933 -0.00550 0.00317 0.48522 -0.00504 0.00291 0.57344 -0.00596 0.00344 0.66166 -0.00687 0.00397 0.58814 -0.00611 0.00352 0.72047 -0.00748 0.00432 1.42624 -0.01482 0.00855 1.33802 -0.01390 0.
00802 52.46081
-0.00550 0.09574 -0.00431 -0.00504 0.08776 -0.00395 -0.00596 0.10371 -0.00467 -0.00687 0.11967 -0.00538 -0.00611 0.10637 -0.00479 -0.00748 0.13031 -0.00586 -0.01482 0.25796 -0.01160 -0.01390 0.24200 -0.
01089 -0.54501 9.48830
0.00317 -0.00431 0.02598 0.00291 -0.00395 0.02382 0.00344 -0.00467 0.02815 0.00397 -0.00538 0.03248 0.00352 -0.00479 0.02887 0.00432 -0.00586 0.03537 0.00855 -0.01160 0.07001 0.00802 -0.01089 0.
06568 0.31438 -0.42684 2.57512
p2 0 ID
View user's profile Send private message
Arthur
Posted: Wed Feb 22, 2012 7:27 pm Reply with quote
Joined: 05 Aug 2008 Posts: 327 Location: Orange, NSW
Dear Kon, there are several possabilities.

1) Sort the data by perion and note thenumber in each period,
then write the R sttructure as 90 lines like

90 1 2
N1 0 !S2=.65
N2 0 !S2=.60
...

2) You could also try a simple model using weights.
SInce it seems the variance decreases with time,
create a period variable 90/90 89/90 ... 1/90 and invert it to form a weight.

Say the variable is call PWT

Fit the model as
Y !WT PWT ~ ... !r units...
1 1 2
0
...

So the residual variance has two parts : the variance componmt for units about 0.4, and the regression part 0.25


But not that a typical RR model has changing residual variance implicit in the model in any case.

PS I didn't respond to your intial query because I was unclear as to what you wanted to do.
I may still not have grasped it.

_________________
Arthur Gilmour

Retired Principal Research Scientist (Biometrics)
View user's profile Send private message Send e-mail Visit poster's website

Display posts from previous:  

All times are GMT
Page 1 of 1
Post new topic

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum