Reproducing experiments from "Non-parametric Models for Non-negative Functions" (arxiv).
This repo was tested with Julia 1.12.1. After cloning the repo, instantiate the environment.
In the shell:
julia --project
# press `]` to enter `(SOSKernels) pkg>` mode.
instantiate
This will install all required packages. An unfortunate dependency is MOSEK; open source tools like Clarabel simply don't work for these problems. Follow the link to request a free academic license.
Consider iid calibration samples
where
The maximum likelihood estimator (with regularization) is:
We can easily model the integral constraint using our SOS model. To handle the product in a tractable way, we take the log likelihood:
To run from the Julia REPL:
include("experiments/density_estimation.jl")The model is, in general, quite sensitive to the choice of kernel (and regularization) parameters. For example:
![]() |
![]() |
![]() |
Note that I had to manually tune the regularization term. The
Opportunity: a better way to set kernel parameters.
TODO: compare with classical density estimation (Glivenko-Cantelli)


