关键词 > ECON30025/ECOM90020

ECON30025/ECOM90020 1/12 Computational Economics and Business Assignment 2, 2023

发布时间:2023-05-13

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Computational Economics and Business

ECON30025/ECOM90020

Assignment 2, 2023

Due 11:59pm, Sunday May 28, 2023

Question 1. (10pts)

Consider the map in Figure 1 of an amusement attraction called Vlad's Park.  Where   the paths back and forth between the attractions are given by the lines and the arrows indicate the direction of paths between them that are either one-way or both ways.

(a) (2pts) Using the page-rank methodology that orders websites based on the number of connections from a website to other websites describe how you would use this method to       create an order of the different amusement locations at Vlad's Park based on the paths leading out of each site.  What is the process for finding a stable solution?

(b) (2pts) How would you define the transition matrix in this case.  Show the formula to use in this case.

(c) (4pts) Modify a Proc IML routine find the order of the attractions with the highest   level of attendance to the lowest.  Print out the transition matrix, the potential final steady     state and total number of paths leading from each attraction.  How does the final order of the sites match the number of paths to and from each site?

(d) (2pts) Given a person starts at site A and randomly chooses where to go next where will they be after 5 iterations? How can you represent this result?

Figure 1 Map of the Vlad's Park amusement attraction is given below. The attractions are

located at the nodes identified by the letters A through H.

Question 2. (10pts/15pts) (Only those in ECOM90020 need attempt part f)

Answer the following questions also based on the map for Vlad's Park in Figure 1.  Consider the following problem:  There are 21 cases of soft drink located in a warehouse at attraction E it is necessary to move 3 cases to the other 7 locations.

(a) (1pt) What method would you employ to find the least cost routes for these cases to

meet this demand?

(b) (3pt) Determine the cost of transport between each attraction where the cost of

transport is a function of cost = 3 + .75# distance.  Where the distance is the is the Euclidean distance as can be computed from the table of grid locations for each site shown below:

Table 1. The location of each site.

Attraction X Vertical Y Horizontal

A

B

C

D

E

F

G

H

4.6

9.6

22.7

24.4

34.7

39.8

40.8

40.8

10.1 20.6 9.1 22.8 18.8 26.6 16.7 8.0

Note: the IML function distance() will compute the matrix of Euclidian distances from a matrix of locations. (see the SAS documentation for details).

(c) (2pts) Define the equations or method you need to solve this problem and write a routine in Proc IML to solve for the least cost route for these deliveries.  Assume that       transporting the cases can only be done in the direction of the arrows.

(d) (2pts) What is the least cost route for moving the 21 cases?  What is the total cost? (e) (2pts) Consider the situation when Vlad's Park needs to close, and two of the             additional cases just delivered need to be returned to the warehouse.  This means moving 2    cases from each attraction back to location E. Is the cost for this 2/3 the cost of the original   move?  Are the routes taken the same as those you found for the answer to part d? If not, how do they differ?

*Additional related question for students in ECOM90020

*(f) (5pts) Consider the original situation where there are 21 cases of soft drink located in a warehouse and it is necessary to move 3 cases to the other 7 locations.  Determine the cost   if the warehouse was located at all the possible sites and there was a need to move the 21        cases to the other sites.  For example, if the warehouse was located at site A and it was            necessary to move the cases to sites B to H etc.  Provide a list of the highest to lowest cost      locations for the warehouse.  To what extent does the choice of location influence the cost of supply?

Question 3. (10/15pts) (Only those in ECOM90020 need attempt part f)

A supervisor at Vlad's Park can spend 15 minutes at each attraction and must move to another site based on an equal probability that they will go to another site that they can go to  (thus, they do not stay in one location for more than 15 minutes).  They can move on routes   that begin or end at that attraction that means they need not follow the directions of the        arrows or consider the distances between them.  For example, if they are at location B, they    can go to either A, C or D.

(a) (2pts) Describe the method you can use to determine which attractions they spend      the most time at if the probability of their movement is based on the number of paths that lead to and from each site?

(b) (2pts) Provide the details (i.e. formulae et cetera) of the algorithm you would use to

solve for the probability that the supervisor will visit each site.  For, example, if they can travel to 3 other locations,  they would have a 1/3 probability of moving to any of them.

(c) (3pts) Use a Proc IML routine to determine the probability that the supervisor will visit each attraction.  Report the order of the sites from least visited to most visited.

(d) (3pts) Report the probability that the supervisor will visit each attraction over an 8-  hour day.  Does it matter where they start?  Plot how the probabilities that the supervisor will visit each site changes if the supervisor starts at attraction A and spends 1 hour at each site.   Which site has the lowest probability of a visit after 4 hours?  How do these probabilities       compare to the results you obtained in part c?

*(e) (5pts) Use the location of each site to compute the distances between them to             determine the probability that the supervisor would move to the other location.  Now assume the same conditions as above with the added information that the probability of moving from between two sites is related to the inverse of the distance (1/distance).1   For example, we can compute the distance between A and E as 31.33, between A and B as 11.63 and between A    and C as 18.13.  This would imply that instead of a probability that the supervisor at A would

move to E as 1/3 it will be proportional to 1/31.33, that they move to B is 1/11.63 or that they

move to C is 1/18. 13.  For example, Prob (A B )  = ( ) = .49685 .

Report the steady state probabilities for each site and compare these to the results you       obtained in part c?  Can you think of alternative ways the distances can be included in this model?

Hint:

To do this you may end up with a transition matrix with missing values on the diagonal since the inverse of the distance to itself will be computed as a missing value. To set the missing   values of a matrix y to zero you can use the code:

y[loc(y= .)] = 0 ; * find the missing values in y and set them to zero ;

The loc() function finds the index of the matrix that satisfies the condition (in this case they  are missing). Then using this to determine which elements ofy we want to set to zero. This matrix would then be multiplied element by element by the transition matrix you used above for part d and then youll need to ensure that the columns sum to one.

Question 4 (10pts) .

By modifying the Tan_portfolio_nasdaq_23a.sas (see the appendix for this code)      routine that uses the daily returns for 25 stocks, the NASDX index of stocks and the daily       value of the annual yield on 10yr US treasury bonds as of April 27, 2023. Note this routine   has been set up as a macro so you can control what it does with resubmission of the last lines of code after you have specified which stocks you want to use and what time period you are  using.  Note that it is necessary to make sure the option at the start of the program is included before reading in the data when using the SAS ONdemand instillation of SAS studio.  Note it is only necessary to execute the first lines of the code up to the end of the definition of the      macro %analysis the line:

%mend analysis ;

(a) (3pts) Using all the stocks available run this model to determine the optimal portfolio over the period from January 1, 2018 to April 25, 2023 and record the optimal portfolio and   plot the results.  Describe what you find.  Which stocks appear to be outliers?  Can you see     why some stocks are not included in the optimal portfolio?

(b) (2pts) Selecting no less than 5 and no more than 10 of the stocks define a list of the

stocks to include in a portfolio.  By modifying the macro that defines the list of stocks as  shown below, you can rerun the analysis with only the ones you use to define the &stocks macro variable.

%let stocks = AAPL CSCO MSFT QCOM SBUX AMD AMZN NASDX TSLA GOOGL NWSA NFLX

DIS BAC TM MBGAF GM META NOW PANW BA PLD JNJ MELI COST BLK;

Run your analysis for three different sets of stocks.  Try to pick stocks that are in similar industries or are of similar size.

(c) (5pts) Using one of the groups of stocks from part b re-run the analysis for the nine   6-month periods from January 2019 to April 25, 2023.2   Record the optimal portfolio weights and the optimal portfolio performance by period.  Can you identify any influence of COVID  or the recent events in Ukraine?

Table 2 The list of stocks and their code we have data for

AAPL CSCO MSFT QCOM SBUX

AMD AMZN NASDX

TSLA

Apple

Cisco

Microsoft

QualComm

Starbucks

AMD

Amazon

NASDX index3

Tesla

GOOGL Google

NWSA NFLX DIS BAC

TM

News Corp

Netflix

Disney

Bank of America

Toyota Motors

MBGAF Mercedes-Benz

GM

META

Meta Platforms (Facebook)

NOW

ServiceNow

PANW

Palo Alto Netw