Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.

learn more… | top users | synonyms

4
votes
1answer
336 views

Moving window forecasting in Python

I am looking to create some code that will out-of-sample forecast the HAR-RV model. The model itself is formulated as the following, and the betas are estimated through HAC-OLS or Newey-West. ...
4
votes
1answer
1k views

Historical volatility from close prices (Haug pg 166)

I have implemented a function for calculating historical volatility using close the close method as described by Haug on page 166. When I implemented the formula given by Haug, it resulted in some ...
3
votes
1answer
88 views

Wrong discount factors when finding Nelson Siegel Svensson model parameters

I am trying to determine the parameters for the Nelson Siegel Svensson model and am solving a Non- Linear Optimization problem to do this. Some of the code I have written is below and this is where my ...
0
votes
1answer
633 views

estimate implied volatility using newton-raphson in python

I am trying to calculate the implied volatility using newton-raphson in python, but the value diverges instead of converge. What is wrong with the code? ...
4
votes
0answers
326 views

Rate Distortion Minimization in a Python Clustering Algorithm

I'm attempting to solve for $\hat{k}$ clusters, such that the rate distortion is minimized, as described here, however, the answers that I am getting from my algorithm are not following the "Jump" ...
2
votes
0answers
86 views

Problem with Naive Bootstrapping (US Government Bonds)

I am using the formula here to determine the discount factor function and eventually the zero-coupon yields. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I ...
1
vote
0answers
50 views

Issue with Naive Bootstrapping (US Government Bonds)

I am using the formula here to determine the discount factor function. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I insert into the Dataframe ...
1
vote
0answers
159 views

How to implement the herding measure proposed by Lakonishok et. al (1992) in python

I would like to test for herding behaviour using the herding measure developed by Lakonishok et. al (1992) on a dataset containing trader transactions during 2013, however, i am having some trouble ...
1
vote
0answers
1k views

Black Scholes well coded Python

I have some trouble with the following code. Some jump and a decentered path are present but it's not the case, normally for Black Scholes diffusion ! Is anyone see a problem in my code ? ...
0
votes
0answers
34 views

Broker or source of intraday futures data for a python API?

I am looking for a broker that offers a python API for downloading historical intraday data on futures. So far I have only seen Interactive Brokers and Tradestation. Are there some other brokers ...
0
votes
0answers
34 views

bandwith portfolio rebalancing in python

I want to calculate a bandwith rebalancing machanism for a portfolio of two assets. As soon as the performance of one ov the assets gets bigger or smaller than the other one + a defined tolerance ...
0
votes
0answers
146 views

Implied volatility from American options using python

I am currently trying to construct volatility surface from american option prices (using Cox-Ross-Rubinstein tree) in Python 2.7. Below you can find the code I came up with. Any corrections would be ...