Re: [R] Weibull distribution

2006-08-03 Thread Göran Broström
On 7/21/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Fri, 21 Jul 2006, Valentin Dimitrov wrote: > > > Dear Leaf, > > > > I modified your code as follows: > > > > gamma.fun <- function(mu,sd,start=100) > > { > > f.fn <- function(alpha) > > {abs(sd^2-mu^2/(gamma(1+1/alpha))^2*(gamma(1+2/alpha)-(

Re: [R] Weibull distribution

2006-07-21 Thread Valentin Dimitrov
re is > no root found within the interval. I was not able to > solve this problem. > > Thanks! > > Leaf > > > > > > - Original Message - > > From: Thomas Lumley, [EMAIL PROTECTED] > Sent: 2006-07-21, 09:35:11 > To: Valentin Dimitrov,

Re: [R] Weibull distribution

2006-07-21 Thread Leaf Sun
n. The error seems to me like there is no root found within the interval. I was not able to solve this problem. Thanks! Leaf - Original Message - From: Thomas Lumley, [EMAIL PROTECTED] Sent: 2006-07-21, 09:35:11 To: Valentin Dimitrov, [EMAIL PROTECTED] Subject: Re: [R] W

Re: [R] Weibull distribution

2006-07-21 Thread Thomas Lumley
On Fri, 21 Jul 2006, Valentin Dimitrov wrote: > Dear Leaf, > > I modified your code as follows: > > gamma.fun <- function(mu,sd,start=100) > { > f.fn <- function(alpha) > {abs(sd^2-mu^2/(gamma(1+1/alpha))^2*(gamma(1+2/alpha)-(gamma(1+1/alpha))^2))} > alpha <- optim(start, f.fn) > beta <- mu/gamma(

Re: [R] Weibull distribution

2006-07-21 Thread Valentin Dimitrov
Dear Leaf, I modified your code as follows: gamma.fun <- function(mu,sd,start=100) { f.fn <- function(alpha) {abs(sd^2-mu^2/(gamma(1+1/alpha))^2*(gamma(1+2/alpha)-(gamma(1+1/alpha))^2))} alpha <- optim(start, f.fn) beta <- mu/gamma(1+1/alpha$par) return(list=c(a=alpha$par,b=beta)); } Now

Re: [R] Weibull distribution

2006-07-20 Thread Leaf Sun
: William Asquith, [EMAIL PROTECTED] Sent: 2006-07-17, 16:18:31 To: Leaf Sun, [EMAIL PROTECTED] Subject: Re: [R] Weibull distribution Do not have answer per se, but if you are seeking some comparisons-- try three parameter Weibull as implemented by the lmomco package

[R] Weibull distribution

2006-07-17 Thread Leaf Sun
Hi all, By its definition, the mean and variance of two-par. Weibull distribution are: (www.wikipedia.org) I was wondering, if given mean and sd. could we parameterize the distribution? I tried this in R. gamma.fun <- function(mu,sd,start=100) { f.fn <- function(alpha) sd^2-mu^2/(