-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vinecop structure selection #49
Conversation
* Vincop's data member `vine_matrix_` is now of class RVineMatrix. * `construct_d_vine_matrix` has been moved to RVineMatrix and declared as static member function.
Vine matrix utilities
Vine matrix utilities refactored
Vinecop pdf
* add simulation method to Vinecop class * use unaryExpr to generate uniforms in Bicop::simulate * fixes for requests in in #25 * Declare invert_order in vinecop_class.hpp * Move to_upper_tri from vinecop_class.cpp to vinecop_class.hpp * Move is_element from bicop_class.cpp to bicop_class.hpp * Rename boost_tools.hpp to distribution_tools.hpp * New function simulate_uniform * remove misplaced return in simulate_uniform * vectorized version of Vinecop.simulate() We avoid exceeding the memory by recursively splitting the problem into sub-problems of half the size. This only comes into play when the memory required exceeds 1GB.
the output is a valid vine copula, but does not fit the data yet
the flip function makes an adjustment that corresponds to flipping the data (u,v) -> (v,u)
still uses VineCopula style matrix notation
I will review the code in details ASAP! |
Concerning ii: The same could be said about removing negatively oriented families whenever tau > 0. Anyway, how about we leave it in, but move it to the last position? |
Concerning ii: that is fine with me. Now:
|
|
I've also wondered: is there a way to compute the likelihood of the joint model sequentially as part of the algorithm? I'm asking because, instead of being an argument, the truncation level could/should IMO be selected as part of the model (either by AIC/BIC or by a Vuong-like test). However, this is something that's, to the best of my knowledge, completely missing in |
Regarding the other question: I have a non-public version of RVineStructureSelect that does that (with mBIC as selection criterion) and even more (selection of a threshold parameter for Kendall's tau). It is part of an upcoming paper that Claudia will talk about in Munich beginning of April. I intend to implement this in the not-so-far future in C++, if time permits even before the conference, so we can advertise the new library. But it causes an óverhead because the loglikelihood has to be calculate for every pair (which is currently not the case when |
* rename make_pc_store() -> make_pair_copula_store() * rename structure_select() -> select() * add truncation_level argument (working) * add matrix argument (cannot be used for now) * remove n = std::max(...) line
* matrix argument default had wrong type * as_vinecop had wrong entry in the trivial column * as_vinecop sometimes reused the same pair-copulas in another column
tests for select() will be added after changing matrix style
I think we should be good to go now (if checks pass). Open issues are summarized in #51, and I'll work on them in a new branch. |
Well, we can merge for now, but we are still doing a lot (really, A LOT) of useless stuff when we truncate... IMO, solving this should have a high priority on the "to-do" list and I added this to #51. |
I just noticed something weird with the includes:
|
I'll comment further on the truncation in #51. Regarding the headers: I could remove it, but I don't think it makes it better. Including the same header twice is almost the same as including it once (because of the ifndef guards). But it's less intuitive to not have |
Alright, we can merge then! |
So now that there is a function version (unit tests still missing), we can start discussing a couple of design choices:
I removed the options
allow_rotations
andpreselect_families
inVinecop::structure_select()
and always use their default (true
). They became additional arguments in VineCopula to ensure backwards compatibilty, but we don't have to worry about that.fit()
(not yet implemented forVinecop
).Do you think this is reasonable? Then I'd suggest we make the same modifications to
Bicop::select()
.I'm not sure if we should follow VineCopula on having two functions for
StructureSelect
andCopSelect
. I find the nameStructureSelect
a bit misleading because it also selects all families. What do you think about a unified interfaceselect(data, matrix = MatXd(0, 0), ...)
similar to kdevine, where specifying the matrix is optional?