test_inhomogeneousGeometricBrownianMotion

Unit test for the InhomogeneousGeometricBrownianMotion (IGBM) MuJoCo dynamics base class.

IGBM is the Ito SDE

dX_t = (mu - X_t)/tau dt + sigma X_t dW_t

with mean-reverting drift and multiplicative diffusion. For mu > 0 and X_0 > 0 the process stays strictly positive. Like MeanRevertingNoise, the class is configured in stationary form (mean mu, time constant tau, stationary std sigma_st); the SDE volatility sigma is derived internally so that the stationary distribution has exactly

E[X_inf] = mu Std[X_inf] = sigma_st

The test integrates a single long path with the strong Euler-Maruyama integrator (started at the stationary mean) and checks the empirical time-average mean and variance against those configured values. A single long ergodic path is used rather than a Monte Carlo ensemble so the test stays cheap while still exercising the drift, the multiplicative diffusion, and the positivity of the process.

test_inhomogeneousGeometricBrownianMotion.test_inhomogeneousGeometricBrownianMotion(showPlots: bool = False)[source]

Verify IGBM reproduces the analytic stationary mean and variance, and stays positive.

test_inhomogeneousGeometricBrownianMotion.test_inhomogeneousGeometricBrownianMotion_rejectsBadParameters()[source]

The parameter setters reject values outside their valid range.

test_inhomogeneousGeometricBrownianMotion.test_inhomogeneousGeometricBrownianMotion_rejectsNonPositiveState()[source]

setStateValue must reject a non-positive initial state: the multiplicative process is only well-posed from a positive state.