[R] Does pdf() not work on Trellis graphics?

2004-02-19 Thread Adi Humbert
Hello, I have the following example. testpdf - function(x,y){ pdf() #plot(x,y) xyplot(x~y) dev.off() } source(testpdf.R) x=1:1000 testpdf(x,x) with xyplot, the output is a file that can not be read because it has no pages. With plot it works fine. If I do it manually (from the GUI

[R] error in nls, step factor reduced below minFactor

2004-02-16 Thread Adi Humbert
Hello, I am trying to estimate 4 parameters of a non-linear model using nls. My model function is a Fourier integral and is very expensive to calculate. I get the following error: theta0 - c(0.045, 1.02*10^(-4), 0.00169, 5.67*10^(-4)) res - nls(log(y) ~ log(model(theta,r,t)), data=dataModel,

[R] question about formulating a nls optimization

2003-07-18 Thread Adi Humbert
Dear list, I'm migrating a project from Matlab to R, and I'm facing a relatively complicated problem for nls. My objective function is below: objFun - function(yEx,xEx,tEx,gamma,theta,kappa){ yTh - pdfDY(xEx,tEx,gamma,theta,kappa) sum(log(yEx/yTh)^2) } The equation is