Closed juanfung closed 5 years ago
Trying to call dpm_init()
via causal-sims.jl
, get the following related error:
ERROR: TypeError: non-boolean (BitArray{1}) used in boolean context Stacktrace: [1] #dpm_init#60(::Bool, ::Function, ::CausalMixtures.RawData, ::InputPriors, ::InputParams) at /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/dpm_init.jl:82 [2] dpm_init(::CausalMixtures.RawData, ::InputPriors, ::InputParams) at /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/dpm_init.jl:35 [3] top-level scope at util.jl:156
The culprit is line 82 of dpm_init.jl
:
## truncated normal support for latent data
lower = ifelse( d .== 1, 0 : -Inf )
upper = ifelse( d .== 1, Inf : 0 )
Should be:
## truncated normal support for latent data
lower = [ di == 1 ? 0 : -Inf for di in d ]
upper = [ di == 1 ? Inf : 0 for di in d ]
The dpm_init()
issue fixed by feccfabece12ae1d693ae0e0b8ce6281f1be1ec5
Should be fixed, but leaving open for now.
This issue seems to be resolved.
For v0.7+.
Eg, consider the following (line 98 in
causal-hedonic.jl
)This throws the following error:
The following works:
d_obs = [ di > 0 ? 1 : 0 for di in d_star ]
.TODO:
ifelse
for element-wise comparisons in vectors.