Skip to content
Prev 278925 / 398502 Next

R help

Just throwing this out there: there's no probability distribution in
the equation you gave, so there's no context for an MLE: what is the
likelihood for m?

Knowing a little bit about the NS model, it seems like it makes more
sense to use nls() to fit all four parameters to the data at once.

Something like this:

nls(y ~ a + b*(1-exp(-m/tau))/(m/tau)+c*((1-exp(-m/tau))/(m/tau)-exp(-m/tau)),
    data = data.frame(y = y, tau = tau), start = list(a = 1, b = 1, c
= 1, m = 1))

Note that as presented, this doesn't work, but it's hopefully a good
start (I'm not very good with nls).

However, the smartest thing to do is to do your homework before
jumping into a project:

library(YieldCurve)
Nelson.Siegel(y, tau, c(48, 60, 84))


Michael
On Tue, Nov 29, 2011 at 1:13 PM, Heh Ness <imostfu at yahoo.com> wrote: