Displaying 7 results from an estimated 7 matches for "typeflag".
2007 Oct 16
0
Simple plot of IR and option prices
...option price varies relative to
interest rates. Kind of a see-saw like graph. I need to keep this
simple because this is meant to teach the absolute basics about the
effects of interest rates on option prices.
These are the option prices I'm using:
CallPrice1<-CRRBinomialTreeOption(TypeFlag="ca",S=20, X=20,
Time=1/12, r=0.0, b=0.0, sigma=.4, n=100)@price
CallPrice2<-CRRBinomialTreeOption(TypeFlag="ca",S=20, X=20,
Time=1/12, r=.05, b=.05, sigma=.4, n=100)@price
CallPrice3<-CRRBinomialTreeOption(TypeFlag="ca",S=20, X=20,
Time=1/12, r=.10, b=.10,...
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 60...
2010 Dec 24
1
Help required: binomial option pricing using package
...ric.
The following is the piece of code:
# USING THE FUNCTION
library(fOptions)
option.price<-matrix(nrow=250,ncol=9)
for(j in 1:9){for(i in 1:250)
{option.price[i,j]=CRRBinomialTreeOption(TypeFlag="ca",S=data[(i+250),j],X=data[j,19],Time=T[i,j],r=data[i
,(9+j)],b=0,sigma=sig[i,j],n=5)}}
R output:
Error in option.price[i, j] = CRRBinomialTreeOption(TypeFlag = "ca", S =
data[(i + :
object of type 'S4' is not subsettable
I'm very new to R and can't fin...
2010 Oct 06
0
multiple record types from a single file efficiently?
...in 1:dim(dd_by_type)[1]) {
#assign(paste("con_",i,sep=""),file(paste(file.path(indata),"_",i,".csv",sep=""),
open="w"))
#}
while (length(line <-
(scan(indata,skip=(i-1),nlines=1,what=character(),fill=TRUE, sep=","))) >
0){
typeflag <- as.integer(substr(line,flag_pos,flag_pos))
inline <-
read.fwf(indata,skip=(i-1),n=1,widths=as.vector(unlist(dd_by_type[typeflag,3]))
)
inline <- matrix(unlist(inline),nrow=1)
write.table(inline,paste(file.path(indata),"_",typeflag,".csv",sep=""),
row.name...
2007 Oct 31
2
reversing perspective plot axis
...ot;,
ylab = "S", :
increasing 'x' and 'y' values expected
So it seems that I can't use a descending sequence for my perspective
plot. Is that true? Is there a way to work around this?
persp(x=Time, y=S, z=Price, xlab="Time", ylab="S", zlab=TypeFlag, ...)
Essentially, what I'm trying to create is something that looks like
this.
http://www.insightful.com/products/finmetrics/opSensitivity1_lg.gif
You can see how Time on the x-axis diminishes as it moves to the
foreground corner.
Thanks in advance.
James
2008 Nov 18
2
error in function: nls (urgent)
...t 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 the R he...
2008 Apr 18
1
Wine release 0.9.60
...widl: Check that attributes are applicable for libraries, modules, dispinterfaces and coclasses and otherwise issue an error.
widl: Output a warning if duplicate attributes are specified.
widl: Add support for the broadcast and idempotent operation attributes.
widl: Write out TYPEFLAG, FUNCFLAG and VARFLAG flags for all attribute we currently parse.
widl: Add functions to print an error or warning message using location information to enable these to be printed accurately when a check is done after an element is parsed.
widl: Add checking to arguments of non-local fu...