PDA

View Full Version : Help needed for plotting charts/graphs



xxbenxx
01-26-2006, 10:02 PM
hi to all,

I need to use Excel VBA code to write a code which allows me to plot graphs from input values that I have.

However, the graphs need to be of the following distributions: Weibull, Gamma and Beta.

Anyone can pls advise on how can this be achieved?

Ken Puls
01-26-2006, 10:43 PM
Hi there, and welcome to VBAX.

Please don't cross post at another forum without providing a link. It is not fair to have multiple experts volunteering their time without knowing that someone else is currently working on, or may have already solved the issue. I'm not saying "don't cross post", I'm just asking you to be corteous enough to post a link.

http://www.puremis.net/excel/cgi-bin/yabb/YaBB.pl?num=1138337353/0#1

xxbenxx
01-26-2006, 10:45 PM
I'm sorry.. din know about the rules.. will not do it again

Shazam
09-03-2007, 09:38 AM
hi to all,

I need to use Excel VBA code to write a code which allows me to plot graphs from input values that I have.

However, the graphs need to be of the following distributions: Weibull, Gamma and Beta.

Anyone can pls advise on how can this be achieved?

I stumbled on this thread and I know it's really old but maybe this could help someone in the near future.

Hi xxbenxx

What you're trying come up with are statistical analysis. These are very complex when trying to determine your variables in your problem. I had a similar project that my boss ask me to do at work. First I'm not a statistician so I'll try my best to explain. I work at a manufacturing plant and my boss ask me what are the time to rate of these machines will fail before 24.00 hours. So I did some research and finding out the WIEBULL is a perfect function for this type of scenario. Before getting your WEIBULL function to work you'll need to get the ALPHA and the BETA and before getting those functions you will need to get the MEAN and SIGMA. The most important of your findings are to have a history of accurate data then we could apply your statistical analysis. Let’s do a small example, List your data in A12:B18.

History of the Hours , Machine Ran until failure

Machine 1 20.23
Machine 1 15.25
Machine 1 12.35
Machine 1 18.25
Machine 1 23.59
Machine 1 24
Machine 1 13.45

To find the MEAN you'll need to take an average in column B
input formula in cell B2.

=AVERAGE(B12:B18)

Then to find the SIGMA you'll need a standard deviation in column B
input formula in cell B3

=STDEV(B12:B18)

Now here where it gets complex to find the ALPHA you'll need to understand the meaning.

ALPHA is the probability of rejecting the hypothesis tested when that hypothesis is true. In layman’s terms it’s pretty much guessing.

Input formula in cell D2

=B2*SQRT(EXP(GAMMALN(1+2/B3))-EXP(GAMMALN(1+1/B3))^2)


BETA is the probability of accepting the hypothesis tested when the alternative hypothesis is true.

Input formula D3

=B2*EXP(GAMMALN(2+3/B3))

The ALPHA and the BETA results might be off slightly maybe, but if you know how to use solver then you could get the alpha & beta from there.

Now we could apply the WEIBULL formula. Also here is a link that will explain the WEIBULL.

http://www.qualitydigest.com/jan99/html/body_weibull.html

Input formula in cell E8

=1-WEIBULL(24,D2,D3,1)

It will tell you that the machine has a 52.37% fail rate before hitting the 24 hour mark.

If you would like to know the Probability rate that the machine will fail between 10 to 24.00 hrs.

Input formula in cell F8

=WEIBULL(24,D2,D3,TRUE)-WEIBULL(10,D2,D3,TRUE)

Then it will tell you that you have a 45.74% it will fail between 10 to 24 hours.

Hope this helps!