Giter VIP home page Giter VIP logo

Comments (3)

albop avatar albop commented on July 28, 2024

Could you define current_x_hat as a 1d vector instead ? Then it would be broadcasted to a 2x1 array or 1x2 array depending on the orientation of x. Would that work ?

To me, one good feature of numpy is that it has 1d vectors, while in matlab everything is a matrix by default. For the dot operator, it works likewise: provided that the dimensions match you can write dot(A,x) or dot(x,A) without caring whether x is a vector or a linear form.

from quantecon.py.

oyamad avatar oyamad commented on July 28, 2024

@albop As you suggest, I dropped conversion to 2d array in the Kalman class, then the solution script worked as expected without flatten(). (But I only tried one particular case with R = np.zeros((2, 2)) and x_hat = np.array([0, 0]).)
http://nbviewer.ipython.org/gist/oyamad/1f9b66fda3679f85f794/kalman_ex3_2.ipynb

from quantecon.py.

jstac avatar jstac commented on July 28, 2024

Thanks for letting me know about this error. In the end I just corrected the exercise by flattening the vector ex post. I didn't flatten everything inside Kalman because I want the inner workings to be transparent --- this module is more instructive rather than for heavy duty use.

from quantecon.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.