xKDR / CRRao.jl

MIT License
35 stars 22 forks source link

Add new types for priors and models. #15

Open codetalker7 opened 2 years ago

codetalker7 commented 2 years ago

Currently the five priors: Prior_Ridge, Prior_Laplace, Prior_Cauchy, Prior_TDist and Prior_Uniform, are not grouped under an umbrella type. Introducing a new supertype for these priors might help in a clearer interface, as well as writing documentation. Since the API remains the same no matter what type of prior we are using, this is a good idea that might help to make the code better.

A similar thing holds for the current four regression models. We don't have any kind of type hierarchy currently, and it seems like these are independent types and not grouped under a common umbrella. Thinking about this might be a good idea. This also helps in writing cleaner and more understandable documentation.

sourish-cmi commented 2 years ago

Yes - this is a very good idea. I am planning to implement the Prior_HorseShoe and its variants. If we can bring all the priors under single umbrella that will be great.

sourish-cmi commented 2 years ago

@codetalker7 any thought on this issue?

sourish-cmi commented 2 years ago

@codetalker7 @ShouvikGhosh2048 any thought? please comment

codetalker7 commented 2 years ago

Hi @sourish-cmi. As a starting point, I think it'll be enough to just introduce a new type (say called Prior), and have all other types subtype it.

abstract type Prior end

"""
 docstring for Ridge
"""
struct Ridge <: Prior end

# define all other priors like this
sourish-cmi commented 2 years ago

great @codetalker7, did you get a chance to test it? I can try it