Displaying 1 result from an estimated 1 matches for "losscosts".
2013 Nov 16
1
contour plot axis correspondence
...s, I don't seem to be able to map axes appropriately.
here is what I mean:
N <- 1000
rm <- rnorm(N, mean=0.0, sd=0.4)
rx <- rnorm(N, mean=0.0, sd=0.4)
rt <- rnorm(N, mean=0.0, sd=0.4)
exploss <- function(hdgM,hdgX) {
## this could be any function that is not vectorized
losscosts <- function(FirmV) { D <- 50; ifelse( FirmV<D, 0.2*(D-FirmV), 0) }
FirmV <- 100*(1+rt)*(1+rm)*(1+rx) + 100*(hdgM*(1+rm)-hdgM) +
100*(hdgX*(1+rx)-hdgX)
mean( losscosts( FirmV ) )
}
ss <- seq(-2,0.5,0.1)
MX <- expand.grid( hdgM= ss, hdgX= ss )
MX$z <- unlist(lapply( 1:nr...