UofTActuarial / LRMoE.jl

LRMoE implemented in Julia
https://UofTActuarial.github.io/LRMoE.jl
MIT License
7 stars 1 forks source link

Generic zero inflated random variable #11

Open azev77 opened 3 years ago

azev77 commented 3 years ago

Hi and thanks for this package! I'm curious would it be possible to create a zero-inflated random variable generically? For example, suppose d1 & d2 are existing random variables. d3 = MixtureModel([d1, d2], [0.5, 0.5]) returns a new random variable d4 = Truncated(d3, 0.25, 1.8) returns a new random variable

Is it possible to do something like: d5 = ZI(d4, p)

I realize there may not be some properties that automatically work for some new ZI random variables.. Btw, isn't ZI essentially a special case of MixtureModel?

Check out discussion here.

sparktseung commented 3 years ago

Thanks for the suggestion!

Since the package was originally designed for insurance application (where zero inflation is prominent), zero inflation is separated out as a special case of expert functions.

For this reason, in the current version, the optimization function for zero inflation probability is separated from the parameters in the positive part. Looking back, this is not the best design, as zero probability should be treated just as a parameter of expert functions.

To make the package more suited for adding general MixtureModel distributions, what I have in mind is: