Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W2D3 T3 E1 solution bug #432

Closed
JesseLivezey opened this issue Jul 22, 2020 · 1 comment
Closed

W2D3 T3 E1 solution bug #432

JesseLivezey opened this issue Jul 22, 2020 · 1 comment

Comments

@JesseLivezey
Copy link
Contributor

The solution in T3 contains the following

"""
params (dict): a dictionary of model paramters: (F, Q, H, R, mu_0, sigma_0)
"""
...
# simulate the system
  for t in range(n_timesteps):
    # write the expressions for computing state values given the time step
    if t == 0:
      state[t] = params['mu_0']
    else:
      state[t] = params['F'] @ state[t-1] + zi[t]

which uses a fixed initial state for sampling (the mean) although the parameters imply that you should treat it as a distribution.

We should either provide a static initial state value and correct the solution, or correct the solution to sample from the initial state distribution, such as

if t == 0:
  state[t] = stats.multivariate_normal(mean=params['mu_0'], cov=np.eye(params['sigma_0']).rvs()
@JesseLivezey
Copy link
Contributor Author

Duplicated in #435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant