## models.QuantileFit


A fitted quantile regression, from [QuantileRegression.fit](models.QuantileRegression.md#prospicio.models.QuantileRegression.fit).


Usage

``` python
models.QuantileFit()
```


## Attributes

| Name | Description |
|----|----|
| [bandwidth](#bandwidth) | The kernel's bandwidth on the residuals' scale. |
| [covariance](#covariance) | The kernel sandwich covariance, a list of rows. |
| [objective](#objective) | The minimised weighted check loss (`rq`'s [rho](aggregate.Ruin.md#prospicio.aggregate.Ruin.rho) leaves the |
| [standard_errors](#standard_errors) | Powell's kernel standard errors. |

------------------------------------------------------------------------


#### bandwidth


The kernel's bandwidth on the residuals' scale.


`bandwidth: float`


------------------------------------------------------------------------


#### covariance


The kernel sandwich covariance, a list of rows.


`covariance: list[list[float]]`


------------------------------------------------------------------------


#### objective


The minimised weighted check loss (`rq`'s [rho](aggregate.Ruin.md#prospicio.aggregate.Ruin.rho) leaves the


`objective: float`


weights out).


------------------------------------------------------------------------


#### standard_errors


Powell's kernel standard errors.


`standard_errors: list[float]`


## Methods

| Name | Description |
|----|----|
| [from_json()](#from_json) | Reads an artifact written by [to_json](models.Terms.md#prospicio.models.Terms.to_json). |
| [predict()](#predict) | The fitted quantile of each row. |
| [predict_distribution()](#predict_distribution) | Draws of each row's fitted quantile from the coefficients' normal |
| [to_json()](#to_json) | The fit as a versioned JSON artifact: the level, the names, the |

------------------------------------------------------------------------


#### from_json()


Reads an artifact written by [to_json](models.Terms.md#prospicio.models.Terms.to_json).


Usage

``` python
from_json(text)
```


##### Parameters


`text: str`  


##### Returns


`QuantileFit`  


##### Raises


`ValueError`  
For malformed JSON, another format, a newer format version or inconsistent fields.


------------------------------------------------------------------------


#### predict()


The fitted quantile of each row.


Usage

``` python
predict(design)
```


------------------------------------------------------------------------


#### predict_distribution()


Draws of each row's fitted quantile from the coefficients' normal


Usage

``` python
predict_distribution(design, n_sims, seed)
```


approximation: the quantile's uncertainty, not the response's.


##### Returns


`PredictiveDistribution`  


------------------------------------------------------------------------


#### to_json()


The fit as a versioned JSON artifact: the level, the names, the


Usage

``` python
to_json()
```


estimates and their covariance, and the fit statistics, numbers bit for bit (#978). [from_json](models.Terms.md#prospicio.models.Terms.from_json) reads it back; `pickle` uses the same document.


##### Returns


`str`  


##### Examples

``` python
>>> import pickle
>>> from prospicio.models import Design, QuantileRegression, QuantileFit
>>> d = Design([[1.0] * 6, [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]], ["(Intercept)", "x"])
>>> fit = QuantileRegression(0.5).fit(d, [1.0, 2.5, 2.0, 4.0, 5.5, 5.0])
>>> QuantileFit.from_json(fit.to_json()).coefficients == fit.coefficients
```

True

``` python
>>> pickle.loads(pickle.dumps(fit)).coefficients == fit.coefficients
```

True
