Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

R question - Noob

Options
  • 27-09-2014 3:46pm
    #1
    Registered Users Posts: 446 ✭✭


    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 Posts: 446 ✭✭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