Created
December 21, 2024 09:29
-
-
Save al6x/318f84dcd7c4f609e10d2577e58ffe57 to your computer and use it in GitHub Desktop.
Julia vs Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table = [ | |
sort( | |
map( | |
(c) -> (type = :Without, moneyness = c.moneyness), | |
filter((c) -> c.tenor == 856, normalized_jl) | |
) | |
)..., | |
sort( | |
map( | |
(c) -> (type = "With CPI", moneyness = c.moneyness), | |
filter((c) -> c.tenor == 852, normalized) | |
) | |
)... | |
] | |
# table = map((i, item) -> ( i = i, item...) ) | |
plot( | |
"Normalization with CPI and without, for last tenor of ~900 days", | |
table, | |
( | |
( height = 300, ), | |
( mark = :tick, ), | |
( x = :type, type = :nominal, domain = ["Without", "With CPI"] ), | |
( y = :moneyness, scale = :log, domain = [0.4, 2.5], axis_values..., title = "Moneyness" ), | |
) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table = [ | |
normalized_jl | |
.select { |c| c.tenor == 856 } | |
.map { |c| { type: :Without, moneyness: c.moneyness } } | |
.sort, | |
normalized | |
.select { |c| c.tenor == 852 } | |
.map { |c| { type: "With CPI", moneyness: c.moneyness } } | |
.sort | |
].flatten | |
plot( | |
"Normalization with CPI and without, for last tenor of ~900 days", | |
table, | |
height: 300, | |
mark: :tick, | |
x: { type: :nominal, field: :type, domain: ["Without", "With CPI"] }, | |
y: { type: :quantitative, field: :moneyness, scale: :log, domain: [0.4, 2.5], axis: { values: [], title: "Moneyness" } } | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment