# {py:mod}`causalis.dgp.causaldata_instrumental.functional`

```{py:module} causalis.dgp.causaldata_instrumental.functional
```

```{autodoc2-docstring} causalis.dgp.causaldata_instrumental.functional
:allowtitles:
```

## Module Contents

### Functions

````{list-table}
:class: autosummary longtable
:align: left

* - {py:obj}`generate_iv_data <causalis.dgp.causaldata_instrumental.functional.generate_iv_data>`
  - ```{autodoc2-docstring} causalis.dgp.causaldata_instrumental.functional.generate_iv_data
    :summary:
    ```
````

### API

````{py:function} generate_iv_data(n: int = 1000, *, outcome_type: str = 'continuous', theta: float = 1.0, tau: typing.Optional[typing.Callable[[numpy.ndarray], numpy.ndarray]] = None, sigma_y: float = 1.0, alpha_y: float = 0.0, gamma_shape: float = 2.0, first_stage: float = 1.25, alpha_d: float = -0.2, alpha_z: float = 0.0, target_d_rate: typing.Optional[float] = None, target_z_rate: typing.Optional[float] = 0.5, confounder_specs: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None, beta_y: typing.Optional[typing.Union[typing.List[float], numpy.ndarray]] = None, beta_d: typing.Optional[typing.Union[typing.List[float], numpy.ndarray]] = None, beta_z: typing.Optional[typing.Union[typing.List[float], numpy.ndarray]] = None, g_y: typing.Optional[typing.Callable[[numpy.ndarray], numpy.ndarray]] = None, g_d: typing.Optional[typing.Callable[[numpy.ndarray], numpy.ndarray]] = None, g_z: typing.Optional[typing.Callable[[numpy.ndarray], numpy.ndarray]] = None, u_strength_d: float = 0.8, u_strength_y: float = 0.8, propensity_sharpness: float = 1.0, instrument_sharpness: float = 1.0, random_state: typing.Optional[int] = 42, k: int = 2, x_sampler: typing.Optional[typing.Callable[[int, int, int], numpy.ndarray]] = None, use_copula: bool = False, copula_corr: typing.Optional[numpy.ndarray] = None, include_oracle: bool = True, return_causal_data: bool = False, instrument_name: str = 'z', add_ancillary: bool = False, deterministic_ids: bool = False) -> typing.Union[pandas.DataFrame, causalis.data_contracts.iv_causal_data.IVCausalData]
:canonical: causalis.dgp.causaldata_instrumental.functional.generate_iv_data

```{autodoc2-docstring} causalis.dgp.causaldata_instrumental.functional.generate_iv_data
```
````
