fstats_bootstrap Module



Contents


Interfaces

interface

  • public subroutine bootstrap_resampling_routine(x, xn)

    Defines the signature of a subroutine used to compute a resampling of data for bootstrapping purposes.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:) :: x

    The N-element array to resample.

    real(kind=real64), intent(out), dimension(size(x)) :: xn

    An N-element array where the resampled data set will be written.

interface

  • public function bootstrap_statistic_routine(x) result(rst)

    Defines the signature of a function for computing the desired bootstrap statistic.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:) :: x

    The array of data to analyze.

    Return Value real(kind=real64)

    The resulting statistic.


Derived Types

type, public ::  bootstrap_statistics

A collection of statistics resulting from the bootstrap process.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: bias

The bias in the statistic.

real(kind=real64), public :: lower_confidence_interval

The lower confidence limit on the statistic.

real(kind=real64), public, allocatable, dimension(:) :: population

An array of the population values generated by the bootstrap process.

real(kind=real64), public :: standard_error

The standard error of the statistic.

real(kind=real64), public :: statistic_value

The value of the statistic of interest.

real(kind=real64), public :: upper_confidence_interval

The upper confidence limit on the statistic.


Functions

public function bootstrap(stat, x, method, nsamples, alpha) result(rst)

Performs a bootstrap calculation on the supplied data set for the given statistic. The default implementation utlizes a random resampling with replacement. Other resampling methods may be defined by specifying an appropriate routine by means of the method input.

Arguments

Type IntentOptional Attributes Name
procedure(bootstrap_statistic_routine), intent(in), pointer :: stat

The routine used to compute the desired statistic.

real(kind=real64), intent(in), dimension(:) :: x

The N-element data set.

procedure(bootstrap_resampling_routine), intent(in), optional, pointer :: method

An optional pointer to the method to use for resampling of the data. If no method is supplied, a random resampling is utilized.

integer(kind=int32), intent(in), optional :: nsamples

An optional input, that if supplied, specifies the number of resampling runs to perform. The default is 10 000.

real(kind=real64), intent(in), optional :: alpha

An optional input, that if supplied, defines the significance level to use for the analysis. The default is 0.05.

Return Value type(bootstrap_statistics)

The resulting bootstrap_statistics type containing the confidence intervals, bias, standard error, etc. for the analyzed statistic.


Subroutines

public subroutine random_resample(x, xn)

Random resampling, with replacement, based upon a normal distribution.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in), dimension(:) :: x

The N-element array to resample.

real(kind=real64), intent(out), dimension(size(x)) :: xn

An N-element array where the resampled data set will be written.

public subroutine scaled_random_resample(x, xn)

A random resampling, scaled by the standard deviation of the original data, but based upon a normal distribution.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in), dimension(:) :: x

The N-element array to resample.

real(kind=real64), intent(out), dimension(size(x)) :: xn

An N-element array where the resampled data set will be written.