Skip to content

HOBuKOB-MEX/multihypothesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

multihypothesis

An R script for construction and performance evaluation of sequential multi-hypothesis tests for the Bernoulli model

This repository contains an R module for design and performance evaluation of sequential multi-hypothesis tests.

Currently, only the model of binary responses (sampling from a Bernoulli population) is covered.

The detailed description of the method and algorithms can be found in

*Andrey Novikov. A Numerical Approach to Sequential Multi-Hypothesis Testing for Bernoulli Model, 2023. Secuential Analysis, V.42, no. 3, pp. 303-322 *

Content description

  • The file multihypothesis.R contains all the functions providing the user interface for all the tasks.

The list of functions can be seen below.

OptTest

The function for designing an optimal truncated sequential multi-hypothesis test.

Arguments:

  • H horizon (maximum number of steps to employ)
  • lam matrix of Lagrange multipliers
  • th vector of the hypothesized values of the parameter (success probability)
  • gam the vector of weights used to calculate the weighted expected sample size (ESS)
  • thgam parameter values at which ESSs are calculated to used in the weighted ESS

Returns: the designed test which minimizes the weighted ESS

MSPRT

The function for designing a truncated MSPRT (see description in the cited article).

Arguments:

  • H horizon (maximum number of steps to employ)
  • lA matrix of the logarithmic thresholds
  • th vector of the hypothesized values of parameter (success probability)

Returns: the designed truncated MSPRT

DBCTest

The function for designing the simplified (Dropped Backward Control-)version of the optimal truncated sequential multi-hypothesis test. (To be published soon)

Arguments:

  • H horizon (maximum number of steps to employ)
  • lam matrix of Lagrange multipliers
  • th the vector of the hypothesized values of parameter (success probability)
  • gam the vector of weights used to calculate the weighted expected sample size (ESS)
  • thgam parameter values at which ESSs are calculated to be used in the weighted ESS

Returns: the designed test which approximately minimizes the weighted ESS

PAccept

The function calculating the probability to accept a hypothesis given a value of the parameter.

Arguments:

  • test test designed by any of the functions OptTest, DBCTest, MSPRT
  • th parameter value at which the probability to accept the hypothesis is calculated
  • i number of the hypothesis whose acceptance probability is evaluated

Returns: the probability to accept

ESS

The function calculating the expected sample size of a test, given a value of the parameter.

Arguments:

  • test test designed by any of the functions OptTest, DBCTest, MSPRT
  • th parameter value at which the ESS is calculated

Returns: ESS

prob_to_stop_after

The function calculating the probability that the test stops after a given stage number.

Arguments:

  • test test designed by any of the functions OptTest, DBCTest, MSPRT
  • th parameter value at which the probability is calculated
  • k the stage number

Returns: the probability

monte_carlo_simulation

The function for carrying out Monte Carlo simulations

Arguments:

  • test test designed by any of the functions OptTest, DBCTest, MSPRT
  • hyp parameter value for the simulation
  • K number of hypotheses
  • nMC number of replications for the simulation

Returns: rates of acceptations and their standard errors, ESS and its standard error

maxNumber

The function to determine the maximum number of stages the test uses

Arguments:

  • test test designed by any of the functions OptTest, DBCTest, MSPRT

Returns: maximum number of stages

Usage example

  • The file usage.R is a usage example of these functions

About

An R script for construction and performance evaluation of optimal multi-hypothesis tests for the Bernoulli model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages