Writing

Long-form writing and technical explanations.

Browse by topic

Quantitative Finance

Computer Science

Other

Showing 153 pieces.

  1. The December Fed Meeting: What to Watch

    The December Fed meeting is today! Despite the worrying lack of data, the market is confident that rates will be cut by 25 bps, with the FedWatch tool giving a 87.6% chance for a c…

  2. Why 50-Year Mortgages Fall Short

    Federal Housing Finance Agency director Bill Pulte recently floated a big potential change to the mortgage market: 50 year mortgages. Unfortunately, these aren’t realistic.

  3. The Case for Structured Errors in Rust

    I found this article on structured errors insightful. Although it is focused on Rust, the explanations of the direct benefits of encoding information about the failure surface of c…

  4. Counterparty Risk-Weighted Assets

    The risk-weighted-assets notes translate counterparty exposure into a capital calculation. The exposure-at-default measure is combined with a risk weight or a model-based capital r…

  5. Multi-Name Credit Risk

    This is going to be a basic introduction, this is a complex topic to cover comprehensively.

  6. Neural Networks and Credit Ratings

    This is an idea that was created in the 50s, exploded in the 90s, where it was called neural networks. A lot of development on the brain happened, so ANN was a term to distinguish …

  7. XVA and Counterparty Risk

    The XVA section adds counterparty and funding effects to an otherwise clean derivative value. CVA is the expected loss from counterparty default on positive exposure; FVA captures …

  8. Credit Default Swap Valuation

    We discussed the mechanics of CDS a bit, and then started on the valuation. So let’s discuss the valuation in more details.

  9. CDS and Credit Markets

    The FE-635 syllabus turns to credit as a traded asset through credit default swaps. A CDS exchanges a premium leg for protection against a defined credit event. The buyer pays the …

  10. Midterm Cheat Sheet

    Handwritten midterm reference for quadrature and Black-Scholes notation; several formulas are unclear in the source render.

  11. GARCH Risk Statistics

    The risk-statistics portion of FE-635 introduces GARCH as a way to model time-varying volatility. Returns may have little serial correlation while their squared returns cluster: ca…

  12. Short-Rate Calibration and HJM

    We’ll look specifically at Vasicek and CIR. Then we will make some remarks on the Hull-White two factor model, then some more complex model.

  13. FX Volatility Smiles and Uncertainty

    The next FE-635 notes explain why a single Black–Scholes volatility is not enough for an FX market. Discrete hedging creates P&L even when the model's inputs are correct, and volat…

  14. Finite-Difference Sketches

    A handwritten finite-difference sketch with A/B/C labels; surrounding equation notation is unclear in the source render.

  15. FX Discrete Hedging and Greeks

    The FE-635 notes move from an ideal continuous hedge to the discrete hedges used in practice. A delta hedge removes the first-order response to an FX move at one instant; between r…

  16. Black–Scholes Pricing for FX

    The FE-635 workbook implements Black–Scholes-style pricing for calls, puts, forwards, and deposits. Its inputs separate the domestic discount rate from the foreign rate, because an…

  17. Interest Rate Adjustments and Currency Swaps

    We may have to make some adjustments when we value interest rate derivatives. These are convexity, timing, and quant adjustments. We will see when it is appropriate to make these a…

  18. FX Parity and Forward Trading

    The FE-635 notes begin with the distinction between spot and forward FX. The forward rate is the exchange rate implied by borrowing in one currency, lending in the other, and carry…

  19. Yield Curves and Bootstrapping

    We started to look at interest rates. In the first part we’re going to discuss various interpolation methods, functions that are useful for modeling the yield curve.

  20. The Cost of Transit Delays

    As a frequent user of public transit, I know how impactful delays are both on my productivity and my mental health. Being stuck in Secaucus Junction because of some nonsense happen…

  21. Exotic Options

    The final FE-610 notes apply the earlier stopping-time and maximum results to path-dependent payoffs. A barrier option depends on whether the underlying crosses a level before expi…

  22. Options and Volatility

    The final FE-535 notes turn to nonlinear risk through options. An option's payoff is convex, so a small change in the underlying can have a different effect depending on where the …

  23. Hedging Bonds

    The bond-hedging lab combines duration, futures, and forward positions. A portfolio can be made locally insensitive to a yield move by matching its dollar duration with an offsetti…

  24. Rust 1.83 Brings More `const`

    A happy Thanksgiving to all! Today, in addition to my loved ones, I'm grateful for a brand-new version of Rust, now with more const! const evaluation is one of the most important s…

  25. Poisson Processes

    The FE-610 notes introduce Poisson processes as counting processes with independent increments and a constant arrival intensity. For a rate \(\lambda\), the number of arrivals by t…

  26. Linear Hedging

    The linear-risk notes approximate a portfolio's change by its sensitivities to risk factors. A hedge chooses positions whose factor exposures offset the portfolio's exposures, ofte…

  27. Multidimensional Market Models

    The multidimensional market model in the FE-610 notes has several stocks driven by several Brownian factors. Prices, drifts, volatilities, and correlations become vectors and matri…

  28. Risk-Neutral Valuation and Interest Rate Parity

    The risk-neutral valuation notes use a pricing measure under which discounted tradable prices are martingales. The expected payoff is discounted at the funding rate rather than for…

  29. Joint and Conditional Distributions

    The final FE-540 notes work with a joint law rather than treating each variable in isolation. A conditional density is obtained by normalizing the joint density with the relevant m…

  30. Forward Contracts

    The forward-contract notes build value from replication. A forward fixes the delivery price today, while the underlying can be financed or invested until maturity. The forward pric…

  31. Risk-Neutral Measures

    The risk-neutral section motivates a change of measure rather than assuming investors literally expect the risk-free rate. Discounted tradable prices should be martingales under a …

  32. Random Vectors and Independence

    The later FE-540 notes package several random variables into a random vector, such as \(X=(X_1,X_2)\). The joint distribution records probability over rectangles and more general s…

  33. Derivatives and Clearinghouses

    The derivatives notes frame a contract as a way to move or reshape risk. Futures and standardized options trade through a clearinghouse, while bilateral contracts expose each party…

  34. Stochastic Calculus Review

    The FE-610 review consolidates the first half of the course: probability spaces and filtrations, martingales, Brownian motion, quadratic variation, the Itô integral, Itô's formula,…

  35. Student's t and Heavy-Tailed Distributions

    After the gamma and beta families, the FE-540 notes turn to Student's \(t\) distribution and other shapes used when observations are more extreme than a Gaussian model suggests. St…

  36. Interest Rate Risk and Duration

    The interest-rate-risk notes approximate how a bond portfolio changes when yields move. Duration is the first-order sensitivity of price to yield; convexity captures the curvature …

  37. Multidimensional Itô Calculus

    When several state variables move together, the FE-610 notes replace the scalar Itô formula with its multidimensional version. The Hessian term contains both variances and cross-va…

  38. Gamma, Beta, and Chi-Squared Distributions

    The FE-540 distribution notes connect several continuous families through the gamma function. The chi-squared family is a gamma distribution with parameters \(n/2\) and \(1/2\), wh…

  39. Black–Scholes

    The Black–Scholes notes start with a stock following geometric Brownian motion,

  40. Probability and Regression Review

    The first-exam review returns to probability, conditional expectation, and regression. A risk estimate is a conditional statement: it depends on the information set, the horizon, a…

  41. Bonds and the Time Value of Money

    The bond material in the FE-535 notes treats a fixed-coupon bond as a stream of future cash flows. Discounting those cash flows gives its present value, and the yield is the consta…

  42. Itô Calculus

    Itô's formula is the stochastic analogue of the multivariable chain rule. If

  43. Stochastic Integrals

    The FE-610 notes define an integral such as \(\int_0^T\Delta_t\,dW_t\) by starting with simple adapted processes. On each partition interval, the position \(\Delta_t\) is chosen fr…

  44. Brownian Motion

    Brownian motion is the continuous limit of a scaled symmetric random walk. Its increments are independent and normally distributed, with \(W_t-W_s\sim N(0,t-s)\). It is a martingal…

  45. Brownian Motion and Geometric Growth

    The stochastic-process notes move from a random walk to Brownian motion and then to geometric Brownian motion. Brownian increments are normally distributed with variance proportion…

  46. Martingales and Random Walks

    The FE-610 notes describe a martingale as an adapted process whose conditional expected future value equals its current value:

  47. Monte Carlo Risk Simulation

    The FE-535 lab notes use Monte Carlo methods to turn a model for returns into a distribution of portfolio outcomes. Simulate the relevant risk factors, revalue the portfolio on eac…

  48. Random Variables and CDFs

    The FE-540 notes define a random variable as a measurable function from the original sample space to the real line. Measurability means that inverse images of Borel sets are events…

  49. Probability Spaces and Filtrations

    FE-610 begins with the probability-space machinery needed for continuous-time finance. The notes revisit sigma-algebras and probability measures, then add a filtration \((\mathcal …

  50. Risk-Adjusted Performance

    The performance notes compare return with the risk taken to earn it. The Sharpe ratio uses excess return divided by volatility, while beta measures sensitivity to a common market f…

  51. Probability Measures and Bayes' Rule

    A probability measure \(\mathbb P\) assigns a number in \([0,1]\) to every event in \(\mathcal F\). The notes begin with \(\mathbb P(\Omega)=1\) and countable additivity for disjoi…

  52. Risk Measurement and Portfolio Construction

    FE-535 opens by separating the risk-management process from a single risk number: identify exposures, measure them, evaluate the result, and decide how the portfolio should be cons…

  53. Probability Spaces

    The first step in the FE-540 notes is to give random experiments a mathematical home. A probability space is a triple \((\Omega,\mathcal F,\mathbb P)\): \(\Omega\) is the sample sp…

  54. Floating Point Architecture

    Floating point numbers are complicated enough in the abstract. How do systems programmers and hardware designers cope with the complexity of floating point?

  55. IEEE-754

    IEEE-754 is the standard for floating point computation around the world. Thus, any real-world discussion of floating point must include it.

  56. Floating Point

    Floating point representation is a complex topic full of nuance. To understand it, we must focus on the abstract method used to represent non-integer numbers.

  57. Network Security

    The internet has taken over the world, but with it have come malicious actors. People want to spy on you, scam you, steal from you, or harm you through the internet. Through networ…

  58. A Crash Course in Python

    Python is a powerful jack-of-all-trades language that is much less limited than OCaml.

  59. Disks

    Persistent storage is essential to every system that we can think of, and we can hardly think of a computer without it. However, managing disks is not as simple as it might appear …

  60. Particles

    Tiny particles are affected in different ways than we are by waves. There are several different effects that must be discussed.

  61. Multimedia Networking

    Streaming multimedia is a relatively new concept in internet technology, but now has become central to the daily media consumption of people around the world.

  62. Control in Prolog

    Conditional statements are very powerful and are in used in almost every language. How does Prolog implement the same idea?

  63. Special Relativity

    Albert Einstein revolutionized the world of physics when he discovered the special theory of relativity. It is only possible due to his contributions that valuable technologies lik…

  64. Waves

    Light is curious because it is both a particle and a wave, which makes it behave strangely in certain contexts. When projected through a slit, some strange fringes will appear, whi…

  65. The Link Layer

    Through all the layers of the internet, the most essential is the link layer: converting bits to and from signals, detecting errors, flow control, and addressing.

  66. Prolog

    Prolog is a special programming language that is not like many others. It exemplifies the paradigm of logic programming.

  67. Threads

    Concurrency is a powerful tool to increase performance in applications. This is usually accomplished using threads.

  68. Routing Algorithms

    When a host needs to find the best destination/prefix to another host, what routing algorithm does it use? We can use either intra or inter domain.

  69. Swapping

    Sometimes we don't have a lot of memory to access. In those cases, we need a place to put our data. The natural solution is to put data in the disk, which has very high storage. Th…

  70. Routers

    Everyone nowadays gets the Internet through the router in their home. But what is a router?

  71. Mirrors

    Mirrors can interact with light in interesting ways. In fact, reflection and refraction are probably most people's engagement with laws of physics surrounding light in their daily …

  72. Lambda Calculus

    When we discuss the principles of programming languages, lambda calculus is the bedrock of our discussion. It is the most abstract, formal way to describe functions and application…

  73. More Internet Protocols

    Besides the primary Internet protocols, there are some others to learn about, like DHCP, NAT, IPv6, etc.

  74. Electromagnetic Waves

    We have discussed electric fields and magnetic fields, and the way that they change and interact. The full interaction of these fields will create electromagnetic waves, the study …

  75. ISP Addressing

    How does an ISP assign IP addresses to its customers?

  76. Currying Arguments in a Function

    Currying is the concept of having multiple arguments in a function. OCaml defaults to currying its functions. int - int - int is a function that takes two ints and returns an int.

  77. HTTP Explained

    HTTP is probably the most visible Internet protocol to end users. It appears (as well as its cousin, HTTPS) at the beginning of every URL we use to access the internet. But how doe…

  78. Paging

    The main problem that segments have introduced to managing memory space is that their variable size wastes memory through fragmentation. Fixed-size pieces that are easier to handle…

  79. TCP Explained

    TCP is the well-known protocol for reliable transfer of data. But how does it actually work?

  80. Electromagnetic Induction

    The final piece to the puzzle of electromagnetism here is electromagnetic induction, where we use magnets to create current.

  81. Data Types in OCaml

    When we make our programs more and more complex, we need more complex data types as well. We have only used OCaml's built-in data types, how can we construct our own data types?

  82. Operational Semantics

    What are the formal semantics of how a programming language works, mathematically? That's a broad topic. Operational semantics, which are how programs execute, are narrow enough fo…

  83. Tail Recursion in OCaml

    Recursion in many languages can cause significant overhead. It might seem that the excess amount of recursion in OCaml would decrease its performance. But it actually doesn't, and …

  84. UDP Explained

    The simplest transport protocol that is used communicate between sockets is known as UDP, the User Datagram Protocol.

  85. Magnets

    The question of how magnets work has [long puzzled many](https://www.youtube.com/shorts/8bhYMnHb5JY). We will endeavor to answer all of those questions today.

  86. SMTP Explained

    Email is the most popular way in the world to send large messages. This is a complicated process which requires its own protocol: SMTP.

  87. Higher Order Functions in OCaml

    We can do a lot of cool things with functions besides calling them in OCaml.

  88. FTP Explained

    Before we had Google Drive, users needed a way to access files from other people quickly and easily. The method for that was FTP.

  89. Memory Virtualization

    Accessing physical memory can cause big issues if we do it directly. How can we virtualize the memory like the CPU so we can use it efficiently and safely?

  90. Lets, Tuples, and Records in OCaml

    Lists are the most basic data structure in OCaml, but there are others that we need to be aware of.

  91. Circuits

    Circuits are the method by which all electricity travels throughout the world and power every single device in existence. It is therefore crucial to understand them while understan…

  92. DNS Explained

    We need protocols to define the way that messages are interpreted.

  93. Packet Switching vs Message Switching

    How do we get the best performance in sending information over the internet? What is packet switching and how can it help? Performance is bottlenecked by propagation delay and tran…

  94. Scheduling

    The way that the operating system decides which processes to run and when is a complicated process known as scheduling. This is how it works.

  95. Lists in OCaml

    Lists are the most basic data structure in OCaml. The most analoguous structure is a vector in C++ or Rust. Lists are homogenous and of arbitrary length.

  96. Electric Potential

    Besides electrical charge and field, there's another force that is relevant to electricity: electric potential.

  97. Functions in OCaml

    A function takes arguments, performs operations using them, and returns a value. In OCaml, we can write functions like so

  98. Electrostatics

    What is electricity, and how does it work?

  99. CPU Virtualization

    We need a way to map on to the physical CPU through our operating system. We do this through virtualization.