当前位置:天才代写 > Python代写,python代做代考-价格便宜,0时差服务 > 贸易融资代写 Commodity Markets代写 jupyter notebook代写

贸易融资代写 Commodity Markets代写 jupyter notebook代写

2021-04-21 17:51 星期三 所属: Python代写,python代做代考-价格便宜,0时差服务 浏览:623

贸易融资代写

Homework for EN 553.753 Commodity Markets and Trade Finance

贸易融资代写 This homework builds upon the prior homework problem that had you construct a model of the forward gas price curve using principal components.

Part I: Energy

First Half of Spring 2019 Term

  • c2019Gary L. Schultz, PhD March 2, 2019

Homework #3: Simulating Gas Curves with Application to Risk Metrics 贸易融资代写

45 points. Due Friday, March 15.

This homework builds upon the prior homework problem that had you construct a model of the forward gas price curve using principal components.

Your assignment now is to use that model to simulate prices for Henry Hub natural gas futures, to analyze the effect of changing measure to explain gas options market prices, and to use the results to compute risk metrics for a simple portfolio of gas contracts. Please produce a quality report giving insight into the business problems given below. Do not simply run a Jupyter notebook containing the calculations. Instead you should explain the analysis to your readers in a way that makes them understand the situation and your conclusions.贸易融资代写

作业#3:模拟气体曲线并将其应用于风险度量
45分。 3月15日,星期五。
该作业是在先前的作业问题的基础上进行的,前一个作业问题是您使用主成分构建了远期汽油价格曲线的模型。
现在,您的任务是使用该模型来模拟Henry Hub天然气期货的价格,分析变更措施的效果以解释天然气期权市场价格,并使用结果来计算简单的天然气合同组合的风险指标。请提供一份质量报告,以深入了解以下给出的业务问题。不要简单地运行包含计算的Jupyter笔记本。相反,您应该以使读者了解情况和结论的方式向读者解释分析结果。

贸易融资代写
贸易融资代写

Data 贸易融资代写

Get all of the files from the PC Homework on the course blackboard site. You should have

  • csv containing natural gas prices (HenryHub),
  • csv containing natural gas European option prices (Henry Hub),and
  • 300ipynb containing python code to munge data and do computations for simu- lating prices and changing measure.

To keep this exercise relatively simple, use a zero discount rate, i.e., you need not worry about any er(T t0) multipliers.贸易融资代写

1 数据
从课程黑板站点上的PC作业中获取所有文件。你应该有
•包含天然气价格的ng.csv(Henry Hub),
•ln.csv包含天然气欧洲期权价格(Henry Hub),以及
•300 sim.ipynb,其中包含python代码以修改数据并进行计算以模拟价格和更改度量。
为了使此操作相对简单,请使用零折扣率,即,您不必担心任何e-r(T -t0)乘数。

Simulate 贸易融资代写

For the valuation date, use the most recent trading date for which you have data. Note that you have plotted this forward curve in the prior homework. Use the 30 maturity month model (seasonality factors and volatility functions) that you built in the prior homework to simulate 1,000 Monte-Carlo iterations of terminal Henry Hub futures prices for 30 maturities (months).

Plot the simulated mean along with the given forward curve with the forward months on the horizontal axis and price on the vertical axis. How large do these sample errors get in your simulation?贸易融资代写

2模拟
对于评估日期,请使用您拥有数据的最近交易日期。请注意,您已经在先前的作业中绘制了此正向曲线。使用您在先前的作业中构建的30个到期月模型(季节性因子和波动率函数)来模拟30个到期日(月)的亨利中心终站期货价格的1,000次蒙特卡罗迭代。
将模拟的平均值与给定的远期曲线一起绘制,水平轴上的远期月份和垂直轴上的价格。这些样本误差在您的仿真中有多大?

Options

Now assemble the option prices at three different strike levels each maturity month. For each forward month T , several strike prices K are given in the dataset. Both puts and calls are provided. Now choose a subset of those options. . .

Define at-the-money options for month T to be call options for the strike K that is closest to the forward price F (t0, T ). If there is a tie, choose one arbitrarily, so there is only one at-the-money call per maturity month T . (For at-the-money options, straddles are generally used, but you should use only at-the-money calls to simplify the computation.) How many at-the-money calls do you have in the data?贸易融资代写

Define out-of-the-money calls to be call options with strike K where K01.4.

Among the out-of-the-money calls, use only the one for which K is closest to the forward

price F (t0, T ) in each month. How many out-of-the-money calls do you have in the data? Similarly,  define out-of-the-money puts to be the put options with strike  K  where    K  1.4.  Among the out-of-the-money puts, use only the one for which K is closest to the forward price F (t0, T ) in each month.  How many out-of-the-money puts do you have in the data?

3选项
现在,在每个到期月份以三种不同的行使价组合期权价格。对于每个远期月份T,数据集中都会给出若干行使价格K。同时提供看跌期权和看涨期权。现在选择这些选项的一个子集。 。 。
将T月的平价期权定义为最接近远期价格F(t0,T)的行使价K的看涨期权。如果有平局,则任意选择一个,因此每个到期月T仅有一个平价电话。 (对于平价期权,通常使用跨界期权,但您应仅使用平价期权来简化计算。)数据中有多少个平价期权?

将非现金呼叫定义为罢工K的看涨期权,其中K0≥1.4。贸易融资代写

在非现金通话中,仅使用K最接近前向的电话
每个月的价格F(t0,T)。您的数据中有多少笔非现金通话?同样,将价外看跌期权定义为行使价为K且K≥1.4的看跌期权。在价外的看跌期权中,仅使用K最接近的看跌期权
每个月的远期价格F(t0,T)。您有多少笔超值认沽期权
在数据中?

Change of Measure

Now compute a posterior weighting as described and demonstrated in the lecture. Your solution should illustrate how the forward prices and option prices are better approximated using the posterior weights, as compared to the uniform prior weights. You may illustrate this with a plot.贸易融资代写

Make sure you trade-off the conflicting objectives of pricing these market contracts correctly with keeping sufficient entropy in the resulting re-weighted simulation. Which regularizing coefficients (called ζ in the lectures and slides) did you use? You began with 1,000 Monte-Carlo scenarios (the equally weighted prior). How many “effective scenarios”

do you have after re-weighting? (Recall that effective scenarios is defined for a posterior weighting q as eH(q) where H(q) = i qi ln qi is the entropy.)贸易融资代写

4变更尺寸
现在,按照讲座中的说明和计算后验权重。您的解决方案应说明与统一的先前权重相比​​,使用后验权重可以更好地估计远期价格和期权价格。您可以用图解说明。
确保在正确地权衡这些市场合同定价的相互矛盾的目标的同时,还要在生成的重新加权模拟中保持足够的熵。您使用了哪些正则化系数(在讲座和幻灯片中称为ζ)?您从1,000个蒙特卡洛方案开始(之前的加权均等)。多少个“有效方案”

重新加权后有什么? (回想一下,将后加权q定义为eH(q)的有效方案,其中H(q)= − i qi ln qi是熵。)n百万美元。 无论如何,请明确使用的单位。
对于先前的(统一)加权,显示投资组合的模拟现金流的直方图。 在第5个百分位数(超过95%的超过概率)下分析CFaR。 提供课程中所述的按市值计价(预期现金流量),临界值,CFaR(=预期负临界值)和有条件CFaR(=预期负平均临界值)。
现在对后加权执行相同的操作。 隐含的市场状况是否比使用简单的统一加权法或多或少地暗示了此投资组合的风险? 回想一下,统一权重适用于经过等效历史波动率校准的模型。

Risk Metrics

This section defines a very simple portfolio and has you compute a few of the “cash flow at risk” (CFaR) metrics described in class. You will use the prior and posterior price distributions you constructed above to do the analysis.贸易融资代写

First of all, define a portfolio Π to have 100 NG futures contracts per month in each month of the year 2020. The NG contract has a notional value  of 10,000 MMBtu per  month, so the notional volumes in each month is 1 million MMBtu in each month of 2020. (NG are not “flow contracts” that you were instructed to use in the first homework.)

You may choose whether you are going to analyze the long portfolio (you are long 100contracts per month) or the short portfolio (where you are short 100 contracts per month). Since risk metrics look only at down-side risk, this is equivalent to choosing which tail of the distribution you need to analyze.贸易融资代写

To keep the numbers short enough to understand, it may be reasonable to report on cash flow results in millions of dollars. In any event, be clear which units you are using.

For the prior (uniform) weighting, show a histogram plot of the simulated cash flows for your portfolio. Analyze the CFaR at the 5th percentile (95% exceedence probability). Give the mark-to-market valuation (expected cash flow), the cutoff value, CFaR (= expected minus cutoff), and conditional CFaR (= expected minus average worse than cutoff) as described in class.

Now do the same for the posterior weighting. Do the implied market conditions indicate more or less risk to this portfolio than using the simple uniform weighting? Recall that the uniform weights are for a model calibrated with the equivalent of historical volatility.贸易融资代写

5风险指标
本节定义了非常简单的投资组合,并让您计算了课堂中描述的一些“风险现金流量”(CFaR)指标。您将使用上面构建的优先价格分布和后价格分布进行分析。
首先,定义一个投资组合Π,以在2020年的每个月每月拥有100张NG期货合约。NG合约的名义价值为每月10,000 MMBtu,因此每个月的名义交易量为每个月100万MMBtu。 2020年1月。(NG并不是您在第一个作业中被要求使用的“流动合同”。)
您可以选择要分析多头投资组合(每月多头100张合约)还是短头投资组合(每月多头100张合约)。由于风险度量标准仅考虑下行风险,因此等效于选择您需要分析的分布的哪一端。
为了使数字足够简短以至于无法理解,可能有必要对现金流量结果进行报告。

贸易融资代写
贸易融资代写

其他代写:algorithm代写 analysis代写 app代写 assembly代写 assignment代写 C++代写 code代写 course代写 dataset代写 java代写 web代写 北美作业代写 编程代写 考试助攻 program代写 cs作业代写 source code代写 dataset代写 金融经济统计代写 加拿大代写

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

 

天才代写-代写联系方式