Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Vancouver_application_8-8-2018/submitted JASA data/Bryan Graham Stata software/simulation_600.g
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
87 lines (61 sloc)
2.98 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new; | |
library pgraph yang; | |
output file = C:/Users/ke/google_drive/keyang/research/vancouvor_housing/tem/500rep/july27_2018/ase600.txt reset; | |
et1=hsec; | |
/*Define control parameter values*/ | |
d=4; /*number of variables */ | |
n=600;/*number of obs */ | |
rep=500; | |
/* Bandwidth selection | |
load data[n*rep,d] = C:/Users/Ke/GoogleDrive/keyang/research/vancouvor_housing/mc/cross_section_data600100100.out; | |
load lw600[600*100,8] = C:/Users/Ke/GoogleDrive/keyang/research/vancouvor_housing/tem/500rep/band_sel_070717_ss600_rep100.txt; | |
lw600ase=meanc((lw600-data[.,8]).^2); | |
lw600bias=meanc(lw600-data[.,8]); | |
load data300[n2*rep,d] = C:/Users/Ke/GoogleDrive/keyang/research/vancouvor_housing/mc/cross_section_data300100100.out; | |
load lw300[300*100,8] = C:/Users/Ke/GoogleDrive/keyang/research/vancouvor_housing/tem/500rep/band_sel_070717_ss300_rep100.txt; | |
lw300ase=meanc((lw300-data300[.,8]).^2); | |
lw300bias=meanc(lw300-data300[.,8]); | |
ase_band=seqa(0.75, 0.1, 8)~lw300ase~lw600ase; | |
print "ase vs band"; | |
print ase_band; | |
bias_band=seqa(0.75, 0.1, 8)~lw300bias~lw600bias; | |
print "bias vs band"; | |
print bias_band; | |
stop; | |
*/ | |
//call ols(0,lw300, ones(8,1)~seqa(0.75, 0.1, 8)~(seqa(0.75,0.1,8)).^2~(seqa(0.75,0.1,8)).^3); | |
//call ols(0,lw600, ones(8,1)~seqa(0.75, 0.1, 8)~(seqa(0.75,0.1,8)).^2~(seqa(0.75,0.1,8)).^3); | |
//stop; | |
//print lw600~lw300;stop; | |
//load iptlw[n*rep,1] = C:/Users/Kyang/GoogleDrive/keyang/research/vancouvor_housing/tem/500rep/iptlw_b75.txt; | |
//load ipt_ols[rep,2] = C:/Users/Kyang/GoogleDrive/keyang/research/vancouvor_housing/tem/500rep/ipt_and_ols_06212017.txt; | |
load gipt[n*rep,d] = C:/Users/ke/Google_Drive/keyang/research/vancouvor_housing/tem/500rep/july27_2018/all_data_600.txt; | |
load ipt[n*rep,d] = C:/Users/ke/Google_Drive/keyang/research/vancouvor_housing/tem/500rep/july27_2018/all_data_600_ipt.txt; | |
load did[n*rep,d] = C:/Users/ke/Google_Drive/keyang/research/vancouvor_housing/tem/500rep/july27_2018/all_data_600_did.txt; | |
//abc=ones(n,1); | |
//ipt_ols=ipt_ols.*.ones(n,1); | |
//ipt_ols300=ipt_ols300.*.ones(n2,1); | |
//res=data~iptlw~ipt_ols; | |
res=gipt[.,4]~gipt[.,2]~ipt[.,2]~did[.,2]; | |
//sam1=res[1:600,.]; | |
//surface(sam1[.,2],sam1[.,3],sam1[.,8]);stop; | |
//bias=(res[.,8]-res[.,9])~(res[.,8]-res[.,10])~(res[.,8]-res[.,11]); | |
//se=((res[.,8]-res[.,9]).^2)~(res[.,8]-res[.,10]).^2~(res[.,8]-res[.,11]).^2; | |
bias=(res[.,1]-res[.,2])~(res[.,1]-res[.,3])~(res[.,1]-res[.,4]); | |
se=bias.^2; | |
//se=(res[.,1]-res[.,2]).^2~(res[.,1]-res[.,3]).^2~(res[.,1]-res[.,4]).^2; | |
ase=meanc((reshape(se[.,1],500,n))')~meanc((reshape(se[.,2],500,n))')~meanc((reshape(se[.,3],500,n))'); | |
print ase; | |
stop; | |
//aseplot=meanc((reshape(se[.,1],500,600))')~meanc((reshape(se[.,2],500,600))')~meanc((reshape(se[.,3],500,600))'); | |
//print "iptlw ipt ols"; | |
//print "sample size =" n; | |
//print "bias"; | |
//print meanc(bias)'; | |
//print "ase"; | |
//print meanc(se)'; | |
//print "smple size =" n2; | |
//print "IPTLW IPT OLS"; | |
//print meanc(bias)'; | |
//print meanc(se)'; | |
//print meanc(res[.,8]); |