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-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
 
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

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 

Recently uploaded (20)

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 

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/ . . . . . .