[R-sig-finance] NIG Option Pricing
maechler at stat.math.ethz.ch
Wed Dec 7 12:09:48 CET 2005
>>>>> "dkf" == dkf <dkf at specere.com>
>>>>> on Wed, 7 Dec 2005 00:23:34 +0700 (ICT) writes:
>> I am not sure of a few things you are doing
dkf> As it turns out - neither was I. I was able to narrow
dkf> the problem down and identify my programing error. I
dkf> apologize for the noise on the list.
dkf> Anyway, to those that might be interested (and to
dkf> prevent anyone else wasting their time on this).
dkf> Basically, my mistake was to assume that the default
dkf> arguments to the function "nigpdf" were evaluated at
dkf> runtime. In fact, they are evaluated at the time of the
dkf> function defnition.
not really -- since this is not true for any R function!
I think your problem is that you are working with global
variables a lot, something which is *very strongly* discouraged....
In your case, I think you could pass a list(alpha=.., beta=..)
to the corresponding functions.
More information about the R-sig-finance