Serving the Quantitative Finance Community

  • 1
  • 4
  • 5
  • 6
  • 7
  • 8
 
User avatar
Cuchulainn
Posts: 22924
Joined: July 16th, 2004, 7:38 am

Re: Is the type of mathematics found in finance limited?

March 20th, 2025, 9:36 am

Is physics "better" than maths in this context?
Some believe that PINNs (physics informed NNs) are the new wave.
 
User avatar
Cuchulainn
Posts: 22924
Joined: July 16th, 2004, 7:38 am

Re: Is the type of mathematics found in finance limited?

March 23rd, 2025, 1:07 pm

Is physics "better" than maths in this context?
Some believe that PINNs (physics informed NNs) are the new wave.
EBMs are 20 years old: https://cs.nyu.edu/~yann/research/ebm/
AI scientists love claiming that they invented this. More word inflatiion. BTW, IHTLA
Lagrange, Hamilton et al did this stuff for breakfast.

AI Rulez: every so often, come up with a new buzzword.
Last edited by Cuchulainn on March 23rd, 2025, 1:24 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 22924
Joined: July 16th, 2004, 7:38 am

Re: Is the type of mathematics found in finance limited?

March 23rd, 2025, 1:18 pm

Speaking of Lagrange, this article shows how to do constrained optimisation usi g ODE solvers.
I wrote a prototypical framework in C++20 to model this. See 101 example. Someone should write a Boost lib.

// Problem is
// 
// (1) min f(x,y) = abs(x-2) + abs(y-2)
// 
// subject to
// 
// (2) g(x,y) = x - y*y >= 0 (inside a parabola) 
// (3) h(x,y) = x*x + y*y - 1 = 0 (on circumference of a circle)
// 
// Write (2) using slack variables
// 
//   (2) g(x,y,z) = x - y*y - z*z = 0 (z is a slack variable)
// 
// (in C++ code, g == g1, h == g2).
// 
// Use Lagrange multipliers and minimise Energy
// 
// Energy(x,y,z;lambda1, lambda2) = f(x,y) + lambda1*g1(x,y,z) + lambda2*g2(x,y,z)
#include <cmath>
#include <vector>
#include <boost/numeric/odeint.hpp>

using value_type = double;
using state_type = std::vector<value_type>;

struct FiaccoOde
{ // Boost C++ odeint library used

 FiaccoOde() {}

 void operator()(const state_type& input, state_type& dxdt, value_type  t)
 { // ODE based on minimisation problem

 value_type x = input[0]; value_type y = input[1]; value_type z = input[2];
 value_type lambda1 = input[3]; value_type lambda2 = input[4];

 // Transform (0, infinity to (0,1)
 double tmp = (1.0 - t);

 auto g1 = [](double x, double y, double z) {return x - y * y - z * z;};
 auto g2 = [](double x, double y, double z) {return x* x + y * y - 1.0;};

 // Compute gradients of f = abs(x-2) + abs(y-2)
 double fx = 1.0; double fy = 1.0; double fz = 0.0;
 if (x < 2.0) fx = -1.0; if (y < 2.0) fy = -1.0;

 // Exact gradient of constraint functions
 // g1(x,y,z) = x - y^2 - z^2 = 0 // z is slack variable
 double g1x = 1.0; double g1y = -2.0 * y; double g1z = -2.0 * z;
 // g2(x, y, z) = x ^ 2 + y ^ 2 - 1 = 0
 double g2x = 2.0 * x; double g2y = 2.0 * y; double g2z = 0.0;

 // Equation (12) of Barr and Platt; notice the signs
 dxdt[0] = -(fx + lambda1 * g1x + lambda2 * g2x) / (tmp * tmp);
 dxdt[1] = -(fy + lambda1 * g1y + lambda2 * g2y) / (tmp * tmp);
 dxdt[2] = -(fz + lambda1 * g1z + lambda2 * g2z) / (tmp * tmp);
 dxdt[3] = g1(x, y, z) / (tmp * tmp);
 dxdt[4] = g2(x, y, z) / (tmp * tmp);
 }
};

value_type f(value_type x, value_type y)
{ // f() is not a functions of the slack variable z

 return (x - 2) * (x - 2) + (y - 2) * (y - 2);
}

int main()
{
 namespace Bode = boost::numeric::odeint;

 // Initial condition
 value_type L = 0.0;
 value_type T = 0.9995;
 value_type dt = 0.1051001001;
 FiaccoOde ode;

 // 5-d space: x,y,z and 2 Lagrange multipliers
 state_type x = { 1,1,1,1,1 }; // the state, vector of 1 element (scalar problem)
 std::size_t steps = Bode::integrate(ode, x, L, T, dt);
 std::cout << "Number of steps Cash Karp 54: " << std::setprecision(16) << steps
 << "\napproximate: " << x[0] << ", " << x[1] << ", " << x[2] << '\n';

 std::cout << "Function value: " << std::setprecision(8) << f(x[0], x[1]) << '\n';

 x = { 1,1,1,1,1 };
 Bode::bulirsch_stoer<state_type, value_type> bsStepper; // O(variable), controlled stepper
 steps = Bode::integrate_const(bsStepper, ode, x, L, T, dt);
 std::cout << "Number of steps Bulirsch-Stoer: " << steps << ", exact: " << ", approximate: " <<
 x[0] << ", " << x[1] << "," << x[2] << ", " << x[3] << ", " << x[4] << '\n';

 std::cout << "Function value: " << std::setprecision(8) << f(x[0], x[1]) << '\n';
}
Attachments
barr and platt.pdf
(695.59 KiB) Downloaded 8 times
 
User avatar
bearish
Posts: 5906
Joined: February 3rd, 2011, 2:19 pm

Re: Is the type of mathematics found in finance limited?

March 24th, 2025, 1:50 am

No, I’m afraid this was viewed as just another windmill
 
User avatar
Cuchulainn
Posts: 22924
Joined: July 16th, 2004, 7:38 am

Re: Is the type of mathematics found in finance limited?

March 24th, 2025, 4:46 pm


EBMs are 20 years old: https://cs.nyu.edu/~yann/research/ebm/
AI scientists love claiming that they invented this. More word inflatiion. BTW, IHTLA
Lagrange, Hamilton et al did this stuff for breakfast.

AI Rulez: every so often, come up with a new buzzword.
You got me fooled here! For a moment I thought you were actually interested in the subject.
Look, if I argue with you. I must take a contrary position.
 
User avatar
Cuchulainn
Posts: 22924
Joined: July 16th, 2004, 7:38 am

Re: Is the type of mathematics found in finance limited?

March 24th, 2025, 11:56 pm

Full on contrarianism is boring. So predictable.
Not necessarily. I could be arguing in my spare time
 
User avatar
Cuchulainn
Posts: 22924
Joined: July 16th, 2004, 7:38 am

Re: Is the type of mathematics found in finance limited?

March 26th, 2025, 1:16 pm

Still boring
I'm sorry, but I'm not allowed to argue anymore.
 
zebedeem
Posts: 14
Joined: May 20th, 2025, 7:03 am

Re: Is the type of mathematics found in finance limited?

May 24th, 2025, 9:42 am

My maths background is as a modeller.
So is mine. Due to Covid I developed a minimal epidemic model which, of course, doesn't grow exponentially. i.e. Doesn't break the laws of Maths.
And obviously I've complained about the accuracy of these models as well.
I found those complaints informative and had a think. I asked myself "What about affine returns?"
What maths do we see? Martingales, Monte Carlo simulations, and the same linear diffusion equation, with the occasional trivial integral equation. Ad nauseam.
Have you ever seen the ugly swan that is the logit-normal distribution? With affine returns I get a mixture distribution that is the sum of the log-normal and, what looks like, a scaled logit-normal. It certainly appears to be fat tailed. Click here for a slide show of growth curves fitted to the noise of S&P 500 stocks and a link to the paper.