How can i change the linestyle in the parcorr function?

2 visualizzazioni (ultimi 30 giorni)
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");

Risposta accettata

Ive J
Ive J il 6 Set 2021
Modificato: Ive J il 6 Set 2021
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 Commenti
Till Hasselmann
Till Hasselmann il 6 Set 2021
Modificato: Till Hasselmann il 6 Set 2021
Thank you very much. It works perfectly!
Ive J
Ive J il 6 Set 2021
My pleasure.
You can of course modify line width or color as well (my edited answer).

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by