[R] manual recreation of varConstPower using new fixed effects variables in nlme

JJ josh8912 at yahoo.com
Mon Oct 18 06:04:51 CEST 2004

Hello, I am trying to design new variance structures
by using fixed effects variables in combination with
the VarPower function.  That is, I would like to
create and evaluate my own variance function in the
data frame and then incorporate it into the model
using varPower, with value=.5.  

As a start, I am trying to recreate the function of
VarConstPower by introducing two new variables in the
data frame, d1 and d2. I am using a self-made
function, fx, which contains a logistic equation.  It
all works just fine in combination with the built-in
varConstPower variance structure.  

I try to mimic the varConstPower structure by using
the varPower variance function:
  varPower(form= ~vartemp, fixed= .5)

and then passing the variables d1 and d2 to fx and
adding a statement in fx like:
  vartemp <- (d1+theta^d2)^2
where theta is my covariate.  
However, even though the built-in varConstPower
function does work with my data set, the substitute
function discussed above does not work, even with d1
and d2 set to the correct values.   After about five
passes through the fx function I get the error

Error in MEEM(object, conLin, control$niterEM) :
Singularity in backsolve at level 0, block 1

All, fixed effect variables look correct at the time
the error occurs.  Can anyone tell me if there is some
reason why this kind of approach would not work?  It
seems like it should be straightforward, but I am
having no luck.

I actually pass the d1 and d2 variables to the
function as d1.1, d1.2, d1.3, and d2.1, d2.2, d2.3 to
take into account the three grouping levels I have. 
The three d1's are then condensed into a single d1
column with respect to group.  Same with the d2's. 

Thanks.  John

PS:  Can anyone tell me what the reStruct parameter
means?  In looking at the verbose output, I obtain a
reStruct parameter value of -0.8352462 (this is for my
grouping factor for the random effect).  Does anyone
know what it means?  The actual value of my single
random effect is different, as is its variance.

More information about the R-help mailing list