Skip to main content
added 347 characters in body
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k

This gives a plot something like this one:

Weibull plot of simulated Weibull data, somewhat analogous to a QQ plot. The middle of the plot shows a fairly straight line, with some deviations from straightness near the ends, due to random variation in order statistics in the tails

You could interchange the axes if you felt the need.

Plot showing the same values as before but with relabelled axes to show original data values and percentiles

You could interchange the axes if you felt the need.

This gives a plot something like this one:

Weibull plot of simulated Weibull data, somewhat analogous to a QQ plot. The middle of the plot shows a fairly straight line, with some deviations from straightness near the ends, due to random variation in order statistics in the tails

You could interchange the axes if you felt the need.

Plot showing the same values as before but with relabelled axes to show original data values and percentiles

added 76 characters in body
Source Link
kjetil b halvorsen
  • 82.8k
  • 32
  • 201
  • 663
x <- rweibull(67,4.1,5.25) # just some random Weibull data to show an example

p <- ppoints(x,.3)
q <- log(-log(1-p))
o <- order(x)
plot(q,log(x[o]))
coeffs <- lm(log(x[o])~q)$coefficients
ests <- c(1/coeffs[2],exp(coeffs[1]),quantile(x,1-exp(-1)))
names(ests) <- c("shape.line","scale.line","scale.quantile")
ests
    x <- rweibull(67,4.1,5.25) # just some random Weibull data 
                               # to show an example

    p <- ppoints(x, .3)
    q <- log(-log(1-p))
    o <- order(x)
    plot(q,log(x[o]))
    coeffs <- lm(log(x[o])~q)$coefficients
    ests <- c(1/coeffs[2],exp(coeffs[1]),quantile(x,1-exp(-1)))
    names(ests) <- c("shape.line","scale.line","scale.quantile")
    ests
qax=c(0.1,0.5,1,5,10,20,50,90,99,99.9)
plot(q,x[o],ylab="x",xaxt="n",log="y",xlim=range(log(-log(1-qax/100))),ylim=range(x))
axis(1,at=log(-log(1-qax/100)),labels=qax)
    qax=c(0.1,0.5,1,5,10,20,50,90,99,99.9)
    plot(q,x[o], ylab="x", xaxt="n", log="y", 
           xlim=range(log(-log(1-qax/100))), ylim=range(x))
    axis(1, at=log(-log(1-qax/100)), labels=qax)
x <- rweibull(67,4.1,5.25) # just some random Weibull data to show an example

p <- ppoints(x,.3)
q <- log(-log(1-p))
o <- order(x)
plot(q,log(x[o]))
coeffs <- lm(log(x[o])~q)$coefficients
ests <- c(1/coeffs[2],exp(coeffs[1]),quantile(x,1-exp(-1)))
names(ests) <- c("shape.line","scale.line","scale.quantile")
ests
qax=c(0.1,0.5,1,5,10,20,50,90,99,99.9)
plot(q,x[o],ylab="x",xaxt="n",log="y",xlim=range(log(-log(1-qax/100))),ylim=range(x))
axis(1,at=log(-log(1-qax/100)),labels=qax)
    x <- rweibull(67,4.1,5.25) # just some random Weibull data 
                               # to show an example

    p <- ppoints(x, .3)
    q <- log(-log(1-p))
    o <- order(x)
    plot(q,log(x[o]))
    coeffs <- lm(log(x[o])~q)$coefficients
    ests <- c(1/coeffs[2],exp(coeffs[1]),quantile(x,1-exp(-1)))
    names(ests) <- c("shape.line","scale.line","scale.quantile")
    ests
    qax=c(0.1,0.5,1,5,10,20,50,90,99,99.9)
    plot(q,x[o], ylab="x", xaxt="n", log="y", 
           xlim=range(log(-log(1-qax/100))), ylim=range(x))
    axis(1, at=log(-log(1-qax/100)), labels=qax)
added 48 characters in body
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k

While it's not the only sort of plot you might want to dodo*, it's a reasonably common way of looking at goodness of fit for a Weibull distribution; ifdistribution, and performs reasonably well. If a Weibull model is suitable, it should look close to straight. You should be aware that with Weibull data the lower left end may be considerably more "wiggly" than the upper right end --end; its behaviour is not symmetric. The log-data values have the long left tail of a flipped Gumbel distribution.

To my mind it makes more sense to interchange the axes from the way around your plot has it, so the random quantity is on the y-axis, just as is usually done with a normal Q-Q plot, and as is common practice with scatterplots more generally. I will do this in my answer, but it's easy to swap them back if you're determined to have the logged data on the x-axis.

It's important to generate Weibull data across a variety of shape parameter values and sample sizes to see what Weibull data can look like, as well as to generate some non-Weibull data (e.g. gamma, lognormal, chi). It's useful to see what the plot tends to look like at a few different sample sizes as well.

BecauseWhen working by hand, it would be easier to use a line joining two quantiles rather than a linear regression fit. Indeed, because of the tendency of the lower-left end to be noisy, it may be better to use a line joining two quantiles rather than a linear regression fit;worth the slight robustness this brings. With actual Weibull data, it looks like the line withtaking the slope of the line joining the points for the $0.167$ and $0.975$ quantiles may work well, but making the intercept of the drawn line correspond to the quantile-estimate of the scale parameter, at the $(1-1/e)$ quantile. It may be worth giving up a little efficiency to gain more robustness by moving the slope quantiles in somewhat further. Another alternative would be to use the quartiles, as is done for the normal Q-Q plot in R.

There are numerous posts relating to Weibull distributions, Weibull plots and other ways of looking at Weibull goodness of fit on site. e.g. try searches, such as a search for Weibull plot.


*(e.g. you might do a Q-Q plot or a P-P plot using fitted parameters, or an ecdf with fitted Weibull cdf)

While it's not the only sort of plot you might want to do, it's a reasonably common way of looking at goodness of fit for a Weibull distribution; if a Weibull model is suitable, it should look close to straight. You should be aware that with Weibull data the lower left end may be considerably more "wiggly" than the upper right end -- its behaviour is not symmetric.

To my mind it makes more sense to interchange the axes from the way around your plot has it, so the random quantity is on the y-axis, just as is usually done with a normal Q-Q plot, and as is common practice with scatterplots more generally. I will do this in my answer, but it's easy to swap them back if you're determined.

It's important to generate Weibull data across a variety of shape parameter values and sample sizes to see what Weibull data can look like, as well as to generate some non-Weibull data (e.g. gamma, lognormal, chi)

Because of the tendency of the lower-left end to be noisy, it may be better to use a line joining two quantiles rather than a linear regression fit; it looks like the line with the slope of the line joining the points for the $0.167$ and $0.975$ quantiles may work well, but making the intercept of the drawn line correspond to the quantile-estimate of the scale parameter, at the $(1-1/e)$ quantile. Another alternative would be to use the quartiles, as is done for the normal Q-Q plot in R.

There are numerous posts relating to Weibull distributions, Weibull plots and other ways of looking at Weibull goodness of fit on site. e.g. try searches, such as a search for Weibull plot.

While it's not the only sort of plot you might want to do*, it's a reasonably common way of looking at goodness of fit for a Weibull distribution, and performs reasonably well. If a Weibull model is suitable, it should look close to straight. You should be aware that with Weibull data the lower left end may be considerably more "wiggly" than the upper right end; its behaviour is not symmetric. The log-data values have the long left tail of a flipped Gumbel distribution.

To my mind it makes more sense to interchange the axes from the way around your plot has it, so the random quantity is on the y-axis, just as is usually done with a normal Q-Q plot, and as is common practice with scatterplots more generally. I will do this in my answer, but it's easy to swap them back if you're determined to have the logged data on the x-axis.

It's important to generate Weibull data across a variety of shape parameter values and sample sizes to see what Weibull data can look like, as well as to generate some non-Weibull data (e.g. gamma, lognormal, chi). It's useful to see what the plot tends to look like at a few different sample sizes as well.

When working by hand, it would be easier to use a line joining two quantiles rather than a linear regression fit. Indeed, because of the tendency of the lower-left end to be noisy, it may be worth the slight robustness this brings. With actual Weibull data, it looks like taking the slope of the line joining the points for the $0.167$ and $0.975$ quantiles may work well, but making the intercept of the drawn line correspond to the quantile-estimate of the scale parameter, at the $(1-1/e)$ quantile. It may be worth giving up a little efficiency to gain more robustness by moving the slope quantiles in somewhat further. Another alternative would be to use the quartiles, as is done for the normal Q-Q plot in R.

There are numerous posts relating to Weibull distributions, Weibull plots and other ways of looking at Weibull goodness of fit on site. e.g. try searches, such as a search for Weibull plot.


*(e.g. you might do a Q-Q plot or a P-P plot using fitted parameters, or an ecdf with fitted Weibull cdf)

added 48 characters in body
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k
Loading
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k
Loading