Note that there are some explanatory texts on larger screens.

plurals
  1. POIndex exceeds matrix dimensions
    text
    copied!<p>I try to forecast few step ahead. And I encountered the problem of <strong>Index exceeds matrix dimensions</strong> at volrv(index2,index1)=sum(rv1m(index2-index1+1:index2,1)); Although I have checked the matrix size is ok. I dont understand why. HELP please</p> <pre><code>load sp100_88_03_for.txt; [y]=sp100_88_03_for; T=3585; % In-Sample: 1/1/1988-9/28/2001 N = size(y,1); dataf = 100*(log(y(2:N))-log(y(1:N-1))); % data to be forecast N = N - 1; % You loose 1 obs'n in taking the lag clear y; %ERRORS datafm = mean(dataf); %mean of all the sample for the forecast error errors = dataf - datafm; % errors errors2 = (dataf(T:N)-datafm).^2; % vector with squared errors % Loading Realized Volatilities load real_vol_adj.txt RV_adj = real_vol_adj; rv1m = RV_adj(:,1); rv5m = RV_adj(:,2); clear real_vol*; clear RV_adj*; % Calculating the proxy for the volatility process volr2 = []; % volatilities from sum of squared daily returns volrv = []; % volatilities from sum of daily realized volatilities volrd = []; % volatilities from d-day period returns (d=1,2,...,22) rsquared=(dataf(T:N)-mean(dataf(T:N))).^2; volr2(:,1)=rsquared; volrv(:,1)=rv1m; for index1=2:22; volr2(1:index1-1,index1) = 0; volrv(1:index1-1,index1) = 0; for index2=index1:N-T+1 volr2(index2,index1)=sum(rsquared(index2-index1+1:index2,1)); volrv(index2,index1)=sum(rv1m(index2-index1+1:index2,1)); end end </code></pre> <p><strong>Error in ==> volrv(index2,index1)=sum(rv1m(index2-index1+1:index2,1));</strong></p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload