## models.ExpectileFit


A fitted expectile regression, from [ExpectileRegression.fit](models.ExpectileRegression.md#prospicio.models.ExpectileRegression.fit).


Usage

``` python
models.ExpectileFit()
```


## Attributes

| Name | Description |
|----|----|
| [covariance](#covariance) | The sandwich covariance, a list of rows. |
| [objective](#objective) | The minimised asymmetric squared loss, without the penalty. |
| [standard_errors](#standard_errors) | The sandwich standard errors. |

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


#### covariance


The sandwich covariance, a list of rows.


`covariance: list[list[float]]`


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


#### objective


The minimised asymmetric squared loss, without the penalty.


`objective: float`


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


#### standard_errors


The sandwich 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 expectile of each row. |
| [predict_distribution()](#predict_distribution) | Draws of each row's fitted expectile under the sandwich covariance. |
| [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


`ExpectileFit`  


##### Raises


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


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


#### predict()


The fitted expectile of each row.


Usage

``` python
predict(design)
```


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


#### predict_distribution()


Draws of each row's fitted expectile under the sandwich covariance.


Usage

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


##### 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, ExpectileRegression, ExpectileFit
>>> d = Design([[1.0] * 6, [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]], ["(Intercept)", "x"])
>>> fit = ExpectileRegression(0.5).fit(d, [1.0, 2.5, 2.0, 4.0, 5.5, 5.0])
>>> ExpectileFit.from_json(fit.to_json()).coefficients == fit.coefficients
```

True

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

True
