question on putting an initial value smaller than 1 for LOO
Posted: Thu Aug 05, 2010 5:01 am
Hello
I am working on estimating a threshold relationship using the following program
scalar thold
scalar test
scalar i
scalar g
scalar numobs
scalar numth
series dum_thold
series resumsq_loan
numobs = 56
numth =394
for g =0.1 to numth step 0.1
dum_thold = 0
thold = grid(g)
for i=1 to numobs
test = inf(i)
if test > thold then
dum_thold(i) = 1
endif
next
equation thr_reg_loan.ls loan dum_thold*(1/inf-1/thold) (1-dum_thold)*(1/inf-1/thold) do fs trend
resumsq_loan(g) = @ssr
next
if I run it, I get the following result:
0 is not a valid index for vector-series-coefficient RESUMSQ_LOAN(g)@SSR
So the program doesn't run.
However if I put the initial value of g=1, than it works.
But I want to use loop for values from 0.1-394, step 0.1
Does anyone have a suggestion on this.
Thank you
I am working on estimating a threshold relationship using the following program
scalar thold
scalar test
scalar i
scalar g
scalar numobs
scalar numth
series dum_thold
series resumsq_loan
numobs = 56
numth =394
for g =0.1 to numth step 0.1
dum_thold = 0
thold = grid(g)
for i=1 to numobs
test = inf(i)
if test > thold then
dum_thold(i) = 1
endif
next
equation thr_reg_loan.ls loan dum_thold*(1/inf-1/thold) (1-dum_thold)*(1/inf-1/thold) do fs trend
resumsq_loan(g) = @ssr
next
if I run it, I get the following result:
0 is not a valid index for vector-series-coefficient RESUMSQ_LOAN(g)@SSR
So the program doesn't run.
However if I put the initial value of g=1, than it works.
But I want to use loop for values from 0.1-394, step 0.1
Does anyone have a suggestion on this.
Thank you