-
Notifications
You must be signed in to change notification settings - Fork 19
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
Changes in data structures to support more replicate methods #261
Comments
Perhaps adding types for different type of variance estimation method, and catching that type using multiple dispatch? |
How about using value types: so instead of having # ReplicateType will be a symbol
struct ReplicateDesign{ReplicateType}
# struct fields
# constructor will look like the following
ReplicateDesign{ReplicateType}(args...) = ...
end So now, we can dispatch on the myfunction(design::ReplicateDesign{:bootstrap}) = "This has type bootstrap"
myfunction(design::ReplicateDesign{:jackknife}) = "This has type jackknife" This is just an idea; if this is the way to go, we'll have to implement it keeping in mind performance: https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-value-type. |
I think could be the going forward with multiple types of |
If only one line fundamentally differs, then it would make sense to do something like the following, for maximum configurability: # ReplicateType will be some replicate type
struct ReplicateDesign{ReplicateType}
# struct fields
inference_method::ReplicateType
# constructor will look like the following
ReplicateDesign{ReplicateType}(args...) = ...
ReplicateDesign(args..., inf::RepType) = ReplicateDesign{RepType}(args..., inf)
end
Base.@kwdef struct BootstrapReplicates
iterations = 1000
end
Base.@kwdef struct JackknifeReplicates
...
end then do some fancy dispatch on an outer constructor which creates the appropriate type. One of these replicate types would then go into I personally wouldn't use symbols for this, because you can't pass any other metadata along. Types tend to be a little easier for extensibility as well. |
lets discuss this suggestion in our next meeting. @ayushpatnaikgit @codetalker7 fyi |
Guys, this is great. I did some experiments and there are no flaws with this. I don't think there is a need for a meeting. We should implement it. We should implement Anshul's suggestion for the reason he mentioned. We don't need an inner constructor right now. |
okay. sounds good to me! |
Hi everyone, small question: now, since we're having |
How about a default? BootstrapReplicates. |
variance estimation of a function using jackknife (say mean) is inherently different to that with Rao-Wu bootstrap
Jackknife variance calculate multiplies the Sum of Square Errors with a different factor (summing
sum((Xt .- X) .^ 2)
by(nh-1) / nh
over each strata, where nh is number of psus in strata).So not ideal to keep signature
design::ReplicateDesign
. Instead I think variance estimation needs system which allows for differing variance calculation for the diff methods (eg Jackknife, BRR, Bootstrap)The text was updated successfully, but these errors were encountered: