I am making a time series with the conditional variance and I want to create a plot.
This is my right code.
v1 = sqrt(sigma2_hat)
ont = ones(1418);
UCP = on*(1.96)
LCP = on*(-1.96)
qv1 = UCP.*v1
h1 = plot(dates,y1,'Color','k')
h2 = plot(dates,qv1,'r--','LineWidth',2)
h3 = plot(dates,qv2,'r--','LineWidth',2)
Then, I want to determine the values that are out on the Upper and lower limits (red line).
I did this
st = controlchart(y1,'charttype','i','nsigma',2,'sigma',v1)
If I use a constant v1 (variance) works but I have a matrix and also my time series is a matrix with the same length.
Then, I should know how many points go beyond limits and create a legend.