From spencer.graves at pdf.com  Thu Jul 28 05:58:27 2005
From: spencer.graves at pdf.com (Spencer Graves)
Date: Wed, 27 Jul 2005 20:58:27 -0700
Subject: [Rd] evaluating variance functions in nlme
In-Reply-To: <1122407801.26649.239292761@webmail.messagingengine.com>
References: <1122407801.26649.239292761@webmail.messagingengine.com>
Message-ID: <42E857E3.6060200@pdf.com>

	  Yes, this probably should go to R-help, and before you do that, I 
suggest you PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html.  It can increase the 
likelihood you will get a useful reply relatively quickly.

	  I tried the your two calls to "gnls", which of course produced errors 
for me as I don't have your data.  The help page for "gnls" included an 
example that looked quite similar to me:

 >      fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean,
+                  weights = varPower())
 >      summary(fm1)>      fm1 <- gnls(weight ~ SSlogis(Time, Asym, 
xmid, scal), Soybean,
+                  weights = varPower())
 >      summary(fm1)

	  Those results plus "str(fm1)" looked like they might help answer your 
question.  However, I don't understand enough of what you are asking to 
say.

	  If an answer might still be worth pursuing to you, I suggest you read 
the posting guide and submit a question following that model to r-help.

	  spencer graves

Nicholas Lewin-Koh wrote:

> Hi,
> I guess this is a final plea, and maybe this should go to R-help but
> here goes.
> I am writing a set of functions for calibration and prediction, and to
> calculate standard 
> errors and intervals I need the variance function to be evaluated at new
> prediction points.
> So for instance
> 
> fit<-gnls(Y~SSlogis(foo,Asym,xmid,scal),weights=varPower())
> fit2<-gnls(Y~SSlogis(foo,Asym,xmid,scal),weights=varPower(form=~foo))
> 
> Now using fit or fit2 I would like to get the variance function
> evaluated at new points. 
> I have played with getCovariateFormula, and looked at Initialize.gnls,
> summary etc.
> but it is not clear to me how to evaluate the form component, especially
> in the case of fit
> above where form=~fitted(.), in any safe way.
> 
> I can grep for "fitted" in the formula eg.
> grep("fitted",deparse(getCovariateFormula(fit$modelStruct$varFunc)))
> and try to calculate predicted values from the model for the new points
> but how to substitute back in the new terms?
> 
> I don't need this problem solved on a platter, I just need to unedrstand
> an approach,
> because my stabs are failing.
> 
> Thanks
> 
> Nicholas
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915



[Rd] evaluating variance functions in nlme
Spencer Graves