Displaying 20 results from an estimated 55 matches for "k4".
Did you mean:
4k
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)+ (k5*k4*x20)+(k5*k5*x21)+(k6*x22)+(k6*k1*x23)+(k6*k2*x24)+(k6*k3*x25)+(k6*k4*x26)+(k6*k5*x27)+(k6*k6*x28)+ (k7*x29)+(k7*k1*x30)+(k7*k2*x...
2012 Jun 14
0
fixed trimmed mean for j-group
...u,sd3)
d=rnorm(n4,miu,sd4)
## data transformation
g=0
h=0
w<-a*exp(h*a^2/2)
x<-b*exp(h*b^2/2)
y<-c*exp(h*c^2/2)
z<-d*exp(h*d^2/2)
mat1<-sort(w)
mat2<-sort(x)
mat3<-sort(y)
mat4<-sort(z)
alpha=0.15
k1=floor(alpha*n1)+1
k2=floor(alpha*n2)+1
k3=floor(alpha*n3)+1
k4=floor(alpha*n4)+1
r1=k1-(alpha*n1)
r2=k2-(alpha*n2)
r3=k3-(alpha*n3)
r4=k4-(alpha*n4)
## j-group trimmed mean
e1=k1+1
f1=n1-k1
e2=k2+1
f2=n2-k2
e3=k3+1
f3=n3-k3
e4=k4+1
f4=n4-k4
trim1=1/((1-2*alpha)*n1)*(sum(mat1[e1:f1]) + r1*(mat1[k1]+mat1[n1-k1+1]))
trim2=1/((1-2*alpha)*n2)*(sum(mat2[e2:f2...
2002 Mar 27
2
Error with nls
...:
db5 = - (k50+k56)*b5 + k56*b6 + c*g(t) + h
db6 = + k65*b5 - (k60+k65)*b6 + d
db5, db6 are the first derivatives, b5, b6 are the functions to be
fitted. The remaining parameters are unknown and should follow from the
fit.
assuming that g(t) has the functional form: b4i + (b40-b4i)*exp(-k4*t)
(after calculations of 2 papers of A4) follows the solution:
L5L6 <- function(b40, b4i, k4, t, p50, p56, p60, p65, pc, ph, pd, pb50,
pb60) {
k50 <- exp(p50)
k56 <- exp(p56)
k60 <- exp(p60)
k65 <- exp(p65)
c <- exp(pc)
h <- exp(ph)
d <- exp(pd)...
2008 Feb 01
2
the "union" of several data frame rows
...quot;, "B", " ", " ",
+ "4", " ", "C", "D", " ", "B", "D"),
+ byrow=TRUE, ncol = 7)
>
> k1 <- key[1, 2:7]
> k2 <- key[2, 2:7]
> k3 <- key[3, 2:7]
> k4 <- key[4, 2:7]
>
> itemid <- c("q1", "q2", "q3", "q4", "q5", "q6")
>
> k1 <- cbind(itemid, k1)
> k2 <- cbind(itemid, k2)
> k3 <- cbind(itemid, k3)
> k4 <- cbind(itemid, k4)
>
> tm...
2012 Jul 07
0
fixed trimmed mean for group
...z<-d*exp(h*d^2/2)
>
> mat1<-sort(w)
> mat2<-sort(x)
> mat3<-sort(y)
> mat4<-sort(z)
>
> alpha=0.15
> k1=floor(alpha*n1)+1
> k2=floor(alpha*n2)+1
> k3=floor(alpha*n3)+1
> k4=floor(alpha*n4)+1
>
> r1=k1-(alpha*n1)
> r2=k2-(alpha*n2)
> r3=k3-(alpha*n3)
> r4=k4-(alpha*n4)
>
> ## j-group trimmed mean
>
> e1=k1+1
> f1=n1-k1
>
> e2=k2+1
> f2=n2-k2
>
>...
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 works (return the updated...
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
1,spA,spB,spD,spE,spC
2,spB,...
3,spC,...
4,spC,...
5...
2012 May 15
2
Renaming names in R matrix
....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:
> new_names <- c("k0","k1","k2,"k3","k4","k5");
How can I get this?
[,1] [,2] [,3] [,4]
k0 0.7574657 0.2104075 0.02922241 0.002705617
k1 0.0000000 0.0000000 0.00000000 0.000000000
k2 0.0000000 0.0000000 0.00000000 0.000000000
k3 0.0000000 0.0000000 0.00000000 0.000000000
k4 0.000...
1997 Apr 30
2
R-alpha: New Incomplete Beta Function
...:
if (flag == 1) {
if (t <= DBL_EPSILON)
t = 1 - DBL_EPSILON;
else
t = 1 - t;
}
return t;
}
/* Continued fraction expansion #1
* for incomplete beta integral
*/
static double incbcf(double a, double b, double x)
{
double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
double k1, k2, k3, k4, k5, k6, k7, k8;
double r, t, ans, thresh;
int n;
k1 = a;
k2 = a + b;
k3 = a;
k4 = a + 1;
k5 = 1;
k6 = b - 1;
k7 = k4;
k8 = a + 2;
pkm2 = 0;
qkm2 = 1;
pkm1 = 1;
qkm1 = 1;
ans = 1;
r = 1;
n = 0;
thresh = 3 * DBL_EPSILON;
do {
xk = -(x * k1 * k2) / (k3 * k4);
pk = pkm1 + pkm...
2006 Nov 29
2
How to solve differential equations with a delay (time lag)?
...an example of the kind of problem that I am trying to solve:
> library(odesolve)
yprime <- function(t, y, p) { # this function
yd1 <- p["k1"] *(t <= p["T"]) - p["k2"] * y[2]
yd2 <- p["k3"] * y[1](t - p["delay"]) - p["k4"] * y[2] # this is not
syntactically valid, but it is what I would like to do
list(c(yd1,yd2))
}
times <- seq(0,30,by=0.1)
y0 <- c(0,0)
parms <- c(k1=0.7, k2=0.5, k3=0.2, k4=0.8, T=10, delay=5)
Is there a way to incorporate delay in odesolve?
Any hints would be much a...
2017 Jul 13
2
Help with R script
...of lines...that
is like as follows:
[922] "FieldName: Wk3PackSubMonth"
[923] "FieldValue: Apr"
[924] "FieldName: Wk3PackSubYear"
[925] "FieldValue: 2017"
[926] "FieldName: Wk3Code1"
[927] "FieldValue: "
[928] "FieldValue: K4"
[929] "FieldName: Wk3Code2"
[930] "FieldValue: "
[931] "FieldValue: Q49"
I want this to be programmatically corrected to
read as follows: (All consecutive lines starting
with FieldValue is cleaned to retain only one
line)
[922] "FieldName: Wk3PackSu...
2011 Jul 27
2
fitting sine wave
...a 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?
?
m<-c(-0.2061826,0.5888406,0.2026079,1.0000000,0.2342754,0.6865078,-0.1265754)
x <- c(1,2,3,4,5,6,7)
p <- nls(m~k1*x+k2*cos(x)+k3*sin(x)+k4*cos(2*x)+k5*sin(2*x)+k6*cos(3*x),start = list(k1=0,k2=0,k3=0.1,k4=0.1,k5=0,k6=0))
par ?<- c(pk1=summary(p)$parameters[1,1],pk2=summary(p)$parameters[2,1],pk3=summary(p)$parameters[3,1],pk4=summary(p)$parameters[4,1],pk5=summary(p)$parameters[5,1],pk6=summary(p)$parameters[6,1])
xx <- seq(1,7,...
2013 Apr 25
2
Vectorized code for generating the Kac (Clement) matrix
Hi,
I am generating large Kac matrices (also known as Clement matrix). This a tridiagonal matrix. I was wondering whether there is a vectorized solution that avoids the `for' loops to the following code:
n <- 1000
Kacmat <- matrix(0, n+1, n+1)
for (i in 1:n) Kacmat[i, i+1] <- n - i + 1
for (i in 2:(n+1)) Kacmat[i, i-1] <- i-1
The above code is fast, but I am curious about
2010 Nov 21
1
solve nonlinear equation using BBsolve
...m <- 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 <- 2*p[1]*(p[2]+p[3])*(p[2]^2 + p[3]^2 - p[2]*p[3] + 3*p[2]*p[3]*p[4])
k4 <- 6*p[1]*((p[2]+p[3])^2*(p[2]^2 + p[3]^2 - 2*p[2]*p[3] + 4*p[2]*p[3]*p[4])+
2*p[2]^2*p[3]^2*(1-p[4])^2)
t[1] <- k1 - mn
t[2] <- k2 - vr
t[3] <- k3/(k2^1.5) - sk
t[4] <- k4/(k2^2) - kur
t
}
I tried this
p0 <- rep(0, 4)
BBsolve(par = p0, fn = mgf_gammasum)
dfsane(par = p0, fn...
2012 Jan 12
0
multcomp two-way anova with interactions within and between
...(matrix(0, nrow = nrow(Tukey), ncol = ncol(Tukey)), Tukey)
rownames(K2) <- paste(levels(d.fr$treat2)[2],rownames(K1), sep = ":")
K3 <- cbind(matrix(0, nrow = nrow(Tukey), ncol = ncol(Tukey)), Tukey)
rownames(K3) <- paste(levels(d.fr$treat2)[3],rownames(K1), sep = ":")
K4 <- cbind(matrix(0, nrow = nrow(Tukey), ncol = ncol(Tukey)), Tukey)
rownames(K4) <- paste(levels(d.fr$treat2)[4],rownames(K1), sep = ":")
K <- rbind(K1, K2, K3,K4)
colnames(K) <- c(colnames(Tukey), colnames(Tukey))
#K gives me a matrix with the dimension 12 by 6 and this will...
2017 Jul 13
0
Help with R script
...Name: Wk3PackSubMonth"
>
> [923] "FieldValue: Apr"
>
> [924] "FieldName: Wk3PackSubYear"
>
> [925] "FieldValue: 2017"
>
> [926] "FieldName: Wk3Code1"
>
> [927] "FieldValue: "
>
> [928] "FieldValue: K4"
>
> [929] "FieldName: Wk3Code2"
>
> [930] "FieldValue: "
>
> [931] "FieldValue: Q49"
>
>
> I want this to be programmatically corrected to
> read as follows: (All consecutive lines starting
> with FieldValue is cleaned to retai...
2017 Jul 13
2
Help with R script
...923] "FieldValue: Apr"
>
> [924] "FieldName: Wk3PackSubYear"
>
> [925] "FieldValue: 2017"
>
> [926] "FieldName: Wk3Code1"
>
> [927] "FieldValue: "
>
> [928] "FieldValue: K4"
>
> [929] "FieldName: Wk3Code2"
>
> [930] "FieldValue: "
>
> [931] "FieldValue: Q49"
>
>
> I want this to be programmatically corrected to
> read as follows: (All consecutive lines starting...
2017 Jul 14
0
Help with R script
...; > [924] "FieldName: Wk3PackSubYear"
> >
> > [925] "FieldValue: 2017"
> >
> > [926] "FieldName: Wk3Code1"
> >
> > [927] "FieldValue: "
> >
> > [928] "FieldValue: K4"
> >
> > [929] "FieldName: Wk3Code2"
> >
> > [930] "FieldValue: "
> >
> > [931] "FieldValue: Q49"
> >
> >
> > I want this to be programmatically corrected to
> >...
2008 Mar 28
1
Device problems in a loop.
...)
{
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 <- scan(filenames52[i], quiet=TRUE)
data <- matrix(data, ncol=8)
grp <- c('K1','K2','K3','K4','N','NBC','NE','NEBC')
grp <- as.factor(rep(grp, each=200))
bwplot(c(data)~grp, ylab='MSE', pch=19,
par.settings = list(plot.symbol = list(pch = "+")),
main=eval(substitute(expression(paste(' ', delta[p...
2009 May 06
1
'RG' looks like a pre-2.4.0 S4 object: please recreate it
...C57BL/6
c2 a1koc2.spot Pool C57BL/6
c3 a1koc3.spot Pool C57BL/6
c4 a1koc4.spot Pool C57BL/6
c5 a1koc5.spot Pool C57BL/6
c6 a1koc6.spot Pool C57BL/6
c7 a1koc7.spot Pool C57BL/6
c8 a1koc8.spot Pool C57BL/6
k1 a1kok1.spot Pool ApoAI-/-
k2 a1kok2.spot Pool ApoAI-/-
k3 a1kok3.spot Pool ApoAI-/-
k4 a1kok4.spot Pool ApoAI-/-
k5 a1kok5.spot Pool ApoAI-/-
k6 a1kok6.spot Pool ApoAI-/-
k7 a1kok7.spot Pool ApoAI-/-
k8 a1kok8.spot Pool ApoAI-/-
> spottypes=readSpotTypes("ApoAISpotTypes.txt")
> spottypes
SpotType ID Name Color
1 cDNA * * black
2 BLANK BLAN...