search for: gridpoints

Displaying 11 results from an estimated 11 matches for "gridpoints".

2013 Apr 13
0
help on smoothing volatility surface..
...piration's line then interpolate.... ?? library(RQuantLib) library(quantmod) library(rgl) library(akima) library(ggplot2) library(plyr) GetIV <- function(type, value, underlying, strike,dividendYield, riskFreeRate, maturity, volatility, timeSteps=150, gridPoints=151) { AmericanOptionImpliedVolatility(type, value, underlying, strike,dividendYield, riskFreeRate, maturity, volatility, timeSteps=150, gridPoints=151)$impliedVol } GetDelta <- function(type, underlying, strike,...
2006 Jun 14
1
Estimate region of highest probabilty density
...d and modified # =============================== library(MASS) kde2d.weighted <- function (x, y, w, h, n = n, lims = c(range(x), range(y))) { nx <- length(x) if (length(y) != nx) stop("data vectors must be the same length") gx <- seq(lims[1], lims[2], length = n) # gridpoints x gy <- seq(lims[3], lims[4], length = n) # gridpoints y if (missing(h)) h <- c(bandwidth.nrd(x), bandwidth.nrd(y)); if (missing(w)) w <- numeric(nx)+1; h <- h/4 ax <- outer(gx, x, "-")/h[1] # distance of each point to each grid point in x-direction ay...
2006 Dec 13
2
caching frequently used values
...mpute and store some frequently used matrices "on demand". The Matrix package already uses something like this for storing decompositions, but I don't know how to do it. The actual context is the following: A list has information about a basis of a B-spline space (nodes, order) and gridpoints at which the basis functions would be evaluated (not necessarily the nodes). Something like this: bsplinegrid <- list(nodes=1:8,order=4,grid=seq(2,5,by=.2)) I need the design matrix (computed by splineDesign) for various derivatives (not necessarily known in advance), to be calculated by the...
2006 Nov 07
1
multivariate splines
Hi, I am looking for an R package that would calculate multivarite (mostly 2d and 3d, tensor) cubic interpolating splines, so that I could evaluate these splines (and their derivatives) at many points (unkown at the time of calculating the spline polynomials) repeatedly. To make things concrete, I have an array V with dim(V) = k and gridpoint vectors grid=list(...), length(grid[[i]])==k[i],
2011 Aug 15
2
area under the curve
...else { if (is.function(y)) y <- y(x) else if (length(y) != length(x)) stop("Mismatch in lengths of x and y.\n") s <- order(x) x <- x[s] ddd <- diff(x) if (any(ddd == 0)) stop("Gridpoints must be distinct.\n") equisp <- isTRUE(all.equal(diff(ddd), rep(0, length(ddd) - 1))) y <- y[s] } n <- length(x) - 1 if (equisp) { old.op <- options(warn = -1) on.exit(options(old.op)) M <- matrix(y, nrow = n + 2, ncol =...
2003 Feb 27
4
What's in a name?
Hi, Let's play a little game. Forget all you know, or think you know. Without any context at all, what does the following pattern make you think of? <p> X -> X X -> X | ^ v | X <- X X <- X | ^ v | X X -> X X | ^ | ^ v | v | X -> X
2009 Jul 20
5
heatmap plot
Dear R community! I am trying to create a heatmap based on the following data. As you can see the diagonal (0,0 to 10,10) is always 0). If I run the heatmap command like i posted it I get a graph with horizontal lines. What is my mistake? > heatmap(activity.matrix, Rowv = NA, Colv = NA, scale="column", xlab="x Compounds", ylab="y Compounds",
2008 Jul 01
2
Area Under a Curve
I would like to integrate the area under a curve without any smoothing or the like- just on the raw numbers. I looked at integrate() but it requires a function which I assume means something like x+x^2+x^3 is there a built in function in R for this? #let's say x <- seq(1:50) y <- seq(1:50) plot(y~x) # the are would be 1250 # I would like to be able to do this but on more complicated
2006 Apr 23
2
distribution of the product of two correlated normal
Hi, Does anyone know what the distribution for the product of two correlated normal? Say I have X~N(a, \sigma1^2) and Y~N(b, \sigma2^2), and the \rou(X,Y) is not equal to 0, I want to know the pdf or cdf of XY. Thanks a lot in advance. yu [[alternative HTML version deleted]]
2011 Jan 17
2
Difficult with round() function
Dear list, I'm writing a function to re-grid a data set from finer to coarser resolutions in R as follows (I use this function with sapply/apply): gridResize <- function(startVec = stop("What's your input vector"), to = stop("Missing 'to': How long do you want the fnial vector to be?")){ from <- length(startVec) shortVec<-numeric() tics <- from*to
2006 Jan 28
3
Creating 3D Gaussian Plot
Hello, I requested help a couple of weeks ago creating a dipole field in R but receieved no responses. Eventually I opted to create a 3d sinusoidal plot and concatenate this with its inverse as a means for a "next best" situation. It seems that this isn't sufficient for my needs and I'm really after creating a continuous 3d gaussian mesh with a "positive" and