similar to: Vectorized code for generating the Kac (Clement) matrix

Displaying 20 results from an estimated 1000 matches similar to: "Vectorized code for generating the Kac (Clement) matrix"

2006 Mar 11
1
Non-linear Regression : Error in eval(expr, envir, enclos)
Hi.. i have an expression of the form: model1<-nls(y~beta1*(x1+(k1*x2)+(k1*k1*x3)+(k2*x4)+(k2*k1*x5)+(k2*k2*x6)+(k3*x7)+(k3*k4*x8)+(k3*k2*x9)+(k3*k3*x10)+ (k4*x11)+(k4*k1*x12)+(k4*k2*x13)+(k4*k3*x14)+(k4*k4*x15)+(k5*x16)+(k5*k1*x17)+(k5*k2*x18)+(k5*k3*x19)+
2008 Feb 01
2
the "union" of several data frame rows
Hi, I have a question about how to obtain the union of several data frame rows. I'm trying to create a common key for several tests composed of different items. Here is a small scale version of the problem. These are keys for 4 different tests, not all mutually exclusive: id q1 q2 q3 q4 q5 q6 1 A C 2 B D 3 A D B 4 C D B D I would like
2004 Oct 04
3
Beginners problem
Hi, I'm new to R and have a problem with a little test program (see below). Why doesn't <<- in function rk4 assign the new value to y so that it is seen in rktest. I thought that <<- does exactly this. But it seems that I didn't get it right. I would be very appreciative for an explanation of that behaviour of <<-. I know how to write the whole thing so that it
2012 May 15
2
Renaming names in R matrix
I have the following matrix: > dat [,1] [,2] [,3] [,4] foo 0.7574657 0.2104075 0.02922241 0.002705617 foo 0.0000000 0.0000000 0.00000000 0.000000000 foo 0.0000000 0.0000000 0.00000000 0.000000000 foo 0.0000000 0.0000000 0.00000000 0.000000000 foo 0.0000000 0.0000000 0.00000000 0.000000000 foo 0.0000000 0.0000000 0.00000000 0.000000000 and given this:
2009 Oct 19
1
updating columns using other column as reference
Dear R-gurus, Just supose I have a dara.frame that looks like myDF<-read.table(stdin(),head=T,sep=",") codID,namesp,k1,k2,k3,k4 1,spA,2,5,6,3 2,spB,4,5,4,6 3,spC,2,1,5,6 4,spC,5,4,3,2 5,spD,1,2,3,4 6,spE,2,4,3,1 I need to update the columns k1-k4 with the namesp, but considering the math between Kx and codID. My desired output must looks like: codID,namesp,k1,k2,k3,k4
2006 Nov 29
2
How to solve differential equations with a delay (time lag)?
Hi, I would like to solve a system of coupled ordinary differential equations, where there is a delay (time lag) term. I would like to use the "lsoda" function "odesolve" package. However, I am not sure how to specify the delay term using the syntax allowed by odesolve. Here is an example of the kind of problem that I am trying to solve: > library(odesolve)
2011 Jul 27
2
fitting sine wave
Dear R-helpers ? I have 7 data points that I want to fit a continuous curve to, that should look similar to a sine wave My data points would mark the local minima and maxima respectively. This is what I?ve got so far. And I would keep doing so, but sadly nls() then says that it has reached the maximum number of Iterations? ?
2010 Nov 21
1
solve nonlinear equation using BBsolve
Hi r-users, I would like to solve system of nonlinear equation using BBsolve function and below is my code.  I have 4 parameters and I have 4 eqns. mgf_gammasum <- function(p) { t  <- rep(NA, length(p)) mn <- 142.36 vr <- 9335.69 sk <- 0.8139635 kur <- 3.252591 rh  <- 0.896 # cumulants k1 <- p[1]*(p[2]+p[3]) k2 <- p[1]*(2*p[2]*p[3]*p[4] +p[2]^2+p[3]^2) k3 <-
2001 Sep 11
2
Differential Equations Using R?
To whom it may concern, I am a student at Macaleste College, and next semester Macalester is going to offer a course for CellBio that is mainly statistically based. For the most part the students will be using R for analysis. The problem is there will be some simple differential equations for the students to solve. The committee that in charge of the classes corriculam would like only to
2008 Mar 28
1
Device problems in a loop.
I have tried the following code to plot and save many box plots in files. The code works by itself, but does not run in a loop. The error indicates that there is no device. The error is printed below the code. Code: for(i in 1:len) { A = as.numeric(delta[Delta[i,1]]) B = as.numeric(delta[Delta[i,2]]) C = as.numeric(delta[Delta[i,3]]) D = as.numeric(delta[Delta[i,4]]) data
2009 May 06
1
'RG' looks like a pre-2.4.0 S4 object: please recreate it
I would like to load ApoAI.RData. During the operation of reading this data an error occurs. There is also a problem with STF file. > library (limma) > load("ApoAI.RData") Warning message: 'RG' looks like a pre-2.4.0 S4 object: please recreate it > objects() [1] "RG" > names(RG) [1] "R" "G" "Rb"
2007 Aug 14
2
State Space Modelling
Hey all, I am trying to work under a State Space form, but I didn't get the help exactly. Have anyone eles used this functions? I was used to work with S-PLUS, but I have some codes I need to adpt. Thanks alot, Bernardo [[alternative HTML version deleted]]
2009 Aug 03
3
Help with reshaping data.frame
I'm having trouble reshaping a data.frame from long to wide. (I think that's the right terminology; feel free to educate me.) I've looked at the reshape function and package and plyr package, but I can't quite figure out how to do this after a dozen variations. I have a data.frame with more levels than this, but similar to: > tst K1 K2 K3 V1 V2 V3 1 10 D a 0.08 99
2012 Apr 12
1
Help with vectorization
Hi every one. I have a exponential function (3 fitting parameters) that I would like to use to produce data (6 series) without having to use a loop. Here wl = seq(300,500,1) k1 = c(1.2e-6, 4.9e-6, 9.6e-6, 2.7e-10, 6.7e-8, 7.44e-6) k2 = c(726, 352, 128, 5232, 1538, 128) k3 = c(-176, -224, -257, 88.7, -111, -256) stations = c('R5d', 'R5a', 'R9', '108',
2016 Sep 25
3
Variable Progresiva
Hola Comunidad, Tengo una duda, Queria que en un For si fuese ejecutando un proceso desde 1 hasta 5 por poner un ejemplo , y que el resultado se fuese guardando en variables que se llamar Ki, es decir k1, k2, k3... Un ejemplo de como crei que funcionaria y no lo hizo xD for (i in 1:3) { paste("k", i, sep = "") <- sum(1:i) } Esperaba se crearan las variables k1 =
2002 Mar 08
1
Problems with Solaris 8 and OpenSSH 3.1p1
When compiling the software it breaks with an error on the cipher.c file. Lot's of warnings and error of undeclared stuff. Snippet follows: gcc -g -O2 -Wall -Wpointer-arith -Wno-uninitialized -I. -I. -I/usr/local/ssl/include -Iyes -I/usr/local/include -DSSHDIR=\"/etc\" -D_PATH_SSH_PROGRAM=\"/usr/bin/ssh\"
2011 Aug 17
2
An example of very slow computation
This message is about a curious difference in timing between two ways of computing the same function. One uses expm, so is expected to be a bit slower, but "a bit" turned out to be a factor of >1000. The code is below. We would be grateful if anyone can point out any egregious bad practice in our code, or enlighten us on why one approach is so much slower than the other. The problem
2010 Aug 20
5
paired samples, matching rows, merge()
Hi everyone! I'm matching two samples to create one sample that have pairs of observations equal for the k1 variable. Merge() doesn't work because I dont't want to recycle the values. x <- data.frame(k1=c(1,1,2,3,3,5), k2=c(20,21,22,23,24,25)) x y <- data.frame(k1=c(1,1,2,2,3,4,5,5), k2=c(10,11,12,13,14,15,16,17)) y merge(x,y,by="k1") k1 k2.x k2.y 1 1 20
2005 Oct 24
2
(small) bug in nb_decode?
Hi, So I got a crash on the following code: k1=SUBMODE(lpc_enh_k1); k2=SUBMODE(lpc_enh_k2); which in the newer codebase is: bw_lpc(SUBMODE(lpc_enh_k1), st->interp_qlpc, awk1, st->lpcSize); bw_lpc(SUBMODE(lpc_enh_k2), st->interp_qlpc, awk2, st->lpcSize); I am not sure if the newer code will have the same issue but the following check is
2012 Nov 22
2
[LLVMdev] Disable loop unroll pass
Hi, Gang: I remember there were different voices when you check-in the code. I agree with them although I didn't reply your mail in open64's mailing list. In the transformation you illustrate, it involves two operations: 1) promote WHILE-loop into DO-loop (i.e noncountable loop to countable loop) 2) get rid of trip-count dec/inc and compare. 1) is irrelevant to HW loop.