No, use a while loop. Something like

change <- 1
while(abs(change) > .001 ){
        do stuff
        change <- updated change
}

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of rach.s
> Sent: Thursday, April 19, 2007 8:00 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] convergence
> 
> 
> hie..
> how can i write a loop that makes algorithm keeps repeating 
> until a solution is converged?do i use a for loop? i know 
> that we can use for loop to ask for a number of repetitions, 
> but how to use it to ask the algorithm to keep repeating 
> until a solution is converged?
> Thanks
> --
> View this message in context: 
> http://www.nabble.com/convergence-tf3606834.html#a10076822
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to