how to detemine this residual matrix ?
Show older comments
I calculate the cumulative sum of a matrix :Gm,n(i,j)
Now, the next step is '' we adopt the simplest function of a plane-fitting (i.e.Gm,n(i,j)=ai+bj+c ) to fit the trending for each surface Gm,n and determine the residual matrix ym,n(i,j).''
Please, can someone give me the code how to detemine this residual matrix, please ?
Answers (1)
Peng Li
on 10 Aug 2020
0 votes
Interesting. This is an application of the detrended fluctuation analysis (DFA) to a 2D image. Based on what your screenshot shows, it implements the algorithm similarly like being implemented to a time series -- cut into segments based on a time scale s (or here a time-spatial scale), integration (cumulative sum), linear fitting to get residual, and finally there should be a log-log fit between s and F(s).
To answer the specific question you asked, the residual is nothing but the point difference between G_{m,n} and \tilde{G}_{m,n}. This means, the y variable y_{m,n} = G_{m,n} - \tide{G}_{m,n}. F is simply the average of sum of squared y.
4 Comments
Nadya
on 10 Aug 2020
Peng Li
on 10 Aug 2020
\tilde{G}_{m,n} is the linear 2D fitting ai+bj+c. Basically c is the intercept, a and b being the slope along i and j respectively. Could you try coding it by yourself first? It should be straightforward now if you understand the algorithm. It's a bit wierd I guess if I do that for you lol
Nadya
on 11 Aug 2020
Peng Li
on 12 Aug 2020
understand and I would just like to encourage you to try it out and ask back here if you get any issues. That way you probably have higher chance to get a solution. I will see what I can do but honestly I have short of time this week and next to meet multiple deadlines, conferences ...
Categories
Find more on Univariate Discrete Distributions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!