RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • bayesopt
    • classify
    • confusionmat
    • crossvalind
    • cvpartition
    • fitclinear
    • fitctree
    • fitlm
    • kmeans
    • knnsearch
    • lasso
    • lassoglm
    • linkage
    • lscov
    • mnrfit
    • optimizableVariable
    • pdist
    • pdist2
    • perfcurve
    • predict
    • regress
    • ridge
    • squareform
    • test
    • training
    • tsne

bayesopt — Run deterministic Bayesian optimization over optimizableVariable metadata.

bayesopt(fun, vars, Name, Value) evaluates a scalar objective over optimizableVariable metadata and returns a BayesianOptimization compatibility object.

Syntax

results = bayesopt(fun, vars, Name, Value)

How bayesopt works

  • The objective is called as fun(X), where X is a one-row table with one column per optimizable variable.
  • Supports real, integer, and categorical optimizableVariable objects, including Transform='log' for valid numeric ranges and Optimize=false fixed variables.
  • Uses deterministic low-discrepancy seed points followed by a Gaussian-process surrogate with expected-improvement-style acquisition for reproducible in-memory optimization loops.
  • Finite integer/categorical search spaces terminate cleanly when all unique candidate points have been exhausted before MaxObjectiveEvaluations.
  • Name-value support includes MaxObjectiveEvaluations, NumSeedPoints, AcquisitionFunctionName, ExplorationRatio, IsObjectiveDeterministic, Verbose, UseParallel=false, empty PlotFcn/OutputFcn, and XConstraintFcn logical feasibility filters.
  • The objective may return a scalar objective value or a struct with Objective and optional ConstraintViolations fields. Constraint violations less than or equal to zero are feasible.
  • The result object exposes XTrace, ObjectiveTrace, ObjectiveMinimumTrace, ObjectiveEvaluationTimeTrace, FeasibilityTrace, OptimizationTrace, XAtMinObjective, MinObjective, BestPoint, BestObjective, VariableDescriptions, Options, Output, ExitFlag, and surrogate metadata.
  • Warm starts, conditional variables, plotting/output callbacks, parallel evaluation, GPU-resident optimization, datastore-backed objectives, and multi-output result forms remain outside this slice and raise explicit compatibility errors.

GPU memory and residency

bayesopt is a host control-flow solver. It gathers variable metadata and option inputs before evaluation, rejects UseParallel=true, and does not run objective scheduling or surrogate updates on a GPU provider.

Examples

Minimize a scalar objective over two real variables

x = optimizableVariable('x',[-1 1]);
y = optimizableVariable('y',[-1 1]);
results = bayesopt(@objective, {x y}, 'MaxObjectiveEvaluations', 24, 'NumSeedPoints', 6)

Expected output:

results is a BayesianOptimization compatibility object with trace tables and the best observed point.

Filter candidates with an XConstraintFcn

x = optimizableVariable('x',[-1 1]);
results = bayesopt(@objective, x, 'XConstraintFcn', @isFeasible)

Expected output:

Only rows for which isFeasible(X) returns true are evaluated by the objective.

Using bayesopt with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how bayesopt changes the result.

Run a small bayesopt example, explain the result, then change one input and compare the output.

Related Stats functions

Ml

classify · confusionmat · crossvalind · cvpartition · fitclinear · fitctree · fitlm · kmeans · knnsearch · lasso · lassoglm · linkage · lscov · mnrfit · optimizableVariable · pdist · pdist2 · perfcurve · predict · regress · ridge · squareform · test · training · tsne

Summary

binocdf · boxplot · cdf · cdfplot · chi2cdf · corr · corrcoef · corrcov · cov · cov2corr · dummyvar · ecdf · filloutliers · fitdist · geomean · grpstats · harmmean · icdf · isoutlier · kstest · kurtosis · lsline · mad · mode · nanmax · normalize · normcdf · norminv · normpdf · onehotdecode · onehotencode · pdf · prctile · quantile · refline · rmse · skewness · tabulate · tcdf · tiedrank · tinv · tpdf · ttest2 · wblinv

Random

binornd · bootstrp · datasample · dividerand · exprnd · gamrnd · lhsdesign · mvnrnd · normrnd · random · randsample · rng · trnd · unidrnd · unifrnd · wblrnd

Hist

histc · histcounts · histcounts2

Options

statget · statset

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • How bayesopt works
  • GPU memory and residency
  • Examples
  • Minimize a scalar objective over two real variables
  • Filter candidates with an XConstraintFcn
  • Using bayesopt with coding agents
  • Related Stats functions
  • Ml
  • Summary
  • Random
  • Hist
  • Options
  • About RunMat