Skip to content

Commit

Permalink
change default of displace t (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderFengler authored Dec 18, 2024
1 parent fdd0201 commit 47a61ef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires = ["setuptools", "wheel", "Cython>=0.29.23", "numpy >= 1.20"]

[project]
name= "ssm-simulators"
version= "0.7.9"
version= "0.8.0"
authors= [{name = "Alexander Fenger", email = "[email protected]"}]
description= "SSMS is a package collecting simulators and training data generators for a bunch of generative models of interest in the cognitive science / neuroscience and approximate bayesian computation communities"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion ssms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
from . import config
from . import support_utils

__version__ = "0.7.9" # importlib.metadata.version(__package__ or __name__)
__version__ = "0.8.0" # importlib.metadata.version(__package__ or __name__)

__all__ = ["basic_simulators", "dataset_generators", "config", "support_utils"]
25 changes: 21 additions & 4 deletions ssms/support_utils/kde_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,28 @@ class LogKDE:
# Initialize the class
def __init__(
self,
simulator_data, # as returned by simulator function
bandwidth_type="silverman",
auto_bandwidth=True,
displace_t=True,
simulator_data: dict, # as returned by simulator function
bandwidth_type: str = "silverman",
auto_bandwidth: bool = True,
displace_t: bool = False,
):
"""Initialize LogKDE class.
Arguments:
----------
simulator_data: Dictionary containing simulation data with keys 'rts', 'choices', and 'metadata'.
Follows the format returned by simulator functions in this package.
bandwidth_type: Type of bandwidth to use for KDE. Currently only 'silverman' is supported.
Defaults to 'silverman'.
auto_bandwidth: Whether to automatically compute bandwidths based on the data.
If False, bandwidths must be set manually. Defaults to True.
displace_t: Whether to shift RTs by the t parameter from metadata.
Only works if all trials have the same t value. Defaults to False.
Raises:
-------
AssertionError: If displace_t is True but metadata contains multiple t values.
"""
self.simulator_info = simulator_data["metadata"]

if displace_t:
Expand Down

0 comments on commit 47a61ef

Please sign in to comment.