Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

R question - Noob

  • 27-09-2014 02:46PM
    #1
    Registered Users, Registered Users 2 Posts: 459 ✭✭


    Hi guys,

    Im trying to calculate a bond value with R. I know how to calculate it but its inputting in R that's the problem.

    This is the que. A 2 year bond with a face value of €1,000 pays a semi-annual coupon of €25. If intererest rates are a constant 4%, what is the current value of the bond? Answer to the nearest euro. Don't round intermediate answers.

    S <- 1000 – Stock price
    r <- 0.04 - Rate
    T <- 2 - Time
    c <- 25 - coupon
    m=2 – annual coupon frequency
    n <- T*m = time * interest period

    so the pv is the sum of the coupon payments by exponent 8(-rate x time) for each of the coupons.

    so thats 25exp(-0.04*.5) + 25exp(-0.04*1) + 25exp(-0.04*1.5)+ 25exp(-0.04*2) + the fave value discounted to the present 1000exp(-0.04*.5)= 1018

    We can break this by assigning the function I, I<-c*exp(-r*T)

    Now the question how do I represent my answer in R


Comments

  • Closed Accounts Posts: 5,482 ✭✭✭Kidchameleon


    Did you just copy a question straight from an assignment? We need more info if were to help.


  • Registered Users, Registered Users 2 Posts: 459 ✭✭ebayissues


    It's not an assignment. For my course there's a bit of programming that,s why it has to be done.

    The objective for the week fir to know to use the technique for loops incorporated into the questions as the coupon payments are multiple times.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    ebayissues wrote: »
    It's not an assignment. For my course there's a bit of programming that,s why it has to be done.

    The objective for the week fir to know to use the technique for loops incorporated into the questions as the coupon payments are multiple times.
    That sounds strangely similar to the definition of an assignment...


Advertisement