You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question regarding the Vasicek example in the documentation.
The REPL help shows:
julia> m = Vasicek(0.136,0.0168,0.0119,Yields.Continuous(0.01))
However, when I tried this example, I received an error.
May I know if Yields.Continuous(0.01) should be Continuous(0.01) by using FinanceCore? I tried and it worked but would like to confirm this is the correct usage.
Apologies if I have misunderstood the documentation.
Hi — yes, that’s correct. Yields.Continuous(0.01) belongs to an older API, so the documentation example you encountered was stale.
With EconomicScenarioGenerators.jl, the corrected usage is:
using EconomicScenarioGenerators
using FinanceCore
m =Vasicek(
0.136,
0.0168,
0.0119,
FinanceCore.Continuous(0.01),
)
Alternatively, FinanceModels re-exports Continuous, so this also works:
using EconomicScenarioGenerators
using FinanceModels
m =Vasicek(0.136, 0.0168, 0.0119, Continuous(0.01))
For new single-model interest-rate simulations, however, we recommend using the maintained successor in FinanceModels.jl v6 or later. Here is the equivalent complete example:
using FinanceModels
using Random
model = ShortRate.Vasicek(
0.136, # speed of mean reversion0.0168, # long-term mean rate0.0119, # volatilityContinuous(0.01), # initial short rate
)
# Generate one reproducible scenario at half-year intervals for 30 years.
scenarios =simulate(
model;
n_scenarios =1,
timestep =0.5,
horizon =30.0,
rng =Xoshiro(1),
)
path =only(scenarios)
# Extract the simulated short rates.
times =0.0:0.5:30.0
rates =short_rate.(Ref(path), times)
collect(zip(times, rates))
The initial rate may also be passed directly as a scalar, which is interpreted as continuously compounded:
model = ShortRate.Vasicek(0.136, 0.0168, 0.0119, 0.01)
FinanceModels.jl now provides the maintained single-model short-rate implementations and simulation functionality. EconomicScenarioGenerators.jl remains the home of Correlated, which supports copula-correlated simulation across multiple models.
Thank you for reporting this—and no need to apologize. Your understanding is correct.
Also, @momoxaxa I see that you are creating a Julia life model repository - I'd love to connect and chat to learn more about your background and other repository work. Feel free to reach out on LinkedIn or the Julia slack if you are interested in connecting.
Activity
alecloudenback commentedon Jul 18, 2026
Hi — yes, that’s correct.
Yields.Continuous(0.01)belongs to an older API, so the documentation example you encountered was stale.With EconomicScenarioGenerators.jl, the corrected usage is:
Alternatively,
FinanceModelsre-exportsContinuous, so this also works:For new single-model interest-rate simulations, however, we recommend using the maintained successor in FinanceModels.jl v6 or later. Here is the equivalent complete example:
The initial rate may also be passed directly as a scalar, which is interpreted as continuously compounded:
FinanceModels.jl now provides the maintained single-model short-rate implementations and simulation functionality. EconomicScenarioGenerators.jl remains the home of
Correlated, which supports copula-correlated simulation across multiple models.Thank you for reporting this—and no need to apologize. Your understanding is correct.
alecloudenback commentedon Jul 18, 2026
Also, @momoxaxa I see that you are creating a Julia life model repository - I'd love to connect and chat to learn more about your background and other repository work. Feel free to reach out on LinkedIn or the Julia slack if you are interested in connecting.
Ecosystem audit: CIR √Δt, HullWhite θ timing, YieldCurve clamp, Finan…