Multivariate regression input for multivariable problem
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Beatrice Pazzucconi
am 30 Nov. 2017
Kommentiert: the cyclist
am 2 Dez. 2017
Hi everyone!
I acquired some data from images to be processed for a master thesis, and since I've decided I need to look at all the variable together, I had a look at the page on multivariate regression, but I am a bit confused as how I should input the design matrix.
Let me first explain the kind of data I have to work on: I segment images of eyeball model, that I can rotate on a stage both in the vertical (up/down) and horizontal(left/right) sense. From the images I extract a vector linking two points of interest on the eye, that I divide in the x and y component. I am interested to see the linearity of the relation between the vertical rotation and the horizontal and vertical offset and the horizontal rotation and the horizontal and vertical offset (even if ideally vertical rotations should only depend on the vertical offset etc.)
The data I have are: the vertical and horizontal rotations, which I know, and the grid I obtain rotating the eye vertically, then scanning horizontally, the rotating vertically again etc. Say, I have pictures with the eye at 5 degrees vertical rotation for horizontal degrees ranging from -30 to 30 degrees, and then I acquire again the same horizontal range but with 10 degrees vertical rotation, and so on. For each image I have two outputs (the x an y offset, that is the vectors components). so if I have a 9x9 grid, my matrix will be 9x9x2 and the vector with the known angles will be 9x2. My unknowns will be 6: 2 intercepts and 4 slopes (relative to both rotations and both offsets for each rotation).
I don't really understand how I should input these data into the mvregress command, especially the part regarding the fact that I have more than one response variable (in my case 2), that is the dimension of the response matrix Y. If this happens, it says:
If d > 1 and all d dimensions have the same design matrix, then you can specify X as a single n-by-p design matrix (not in a cell array).
If d > 1 and all n observations have the same design matrix, then you can specify X as a cell array containing a single d-by-K design matrix.
If d > 1 and all n observations do not have the same design matrix, then specify X as a cell array of length n containing d-by-K design matrices.
What does exactly means? How can I understand in which case am I? How should I input the data anyway?
Thank you all very much!
0 Kommentare
Akzeptierte Antwort
the cyclist
am 1 Dez. 2017
My answer to this question gives a few examples of using different design matrices, depending on whether you want common slopes and/or intercepts. Take a look and see if that helps.
2 Kommentare
the cyclist
am 2 Dez. 2017
If you look at the "Output Arguments" section of the documentation for mvregress, it specifies the dimensions of the beta output, for each type of design matrix entry. But it's not clear (at least to me) the exact ordering of the coefficients. If you also look up at the examples, it looks like the intercepts are always listed first (either at the top of vector output, or left-most column of matrix output).
What I will typically do to be sure I am interpreting things correctly is to put in some pretend data where I know exactly what the coefficients should be, so that I understand the output of that model.
Also, be a little bit careful in your notation compared to the MATLAB documentation. They call the intercept terms "alpha".
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!