Skip to content

Commit a4f179b

Browse files
authored
Merge pull request #80 from JuliaPsychometricsBazaar/information-compat
Information compat
2 parents 234d623 + 3237b05 commit a4f179b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2269
-672
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
*.jl.cov
33
*.jl.mem
44
Manifest.toml
5-
!/docs/Manifest.toml
6-
!/test/Manifest.toml
75
!/binder/Manifest.toml
8-
/attic/
6+
attic/
97
/.vscode/
10-
/docs/attic/
118
/docs/build/
129
/docs/.CondaPkg/
1310
/docs/LocalPreferences.toml

Project.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ComputerAdaptiveTesting"
22
uuid = "5a0d4f34-1f62-4a66-80fe-87aba0485488"
33
authors = ["Frankie Robertson"]
4-
version = "0.3.2"
4+
version = "0.4.0"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
@@ -11,6 +11,7 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
1111
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1212
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1313
EffectSizes = "e248de7e-9197-5860-972e-353a2af44d75"
14+
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
1415
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1516
FittedItemBanks = "3f797b09-34e4-41d7-acf6-3302ae3248a5"
1617
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -23,6 +24,7 @@ MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
2324
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
2425
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
2526
PsychometricsBazaarBase = "b0d9cada-d963-45e9-a4c6-4746243987f1"
27+
QuickHeaps = "30b38841-0f52-47f8-a5f8-18d5d4064379"
2628
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2729
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2830
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
@@ -46,8 +48,9 @@ DataFrames = "1.6.1"
4648
Distributions = "^0.25.88"
4749
DocStringExtensions = " ^0.9"
4850
EffectSizes = "^1.0.1"
51+
ElasticArrays = "1.2.12"
4952
FillArrays = "0.13, 1.5.0"
50-
FittedItemBanks = "^0.6.3"
53+
FittedItemBanks = "^0.7.2"
5154
ForwardDiff = "1"
5255
HypothesisTests = "^0.10.12, ^0.11.0"
5356
Interpolations = "^0.14, ^0.15"
@@ -59,10 +62,10 @@ MacroTools = "^0.5.6"
5962
Mmap = "^1.11"
6063
Optim = "1.7.3"
6164
PrecompileTools = "1.2.1"
62-
PsychometricsBazaarBase = "^0.8.1"
65+
PsychometricsBazaarBase = "^0.8.4"
66+
QuickHeaps = "0.2.2"
6367
Random = "^1.11"
6468
Reexport = "1"
65-
ResumableFunctions = "^0.6"
6669
Setfield = "^1"
6770
SparseArrays = "^1.11"
6871
StaticArrays = "1"
@@ -75,8 +78,7 @@ julia = "^1.11"
7578
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
7679
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
7780
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
78-
ResumableFunctions = "c5292f4c-5179-55e1-98c5-05642aab7184"
7981
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8082

8183
[targets]
82-
test = ["Aqua", "JET", "Optim", "ResumableFunctions", "Test"]
84+
test = ["Aqua", "JET", "Optim", "Test"]

benchmark/benchmarks.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ using FittedItemBanks.DummyData: dummy_full, SimpleItemBankSpec, StdModel4PL
88
using ComputerAdaptiveTesting.Aggregators
99
using PsychometricsBazaarBase.Optimizers
1010
using PsychometricsBazaarBase.Integrators: even_grid
11-
using ComputerAdaptiveTesting.NextItemRules: mirtcat_quadpts
1211
using ComputerAdaptiveTesting.NextItemRules: ExpectationBasedItemCriterion,
1312
PointResponseExpectation
1413
using ComputerAdaptiveTesting.NextItemRules
@@ -27,21 +26,21 @@ function prepare_4pls(group)
2726
num_questions = 20,
2827
num_testees = 1
2928
)
30-
integrator = even_grid(-6.0, 6.0, mirtcat_quadpts(1))
29+
integrator = even_grid(-6.0, 6.0, 121)
3130
optimizer = AbilityOptimizer(OneDimOptimOptimizer(-6.0, 6.0, NelderMead()))
3231

33-
dist_ability_estimator = PriorAbilityEstimator()
32+
dist_ability_estimator = PosteriorAbilityEstimator()
3433
ability_estimators = [
3534
("mean", MeanAbilityEstimator(dist_ability_estimator, integrator)),
3635
("mode", ModeAbilityEstimator(dist_ability_estimator, optimizer))
3736
]
3837
response_idxs = sample(rng, 1:20, 10)
3938

4039
for (est_nick, ability_estimator) in ability_estimators
41-
next_item_rule = ItemStrategyNextItemRule(
40+
next_item_rule = ItemCriterionRule(
4241
ExhaustiveSearch(),
4342
ExpectationBasedItemCriterion(PointResponseExpectation(ability_estimator),
44-
AbilityVarianceStateCriterion(
43+
AbilityVariance(
4544
integrator, distribution_estimator(ability_estimator)))
4645
)
4746
next_item_rule = preallocate(next_item_rule)

docs/examples/examples/ability_convergence_3pl.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ using Distributions: Normal, cdf
2020
using AlgebraOfGraphics
2121
using ComputerAdaptiveTesting
2222
using ComputerAdaptiveTesting.Sim: auto_responder
23-
using ComputerAdaptiveTesting.NextItemRules: AbilityVarianceStateCriterion
24-
using ComputerAdaptiveTesting.TerminationConditions: FixedItemsTerminationCondition
25-
using ComputerAdaptiveTesting.Aggregators: PriorAbilityEstimator,
23+
using ComputerAdaptiveTesting.NextItemRules: AbilityVariance
24+
using ComputerAdaptiveTesting.TerminationConditions: FixedLength
25+
using ComputerAdaptiveTesting.Aggregators: PosteriorAbilityEstimator,
2626
MeanAbilityEstimator, LikelihoodAbilityEstimator
2727
using FittedItemBanks
2828
using ComputerAdaptiveTesting.Responses: BooleanResponse
@@ -46,18 +46,18 @@ using FittedItemBanks.DummyData: dummy_full, std_normal, SimpleItemBankSpec, Std
4646
# CatRecorder collects information which can be used to draw different types of plots.
4747
max_questions = 99
4848
integrator = FixedGKIntegrator(-6, 6, 80)
49-
dist_ability_est = PriorAbilityEstimator(std_normal)
49+
dist_ability_est = PosteriorAbilityEstimator(std_normal)
5050
ability_estimator = MeanAbilityEstimator(dist_ability_est, integrator)
5151
rules = CatRules(ability_estimator,
52-
AbilityVarianceStateCriterion(dist_ability_est, integrator),
53-
FixedItemsTerminationCondition(max_questions))
52+
AbilityVariance(dist_ability_est, integrator),
53+
FixedLength(max_questions))
5454

5555
points = 500
5656
xs = range(-2.5, 2.5, length = points)
5757
raw_estimator = LikelihoodAbilityEstimator()
5858
recorder = CatRecorder(xs, responses, integrator, raw_estimator, ability_estimator)
5959
for testee_idx in axes(responses, 2)
60-
tracked_responses, θ = run_cat(CatLoopConfig(rules = rules,
60+
tracked_responses, θ = run_cat(CatLoop(rules = rules,
6161
get_response = auto_responder(@view responses[:, testee_idx]),
6262
new_response_callback = (tracked_responses, terminating) -> recorder(tracked_responses,
6363
testee_idx,

docs/examples/examples/ability_convergence_mirt.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ using AlgebraOfGraphics
2121
using ComputerAdaptiveTesting
2222
using ComputerAdaptiveTesting.Sim: auto_responder
2323
using ComputerAdaptiveTesting.NextItemRules: DRuleItemCriterion
24-
using ComputerAdaptiveTesting.TerminationConditions: FixedItemsTerminationCondition
25-
using ComputerAdaptiveTesting.Aggregators: PriorAbilityEstimator,
24+
using ComputerAdaptiveTesting.TerminationConditions: FixedLength
25+
using ComputerAdaptiveTesting.Aggregators: PosteriorAbilityEstimator,
2626
MeanAbilityEstimator, LikelihoodAbilityEstimator
2727
using FittedItemBanks
2828
import PsychometricsBazaarBase.IntegralCoeffs
@@ -49,11 +49,11 @@ using ComputerAdaptiveTesting.Responses: BooleanResponse
4949
# CatRecorder collects information which can be used to draw different types of plots.
5050
max_questions = 9
5151
integrator = CubaIntegrator([-6.0, -6.0], [6.0, 6.0], CubaVegas(); rtol = 1e-2)
52-
ability_estimator = MeanAbilityEstimator(PriorAbilityEstimator(std_mv_normal(dims)),
52+
ability_estimator = MeanAbilityEstimator(PosteriorAbilityEstimator(std_mv_normal(dims)),
5353
integrator)
5454
rules = CatRules(ability_estimator,
5555
DRuleItemCriterion(ability_estimator),
56-
FixedItemsTerminationCondition(max_questions))
56+
FixedLength(max_questions))
5757

5858
# XXX: We shouldn't need to specify xs here since the distributions are not used -- rework
5959
points = 3
@@ -67,7 +67,7 @@ recorder = CatRecorder(xs,
6767
abilities)
6868
for testee_idx in axes(responses, 2)
6969
@debug "Running for testee" testee_idx
70-
tracked_responses, θ = run_cat(CatLoopConfig(rules = rules,
70+
tracked_responses, θ = run_cat(CatLoop(rules = rules,
7171
get_response = auto_responder(@view responses[:, testee_idx]),
7272
new_response_callback = (tracked_responses, terminating) -> recorder(tracked_responses,
7373
testee_idx,

docs/examples/examples/vocab_iq.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# ---
66

77
#md # Running a CAT based based on real response data
8-
#
8+
#
99
# This example shows how to run a CAT end-to-end on real data.
10-
#
10+
#
1111
# First a 1-dimensional IRT model is fitted based on open response data to the
1212
# vocabulary IQ test using the IRTSupport package which internally, this uses
1313
# the `mirt` R package. Next, the model is used to administer the test
@@ -37,13 +37,13 @@ function run_vocab_iq_cat()
3737
item_bank, labels = get_item_bank()
3838
integrator = FixedGKIntegrator(-6, 6, 61)
3939
ability_integrator = AbilityIntegrator(integrator)
40-
dist_ability_est = PriorAbilityEstimator(std_normal)
40+
dist_ability_est = PosteriorAbilityEstimator(std_normal)
4141
optimizer = AbilityOptimizer(OneDimOptimOptimizer(-6.0, 6.0, NelderMead()))
4242
ability_estimator = ModeAbilityEstimator(dist_ability_est, optimizer)
4343
@info "run_cat" ability_estimator
4444
rules = CatRules(ability_estimator,
45-
AbilityVarianceStateCriterion(dist_ability_est, ability_integrator),
46-
FixedItemsTerminationCondition(45))
45+
AbilityVariance(dist_ability_est, ability_integrator),
46+
FixedLength(45))
4747
function get_response(response_idx, response_name)
4848
params = item_params(item_bank, response_idx)
4949
println("Parameters for next question: $params")
@@ -63,7 +63,7 @@ function run_vocab_iq_cat()
6363
println("Got ability estimate: $ability ± $var")
6464
println("")
6565
end
66-
loop_config = CatLoopConfig(rules = rules,
66+
loop_config = CatLoop(rules = rules,
6767
get_response = get_response,
6868
new_response_callback = new_response_callback)
6969
run_cat(loop_config, item_bank)

docs/src/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ CurrentModule = ComputerAdaptiveTesting
88
```
99

1010
```@autodocs
11-
Modules = [ComputerAdaptiveTesting, ComputerAdaptiveTesting.Aggregators, ComputerAdaptiveTesting.Responses, ComputerAdaptiveTesting.Sim, ComputerAdaptiveTesting.TerminationConditions, ComputerAdaptiveTesting.NextItemRules, ComputerAdaptiveTesting.CatConfig]
11+
Modules = [ComputerAdaptiveTesting, ComputerAdaptiveTesting.Aggregators, ComputerAdaptiveTesting.Responses, ComputerAdaptiveTesting.Sim, ComputerAdaptiveTesting.TerminationConditions, ComputerAdaptiveTesting.NextItemRules, ComputerAdaptiveTesting.Rules]
1212
```

docs/src/creating_a_cat.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The configuration of a CAT is built up as a tree of configuration structs.
1313
These structs are all subtypes of `CatConfigBase`.
1414

1515
```@docs; canonical=false
16-
ComputerAdaptiveTesting.CatConfig.CatConfigBase
16+
ComputerAdaptiveTesting.ConfigBase.CatConfigBase
1717
```
1818

1919
The constructors for the configuration structs in this package tend to have
@@ -59,7 +59,7 @@ next item selection rule, and the stopping rule. `CatRules` has explicit and
5959
implicit constructors.
6060

6161
```@docs; canonical=false
62-
ComputerAdaptiveTesting.CatConfig.CatRules
62+
ComputerAdaptiveTesting.CatRules
6363
```
6464

6565
### Next item selection with `NextItemRule`
@@ -79,13 +79,13 @@ ComputerAdaptiveTesting.NextItemRules.RandomNextItemRule
7979

8080
Other rules are created by combining a `ItemCriterion` -- which somehow rates
8181
items according to how good they are -- with a `NextItemStrategy` using an
82-
`ItemStrategyNextItemRule`, which acts as an adapter. The default
82+
`ItemCriterionRule`, which acts as an adapter. The default
8383
`NextItemStrategy` (and currently only) is `ExhaustiveSearch`. When using
8484
the implicit constructors, `ItemCriterion` can therefore be used directly
8585
without wrapping in any place an NextItemRule is expected.
8686

8787
```@docs; canonical=false
88-
ComputerAdaptiveTesting.NextItemRules.ItemStrategyNextItemRule
88+
ComputerAdaptiveTesting.NextItemRules.ItemCriterionRule
8989
```
9090

9191
```@docs; canonical=false
@@ -114,17 +114,17 @@ takes a `ResponseExpectation`: either `PointResponseExpectation` or
114114
good a particular state is in terms getting a good estimate of the test takers
115115
ability. They look one ply ahead to get the expected value of the
116116
``StateCriterion`` after selecting the given item. The
117-
`AbilityVarianceStateCriterion` looks at the variance of the ability ``\theta``
117+
`AbilityVariance` looks at the variance of the ability ``\theta``
118118
estimate at that state.
119119

120120
### Stopping rules with `TerminationCondition`
121121

122-
Currently the only `TerminationCondition` is `FixedItemsTerminationCondition`, which ends the test after a fixed number of items.
122+
Currently the only `TerminationCondition` is `FixedLength`, which ends the test after a fixed number of items.
123123

124124
```@docs; canonical=false
125125
ComputerAdaptiveTesting.TerminationConditions.TerminationCondition
126126
```
127127

128128
```@docs; canonical=false
129-
ComputerAdaptiveTesting.TerminationConditions.FixedItemsTerminationCondition
129+
ComputerAdaptiveTesting.TerminationConditions.FixedLength
130130
```

docs/src/stateful.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Stateful.get_ability
2828
There is an implementation in terms of [CatRules](@ref):
2929

3030
```@docs
31-
Stateful.StatefulCatConfig
31+
Stateful.StatefulCatRules
3232
```
3333

3434
## Usage
3535

36-
Just as [CatLoopConfig](@ref) can wrap [CatRules](@ref), you can also use it with any implementor of [Stateful.StatefulCat](@ref), and run using [Sim.run_cat](@ref).
36+
Just as [CatLoop](@ref) can wrap [CatRules](@ref), you can also use it with any implementor of [Stateful.StatefulCat](@ref), and run using [Sim.run_cat](@ref).

docs/src/using_your_cat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ a number of ways you can use it.
99
This section covers a few.
1010
See also the [Examples](@ref demo-page).
1111

12-
When you've set up your CAT using [CatRules](@ref), you can wrap it in a [CatLoopConfig](@ref) and run it with [run_cat](@ref).
12+
When you've set up your CAT using [CatRules](@ref), you can wrap it in a [CatLoop](@ref) and run it with [run_cat](@ref).
1313

1414
```@docs; canonical=false
15-
CatLoopConfig
15+
CatLoop
1616
run_cat
1717
```
1818

0 commit comments

Comments
 (0)