[R] nls.control: increasing number of iterations

2005-06-02 Thread Martin Biuw

Hello,
I'm using the nls function and would like to increase the number of 
iterations. According to the documentation as well as other postings on 
R-help, I've tried to do this using the control argument:


nls(y ~ SSfpl(x, A, B, xmid, scal), data=my.data, 
control=nls.control(maxiter=200))


but no matter how much I increase maxiter, I get the following error 
message:


Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal, data = 
xy,  :

   number of iterations exceeded maximum of 50

The second line here suggests that the maximum number of iterations is 
still 50, despite changing the control argument. Also, increasing 
maxiter to something silly, like 5, doesn't seem to increase the 
process time, which made me a bit suspicious that I'm not giving the 
right statement to the control argument. Or is the function indeed 
using the increased number of maxiter, while the error message remains 
the same rather than reflecting the requested change to nls.control?


I should say that nls converges without increasing maxiter when I use 
the full dataset, and it is only when I use a smaller subset that the 
error occurs, possibly due to noisy data. But I would very much 
appreciate if someone could clarify whether the error message is wrong 
or if my statement to the control argument is wrong.


Thanks very much in advance,
Martin

--
Dr Martin Biuw
NERC Postdoctoral research fellow
Sea Mammal Research Unit
Gatty Marine Laboratory
University of St Andrews
St Andrews, Fife KY16 8LB
Scotland
Ph: +44-(0)1334-462677
Fax: +44-(0)1334-462632
www: http://www.smru.st-and.ac.uk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Stochastic dynamic programming

2003-10-23 Thread Martin Biuw
Hello all,
Does anyone know of any already written functions for carrying out 
stochastic dynamic programming in R?

Thanks!

Martin

--
Martin Biuw
Sea Mammal Research Unit
Gatty Marine Laboratory, University of St Andrews
St Andrews, Fife KY16 8PA
Scotland
Ph: +44-(0)1334-462637
Fax: +44-(0)1334-462632
Web: http://smub.st.and.ac.uk
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] (no subject)

2003-10-15 Thread Martin Biuw
Hello,

Does anyone know of any Stochastic Dynamic Programming functions/packages 
for R?

Thanks!

Martin

-- Martin Biuw
Sea Mammal Research Unit
Gatty Marine Laboratory, University of St Andrews
St Andrews, Fife KY16 8PA
Scotland
Ph: +44-(0)1334-462637
Fax: +44-(0)1334-462632
Web: http://smub.st.and.ac.uk
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] insert eps into microsft word

2003-09-10 Thread Martin Biuw
You can also add a Windows metafile preview to your eps image using for 
instance Ghostscript.

Martin

On Wed, 10 Sep 2003 18:12:00 +0100, Karim Elsawy [EMAIL PROTECTED] 
wrote:

it seems that word can not read encapsupalted postscripts generated by R
I used this command
postscript(output.eps,horizontal=F,onefile=TRUE)
since onefile=TRUE produces an encapsualted postscript
actually what I'm trying to do is to insert the postsript file into a
word document
since other formats like jpeg and bmp do not reproduce the same quality
like postscript
formats
any suggestions are very much appreciated
Karim
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help



--
Martin Biuw
Sea Mammal Research Unit
Gatty Marine Laboratory, University of St Andrews
St Andrews, Fife KY16 8PA
Scotland
Ph: +44-(0)1334-462637
Fax: +44-(0)1334-462632
Web: http://smub.st.and.ac.uk
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] (no subject)

2003-08-20 Thread Martin Biuw
Hello,
Is there a simple way to modify the circ.mean function in the CircStats 
package to include a vector of weights to obtain a weighted average angle?

Thanks!

Martin

--
Martin Biuw
Sea Mammal Research Unit
Gatty Marine Laboratory, University of St Andrews
St Andrews, Fife KY16 8PA
Scotland
Ph: +44-(0)1334-462637
Fax: +44-(0)1334-462632
Web: http://smub.st.and.ac.uk
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Confidence prediction limits from bootstrapped linear model

2003-08-15 Thread Martin Biuw
Sorry, I sent this without a subject at first..

Hello,
Is there a simple function that calculates standard errors and confidence 
limits of response values (Y) in a linear model, where parameter estimates 
have been arrived at by bootstrapping (e.g. according to the first example 
in Angelo Canty's prsentation of the boot package in R-News, Dec 2002)? 
Or does anyone have any ideas as to the simplest way to write such a 
function, incorporating enough flexibility in terms of model structure etc?

Thanks!

Martin

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Comparing two regression slopes

2003-07-30 Thread Martin Biuw
Hello,
I've written a simple (although probably overly roundabout) function to 
test whether two regression slope coefficients from two linear models on 
independent data sets are significantly different. I'm a bit concerned, 
because when I test it on simulated data with different sample sizes and 
variances, the function seems to be extremely sensitive both of these. I am 
wondering if I've missed something in my function? I'd be very grateful for 
any tips.

Thanks!

Martin

TwoSlope -function(lm1, lm2) {

## lm1 and lm2 are two linear models on independent data sets

coef1 -summary(lm1)$coef
coef2 -summary(lm2)$coef
sigma -(sum(lm1$residuals^2)+sum(lm2$residuals^2))/(lm1$df.residual + 
lm2$df.residual-4)
SSall -sum(lm1$model[,2]^2) + sum(lm2$model[,2]^2)
SSprod -sum(lm1$model[,2]^2) * sum(lm2$model[,2]^2)

F.val -(as.numeric(coefficients(lm1)[2]) - as.numeric(coefficients(lm2) 
[2]))^2/((SSall/SSprod)*sigma)

p.val -1-pf(F.val, 1, (lm1$df.residual + lm2$df.residual-4))

cat(\n\nTest for equality between two regression slopes\n\n)
cat(\nCoefficients model 1:\n\n)
print(coef1)
cat(\nCoefficients model 2:\n\n)
print(coef2)
cat(\nF-value on 1 and, lm1$df.residual + lm2$df.residual-4, degrees of 
freedom: ,F.val, \n)
cat(p =, ifelse(p.val=0.0001, p.val,  0.0001), \n)

}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Constraining asymptote in SSasymp

2003-07-11 Thread Martin Biuw
Hi all,
Is there a simple way to constrain the Asym argument in the SSasymp 
function so that it does not exceed some maximum value?

Thanks!

Martin

--
Martin Biuw
Sea Mammal Research Unit
Gatty Marine Laboratory, University of St Andrews
St Andrews, Fife KY16 8PA
Scotland
Ph: +44-(0)1334-462637
Fax: +44-(0)1334-462632
Web: http://smub.st.and.ac.uk
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Regression slopes

2003-06-06 Thread Martin Biuw
Hi,
Sorry if this is an obvious one, but is there a simple way to modify the lm 
function to test whether a slope coefficient is significantly different 
from 1 instead of different from 0?

Thanks,

Martin


Martin Biuw
SEA MAMMAL RESEARCH UNIT
Gatty Marine Laboratory
School of Environmental and Evolutionary Biology
University of St Andrews
Fife, Scotland KY16 8LB
UK
phone +44 (0)1334 462630
fax + 44 (0)1334 462632
http://www.smru.st-and.ac.uk
http://www.smru.st-and.ac.uk/research/individuals/martinbiuw.htm

[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help