briencj / asremlPlus

asremlPlus is an R package that augments the use of 'ASReml-R' and 'ASReml4-R' in fitting mixed models
Other
16 stars 3 forks source link

estimateV problem with corh variance model #5

Closed szymekdr closed 2 years ago

szymekdr commented 2 years ago

Hi, when trying to use the estimateV.asreml function on a model object I get an error message that Z %*% G are not comformable. Manual says estimate.V can handle cor/corh variance functions - any idea about a workaround?

My model is a fairly simple one:

asreml(myformula, random = ~box+corh(HEXP):boxor, data = myset, maxiter = 200)

(I simplified it from a more complex one with corgh() and some correlations constrained using the vcc option - thought it might be the fault of vcc but the simpler one also does not seem to work).

Any feedback appreciated! Szymek

briencj commented 2 years ago

Hi Szymek,

I am not sure what the terms in your model represent. However, I have test examples that have us, corv, corh and corgh on a factor, e.g. random = ~ corv(Treatment.1):Genotype.ID + Smarthouse:Zones:Mainplots. These example run without error.

It would seem that the most likely problem in your case is related to your particular variables and/or the fit of the model. The Z matrix comes from the design component of the asreml object, this only being available if you use asreml.options(design = TRUE). The G matrix is formed from the variance parameters that are extracted from the vparameters component of the asreml object. These two may not match if there has been a problem with estimating some of the variance parameters, such as some are bound or singular.

The only workaround that I can come up with is to extract the Z matrix and vparameters yourself and manually build the V matrix – not exactly a workaround, but the best that I can do with the available information.

Cheers,

Chris

From: Szymek Drobniak @.*** Sent: Thursday, 5 August 2021 12:18 AM To: briencj/asremlPlus Cc: Subscribed Subject: [briencj/asremlPlus] estimateV problem with corh variance model (#5)

Hi, when trying to use the estimateV.asreml function on a model object I get an error message that Z %*% G are not comformable. Manual says estimate.V can handle cor/corh variance functions - any idea about a workaround?

My model is a fairly simple one:

asreml(myformula, random = ~box+corh(HEXP):boxor, data = myset, maxiter = 200)

(I simplified it from a more complex one with corgh() and some correlations constrained using the vcc option - thought it might be the fault of vcc but the simpler one also does not seem to work).

Any feedback appreciated! Szymek

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/briencj/asremlPlus/issues/5, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADB6GFJFEJZXW5EDZ5SSLDDT3FHKLANCNFSM5BRJ74TQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

szymekdr commented 2 years ago

Hi, thanks for your answer - yes, it seems the problem is in the vector of u - which does not contain BLUPs for levels that cannot be estimated. Pitty asreml is not filling it with zeros as in case of b (that way it still could be used with Z in prediction) - but of course all is diable with manually generated Z based on levels reported in BLUPs.

Thanks! Szymek