Harnessing Advanced Financial Modeling Technologies with MATLAB - MATLAB
Video length is 26:36

Harnessing Advanced Financial Modeling Technologies with MATLAB

Alexander Diethert, MathWorks

Financial modeling stands as the bedrock of decision making in the finance industry, yet it is undergoing transformative changes in today's fast-paced and complex environment. Rapid advancements in mathematical methods, heightened regulatory demands, the transformative potential of cloud computing, the explosion of accessible data sources, and the rise of (generative) AI are revolutionizing the field. These developments make the work of financial professionals both exhilarating and challenging.

Modern modeling tools must harness these technologies in a user-friendly, transparent, and customizable manner. In this presentation, see how practitioners leverage MATLAB® to tap into a comprehensive ecosystem of data and tools for swift and robust modeling. Explore compelling examples, including econometric modeling tools, climate scenarios, geophysical data sources, and collaboration in multilanguage setups. Discover how MATLAB empowers financial professionals to stay ahead in an ever-evolving landscape.

Published: 22 Oct 2024

My name is Alexander Diethert, and I'm based out of Munich in Germany. I've been working for the MathWorks for the last 12 years. And I'm leading a team of customer-facing financial engineers.

I want to cover two aspects today. One is, I want to give you a glimpse into what the team and myself have been doing in our customer-facing activities in the last year or so. And you will find that this is a lot about combining and integrating various technologies into a MATLAB-based workflows.

And along the way-- and that's the second aspect-- I'm going to highlight some hopefully interesting MathWorks technology that you might not be yet aware of. Right, so let's get started.

So assuming you're a developer, and you're tasked to create a new application-- so it's my X application. An X is, for sure, for you, a subset of. It has to be new, fast, robust, flexible, interactive, AI-powered, you name it.

And then you start thinking. A lot of things are going through your head in terms of what components do you need to create such an application. So when you start working, you probably first want to think about what you want to create, right? So it could be the various outputs you have is what you're creating, maybe part of a larger system wrapped up in a docker container. Is it an app? Is it maybe a documentation that you want to share Or are these nice little visualizations illustrating your idea?

And then you think about what additional technologies you need to have. One will be, you might actually have existing code that you're reusing. So there might be code flying around from a colleague that's worked on Python. Or you want to download a deep learning network from Hugging Face, or you want to use some of the community toolboxes in the econometrics space which are out there.

And then you move on. You need data. Data can be provided through your favorite data vendor. There's a lot of new data sources out there, especially with the rise of climate modeling. And there's also public data. You might do web scraping, and you realize that the data is living somewhere.

It could be in databases. It could be in Excel files. It could be in PDF files, or it could be written to-- or you might be using some dashboarding systems like Tableau or Power BI.

And depending on your environment, you might be working in an enterprise context. So whatever you're creating might be under some scrutiny in terms of some compliance processes that you have. You might be part of a DevOps workflow, or you might be using products like Jenkins or like Azure Pipelines. And of course, your application will either be created somewhere or be executed somewhere. For example, on the cloud, using your favorite cloud provider using Jupyter hub, or you might be connected to Databricks.

And finally, you want to do the best coding you can. You want to make sure your code is fast, so you might consider technologies parallelization. You want to collaborate with others. You might make sure that your code is tested. And you might be using products like GitHub, for example.

Now, don't worry, I'm not going to cover all of these items here. I want to actually narrow it down a little to the aspects we said in the beginning and divide that vast spectrum a little bit into four key ideas.

So the four key ideas I want to cover is one is the modeling side itself. I call it frontier technologies because you want to do the best modeling or use the best modeling, which is available. And from our perspective, there's a lot of talk about generative AI, regulation technology, climate modeling, and the latest and greatest financial and economic research.

Then you care about data management. You care about accessing data from your data vendors. You might access web data or publicly available data. And you might be dealing with text data or even try to synthesize your own data.

Third one is you might be part of an enterprise. And then IT compliance matters to you. You care about operationalizing your applications or efficiently sharing your tools.

And finally, you want to do the best coding you can. You want to make sure your application is highly performant. You want to be productive and transparent with what you're doing, and you want to create a highly usable application. And at the same time, these four aspects will be the outline of the talk. So we go through those in order, starting with those frontier technologies. Let's dive into that.

There's four aspects that played a big role in the last year for me and my team. It's generative AI, regulation technology, climate models, and financial and economic research. And I hope you had the opportunity to attend yesterday's conference day because we actually covered in two of the MathWorks talks three of those topic areas quite nicely, I believe.

So I want to refer you to Paul Peeling's talk about the delivery of AI-powered financial services. He gave a nice deep dive into GenAI and into how we could be dealing with regulatory requirements. And there was a talk by my colleague, Elre, who talked about software solutions for climate risk management. The recordings will be available. And if you're interested, please have a look into those recordings.

I do want to, today, actually, focus a little bit more on the aspect of providing and reusing the latest financial and economic research. And for that, it's quite interesting that there are actually quite a lot of packages-- tools out there that people have created.

And the creators of the tools, they actually vary quite a bit. This could be individual persons. This could be groups being interested in a certain type of modeling. This could be public institutions like the Fed or the ECB. And they share tools, actually. And a lot of those tools are actually based on 4 and serve different purposes.

And we're proud that, in this conference, we've actually seen already a couple of those. So for example, last year, we heard a colleague from the Austrian National Bank talk about ARNIE. And we heard from the authors of the BEAR Toolbox and from Dynare. And they gave some insights into their work on Dynare and the applications they have with BEAR and Dynare.

And actually today, we see more. Right after this one, we see junior. So I'm looking forward to see junior talking about this RISE Toolbox. And we see colleagues from the IMF presenting their DIGNAD model.

And furthermore, there's a colleague from the European Stability Mechanism, who will present the work on MATLAB, and Dynare, which is also based on MATLAB. So those things, those community tool boxes or those tool boxes-- regardless whether they're shared publicly, or whether you want to create such a thing-- they want to share with your fellow coworkers-- I want to highlight one technology which is very nice facilitating sharing of that functionality, and that's called custom toolbox packaging.

So with a custom toolbox, you can actually combine a lot of things that belong to one application. So that's the code. Obviously, that's maybe data. There could be apps that come along with the code-- the documentation or some examples you've created. And all of that can live under a single installer file. And for somebody who retrieves that, it's very easy because, by the click of a button, he could unpack everything. And MATLAB takes care of the path dependencies, et cetera, and it will just work.

And at the same time, you as a user can manage all the add-ons you have installed through the Add-on explorer. So you can install and install the various tools you have there and also be notified if there are updates available.

I want to now share one great example with you, which is the BEAR Toolbox, actually, which has been packaged as a toolbox. So the BEAR Toolbox is produced by ECB. You see a screenshot of file exchange with a BEAR Toolbox on it. And I want to highlight three key aspects of that File Exchange page there.

One is the actual posting of the code and of the application. It's actually done on GitHub. So for people who write those applications can actually use their favorite collaboration tool. And they can work together. They can publish. They can retrieve feedback, all the nice things they can do in GitHub.

Second one is, there's a button, which is called Open in Matlab Online. And that means, by the click of a button, people can download the application into their MATLAB drive and execute the application from MATLAB Online. And this is especially interesting for, let's say, teachers and students because it's a very easy way of accessing MATLAB. And for that purpose, no big download is needed. You don't even have to download MATLAB because you can just access the browser-based version of MATLAB. Quite interestingly, for those who are aware of the Dynare package, also Dynare is available in a MATLAB Online-enabled version, which has quite a lot of popularity, as far as we can tell.

And the third one is a feature called GitHub Actions. So if you create your MATLAB application, then you can automatically run unit tests that you might have written. So upon a new commit, before things get public, it might run again against test, or it might be part of a build pipeline. And if you're sharing your code publicly, that's freely available to you.

Now, let's dive into the next topic, which is around data management. So areas I want to cover there are the access to the various data vendors out there, accessing web or public sources, working with text-based data, and creating synthetic data.

On the data vendor side, there's a dedicated tool that MathWorks provides, which is called the Datafeed Toolbox, and it provides APIs to a lot of the common data vendors out there. And you see a list of those and the sort of data that the API supports in the list on the left hand side.

In addition to that, there's companies, other providers, institutions that publish their own APIs through community channels. And there's, for example, the connector written by Attilio from the Bank of Italy, which provides an easy way to access data from the statistical data meta exchange. And also sometimes we write those tools.

My colleague, IDO, for example, has written the Climate IAM Explorer, which allows you to easily navigate and visualize data for integrated assessment models from the network of greening the financial system. And people sometimes want to have their own sources. And for that, MATLAB provides a variety of APIs.

I want to highlight one very popular one, which is popular in the context of web scraping. And there's a MATLAB function, which is called Web Read, which allows you to read websites and extract the content from there. And I've created a little code example there, like, take today's conference.

If I wanted to extract the data of today's conference, there's just four lines of code I need to extract that information. And now imagine you do that on a more regular basis, and you want to scrape hundreds of websites. Then this is a very convenient way of automating things.

And this already leads us to the area of text data. And when we speak about text data, it's almost inevitable to speak at least a little bit about generative AI and ChatGPT. I want to highlight that MathWorks has created a free GitHub repository that contains code to connect to the MATLAB OpenAI ChatGPT Completions API. Or in less technical words, you can use ChatGPT from your MATLAB desktop and speak to ChatGPT and go back and forth.

There's a link to GitHub. Check it out. And we have tried to create some proof of concepts with that and create some applications. And one of the nice things that we produced was this idea here. It's actually coming back to the $DMX database we saw before. So that's statistically data, publicly available using the connector we just mentioned.

And the tricky thing there is if you're a beginner, then this is a very rich database, and it contains data sets that are distinguished by acronyms, by the area of the data you're looking at, by the seasonality. And there's a bunch of attributes. And if you don't know those, it could be if you've not experienced a bit of work to get used to it.

So we tried and played a little around and we created an API, which lets you give text-based input. And the output would be the acronym that could then identify the right data set. It worked quite fine for us. If you're interested to learn more, please contact us.

And the last one in this context is, creating synthesized data. So imagine you're an organization. And sometimes organizations want to outsource specific tasks, based on confidential data. So it's often impossible to share that confidential data with the partners.

So what you want to do is, you still want the partners to do the work, but actually you want to create similar data. So what you do is you take the existing data you have and synthesize data that has a similar statistical pattern to the original data. And that's the data you can share without violating any confidentiality rules.

And that is exactly what synthesized tabular data does. That's a new function released in 24B. And this reads tables, column by column. And it does some binning on the columns, even on categorical data. And you have some control over that. And as a result, new data is simulated, and it's created a new synthetic data set which you then can share.

Let's move into enterprise requirements. We've already moved a little bit into, let's say, more professional contexts. But if you're working in an organization, then oftentimes you need to deal with IT compliance rules. You want to operationalize applications effectively and compliant with best practices that your organization has established. And you want to effectively share tools.

And some of the best practices I want to highlight there. Let's start with testing. Best practices are that IT systems must be fully tested before they're deployed into production systems. That's one aspect. And it's not only the test itself. It's also the test documentation. So all test activities and test results must be fully documented and reported on.

And I want to highlight some MATLAB functionality. One is you can do actually testing with MATLAB. MATLAB provides a unit test framework with a rich set of tests to do functional tests on the code you've written. And you can also document the requirements you have on your code. So you can write the requirements down-- that's the screenshot on the left hand side-- and you can track.

Have you implemented that requirement? And did the test according to that requirement pass or fail? And so you have three angles. You have the MATLAB code itself. You have the requirements, and you have the code. And everything is very integrated. And you can do proper reporting on that framework, which is especially interesting when things get bigger and more complex.

And the second set of aspects is the deployment process itself. So best practices say that programs that are deployed into production shall be encrypted and shall not be subject to modifications outside the IT process. Second one is, you're supposed to segregate your environments. So have a separate development, testing, and production environment.

And the last one is user access control. Let only a defined set of people interfere with your IT system. And let only a defined set of people execute your application. And for that, our server products are a very good match. So you have MATLAB. And we have two compiler products-- the MATLAB Compiler and the Compiler SDK-- who cover exactly the first point-- the application encryption and the security because those encrypt your MATLAB application, and they create a package that matches your target.

So that could range from a simple executable file, an Excel add-in, or a Python package, or a .NET assembly. And that package can be hosted on one of the servers. So server is a piece of software like the production server that handles the applications that are sitting on that server. So it can deal with requests to execute that application.

And this enables-- if you create several instances of those servers, those instances could live in your test, in your development, and in your production environment. And you facilitate the segregation of environments. And the last one, the User Access Control, MATLAB facilitates usage of your favorite authentication protocols like Kerberos and LDAP. And those comply with those servers as well.

I want to show, before we move on to the next topic, two great examples of people using actually apps as part of their enterprise application. And I'm using two examples that have been presented at last year's conference. So one on the first, on the upper left hand side, you see the presentation or one of the slides from Amundi. And they show this nice little app that performs an interactive performance analysis framework.

And it's actually quite nice. I find it personally visually very appealing. It has a bunch of buttons that do something. It has dropdown menus, it has checkboxes. It's actually quite rich.

And equally nice on the lower right hand side, there's an application presented by Helaba Invest for generating data cubes for portfolio analysis and simulation. And it's also quite nice. And in addition to that, it has a bunch of tabs which you can navigate, and it's actually quite rich in functionality. Those videos to those presentations are available if you want to learn more about those applications.

Moving on to the final bit, coding excellence. So you want to do the best coding you can. You want to create fast applications. You want to be productive. You want to be transparent, and you want your applications to be highly usable.

On the performance side, there is now support, native support from Apple devices or the natively support now MATLAB. So if you're running an Apple device on an M-series chip, MATLAB is natively supported, and you will experience faster startup time, faster mathematics, and optimized battery usage. And we're quite proud of that. Also, Apple was quite excited about it. The even included it in last year's release event in October, which they called scary fast.

And the second one highlighting productivity is a new feature regarding the desktop. So MathWorks has introduced a JavaScript-based desktop. And with the release 2024b, this is now an open beta version, which means that you can all try it out.

MathWorks is going in that direction. You find it on File Exchange. It's very important to us. There's even a button in the desktop suggesting you to try it out by the click of a button.

And it's very convenient. It has features for you to provide feedback. It gives you previews of the upcoming features. You can provide feedback. Or if you see missing functionality, we're very interesting to hearing that.

And with that new JavaScript-m based technology, this opens up a variety of new things we can provide. So it's the dark mode. It's a very nice feature if you're used to using that.

It provides enhanced figure windows. And already in the pre-release you can see new side panels. For example, for source control, debugging, add-on management. And a lot more is coming in that space. So please try it out.

And the next one, which is also one of my favorite productivity features, is a tool, which is called Experiment Manager. And this is a tool for you to conduct numerical experiments. It is actually an app which you see here. So you can start a new project or create your own one.

So this is one of the shipping ones. You see a description of the project. And you see various parameter combinations that could go into your application. And the goal is to try out all of those defined parameter combinations. You can do that in parallel. You can do that sequentially. And MATLAB will go through all of those in a documented fashion.

It will not only document the execution speed, but it will also give you the results. And you're able to browse figures that you create on the way and compare and contrast different runs. So like that, you can easily identify your favorite parameter combination, which is the one you will then move forward with.

So essentially, it saves you from having paper and pencil next to your computer and writing down what you've done and what you're planning to do. And this helps you not only to become more productive, but also to become more transparent.

Next one in terms of transparency, but also in terms of usability is live scripts. So live scripts in the Live Editor. And that is an interactive environment for you to create human-readable scripts. So these are scripts that are executable, like normal MATLAB scripts are as well.

But you can include richly format text. And you can include code and the output of that code. And you see there are tables. There's equations, and there's many more.

You can also add interactive features, like hyperlinks or little sliders that if you choose a new parameter value with that slider, that section will automatically be executed using the new value. And you can see what changes that makes.

And you can share that, of course. You can share it with MATLAB users who have MATLAB. But if they don't, you can export the live script as a PDF file or as a Word file, for example. And finally, you can also share it now through GitHub.

Because this is another one of my favorite new features, you can now save those live scripts as marked-up text files. So there's an option where you have a live script. You save it, and you see the result on the right hand side.

This is the script in markup language. And that allows users not only to edit the code outside of MATLAB, but also to use in your favorite source control system, and do your different merge operations as you are used to doing that.

And with that, I'd like to thank you for your attention. And I hope I could give you some insights into how to access the best modeling technology out there. New ideas in terms of data management give you some confidence in complying with enterprise requirements and giving you some inspiration to do the best coding you can. Thank you.

View more related videos