<a id="skfolio-descriptor-analystdispersiontoprice"></a>

# skfolio.descriptor.AnalystDispersionToPrice

<a id="skfolio.descriptor.AnalystDispersionToPrice"></a>

### *class* skfolio.descriptor.AnalystDispersionToPrice

Analyst forecast dispersion to price descriptor.

Computes the ratio of analyst earnings forecast dispersion to the split-adjusted
close price:

$$
\text{analyst\_dispersion\_to\_price}(t) =
\frac{\text{eps\_ntm\_std}(t)}{\text{adj\_close}(t)}
$$

Higher values indicate greater disagreement among analysts about a firm’s forward
earnings relative to its price. Forecast dispersion is a proxy for earnings
uncertainty and information asymmetry. Empirically, stocks with high analyst
disagreement tend to be overpriced and earn lower future returns [[1]](#r85cdca767597-1).

This descriptor uses per-share quantities (standard deviation of per-share EPS
forecasts divided by split-adjusted price) because analyst consensus data is
natively reported on a per-share basis.

* **Parameters:**
  **None**
* **Attributes:**
  **n_assets_** *int*
  : Number of assets seen during fitting.

  **asset_names_** *ndarray of shape (n_assets,)*
  : Asset names seen during fitting.

### Methods

| [`fit_transform`](#skfolio.descriptor.AnalystDispersionToPrice.fit_transform)(X[, y])         | Compute analyst earnings dispersion relative to price.   |
|--------------------------------------------------------------------------------|----------------------------------------------------------|
| [`get_metadata_routing`](#skfolio.descriptor.AnalystDispersionToPrice.get_metadata_routing)()        | Get metadata routing of this object.                     |
| [`get_params`](#skfolio.descriptor.AnalystDispersionToPrice.get_params)([deep])            | Get parameters for this estimator.                       |
| [`partial_fit_transform`](#skfolio.descriptor.AnalystDispersionToPrice.partial_fit_transform)(X[, y]) | Stateless class delegation to `fit_transform`.           |
| [`set_params`](#skfolio.descriptor.AnalystDispersionToPrice.set_params)(\*\*params)        | Set the parameters of this estimator.                    |

#### SEE ALSO
[`ForwardEarningsToPrice`](https://skfolio.org/generated/skfolio.descriptor.ForwardEarningsToPrice.html.md#skfolio.descriptor.ForwardEarningsToPrice)
: Level of forward earnings to price.

### Notes

`eps_ntm_std` is the cross-analyst standard deviation of NTM EPS estimates,
typically provided by consensus data vendors. It should use the same
split-adjustment basis as `adj_close`.

### References

* <a id='r85cdca767597-1'>**[1]**</a> “Differences of opinion and the cross section of stock returns” The Journal of Finance. Diether, K. B., Malloy, C. J., & Scherbina, A. (2002).

### Examples

```pycon
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import AnalystDispersionToPrice
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = AnalystDispersionToPrice()
>>> analyst_dispersion_to_price = descriptor.fit_transform(X)
```

<a id="skfolio.descriptor.AnalystDispersionToPrice.fit_transform"></a>

#### fit_transform(X, y=None, \*\*fit_params)

Compute analyst earnings dispersion relative to price.

* **Parameters:**
  **X** *AssetPanel*
  : Input panel containing `eps_ntm_std` and `adj_close`.

  **y** *None*
  : Ignored. Present for compatibility with scikit-learn’s API.

  **\*\*fit_params** *dict*
  : Additional fit parameters. Ignored.
* **Returns:**
  **analyst_dispersion_to_price** *ndarray of shape (n_observations, n_assets)*
  : Standard deviation of forward EPS estimates divided by split-adjusted close
    for each observation and asset.

<a id="skfolio.descriptor.AnalystDispersionToPrice.get_metadata_routing"></a>

#### get_metadata_routing()

Get metadata routing of this object.

Please check [User Guide](https://skfolio.org/user_guide/metadata_routing.html.md#metadata-routing) on how the routing
mechanism works.

* **Returns:**
  **routing** *MetadataRequest*
  : A `MetadataRequest` encapsulating
    routing information.

<a id="skfolio.descriptor.AnalystDispersionToPrice.get_params"></a>

#### get_params(deep=True)

Get parameters for this estimator.

* **Parameters:**
  **deep** *bool, default=True*
  : If True, will return the parameters for this estimator and
    contained subobjects that are estimators.
* **Returns:**
  **params** *dict*
  : Parameter names mapped to their values.

<a id="skfolio.descriptor.AnalystDispersionToPrice.partial_fit_transform"></a>

#### partial_fit_transform(X, y=None, \*\*fit_params)

Stateless class delegation to `fit_transform`.

<a id="skfolio.descriptor.AnalystDispersionToPrice.set_params"></a>

#### set_params(\*\*params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects
(such as `Pipeline`). The latter have
parameters of the form `<component>__<parameter>` so that it’s
possible to update each component of a nested object.

* **Parameters:**
  **\*\*params** *dict*
  : Estimator parameters.
* **Returns:**
  **self** *estimator instance*
  : Estimator instance.

