GithubHelp home page GithubHelp logo

Projection matrices about tornadox HOT 4 CLOSED

pnkraemer avatar pnkraemer commented on May 22, 2024
Projection matrices

from tornadox.

Comments (4)

nathanaelbosch avatar nathanaelbosch commented on May 22, 2024

Just to make sure I'm thinking about the right thing here: For me it would be enough to implement a make_projmat(d, q, derivative_to_project_onto) that returns the actual projection matrix. Did you expect something different or is that fine?

from tornadox.

pnkraemer avatar pnkraemer commented on May 22, 2024

no that is fine. I think it would be useful to implement it as some linear-operator-thing, but I can make the exact refactoring I have in mind once things work :)

from tornadox.

pnkraemer avatar pnkraemer commented on May 22, 2024

along the lines of:

    def select_derivative(self, state, derivative):

        # Once we allow changed orderings, extend this functionality here.
        # Due to the behaviour in __init__,
        # non-coordinate-representation should be impossible
        assert self.state_ordering == "coordinate"

        derivative_indices = np.arange(
            start=derivative, stop=self.state_dimension, step=(self.num_derivatives + 1)
        )
        return np.take(state, indices=derivative_indices)

    def derivative_selection_operator(self, derivative):

        selection_unit_vector = np.eye(self.num_derivatives + 1)[:, derivative]
        selection_unit_vector_as_matrix = selection_unit_vector.reshape(
            (1, self.num_derivatives + 1)
        )
        selection_matrix = np.kron(
            np.eye(self.wiener_process_dimension), selection_unit_vector_as_matrix
        )
        return selection_matrix

from tornadox.

pnkraemer avatar pnkraemer commented on May 22, 2024

which I know realise is not an operator, my bad. I meant something like

class Projection2Derivative1d:
    def __init__(self, derivative):
        self._derivative = derivative

    def __matmul__(self, other):
        return np.take(other, axis=-2, indices=self.derivative)

and axis=-2 makes sure it behaves like numpy matmul. Non-1d projections are then fairly straightforward, but not really used for EK0, right?

from tornadox.

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.