How can i change the linestyle in the parcorr function?

3 ビュー (過去 30 日間)
Till Hasselmann
Till Hasselmann 2021 年 9 月 6 日
コメント済み: Ive J 2021 年 9 月 6 日
Hey guys,
I am currently working on a Time series Analysis which Data is stored in a 20604x3 double Array called Y_mat. The Code is working how i want it to, however i am trying to change the red bubbled linestyle of the partial autocorrelation properties to be just normal lines. This is for visibility reasons, because my standard deviation is so small that the confidence intervall bounds are hard to make up under the big red bubbles.
I tried experementing with something like set(gcf, 'linestyle', '-') but it doesnt seem to be the right approach at all. I am linking two images, the first is the outcome of my code and the second is an example from a paper how the lines should look like.
The Problem is probably not a big Deal, but i wasnt able to find an established solution in the Forums.
I have one little bonus question aswell, but this one isnt a important point for me. Is it possible that the confidence bounds touch the y-Axis, they are currently beginning at Lag 1.
Thank you so much!
figure
parcorr(Y_mat(:,3))
set(gca,'YTick',[-0.3 0 0.5 1 ])
title('PACF Offshore')
ylabel('partielle Autokorrelation')
xlabel('Lag')
lg = legend("Partielle Autokorrelationsfunktion(Lag)", "95% Konfidenzintervall");

採用された回答

Ive J
Ive J 2021 年 9 月 6 日
編集済み: Ive J 2021 年 9 月 6 日
This should work:
[~, ~, ~, h] = parcorr(randn(1000, 1));
set(gca,'YTick',[-0.3 0 0.5 1 ])
title('PACF Offshore')
ylabel('partielle Autokorrelation')
xlabel('Lag')
lg = legend("Partielle Autokorrelationsfunktion(Lag)", "95% Konfidenzintervall");
sh = findobj(h, 'Type', 'Stem'); % find PACF stem plot
sh.Marker = 'none'; % remove the marker
sh.LineWidth = 1.5;
sh.Color = 'k';
  2 件のコメント
Till Hasselmann
Till Hasselmann 2021 年 9 月 6 日
編集済み: Till Hasselmann 2021 年 9 月 6 日
Thank you very much. It works perfectly!
Ive J
Ive J 2021 年 9 月 6 日
My pleasure.
You can of course modify line width or color as well (my edited answer).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by