Displaying 2 results from an estimated 2 matches for "gbsoption".
Did you mean:
bbsoptions
2010 Nov 06
1
Extracting elements of a particular slot from S4 object
Hi there, can anyone tell me how to extract to values of a particular slot for some S4 object? Let take following example:
> library(fOptions)
> val <-GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08, b = 0.08, sigma = 0.30)
> val
Title:
Black Scholes Option Valuation
Call:
GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08,
b = 0.08, sigma = 0.3)
Parameters:
Value:
TypeFlag c
S...
2008 Nov 18
2
error in function: nls (urgent)
...t matrix at initial parameter estimates
By the way, bs function actually based on the Black-sholes option pricing
model. There is a specific function in Rmetrics, can I call the function in
Rmetrics package? Something like this:
bs<-function(s,x,t,a0,a1,a2,...){
v=exp(a0+a1*(x/s)+a2*(x/s)^2)
GBSOption(TypeFlag=c("c"),S=s,X=x,Time=t,r=0,b=0,sigma=v)@price
}
When I use this one, it returns the error similar to the upper one.
Please help me, many thanks.
Ted
--
View this message in context: http://www.nabble.com/error-in-function%3A-nls--%28urgent%29-tp20558499p20558499.html
Sent from...