Top Banner

of 18

Stochastic Process and Modelling Solution

Feb 20, 2018

Download

Documents

Gourav Kumar
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 7/24/2019 Stochastic Process and Modelling Solution

    1/18

    5th

    k

    (k+ 2)

    th

    t

    t exp () t N(t) t

    P[N(t) = n] =

    t

    nexp

    t

    n!

    to (k+ 2) p

    n=k+2

    P[N(to) = n] p

    1k+1n=0

    P[N(to) = n] p

    f(to) = 1k+1n=0

    to

    nexp

    to

    n!

    p

    to f(to) to to

    1k+1n=0

    to

    nexp

    to

    n!

    =p

    to

    f(to) to to= 0

    to= 10 (k+ 2)

    to = 10 (k+ 2) (k+ 2) k+ 2

  • 7/24/2019 Stochastic Process and Modelling Solution

    2/18

    k0 1 2 3 4 5

    t(inhours)

    3

    3.5

    4

    4.5

    5

    5.5

    66.5

    7

    7.5

    8

    8.5

    9

    9.5

    10

    10.5

    11

    k to

    = 1 hour p= 0.9 k= 0, 1, 2, 3, 4, 5 to k to

    to k

    n=k+2P[N(to) = n] = 1

    k+1

    n=0to

    nexp

    to

    n!

    k= 0 = 1 hour to = 90 min= 1.5 hour

    11

    n=0

    1.5n exp(1.5)

    n! = 1 (exp(1.5) + 1.5exp(1.5)) = 1 2.5exp(1.5) 0.44

    k= 0 2nd 1st

    P[N(1.5) = 0] = exp (1.5) 0.22

    to k = 0 3.89 hours

    0.44 0.9

  • 7/24/2019 Stochastic Process and Modelling Solution

    3/18

    k

    0 10 20 30 40 50 60 70 80 90 100

    TheRatio

    1.1

    1.15

    1.2

    1.25

    1.3

    1.35

    1.4

    1.45

    1.5

    1.55

    k to(k+2)

    p

    k

    k+ 2 (k+ 2) k

    to(k+2) k

    to(k+2) to k

    p k

    k

    1k+1n=0

    to

    nexp

    to

    n!

    =

    n=k+2

    to

    nexp

    to

    n!

    = p

    to

    k+2exp

    to

    (k+ 2)!

    +

    to

    k+3exp

    to

    (k+ 3)!

    +

    to

    k+4exp

    to

    (k+ 4)!

    + = p

    exp( (k+ 2) x)

    (k+ 2)

    k+2xk+2

    (k+ 2)! +

    (k+ 2)k+3

    xk+3

    (k+ 3)! +

    (k+ 2)k+4

    xk+4

    (k+ 4)! +

    p where x=

    to

    (k+ 2)

    n

    ln (n!) n ln (n) n = n! nn

    en

    exp( (k+ 2) x)

    (k+ 2)

    k+2xk+2

    (k+ 2)(k+2)

    e(k+2)+

    (k+ 2)k+3

    xk+3

    (k+ 3)(k+3)

    e(k+3)+

    (k+ 2)k+4

    xk+4

    (k+ 4)(k+4)

    e(k+4)+

    = p

    exp( (k+ 2) x)

    xk+2

    e(k+2)

    1

    0

    k+ 2

    k+2+

    xk+3

    e(k+3)

    1

    1

    k+ 3

    k+3+

    xk+4

    e(k+4)

    1

    2

    k+ 4

    k+4+

    = p

    limn

    1 a

    n

    n=ea

  • 7/24/2019 Stochastic Process and Modelling Solution

    4/18

    exp( (k+ 2) x)

    xk+2

    e(k+2)+

    xk+3

    e(k+3)e1 +

    xk+4

    e(k+4)e2 +

    = p

    exp( (k+ 2) x)

    exp( (k+ 2)) xk+2

    1 + x + x2 +

    = p

    xe1x

    1 + x + x2 + 1k+2 = p

    1k+2

    k 1k+2 0

    p 1k+2

    1

    xe1x

    1 + x + x2 + 1k+2 = 1

    0< x 1 1 x= 1 k x 1

    to

    M ln

    S = {0, 1, 2, . . . , M }

    pAj

    j=0

    pAj j

    j=0

    pAj = 1

    pLr (l)

    r=0

    pLr (l) r

    l r=0

    pLr (l) = 1; l pLr (l)

    l

    pDi (l)

    li=0

    pDi (l)

    i

    l

    l pDi l

    li=0

    pDi (l) = 1 ; l pD0 (0) = 1

    pJk(l) =j=k

    pAj

    j

    k

    1 pLjk(l)

    k pLjk(l)

    jk

    x= 1

    0 < x

  • 7/24/2019 Stochastic Process and Modelling Solution

    5/18

    pJk(l) k j pAj j k k

    jk

    1 pLjk(l)

    k pLjk(l)

    jk

    j

    ln ln+1 0 ln+1 M 1 k i k i

    ln ln+1

    k i= ln+1 ln; i {0, 1, . . . , ln} ; k 0

    0 ln+1 M 1 ln ln+1

    p (ln, ln+1) =

    ki=ln+1ln; i{0,1,...,ln} ;k0

    pDi (ln)pJk(ln)

    ln+1 ln

    p (ln, ln+1) =

    ln+1k=0

    pDk+lnln+1 (ln)pJk(ln)

    ln+1 > ln

    p (ln, ln+1) =

    lni=0

    pDi (ln)pJi+ln+1ln(ln)

    ln ln+1 ln+1 = M 1

    p (ln, M) = 1M1i=0

    p (ln, i)

    S = {0, 1, 2, . . . , M 1} ln M ln= M ln+1 = M+ 1 M

    ln ln+1 0 ln+1 M1 ln 1 1 k k

    k 1 = ln+1 ln; k 0

    k ln+1 ln 1 0 ln+1 M 1 ln 1 ln ln+1

    p (ln, ln+1) =

    0 ; ln+1 < ln 1

    pJln+1ln+1(ln) ; ln+1 ln 1

  • 7/24/2019 Stochastic Process and Modelling Solution

    6/18

    ln= 0 k k

    k= ln+1; k 0

    0 ln+1 M 1 ln= 0 p (0, ln+1) = p

    Jln+1

    (ln)

    ln+1 = M

    0 1 2 3 M 1

    0 pJ0 (0) pJ1 (0) p

    J2 (0) p

    J3 (0) 1

    M2i=0

    pJi (0)

    1 pJ0 (1) pJ1 (1) p

    J2 (1) p

    J3 (1) 1

    M2i=0

    pJi (1)

    2 0 pJ0 (2) pJ1 (2) p

    J2 (2) 1

    M3i=0

    pJi (2)

    3 0 0 pJ0 (3) pJ1 (3) 1

    M4i=0

    pJi (3)

    M 1 0 0 0 pJ0(M 1) 1 pJ0 (M 1)

    x

    x

    kth

    kth

    kth

    kth

    r

    X=

    x1n x2n x3n

    xin 1 ith nth 0

    Rin 1 ith

    nth 0 Rin= 1 q

    Mijn 1 ith

    jth nth 0 Mijn = 1 r Mijn =M

    jin

    Iijn 1 ith

    jth nth 0 Iijn = 1 p

  • 7/24/2019 Stochastic Process and Modelling Solution

    7/18

    x1n+1 =

    M12n

    I12n

    x2n

    M13n

    I13n

    x3n ; x

    1n= 0

    R1n ; x1n= 1

    1st nth x1n = 0 M12n

    I12n

    x2n 1

    st 2nd

    M13n

    I13n

    x3n x

    1n+1 = 1 M

    12n

    I12n

    x2n = 1 M

    13n

    I13n

    x3n= 1

    1st nth x1n= 1 x1n+1 = 0 1

    st

    R1n = 1 x1n+1 = 1 1st R1n = 0

    x1n+1 =

    M12n

    I12n

    x2n

    M13n

    I13n

    x3n

    x1n

    R1n

    x1n

    x2n+1 =

    M21n

    I21n

    x1n

    M23n

    I23n

    x3n

    x2n

    R2n

    x2n

    x3n+1 =

    M31n

    I31n

    x1n

    M32n

    I32n

    x2n

    x3n

    R3n

    x3n

    N

    xin+1 =

    j{1,2,...,N} ; j=i

    Mijn

    Iijn

    xjn

    xinRinxin

    Ai= A1

    A2

    AN

    xn S = {0, 1, 2, 3} P xn xn+1

    n= 1Pn1

    n 1

    nth 1st

    1st 1 =

    0 1 0 0

    n En nth

    En = n

    0123

    n

    th

    En=

    0 1 0 0

    Pn1

    0123

    P N

    ith y (N y)

    k (N y) y

  • 7/24/2019 Stochastic Process and Modelling Solution

    8/18

    pI(y, k) =

    N y

    k

    (1 (1 rp)

    y)k

    ((1 rp)y

    )Nyk

    k {0, 1, 2, . . . , N y} (1 rp)y y (1 (1 rp)y) y

    y m

    pR(y, m) =

    y

    m

    qm (1 q)

    m

    k {0, 1, 2, . . . , y}

    xn xn+1 k

    m k m

    xn xn+1

    k m= xn+1 xn; k {0, 1, . . . , N y} ; m {0, 1, . . . , y}

    xn xn+1

    p (xn, xn+1) =

    km=xn+1xn; k{0,1,...,Ny} ;m{0,1,...,y}pI(y, k)pR(y, m)

    s = rp

    P=

    1 0 0 0

    (1 s)2

    q (1 s)

    2(1 q)

    +2s (1 s) q2s (1 s) (1 q)

    +s2q s2 (1 q)

    (1 s)2

    q2

    2 (1 s)2

    q(1 q)

    +

    1 (1 s)2

    q2

    (1 s)2

    (1 q)2

    +2

    1 (1 s)2

    q(1 q)

    1 (1 s)2

    (1 q)2

    q3 3q2 (1 q) 3q(1 q)2 (1 q)3

    nth En(r,p,q) r p s = rp En(r,p,q) En(s, q) En(s, q) s q En(s, q) n

  • 7/24/2019 Stochastic Process and Modelling Solution

    9/18

    En(s, q) n

    n En(s, q) s q

    r

    n= 1

    Mijn n Mijn =M

    ij Mij

    n= 1 Mij =Mji

    x1n+1 =

    M12

    I12n

    x2n

    M13

    I13n

    x3n

    x1n+ R1n

    x1n

    x2n+1 =

    M21

    I21n

    x1n

    M23

    I23n

    x3n

    x2n+ R

    2n

    x2n

    x3n+1 =

    M31

    I31n

    x1n

    M32

    I32n

    x2n

    x3n+ R

    3n

    x3n

    xin+1 =

    j{1,2,...,N} ; j=i

    Mij

    Iijn

    xjn

    xinRinxin

    Xn+1 = f(Xn, Zn) Xn Zn Zn M

    ij

    Mij

    x1n+1 =

    M12n

    I12n

    x2n

    M13n

    I13n

    x3n

    x1n+ R

    1n

    x1n

    x2n+1 =

    M21n

    I21n

    x1n

    M23n

    I23n

    x3n

    x2n+ R

    2n

    x2n

    x3n+1 = M31n

    I31n x1n

    M32n I32n

    x2nx3n+ R

    3n

    x3n

  • 7/24/2019 Stochastic Process and Modelling Solution

    10/18

    Mij1 =M

    ij2 =M

    ij3 = M

    ijn =M

    ij i, j

    Mijn

    Xn+1 = f(Xn, Zn, Y) Y Mij

    x1n+1 =

    M12n

    I12n

    x2n

    M13n

    I13n

    x3n

    x1n+ R

    1n

    x1n

    x2n+1 =

    M12n

    I21n

    x1n

    M23n

    I23n

    x3n

    x2n+ R

    2n

    x2n

    x3n+1 =

    M13n

    I31n

    x1n

    M23n

    I32n

    x2n

    x3n+ R

    3n

    x3n

    M12n+1 = M12n

    M13n+1 = M13n

    M23n+1 = M23n

    p= 0.8 q= 0.5 r= 0.6

    Day1 2 3 4 5 6 7 8 9 1 0 11 1 2 13 1 4 15 1 6 17 1 8 19 2 0 21 2 2 23 2 4 25 2 6 27 2 8 29 3 0 31 3 2 33 3 4 35 3 6 37 3 8 39 4 0

    0

    1Individual 1

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 1 3 1 4 15 1 6 1 7 18 1 9 2 0 21 2 2 2 3 24 25 2 6 2 7 28 2 9 3 0 3 1 32 3 3 3 4 35 3 6 3 7 38 3 9 4 00

    1Individual 2

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 1 3 14 1 5 1 6 17 1 8 1 9 20 2 1 22 2 3 2 4 25 2 6 2 7 28 2 9 3 0 31 3 2 3 3 34 3 5 3 6 37 3 8 3 9 400

    1Individual 3

    p = 0.8

    q= 0.5

    r= 0.6

    p= 0.5 q= 0.5 r= 0.5

  • 7/24/2019 Stochastic Process and Modelling Solution

    11/18

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 1 3 14 1 5 16 1 7 1 8 19 2 0 21 22 2 3 24 2 5 2 6 27 2 8 29 30 3 1 32 3 3 34 3 5 36 3 7 38 39 4 00

    1Individual 1

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 13 1 4 15 1 6 17 1 8 19 2 0 21 2 2 23 2 4 25 26 2 7 28 2 9 30 3 1 32 3 3 34 3 5 36 3 7 38 3 9 400

    1Individual 2

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 1 3 14 1 5 16 1 7 18 1 9 20 2 1 22 23 2 4 25 2 6 27 2 8 29 3 0 31 3 2 33 3 4 35 3 6 37 3 8 39 4 00

    1Individual 3

    p = 0.5q= 0.5 r= 0.5

    p r

    N = 15 p= 0.8 q= 0.5 r= 0.6

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 1

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 2

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 3

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 4

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 5

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 6

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 7

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 8

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 9

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 10

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 11

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 12

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 13

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 14

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 15

    N= 15 p= 0.8 q= 0.5 r= 0.6

    p= 0.8 q= 0.5 r= 0.6

  • 7/24/2019 Stochastic Process and Modelling Solution

    12/18

    Day

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 400

    1Individual 1

    Day

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 400

    1Individual 2

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 1 3 14 1 5 1 6 17 1 8 19 2 0 21 2 2 23 2 4 25 2 6 2 7 28 2 9 30 3 1 3 2 33 3 4 3 5 36 3 7 3 8 39 4 0

    Individual 3

    p = 0.8q= 0.5 r= 0.6

    p= 0.5 q= 0.5 r= 0.5

    Day1 2 3 4 5 6 7 8 9 10 1 1 12 1 3 14 1 5 16 1 7 18 1 9 20 2 1 22 2 3 24 2 5 26 2 7 28 2 9 30 3 1 32 3 3 34 3 5 36 3 7 38 3 9 40

    0

    1Individual 1

    Day

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 13 1 4 15 1 6 17 1 8 19 2 0 21 2 2 23 2 4 25 2 6 27 2 8 29 3 0 31 3 2 33 3 4 35 3 6 37 3 8 39 4 00

    1Individual 2

    Day1 2 3 4 5 6 7 8 9 1 0 11 1 2 13 1 4 15 16 1 7 18 1 9 20 2 1 22 23 2 4 25 2 6 27 2 8 29 30 3 1 32 3 3 34 3 5 36 37 3 8 39 4 0

    0

    1Individual 3

    p = 0.5q= 0.5 r= 0.5

    p r

    N = 15 p= 0.8 q= 0.5 r= 0.6

  • 7/24/2019 Stochastic Process and Modelling Solution

    13/18

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 1

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 2

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 3

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 4

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 5

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 6

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 7

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 8

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 9

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 10

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 11

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 12

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 13

    Day0 5 10 15 20 25 30 35 40

    0

    1Individual 14

    Day

    0 5 10 15 20 25 30 35 400

    1Individual 15

    N= 15 p= 0.8 q= 0.5 r= 0.6

    En(r,p,q) EIn(r,p,q)

    En(r,p,q) EIn(r,p,q) 0 n

    En(r,p,q) EIn(r,p,q) n

    En(r,p,q) EIn(r,p,q) n q q

    En(r,p,q) EIn(r,p,q)

    En(r,p,q) EIn(r,p,q) n p r

    p r

    EIn(r,p,q)

    x1n+1 =

    M12n

    I12n

    x2n

    M13n

    I13n

    x3n

    x1n+ R1n

    x1n

    x2n+1 =

    M21n

    I21n

    x1n

    M23n

    I23n

    x3n

    x2n+ R

    2n

    x2n

    x3n+1 =

    M31n

    I31n

    x1n

    M32n

    I32n

    x2n

    x3n+ R

    3n

    x3n

    I1n 1st

    I1n = 1 1st

    nth I1n= 0 I1n

    I1n+1 = I1n

    x1nR1n

  • 7/24/2019 Stochastic Process and Modelling Solution

    14/18

    x1n

    x1n+1 =

    M12n

    I12n

    x2n

    M13n

    I13n

    x3n

    x1n+ R

    1n

    x1n

    I1n

    xin+1 =

    j{1,2,...,N} ; j=i

    Mijn

    Iijn

    xjn

    xinRinxinIin ; iIin+1 = I

    in

    xin

    Rin

    ; i

  • 7/24/2019 Stochastic Process and Modelling Solution

    15/18

    10/6/15 4:16 PM C:\Us...\Inverse_Poisson_UpperCDF_Solver.m 1 of 1

    fun!ion"!o# $ Inverse_Poisson_UpperCDF_Solver%!&u'('p)

    *_l+$0, - Ini!i&l oer oun

    *_u+$102%(3)2!&u, - Ini!i&l Upper oun

    !resol$0.001, - *resol for error in p

    fl&$1,

    ilefl&$$1

    mi$%*_l+3*_u+)/,

    v&l$PoissonUpperCDF%!&u'('mi),

    if%&+s%v&l7p)8$!resol)

    fl&$0,

    elseif%v&l8p)

    *_l+$mi,

    else

    *_u+$mi,

    en

    en

    !o$mi,

    en

    fun!ion"v&l# $ PoissonUpperCDF%!&u'('!)

    v&l$1,

    forn$0:1:%(31)

    v&l$v&l7%!/!&u)9%n)2ep%7!/!&u)/f&!ori&l%n),

    en

    en

    Appendix A (Inverse Poisson Upper CDF Solver: MATLAB Code)

  • 7/24/2019 Stochastic Process and Modelling Solution

    16/18

    10/7/15 1:10 PM C:\Users\sahah_000...\disease_expectancy.m 1 of 1

    function! " disease_expectancy#n$

    fort"1:1:n

    i"1%

    fors"0:0.05:1

    &"1%

    for'"0:0.05:1

    P"Pro()ransMatrix#s*'$%

    +#&*i$"0 1 0 0!,#P-#t1$$,0%1%%!%

    &"&1%

    end

    i"i1%

    end

    2"0:0.05:1%

    3"0:0.05:1%

    surf#2*3*+$%

    4rid on

    xa(e#6s6$%

    ya(e#6'6$%

    a(e#6+6$%

    str"sprintf#68ay 9d6*t$%

    tite#str$%

    pause#$

    end

    end

    functionP!"Pro()ransMatrix#s*'$

    1"1 0 0 0!%

    "##1s$-$,' 0 0 #s-$,#1'$!%

    "##1s$-$,'- 0 0 ##1'$-$,#1#1s$-$!%

    ;"'- ,#'-$,#1'$ ,',#1'$- #1'$-!%

    P"1%%%;!%

    P#*$"##1s$-$,#1'$,',s,#1s$%

    P#*$",#1'$,s,#1s$#s-$,'%

    P#*$",',#1'$,#1s$-#1#1s$-$,'-%

    P#*$"##1s$-$,##1'$-$,',#1'$,#1#1s$-$%

    end

    Appendix B (Disease Expectancy: MATLAB Code)

  • 7/24/2019 Stochastic Process and Modelling Solution

    17/18

    10/7/15 5:10 AM C:\Users\sahah_000\Deskto...\disease_sim.m 1 of 2

    clear

    clc

    % Model arameters: !"A#"

    $&' % $(m)er of eo*le

    *0.+' % ro)a)ilit, of -etti- ifected

    0.5' % ro)a)ilit, of -etti- c(red

    r0.' % ro)a)ilit, of Meeti-/ro)a)ilit, of )ei- a terati- air

    sceario2' % sceario1 !tatic Meeti- Model 3teracti- air !ceario4

    % sceario2 D,amic Meeti- Model

    % Model arameters: $D

    % Miscellaeo(s arameters: !"A#"

    "sim60' % !im(latio "ime 3i Da,s4

    o(t*(t1' %

    % Miscellaeo(s arameters: $D

    % itial !tate: !"A#"

    8eros3$914'

    tem*rad'

    idema3ceil3tem*;$4914'

    3ide41'

    % itial !tate: $D

    % !im(latio: !"A#"

    arr8eros3$9"sim4'

    arr3:914'

    fort2:1:"sim

    % #eco?er, @ector: $D

    % *44914'

    fori1:1:$

    3i9i40'

    ed

    %

  • 7/24/2019 Stochastic Process and Modelling Solution

    18/18

    10/7/15 5:10 AM C:\Users\sahah_000\Deskto...\disease_sim.m 2 of 2

    % r44914'

    fori1:1:$

    for1:1:i

    if3i4

    M3i940'

    else

    M3i94M39i4'

    ed

    ed

    ed

    ed

    %