Skip to content

Computing sigma points with column (or row) vectors of cholesky((n+lambda)*P)) #316

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

Closed
aserbremen opened this issue Oct 23, 2019 · 1 comment

Comments

@aserbremen
Copy link

aserbremen commented Oct 23, 2019

In chapter 10 when calculating sigma points you state:

The subscript 𝑖 in [ sqrt( (𝑛+𝜆)Σ )]𝑖 is choosing the column vector of the matrix.

but when calculating the sigma points you choose row vectors

sigmas = np.zeros((2*n+1, n))
U = scipy.linalg.cholesky((n+lambda_)*P) # sqrt

sigmas[0] = X
for k in range (n):
    sigmas[k+1]   = X + U[k] # row vector of U
    sigmas[n+k+1] = X - U[k] # row vector of U

According to Merwe on page 7, row or column vectors are okay as I understood. Maybe you could elaborate on that and change either the text or the implementation?

@rlabbe
Copy link
Owner

rlabbe commented May 4, 2020

I'm not 100% sure at the moment. I know why the discrepancy exists between text and code, however. scipy.linalg.cholesky returns upper-triangular by default, and numpy.linalg.cholesky returns lower-triangular by default. I think when I wrote the text I was using numpy, not scipy. If I remember correctly grabbing rows or columns depends on which one you use, but I don't recall the specifics,

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

No branches or pull requests

2 participants