[jaspFrequencies] Fix crash in Bayesian Informed Multinomial Test when enabling...#308
Open
sisyphus-jasp wants to merge 1 commit into
Open
[jaspFrequencies] Fix crash in Bayesian Informed Multinomial Test when enabling...#308sisyphus-jasp wants to merge 1 commit into
sisyphus-jasp wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes: https://github.com/jasp-stats/INTERNAL-jasp/issues/3106
Root cause
.createInformedMultSequentialAnalysisPlot()assumed sequential results always existed..computeInformedMultSequentialResults()yields no sequential rows/state; posterior-probability code then built a mismatcheddata.frame, causing fatal crash.What changed
R/informedmultinomialtestbayesian.Rinside.createInformedMultSequentialAnalysisPlot():Why
Caveats / reviewer checks
testAll()result after fix:[ FAIL 0 | WARN 9 | SKIP 3 | PASS 110 ](matches baseline counts)..jaspnow returnsstatus: complete; sequential plot carries error message instead of crashing.Implementation Plan
Root cause
R/informedmultinomialtestbayesian.R,.createInformedMultSequentialAnalysisPlot()assumes.computeInformedMultSequentialResults()always createsjaspResults[["sequentialAnalysisResults"]]with rows..multinomAggregateData()setsattr(dataset, "individual") <- FALSE; then.computeInformedMultSequentialResults()returns early and no sequential state is created.data.frame(model = unique(sequentialAnalysisResults$model), ..., postProb = priorProb), causing row-length mismatch and fatal crash.Proposed changes
R/informedmultinomialtestbayesian.R.createInformedMultSequentialAnalysisPlot()sequentialAnalysisPlotwith proper dependencies and set a user-facing error (sequential analysis requires unaggregated individual data), then return.includeNullModel,includeEncompassingModel): if no models remain, create same plot with error and return.Expected test impact
Fix issue #3106: Fix crash in Bayesian Informed Multinomial Test when enabling Sequential analysis plot with Posterior probability display option.
Attachment files available in: /workspace/attachment/
Files: bayes_inform_multinom.jasp
Screenshot Analysis
screenshot-1.png:
The screenshot shows JASP in the Frequencies module, analysis: Informed Bayesian Multinomial Test (results pane title: “Informed Bayesian Multinomial Test”).
Exact visible error text (as shown):
Note: the call stack itself is not expanded/visible in this screenshot; only the “Stack trace” row is shown.
Selected UI state / settings visible:
Informed Bayesian Multinomial TestFrequenciesTrials,Count2,Trials2Factor:RaceCounts:CountShow all options: uncheckedNull: selectedEncompassing: unselectedvs. Model 1: unselectedBF₁₀: selectedBF₀₁: unselectedLog(BF₁₀): unselectedTable: checkedPlot: uncheckedCounts: unselectedProportions: selectedPosterior plot: unchecked (Credible interval shown as95%, disabled)Sequential analysis plot: checkedBayes factors: unselectedPosterior probability: selectedPrior Distribution,Prior Model ProbabilityOrder Restricted Hypotheses: expandedModel 1,Model 2,Model 3White > Black > Chinese > IndianAdvanced: collapsedOutput visible:
Test Results
Automated Code Review
Approved after 1 review iteration(s).