# Path: catsim/irt.py
# def icc(theta: float, a: float, b: float, c: float = 0, d: float = 1) -> float:
# def _split_params(items: numpy.ndarray):
# def detect_model(items: numpy.ndarray) -> int:
# def icc_hpc(theta: float, items: numpy.ndarray) -> numpy.ndarray:
# def inf_hpc(theta: float, items: numpy.ndarray):
# def inf(theta: float, a: float, b: float, c: float = 0, d: float = 1) -> float:
# def test_info(theta: float, items: numpy.ndarray) -> float:
# def var(theta: float, items: numpy.ndarray) -> float:
# def see(theta: float, items: numpy.ndarray) -> float:
# def reliability(theta: float, items: numpy.ndarray):
# def max_info(a: float = 1, b: float = 0, c: float = 0, d: float = 1) -> float:
# def max_info_hpc(items: numpy.ndarray):
# def log_likelihood(
#     est_theta: float, response_vector: List[bool], administered_items: numpy.ndarray
# ) -> float:
# def negative_log_likelihood(est_theta: float, *args) -> float:
# def normalize_item_bank(items: numpy.ndarray) -> numpy.ndarray:
# def validate_item_bank(items: numpy.ndarray, raise_err: bool = False):


import operator
import random
import numpy
    import doctest
from typing import List, Union
from catsim import irt
        raise ValueError("Item type not in " + str(valid_itemtypes))

    means = [0, 1.2]
    stds = [1, 0.25]
    covs = [
        [stds[0]**2, stds[0] * stds[1] * corr],
        [stds[0] * stds[1] * corr, stds[1]**2],
    ]

    b, a = numpy.random.multivariate_normal(means, covs, n).T

    # if by chance there is some discrimination value below zero
    # this makes the problem go away
    if any(disc < 0 for disc in a):
        min_disc = min(a)
        a = [disc + abs(min_disc) for disc in a]

    if itemtype not in ["2PL", "3PL", "4PL"]:
        a = numpy.ones(n)

    if itemtype in ["3PL", "4PL"]:
        c = numpy.random.normal(0.25, 0.02, n).clip(min=0)
    else:
        c = numpy.zeros(n)

    if itemtype == "4PL":
        d = numpy.random.uniform(0.94, 1, n)
    else:
        d = numpy.ones(n)


# Path: catsim/irt.py
# def icc(theta: float, a: float, b: float, c: float = 0, d: float = 1) -> float:
# def _split_params(items: numpy.ndarray):
# def detect_model(items: numpy.ndarray) -> int:
# def icc_hpc(theta: float, items: numpy.ndarray) -> numpy.ndarray:
# def inf_hpc(theta: float, items: numpy.ndarray):
# def inf(theta: float, a: float, b: float, c: float = 0, d: float = 1) -> float:
# def test_info(theta: float, items: numpy.ndarray) -> float:
# def var(theta: float, items: numpy.ndarray) -> float:
# def see(theta: float, items: numpy.ndarray) -> float:
# def reliability(theta: float, items: numpy.ndarray):
# def max_info(a: float = 1, b: float = 0, c: float = 0, d: float = 1) -> float:
# def max_info_hpc(items: numpy.ndarray):
# def log_likelihood(
#     est_theta: float, response_vector: List[bool], administered_items: numpy.ndarray
# ) -> float:
# def negative_log_likelihood(est_theta: float, *args) -> float:
# def normalize_item_bank(items: numpy.ndarray) -> numpy.ndarray:
# def validate_item_bank(items: numpy.ndarray, raise_err: bool = False):


# Path: catsim/cat.py
import operator
import random
import numpy
    import doctest
from typing import List, Union
from catsim import irt

        raise ValueError("Item type not in " + str(valid_itemtypes))

    means = [0, 1.2]
    stds = [1, 0.25]
    covs = [
        [stds[0]**2, stds[0] * stds[1] * corr],
        [stds[0] * stds[1] * corr, stds[1]**2],
    ]

    b, a = numpy.random.multivariate_normal(means, covs, n).T

    # if by chance there is some discrimination value below zero
    # this makes the problem go away
    if any(disc < 0 for disc in a):
        min_disc = min(a)
        a = [disc + abs(min_disc) for disc in a]

    if itemtype not in ["2PL", "3PL", "4PL"]:
        a = numpy.ones(n)

    if itemtype in ["3PL", "4PL"]:
        c = numpy.random.normal(0.25, 0.02, n).clip(min=0)
    else:
        c = numpy.zeros(n)

    if itemtype == "4PL":
        d = numpy.random.uniform(0.94, 1, n)
    else:
        d = numpy.ones(n)


    return irt.normalize_item_bank(numpy.array([a, b, c, d]).T)