How to retrend data, after detrending it?
古いコメントを表示
I have some data (inputClosePrice)
i log it, detrend it, and then normalise it.
How can i now get back to the intial set of data for a given point?
detrend function:
https://au.mathworks.com/help/ident/ref/iddata.detrend.html
I've had a look at the retrend function,however, in the example they talk abotu iddata, linear ARX model, simulate model, and i do none of that, as part of my detrending process, so i'm unsure what to send the retrend function.
--- sample of my code given below:
sdata_log = log10(inputClosePrice); %log the data
detrend_LogPrice = detrend(sdata_log, inputPolyDegree); %detrended log price
normalised_detrendedData = detrend_LogPrice;
回答 (1 件)
Star Strider
2021 年 6 月 7 日
0 投票
There are three different ddetrend funcitons. The one you want is: detrend however it does not return the function it used to detrend the data. If you want to retain that function, use polyfit and polyval instead to create and evaluate the detrending polynomial, then subtract it from the data, do whatever analysis you want, then add that polynomial back to the processed data.
6 件のコメント
Rizwan Khan
2021 年 6 月 8 日
Star Strider
2021 年 6 月 8 日
I do not understand tha problem, so I have no idea how to reply.
Rizwan Khan
2021 年 6 月 9 日
Star Strider
2021 年 6 月 9 日
I do not understand the reason for normalising the residuals. The residuals themselves would not appear to be important. The entire purpoose of detrending is to remove a linear or polynomial trend from a recorded signal, something that can be done by simple regression. Then to reconstitute the processed signal, simply add the removed trend back.
I agree that reversing the order of operations is important if the intent is to reconstitute the original signal baseline trend after processing it.
Rizwan Khan
2021 年 6 月 9 日
Star Strider
2021 年 6 月 9 日
Please share the data used to produce that plot, and a detailed description of what you want to do with it.
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
