<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ICSS &#8211; Aptech</title>
	<atom:link href="https://www.aptech.com/blog/tag/icss/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aptech.com</link>
	<description>GAUSS Software - Fastest Platform for Data Analytics</description>
	<lastBuildDate>Tue, 20 Jun 2023 15:44:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>A Simple Test for Structural Breaks in Variance</title>
		<link>https://www.aptech.com/blog/a-simple-test-for-structural-breaks-in-variance/</link>
					<comments>https://www.aptech.com/blog/a-simple-test-for-structural-breaks-in-variance/#respond</comments>
		
		<dc:creator><![CDATA[Eric]]></dc:creator>
		<pubDate>Fri, 30 Nov 2018 21:02:11 +0000</pubDate>
				<category><![CDATA[Econometrics]]></category>
		<category><![CDATA[Time Series]]></category>
		<category><![CDATA[ICSS]]></category>
		<category><![CDATA[structural breaks]]></category>
		<category><![CDATA[time series]]></category>
		<guid isPermaLink="false">https://www.aptech.com/?p=17073</guid>

					<description><![CDATA[Though many standard econometric models assume that variance is constant, structural breaks in variance are well-documented, particularly in economic and finance data. If these changes are not accurately accounted for, they can hinder forecast inference measures, such as forecast variances and intervals. In this blog, we consider a tool that can be used to help locate structural breaks in variance -- the iterative cumulative sum of squares algorithm(ICSS) (Inclan and Tiao, 1994).]]></description>
										<content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>
<p>Though many standard econometric models assume that variance is constant, <a href="https://www.aptech.com/structural-breaks/">structural breaks</a> in variance are well-documented, particularly in economic and finance data. If these changes are not accurately accounted for, they can hinder forecast inference measures, such as forecast variances and intervals.</p>
<p>In this blog, we consider a tool that can be used to help locate <a href="https://www.aptech.com/structural-breaks/">structural breaks</a> in variance -- the <a href="https://www.jstor.org/stable/2290916?seq=1#page_scan_tab_contents">iterative cumulative sum of squares algorithm</a> (ICSS) (Inclan and Tiao, 1994).</p>
<h2 id="centered-cumulative-sum-of-squares">Centered Cumulative Sum of Squares</h2>
<p>The first step of the algorithm is to find the cumulative sum of squares test statistic. This statistic can be found in four easy steps:
    <!-- MathJax configuration -->
    <style>
        .mjx-svg-href {
            fill: "inherit" !important;
            stroke: "inherit" !important;
        }
    </style>
    <script type="text/x-mathjax-config">
        MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "AMS"} } });
    </script>
    <script type="text/javascript">
window.MathJax = {
  tex2jax: {
    inlineMath: [ ['$','$'] ],
    displayMath: [ ['$$','$$'] ],
    processEscapes: true,
    processEnvironments: true
  },
  // Center justify equations in code and markdown cells. Elsewhere
  // we use CSS to left justify single line equations in code cells.
  displayAlign: 'center',
  "HTML-CSS": {
    styles: {'.MathJax_Display': {"margin": 0}},
    linebreaks: { automatic: false }
  },
  "SVG": {
    styles: {'.MathJax_SVG_Display': {"margin": 0}},
    linebreaks: { automatic: false }
  },
  showProcessingMessages: false,
  messageStyle: "none",
  menuSettings: { zoom: "Click" },
  AuthorInit: function() {
    MathJax.Hub.Register.StartupHook("End", function() {
            var timeout = false, // holder for timeout id
            delay = 250; // delay after event is "complete" to run callback
            var shrinkMath = function() {
              //var dispFormulas = document.getElementsByClassName("formula");
              var dispFormulas = document.getElementsByClassName("MathJax_SVG_Display");
              if (dispFormulas){
                // caculate relative size of indentation
                var contentTest = document.getElementsByTagName("body")[0];
                var nodesWidth = contentTest.offsetWidth;
                // if you have indentation
                var mathIndent = MathJax.Hub.config.displayIndent; //assuming px's
                var mathIndentValue = mathIndent.substring(0,mathIndent.length - 2);
                for (var i=0; i<dispFormulas.length; i++){
                  var dispFormula = dispFormulas[i];
                  var wrapper = dispFormula;
                  //var wrapper = dispFormula.getElementsByClassName("MathJax_Preview")[0].nextSibling;
                  var child = wrapper.firstChild;
                  wrapper.style.transformOrigin = "center"; //or top-left if you left-align your equations
                  var oldScale = child.style.transform;
                  //var newValue = Math.min(0.80*dispFormula.offsetWidth / child.offsetWidth,1.0).toFixed(2);
                  var newValue = Math.min(dispFormula.offsetWidth / child.offsetWidth,1.0).toFixed(2);
                  var newScale = "scale(" + newValue + ")";
                  if(newValue != "NaN" && !(newScale === oldScale)){
                    wrapper.style.transform = newScale;
                    wrapper.style["margin-left"]= Math.pow(newValue,4)*mathIndentValue + "px";
                    var wrapperStyle = window.getComputedStyle(wrapper);
                    var wrapperHeight = parseFloat(wrapperStyle.height);
                    wrapper.style.height = "" + (wrapperHeight * newValue) + "px";
                    if(newValue === "1.00"){
                      wrapper.style.cursor = "";
                      wrapper.style.height = "";
                    }
                    else {
                      wrapper.style.cursor = "zoom-in";
                    }
                  }

                }
            }
            };
            shrinkMath();
            window.addEventListener('resize', function() {
              clearTimeout(timeout);
              timeout = setTimeout(shrinkMath, delay);
            });
          });
  }
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_SVG"></script></p>
<ol>
<li>Using the model error terms find the cumulative sum of squares (CSS) for all potential breakpoints observations 1 through <em>k</em> :
$$C_1 = \sum_{t=1}^1 a_t^2 \\ C_2 = \sum_{t=1}^2 a_t^2 \\ \vdots \\ C_k = \sum_{t=1}^k a_t^2 \\ C_T = \sum_{t=1}^T a_t^2$$
 
$$ a = \begin{bmatrix} 0.1 \\ 0.3 \\ 0.5 \\ 0.7 \\ 0.2 \end{bmatrix} \rightarrow C_{k=1,2,..T} = \begin{bmatrix} 0.01 \\ 0.1 \\ 0.35 \\ 0.84 \\ 0.88 \end{bmatrix} $$
 </li>
<li>Normalize and center the cumulative sum of squares, using the partial series CSS , $C_k$, and the full series CSS, $C_T$ :
$$D_k = \frac{C_k}{C_T} - \frac{k}{T}\\$$
 
$$D_{k=1,2,..T} = \begin{bmatrix} 0.01/0.88 \\ 0.1/0.88 \\ 0.35/0.88 \\ 0.84/0.88 \\ 0.88/0.88 \end{bmatrix} - \begin{bmatrix} 1/5 \\ 2/5 \\ 3/5 \\ 4/5 \\ 5/5 \end{bmatrix} = \begin{bmatrix} -0.189\\ -0.286 \\ -0.202\\ 0.155 \\ 0.000 \end{bmatrix} $$
 </li>
<li>Find the maximum centered cumulative sum of squares. The potential breakpoint, k*, is the location in the series of the maximum absolute value of the centered cumulative sum of squares, $D_{k^{*}}$ :
$$D_{k^{*}} = \max\limits_{k} | D_k |\\$$
 
$$ \begin{bmatrix} abs(-0.189)\\ abs(-0.286) \\ abs(-0.202)\\ abs(0.155)\\ abs(0.000) \end{bmatrix} \rightarrow D_{k^{*}} = 0.286, k^{*} = 2 $$
 </li>
<li>Finally, if $IT = \sqrt{T/2}D_{k^{*}}$ exceeds the critical value of the limiting distribution, then $k^*$ represents a statistically significant breakpoint.</li>
</ol>
<h2 id="iterative-cumulative-sum-of-squares-algorithm">Iterative Cumulative Sum of Squares Algorithm</h2>
<p>Finding $k^*$ would be sufficient if we were certain that there was only one break point in the variance. However, how can we definitively know that this is the case?</p>
<p>Because we cannot eliminate the possibility that there are multiple breaks in the variance, we must iteratively search for all potential additional breakpoints.</p>
<p>The ICSS algorithm searches for breakpoints in each of the sections created by newly found breakpoints. Once new breakpoints are no longer found, the search stops.</p>
<p>Considering our hypothetical example, our first potential break was located at $k^{*} = 2$, therefore, our iterative search for breakpoints would begin again in the section of data bounded by $t = 3$ and $t = 5$.</p>
<h2 id="using-the-icss-algorithm-in-gauss">Using the ICSS algorithm in GAUSS</h2>
<p>The ICSS test is available in the GAUSS <a href="https://github.com/aptech/gauss-carrion-library" target="_blank" rel="noopener">carrionlib</a> package. This package is a free package that should be installed using the <a href="https://www.aptech.com/blog/gauss-package-manager-basics/" target="_blank" rel="noopener">GAUSS Package Manager</a>.</p>
<div class="alert alert-info" role="alert">For more information about using GAUSS library, please see our blog, <a href="https://www.aptech.com/blog/using-gauss-packages-complete-guide/" target="_blank" rel="noopener">&quot;Using GAUSS Packages [Complete Guide]&quot;</a>.</div>
<h3 id="the-icss-procedure">The icss Procedure</h3>
<p>The carrionlib package includes the <code>icss</code> procedure for implementing the ICSS test. Because the <code>icss</code> function also provides options to perform the modifications discussed in the paper, the <code>icss</code> function requires the following three inputs:</p>
<hr />
<dl>
<dt>e</dt>
<dd>Vector, the stochastic series to be tested.</dd>
<dt>test</dt>
<dd>Scalar, an indicator of which test to run, should always be set to zero to run the standard ICSS test.</dd>
<dt>cri</dt>
<dd>Vector, 3x1, sets the bandwidth for the modification models. This is irrelevant to the standard ICSS and can be set to any 3x1 vector.</dd>
</dl>
<hr />
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">{ cp, nbre } = icss(e, test, cri);</code></pre>
<h2 id="empirical-example">Empirical Example</h2>
<p>Let's use quick empirical example to get a better understanding of how to use the <code>icss</code> procedure. </p>
<p><a href="https://www.aptech.com/wp-content/uploads/2018/11/gblog-sp500-icss-test.png"><img class="aligncenter size-full wp-image-18561" src="https://www.aptech.com/wp-content/uploads/2018/11/gblog-sp500-icss-test.png" alt="ICSS structural break test." width="800" height="400" /></a></p>
<p>Today, we'll use the S&amp;P 500 data provided by <a href="http://www.aefin.es/articulos/pdf/A4-2_443809.pdf">Sanso, Arago, and Carrion-i-Silvestre, 2004</a> to demonstrate how to use the <code>icss</code> procedure.</p>
<p>The first step is to load the library and load our data using the <a href="https://docs.aptech.com/gauss/loadd.html" target="_blank" rel="noopener"><code>loadd</code></a> procedure: </p>
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">// Load library
new;
library carrionlib;

// Load S&amp;P data
x = loadd("sp.dat");</code></pre>
<p>Next, to prepare our data for testing, we'll demean our data:</p>
<pre class="hljs-container hljs-container-solo"><code>// Demean data
e = x - meanc(x);</code></pre>
<p>Finally we are ready to run our test:</p>
<pre class="hljs-container hljs-container-solo"><code>// Set our test to run ICSS
test = 0;

// Set cri vector to be any
// 3x1 vector
cri = 0|0|0;

// Run
{ cp, nbre } = icss(e, test, cri);</code></pre>
<p>The function returns two outputs:</p>
<ol>
<li>A vector containing the change points (<em>cp</em>).</li>
<li>A scalar containing the number of break points (<em>nbre</em>).</li>
</ol>
<h2 id="conclusion">Conclusion</h2>
<p>Identifying structural breaks in the variance of data is an important step in modeling time series data. In this tutorial we've covered:</p>
<ul>
<li>What the ICSS algorithm is.</li>
<li>How to use the ICSS algorithm in GAUSS.</li>
</ul>
<p>Code and data from this blog can be found <a href="https://github.com/aptech/gauss_blog/tree/master/time_series/icss-11.30.2018">here</a>.</p>
<h2 id="references">References</h2>
<p>Inclan, C., &amp; Tiao, G. C. (1994). Use of cumulative sums of squares for retrospective detection of changes of variance. <em>Journal of the American Statistical Association, 89</em>(427), 913-923.</p>
<p>Sansó, A., Aragó, V., &amp; Carrion, J. L. (2004). Testing for changes in the unconditional variance of financial time series. <em>Revista de Economía financiera, 4</em>(1), 32-53.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.aptech.com/blog/a-simple-test-for-structural-breaks-in-variance/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
