douglas GXE analysis row and columns within site

28 views
Skip to first unread message

fj lario

unread,
Jun 8, 2021, 2:33:02 AM6/8/21
to breedR
Dear Facundo, thank you for inviting me to this group.

I am studying the way to analyse a model in which you study the spacial components and in different sites at the same time... following course material I wrote:

data<- douglas

## Use breedR internal functions to compute splines models on each site
sp1 <- breedR:::breedr_splines(douglas[douglas$site == 's1', c('x', 'y')])

sp2 <- breedR:::breedr_splines(douglas[douglas$site == 's2', c('x', 'y')])

sp3 <- breedR:::breedr_splines(douglas[douglas$site == 's3', c('x', 'y')])
## Manually build the full incidence matrices with 0
## and the values computed before
mm1 <- model.matrix(sp1)
mm2 <- model.matrix(sp2)
mm3 <- model.matrix(sp3)

inc.sp1 <- Matrix::Matrix(0, nrow = nrow(douglas), ncol = ncol(mm1))
inc.sp1[douglas$site == 's1', ] <- mm1
inc.sp2 <- Matrix::Matrix(0, nrow = nrow(douglas), ncol = ncol(mm2))
inc.sp2[douglas$site == 's2', ] <- mm2
inc.sp3 <- Matrix::Matrix(0, nrow = nrow(douglas), ncol = ncol(mm3))
inc.sp3[douglas$site == 's3', ] <- mm3
reml.spl <- remlf90 (fixed=C13~1,
                     generic = list(sp1 = list(inc.sp1, breedR:::get_structure(sp1)),
                                   sp2 = list(inc.sp2, breedR:::get_structure(sp2)),
                                   sp3 = list(inc.sp3, breedR:::get_structure(sp3))),
                                data = data,
                                method ="em")

And what I got was a error message that I don't understand:
Error in strsplit(reml.out[last.round.idx], split = "In round")[[1]] : 
  subscript out of bounds

Will you be so kind to help me. What should I have to do now?

Thank you so much in advance

Bester regards

Paco Lario
                   

Facundo Muñoz

unread,
Jun 8, 2021, 6:35:56 AM6/8/21
to bre...@googlegroups.com

Dear Paco,

Congratulations! you've found a bug :)

Unfortunately however, it seems to be in the upstream codebase (i.e. PROGSF90 which are the computing libraries behind breedR). This means that I have no control over it.

As a workaround, I've found that as long as you use another random effect in the model (e.g. random = ~ mum), it passes.

The issue seems to be related to an excessive number of zero-valued columns in the incidence matrix of the random effects for the observations in sites 2 and 3. As far as there is some other effect involved, it works.

I hope it helps. Sorry for not giving a more elegant solution.

ƒacu.-

--
Report issues at https://github.com/famuvie/breedR/issues
---
You received this message because you are subscribed to the Google Groups "breedR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to breedr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/breedr/c44c69c2-5f5f-46ff-992e-084c08152988n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages