Estimating phylogenetic signal when family = bernoulli

138 views
Skip to first unread message

Nora Mitchell

unread,
Apr 6, 2018, 12:33:47 PM4/6/18
to brms-users
Hi all,

I'm following the "Estimating Phylogenetic Multilevel Models with brms" vignette (https://cran.r-project.org/web/packages/brms/vignettes/brms_phylogenetics.html), specifically the phylogenetic model with repeated measures. I'm interested in estimating the phylogenetic signal using hypothesis testing as below:

hyp <- paste(
  "sd_phylo__Intercept^2 /", 
  "(sd_phylo__Intercept^2 + sd_species__Intercept^2 + sigma^2) = 0"
)
(hyp <- hypothesis(model_repeat1, hyp, class = NULL))
but my response variable is a 0 1 outcome, not a continuous variable, thus there is no sigma^2 term. In order to estimate lambda, then, should I add another term (1|obs)? Or is something else necessary? Example model below:
model.full1 <- brm(response ~ 
                    spec_mean_bioclim_PC1 + spec_mean_bioclim_PC2 +
                    within_spec_bioclim_PC1 + within_spec_bioclim_PC2 +
                    (1|phylo) + (1|species) + (1|obs), 
                    family = bernoulli(),  
                    cov_ranef = list(animal = A),
                    sample_prior = TRUE,
                    data = mcmc_data, 
                    thin = 10, warmup = 1000, iter = 2000)
Thanks in advance!

Paul Buerkner

unread,
Apr 6, 2018, 12:36:09 PM4/6/18
to Nora Mitchell, brms-users
I believe, I have answered this question before somewhere on brms-users. Would you mind taking a look of whether you can find it? If not, I will try to find it myself.

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/e0012303-70bd-4fc2-bcef-2e2af4656887%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nora Mitchell

unread,
Apr 6, 2018, 12:49:34 PM4/6/18
to brms-users
Are you referring to this thread? https://groups.google.com/d/msg/brms-users/HrGwo1iQFLE/ePOanP2bCAAJ

I'm not sure how to connect it to the phylogenetic signal, is it not possible to do this with a bernoulli? 


On Friday, April 6, 2018 at 10:36:09 AM UTC-6, Paul Buerkner wrote:
I believe, I have answered this question before somewhere on brms-users. Would you mind taking a look of whether you can find it? If not, I will try to find it myself.
2018-04-06 18:33 GMT+02:00 Nora Mitchell <nora.c....@gmail.com>:
Hi all,

I'm following the "Estimating Phylogenetic Multilevel Models with brms" vignette (https://cran.r-project.org/web/packages/brms/vignettes/brms_phylogenetics.html), specifically the phylogenetic model with repeated measures. I'm interested in estimating the phylogenetic signal using hypothesis testing as below:

hyp <- paste(
  "sd_phylo__Intercept^2 /", 
  "(sd_phylo__Intercept^2 + sd_species__Intercept^2 + sigma^2) = 0"
)
(hyp <- hypothesis(model_repeat1, hyp, class = NULL))
but my response variable is a 0 1 outcome, not a continuous variable, thus there is no sigma^2 term. In order to estimate lambda, then, should I add another term (1|obs)? Or is something else necessary? Example model below:
model.full1 <- brm(response ~ 
                    spec_mean_bioclim_PC1 + spec_mean_bioclim_PC2 +
                    within_spec_bioclim_PC1 + within_spec_bioclim_PC2 +
                    (1|phylo) + (1|species) + (1|obs), 
                    family = bernoulli(),  
                    cov_ranef = list(animal = A),
                    sample_prior = TRUE,
                    data = mcmc_data, 
                    thin = 10, warmup = 1000, iter = 2000)
Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.

Paul Buerkner

unread,
Apr 6, 2018, 12:59:29 PM4/6/18
to brms-users
No. I can't find it myself right now. Let's just answer it again.

You cannot add (1|obs) here because this is not identified in a bernoulli model. You either have to ignore it in the computation of the phylogenetic signal or replace it by some fixed value (pi^2 / 3 I believe. This is the variance of the standard logistic distribution).

There are some papers out there dealing with this exact situation, but I can't remember them right now and can't find them in my folders...

Nora Mitchell

unread,
Apr 6, 2018, 1:08:00 PM4/6/18
to brms-users
Okay thank you!
Reply all
Reply to author
Forward
0 new messages