Clear Filters
Clear Filters

linear mixed-effects model (fitlme) add array variable

1 view (last 30 days)
Hello community!
I would like to run a linear mixed-effect model using fitlme and include one fixed effect which instead of having one value per observations has an array (i.e., a reflectance spectrum) for each observation. The other fixed (and random) effect are instead single values.
I want to understand the variance contribution from the entire array (i.e., full spectrum) on my response variable rather than from its individual elements (i.e., reflectance at single wavelengths). How to modify the fitlme synthax for this?
Thank you in advance for any suggestion.

Answers (2)

Jeff Miller
Jeff Miller on 24 Jan 2023
I'm pretty sure the predictors have to be single values, so you can't feed in an array as a single unified predictor. You could feed in the individual elements, but you say you don't want to do that.
The only other possibility would be to use a single categorical predictor to represent the whole spectrum array for each case. For example, if you had only two spectrum patterns across your whole dataset, then you could use a predictor variable coding them as type A and type B (or whatever). Something like this would work if you can group the different spectrum arrays into a small-ish number of categories; otherwise, I have no idea.
P. Dodo
P. Dodo on 25 Jan 2023
Thank you for your answer Jeff. The categorical predictor approach would not work because spectra are very variable and cannot be grouped into types, but I see your point.
Jeff Miller
Jeff Miller on 25 Jan 2023
Too bad. In that case, the PCA approach suggested by @the cyclist seems the most promising.
Just out of curiousity, can you describe what sort of output you would hope to get if you could get fitlme to handle a vector-type predictor? I'm having trouble envisioning just what is meant by the "variance contribution from the entire array" as opposed to the individual elements. If you mean contributions due to (say) products of pairs of elements, products of triples, etc, then you could form those in advance and feed them into the equation as further individual predictors, like in polynomial regression.

Sign in to comment.

the cyclist
the cyclist on 25 Jan 2023
I am by no means an expert on image processing, but one possibility is to preprocess your images to extract individual "features" that can then be used in a regression model. If you have an m-by-n array (of some kind of reflectance measure), then you have m*n features in the original data space. That will capture a certain amount of noise, but if you do some kind of dimensional reduction technique (such as PCA), then you might be able to extract a smaller number of more meaningful features (e.g. things like "overall reflectance", or "left-brighter-than-right") that could be predictors of the response.
You will not have one fit coefficent for "fixed effect of image", but you may end up with just a few.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!