Miscellaneous Plotting Functions – catsim.plot

Module with functions for plotting IRT-related results.

catsim.plot.gen3d_dataset_scatter(items: ndarray, title: str | None = None, filepath: str | None = None, show: bool = True, figsize: tuple | None = None)[source]

Generate the item matrix tridimensional dataset scatter plot

(Source code, png, hires.png, pdf)

_images/plot-1.png
Parameters:
  • items – the item matrix

  • title – the scatter plot title

  • filepath – the path to save the scatter plot

  • show – whether the generated plot is to be shown

catsim.plot.item_curve(a: float = 1, b: float = 0, c: float = 0, d: float = 1, title: str | None = None, ptype: str = 'icc', max_info=True, filepath: str | None = None, show: bool = True, figsize: tuple | None = None)[source]

Plots ‘Item Response Theory’-related item plots

(Source code)

_images/plot-2_00.png

Fig. 10 (png, hires.png, pdf)

_images/plot-2_01.png

Fig. 11 (png, hires.png, pdf)

_images/plot-2_02.png

Fig. 12 (png, hires.png, pdf)

When both curves are plotted in the same figure, the figure has no grid, since each curve has a different scale.

Parameters:
  • a – item discrimination parameter

  • b – item difficulty parameter

  • c – item pseudo-guessing parameter

  • d – item upper asymptote

  • title – plot title

  • ptype – ‘icc’ for the item characteristic curve, ‘iic’ for the item information curve or ‘both’ for both curves in the same plot

  • max_info – whether the point of maximum information should be shown in the plot

  • filepath – saves the plot in the given path

  • show – whether the generated plot is to be shown

catsim.plot.item_exposure(title: str | None = None, simulator: Simulator | None = None, items: ndarray | None = None, par: str | None = None, hist: bool = False, filepath: str | None = None, show: bool = True, figsize: tuple | None = None)[source]

Generates a bar chart for the item bank exposure rate. The x axis represents one of the item parameters, while the y axis represents their exposure rates. an examinee’s test progress.

(Source code)

_images/plot-3_00.png

Fig. 13 (png, hires.png, pdf)

_images/plot-3_01.png

Fig. 14 (png, hires.png, pdf)

Parameters:
  • title – the plot title.

  • simulator – a simulator which has already simulated a series of CATs, containing estimations to the examinees’ abilities and a list of administered items for each examinee.

  • items – an item matrix containing item parameters and their exposure rate in the last column.

  • par – a string representing one of the item parameters to order the items by and use on the x axis, or None to use the default order of the item bank. Please note that, if hist=True, no sorting will be done.

  • hist – if True, plots a histogram of item exposures. Otherwise, plots a dotted line chart of the exposures, sorted in the x-axis by the parameter chosen in par.

  • filepath – the path to save the plot.

  • show – whether the generated plot is to be shown.

catsim.plot.test_progress(title: str | None = None, simulator: Simulator | None = None, index: int | None = None, thetas: List[float] | None = None, administered_items: ndarray | None = None, true_theta: float | None = None, info: bool = False, var: bool = False, see: bool = False, reliability: bool = False, filepath: str | None = None, show: bool = True, figsize: tuple | None = None)[source]

Generates a plot representing an examinee’s test progress. Note that, while some functions increase or decrease monotonically, like test information and standard error of estimation, the plot calculates these values using the examinee’s ability estimated at that given time of the test. This means that a test that was tought to be informative at a given point may not be as informative after new estimates are done.

(Source code)

_images/plot-4_00.png

Fig. 15 (png, hires.png, pdf)

_images/plot-4_01.png

Fig. 16 (png, hires.png, pdf)

Parameters:
  • title – the plot title.

  • simulator – a simulator which has already simulated a series of CATs, containing estimations to the examinees’ abilities and a list of administered items for each examinee.

  • index – the index of the examinee in the simulator whose plot is to be done.

  • thetas – if a Simulator is not passed, then a list of ability estimations can be manually passed to the function.

  • administered_items – if a Simulator is not passed, then a matrix of administered items, represented by their parameters, can be manually passed to the function.

  • true_theta – the value of the examinee’s true ability. If it is passed, it will be shown on the plot, otherwise not.

  • info – plot test information. It only works if both abilities and administered items are passed.

  • var – plot the estimation variance during the test. It only works if both abilities and administered items are passed.

  • see – plot the standard error of estimation during the test. It only works if both abilities and administered items are passed.

  • reliability – plot the test reliability. It only works if both abilities and administered items are passed.

  • filepath – the path to save the plot

  • show – whether the generated plot is to be shown