SlideShare a Scribd company logo
1 of 71
Download to read offline
AWS in Academic Finance
 High Performance Modeling

          Stephen J. Barr
stephen.barr@simon.rochester.edu

        University of Rochester


         March 24, 2012




                                  .   .   .   .   .   .
Welcome




  Welcome!
     Glad to be here at Rochester Cloud Camp 2012




                                         .    .     .   .   .   .
Welcome




  Welcome!
     Glad to be here at Rochester Cloud Camp 2012
     I am a PhD student at the Simon School of Business,
     University of Rochester




                                          .    .    .      .   .   .
Welcome




  Welcome!
     Glad to be here at Rochester Cloud Camp 2012
     I am a PhD student at the Simon School of Business,
     University of Rochester
     Presenting a bit of my research, and how I use AWS daily for
     financial models




                                           .    .    .     .   .    .
Quick Overview



   First 5-7 minutes
       My research question




   Remaining time




                              .   .   .   .   .   .
Quick Overview



   First 5-7 minutes
       My research question




   Remaining time
       How I use AWS daily in my research




                                            .   .   .   .   .   .
Research Question



       My area of interest is financial capital structure, meaning
       how firms use debt and equity issuance to finance
       themselves



                                      net debt
                        Leverage =
                                     total assets

   The main goal of this line of research is to explain the dynamics
   of leverage and investment in the face of uncertainty.




                                                .   .    .   .    .    .
Research Question



       My area of interest is financial capital structure, meaning
       how firms use debt and equity issuance to finance
       themselves
       Main quantities of interest are leverage and investment rates

                                      net debt
                        Leverage =
                                     total assets

   The main goal of this line of research is to explain the dynamics
   of leverage and investment in the face of uncertainty.




                                                .   .    .   .    .    .
Research Question



   Rather than talk, lets just put together a simple model.
   Modeling Principles
       Take as many simplifications as possible




                                               .    .    .    .   .   .
Research Question



   Rather than talk, lets just put together a simple model.
   Modeling Principles
       Take as many simplifications as possible
       Based on economic principles




                                               .    .    .    .   .   .
Research Question



   Rather than talk, lets just put together a simple model.
   Modeling Principles
       Take as many simplifications as possible
       Based on economic principles
       Rather than forcing the firm to follow rules about investment
       or leverage, the firm chooses the value-maximizing behaviour
       given reasonable incentives




                                               .    .    .    .   .   .
Research Question



   Rather than talk, lets just put together a simple model.
   Modeling Principles
       Take as many simplifications as possible
       Based on economic principles
       Rather than forcing the firm to follow rules about investment
       or leverage, the firm chooses the value-maximizing behaviour
       given reasonable incentives
       Firm’s incentive: maximize equity value




                                               .    .    .    .   .   .
Research Question - Math - I



       e(k, k , b, b , z) =                                        (1)
        zk θ                                          Profit        (2)
        + p − (1 − r (1 − τc )p)      New debt + repay old         (3)
        + k − (1 − δk)                           Investment        (4)
        + A(k, k )                 Capital Adjustment Cost         (5)

   The function e(·) shows the firm’s financing status.
      {
        e(·) ≥ 0 the firm make a distribution to shareholders
                                                                   (6)
        e(·) < 0 the firm is issuing equity



                                             .    .   .   .    .         .
Research Question - Math - II
   But, to issue equity, the firm goes to an investment bank. This
   isn’t free.
                       φ(e(·)) = λ1 e(·) + λ2 (e(·))2             (7)
   The firm wants to make the choices of k and p to maximize
   current plus expected future discounted returns. In math, this is
   called a dynamic programming problem and is expressed as a
   Bellman equation (recursively defined).

    V (Kt , Pt , zt∗ ) =                                                         (8)
                       {
        max              e(Kt , Kt+1 , Pt , Pt+1 , zt∗ ) + φ(e(Kt , Kt+1 , Pt , Pt+1 , zt∗ ))
   Kt+1 ,Pt+1 ∈{K×P}
                                                                                     (9)
                             ∫                                      }
                                                   ∗     ∗     ∗
                        +β       V (Kt+1 , Pt+1 , z )dΓ(zt , dzt+1 )


                                                         .     .     .     .     .         .
Phew!




        .   .   .   .   .   .
How do we solve this?



   The math and algorithms to solve these programs fall under
   “dynamic programming”.
    HUGE ISSUE:




    The curse of dimensionality!!!


                                              .   .    .   .    .   .
Why is this an issue? - I

   For 3 k’s {5, 10, 15} and 2 p’s {2, 4}
                                                                                
           5 5 5 5 5 5                      5        5       10      10    15   15
        5 5 5 5 5 5                     5         5       10      10    15   15
                                                                                
        10 10 10 10 10 10                                                    15
    k =                            k = 5         5       10      10    15      
                                         5                                    15
        10 10 10 10 10 10                         5       10      10    15      
        15 15 15 15 15 15               5         5       10      10    15   15
          15 15 15 15 15 15                 5        5       10      10    15   15


                                                                
       2    2   2   2   2   2        2   4   2   4       2       4
     4     4   4   4   4   4     2   4   2   4       2       4
                                                                 
     2     2   2   2   2   2                                  4
   p=                         p = 2   4   2   4       2         
     4     4   4   4   4   4      2   4   2   4       2       4
                                                                
     2     2   2   2   2   2      2   4   2   4       2       4
       4    4   4   4   4   4        2   4   2   4       2       4

                                                 .           .         .    .    .     .
Why is this an issue - II



    1. For sufficient granularity, I need   71 k’s and   29 p’s




                                              .    .   .    .   .   .
Why is this an issue - II



    1. For sufficient granularity, I need   71 k’s and   29 p’s
    2. The above leads to a 2059 × 2059 matrix




                                              .    .   .    .   .   .
Why is this an issue - II



    1. For sufficient granularity, I need   71 k’s and   29 p’s
    2. The above leads to a 2059 × 2059 matrix
    3. I need one of those for each shock z




                                              .    .   .    .   .   .
Why is this an issue - II



    1. For sufficient granularity, I need   71 k’s and   29 p’s
    2. The above leads to a 2059 × 2059 matrix
    3. I need one of those for each shock z
    4. My z is a combination of two processes...I have 323 of them.




                                              .    .   .    .   .     .
Why is this an issue - II



    1. For sufficient granularity, I need   71 k’s and   29 p’s
    2. The above leads to a 2059 × 2059 matrix
    3. I need one of those for each shock z
    4. My z is a combination of two processes...I have 323 of them.
    5. I have a (2059 × 323) × 2059 matrix of double precision
       numbers sitting in memory




                                              .    .   .    .    .    .
Why is this an issue - II



    1. For sufficient granularity, I need   71 k’s and   29 p’s
    2. The above leads to a 2059 × 2059 matrix
    3. I need one of those for each shock z
    4. My z is a combination of two processes...I have 323 of them.
    5. I have a (2059 × 323) × 2059 matrix of double precision
       numbers sitting in memory
    6. This is a 665057 × 2059 = 1, 369, 352, 363 element matrix.




                                              .    .   .    .    .    .
How to solve

                   {
           max      e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ ))   (10)
     K   ,P ∈{K×P}
                                  ∫                                 }
                             + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ )         (11)

   Algorithm: Value Function Iteration
    1. Compute eq. (10)




                                                    .    .     .    .    .      .
How to solve

                   {
           max      e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ ))   (10)
     K   ,P ∈{K×P}
                                  ∫                                 }
                             + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ )         (11)

   Algorithm: Value Function Iteration
    1. Compute eq. (10)
    2. Iteratively guess eq.(11)




                                                    .    .     .    .    .      .
How to solve

                   {
           max      e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ ))   (10)
     K   ,P ∈{K×P}
                                  ∫                                 }
                             + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ )         (11)

   Algorithm: Value Function Iteration
    1. Compute eq. (10)
    2. Iteratively guess eq.(11)
    3. Get a policy function, giving the value-maximizing choice for
       every state




                                                    .    .     .    .    .      .
How to solve

                   {
           max      e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ ))   (10)
     K   ,P ∈{K×P}
                                  ∫                                 }
                             + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ )         (11)

   Algorithm: Value Function Iteration
    1. Compute eq. (10)
    2. Iteratively guess eq.(11)
    3. Get a policy function, giving the value-maximizing choice for
       every state
    4. The policy function is a 323 × 2059 matrix giving the best of
       {k , p } for every {z, k, p}


                                                    .    .     .    .    .      .
How to solve

                   {
           max      e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ ))   (10)
     K   ,P ∈{K×P}
                                  ∫                                 }
                             + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ )         (11)

   Algorithm: Value Function Iteration
    1. Compute eq. (10)
    2. Iteratively guess eq.(11)
    3. Get a policy function, giving the value-maximizing choice for
       every state
    4. The policy function is a 323 × 2059 matrix giving the best of
       {k , p } for every {z, k, p}
    5. Use a cc2.8xlarge

                                                    .    .     .    .    .      .
Software - Old Version




      Original solver written in Python / Numpy




                                            .     .   .   .   .   .
Software - Old Version




      Original solver written in Python / Numpy
      Pros: beautifully general, modular,




                                            .     .   .   .   .   .
Software - Old Version




      Original solver written in Python / Numpy
      Pros: beautifully general, modular,
      Cons: takes 15 mins to solve. Global interpreter lock makes
      things hard to parallelize




                                            .     .   .   .    .    .
Software and Hardware - Version 2 - I



      Reimplemented in C++ using Eigen - high performance
      templating engine




                                          .   .   .    .    .   .
Software and Hardware - Version 2 - I



      Reimplemented in C++ using Eigen - high performance
      templating engine
      Eigen links against Intel’s Math Kernel Library (optimized
      BLAS, LAPACK)




                                             .    .    .    .      .   .
Software and Hardware - Version 2 - I



      Reimplemented in C++ using Eigen - high performance
      templating engine
      Eigen links against Intel’s Math Kernel Library (optimized
      BLAS, LAPACK)
      Intel’s icpc C++ compiler, using -xavx




                                             .    .    .    .      .   .
Software and Hardware - Version 2 - I



      Reimplemented in C++ using Eigen - high performance
      templating engine
      Eigen links against Intel’s Math Kernel Library (optimized
      BLAS, LAPACK)
      Intel’s icpc C++ compiler, using -xavx
      cc2.8xlarge have Intel Xeon Sandy Bridge-EP’s, which have
      AVX




                                             .    .    .    .      .   .
Software and Hardware - Version 2 - I



      Reimplemented in C++ using Eigen - high performance
      templating engine
      Eigen links against Intel’s Math Kernel Library (optimized
      BLAS, LAPACK)
      Intel’s icpc C++ compiler, using -xavx
      cc2.8xlarge have Intel Xeon Sandy Bridge-EP’s, which have
      AVX
      OpenMP to use all 32 threads




                                             .    .    .    .      .   .
Software and Hardware - Version 2 - I



      Reimplemented in C++ using Eigen - high performance
      templating engine
      Eigen links against Intel’s Math Kernel Library (optimized
      BLAS, LAPACK)
      Intel’s icpc C++ compiler, using -xavx
      cc2.8xlarge have Intel Xeon Sandy Bridge-EP’s, which have
      AVX
      OpenMP to use all 32 threads
      Result....




                                             .    .    .    .      .   .
Model Solves in 90 seconds




   .
Software and Hardware - Version 2 - II


       cc2.8xlarge’s are fast
       coding towards MKL / AVX makes things gives a substantial
       speedup
       at this scale, optimizations such as row-major vs column
       major are trivial. Eigen makes this easy.
              typedef Eigen : : Matrix<double ,
                  Eigen : : Dynamic , Eigen : : Dynamic ,
                  Eigen : : RowMajor> MatrixRMXd ;

       I can iterate on a 665057 × 2059 about once per second
       OpenMP is easy



                                               .    .   .   .     .   .
while ( ( err > iterpar . TOLERANCE )
  && ( itercount < iterpar . MAXIT ) ) {
  EV_prev . noalias ( ) = beta ∗ TMAT ∗ V_prev ;
  #pragma omp parallel for
  for ( int i = 0 ; i < Nshocks ; i++) {
    // p a r a l l e l copy
    fullmat . middleRows ( i∗ nstates , nstates ) =
    staticmat . middleRows ( i∗ nstates , nstates ) ;
    // p a r a l l e l b r o a d c a s t
    fullmat . middleRows ( i∗ nstates , nstates ) . rowwise ( )
         += EV_prev . row ( i ) ;
    // p a r a l l e l new v a l u e f n
    V_new . row ( i ) = fullmat . middleRows ( i∗ nstates , nstates )
         . rowwise ( ) . maxCoeff ( ) . transpose ( ) ;
    // p a r a l l e l g e t mins
    diffs ( i )       = ( V_new . row ( i )
         − V_prev . row ( i ) ) . array ( ) . abs ( ) . maxCoeff ( ) ;
    lbounds ( i ) = ( V_new . row ( i )
          − V_prev . row ( i ) ) . minCoeff ( ) ;
    ubounds ( i ) = ( V_new . row ( i )
          − V_prev . row ( i ) ) . maxCoeff ( ) ;
  } // end p a r a l l e l f o r
                                          .    .    .    .    .   .
lbound = beta ∗ double ( lbounds . minCoeff ( ) ) ;
  ubound = beta ∗ double ( ubounds . maxCoeff ( ) ) ;


  double adjfactoriter = 0 . 5 ∗ ( ( beta /(1− beta ) )
     ∗ lbound + ( beta /(1− beta ) ) ∗ ubound ) ;
  double diff = diffs . maxCoeff ( ) ;


 #pragma omp parallel for
 for ( int ii = 0 ; ii < Nshocks ; ii++) {
   V_new . row ( ii ) . array ( ) += adjfactoriter ;
 }
 err = diff ;

  // UPDATE ITER COUNT AND VALUE FUNCTION
  cout << "i: " << itercount++ << ": " << err << endl ;

  V_prev = V_new ;

} // END WHILE

                                         .   .    .     .   .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations




                                          .   .   .    .     .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N




                                          .   .   .    .     .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI
       1. Get latest solver binary




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI
       1. Get latest solver binary
       2. Check SQS queue




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI
       1. Get latest solver binary
       2. Check SQS queue
       3. While (queue nonempty)




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI
       1. Get latest solver binary
       2. Check SQS queue
       3. While (queue nonempty)
           3.1 Get Ωi and solve




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI
       1. Get latest solver binary
       2. Check SQS queue
       3. While (queue nonempty)
           3.1 Get Ωi and solve
           3.2 Simulate and gather statistics




                                                  .     .    .        .        .   .
How I Use AWS - Solving the Model A LOT

      GOAL: See how the model behaves under random sets of
      parameterizations
      HOWTO: - Small Python (using mostly boto) Script
      For i in 1:N
       1. Generate random parameterization Ωi = [ri , θi , δi ,   P,i , ...]
       2. Assign a UUID to Ωi
       3. Push Ωi SQS
      SOLVER AMI
       1. Get latest solver binary
       2. Check SQS queue
       3. While (queue nonempty)
           3.1 Get Ωi and solve
           3.2 Simulate and gather statistics
           3.3 Push all back to S3



                                                  .     .    .        .        .   .
Identification!




   .
No Identification




   .
AWS Advantages




     For each plot, each point takes at least 90 seconds to generate




                                             .    .   .    .    .      .
AWS Advantages




     For each plot, each point takes at least 90 seconds to generate
     Allows me to work in real time - start a group of cc2.8xlarge’s




                                             .    .   .    .    .      .
AWS Advantages




     For each plot, each point takes at least 90 seconds to generate
     Allows me to work in real time - start a group of cc2.8xlarge’s
     Paid for by AWS in Education grant




                                             .    .   .    .    .      .
AWS Advantages




     For each plot, each point takes at least 90 seconds to generate
     Allows me to work in real time - start a group of cc2.8xlarge’s
     Paid for by AWS in Education grant
     cc2.8xlarge’s are FAST!




                                             .    .   .    .    .      .
Next Research Step - Simulated Method of Moments

   MAIN IDEA:
      Reality has some true parameterization Ω∗ which we don’t
      know.




                                           .    .    .   .       .   .
Next Research Step - Simulated Method of Moments

   MAIN IDEA:
      Reality has some true parameterization Ω∗ which we don’t
      know.
      Reality has some statistics X ∗ which we do know.




                                             .   .    .   .      .   .
Next Research Step - Simulated Method of Moments

   MAIN IDEA:
      Reality has some true parameterization Ω∗ which we don’t
      know.
      Reality has some statistics X ∗ which we do know.
      A model’s Ωi implies simulated statistics Xi .

                                Xi = f (Ωi )




                                               .       .   .   .   .   .
Next Research Step - Simulated Method of Moments

   MAIN IDEA:
      Reality has some true parameterization Ω∗ which we don’t
      know.
      Reality has some statistics X ∗ which we do know.
      A model’s Ωi implies simulated statistics Xi .

                                  Xi = f (Ωi )
      To find   Ω∗ ,   we can define

                        g (Ωi ) = sum(abs(X ∗ − f (Ωi )))

      and then find the Ωi which minimizes g (Ωi ).




                                                 .     .    .   .   .   .
Next Research Step - Simulated Method of Moments

   MAIN IDEA:
      Reality has some true parameterization Ω∗ which we don’t
      know.
      Reality has some statistics X ∗ which we do know.
      A model’s Ωi implies simulated statistics Xi .

                                  Xi = f (Ωi )
      To find   Ω∗ ,   we can define

                        g (Ωi ) = sum(abs(X ∗ − f (Ωi )))

      and then find the Ωi which minimizes g (Ωi ).
      This amounts to a multidimensional optimization, which is
      well understood (e.g. Nelder Mead, Simulated Annealing)

                                                 .     .    .   .   .   .
Next Research Step - Simulated Method of Moments




      Pick a large amount of starting values of the optimizers




                                             .    .    .    .    .   .
Next Research Step - Simulated Method of Moments




      Pick a large amount of starting values of the optimizers
      Each cc2.8xlarge can handle 2 optimizers simultaneously




                                             .    .    .    .    .   .
Next Research Step - Simulated Method of Moments




      Pick a large amount of starting values of the optimizers
      Each cc2.8xlarge can handle 2 optimizers simultaneously
      Should take about 500 iterations to find a solution




                                             .    .    .    .    .   .
Thank you




  References:
      My blog: www.econsteve.com




                                   .   .   .   .   .   .
Thank you




  References:
      My blog: www.econsteve.com
      My code: www.bitbucket.com/stevejb




                                      .    .   .   .   .   .
Thank you




  References:
      My blog: www.econsteve.com
      My code: www.bitbucket.com/stevejb
      Twitter: @stevejb




                                      .    .   .   .   .   .
Thank you




  References:
      My blog: www.econsteve.com
      My code: www.bitbucket.com/stevejb
      Twitter: @stevejb
      AWS in Eduaction: http://aws.amazon.com/education/




                                       .   .   .   .   .   .

More Related Content

Viewers also liked

Quality peer advising getting a return on your investment
Quality peer advising getting a return on your investmentQuality peer advising getting a return on your investment
Quality peer advising getting a return on your investmentkrambo-reinitz
 
Science ideas in context 2012
Science ideas in context 2012Science ideas in context 2012
Science ideas in context 2012opsonise
 
Film poster analysis
Film poster analysisFilm poster analysis
Film poster analysis08murphyc
 
Uttarkhand relief updates 1st spetember 2013 1
Uttarkhand relief updates 1st spetember 2013 1Uttarkhand relief updates 1st spetember 2013 1
Uttarkhand relief updates 1st spetember 2013 1dexterousdoc
 
Rebeca salas y hilary jimenes
Rebeca salas y hilary jimenesRebeca salas y hilary jimenes
Rebeca salas y hilary jimenesRebeca Salas
 
E marketing assessment 1
E marketing assessment 1E marketing assessment 1
E marketing assessment 1Eoin Cullen
 
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №208600 Vasilkov
 
Second Language Acquisition and Schizophrenia
Second Language Acquisition and SchizophreniaSecond Language Acquisition and Schizophrenia
Second Language Acquisition and SchizophreniaJoan Cahuich Perez
 
Impl reference manual_for_qualities
Impl reference manual_for_qualitiesImpl reference manual_for_qualities
Impl reference manual_for_qualitiesAlkis Vazacopoulos
 
социально педагогический блок
социально педагогический блоксоциально педагогический блок
социально педагогический блокAkuJIa
 
Finding your voice in facilitating productive conversations
Finding your voice in facilitating productive conversationsFinding your voice in facilitating productive conversations
Finding your voice in facilitating productive conversationsLearning Forward
 
приспособительное поведение
приспособительное поведениеприспособительное поведение
приспособительное поведениеbiolog259
 

Viewers also liked (19)

Animalsoundgame
AnimalsoundgameAnimalsoundgame
Animalsoundgame
 
Tamara maida
Tamara maidaTamara maida
Tamara maida
 
Quality peer advising getting a return on your investment
Quality peer advising getting a return on your investmentQuality peer advising getting a return on your investment
Quality peer advising getting a return on your investment
 
Science ideas in context 2012
Science ideas in context 2012Science ideas in context 2012
Science ideas in context 2012
 
Film poster analysis
Film poster analysisFilm poster analysis
Film poster analysis
 
Uttarkhand relief updates 1st spetember 2013 1
Uttarkhand relief updates 1st spetember 2013 1Uttarkhand relief updates 1st spetember 2013 1
Uttarkhand relief updates 1st spetember 2013 1
 
Rebeca salas y hilary jimenes
Rebeca salas y hilary jimenesRebeca salas y hilary jimenes
Rebeca salas y hilary jimenes
 
E marketing assessment 1
E marketing assessment 1E marketing assessment 1
E marketing assessment 1
 
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
 
Too 1 9
Too 1 9Too 1 9
Too 1 9
 
Second Language Acquisition and Schizophrenia
Second Language Acquisition and SchizophreniaSecond Language Acquisition and Schizophrenia
Second Language Acquisition and Schizophrenia
 
Impl reference manual_for_qualities
Impl reference manual_for_qualitiesImpl reference manual_for_qualities
Impl reference manual_for_qualities
 
Ismael jorge
Ismael jorgeIsmael jorge
Ismael jorge
 
социально педагогический блок
социально педагогический блоксоциально педагогический блок
социально педагогический блок
 
Finding your voice in facilitating productive conversations
Finding your voice in facilitating productive conversationsFinding your voice in facilitating productive conversations
Finding your voice in facilitating productive conversations
 
приспособительное поведение
приспособительное поведениеприспособительное поведение
приспособительное поведение
 
Hari lahir
Hari lahirHari lahir
Hari lahir
 
Violencedomestique
ViolencedomestiqueViolencedomestique
Violencedomestique
 
2144 s17 intro
2144 s17 intro2144 s17 intro
2144 s17 intro
 

Similar to Barr cc slides

Ec2204 tutorial 2(2)
Ec2204 tutorial 2(2)Ec2204 tutorial 2(2)
Ec2204 tutorial 2(2)dannygriff1
 
0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinar0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinarrfrederickpmp
 
0100 01 It Prj Planning Webinar
0100 01 It Prj Planning Webinar0100 01 It Prj Planning Webinar
0100 01 It Prj Planning Webinarrfrederick_pmp
 
0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinar0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinarrfrederickpmp
 
Gs503 vcf lecture 5 partial valuation i 140315
Gs503 vcf lecture 5 partial valuation i  140315Gs503 vcf lecture 5 partial valuation i  140315
Gs503 vcf lecture 5 partial valuation i 140315Stephen Ong
 
@RISK Unchained Webinar
@RISK Unchained Webinar@RISK Unchained Webinar
@RISK Unchained WebinarAndrew Sich
 
Gs503 vcf lecture 4 valuation ii 090215
Gs503 vcf lecture 4 valuation ii  090215Gs503 vcf lecture 4 valuation ii  090215
Gs503 vcf lecture 4 valuation ii 090215Stephen Ong
 
Decision Making with Excel for Managers
Decision Making with Excel for ManagersDecision Making with Excel for Managers
Decision Making with Excel for ManagersAsen Gyczew
 
Capital budgeting
Capital budgetingCapital budgeting
Capital budgetingankyta89
 
FIN 515 NERD Education Counseling -- fin515nerd.com
FIN 515 NERD Education Counseling -- fin515nerd.comFIN 515 NERD Education Counseling -- fin515nerd.com
FIN 515 NERD Education Counseling -- fin515nerd.comkopiko85
 
FIN 515 NERD Lessons in Excellence / fin515nerd.com
FIN 515 NERD Lessons in Excellence / fin515nerd.comFIN 515 NERD Lessons in Excellence / fin515nerd.com
FIN 515 NERD Lessons in Excellence / fin515nerd.comkopiko33
 
Introduction to Optimization revised.ppt
Introduction to Optimization revised.pptIntroduction to Optimization revised.ppt
Introduction to Optimization revised.pptJahnaviGautam
 
Playing chess with Companies
Playing chess with CompaniesPlaying chess with Companies
Playing chess with CompaniesSimon Wardley
 
Machine Learning and Data Mining - Organization, Literature
Machine Learning and Data Mining - Organization, LiteratureMachine Learning and Data Mining - Organization, Literature
Machine Learning and Data Mining - Organization, Literaturewebisslides
 
Capital budgeting techniques
Capital budgeting techniquesCapital budgeting techniques
Capital budgeting techniquesusman_sabir
 
Increasing reporting value with statistics
Increasing reporting value with statisticsIncreasing reporting value with statistics
Increasing reporting value with statisticsvraopolisetti
 

Similar to Barr cc slides (20)

Ec2204 tutorial 2(2)
Ec2204 tutorial 2(2)Ec2204 tutorial 2(2)
Ec2204 tutorial 2(2)
 
0273685988 ch13
0273685988 ch130273685988 ch13
0273685988 ch13
 
0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinar0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinar
 
0100 01 It Prj Planning Webinar
0100 01 It Prj Planning Webinar0100 01 It Prj Planning Webinar
0100 01 It Prj Planning Webinar
 
0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinar0100 01-it-prj planning-webinar
0100 01-it-prj planning-webinar
 
Gs503 vcf lecture 5 partial valuation i 140315
Gs503 vcf lecture 5 partial valuation i  140315Gs503 vcf lecture 5 partial valuation i  140315
Gs503 vcf lecture 5 partial valuation i 140315
 
@RISK Unchained Webinar
@RISK Unchained Webinar@RISK Unchained Webinar
@RISK Unchained Webinar
 
Gs503 vcf lecture 4 valuation ii 090215
Gs503 vcf lecture 4 valuation ii  090215Gs503 vcf lecture 4 valuation ii  090215
Gs503 vcf lecture 4 valuation ii 090215
 
Decision Making with Excel for Managers
Decision Making with Excel for ManagersDecision Making with Excel for Managers
Decision Making with Excel for Managers
 
Ch12ppt
Ch12pptCh12ppt
Ch12ppt
 
Capital budgeting
Capital budgetingCapital budgeting
Capital budgeting
 
FIN 515 NERD Education Counseling -- fin515nerd.com
FIN 515 NERD Education Counseling -- fin515nerd.comFIN 515 NERD Education Counseling -- fin515nerd.com
FIN 515 NERD Education Counseling -- fin515nerd.com
 
FIN 515 NERD Lessons in Excellence / fin515nerd.com
FIN 515 NERD Lessons in Excellence / fin515nerd.comFIN 515 NERD Lessons in Excellence / fin515nerd.com
FIN 515 NERD Lessons in Excellence / fin515nerd.com
 
Introduction to Optimization revised.ppt
Introduction to Optimization revised.pptIntroduction to Optimization revised.ppt
Introduction to Optimization revised.ppt
 
Playing chess with Companies
Playing chess with CompaniesPlaying chess with Companies
Playing chess with Companies
 
Machine Learning and Data Mining - Organization, Literature
Machine Learning and Data Mining - Organization, LiteratureMachine Learning and Data Mining - Organization, Literature
Machine Learning and Data Mining - Organization, Literature
 
CAPITAL BUDGETING TECHNIQUES
CAPITAL BUDGETING TECHNIQUESCAPITAL BUDGETING TECHNIQUES
CAPITAL BUDGETING TECHNIQUES
 
Capital budgeting techniques
Capital budgeting techniquesCapital budgeting techniques
Capital budgeting techniques
 
cloud star notes.pdf
cloud star notes.pdfcloud star notes.pdf
cloud star notes.pdf
 
Increasing reporting value with statistics
Increasing reporting value with statisticsIncreasing reporting value with statistics
Increasing reporting value with statistics
 

Recently uploaded

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

Barr cc slides

  • 1. AWS in Academic Finance High Performance Modeling Stephen J. Barr stephen.barr@simon.rochester.edu University of Rochester March 24, 2012 . . . . . .
  • 2. Welcome Welcome! Glad to be here at Rochester Cloud Camp 2012 . . . . . .
  • 3. Welcome Welcome! Glad to be here at Rochester Cloud Camp 2012 I am a PhD student at the Simon School of Business, University of Rochester . . . . . .
  • 4. Welcome Welcome! Glad to be here at Rochester Cloud Camp 2012 I am a PhD student at the Simon School of Business, University of Rochester Presenting a bit of my research, and how I use AWS daily for financial models . . . . . .
  • 5. Quick Overview First 5-7 minutes My research question Remaining time . . . . . .
  • 6. Quick Overview First 5-7 minutes My research question Remaining time How I use AWS daily in my research . . . . . .
  • 7. Research Question My area of interest is financial capital structure, meaning how firms use debt and equity issuance to finance themselves net debt Leverage = total assets The main goal of this line of research is to explain the dynamics of leverage and investment in the face of uncertainty. . . . . . .
  • 8. Research Question My area of interest is financial capital structure, meaning how firms use debt and equity issuance to finance themselves Main quantities of interest are leverage and investment rates net debt Leverage = total assets The main goal of this line of research is to explain the dynamics of leverage and investment in the face of uncertainty. . . . . . .
  • 9. Research Question Rather than talk, lets just put together a simple model. Modeling Principles Take as many simplifications as possible . . . . . .
  • 10. Research Question Rather than talk, lets just put together a simple model. Modeling Principles Take as many simplifications as possible Based on economic principles . . . . . .
  • 11. Research Question Rather than talk, lets just put together a simple model. Modeling Principles Take as many simplifications as possible Based on economic principles Rather than forcing the firm to follow rules about investment or leverage, the firm chooses the value-maximizing behaviour given reasonable incentives . . . . . .
  • 12. Research Question Rather than talk, lets just put together a simple model. Modeling Principles Take as many simplifications as possible Based on economic principles Rather than forcing the firm to follow rules about investment or leverage, the firm chooses the value-maximizing behaviour given reasonable incentives Firm’s incentive: maximize equity value . . . . . .
  • 13. Research Question - Math - I e(k, k , b, b , z) = (1) zk θ Profit (2) + p − (1 − r (1 − τc )p) New debt + repay old (3) + k − (1 − δk) Investment (4) + A(k, k ) Capital Adjustment Cost (5) The function e(·) shows the firm’s financing status. { e(·) ≥ 0 the firm make a distribution to shareholders (6) e(·) < 0 the firm is issuing equity . . . . . .
  • 14. Research Question - Math - II But, to issue equity, the firm goes to an investment bank. This isn’t free. φ(e(·)) = λ1 e(·) + λ2 (e(·))2 (7) The firm wants to make the choices of k and p to maximize current plus expected future discounted returns. In math, this is called a dynamic programming problem and is expressed as a Bellman equation (recursively defined). V (Kt , Pt , zt∗ ) = (8) { max e(Kt , Kt+1 , Pt , Pt+1 , zt∗ ) + φ(e(Kt , Kt+1 , Pt , Pt+1 , zt∗ )) Kt+1 ,Pt+1 ∈{K×P} (9) ∫ } ∗ ∗ ∗ +β V (Kt+1 , Pt+1 , z )dΓ(zt , dzt+1 ) . . . . . .
  • 15. Phew! . . . . . .
  • 16. How do we solve this? The math and algorithms to solve these programs fall under “dynamic programming”. HUGE ISSUE: The curse of dimensionality!!! . . . . . .
  • 17. Why is this an issue? - I For 3 k’s {5, 10, 15} and 2 p’s {2, 4}     5 5 5 5 5 5 5 5 10 10 15 15 5 5 5 5 5 5 5 5 10 10 15 15     10 10 10 10 10 10  15 k =  k = 5 5 10 10 15   5 15 10 10 10 10 10 10  5 10 10 15  15 15 15 15 15 15 5 5 10 10 15 15 15 15 15 15 15 15 5 5 10 10 15 15     2 2 2 2 2 2 2 4 2 4 2 4 4 4 4 4 4 4 2 4 2 4 2 4    2 2 2 2 2 2  4 p=  p = 2 4 2 4 2  4 4 4 4 4 4 2 4 2 4 2 4     2 2 2 2 2 2  2 4 2 4 2 4 4 4 4 4 4 4 2 4 2 4 2 4 . . . . . .
  • 18. Why is this an issue - II 1. For sufficient granularity, I need 71 k’s and 29 p’s . . . . . .
  • 19. Why is this an issue - II 1. For sufficient granularity, I need 71 k’s and 29 p’s 2. The above leads to a 2059 × 2059 matrix . . . . . .
  • 20. Why is this an issue - II 1. For sufficient granularity, I need 71 k’s and 29 p’s 2. The above leads to a 2059 × 2059 matrix 3. I need one of those for each shock z . . . . . .
  • 21. Why is this an issue - II 1. For sufficient granularity, I need 71 k’s and 29 p’s 2. The above leads to a 2059 × 2059 matrix 3. I need one of those for each shock z 4. My z is a combination of two processes...I have 323 of them. . . . . . .
  • 22. Why is this an issue - II 1. For sufficient granularity, I need 71 k’s and 29 p’s 2. The above leads to a 2059 × 2059 matrix 3. I need one of those for each shock z 4. My z is a combination of two processes...I have 323 of them. 5. I have a (2059 × 323) × 2059 matrix of double precision numbers sitting in memory . . . . . .
  • 23. Why is this an issue - II 1. For sufficient granularity, I need 71 k’s and 29 p’s 2. The above leads to a 2059 × 2059 matrix 3. I need one of those for each shock z 4. My z is a combination of two processes...I have 323 of them. 5. I have a (2059 × 323) × 2059 matrix of double precision numbers sitting in memory 6. This is a 665057 × 2059 = 1, 369, 352, 363 element matrix. . . . . . .
  • 24. How to solve { max e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ )) (10) K ,P ∈{K×P} ∫ } + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ ) (11) Algorithm: Value Function Iteration 1. Compute eq. (10) . . . . . .
  • 25. How to solve { max e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ )) (10) K ,P ∈{K×P} ∫ } + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ ) (11) Algorithm: Value Function Iteration 1. Compute eq. (10) 2. Iteratively guess eq.(11) . . . . . .
  • 26. How to solve { max e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ )) (10) K ,P ∈{K×P} ∫ } + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ ) (11) Algorithm: Value Function Iteration 1. Compute eq. (10) 2. Iteratively guess eq.(11) 3. Get a policy function, giving the value-maximizing choice for every state . . . . . .
  • 27. How to solve { max e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ )) (10) K ,P ∈{K×P} ∫ } + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ ) (11) Algorithm: Value Function Iteration 1. Compute eq. (10) 2. Iteratively guess eq.(11) 3. Get a policy function, giving the value-maximizing choice for every state 4. The policy function is a 323 × 2059 matrix giving the best of {k , p } for every {z, k, p} . . . . . .
  • 28. How to solve { max e(K , K , P, P , z ∗ ) + φ(e(K , K , P, P , z ∗ )) (10) K ,P ∈{K×P} ∫ } + β V (K , P , z ∗ )dΓ(z ∗ , dz ∗ ) (11) Algorithm: Value Function Iteration 1. Compute eq. (10) 2. Iteratively guess eq.(11) 3. Get a policy function, giving the value-maximizing choice for every state 4. The policy function is a 323 × 2059 matrix giving the best of {k , p } for every {z, k, p} 5. Use a cc2.8xlarge . . . . . .
  • 29. Software - Old Version Original solver written in Python / Numpy . . . . . .
  • 30. Software - Old Version Original solver written in Python / Numpy Pros: beautifully general, modular, . . . . . .
  • 31. Software - Old Version Original solver written in Python / Numpy Pros: beautifully general, modular, Cons: takes 15 mins to solve. Global interpreter lock makes things hard to parallelize . . . . . .
  • 32. Software and Hardware - Version 2 - I Reimplemented in C++ using Eigen - high performance templating engine . . . . . .
  • 33. Software and Hardware - Version 2 - I Reimplemented in C++ using Eigen - high performance templating engine Eigen links against Intel’s Math Kernel Library (optimized BLAS, LAPACK) . . . . . .
  • 34. Software and Hardware - Version 2 - I Reimplemented in C++ using Eigen - high performance templating engine Eigen links against Intel’s Math Kernel Library (optimized BLAS, LAPACK) Intel’s icpc C++ compiler, using -xavx . . . . . .
  • 35. Software and Hardware - Version 2 - I Reimplemented in C++ using Eigen - high performance templating engine Eigen links against Intel’s Math Kernel Library (optimized BLAS, LAPACK) Intel’s icpc C++ compiler, using -xavx cc2.8xlarge have Intel Xeon Sandy Bridge-EP’s, which have AVX . . . . . .
  • 36. Software and Hardware - Version 2 - I Reimplemented in C++ using Eigen - high performance templating engine Eigen links against Intel’s Math Kernel Library (optimized BLAS, LAPACK) Intel’s icpc C++ compiler, using -xavx cc2.8xlarge have Intel Xeon Sandy Bridge-EP’s, which have AVX OpenMP to use all 32 threads . . . . . .
  • 37. Software and Hardware - Version 2 - I Reimplemented in C++ using Eigen - high performance templating engine Eigen links against Intel’s Math Kernel Library (optimized BLAS, LAPACK) Intel’s icpc C++ compiler, using -xavx cc2.8xlarge have Intel Xeon Sandy Bridge-EP’s, which have AVX OpenMP to use all 32 threads Result.... . . . . . .
  • 38. Model Solves in 90 seconds .
  • 39. Software and Hardware - Version 2 - II cc2.8xlarge’s are fast coding towards MKL / AVX makes things gives a substantial speedup at this scale, optimizations such as row-major vs column major are trivial. Eigen makes this easy. typedef Eigen : : Matrix<double , Eigen : : Dynamic , Eigen : : Dynamic , Eigen : : RowMajor> MatrixRMXd ; I can iterate on a 665057 × 2059 about once per second OpenMP is easy . . . . . .
  • 40. while ( ( err > iterpar . TOLERANCE ) && ( itercount < iterpar . MAXIT ) ) { EV_prev . noalias ( ) = beta ∗ TMAT ∗ V_prev ; #pragma omp parallel for for ( int i = 0 ; i < Nshocks ; i++) { // p a r a l l e l copy fullmat . middleRows ( i∗ nstates , nstates ) = staticmat . middleRows ( i∗ nstates , nstates ) ; // p a r a l l e l b r o a d c a s t fullmat . middleRows ( i∗ nstates , nstates ) . rowwise ( ) += EV_prev . row ( i ) ; // p a r a l l e l new v a l u e f n V_new . row ( i ) = fullmat . middleRows ( i∗ nstates , nstates ) . rowwise ( ) . maxCoeff ( ) . transpose ( ) ; // p a r a l l e l g e t mins diffs ( i ) = ( V_new . row ( i ) − V_prev . row ( i ) ) . array ( ) . abs ( ) . maxCoeff ( ) ; lbounds ( i ) = ( V_new . row ( i ) − V_prev . row ( i ) ) . minCoeff ( ) ; ubounds ( i ) = ( V_new . row ( i ) − V_prev . row ( i ) ) . maxCoeff ( ) ; } // end p a r a l l e l f o r . . . . . .
  • 41. lbound = beta ∗ double ( lbounds . minCoeff ( ) ) ; ubound = beta ∗ double ( ubounds . maxCoeff ( ) ) ; double adjfactoriter = 0 . 5 ∗ ( ( beta /(1− beta ) ) ∗ lbound + ( beta /(1− beta ) ) ∗ ubound ) ; double diff = diffs . maxCoeff ( ) ; #pragma omp parallel for for ( int ii = 0 ; ii < Nshocks ; ii++) { V_new . row ( ii ) . array ( ) += adjfactoriter ; } err = diff ; // UPDATE ITER COUNT AND VALUE FUNCTION cout << "i: " << itercount++ << ": " << err << endl ; V_prev = V_new ; } // END WHILE . . . . . .
  • 42. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations . . . . . .
  • 43. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N . . . . . .
  • 44. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] . . . . . .
  • 45. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi . . . . . .
  • 46. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS . . . . . .
  • 47. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI . . . . . .
  • 48. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI 1. Get latest solver binary . . . . . .
  • 49. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI 1. Get latest solver binary 2. Check SQS queue . . . . . .
  • 50. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI 1. Get latest solver binary 2. Check SQS queue 3. While (queue nonempty) . . . . . .
  • 51. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI 1. Get latest solver binary 2. Check SQS queue 3. While (queue nonempty) 3.1 Get Ωi and solve . . . . . .
  • 52. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI 1. Get latest solver binary 2. Check SQS queue 3. While (queue nonempty) 3.1 Get Ωi and solve 3.2 Simulate and gather statistics . . . . . .
  • 53. How I Use AWS - Solving the Model A LOT GOAL: See how the model behaves under random sets of parameterizations HOWTO: - Small Python (using mostly boto) Script For i in 1:N 1. Generate random parameterization Ωi = [ri , θi , δi , P,i , ...] 2. Assign a UUID to Ωi 3. Push Ωi SQS SOLVER AMI 1. Get latest solver binary 2. Check SQS queue 3. While (queue nonempty) 3.1 Get Ωi and solve 3.2 Simulate and gather statistics 3.3 Push all back to S3 . . . . . .
  • 56. AWS Advantages For each plot, each point takes at least 90 seconds to generate . . . . . .
  • 57. AWS Advantages For each plot, each point takes at least 90 seconds to generate Allows me to work in real time - start a group of cc2.8xlarge’s . . . . . .
  • 58. AWS Advantages For each plot, each point takes at least 90 seconds to generate Allows me to work in real time - start a group of cc2.8xlarge’s Paid for by AWS in Education grant . . . . . .
  • 59. AWS Advantages For each plot, each point takes at least 90 seconds to generate Allows me to work in real time - start a group of cc2.8xlarge’s Paid for by AWS in Education grant cc2.8xlarge’s are FAST! . . . . . .
  • 60. Next Research Step - Simulated Method of Moments MAIN IDEA: Reality has some true parameterization Ω∗ which we don’t know. . . . . . .
  • 61. Next Research Step - Simulated Method of Moments MAIN IDEA: Reality has some true parameterization Ω∗ which we don’t know. Reality has some statistics X ∗ which we do know. . . . . . .
  • 62. Next Research Step - Simulated Method of Moments MAIN IDEA: Reality has some true parameterization Ω∗ which we don’t know. Reality has some statistics X ∗ which we do know. A model’s Ωi implies simulated statistics Xi . Xi = f (Ωi ) . . . . . .
  • 63. Next Research Step - Simulated Method of Moments MAIN IDEA: Reality has some true parameterization Ω∗ which we don’t know. Reality has some statistics X ∗ which we do know. A model’s Ωi implies simulated statistics Xi . Xi = f (Ωi ) To find Ω∗ , we can define g (Ωi ) = sum(abs(X ∗ − f (Ωi ))) and then find the Ωi which minimizes g (Ωi ). . . . . . .
  • 64. Next Research Step - Simulated Method of Moments MAIN IDEA: Reality has some true parameterization Ω∗ which we don’t know. Reality has some statistics X ∗ which we do know. A model’s Ωi implies simulated statistics Xi . Xi = f (Ωi ) To find Ω∗ , we can define g (Ωi ) = sum(abs(X ∗ − f (Ωi ))) and then find the Ωi which minimizes g (Ωi ). This amounts to a multidimensional optimization, which is well understood (e.g. Nelder Mead, Simulated Annealing) . . . . . .
  • 65. Next Research Step - Simulated Method of Moments Pick a large amount of starting values of the optimizers . . . . . .
  • 66. Next Research Step - Simulated Method of Moments Pick a large amount of starting values of the optimizers Each cc2.8xlarge can handle 2 optimizers simultaneously . . . . . .
  • 67. Next Research Step - Simulated Method of Moments Pick a large amount of starting values of the optimizers Each cc2.8xlarge can handle 2 optimizers simultaneously Should take about 500 iterations to find a solution . . . . . .
  • 68. Thank you References: My blog: www.econsteve.com . . . . . .
  • 69. Thank you References: My blog: www.econsteve.com My code: www.bitbucket.com/stevejb . . . . . .
  • 70. Thank you References: My blog: www.econsteve.com My code: www.bitbucket.com/stevejb Twitter: @stevejb . . . . . .
  • 71. Thank you References: My blog: www.econsteve.com My code: www.bitbucket.com/stevejb Twitter: @stevejb AWS in Eduaction: http://aws.amazon.com/education/ . . . . . .