Re: trouble with extraction/interpretation of variance struct ure para meters from a model built using gnls and varConstPower
Works perfectly. Thank you.
From: Spencer Graves [mailto:[hidden email]]
Sent: Sunday, January 15, 2006 6:41 PM
To: Rand, Hugh
Cc: '[hidden email]'
Subject: Re: [R] trouble with extraction/interpretation of variance
structure para meters from a model built using gnls and varConstPower
Does that answer the question about not understanding the
between summary(model3) and coef(model3$modelStruct$varStruct)["const"]?
Regarding the question about R not being able to find
I tried the following:
 coef.varIdent* coef.varPower*
Non-visible functions are asterisked
Since "coef.varFunc" is "asterisked", I tried
'getAnywhere(coef.varFunc)'. I walked through this code line by line,
until I found the following:
> (val <- as.vector(model3$modelStruct$varStruct))
Variance function structure of class varConstPower representing
Answer the questions?
Rand, Hugh wrote:
> I have been using gnls with the weights argument (and varConstPower) to
> specify a variance structure for curve fits. In attempting to extract the
> parameters for the variance model I am seeing results I don't understand.
> When I simply display the model (or use "summary" on the model), I get
> seem like reasonable values for both "power" and "const". When I actually
> try to extract the values, I get the same number for the "power", but a
> different (and less sensible) value for "const".
> The simplest example I can come up with that shows the problem is as
> #Set up data
> x = c(0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7);
> y0 = c(.1,.1,.1, .5,.5,.5, 1,1,1, 2,2,2, 4,4,4, 7,7,7, 9,9,9, 10,10,10);
> yp = c(0,.03,.05, 0,.05,.01, 0,.07,.03, .1,0,.2, .2,.1,0, .3,0,.1,
> 0,.3,.4, .3,.5,0);
> y = y0 + 4*yp;
> data = data.frame(x=x,y=y);
> #Run model
> model3 = try(gnls(y ~
> coef(model3$modelStruct$varStruct)["const"]; #const = -0.4229219
> coef.varFunc(model3$modelStruct$varStruct); #R can't seem to find this
> function, Splus can
> Any advice on what I am doing wrong would be appreciated.
> Hugh Rand
> Senior Scientist
> [hidden email] >
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!