Learn R Programming

hdMTD (version 0.1.1)

perfectSample: Perfectly samples an MTD Markov chain

Description

Samples an MTD Markov Chain from the stationary distribution.

Usage

perfectSample(MTD, N = NULL)

Value

Returns a sample from an MTD model (the first element is the most recent).

Arguments

MTD

An MTD object, see MTDmodel() for properly generating a MTD object.

N

The sample size. If NULL sample size will be set to 1000.

Details

This perfect sample algorithm requires that the MTD model has an independent distribution (p0) with a positive weight (i.e., MTD$lambdas["lam0"]>0 which means \(\lambda_0>0\)).

Examples

Run this code
perfectSample(MTDmodel(Lambda=c(1,4), A = c(0,2)), N = 200 )
perfectSample(MTDmodel(Lambda=c(2,5), A = c(1,2,3)), N = 1000 )

Run the code above in your browser using DataLab