[R] Indexes for Simplexes

2010-01-27 Thread John Tillinghast
I'm going to be manipulating some 3-rd and 4-th rank tensors in relatively high dimensions, and it would help a great deal to use only the unique entries instead of repeating every operation 6 or 24 times. Operations are tensor-matrix, tensor-vector, and tensor-tensor multiplication. Does any

[R] mgcv with discrete covariates, interaction term

2009-12-21 Thread John Tillinghast
I'm trying to build a model with an overall smooth function for all the data, plus an additional smooth function for *some* of the data. If "ind" is my indicator variable (0 for some x, 1 for others), I imagined I could write it like this: gam.obj <- gam(y ~ s(x) + ind*s(x)) but this does no

[R] standardGeneric seems slow; any way to get around it?

2009-11-10 Thread John Tillinghast
ng on in the usual functions; is there any way to avoid that and go straight to the calculaions? Thanks John Tillinghast [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

[R] Passing environments: why doesn't this work???

2009-02-15 Thread John Tillinghast
This is a trivial example I set up to see if I could pass an environment and use the variables in it (this is for a function that will be called many times and might need to use a lot of variables that won't be changing, so it seemed more sensible to use an environment). Here's the code: #

[R] Taking slices with tensorA

2008-12-02 Thread John Tillinghast
I've set up a simple tensor with indices 'a' and 'b'. > ftable(B) b u v w x y a a1 0.001868954 0.403345197 0.030088185 0.137252368 0.142634612 a2 0.396935972 0.945219795 0.068828465 0.314180585 0.446338719 a3 0.752412200 0.748810918 0.1255

Re: [R] Sending "..." to a C external

2008-08-25 Thread John Tillinghast
mize over one (vector) argument. As with optim, this C code will pass all the arguments for the user-provided R function back into R, over and over. I am open to any suggestions about how to do this simply and efficiently. On Fri, Aug 22, 2008 at 2:16 PM, John Tillinghast <[EMAIL PROTECTED]>

[R] Sending "..." to a C external

2008-08-22 Thread John Tillinghast
I'm trying to figure this out with "Writing R Extensions" but there's not a lot of detail on this issue. I want to write a (very simple really) C external that will be able to take "..." as an argument. (It's for optimizing a function that may have several parameters besides the ones being optimize

[R] LSODA not accurate when RK4 is; what's going on?

2008-04-09 Thread John Tillinghast
I'm solving the differential equation dy/dx = xy-1 with y(0) = sqrt(pi/2). This can be used in computing the tail of the normal distribution. (The actual solution is y(x) = exp(x^2/2) * Integral_x_inf {exp(-t^2/2) dt} = Integral_0_inf {exp (-xt - t^2/2) dt}. For large x, y ~ 1/x, starting around x~