Hello everyone,
I have a time series that has 10 short term rates (f1 f2 f3 f4 f5 f6 f7 f8 f9 f10) which I am trying to aggregate into two components (looks like two is ideal from the eigen values).
The data has a dummy 1 when a specific event occurred and 0 otherwise.
I have created two group of variables :
1) the difference f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 (a*) only on days in which the dummy is 1 (the literature uses this and I have created it so that I can compare). (there are 300 obs)
2) the difference f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 (b*) every day (there are 7000 obs)
forvalues i = 0/10 {
if `i' > 1 {
local j = `i'+1
gen a`i'=.
replace a`i' = d.f`i' if event!=0 &
}
summ a`i'
replace a`i' = (a`i' - r(mean))/r(sd)
} //*normalized*//
forvalues i = 0/10 {
if `i' > 1 {
local j = `i'+1
gen b`i'=.
replace b`i' = d.f`i'
}
summ b`i'
replace b`i' = (b`i' - r(mean))/r(sd)
} //*normiled and created the shocks on events*//
Then I run a Principle component analysis on them.
pca a*, comp(2) blank(.3) //*2 comp*//
predict m1 m2
pca b*, comp(2) blank(.3) //2 comp///
predict t1 t2
The first one generates value only for days of the event (which makes sense) . The second one should generate values for every day but instead it generates them only for the day of the event. WHICH MAKES ABSOLUTELY NO SENSE.
Does anyone know what could be the issue? Any help is highly appreciated!
Best,
Giulia
I have a time series that has 10 short term rates (f1 f2 f3 f4 f5 f6 f7 f8 f9 f10) which I am trying to aggregate into two components (looks like two is ideal from the eigen values).
The data has a dummy 1 when a specific event occurred and 0 otherwise.
I have created two group of variables :
1) the difference f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 (a*) only on days in which the dummy is 1 (the literature uses this and I have created it so that I can compare). (there are 300 obs)
2) the difference f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 (b*) every day (there are 7000 obs)
forvalues i = 0/10 {
if `i' > 1 {
local j = `i'+1
gen a`i'=.
replace a`i' = d.f`i' if event!=0 &
}
summ a`i'
replace a`i' = (a`i' - r(mean))/r(sd)
} //*normalized*//
forvalues i = 0/10 {
if `i' > 1 {
local j = `i'+1
gen b`i'=.
replace b`i' = d.f`i'
}
summ b`i'
replace b`i' = (b`i' - r(mean))/r(sd)
} //*normiled and created the shocks on events*//
Then I run a Principle component analysis on them.
pca a*, comp(2) blank(.3) //*2 comp*//
predict m1 m2
pca b*, comp(2) blank(.3) //2 comp///
predict t1 t2
The first one generates value only for days of the event (which makes sense) . The second one should generate values for every day but instead it generates them only for the day of the event. WHICH MAKES ABSOLUTELY NO SENSE.
Does anyone know what could be the issue? Any help is highly appreciated!
Best,
Giulia
Comment