Using mdarray to Price Equity Options
Daniel Hanson is a former full-time lecturer in the Computational Finance & Risk Management program within the Department of Applied Mathematics at the University of Washington. His appointment followed over 25 years of experience in private sector quantitative development in finance and data science.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Using mdarray to Price Equity Options
std::mdspan, proposed for release in C++23 (P0009), can impose a non-owning multidimensional array structure on a reference to a container, such as an STL vector. Using the example of a vector containing the data, and a referring mdspan representing a matrix, the number of rows and columns are set at construction of the mdspan. An mdspan can also take the form of higher dimensional arrays, but it is specifically useful for the two-dimensional case often found in financial and other applied science applications.
But what about the case where the data is not known a priori, and needs to be generated within a multidimensional array? A particular example is the binomial lattice pricing model for equity options, where underlying prices and option payoffs are generated going forward and backward in time, respectively. The owning analog of mdspan, namely mdarray, proposed for C++26 (P1684) — not far off within the next three years — provides the lattice structure for us, which can save a considerable amount of time and work, as well as separate the lattice from the mathematics.
In this presentation, we will cover a quick introduction to mdspan, and contrast it with mdarray. A solution to the implementation of a binomial lattice option pricing model using mdarray will then be shown, with examples of both European and American options, although it is the latter case where lattice models are particularly useful. Convergence issues will also be discussed, and it will also be noted how mdarray can be extended for trinomial lattices common in interest rate derivative pricing, and higher dimensional cases where options on more than one underlying asset are involved.
Daniel Hanson is a former full-time lecturer in the Computational Finance & Risk Management program within the Department of Applied Mathematics at the University of Washington. His appointment followed over 25 years of experience in private sector quantitative development in finance and data science.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Using the power of Assembly to fine tune an application's performance
Brett Searles will be the presenter.
We are going HYBRID!! - All
NWCPP meetings will have the option of
attending in person at the Microsoft Redmone
Reactor room as well as online!! We are also
starting to work on bringing back the pizza!
We are going HYBRID!! - All NWCPP meetings will have the option of attending in person at the Microsoft Redmond Reactor room as well as online!! We are also starting to work on bringing back the
pizza!
Real-Time Circuit Simulation with Wave Digital Filters in C++
Jatin Chowdhury is an audio signal processing engineer and software developer, with a focus in music technology. He has previously studied at the Center for Computer Research in Music and Acoustics (CCRMA), and worked as an Audio Test Engineer for Tesla Motors. He currently lives in Seattle, WA, and runs Chowdhury DSP, a boutique audio software company.
The Diamond Problem
Solved!
Traditionally in class based OOP languages, both the fields and methods from the super-classes are inherited by the sub-classes. However this may cause some serious problems in multiple inheritance, e.g. most notably the diamond problem. In this paper, we propose to stop inheriting data fields as a clean and general solution to such problems. We first present a design pattern called DDIFI (which stands for Decoupling Data Interface From data Implementation) to cleanly achieve multiple inheritance in C++, which can handle class fields of the diamond problem exactly according to the programmers’ intended application semantics. It gives programmers flexibility when dealing with the diamond problem for instance variables: each instance variable can be configured either as one joined copy or as multiple independent copies in the implementation class. The key ideas are:
- Decouple data interface from data implementation, by stopping inheriting data fields
- In the regular methods implementation use virtual property methods instead of direct raw fields
- After each semantic branching add (and override) the new semantic assigning property
Then we show our method is general enough, and also applicable to any OOP languages:
- That natively support multiple inheritance (e.g. C++, Python, OCaml, Lisp, Eiffel, etc.), or
- Single inheritance languages that support default interface methods (e.g. Java, C# etc.), or
- Single inheritance languages that support mixins, and conditional compilation (e.g. static if in D), or traits (e.g. Scala).
We have demo implementation of this design pattern DDIFI in these 9 languages, since this is C++ talk, we will mostly talk about the C++ implementation.
YuQian Zhou: Ph.D from Oxford Univ.; previous Google engineer; startup founder.
The Diamond Problem
Solved!
Hi Folks,
The slides and video from the meeting this week are now available here:
MDSPAN: A Deep Dive
Spanning C++, Kokkos & SYCL
Nevin “:-)” Liber is a Computer Scientist in the ALCF (Argonne Leadership Computing Facility) division of Argonne National Laboratory, where he works on Kokkos. He also represents Argonne on the SYCL and C++ Committees, the latter as INCITS C++ Vice Chair, WG21 Admin Chair and WG21 Vice Chair of LEWGI/SG18. Back when he started out working at Bell Labs over three decades ago, a friend of his called and asked “What do you know about C++? You folks invented it!” That was enough to get a relatively shy junior engineer to go find the local expert so he could go play with it, and the rest is history! He has worked in C++ across various industries and platforms (big data, low-latency, operating systems, embedded, telephony and now exascale computing, just to name a few). He has also been a C++ Committee member since 2010 and hosted both the C++ and C standards meetings in Chicago.
Hi Folks,
Here are the slides and video from the meeting Wednesday night:
Remedial C++ 17
Library Features - Part 2!
Like the man in black said: "No one of consequence". Peter Williamson has been programming professionally for 30 years at companies like Boeing, Microsoft, Amazon, and Google. He’s been using C++ for most of that time, and attending NWCPP off and on since the 90’s. He has been known to talk about himself in third person.
Hi Folks,
Here are the resources from the meeting last night. Again apologies to those on line with the meeting link mix up - will get that fixed for the January meeting!!
What Have We
Lost?
In the last 40+ years that I have been developing software there has been a massive increase in computing capability, both in terms of performance and the speed and ease of which new software can be created.
If we look back , the level of benefit to the user hasn’t kept pace with either of the above metrics. 40+ years ago I would have used a word processor to write this abstract (albeit without some of the fancy formatting) on a computer that had a single 8 bit processor and ran at Mhz speeds (ie: Commodore 64). On my modern computer with 16x 64 bit processors each running at Ghz speed writing this abstract is much the same experience. (For the moment we’ll ignore that MABYE in the not too distant future I won’t be doing this at all as a ChatGPT descent will do it for me – which of course would justify the cost of my current computer!)
Let’s take a moment to look back at how things were done in the past, particularly at techniques which I do not find in common practice, to see how we can do better. This is not to say that 40+ years of progress should be thrown out the window, this is to say some 40+ year old techniques still have value today and should not be forgotten.
Lloyd Moore is the founder and owner of CyberData Corporation, which provides consulting services in the aerospace, robotics, machine vision and industrial automation fields. Lloyd has worked in software industry for 35 years. His formal training is in biological-based artificial intelligence, electronics, and psychology. Lloyd is also currently the president of the Northwest C++ User’s Group and an organizer of the Seattle Robotics Society Robothon events.
Comprehensible
Programming
Have you ever looked at code you wrote 5 years ago, and wondered what you were thinking? Just think of code you authored even further back! You’ve heard about secure code, safe code, clean code, modern code, optimized code, clever code, user friendly code, structured code, effective code, etc. Everybody thinks they write easy to comprehend code (including me), but your future self will likely have the last word on that. Here I’ll be talking about writing easy to understand code. It’s based on decades of experience writing code that is hard to understand. It’ll show how D makes it easy to write easy to understand code. It won’t cost anything, either. And who knows - maybe your future self will sigh contentedly with “I wrote that!”
The highest praise you can get for your code is someone else looking at it saying “that’s so simple, anyone could have done it!” (But you and I know better)
Walter Bright Engineer, Digital Mars
Walter Bright is the creator and first implementer of the D programming language and has implemented compilers for several other languages. He’s an expert in all areas of compiler technology, including front ends, optimizers, code generation, interpreter engines and runtime libraries. Walter regularly writes articles about compilers and programming, is known for engaging and informative presentations, and provides training in compiler development techniques. Many are surprised to discover that Walter is also the creator of the wargame Empire, which is still popular today over 30 years after its debut.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Comprehensible
Programming
Linear
Algebra and the
Eigen Library
Linear algebra is an essential part of scientific programming, particularly in domains such as quantitative finance, data science, physics, and medical research. As C++ did not have all the convenient built-in multidimensional array capabilities that came with Fortran platforms, scientific programmers making the transition to C++ back in the 1990’s often found themselves in an inconvenient situation with limited options. These included building up this functionality mostly from scratch, wrestling with interfaces to numerical Fortran libraries such as BLAS and LAPACK, or somehow convincing management to invest in a third-party commercial C++ linear algebra library.
The situation has improved substantially over the years with the release and availability of several well-regarded open-source linear algebra libraries for C++. One in particular that has become popular, first released in 2006, is the Eigen library. It has been adopted for use within both the TensorFlow machine learning library and the Stan Math Library, as well as in financial applications. Linear algebra has also become a point of emphasis in C++ Standard Library enhancements, with the release of std::mdspan (P0009) in C++23, and the BLAS (Basic Linear Algebra Subroutines) interface (P1673) that has been accepted for C++26.
In this talk, we will examine the setup and basics of the Eigen library, followed by a discussion of some of its more advanced features, such as matrix decompositions frequently used in quantitative work, as well as its compatibility with STL algorithms. It will conclude with an overview of how it might be used within the context of the C++26 BLAS proposal, via an interface with mdspan now in C++23.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Conan 2.0 was released over a year ago with a large number of new features and improvements. Since its release, the team has continued to add improvements based on user feedback, releasing many more new features than in the previous years combined.
This talk will introduce and demonstrate many exciting and new features like how CMake presets and dependency providers can give a fully transparent integration, the new interactive dependency graph visualization, using dependencies from a git repo and new compliance tools. It will also present ongoing work and current efforts in the Common Package Specification (CPS) initiative.
Diego Rodriguez-Losada‘s passions are robotics and SW engineering and development. He has developed many years in C and C++ in the Industrial, Robotics and AI fields. Diego was also a University (tenure track) professor and robotics researcher for 8 years, till 2012, when he quit academia to try to build a C/C++ dependency manager and co-founded a startup. Since then he mostly develops in Python. Diego is a conan.io C/C++ package manager co-creator and project lead, now working at JFrog as Conan Lead Architect and C/C++ Advocate.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Hi Folks,
Here is the video from the meeting this week, still working on getting the slides:
Local Reasoning in C++
Sean Parent is a senior principal scientist and software architect managing Adobe’s Software Technology Lab. Sean joined Adobe in 1993, working on Photoshop, and is one of the creators of Photoshop Web, Photoshop Mobile, Lightroom Mobile, and Lightroom Web. In 2009, Sean spent a year at Google working on Chrome OS before returning to Adobe. From 1988 through 1993, Sean worked at Apple, where he was part of the system software team that developed the technologies that allowed Apple’s successful transition to PowerPC.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Note: We had some issues with this recording. We’ll do what we can to clean up those issues as we can. In particular the start nmay need to be adjusted and toward the end of the video the Teams session cut out and was then restored. Sorry about this and we’ll work to make the video as clean as we can.
NVIDIA CUDA is a tool kit for development of GPU accelerated applications. For specific types of applications and computational patterns the GPU allows you to deploy thousands of cores for processing in a very cost effective manner.
While getting the full benefit of GPU acceleration can take a considerable amount of knowledge and effort, considerable speedups can be achieved with minimal program changes.
This talk provides an overview of what CUDA is, where it can be effective, and then does a deep dive to convert a simple, sequential data processing loop running as a single thread on the CPU into a massively parallel operation running on the GPU.
Lloyd Moore is the founder and owner of CyberData Corporation, which provides consulting services in the aerospace, robotics, machine vision and industrial automation fields. Lloyd has worked in software industry for 35 years. His formal training is in biological-based artificial intelligence, electronics, and psychology. Lloyd is also currently the president of the Northwest C++ User’s Group and an organizer of the Seattle Robotics Society Robothon events.
Please thank Microsoft for sponsoring our meeting room and Teams account!
Hi Folks,
Here are the resources from the last meeting:
CUDA Without a PhD