# Runnable examples

Run the Python file directly or compile the TypeScript file with the repository
compiler. Both examples show the nominal return, uncertainty penalty, robust
return, variance, and convergence certificate separately.

## Reproduce locally

Run these commands from this topic folder. Python 3.10+ uses only its standard library.

```bash
python examples/python_example.py
python -m unittest discover -s tests -p "test_*.py"
```

For TypeScript, use the repository's installed compiler and Node.js. The explicit-source command below uses the installed TypeScript 7.0.2 compiler's `--ignoreConfig` option:

```bash
node ../../../../../node_modules/typescript/bin/tsc --ignoreConfig --target ES2022 --module NodeNext --moduleResolution NodeNext --types node --strict --skipLibCheck --outDir .build examples/typescript_example.ts
node .build/examples/typescript_example.js
```

The Python/TypeScript fixture values and regression cases are shared. Use `status` and residuals before interpreting an iterative result. The lab embeds the compiled canonical TypeScript calculation and needs no server or network to compute.
