query: lme

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

query: lme

Pryseley Assam
Dear R Users
   
  I have difficulties accessing the variance components for an lme fit when the variance covariance matrix of the random effects is not positive definite.
   
  Can anyone inform me on how to get by this ?
   
  Thanks in advance
   
  Pryseley

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

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: query: lme

Douglas Bates-2
On 5/16/06, Pryseley Assam <[hidden email]> wrote:
> Dear R Users
>
>   I have difficulties accessing the variance components for an lme fit when the variance covariance matrix of the random effects is not positive definite.

Well, that shouldn't happen.  A variance-covariance matrix is, by
definition, positive-definite and the whole purpose of the pdMat
classes in the nlme package is to ensure that the variance-covariance
matrices over which the optimization of the log-likelihood is
performed stay positive definite.

Are you sure you are not referring to the approximate Hessian matrix
of the parameters that determine the variance-covariance structure?

>   Can anyone inform me on how to get by this ?

Can you tell us how you are trying to do this?

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

query: lme

Pryseley Assam
Good R-users,
   
  I have difficulties accessing the variance components for an lme fit when the variance covariance matrix of the random effects is not positive definite.
   
  For example, i fit the following model:
   
  ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat2a,
  random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials),
  correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp))
   
  intervals(ggg, which="var-cov")
   
  when i try to access the variance components using  the 'intervals' function i get the following error message:
   
  "Error in intervals.lme(ggg, which = "var-cov") :
  Cannot get confidence intervals on var-cov components: Non-positive definite approximate variance-covariance"
   
  Is there a way out of this? or better still
  Is there another function through which i can access these variance components other than the intervals function?
 
Kind regards
  Pryseley

                       
---------------------------------
Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better.
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: query: lme

Andrew Robinson-6
I'm not exactly certain, but it seems to me that you're including a
factor in the LHS of the random term.  You might write down the model
that you're fitting, and reflect upon it. Of course, there may be a
perfectly good reason, but that does make for an exceptionally
complicated model.  You might try to reinvent your question so that it
is matched by a simpler model.  Of course, I'm only speculating,
because you haven't told us anything about the data, or your
intentions.

In general, you might find that the variance covariance matrix of the
random effects not being positive definite could be a sign of a model
that is not a good match with the available data.

Cheers

Andrew

On Mon, May 29, 2006 at 02:15:54AM -0700, Pryseley Assam wrote:

> Good R-users,
>    
>   I have difficulties accessing the variance components for an lme fit when the variance covariance matrix of the random effects is not positive definite.
>    
>   For example, i fit the following model:
>    
>   ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat2a,
>   random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials),
>   correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp))
>    
>   intervals(ggg, which="var-cov")
>    
>   when i try to access the variance components using  the 'intervals' function i get the following error message:
>    
>   "Error in intervals.lme(ggg, which = "var-cov") :
>   Cannot get confidence intervals on var-cov components: Non-positive definite approximate variance-covariance"
>    
>   Is there a way out of this? or better still
>   Is there another function through which i can access these variance components other than the intervals function?
>  
> Kind regards
>   Pryseley
>
>
> ---------------------------------
> Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
Email: [hidden email]         http://www.ms.unimelb.edu.au

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: query: lme

Doran, Harold
In reply to this post by Pryseley Assam
As noted below, it is hard to diagnose the specific issue. But, as a recommendation, I would suggest using lmer and then investigating the parameters of the model using the MCMCsamp() function. You can then do all diagnostics using the various functions in the coda package as MCMCsamp() returns an object of class mcmc.


-----Original Message-----
From: [hidden email] on behalf of Andrew Robinson
Sent: Mon 5/29/2006 7:22 AM
To: Pryseley Assam
Cc: R-Help Discussion
Subject: Re: [R] query: lme

I'm not exactly certain, but it seems to me that you're including a
factor in the LHS of the random term.  You might write down the model
that you're fitting, and reflect upon it. Of course, there may be a
perfectly good reason, but that does make for an exceptionally
complicated model.  You might try to reinvent your question so that it
is matched by a simpler model.  Of course, I'm only speculating,
because you haven't told us anything about the data, or your
intentions.

In general, you might find that the variance covariance matrix of the
random effects not being positive definite could be a sign of a model
that is not a good match with the available data.

Cheers

Andrew

On Mon, May 29, 2006 at 02:15:54AM -0700, Pryseley Assam wrote:

> Good R-users,
>    
>   I have difficulties accessing the variance components for an lme fit when the variance covariance matrix of the random effects is not positive definite.
>    
>   For example, i fit the following model:
>    
>   ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat2a,
>   random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials),
>   correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp))
>    
>   intervals(ggg, which="var-cov")
>    
>   when i try to access the variance components using  the 'intervals' function i get the following error message:
>    
>   "Error in intervals.lme(ggg, which = "var-cov") :
>   Cannot get confidence intervals on var-cov components: Non-positive definite approximate variance-covariance"
>    
>   Is there a way out of this? or better still
>   Is there another function through which i can access these variance components other than the intervals function?
>  
> Kind regards
>   Pryseley
>
>
> ---------------------------------
> Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
Email: [hidden email]         http://www.ms.unimelb.edu.au

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html