relabel_samples | R Documentation |
Given a sampler object and a vector of sample indices, relabel the given samples to be adaptation samples. This will allow them to be used in the calculation of the conditional distribution for efficient sampling.
relabel_samples(sampler, indices, from = "burn", to = "adapt")
sampler |
The pmwgs object that we are relabelling samples from |
indices |
The sample iterations from burn-in to relabel |
from |
The stage you want to re-label from. Default is "burn" |
to |
The stage you want to relabel to. Default is "adapt" |
The pmwgs object with re-labelled samples
This should not usually be needed, however if you have a model that is slow to fit, and upon visual inspection and/or trace analysis you determine that during burn-in the samples had already approached the posterior distribution then you can use this function to re-label samples from that point onwards to be classed as adaptation samples.
This will allow them to be used in tests that check for the number of unique samples, and in the building of the conditional distribution (which is used for efficient sampling)
If all old samples do not match 'from' then an error will be raised.
new_pmwgs <- relabel_samples(sampled_forstmann, 17:21)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.