Hi Daniel,

Thanks for that. I have checked that the parameter names in my reduced 'start' 
vector and the likelihood function are the same and they are, so that doesn't 
seem to be the problem. I've also tried specifying the start vector as the 
parameters that I want rather than (as currently) the whole vector minus the 
parameters I don't want but I get the same message.

Very odd.

Kev

----------------------------------------------------------------------

Message: 1
Date: Thu, 03 Apr 2014 10:02:41 -0700
From: Daniel Caetano <caetano...@gmail.com>
To: r-sig-phylo@r-project.org
Subject: Re: [R-sig-phylo] Error in diversitree with MuSSE models
        (Arbuckle,      Kevin)
Message-ID: <533d9431.6010...@gmail.com>
Content-Type: text/plain

Hi Kev,

Your constrain looks fine but I think you should double check your index
for the 'find.mle' function in this line:
"fit.allcon <-
find.mle(lik.allcon,start[-c(1,2,3,5,6,7,9,10,11,12,13,14,15,16,17,18,19)])"

'start' is a vector with a number of elements equal to the number of
parameters in your full model. To find the MLE of your constrained
likelihood function you need to point to the free parameters in 'start'.

Try this, check if start has only "lambda1","mu1","q12":

fit.allcon <- find.mle(lik.allcon,start[c(1,6,12)])

Good luck

*Daniel Caetano Silva*
Ph.D. Student
Harmon Lab
http://caetanods.weebly.com/
http://www.webpages.uidaho.edu/~lukeh/
University of Idaho - Department of Biological Sciences
Moscow, Idaho 83844-3051 USA
----
On 04/03/2014 03:00 AM, r-sig-phylo-requ...@r-project.org wrote:
> Send R-sig-phylo mailing list submissions to
>       r-sig-phylo@r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> or, via email, send a message with subject or body 'help' to
>       r-sig-phylo-requ...@r-project.org
>
> You can reach the person managing the list at
>       r-sig-phylo-ow...@r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-phylo digest..."
>
>
> Today's Topics:
>
>     1. Re: Error in diversitree with MuSSE models (Arbuckle, Kevin)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 2 Apr 2014 13:23:44 +0000
> From: "Arbuckle, Kevin" <k.arbuc...@liverpool.ac.uk>
> To: Nicholas Crouch <ncro...@uic.edu>
> Cc: "r-sig-phylo@r-project.org" <r-sig-phylo@r-project.org>
> Subject: Re: [R-sig-phylo] Error in diversitree with MuSSE models
> Message-ID:
>       <eb15200a53ef104a85d6d8e071cc0edcb2131...@bhexmbx2.livad.liv.ac.uk>
> Content-Type: text/plain
>
> Hi Nick, it's running (or trying to) on diversitree v0.9-7
>
>
>
> Kev
>
>
>
>
>
> ________________________________
> From: Nicholas Crouch [ncro...@uic.edu]
> Sent: 01 April 2014 17:01
> To: Arbuckle, Kevin
> Subject: Re: [R-sig-phylo] Error in diversitree with MuSSE models
>
>
> Kev,
>
> What version of diversitree are you running?
>
> Nick
>
> On Apr 1, 2014 10:50 AM, "Arbuckle, Kevin" 
> <k.arbuc...@liverpool.ac.uk<mailto:k.arbuc...@liverpool.ac.uk>> wrote:
> Hi,
>
> I am trying to run a set of MuSSE models in diversitree but getting error 
> messages that I can't seem to figure out (fortunately the models are only an 
> adjunct to my main premise, not particularly vital). The trait has 4 levels 
> and the full model works fine, with the following code:-
>
> lik<-make.musse(contree,col,k=4,sampling.f=0.33)
> start<-starting.point.musse(contree,k=4)
> fit<-find.mle(lik,start)
>
> However, when I then try and run a fully constrained model (with only a 
> single speciation rate, extinction rate, and transition rate) with the 
> following code:-
>
> lik.allcon<-constrain(lik,lambda1~lambda2,lambda2~lambda3,lambda3~lambda4,mu1~mu2,mu2~mu3,mu3~mu4,q12~q13,q13~q14,q14~q21,q21~q23,q23~q24,q24~q31,q31~q32,q32~q34,q34~q41,q41~q42,q42~q43)
> fit.allcon<-find.mle(lik.allcon,start[-c(1,2,3,5,6,7,9,10,11,12,13,14,15,16,17,18,19)])
>
> I get the following error message:-
>
> Error in check.pars.nonnegative(pars, k * (k + 1)) :
>    Parameters must be non-negative and finite
>
> I don't quite understand why or how to fix this. I have previously run BiSSE 
> models (including with constraints) on the same dataset (just with different 
> coding of some levels which made the trait binary) and had no problems. After 
> looking through the diversitree manual I have tried specifying/changing the 
> fail.value and method arguments in find.mle, but I get exactly the same 
> message. Any help or ideas would be greatly appreciated. I presume it is 
> something introduced via the constraints since the full model runs fine, but 
> other than that I am none the wiser.
>
> Thanks,
>
> Kev
>
>
>          [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list - 
> R-sig-phylo@r-project.org<mailto:R-sig-phylo@r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
>
>       [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> _______________________________________________
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
>
> End of R-sig-phylo Digest, Vol 75, Issue 3
> ******************************************
>


        [[alternative HTML version deleted]]



------------------------------

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


End of R-sig-phylo Digest, Vol 75, Issue 4
******************************************

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to