[R] nls start values
Sundar Dorai-Raj
sundar.dorai-raj at pdf.com
Sun Mar 12 14:45:02 CET 2006
Wouldn't this be easier?
vals <- 1:100
names(vals) <- sprintf("beta%d", 1:100)
## or
## names(vals) <- paste("beta", 1:100, sep = "")
--sundar
Cal Stats wrote:
> Hi..
>
> here is an example
>
> ss<-NULL
> vals<-1:100
> for(i in 1:100){
> ss<-c(ss,paste("beta",i,"=",vals[i],sep=""))
> }
> sss<-paste(ss,collapse=",")
>
> now is there a way i can convert "sss" so that i can give the command
>
> nls(formula,start=sss)
>
> Thanks
>
> Harsh
>
> "Charles Annis, P.E." <Charles.Annis at StatisticalEngineering.com> wrote: Please give us an EXAMPLE of the loop you have in mind. (It's likely that
> you can use simpler methods than a loop, but without an example we'd be
> guessing.)
>
>
>
>
> Charles Annis, P.E.
>
> Charles.Annis at StatisticalEngineering.com
> phone: 561-352-9699
> eFax: 614-455-3265
> http://www.StatisticalEngineering.com
>
>
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Cal Stats
> Sent: Saturday, March 11, 2006 3:43 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] nls start values
>
> Hi,
>
> I have a large number of parameters to estimate in nls say 100:
> beta1--beta100
> lets say i have 100 values in a vector
>
> is there a way where i can create the start vector for nls using a loop
> instead of individually filling the 100 values.
>
> Thanks
>
> Harsh
>
>
> ---------------------------------
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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
>
>
>
>
>
> ---------------------------------
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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
More information about the R-help
mailing list