Non-parametric residual bootstrap, extreme empirical distribution.

2 Ansichten (letzte 30 Tage)
Mercu Vestergaard
Mercu Vestergaard am 3 Sep. 2013
I am trying to make statistical inference in a stock return predictability study using the bootstrap methodology.
However I am not sure my code works perfectly, since it provides some rather extreme distributions of my t-statistics, (-12 to -24), heres my code:
Anyone who might be able to take a look?
%quarterly_DATA_IS_DP%
%loading data
[dp]=xlsread('Variables.xlsx','5yr','g20:g127');
[nom]=xlsread('Variables.xlsx','5yr','b20:b127');
[real]=xlsread('Variables.xlsx','5yr','c20:c127');
[excess]=xlsread('Variables.xlsx','5yr','d20:d127');
mean_x_t=mean(dp);
%rows and colums in data%
[rows columns]=size(nom);
const=ones(rows,1);
%OLS regression of nom returns on dp, with NW-std.errors.%
results=nwest(nom,dp,5)
results=nwest(real,dp,5)
results=nwest(excess,dp,5)
%(4) in Rapach Wohar
test=ols(excess,const);
e1=test.resid; %residuals from return regression %
lagY=[NaN; dp(1:end-1)];
dp_lag=[const lagY];
%(5) in rapach Wohar)
[b,bint,r]=regress(dp,dp_lag);
%Reisudals from GDP%
e2=r(2:end);
e1=e1(2:end);
%residual vector, with e1 and e2%
e=[e1 e2];
%number of draws (T+100)
T=rows+100;
r_star_t=zeros(T,1);
x_star_t=zeros(T,1);
tstat_v=zeros(200,1);
N=2000; %0000replications
for j=1:N;
%drawing randomly with replacement
data=datasample(e, T);
%estimating DGP
for i=1:T;
r_star_t(i)=test.beta+data(i,1);
if i==1;
x_star_t(i)=b(1,1)+b(2,1)*mean_x_t+data(i,2);
else
x_star_t(i)=b(1,1)+b(2,1)*x_star_t(i-1)+data(i,2);
end
end;
%drop 100
r_star_t=(r_star_t(101:end));
x_star_t=(x_star_t(101:end));
%OLS regression of pseudo data
pseudo=nwest(r_star_t,x_star_t,5);
%tstat
tstat_v(j)=pseudo.tstat;
end;
hist(tstat_v)
xlswrite('bootstrap_dp5',tstat_v,'F2:F2002')

Antworten (0)

Kategorien

Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by