Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-20 Thread Jarrod Hadfield
://scholar.google.com/citations?user=nBSC4-EJ=it - Original Message - From: "Jarrod Hadfield" To: "David COSTANTINI" Cc: "r-sig-phylo" Sent: Monday, 17 May, 2021 21:34:34 Subject: Re: [R-sig-phylo] phylogenetic correction and MCMC model Hi, chronos adds a chronos

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
://davidcostantini.wordpress.com/ https://twitter.com/DavidZool http://scholar.google.com/citations?user=nBSC4-EJ=it - Original Message - From: "Jarrod Hadfield" To: "David COSTANTINI" Cc: "r-sig-phylo" Sent: Monday, 17 May, 2021 21:34:34 Subject: Re: [R-sig-phylo] phylogen

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
Ecology http://davidcostantini.wordpress.com/ https://twitter.com/DavidZool http://scholar.google.com/citations?user=nBSC4-EAAAAJ=it - Original Message - From: "Jarrod Hadfield" To: "David COSTANTINI" , "r-sig-phylo" Sent: Monday, 17 May, 2021 19:48:59 Subject: R

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
Hi David, It looks like phylo_ultra might be a list? Is phylo_ultra[[1]] a tree? Also, don't use nodes="TIPS"; this is just to demonstrate how poor the algorithm is when you don't use the expanded inverse. I see people using nodes="TIPS" a lot - where does this code come from? Cheers, Jarrod

Re: [R-sig-phylo] Comparing DIC of phylogenetic and non-phylogenetic GLMM run with MCMC (MCMCglmm)

2018-06-21 Thread Jarrod Hadfield
Hi Liam, In multi-level models DIC can be 'focused' at different levels. In MCMCglmm, DIC is focussed at the highest possible level because this is the only level at which it can be analytically computed for non-Gaussian models. The highest level is not the level at which most scientists want

Re: [R-sig-phylo] selecting a set of incongruent trees from a posterior distribution

2017-07-26 Thread Jarrod Hadfield
Hi Jesse, In order to account for phylogenetic uncertainty you are better just pulling trees from their posterior rather than choosing trees that are incongruent. The latter will give estimates biased toward those associated with extreme trees. If the analysis is the binomial model you

Re: [R-sig-phylo] How to incorporate intraspecific variation in MCMCglmm

2017-07-17 Thread Jarrod Hadfield
Dear Jarrod, Thanks very much for the quick reply. I'll try to implement the changes in the model. Have a nice weekend, Diogo Em Sex, 14 de jul de 2017 17:48, Jarrod Hadfield <j.hadfi...@ed.ac.uk <mailto:j.hadfi...@ed.ac.uk>> escreveu: Hi Diogo,

Re: [R-sig-phylo] How to incorporate intraspecific variation in MCMCglmm

2017-07-14 Thread Jarrod Hadfield
Hi Diogo, First, your model1 is unlikely to be valid unless the residual variance happens to be 1. You should not fix it at one, and use a prior like: prior = list(R = list(V = 1, nu = 0.02), G=list(G1=list(V=1, nu=0.02))) Note that the residual variance (Ve) is the intra-specific variance,

Re: [R-sig-phylo] Threshold models using threshBayes vs MCMCglmmRAM

2016-12-15 Thread Jarrod Hadfield
data=traits, prior=prior.dep2, pr=TRUE, pl=TRUE, family="threshold") an send me the summary and hist(dep2$Liab) Cheers, Jarrod On 16/12/2016

Re: [R-sig-phylo] Threshold models using threshBayes vs MCMCglmmRAM

2016-12-15 Thread Jarrod Hadfield
l=TRUE, family="threshold") an send me the summary and hist(dep2$Liab) Cheers, Jarrod On 16/12/2016 07:02, Jarrod Hadfield wrote: Hi Chris, I think ngen in threshbayes is not the number of full iterations (i.e. a full update of all parameters), but the number of full iterat

Re: [R-sig-phylo] Threshold models using threshBayes vs MCMCglmmRAM

2016-12-15 Thread Jarrod Hadfield
Hi Chris, I think ngen in threshbayes is not the number of full iterations (i.e. a full update of all parameters), but the number of full iterations multiplied by the number of nodes (2n-1). With n=600 species this means threshbayes has only really done about 8,000 iterations (i.e. about

Re: [R-sig-phylo] Accounting for phylogeny in binary predictor, binary response data

2016-02-11 Thread Jarrod Hadfield
derive from your specification of the priors. Usually you don’t specify the prior for B in MCMCglmm. The problem may also be related to the size of your dataset. Estimation of effects can be difficult with binary data, when the dataset is small. Below is a small example from Jarrod Hadfield for b

Re: [R-sig-phylo] A perfect storm: phylogenetic trees, random effects and zero-inflated binomial data

2015-10-14 Thread Jarrod Hadfield
Dear Diederik, The lack of convergence is because the residual variance is non-identifiable with binary data but you have a very weak prior on it. You should fix the residual variance at something (I usually use 1): prior.test<-list(R=list(V=1,fix=1), G=list(G1=list(V=1, nu=0.002),G2 =

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-22 Thread Jarrod Hadfield
for the question. This should be easier for a continuous predictor, right? Cheers Gustaf On 2015-01-22 12:23, Jarrod Hadfield wrote: Hi Gustaf, In the model with just species the residual variation is measurement error/plasticity error, but could also include deviations from the assumed BM process

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-22 Thread Jarrod Hadfield
we observe: Va / (Va+Vhab+Ve) #phylo Vhab / (Va+Vhab+Ve) #habitat Ve / (Va+Vhab+Ve) #measurement/plasticity/local adaption and other processes Did I get that right or am I lost? Gustaf On 2015-01-22 04:54, Jarrod Hadfield wrote: Hi Gustaf, 1/ You can ignore nhabitat: for some reason

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-21 Thread Jarrod Hadfield
Dear Gustaf, How many levels of `habitat' are there, and are they cross-classified with respect to species (i.e. are multiple species measured in the same habitat)? Assuming for now there are a reasonable number of habitats then the simplest model (without cross-classification) in

Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-08 Thread Jarrod Hadfield
2013 um 14:54 Uhr VON: Jarrod Hadfield j.hadfi...@ed.ac.uk AN: Sereina Graber sereina.gra...@gmx.ch CC: r-sig-phylo@r-project.org BETREFF: Re: Aw: Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification? Hi, They are the effect of the covariates

Re: [R-sig-phylo] MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-02 Thread Jarrod Hadfield
Hi Sereina, You should not get that error message when you do not specify a prior - but if you do can you let me know. For the prior you specified you get the error message because us(trait):units is specifying a 3x3 covariance matrix, and yet your prior, R=list(V=1,nu=0.002), is

Re: [R-sig-phylo] MCMCglmm: G-structure R-Structure

2012-12-17 Thread Jarrod Hadfield
Hi Sam, The terminology G and R structure is used widely, for example in ASreml SAS and probably others. The G-structure is the covariance matrix of the random effects and the R-structure is the covariance matrix of the residuals. In your model you have one random term (animal) and one

Re: [R-sig-phylo] Phylogenetic signal and PGLS

2012-11-29 Thread Jarrod Hadfield
Hi, ASReml is another option, which uses REML. It takes 1/10th of a second on a 1000 tip phylogeny and is considerably more flexible. fit-asreml(y~x,random=~giv(species),data=dat,ginverse=list(species=sm2asreml(Ainv))) # with the data set up as: ntips-1000 tree-rcoal(ntips) #

Re: [R-sig-phylo] specifying priors in MCMCglmm - phylogenetic logistic regression

2012-10-03 Thread Jarrod Hadfield
Hi, Quoting Margaret Evans mekev...@yahoo.com on Mon, 24 Sep 2012 22:56:48 +0100 (BST): Hello all, I have a few questions concerning the specification of flat priors (on the probability scale) for a phylogenetic logistic regression in MCMCglmm. 1) First, I'd like to verify my

Re: [R-sig-phylo] testing binomial characters

2012-08-30 Thread Jarrod Hadfield
Hi, Regarding the blog and the feasibility of MCMCglmm for threshold models: If y1 is binary and y2 is normal, then the univariate analysis would be: Ainv-inverseA(tree)$Ainv m1-MCMCglmm(y1~y2, random=~species,ginverse=list(species=Ainv), data=my.data, prior=my.prior, family=ordinal)

Re: [R-sig-phylo] asymmetric transitions

2012-08-17 Thread Jarrod Hadfield
Hi, Thanks for the Allman Rhodes paper, it is very nice. For me at least it confirms my suspicions, but made me realise that claims of asymmetric transition rates are only suspicious if you are unprepared to make some (strong?) assumptions. If anyone disagrees with what I have written

Re: [R-sig-phylo] asymmetric transitions

2012-08-17 Thread Jarrod Hadfield
On Aug 17, 2012, at 6:31 AM, Jarrod Hadfield wrote: Hi, Thanks for the Allman Rhodes paper, it is very nice. For me at least it confirms my suspicions, but made me realise that claims of asymmetric transition rates are only suspicious if you are unprepared to make some (strong?) assumptions

[R-sig-phylo] asymmetric transitions

2012-08-16 Thread Jarrod Hadfield
Hi, I have been helping someone with some analyses and came across some routines to estimate asymmetric transition rates between discrete characters. This surprised me because its fairly straightforward to prove that asymmetric transition rates cannot be identified using data collected

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Jarrod Hadfield
supported y-rbinom(n, 1, 0.5) # random data unconnected to the tree but p=0.5 m1-ace(y, tree, type = d, model=SYM) m2-ace(y, tree, type = d, model=ARD) anova(m1, m2) # asymmetric evolutionary transition not supported Cheers, Jarrod Quoting Jarrod Hadfield j.hadfi...@ed.ac.uk on Thu, 16

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Jarrod Hadfield
On Aug 16, 2012, at 10:09 AM, Jarrod Hadfield wrote: Hi, I have had a few replies off-list which have made me try and clarify what I mean. I think the distinction needs to be made between two types of probability: the probability that an outcome is 0 or 1 Pr(y| \theta) and the probability density

Re: [R-sig-phylo] [R-sig-ME] Phylogenetic meta-analysis and setting animal variable in MCMCglmm

2009-09-18 Thread Jarrod Hadfield
Dear Wayne, This is my fault. With phylogenies the ancestral nodes are treated as missing data and so I set their measurement error to an arbitrary value. The code for working out how many new measurement errors there are was incorrect. L98 of MCMCglmm.R should read mev-c(mev, rep(1,