From: Damien on 14 Jul 2010 09:54 I think the best way to explain my problem is by using an example: I’ve tested 2 sets of parts at 2 different pressure levels, for example: At P1 = 2800 bars, 40 % of the parts failed At P2 = 3000 bars, 70 % of the parts failed I know that my parts follow a Lognormal distribution. I have 2 points: (2800, 40%) and (3000, 70%) => I want the 2 parameters (mu, sigma) of that distribution I managed to get the parameters for a normal distribution, using the following lines: b= glmfit(Pressure,FailureRate,'normal','link','probit'); Mean = -b(1)/b(2); Sigma = 1/b(2); But I can’t find how to do the same for a Lognormal Thanks for your help !!!
From: Tom Lane on 14 Jul 2010 13:12 >I think the best way to explain my problem is by using an example: > > I’ve tested 2 sets of parts at 2 different pressure levels, for > example: > At P1 = 2800 bars, 40 % of the parts failed > At P2 = 3000 bars, 70 % of the parts failed > > I know that my parts follow a Lognormal distribution. > I have 2 points: (2800, 40%) and (3000, 70%) > => I want the 2 parameters (mu, sigma) of that distribution > > I managed to get the parameters for a normal distribution, using the > following lines: > b= glmfit(Pressure,FailureRate,'normal','link','probit'); > Mean = -b(1)/b(2); > Sigma = 1/b(2); > > But I can’t find how to do the same for a Lognormal It is possible to write your own link function to use in place of probit. But it's not clear to me what it is that follows a normal/lognormal distribution. Is it that there is some measurement following this distribution, and you judge pass/fail depending on whether it exceeds some cutoff, and you determine this pass/fail for two different cutoffs? If my guess is correct, here is some code that solves for the parameters: >> f = @(ms) norm([normcdf(2800,ms(1),ms(2))-.4, >> normcdf(3000,ms(1),ms(2))-.7]); >> ms = fminsearch(f,[3000 100]) ms = 2865.14892166213 257.152854744613 >> normcdf((2800-ms(1))/ms(2)) ans = 0.400000013747603 >> normcdf((3000-ms(1))/ms(2)) ans = 0.699999985756403 You could easily use logncdf in place of normcdf. -- Tom
|
Pages: 1 Prev: resid function - System Identification Toolbox Next: Combining row vectors |