当前位置:文档之家› 浙江工商大学MATLAB2015-2016学年期末试卷

浙江工商大学MATLAB2015-2016学年期末试卷

浙江工商大学 2015/2016 学年第一学期考试试卷(B)
课程名称:Matlab金融工具箱应用
考试方式:开卷 上机完成 完成时限:120分钟
班级名称:学号:姓名:
题号 一 二 三 四 总分
分值 8 12 49 31 100
得分
阅卷人
Section 1. (4*2%) Multiple choice questions
1.Which of the following command can be used to find out the standard
deviation of vector X and Y. ……………………………………()
A、var([X Y])
B、std([X Y])
C、cov([X Y])
D、xcorr([X Y])
2. Which of the following command can be used to change the directory if the file is not in the current directory. ……………………()
A、path
B、set
C、pathtool
D、addpath
3. Which is the most appropriate command to find the present value of a set of cash flows. ………………………………………………………( )
A、pvvar
B、bndprice
C、fvvar
D、bnddur
4. Which of following command can be used to get rid of (delete)
variables. ………………………………………………………………( )
A、clear
B、close
C、open
D、rm
Section 2. (3*4%) Answer the following questions briefly
1. Please summarize the advantage and disadvantage of Matlab as a
programming language comparing with other advance programming
languages or statistical software like Eviews.
2. Explain the main differences between Matlab function and script .
3. Can you please list at least 3 ways by which Matlab can import data from
other sources (i.e. Excel, CSV, TXT, MAT files or other data bases)? Please include some of key functions and comments.
Section 3. (7*7%) Simple calculation and drawing 1. Being provided the following function
)
log(10),(22y x e xy x y x f z x
++++== Please define it as a Matlab function funxy , with two input variables x and y and return the value z (Script)
2.Please generate a 100*1 vector with averagely distributed random value and sort it in ascending order.
3.Given two bonds with same face value $1000 whilst different annual coupon rates: 2% and 3%. Suppose today is Dec 1st , 2015 and the bonds will mature on Feb 1st , 2019 and Jan 1st , 2019 respectively. Please calculate current prices of those two bonds if the expected rate of return (i.e. Discount rate) is 3.2%. (Script)
4.Suppose you have some birthday data (range from 1 to 365) stored in a
variable bday and the variable has been saved in a data file bday.mat . Please load the variable bday into the workspace and draw the histogram
(distribution) of the variable bday .
5.If you have collected some stock price data from yahoo and stored them into vector datex and pricex , the datex represents date information and the pricex represents the price series. Please show a figure which shows the price series. Ideally, you may represent date vector by an elegant format.
6.Given the average return of 4 assets in a 4 by 1 matrix R , and corresponding
covariance in a 4 by 4 matrix C, how could you calculation the mean-variance efficient frontier for n points. (Script only)
7.Find the specific Matlab function by using Matlab Help.
A.To draw a pie chart
B.Find the year in numeric form given a serial date number
C.Find the eigenvector of a matrix
D. Computes the duration of fixed income securities given a clean price
for each bond
(Function name only)
Section 4. (31%) Comprehensive programming
1.Please design a function which can be used to determine the percentage of
a certain class (with a certain number of students) has at least two students with same birthday. The number of classes being tested are assumed to be 500 (8%)
Please write a script to calculate a series of percentage for a group of classes with the number of students are 30,32,34,...,48,50. (8%)
2. Given N assets with known price in matrix P (T by N), and the market average return which can be used as the risk free return in matrix R, please develop a Matlab function which can take asset return, variance, risk free return and risk aversion as input, and provide (output) an optimal solution on how to make an appropriate investment to both risk free asset and all risky assets - weights allocated to each asset. And also plot the results. (Script only) Please define any necessary variable and function as appropriate and use matlab functions from any toolbox.。

相关主题