[R-sig-ME] MCMCglmm Starting Value structure
Jarrod Hadfield
j.hadfield at ed.ac.uk
Wed Jun 8 06:26:44 CEST 2011
Hi,
A bug has crept into MCMCglmm at some point when specifying starting
values. The correct syntax should be start2c for which you get an error
message. I will update as soon I have finished some of the other updates
I am working on. As a work around you can add another matrix to the G
element:
start2c$G[[5]]<-diag(2)
It will be ignored but will alow the code to run.
Sorry,
Jarrod
On Tue, 2011-06-07 at 10:34 -0700, Robin Jeffries wrote:
> I am having some difficulty defining the correct structure for the
> starting values in MCMCglmm.
> Several prior google searches for examples of starting values for
> MCMCglmm resulted only in one unhelpful L-serv posting where the
> poster was subsequently told to RTM and quit posting. I hope that I
> show that I have spent time trying to find the answer on my own prior
> to posting.
>
>
> My prior structure is:
>
> prior1 = list(R = list(V = 1, nu = .002),
> G = list(
> G1 = list(V = diag(3), n=4),
> G2 = list(V = diag(3), n=4),
> G3 = list(V = 1, nu=1),
> G4 = list(V = 1, nu=1)
> ))
>
>
> To set up starting values I first set Rc and Gc to be vectors of
> length 1 and 20 respectively. I then tried the starting value
> structure as
>
> start2a = list( R = Rc,
> G = list(
> G1 = Gc[1:9],
> G2 = Gc[10:18],
> G3 = Gc[19],
> G4 = Gc[20]),
> QUASI=FALSE)
>
> which gives me the error "V is the wrong dimension for some
> startG/startR elements"
> So I tried to structure it exactly as the priors (with lists and matricies)
>
> start2b = list(R = list(V =Rc),
> G = list(
> G1 = list(V = matrix(Gc[1:9], nrow=3, ncol=3)),
> G2 = list(V = matrix(Gc[10:18], nrow=3, ncol=3)),
> G3 = list(V = Gc[19]),
> G4 = list(V = Gc[20])
> ))
>
> and got the same error message.
>
> Since the help file/notes/vignette says that "the starting values is a
> list of 4 possible elements, where G itself is also a list with as
> many elements as RE components" I tried a combination of the above
> two:
>
> start2c = list(
> R = Rc,
> G = list(
> G1 = matrix(Gc[1:9], nrow=3, ncol=3),
> G2 = matrix(Gc[10:18], nrow=3, ncol=3),
> G3 = Gc[19],
> G4 = Gc[20]),
> QUASI=FALSE)
>
> but then was greeted with the error "Error in start$G[[r]] : subscript
> out of bounds"
>
> If someone could help me out with what the structure of the starting
> values is supposed to look like, it would be appreciated.
>
>
> Robin Jeffries
> MS, DrPH Candidate
> Department of Biostatistics
> UCLA
> 530-633-STAT(7828)
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the R-sig-mixed-models
mailing list