Dear Todd,
in VARTVPKSC.src, STEP 4: Draw {select_draw_1,....,select_draw_T}, the states used in the KSC mixture distribution - could you please tell me why we have to divide by sqrt(var_mixdist(i)) in line 4 of the following loop?
do ii = 1,nvar
do vtime=stpt,endpt
ewise tempinside(i) = (ystar2mat(vtime)(ii) - (2.*deltadraw(vtime)(ii) + mean_mixdist(i)))/sqrt(var_mixdist(i))
ewise tempdensity(i) = %density(tempinside(i))/sqrt(var_mixdist(i))
comp selection = pr_mixdist.*tempdensity
comp select_draw(vtime)(ii) = %ranbranch(selection)
end do vtime
end do ii
I tried looking up how %density calculates the standard normal density but I could not find the answer in the manuals. If the standard normal density is defined as:
1/sqrt(2*pi*sigma^2)*exp(-.5*((x - mu)^2)/sigma^2)
and I feed %density with (x - mu)/sigma, i.e. tempinside(i), what does %density give me?
Thanks in advance!
