Directions
Using R Markdown in R Studio, complete the following questions. Launch RStudio and open a new RMarkdown file or use the class RMarkdown template provided and save it on your working directory as a.Rmd file. At the end of the activity, save your pdf generated from RMarkdown+Knitr and submit your homework on the Blackboard.
If you have questions, please post them on the lesson’s Discussion Board.
All questions are mandatory. R code and output must be clearly shown.
Homework submitted after the due date will attract a penalty of 10 points per day after the due date.
1. Write an R function for computing the value of f (x) = e−x2 and test it for a vector x = c(0, 1, 100).
2. Write an R function to compute the sample excess kurtosis given by for a given vector x = (x1, xn), where x¯ is the average of the elements of x. Test the function for a vector x = 1:10.
3. Suppose Jane wishes to take out a mortgage on a house. She wants to know what her periodic payments will be. If P is the initial amount mortgaged, r is the effective interest rate, and n is the length of the mortgage, then the periodic payment R is given by R=Pr1 − (1 + r)−n
(a) Construct a function which employs this formula
(b) Calculate Jane’s monthly payments, if the initial amount is $100, 000, the interest rate is 1% and the number of interest conversion periods is 300.
4. Suppose payments of P dollars are deposited annually into a bank account that earns constant interest r per year. What is the accumulated value of the account at the end of n years, supposing deposits are made at the end of each year? The total amount at the end of n years is given by the expression Amount = P (1 + r)n−1 + · · · + P (1 + r) + P = P (1 + r)n − 1r
(a) Write an R function to compute the accumulated amounts after n = 10 years, with periodic payments P = $400 with a vector of interest rates r ranging from
0.01 to 0.2 by increments of 0.01.
(b) Produce a line plot of the amounts (y-axis) against the interest rates (x-axis)
(c) Optional question: Write a single function to perform both parts (a) and (b) above.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
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
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme