Code Monkey home page Code Monkey logo

Comments (2)

montrixdev avatar montrixdev commented on July 28, 2024

hi, jojogh
I think your question is about the calculation of SpotRates (9M, 1Y, 2Y, 3Y) using the short rate.
it's formula -> T-maturity discount bond

to add SpotRate associated hw1f model,

define calcs for 9m, 1y, 2y, 3y

hw1f_spot9m = hw1f.spot('hw1f_spot9m', maturityTenor=mx.Period(9, mx.Months), compounding=mx.Continuous)
hw1f_spot1y = hw1f.spot('hw1f_spot1y', maturityTenor=mx.Period(1, mx.Years), compounding=mx.Continuous)
hw1f_spot2y = hw1f.spot('hw1f_spot2y', maturityTenor=mx.Period(2, mx.Years), compounding=mx.Continuous)
hw1f_spot3y = hw1f.spot('hw1f_spot3y', maturityTenor=mx.Period(3, mx.Years), compounding=mx.Continuous)

calcs = [hw1f_spot9m, hw1f_spot1y, hw1f_spot2y, hw1f_spot3y]

update generation code ( add calcs to parameter )

results2 = xen.generate(models=models, calcs=calcs, corr=corrMatrix, timegrid=timegrid1,
rsg=sobol_rsg, filename=filename2, isMomentMatching=False)

I hope my answer is helpful.
thanks.

from mxdevtool-python.

jojogh avatar jojogh commented on July 28, 2024

Many thanks!!!

from mxdevtool-python.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.