Formulas in Project Risk Jørn Vatn Email: jorn.vatn@ntnu.no 2014-07-04 - Rev2 Some important formulas from the course compendium Project Risk Analysis are listed in this memo. For assumptions and limitations, please consult the compendium. Denne formelsamlingen er tillatt hjelpemiddel under eksamen i TPK 5115 Risikostyring i prosjekter, 6. desember 2014. Studentene kan skrive notater i formelsamlingen og på omslaget. Formelsamlingen inneholder 16 sider og skal skrives ut med skrift på begge sider. The table of formulas can be used during the exam in TPK 5115 Risk Management in Projects, December 6th, 2014. The students are allowed to make notes in the memo and on its cover. The table of formula contains 16 pages and shall be printed with double sided print. 1
Chapter 3 Basic Probability Rules Pr(A B) = Pr(A) + Pr(B) Pr(A B) Pr(A B) = Pr(A) Pr(B) if A and B are independent Pr(A C ) = Pr(A does not occur) = 1 Pr(A) Pr(A B) Pr(A B) = Pr(B) The Law of Total Probability Bayes Theorem r Pr(B) = Pr(A i ) Pr(B A i ) i=1 Pr(A j B) = Pr(B A j) Pr(A j ) r Pr(A i ) Pr(B A i ) i=1 Cumulative Distribution Function - CDF F X (x) = Pr(X x) Pr(a < X b) = F X (b) F X (a) Probability Density Function - PDF f X (x) = d dx F X (x) F X (x) = x f X (u)du b Pr(a < X b) = f X (x)dx a 2
Point Probability p(x j ) = Pr(X = x j ) Expectation Variance x f X (x) dx if X is continuous E(X) = x j p(x j ) if X is discrete j [x E(X)] 2 f X (x) dx if X is continuous Var(X) = [ (x j E(X) ] 2 p(x j ) if X is discrete Standard Deviation j SD(X) = + Var(X) Double Expectation Rules E(X) = E(E(X Y )) Var(X) = E(Var(X Y )) + Var(E(X Y )) E(X) = E(X B)Pr(B) + E(X B C )Pr(B C ) Var(X) = Var(X B)Pr(B) + Var(X B C )Pr(B C ) [ 2 +[E(X B) E(X)] 2 Pr(B) + E(X B C ) E(X)] Pr(B C ) Normal Distribtuion f X (x) = 1 1 (x µ) 2 2π σ e 2σ 2 E(X) = µ Var(X) = σ 2 3
Standard Normal Distribtuion f U (u) = φ(u) = 1 e u2 2 2π F U (u) = Φ(u) = u φ(t)dt = u 1 2π e t2 2 dt Transforming to the Standard Normal Distribution Exponential Distribtuion U = X µ σ f X (x) = λe λx F X (x) = 1 e λx Weibull Distribution E(X) = 1/λ Var(X) = 1/λ 2 f X (x) = αλ(λx) α 1 e (λx)α Gamma Distribution F X (x) = 1 e (λx)α E(X) = 1 [ ) 1 λ Γ α + 1 Var(X) = 1 ( ) ( )] 2 1α (Γ λ 2 α + 1 Γ 2 + 1 f X (x) = λα Γ(α) (x)α 1 e λx 4
Erlang Distribution: α = integer F X (x) = 1 α 1 n=0 (λx) α Gamma- and Erlang Distribution - Moments: n! e (λx) E(X) = α λ Var(X) = α λ 2 Inverted Gamma Distribution Lognormal Distribution f X (x) = λα Γ(α) ( ) 1 α+1 e λ/x x E(X) = λ/(α 1) Var(X) = λ 2 (α 1) 2 (α 2) 1 f X (x) = 1 1 1 2π τ x e 1 2τ2 (log x ν)2 Binomial Distribution ( n Pr(X = x) = x E(X) = e ν+ 1 2 τ2 Var(X) = e 2ν (e 2τ2 e τ2 ) ) p x (1 p ) n x for x = 1,2,.., n Poisson Distribution E(X) = np Var(X) = np(1 p) p(x) = Pr(X = x) = λx x! e λ E(X) = λ Var(X) = λ 5
Poisson Process: Number of Events in an Interval p(x) = Pr(X = x) = Inverse-Gauss Distribution ( λ F T (t) = Φ µ Triangular Distribution f X (x) = F X (x) = PERT Distribution t λ 1 t ) + Φ { { [λ(b a)]x e λ(b a) x! E(T) = µ Var(T) = µ 3 /λ 2(x L) (M L)(H L) 2(H x) (H M)(H L) (x L) 2 (M L)(H L) 1 (H x)2 (H M)(H L) ( λ ) 1 t λ t e 2λ/µ µ if L x M if M x H if L x M if M x H E(X) = L + M + H 3 Var(X) = L2 + M 2 + H 2 LM LH MH 18 Introduce: Then 4M + H 5L α 1 = H L 5H 4M L α 2 = H L z = x L H L f X (x) = (x L)α 1 1 (H x) α 2 1 B(α 1,α 2 )(H L) α 1+α 2 1 F X (x) = B z(α 1,α 2 ) B(α 1,α 2 ) E(X) = L + 4M + H 6 (E(X) L)(H E(X)) Var(X) = 7 6
Distribution of a Sum E(X 1 + X 2 +... + X n ) = E ( n i=1 X i) = n i=1 E(X i) Variables are independent: Var(X 1 + X 2 +... + X n ) = Var ( n i=1 X i) = n i=1 Var(X i) Variables are dependent (n = 2): SD ( n i=1 X ) n i = i=1 [SD(X i)] 2 Var(X 1 + X 2 ) = Var(X 1 ) + Var(X 2 ) + 2Cov(X 1, X 2 ) Distribution of a Product Variables are independent: ( ) n n E(X 1 X 2... X n ) = E X i = E(X i ) i=1 i=1 Var(X 1 X 2 ) = Var(X 1 )Var(X 2 ) + Var(X 1 )[E(X 2 )] 2 + Var(X 2 )[E(X 1 )] 2 SD(X 1 X 2 ) = Var(X 1 )Var(X 2 ) + Var(X 1 )[E(X 2 )] 2 + Var(X 2 )[E(X 1 )] 2 Distribution of maximum values Let Y = max(x 1, X 2 ): F Y (x) = Pr(Y x) = Pr(X 1 x X 2 x) = Pr(X 1 x)pr(x 2 x) = F X1 (x)f X2 (x) E(Y ) = x f Y (x) dx = x [f X1 (x)f X2 (x) + f X2 (x)f X1 (x) ] dx Var(Y ) = [x E(Y )] 2 [f X1 (x)f X2 (x) + f X2 (x)f X1 (x) ] dx 7
Chapter 4 Total Expected Penalty for Default Chapter 5 PDTot = D (t D)PDf T (t) dt Fundamental Utility Function Requirements y 1 y 0 y 2, and Y = y 0 is the certain outcome: u(y 0 ) = αu(y 1 ) + (1 α)u(y 2 ) Typical utility function dealing with safety attributes: u(y 1, y 2, y 3, y 4 ) = 0.03y 1 0.5y 2 2.5y 3 7y 4 Typical utility function dealing with safety attributes and profit: u(y 1, y 2, y 3, y 4 ) = 0.03y 1 0.5y 2 2.5y 3 7y 4 + y 7 ae by 7 Chapter 6 NPV Formulas One amount: NPV = X t (1 + r) t Cash Flow: T NPV = X t (1 + r) t t=0 Fixed Amount: Increasing Amount: [ 1 (1 + r) T NPV = r NPV = 1 ( 1+v 1+r r v ) T ] X A X A,v 8
Periodic Amount NPV = X A (1 + r) ki X A = 1 (1 + r) k i=0 Periodic amount when the first amount occurs at the end of year l: Degradation Cost in year t in case of degradation NPV = X A(1 + r) l 1 (1 + r) k c t = c 0 (1 + d) t Degradation rate found from growth factor: d = e ln(gf)/t 1 Chapter 7 Maximum Likelihood Principle Simultaneous probability density n f (x 1 ;θ)f (x 2 ;θ)... f (x n ;θ) = f (x i ;θ) i=1 Likelihood function n L(θ; x 1, x 1... x n ) = f (x i ;θ) i=1 MLE ˆθ = ˆθ(X1, X 2,... X n ) Methods of Moments - PERT Distribution ˆM = ¼(6 x ˆL Ĥ) Ĥ = x + S 7 x Max x x x Min ˆL = x (Ĥ x)( x x Min ) x Max x 9
LS Principle Simple linear regression model: n Q(θ) = [y i φ i (θ] 2 i=1 Multiple linear model: E(Y i ) = β 0 + β 1 x i E(Y i ) = β 0 + β 1 x i,1 + β 2 x i,2 + + β r x i,r X = 1 x 11... x 1r 1 x 21 x 1r : x i j 1 x i1... x nr X T y = X T Xβ With error terms: ˆβ = (X T X) 1 X T y Predictions: Residuals: Y i = β 0 + β 1 x i,1 + β 2 x i,2 + + β r x i,r + ε i ŷ i = ˆ β 0 + ˆ β 1 x i,1 + ˆ β 2 x i,2 + + ˆ β r x i,r εˆ i = y i ŷ i Chapter 8 Calibration Let Z be the number of Y i x i that are >0 For n 5, a calibration is done when Z <n/2 - n or Z >n/2 + n For 2 n 4 calibrate if Z = 0 or Z = n, and: (i) Z = 0 and 1/n i(y i /x i ) <1/(6-n), or (ii) Z = n and 1/n i(y i /x i ) >(6-n) 10
Calibration Formulas Relation between the true values (x i s) and the estimates (Y i s): x i = β 0 + β 1 Y i + error term LS formulas: i (Y i Ȳ )x i ˆβ 1 = ( Yi Ȳ ) 2 i ˆβ 0 = x ˆβ1 Ȳ New value: Regression line through the origin: Weighting of Experts Error terms from control questions: ˆx = ˆβ0 + ˆβ1 y ( ) ˆβ 0 ˆx = + ˆβ1 x i,min Y i = α 0 + α 1 x i + error term Square sum of the residuals for expert k: Estimate for the variance: Standardised weight of expert k: SS k = i (y i αˆ 0 ˆα 1 x i ) 2 S 2 k = SS k/(n 2) w k = S 2 k j S 2 j Weight for expert k based on mutual evaluation: w k = j j p j,k y i j p j,i Standard weighting model - Experts only: ˆx = j=1:m w j ˆx j 11
Experts and data Sample variance from expert statements: S 2 V E = 1 1 m j=1 w2 j Self evaluated standard deviation : Variance of the weighted estimate: m j=1 Ŝ k = 0.37( ˆx k,h ˆx k,l ) S 2 SE = 1 j=1:m Ŝ 2 j Combined estimate - Experts and Data: Chapter 9 ˆx = S 2 E ˆx E + S 2 D ˆx D S 2 E + S 2 D ( w j xˆ j ˆx ) 2 Single Component Maintenance Models C(τ) = C PM /τ + λ E (τ)[c CM + C EP + C ES ] Effective failure rate approximation: ( ) Γ(1 + 1/α) α λ E (τ) = τ α 1 MTTF Improved approximation: ( ) Γ(1 + 1/α) α λ E (τ) = τ α 1 [ 1 0.1α(τ/MTTF) 2 + (0.09α 0.2)τ/MTTF ] MTTF Optimal interval in the simple model: τ = MTTF ( C PM Γ(1 + 1/α) C U (α 1) ) 1/α Single activity - Dynamic considerations C First TA = C TA + λ E (τ TA ) C U τ TA C Second TA = λ E (τ TA + x) C U (τ TA + x) λ E (x) C U x 12
Single activity - Artic maintenance C First TA = C TA + [1 R(τ TA )]C U + τta t=0 f T (t)(τ TA t)c W dt τta C Second TA = [1 R(τ TA + x)/r(x)]c U + f T (t + x)(τ TA t)c W dt/r(x) t=0 Random cost due to delaying the turnaround: E(C T A,R ) = C PL t=d TA [f TI (t) f TO (t)](t D TA ) dt Total cost of PM when included in the turnaround if turnaround may be dealyed: C TA = C TA,F + E(C TA,R ) Possibilities to cancel PM from turnaround: PM outside TA C 1 = C PM + C U [ λe (τ )τ λ E (τ TA )τ TA ] + C (2τ TA τ ) PM planned in TA, but cancelled C 2 = C PM + C TA,P + C U [ λe (τ )τ λ E (τ TA )τ TA ] + C (2τ TA τ ) +C PL t=d TA f TO (t)(t D TA )dt PM in TA & problems C 3 = C TA,E + C TA,P + C U λ E (τ TA )τ TA + C PL PM in TA without any problems C 4 = C TA,E + C TA,P + C U λ E (τ TA )τ TA + C PL Changing the frequency of the turnaround Assuming uppgrade of safety critical components: C(τ TA ) = C τta,b /τ TA + n i C TA,i /τ TA + i {SC} t=d TA f TI (t)(t D TA )dt t=d TA f TN (t)(t D TA )dt i {NC} n i C U,i λ E,i (τ TA ) Yearly upgrading cost: C UG = n i C UG,i /T i {SC} 13
Discounted number of failures τ TA ( Λ E,i (τ TA, r) = jλe,i ( j) ( j 1)λ E,i ( j 1) ) (1 + r) j j=1 The turnaround related cost up to time of disposal: C A (τ TA = ( n(t,τta ) j=1 (1 + r) ( j 1)τ TA C TA,B + i {SC} n ic TA,i + ) i {NC} n ic U,i Λ E,i (τ TA, r) + C FLP + i {SC} n ic UG,i Cost related to exclude production related activities from the turnaround: n(t,τ i ) (1 + r) ( j 1)τ i j=1 The Gamma Function ( ni C PM,i + n i C U,i Λ E,i ( τ i, r)) The gamma function Γ(α) is defined for all real α > 0 by the integral Γ(α) = 0 t α 1 e t dt By partial integration it is easy to show that Γ(α + 1) = αγ(α) for all α > 0 (1) In Table 2 the Gamma function Γ(α) is given for values of α between 1.00 and 2.00. Γ(α) for other positive values of α may be calculated from formula (1). 14
Table 1: The Cumulative Standard Normal Distribution Φ(z) = Pr(Z z) = z 1 2π e u2 2 du z.00.01.02.03.04.05.06.07.08.09 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0.500.540.579.618.655.691.726.758.788.816.841.864.885.903.919.933.945.955.964.971.977.982.986.989.992.994.995.504.544.583.622.659.695.729.761.791.819.844.867.887.905.921.934.946.956.965.972.978.983.986.990.992.994.995.508.548.587.626.663.698.732.764.794.821.846.869.889.907.922.936.947.957.966.973.978.983.987.990.992.994.996.512.552.591.629.666.702.732.767.797.824.849.871.891.908.924.937.948.958.966.973.979.983.987.990.992.994.996.516.556.595.633.670.705.739.770.800.826.851.873.893.910.925.938.949.959.967.974.979.984.987.990.993.994.996.520.560.599.637.674.709.742.773.802.829.853.875.894.911.926.939.951.960.968.974.980.984.988.991.993.995.996.524.564.603.641.677.712.745.776.805.831.855.877.896.913.928.941.952.961.969.975.980.985.988.991.993.995.996.528.567.606.644.681.716.749.779.808.834.858.879.898.915.929.942.953.962.969.976.981.985.988.991.993.995.996.532.571.610.648.684.719.752.782.811.836.860.881.900.916.931.943.954.962.970.976.981.985.989.991.993.995.996.536.575.614.652.688.722.755.785.813.839.862.883.901.918.932.944.954.963.971.977.982.986.989.992.994.995.996 Φ(-z) = 1 - Φ(z) 15
Table 2: Gamma Function Γ(α) for α between 1.00 and 2.00. α Γ(α) α Γ(α) α Γ(α) α Γ(α) 1.00 1.00000 1.25 0.90640 1.50 0.88623 1.75 0.91906 1.01 0.99433 1.26 0.90440 1.51 0.88659 1.76 0.92137 1.02 0.98884 1.27 0.90250 1.52 0.88704 1.77 0.92376 1.03 0.98355 1.28 0.90072 1.53 0.88757 1.78 0.92623 1.04 0.97844 1.29 0.89904 1.54 0.88818 1.79 0.92877 1.05 0.97350 1.30 0.89747 1.55 0.88887 1.80 0.93138 1.06 0.96874 1.31 0.89600 1.56 0.88964 1.81 0.93408 1.07 0.96415 1.32 0.89464 1.57 0.89049 1.82 0.93685 1.08 0.95973 1.33 0.89338 1.58 0.89142 1.83 0.93969 1.09 0.95546 1.34 0.89222 1.59 0.89243 1.84 0.94261 1.10 0.95135 1.35 0.89115 1.60 0.89352 1.85 0.94561 1.11 0.94740 1.36 0.89018 1.61 0.89468 1.86 0.94869 1.12 0.94359 1.37 0.88931 1.62 0.89592 1.87 0.95184 1.13 0.93993 1.38 0.88854 1.63 0.89724 1.88 0.95507 1.14 0.93642 1.39 0.88785 1.64 0.89864 1.89 0.95838 1.15 0.93304 1.40 0.88725 1.65 0.90012 1.90 0.96177 1.16 0.92980 1.41 0.88676 1.66 0.90167 1.91 0.96523 1.17 0.92670 1.42 0.88636 1.67 0.90330 1.92 0.96877 1.18 0.92373 1.43 0.88604 1.68 0.90500 1.93 0.97240 1.19 0.92089 1.44 0.88581 1.69 0.90678 1.94 0.97610 1.20 0.91817 1.45 0.88566 1.70 0.90864 1.95 0.97988 1.21 0.91558 1.46 0.88560 1.71 0.91057 1.96 0.98374 1.22 0.91311 1.47 0.88563 1.72 0.91258 1.97 0.98768 1.23 0.91075 1.48 0.88575 1.73 0.91467 1.98 0.99171 1.24 0.90852 1.49 0.88595 1.74 0.91683 1.99 0.99581 2.00 1.00000 16