Class TimeChangeProcess

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class TimeChangeProcess : public otyca::ModelBase

Abstract base class for time change processes.

A time change process is a mathematical model that modifies time or time steps in Levy processes. This class defines the interface for time change processes used in pricing and risk management.

Subclassed by otyca::AlphaStable, otyca::Gamma, otyca::InverseGaussian, otyca::LCIR, otyca::Poisson

Public Functions

virtual TimeChangeProcess *clone() const = 0

Clone the current TimeChangeProcess instance.

Returns:

A pointer to a newly allocated copy of the TimeChangeProcess object.

virtual arma::cx_mat laplace_transform(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi) const = 0

Compute the Laplace transform of the process.

The Laplace transform is applied to the time vector, along with Complex-valued column vector of Fourier arguments (u) and the characteristic exponent (psi), to produce the characteristic function (phi).

Parameters:
  • t – The time vector for which the Laplace transform is computed.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

Returns:

The resulting Laplace-transformed characteristic function.

virtual arma::cx_mat d_phi_d_psi(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi) const = 0

Compute the derivative of the Laplace transform with respect to psi.

This method calculates the derivative of the characteristic function phi with respect to the characteristic exponent psi, and stores the result in d_phi_d_psi.

Parameters:
  • t – The time vector for which the Laplace transform is computed.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

Returns:

The matrix to store the derivative of the Laplace transform with respect to psi.

virtual std::vector<arma::cx_mat> d_phi_d_p(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi) const = 0

Compute the derivative of the Laplace transform with respect to parameters.

This method computes the derivative of the Laplace transform with respect to its parameters and stores the result in d_phi_d_params.

Parameters:
  • t – The time vector for which the Laplace transform is computed.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

Returns:

The vector to store the derivatives with respect to parameters.

virtual arma::cx_mat d_phi_d_psi_finite_difference(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi, double h = 1e-6) const

Compute the derivative of the Laplace transform with respect to psi using finite differences.

This method approximates the derivative of the Laplace transform with respect to psi using finite differences.

Parameters:
  • t – The time vector for which the Laplace transform is computed.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

  • h – The step size for finite differences (default: 1e-6).

Returns:

The finite difference approximation of the derivative of characteristic function with respect to psi.

std::vector<arma::cx_mat> d_phi_d_p_finite_difference(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi, double h = 1e-6) const

Compute the derivative of the Laplace transform with respect to parameters using finite differences.

This method approximates the derivative of the Laplace transform with respect to parameters using finite differences.

Parameters:
  • t – The time vector for which the Laplace transform is computed.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

  • h – The step size for finite differences (default: 1e-6).

Returns:

A vector that contains the finite difference approximations of the derivatives of characteristic function with respect to parameters.

bool compare_d_phi_d_p(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi, double h = 1e-6, double tolerance = 1e-6) const

Compare the derivative of the Laplace transform with respect to parameters against a finite difference approximation.

This method checks if the analytical derivative of the Laplace transform with respect to parameters matches the finite difference approximation within a specified tolerance.

Parameters:
  • t – The time vector for which the Laplace transform is computed.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

  • h – The step size for finite differences (default: 1e-6).

  • tolerance – The tolerance for comparison (default: 1e-6).

Returns:

true if the derivatives are within the tolerance, false otherwise.

bool compare_d_phi_d_psi(const arma::rowvec &t, const arma::cx_colvec &u, const arma::cx_colvec &psi, double h = 1e-6, double tolerance = 1e-6) const

Compare the derivative of the Laplace transform with respect to psi against a finite difference approximation.

This method checks if the analytical derivative of the Laplace transform with respect to psi matches the finite difference approximation within a specified tolerance.

Parameters:
  • t – The time vector.

  • u – Complex-valued column vector of Fourier arguments.

  • psi – The characteristic exponent.

  • h – The step size for finite differences (default: 1e-6).

  • tolerance – The tolerance for comparison (default: 1e-6).

Returns:

true if the derivatives are within the tolerance, false otherwise.