[R] Fitting my data to a Weibull model

2011-08-31 Thread Marcio
Hi guys, I have a data-set that fits well into a Weibull model y = a-b*exp(-c*x^d). I want to estimate the parameters of the coefficients a, b, c and d, given x and y. Can you guys help me? Just as an example, I fit the data y - c(1,2,3,4,10,20) and x - c(1,7,14,25,29,30) According to this

Re: [R] Fitting my data to a Weibull model

2011-08-31 Thread Dennis Murphy
Hi: Things work if x is the response and y is the covariate. To use the approach I describe below, you need RStudio and its manipulate package (which is only available in RStudio - you won't find it on CRAN). You can download and install RStudio freely from http://rstudio.org/ ; it is available

Re: [R] Fitting my data to a Weibull model

2011-08-31 Thread Justin Haynes
This is what I use... fit.func-function(x){ require(MASS) est-fitdistr(x$wind_speed, 'weibull')$estimate data.frame(shape=est[1],scale=est[2]) } feel free to correct me if this is wrong! Justin On Wed, Aug 31, 2011 at 6:21 AM, Dennis Murphy djmu...@gmail.com wrote: Hi: Things work

Re: [R] Fitting my data to a Weibull model

2011-08-31 Thread Marcio
Thanks for the answers. Indeed, I wrote wrong in my examples the variables x and y I meant to say y - c(1,7,14,25,29,30) x - c(1,2,3,4,10,20) Thanks -- View this message in context: http://r.789695.n4.nabble.com/Fitting-my-data-to-a-Weibull-model-tp3780169p3781746.html Sent from the R help

Re: [R] Fitting my data to a Weibull model

2011-08-31 Thread Marcio
Hi djmuseR, I tried installing and running the script that you suggested. But with every value I tried for a, b, c and d I get one of those 2 error messages Error in nls(y ~ a - b * exp(-c * x^d), start = list(a = 10, b = 30, c = 0.4, : singular gradient Error in numericDeriv(form[[3L]],