Package: bistablehistory 1.1.4

bistablehistory: Cumulative History Analysis for Bistable Perception Time Series

Estimates cumulative history for time-series for continuously viewed bistable perceptual rivalry displays. Computes cumulative history via a homogeneous first order differential process. I.e., it assumes exponential growth/decay of the history as a function time and perceptually dominant state, Pastukhov & Braun (2011) <doi:10.1167/11.10.12>. Supports Gamma, log normal, and normal distribution families. Provides a method to compute history directly and example of using the computation on a custom Stan code.

Authors:Alexander Pastukhov [aut, cre]

bistablehistory_1.1.4.tar.gz
bistablehistory_1.1.4.zip(r-4.7)bistablehistory_1.1.4.zip(r-4.6)bistablehistory_1.1.4.zip(r-4.5)
bistablehistory_1.1.4.tgz(r-4.6-x86_64)bistablehistory_1.1.4.tgz(r-4.6-arm64)bistablehistory_1.1.4.tgz(r-4.5-x86_64)bistablehistory_1.1.4.tgz(r-4.5-arm64)
bistablehistory_1.1.4.tar.gz(r-4.7-arm64)bistablehistory_1.1.4.tar.gz(r-4.7-x86_64)bistablehistory_1.1.4.tar.gz(r-4.6-arm64)bistablehistory_1.1.4.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
bistablehistory/json (API)
NEWS

# Install 'bistablehistory' in R:
install.packages('bistablehistory', repos = c('https://alexander-pastukhov.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/alexander-pastukhov/bistablehistory/issues

Pkgdown/docs site:https://alexander-pastukhov.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • br - Binocular rivalry data
  • br_contrast - Binocular rivalry, variable contrast
  • br_single_subject - Single experimental session for binocular rivalry stimulus
  • br_singleblock - Single run for binocular rivalry stimulus
  • kde - Kinetic-depth effect data
  • kde_two_observers - Multirun data for two participants, kinetic-depth effect display
  • nc - Necker cube data

On CRAN:

Conda:

cpp

4.78 score 7 scripts 301 downloads 21 exports 54 dependencies

Last updated from:39e6223fed. Checks:12 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK303
linux-devel-x86_64OK293
source / vignettesOK354
linux-release-arm64OK286
linux-release-x86_64OK267
macos-release-arm64OK343
macos-release-x86_64OK453
macos-oldrel-arm64OK249
macos-oldrel-x86_64OK686
windows-develOK352
windows-releaseOK358
windows-oldrelOK301
wasm-releaseFAIL150

Exports:bayes_R2check_fixed_history_parametercheck_normal_priorcompute_historyevaluate_history_initevaluate_history_optionextract_historyextract_history_parameterextract_replicate_term_to_matrixextract_term_to_matrixfast_history_computefit_cumhistfixefhistory_mixed_statehistory_parameterhistory_tauhistoryefloopredict_historypredict_samplespreprocess_data

Dependencies:abindbackportsBHbootcallrcheckmateclicpp11descdistributionaldplyrfarvergenericsggplot2gluegridExtragtableinlineisobandlabelinglifecycleloomagrittrmatrixStatsnumDerivpillarpkgbuildpkgconfigposteriorprocessxpspurrrQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolsS7scalesStanHeadersstringistringrtensorAtibbletidyrtidyselectutf8vctrsviridisLitewithr

Cumulative History

Rendered fromcumulative-history.Rmdusingknitr::rmarkdownon May 10 2026.

Last update: 2026-03-11
Started: 2021-07-25

Usage examples

Rendered fromusage-examples.Rmdusingknitr::rmarkdownon May 10 2026.

Last update: 2026-03-11
Started: 2021-09-23

Writing Stan code

Rendered fromwriting-stan-code.Rmdusingknitr::rmarkdownon May 10 2026.

Last update: 2022-01-07
Started: 2021-09-23

Readme and manuals

Help Manual

Help pageTopics
Cumulative History Analysis for Bistable Perception Time Seriesbistablehistory-package bistablehistory
Computes R-squared using Bayesian R-squared approach.bayes_R2 bayes_R2.cumhist
Binocular rivalry databr
Binocular rivalry, variable contrastbr_contrast
Single experimental session for binocular rivalry stimulusbr_single_subject
Single run for binocular rivalry stimulusbr_singleblock
Extract Model Coefficientscoef.cumhist
Computes cumulative history for the time-seriescompute_history
Class 'cumhist'.cumhist cumhist-class
Computes history for a fitted modelextract_history
Extracts a history parameter as a matrixextract_history_parameter
Extract a term and replicates it randomN times for each linear modelextract_replicate_term_to_matrix
Extracts a term with one column per fixed or random-level into a matrixextract_term_to_matrix
Computes cumulative historyfast_history_compute
Fits cumulative history for bistable perceptual rivalry displays.fit_cumhist
Extract the fixed-effects estimatesfixef
Extract values of used or fitted history parameter mixed_statehistory_mixed_state
Extract values of used or fitted history parameterhistory_parameter
Extract values of used or fitted history parameter tauhistory_tau
Extract the history-effects estimateshistoryef
Kinetic-depth effect datakde
Multirun data for two participants, kinetic-depth effect displaykde_two_observers
Computes an efficient approximate leave-one-out cross-validation via loo library. It can be used for a model comparison via loo::loo_compare() function.loo.cumhist
Necker cube datanc
Computes predicted cumulative history using posterior predictive distribution.predict_history
Computes prediction for a each sample.predict_samples
Computes predicted dominance phase durations using posterior predictive distribution.predict.cumhist
Preprocesses time-series data for fittingpreprocess_data
Prints out cumhist objectprint.cumhist
Summary for a cumhist objectsummary.cumhist
Computes widely applicable information criterion (WAIC).waic.cumhist