Yes it means [-1]. From the reference page :
Command selections '[-1]','[-2]' and '[-3]' are so often used that they have their own shortcuts,
respectively '.', '..' and '...'. For instance, command '-blur..' is equivalent to '-blur[-2]'.
These shortcuts work only for command selections, not for command arguments.
A double dash means “works on a copy instead of in-place”. Here, we copy the two input images into a separate local environment (so inside, you have a list with the two copies). I do that because I modify the images data inside the local environment. Just before exiting the local environment, I don’t need the modified image data anymore, so I remove them all. That’s because I’ve found my coefficients a and b and stored their values in variables.
Here the --local just ensures you won’t modify your two input images at all.
What I do in the --local environment is I construct a matrix A (image [0]) and a vector B (image [1]), such that I’m looking to get the unknown X (the vector of the two coefs a and b of the linear transformation), so that :
A.X = B (matrix product).
This is an over-determined system in this case, but command -solve is able to return the least-square solution X to this system. Here, A is a matrix with 2 columns : the first column is the set of values of the first image, and the second column is filled with 1. The vector B is the set of values of the second image.
Keeping only 10k values is not only for speed reasons, it’s also because if you keep all the values you get a system that is so-overdetermined that you lose numerical precisions when computing the least-square solution with -solve (this is due to the unstability of the pseudo-inverse computation).