chain_builder Derived Type

type, public :: chain_builder

A type allowing for the construction of chain of values.


Contents


Type-Bound Procedures

procedure, public :: get_chain => cb_get_chain

  • private function cb_get_chain(this, bin, err) result(rst)

    Gets a copy of the stored Markov chain.

    Arguments

    Type IntentOptional Attributes Name
    class(chain_builder), intent(in) :: this

    The chain_builder object.

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

    An optional input allowing for a burn-in region. The parameter represents the amount (percentage-based) of the overall chain to disregard as "burn-in" values. The value shoud exist on [0, 1). The default value is 0 such that no values are disregarded.

    class(errors), intent(inout), optional, target :: err

    The error handling object.

    Return Value real(kind=real64), allocatable, dimension(:,:)

    The resulting chain with each parameter represented by a column.

procedure, public :: get_chain_length => cb_get_chain_length

  • private pure function cb_get_chain_length(this) result(rst)

    Gets the length of the chain (number of stored state variables).

    Arguments

    Type IntentOptional Attributes Name
    class(chain_builder), intent(in) :: this

    The chain_builder object.

    Return Value integer(kind=int32)

    The chain length.

procedure, public :: get_state_variable_count => cb_get_nvars

  • private pure function cb_get_nvars(this) result(rst)

    Gets the number of state variables.

    Arguments

    Type IntentOptional Attributes Name
    class(chain_builder), intent(in) :: this

    The chain_builder object.

    Return Value integer(kind=int32)

    The number of state variables.

procedure, public :: push_new_state => cb_push

  • private subroutine cb_push(this, x, err)

    Pushes a new set of state variables onto the buffer.

    Arguments

    Type IntentOptional Attributes Name
    class(chain_builder), intent(inout) :: this

    The chain_builder object.

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

    The new N-element state array.

    class(errors), intent(inout), optional, target :: err

    The error handling object.

procedure, public :: reset => cb_clear_chain

  • private subroutine cb_clear_chain(this)

    Resets the object and clears out the buffer storing the chain values.

    Arguments

    Type IntentOptional Attributes Name
    class(chain_builder), intent(inout) :: this

    The chain_builder object.