logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Paul BurlingComputer science
(5/5)

671 Answers

Hire Me
expert
Catherine Chanwai EarleLaw
(5/5)

687 Answers

Hire Me
expert
Gayle ThomasManagement
(5/5)

820 Answers

Hire Me
expert
Himani KhatterStatistics
(/5)

657 Answers

Hire Me
R Programming
(5/5)

Consider the following formula to calculate the monthly payment amount.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1. [6 points] Suppose you invested into a mutual fund account on January 1st, 2020. You earned 2% return in January and 5% return in February 2020. Then, the account balance at the end of February 2020 is $21,420. How much did you invest in the fund on January 1st, 2020? 

Not sure if correct? 

>starting_saving <- 20000

>feb_mysaving <- starting_saving*1.02*1.05

>feb_mysaving

[1] 21420 

2. [4 points] Your portfolio contains 60% of stock A and 40% of stock B. Assume that stock A earned a 5% return and stock B earned - 4% return this month. What is your total portfolio return this month? 

ret_A <- 5

ret_B <- 4

weight_A <- 0.6

weight_B <- 0.4

ret_portfolio <- weight_A*ret_A+weight_B*ret_B

ret_portfolio

[1] 4.6 

Not sure if correct? 

3. Consider the following formula to calculate the monthly payment amount.

M= 𝑃𝑖1− 1(1+𝑖)𝑛       

a) [4 points] In this equation, P represents the principle, i the (monthly) interest rate, and n the number of payment terms for a mortgage with a principle balance of 200,000, monthly interest rate of 0.3%, and the number of payment terms of 360. Calculate the monthly payment amount M. 

b) [6 points] Construct a vector M of length 3 with the results of this calculation for a series of principle balances: 150,000, 180,000, 220,000. 

4. Use the “ : operator ” and arithmetic operators in Chapter 1 to create the following vectors. You have to use “ : operator ” on p. 7 in Chapter 1 course material for both a) and b).

    a) [8 points] [1] 5 10 15 20 25 30

    b) [8 points] [1] 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Hint: you may use Modulo %% 

5. [6 points] Use the following R script to create a vector ‘x’. 

set.seed(100) 

x <- round(rnorm(18, mean = 2, sd = 0.1), 2) 

Create a 3 x 6 matrix (matrix with 3 rows and 6 columns) using x, and assign the name ‘x.mat’ to the matrix. 

6. [6 points] Use the following R script to create a vector ‘x.vec’.

x.vec <- c(2, 5, 6, 8, 3) 

Assign the names (“Apple”, “Samsung”, “Amazon”, “CVS”, “Walmart”) to the vector. 

7. [6 points] Use the following R script to create a matrix ‘y.mat’. 

y.mat <- matrix(1:12, nrow = 4, ncol = 3)

Assign the names (“New York”, “Boston”, “Dallas”) to the three columns, and assign the names (“AAA”, “AA”, “A”, “BBB”) to the four rows. 

8. [6 points] Create the following data frame with the name “myportfolio”. Then, select the stock price and volume of Company ZZZ. 

> myportfolio

Company Stock_Price Volume

1 XXX 56 1500

2 YYY 86 4100

3 ZZZ 62 2800

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. ThisΒ  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme