draw from truncated normal
Posted: Tue Oct 13, 2015 9:28 am
Dear all,
I want to draw a latent variable from a truncated normal. Here I repeat the crucial commands. First, I specifiy two policy actions, easing and tightening:
set easing= loose ==1.0
set tighhtening= tight ==-1.0
set ystar = %if(tightening,-1.0,%if(easing,1.0,0.0))
The latent variable should be above 1 for easing, below -1 for tightening and between 1 and -1 otherwise:
compute ystar(time)=%if(easing(time),%rantruncate(cmean,cstddev,1.0,%na),$
%if(tightening(time),%rantruncate(cmean,cstddev,%na,-1.0),$
%rantruncate(cmean,cstddev,-1.0,1.0)))
The problem is that the estimated ystar is never below -1 despite several tightening observations. Where is the flaw?
Thanks a lot for your help.
I want to draw a latent variable from a truncated normal. Here I repeat the crucial commands. First, I specifiy two policy actions, easing and tightening:
set easing= loose ==1.0
set tighhtening= tight ==-1.0
set ystar = %if(tightening,-1.0,%if(easing,1.0,0.0))
The latent variable should be above 1 for easing, below -1 for tightening and between 1 and -1 otherwise:
compute ystar(time)=%if(easing(time),%rantruncate(cmean,cstddev,1.0,%na),$
%if(tightening(time),%rantruncate(cmean,cstddev,%na,-1.0),$
%rantruncate(cmean,cstddev,-1.0,1.0)))
The problem is that the estimated ystar is never below -1 despite several tightening observations. Where is the flaw?
Thanks a lot for your help.