Skip to content

Instantly share code, notes, and snippets.

@Nick3523
Last active August 23, 2020 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nick3523/933a72b57326b82c8f8370fb2ee63b1a to your computer and use it in GitHub Desktop.
Save Nick3523/933a72b57326b82c8f8370fb2ee63b1a to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# coding: utf-8
import math as m
import pandas as pd
import cufflinks as cf
import plotly.offline
cf.go_offline()
cf.set_config_file(offline=False, world_readable=True)
P0 = 2000
r = 0.005 #taux d'intêrets, supposé constant
MC = 500 #cout marginale, supposé constant
def getPrice(P0, MC, r, T):
return [((P0-MC) * m.exp(r * t)) for t in range(T)] #exp car en temps continue
df = pd.DataFrame(getPrice(P0, MC, r, 1000), columns = ['Prix'])
df.iplot(title="Evolution du prix selon la rente d'Hotelling", xTitle='Périodes', yTitle='Prix', color='black')
#Sources : https://www.wikiwand.com/fr/Rente_d%27Hotelling#/D%C3%A9monstration_en_temps_continu
# https://www.investopedia.com/terms/h/hotellings-theory.asp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment