tensorflow / tensorflow/probability

Input initial_level_prior inconsistent with initial_state_prior (sts.LocalLevel)

Open
#1,481 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

This might turn out to clarification, but feel free to let me know and I can close it.

In the simplest cases of
LocalLevel
LocalLinearTrend

the highlighted lines above define initial_state_prior through a MultivariateNormalDiag with mean and scale defined by initial_level_prior or initial_slope_prior.

May I know why are the priors defined as MultivariateNormalDiag even though the initial_level_prior/initial_scale_prior inputs may not be Normal?

For example, suppose I have the following simple random walk model, where my initial_level_prior is a LogNormal distribution.

trend = sts.LocalLevel(
    observed_time_series = co2_by_month_training_data,
    initial_level_prior=tfd.LogNormal(
        loc=2.,
        scale=1.
    )
)

If I check the initial_state_prior, as expected, the prior has been redefined as MultiNormal (which in this is simply a normal distribution)

trend.initial_state_prior

<tfp.distributions.MultivariateNormalDiag 'MultivariateNormalDiag' batch_shape=[] event_shape=[1] dtype=float32>

My questions are:

  1. What is the rationale for overwriting the initial_state_prior with MultivariateNormalDiag as opposed to a joint independent distribution?
  2. Is there a way for me to enforce the initial_state_prior to user defined distribution?

Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked initial_state_prior definitions in tensorflow_probability/python/sts/components/local_level.py and local_linear_trend.py, then reproduce the LogNormal example from the issue. Compare the documented behavior of initial_level_prior and initial_state_prior, and establish whether the desired outcome is clarification or support for preserving a user-defined distribution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.