{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Create a design of experiments with discrete and continuous variables" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this example we present how to create a design of experiments when one (or several) of the marginals are discrete." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from __future__ import print_function\n", "import openturns as ot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To create the first marginal of the distribution, we select a univariate discrete distribution. Some of them, like the `Bernoulli` or `Geometric` distributions, are implemented in the library as classes. In this example however, we pick the `UserDefined` distribution that assigns equal weights to the values -2, -1, 1 and 2." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
v0 | |
---|---|
0 | -2.0 |
1 | -1.0 |
2 | 1.0 |
3 | 2.0 |