Skip to content

hssm.simulate_data

hssm.simulate_data

simulate_data(
    model: str,
    theta: dict[str, ArrayLike] | list[float] | ArrayLike,
    size: int,
    random_state: int | None = None,
    output_df: bool = True,
    **kwargs
) -> np.ndarray | pd.DataFrame

Sample simulated data from specified distributions.

Parameters:

  • model (str) –

    A model name that must be supported in ssm_simulators. For a detailed list of supported models, please see all fields in the model_config dict here

  • theta (dict[str, ArrayLike] | list[float] | ArrayLike) –

    Parameters of the process. Can be supplied as dictionary with parameter names as key and np.array or float as values. Can also be supplied as a list or 1D-array, however in this case the order of parameters is important and must match specifications here. Parameters can be specificed 'trial-wise', by supplying 1D arrays of shape size to the dictionary, or by supplying a 2D array of shape (size, n_parameters) dicrectly.

  • size (int) –

    The size of the data to be simulated. If theta is a 2D ArrayLike, this parameter indicates the size of data to be simulated for each trial.

  • random_state (optional, default: None ) –

    A random seed for reproducibility.

  • output_df (optional, default: True ) –

    If True, outputs a DataFrame with column names "rt", "response". Otherwise a 2-column numpy array, by default True.

  • kwargs (optional, default: {} ) –

    Other arguments passed to ssms.basic_simulators.simulator.

Returns:

  • ndarray | DataFrame

    An array or DataFrame with simulated data.