当前位置:天才代写 > JAVA代写,java代考-JAVA作业代写免费Moss检测 > Computational Finance代写 Computer Science代写 project代写 Java代写

Computational Finance代写 Computer Science代写 project代写 Java代写

2021-01-08 17:22 星期五 所属: JAVA代写,java代考-JAVA作业代写免费Moss检测 浏览:1392

Computational Finance代写

Queens College, CUNY, Department of Computer Science

Computational Finance代写 Please submit your solution via email, as a ftle attachment, to Sateesh.Mane@qc.cuny.edu.The file attachment is a zip archive

Computational Finance CSCI 365/765

Fall 2019 Computational Finance代写

Instructor:  Dr. Sateesh Mane

cSateesh R. Mane 2019

due Tuesday Dec. 17, 2019 11:59 pm

1 Project 1 Computational Finance代写

  • Please submit your solution via email, as a ftle attachment, toMane@qc.cuny.edu.
  1. The file attachment is a zip archive with the following namingformat:

StudentId_first_last_CS365_project_Fall2019.zip StudentId_first_last_CS765_project_Fall2019.zip

  1. Important: do not encrypt the zip. Other formats such as RAR archive orOneDrive or Google Drive, etc. will not be
  2. You may submit update solutions up to the due date. Computational Finance代写

(a)Usethe same name for the zip archive: your previous submission will be

(b)Only your final submission will be graded.

  1. Late submissions will receive a reduced grade, possibly including a failing

 All students must submit solutions individually for this project.

  1. Studentswho work together on this project must inform me of the names of all collaborators in advance of the due date.
  2. Otherwise,if I receive identical solutions from multiple students, they will be classified as cheating and all students involved will receive a failing
  3. Every student must submit a zip archive, even if he/she worked withothers.
  • Thisproject requires the coding of a polymorphic software library for financial derivatives.Computational Finance代写

1. All code must be written in Java.

2.Yourproject zip archive must contain all your source code.

3.Your code will be tested by compiling and running it on the Venus server.

4.You are responsible to check that your code compiles and runs on the Venus server.

5.A failing grade will be awarded if your program does not compile and run successfully.

6.Thisincludes items such as array out of bounds errors, division by zero and/or operations which yield NAN, infinite loops.Computational Finance代写

7.Non-fatalwarnings, g. use of deprecated features, will be excused.

  • Thequality of your software design will be graded, g. copy and paste, unnecessary recalcu- lations (instead of saving data in temporary variables), etc.Computational Finance代写

• A failing grade will also be awarded if your code does not implement the public interface stated in the project description below.

  1. I may, at my discretion, ask you questions about your program code.
  2. Studentswho do not give satisfactory answers will receive a failing grade.
Computational Finance代写
Computational Finance代写

1.1 Library

  • Declare a Library class to support the following

Output binom(final Derivative deriv, final MarketData mkt, int n)

int impvol(final Derivative deriv, final MarketData mkt, int n,int max_iter, double tol, Output out)Computational Finance代写

  • The Library class is a final
  1. Thefunction binom implements the binomial model to compute the fair value and fugit of a derivative.
  2. Thefunction impvol executes a loop of iterations to calculate the implied volatility of a derivative.
    • Additional details, including the various input and output classes mentioned above, will be given below.

1.2ClassMarketData Computational Finance代写

  • A MarketData object contains market data values to be used for valuation of a derivative.

final class MarketData

{

public double Price; // market price of security

public double S; // stock price

public double r; // interest rate

public double sigma; // volatility

public double t0; // current time

}

  • The values of the MarketData class members are set in a calling application (for example the main() program), and the MarketData object is passed as an input to the above library functions.
  • It is your responsibility to write any class methods, etc. that you considerappropriate.

1.3 ClassOutput Computational Finance代写

  • An Output object contains the results of calculations by the library

final class Output

{

public double FV; // fair value public double fugit; // fugit

public double impvol; // implied volatility

public int num_iter; // number of iterations to compute implied volatility

}

  • The values of the Output class members are set in the library functions and returned to the calling
  1. Note that not all output fields may be populated by a given fumction.
  2. Forexample the function binom populates the values of FV and fugit, but not impvoland num iter.Computational Finance代写
  • It is your responsibility to write any class methods, etc. that you considerappropriate.

1.4  ClassNode Computational Finance代写

  • To calculate the fair value and fugit of a derivative, the binomial model should allocateNode

objects.

final class Node

{

}

  • It is your responsibility to decide what data members and methods the Node class should contain.Computational Finance代写

 It is your responsibility to decide how the binomial model allocates the Node objects, e.g. array or ArrayList or HashSet, etc.

  • In other words, you formulate the software design.

1.5 ClassDerivative

  • The class Derivative is an abstract base class which supports virtual functions for use in the valuation of derivatives.

abstract class Derivative

{

public double T; // data member public void terminalCondition(Node n) // virtual function public void valuationTest(Node n) // virtual function

}

  • All the derivatives we shall treat in this course have an expiration time T.
  • Hence the Derivative class contains a data member double T.Computational Finance代写
  • The virtual functions must be overridden by non-abstract derived classes.
  1. The virtual function terminalCondition sets the payoff value and the fugit value on the expiration date.
  2. The virtual function valuationTest is called when traversing the tree in the binomial model, to make decisions about early exercise and to set the fair value and fugit to appropriate values.Computational Finance代写
  3. The Node object must therefore contain suitable data members and methods for the above functions to perform their tasks.

1.6 ClassVanillaOption Computational Finance代写

  • The class VanillaOption is a non-abstract class which extends Derivative, to support thevaluation of ordinary (vanilla) options.
  • It must support put and call options, also American and European exercise policies.
  • Thereforethe VanillaOption must contain suitable indicative data members (primary key).
  • The VanillaOption class must also override the virtual functions.

class VanillaOption extends Derivative Computational Finance代写

{

// data members

public void terminalCondition(Node n) // override public void valuationTest(Node n) // override

}

1.7 ClassBermudanOption Computational Finance代写

  • Theclass BermudanOption is a non-abstract class which is an American-style vanilla option, but it allows early exercise only in the time window wbegin t  wend.

class BermudanOption extends …

{

public double window_begin;

public double window_end;

}

  • A real Bermudan option can have many time windows, but we shall support only one time window.Computational Finance代写
  • The BermudanOption class must contain suitable indicative data members and override the virtual functions in Derivative.

1.8 Classes

  • The overall set of classes is therefore as

class Library class MarketData class Output class Node Computational Finance代写

abstract class Derivative & non-abstract classes

  • It must be possible for me to declare a non-abstract class (new financial derivative) and override the virtual functions in
  • The functions in your library must be able to calculate the fair value, fugit and implied volatility of an object of that class I
  • Polymorphism:  it must be possible for me to declare such a class and your program code  must support it without modifying any of your program code.

1.9 Functionbinom Computational Finance代写

  • The library function binom calculates the fair value and fugit of an input derivative.
  • Theindicative data is in a polymorphic class inherited from the Derivative class.
  • The market data (such as the values of S and t0) is supplied in the MarketData class.
  • The function internally allocates a binomial tree with timesteps.
  • Thefunction must not change the input data, hence they are tagged as final objects.

Output binom(final Derivative deriv, final MarketData mkt, int n)

  • The function return type is an Output Computational Finance代写
  1. Thevalues of the fair value and fugit are returned in an Output object.
  2. Thebinom function should perform validation checks to test for bad  inputs.
  3. Ifthe inputs are invalid then the function should set the fair value and fugit to zero.

1.10 Functionimpvol

  • The library function impvol calculates the implied volatility of an input derivative.
  • The market price of the derivative is supplied in the MarketData object.
  • To calculate the implied volatility, the function impvol calls binom in a loop.
  • Thenumber of loop iterations and the implied volatility are returned in the Output object.Computational Finance代写
  • Thefunction must not change the input data, hence they are tagged as final object.

int impvol(final Derivative deriv, final MarketData mkt, int n, int max_iter, double tol, Output out)

  • It is possible the iteration might not converge.
  1. The value of max iter specifies the maximum number of iterations to execute in the
  2. To test your code you may set maxiter=100.
  3. The value of tol specifies the tolerance in the iteration.
  4. Iterate until the following condition issatisfied:

(Fair value) mkt.Price tol .Computational Finance代写

  1. To test your code you may settol=1.0e-4.
    • Thefunction return type is int, because a solution may not

1.If a solution is not found, set the implied volatility and number of iterations to zero in the Output object and return 1(fail).

2.If a solution which meets the tolerance is found, set the implied volatility and number of iterations in the Output object and return 0(success).Computational Finance代写

• Employ the bisection algorithm to calculate the implied volatility.

  1. Recall the bisection algorithm procedure to iterate to calculate the yield of a  bond.
  2. For the implied volatility, employ an initial bracket with a low volatility of 1% and a high volatility of200%.
Computational Finance代写
Computational Finance代写

其他代写:考试助攻 计算机代写 java代写 assembly代写 function代写paper代写 金融经济统计代写 web代写 编程代写 report代写 数学代写 finance代写 java代写 python代写 code代写 代码代写 project代写 app代写

合作平台:天才代写 幽灵代写 写手招聘 Essay代写

 

天才代写-代写联系方式