Fits parameters for an STS model using Gibbs sampling.
tfp.experimental.sts_gibbs.fit_with_gibbs_sampling(
model,
observed_time_series,
num_chains=(),
num_results=2000,
num_warmup_steps=200,
initial_state=None,
seed=None,
default_pseudo_observations=None,
experimental_use_dynamic_cholesky=False,
experimental_use_weight_adjustment=False
)
Args |
model
|
A tfp.sts.StructuralTimeSeries model instance return by
build_model_for_gibbs_fitting .
|
observed_time_series
|
float Tensor of shape [..., T, 1](omitting the
trailing unit dimension is also supported when T > 1), specifying an
observed time series. May optionally be an instance of
<a href="../../../tfp/sts/MaskedTimeSeries"><code>tfp.sts.MaskedTimeSeries</code></a>, which includes a mask Tensorto specify
timesteps with missing observations.
</td>
</tr><tr>
<td> num_chains<a id="num_chains"></a>
</td>
<td>
Optional int to indicate the number of parallel MCMC chains.
Default to an empty tuple to sample a single chain.
</td>
</tr><tr>
<td> num_results<a id="num_results"></a>
</td>
<td>
Optional int to indicate number of MCMC samples.
</td>
</tr><tr>
<td> num_warmup_steps<a id="num_warmup_steps"></a>
</td>
<td>
Optional int to indicate number of MCMC samples.
</td>
</tr><tr>
<td> initial_state<a id="initial_state"></a>
</td>
<td>
A GibbsSamplerStatestructure of the initial states of the
MCMC chains.
</td>
</tr><tr>
<td> seed<a id="seed"></a>
</td>
<td>
Optional Python intseed controlling the sampled values.
</td>
</tr><tr>
<td> default_pseudo_observations<a id="default_pseudo_observations"></a>
</td>
<td>
Optional scalar float TensorControls the
number of pseudo-observations for the prior precision matrix over the
weights.
</td>
</tr><tr>
<td> experimental_use_dynamic_cholesky<a id="experimental_use_dynamic_cholesky"></a>
</td>
<td>
Optional bool - in case of spike and slab
sampling, will dynamically select the subset of the design matrix with
active features to perform the Cholesky decomposition. This may provide
a speedup when the number of true features is small compared to the size
of the design matrix. *Note*: If this is true, neither batch shape nor jit_compileis supported.
</td>
</tr><tr>
<td> experimental_use_weight_adjustment`
|
Optional bool - use a nonstandard
update for the posterior precision of the weight in case of a spike and
slab sampler.
|
Returns |
model
|
A GibbsSamplerState structure of posterior samples.
|