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 there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

R question - Noob

  • 27-09-2014 2:46pm
    #1
    Registered Users, Registered Users 2 Posts: 452 ✭✭


    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: 452 ✭✭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