Displaying 6 results from an estimated 6 matches for "cash_flow".
2010 Feb 02
2
Yield to Maturity using R
...iable nature of the input, I am trying to write a generalized code.
## Input
price = 101 # Price of bond
tenure = 3
no_comp = 1 # no of times coupon paid in a year.
coupon_rate = 0.10 # i.e. 10%
face_value = 100
# Computations
coupon_payment = face_value * coupon_rate
cash_flow = c(rep(c(coupon_payemnt), (no_comp * tenure - 1)), face_value + coupon_payment)
cash_flow
## I am trying to customize the code as given by Mr Ellison.
f.ytm = function(ytm)
{
for (i in 1 : (tenure * no_comp - 1))
E = NULL
F = NULL
{
E[i] = cash_flow[i]/(1+ytm)^i
F = (sum(E) + (face_v...
2010 Aug 20
1
Shifting of Principal amount while calculating Present Value
Dear R Helpers
I have following data -
cash_flow = c(7, 7, 107) # 107 = Principle 100 + interest of 7%
t = c(1,2,3)
and zero rate table as
rating year1 year2 year3
AAA 3.60 4.17 4.73
AA 3.65 4.22
4.78
A 3.72 4.32 ...
2007 Dec 05
1
alternatives to latex() or xtable() ?
Hello everyone,
I have several problems with exporting to LaTeX the output of
numSummary() from the abind package.
> numSummary(finance[,"Cash_flow"], statistics=c("mean", "sd", "quantiles"))
mean sd 0% 25% 50% 75% 100% n NA
188070.9 414771.9 -426804 26743 53866 150975.5 1871500 54 4
> xtable(numSummary(finance[,"Cash_flow"], statistics=c("mean", "sd...
2010 Jan 19
0
Macaulay Duration for Group
...freq_coupon <= 3)
{
freq_coupon_new = 2
}
if(freq_coupon > 3 & freq_coupon <= 4)
{
freq_coupon_new = 1
}
## COMPUTATIONS
terms_coupon_payment = (seq(1/freq_coupon_new, tenure, by = 1/freq_coupon_new))*freq_coupon_new
coupon_amount = coupon/(freq_coupon_new)
cash_flow1 = rep(c(coupon_amount), (tenure*freq_coupon_new - 1))
cash_flow2 = par_value + coupon_amount
cash_flow = c(cash_flow1, cash_flow2)
ytm_effective = ((1+ytm/100)^(1/freq_coupon_new))-1
pv = NULL
for (i in 1:(tenure*freq_coupon_...
2010 Jan 19
0
Macualay Duration code in a Functional Form - Please Help
...freq_coupon > 3 & freq_coupon <= 4)
{
freq_coupon_new = 1
}
## COMPUTATIONS
terms_coupon_payment = (seq(1/freq_coupon_new, tenure, by = 1/freq_coupon_new))*freq_coupon_new
coupon = coupon_rate*par_value/100
coupon_amount = coupon/(freq_coupon_new)
cash_flow1 = rep(c(coupon_amount), (tenure*freq_coupon_new - 1))
cash_flow2 = par_value + coupon_amount
cash_flow = c(cash_flow1, cash_flow2)
ytm_effective = ((1+ytm/100)^(1/freq_coupon_new))-1
pv = NULL
for (i in 1:(tenure*freq_coupon_new...
2010 Jan 20
2
Please Please Please Help me!!
...poun > 3 & frequency_copoun <= 4)
{
freq_coupon_new = 1
}
## COMPUTATIONS
terms_coupon_payment = (seq(1/freq_coupon_new, tenure, by = 1/freq_coupon_new))*freq_coupon_new
coupon = coupon_rate*par_value/100
coupon_amount = coupon/(freq_coupon_new)
cash_flow1 = rep(c(coupon_amount), (tenure*freq_coupon_new - 1))
cash_flow2 = par_value + coupon_amount
cash_flow = c(cash_flow1, cash_flow2)
ytm_effective = ((1+ytm/100)^(1/freq_coupon_new))-1
pv = NULL
for (i in 1:(tenure*freq_coupon_...