Beispiel #1
0
    def __init__(self, market_params):
        '''
        
        '''

        self.market_params = market_params
        self.spots = market_params['spots']
        self.rates = market_params['rates']
        self.cov = market_params['cov']
        self.generator = NormalGenerator(normal)
Beispiel #2
0
    def __init__(self, market_params, path_construction='incremental'):
        '''
        
        '''

        self.market_params = market_params  #Should clean this up
        self.spot = market_params['spot']
        self.rate = market_params['rate']
        self.vol = market_params['vol']
        self.generator = NormalGenerator()
        self.path_construction = path_construction
Beispiel #3
0
    rate = 0.05
    vol = 0.05

    #     times = list(np.linspace(0.0, stop=1.0, num=4))
    times = list(np.linspace(0.0, stop=1.0, num=3))
    times = times[1:]
    print times
    #     times = [1.]

    market_params = {'spot': spot, 'rate': rate, 'vol': vol}

    bgmgen = GeneratorGBM(market_params, "brownian_bridge")
    #     bgmgen = GeneratorGBM(market_params)
    bgmgen.sim_setup(times)
    #Change random generator
    generator = NormalGenerator()  #Make generator out of np normal generator
    athetic = Antithetic(generator)

    bgmgen.generator = athetic
    #     print athetic.get_variates(0, 1, 3)
    #     print athetic.get_variates(0, 1, 3)

    path = bgmgen.do_one_path()
    #     print len(path)
    #     print list(times)
    plt.plot(times, path)
    plt.show()

#     vals = [bgmgen.do_one_path() for i in range(0,3)]

#     print vals