Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appendix d #16

Merged
merged 13 commits into from
Dec 6, 2023
14 changes: 0 additions & 14 deletions .vscode/settings.json

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ pip install ref_gsd

```python
import gsd
gsd.fit_mle([2,8,2,0,0.])

gsd.fit_moments([2, 8, 2, 0, 0.])
```

## Development
Expand Down
37 changes: 31 additions & 6 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,52 @@ Distribution functions implemented in JAX for speed and auto differentiation.
__Currently, we support only GSD with 5 point scale__

::: gsd.log_prob

---

::: gsd.sample

---

::: gsd.mean

---

::: gsd.variance

---

::: gsd.sufficient_statistic


## Fit

We provide two estimators.
The simple one based on moments and the maximum likelihood estimator.

::: gsd.fit_mle
We provide few estimators. The simple one is based on moments.
A more advanced gradient-based estimator maximum likelihood estimator is
provided in `gsd.experimental`. We also provide a naive grid search MLE.
Besides the high-level API one can use optimizers form `scipy` or `tensorflow_probability`.

::: gsd.fit_moments

## Structures

### Constrained parameter space

:::gsd.fit.log_pmax

:::gsd.fit.allowed_region




### Structures


::: gsd.fit.GSDParams

::: gsd.fit.OptState

## Experimental

::: gsd.experimental



Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ pip install ref_gsd

```python
import gsd
gsd.fit_mle([2,8,2,0,0.])

gsd.experimental.fit_moments([2, 8, 2, 0, 0.])
```

## Development
Expand Down
152 changes: 76 additions & 76 deletions examples/colab.ipynb
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/gsd-authors/gsd/blob/main/examples/colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Info\n",
"\n",
"This is template notebook experiments with GSD in colab."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "lIYdn1woOS1n"
},
"outputs": [],
"source": [
"!pip install ref_gsd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kSQYyYzg0MWk"
},
"outputs": [],
"source": [
"import gsd\n",
"print(gsd.__version__)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "xJLHCZdl0NW4"
},
"outputs": [],
"source": [
"gsd.gsd_prob(4.,0.8,2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gsd.fit_mle([2,8,2,0,0.])"
]
}
],
"metadata": {
"colab": {
"include_colab_link": true,
"name": "scratchpad",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/gsd-authors/gsd/blob/main/examples/colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
"nbformat": 4,
"nbformat_minor": 0
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Info\n",
"\n",
"This is template notebook experiments with GSD in colab."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "lIYdn1woOS1n"
},
"outputs": [],
"source": [
"!pip install ref_gsd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kSQYyYzg0MWk"
},
"outputs": [],
"source": [
"import gsd\n",
"print(gsd.__version__)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "xJLHCZdl0NW4"
},
"outputs": [],
"source": [
"gsd.gsd_prob(4.,0.8,2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gsd.fit_moments([2,8,2,0,0.])"
]
}
],
"metadata": {
"colab": {
"include_colab_link": true,
"name": "scratchpad",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Loading