Displaying 20 results from an estimated 289 matches for "t5".
2017 Jun 03
4
New var
...etween the start date and end dates
(End-start).
obs, Start , end, datediff
1,2/1/2015, 1/1/2017, 700
2,4/11/2010, 1/1/2011, 265
3,1/4/2006, 5/3/2007, 484
4,10/1/2007, 1/1/2008, 92
5,6/1/2011, 1/1/2012, 214
6,10/15/2004,12/1/2004,47
Second. I want create 5 more variables t1, t2, t3, t4 and t5
The value of each variable is defined as follows
if datediff < 100 then t1=1, t2=t3=t4=t5=-1.
if datediff >= 100 and < 200 then t1=0, t2=1,t3=t4=t5=-1,
if datediff >= 200 and < 300 then t1=0, t2=0,t3=1,t4=t5=-1,
if datediff >= 300 and < 400 then t1=0, t2=0,t3=0,t4=1,t...
2008 Oct 15
1
MLE Constraints
..., 1)
x3 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
states = c(1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 2, 3, 1, 1)
prob_fn = rep(0,M)
Model=function(a, b, c, d, e, f, g, h, i, j, k, l)
{
p1 = exp(-(a g*x1 d*x2 j*x3))
p2 = exp(-(b h*x1 e*x2 k*x3))
p3 = exp(-(c i*x1 f*x2 l*x3))
### Set P
t5 = 0
while(t5<M)
{
t5 = t5 1
if(states[t5]==1) {prob_ok = p1[1]}
if(states[t5]==2) {prob_ok = p2[1]}
if(states[t5]==3) {prob_ok = p3[1]}
prob_fn[t5] = c(prob_ok)
}
prob_fn[prob_fn==0] = 0.0000000000001
### LL
ll_calc = -(sum(Y*log(prob_fn)))
return(ll_calc)
}
res = mle2(Model, start=list(a...
2011 Nov 06
1
Deleting rows dataframe in R conditional to “if any of (a specific variable) is equal to”
...ID "EID" of length 821 extracted from one of my dataframe (skate). It looks like this:
> head(skate$EID)
[1] "896-19" "895-8" "899-1" "899-5" "899-8" "895-7"
I would like to remove the complete rows in another dataframe (t5) if any of the t5$EID is equal (a duplicate) of skate$EID.
I was able to get my 'duplicated' dataframe in t5 of all my matching EID as follow:
> xx<-skate$EID
> t5[match(xx,t5[,26]), ]#gives me a dataframe of all matching EID in skate$EID
record.t trip set month stratum NA...
2017 Jun 03
0
New var
...>
> obs, Start , end, datediff
> 1,2/1/2015, 1/1/2017, 700
> 2,4/11/2010, 1/1/2011, 265
> 3,1/4/2006, 5/3/2007, 484
> 4,10/1/2007, 1/1/2008, 92
> 5,6/1/2011, 1/1/2012, 214
> 6,10/15/2004,12/1/2004,47
>
> Second. I want create 5 more variables t1, t2, t3, t4 and t5
> The value of each variable is defined as follows
> if datediff < 100 then t1=1, t2=t3=t4=t5=-1.
> if datediff >= 100 and < 200 then t1=0, t2=1,t3=t4=t5=-1,
> if datediff >= 200 and < 300 then t1=0, t2=0,t3=1,t4=t5=-1,
> if datediff >= 300 and < 400 the...
2017 Jun 03
2
New var
...start end D
1 1 2/1/2015 1/1/2017 700
2 2 4/11/2010 1/1/2011 265
3 3 1/4/2006 5/3/2007 484
4 4 10/1/2007 1/1/2008 92
5 5 6/1/2011 1/1/2012 214
6 6 10/5/2004 12/1/2004 57
My problem is how do I get the other new variables
obs start end D t1,t2,t3,t4, t5
1, 2/1/2015, 1/1/2017, 700,0,0,0,0,0
2, 4/11/2010, 1/1/2011, 265,0,0,1,-1,-1
3, 1/4/2006, 5/3/2007, 484,0,0,0,0,1
4, 10/1/2007, 1/1/2008, 92,1,-1,-1,-1,-1
5, 6/1/2011, 1/1/2012, 214,0,0,1,-1,-1
6, 10/15/2004,12/1/2004,47,1,-1,-1,-1,-1
Thank you again.
On Sat, Jun 3, 2017 at 12:13 AM, Bert Gu...
2010 Jun 02
1
compute the associate vector of distances between leaves in a binary non-rooted tree
...d this vector.
For example, using rtree(5,rooted=F) I've obtained the following tree:
$edge
[,1] [,2]
[1,] 6 7
[2,] 7 1
[3,] 7 8
[4,] 8 2
[5,] 8 3
[6,] 6 4
[7,] 6 5
$tip.label
[1] "t4" "t3" "t2" "t1" "t5"
$edge.length
[1] 0.9126727 0.2765674 0.4996832 0.7904400 0.8508797 0.8174133 0.9027958
$Nnode
[1] 3
My question is: how to compute the vector of distances between the 5 leaves. This vector is in this case:
v=(d(t1,t2),d(t1,t3),d(t1,t4),d(t1,t5),d(t2,t3),d(t2,t4),d(t2,t5),d(t3,t4),d(t3,t5)...
2017 Jun 04
2
New var
...00 <= DFM$D & DFM$D < 200, 1, ifelse( DFM$D < 100, -1,
> 0 ) )
> DFM$t3 <- ifelse( 200 <= DFM$D & DFM$D < 300, 1, ifelse( DFM$D < 200, -1,
> 0 ) )
> DFM$t4 <- ifelse( 300 <= DFM$D & DFM$D < 400, 1, ifelse( DFM$D < 300, -1,
> 0 ) )
> DFM$t5 <- ifelse( 400 <= DFM$D & DFM$D < 500, 1, ifelse( DFM$D < 400, -1,
> 0 ) )
> # brute force method with ordered factor
> DFM$tf1 <- ifelse( "[0,100)" == DFM$bin, 1, 0 )
> DFM$tf2 <- ifelse( "[100,200)" == DFM$bin, 1, ifelse( "[100,200)"...
2017 Jun 04
0
New var
...1, 0 )
DFM$t2 <- ifelse( 100 <= DFM$D & DFM$D < 200, 1, ifelse( DFM$D < 100, -1, 0 ) )
DFM$t3 <- ifelse( 200 <= DFM$D & DFM$D < 300, 1, ifelse( DFM$D < 200, -1, 0 ) )
DFM$t4 <- ifelse( 300 <= DFM$D & DFM$D < 400, 1, ifelse( DFM$D < 300, -1, 0 ) )
DFM$t5 <- ifelse( 400 <= DFM$D & DFM$D < 500, 1, ifelse( DFM$D < 400, -1, 0 ) )
# brute force method with ordered factor
DFM$tf1 <- ifelse( "[0,100)" == DFM$bin, 1, 0 )
DFM$tf2 <- ifelse( "[100,200)" == DFM$bin, 1, ifelse( "[100,200)" < DFM$bin, 0, -1...
2017 Jun 04
0
New var
...t;data.frame")
Construct a matrix of the six alternatives:
tvals <- c(1, -1, -1, -1, -1, 0, 1, -1, -1, -1, 0, 0, 1, -1, -1, 0, 0,
0, 1, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0)
tmat <- matrix(tvals, 6, 5, byrow=TRUE)
colnames(tmat) <- paste0("t", 1:5)
tmat
# t1 t2 t3 t4 t5
# [1,] 1 -1 -1 -1 -1
# [2,] 0 1 -1 -1 -1
# [3,] 0 0 1 -1 -1
# [4,] 0 0 0 1 -1
# [5,] 0 0 0 0 1
# [6,] 0 0 0 0 0
idx <-as.numeric(DFM$bin)
(DFM <- data.frame(DFM, tmat[idx, ]))
# obs start end D bin t1 t2 t3 t4 t5
# 1 1 2015-02-01 2017-01-01 700 [5...
2017 Aug 10
4
PROC MIXED RANDOM equivalence in R nlme
...#39;m
unable to provide an example.
The original SAS v6.12 code is provided below:
------------------------------------------------------------------
/* READ DATA */
DATA emiss;
INFILE 'data.tab' LRECL=8000 FIRSTOBS=2 DLM='09'X MISSOVER DSD;
INPUT study $ vehicle $ thc rv t5 t9 ar ol ox su bz;
/* CREATE NEW VARIABLES */
ln_thc = log (thc);
new = study||vehicle;
/* PERFORM ANALYSIS */
PROC MIXED DATA=emiss MAXITER=1000 CONVH=1E-8 METHOD=REML NOCLPRINT
NOITPRINT;
CLASS new;
MODEL ln_thc = rv t5 t9 ar ol ox su bz
/S DDFM=RES;
RANDOM int rv...
2009 Nov 09
1
Models
Hi all,
I hope that there might be some statistician out there to help me for a
possible explanation for the following simple question.
Y1~ lm(y~ t1 + t2 + t3 + t4 + t5,data=temp) # oridnary linear model
library(gam)
Y2~ gam(y~ lo(t1) +lo(t2) +lo(t3) +lo(t4) +lo(t5),data=temp) # additive
model
In the first model t1, t2 and t3 found to be significant,.
However, in the second model (using gam package) t1, t4 and t5 are
significant.
I was hopping to expect n...
2012 Jul 06
2
[LLVMdev] Excessive register spilling in large automatically generated functions, such as is found in FFTW
...zk_n);
zk_d = MULI(SUB(zk_p, zk_n));
*r2 = SUB(uk, zk);
*r0 = ADD(uk, zk);
*r3 = ADD(uk2, zk_d);
*r1 = SUB(uk2, zk_d);
}
__INLINE void L_4_4(const float *i0, const float *i1, const float *i2,
const float *i3, __m128 *r0, __m128 *r1, __m128 *r2, __m128 *r3) {
__m128 t0, t1, t2, t3, t4, t5, t6, t7;
t0 = LOAD(i0);
t1 = LOAD(i1);
t2 = LOAD(i2);
t3 = LOAD(i3);
t4 = ADD(t0, t1);
t5 = SUB(t0, t1);
t6 = ADD(t2, t3);
t7 = MULI(SUB(t2, t3));
t0 = ADD(t4, t6);
t2 = SUB(t4, t6);
t1 = SUB(t5, t7);
t3 = ADD(t5, t7);
TX2(&t0,&t1);
TX2(&t2,&t3);...
2007 Nov 01
2
computing the mean of a few variables
hello,
I have a simple question:
I want to compute the average of 6 variables,
my data looks like this:
t0 t1 t2 t3 t4 t5
1 32 34 36 40 38 40
2 35 37 38 36 33 39
.
.
.
I want the mean of t0-t5 for each row (observation).
thank you,
sigalit.
[[alternative HTML version deleted]]
2010 Mar 05
2
Selecting rows of a matrix based on some condition on the columns
The data set consists of two sets of matrices, as labelled by the columns, T's and C's.
> xy
x T1 T2 T3 T4 T5 C1 C2 C3 C4 C5
[1,] 50 0.00 0.00 33.75 0.00 0.00 0.00 36.76 0.00 35.26 0.00
[2,] 13 34.41 0.00 0.00 36.64 32.86 34.11 35.80 37.74 0.00 0.00
[3,] 14 35.85 0.00 33.88 36.68 34.88 34.58 0.00 32.75 37.45 0.00
[4,] 33 34.56 0.00 0.00 36.00 0.00 0.00 36.56 0.00 34.83...
2004 Dec 20
0
[LLVMdev] Re: Compiling FreeType 2.1.9 with LLVM 1.4
...ile a bug and
> attach the pre-processed source to it. You can get that with the -E flag
> to GCC.
Many thanks for everyone's wonderful replies.
I added the -E flag to the build options. Are the preprocessed sources the
.o files that now look something like this:
# 1 "/home/adam/t/t5/freetype-2.1.9/src/sfnt/sfnt.c"
# 1 "/home/adam/t/t5/freetype-2.1.9//"
# 1 "/home/adam/t/t5/freetype-2.1.9/src/sfnt/sfnt.c"
# 1 "<built-in>"
# 1 "<command line>"
...
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_i...
2017 Aug 11
0
PROC MIXED RANDOM equivalence in R nlme
...>
> The original SAS v6.12 code is provided below:
>
> ------------------------------------------------------------------
> /* READ DATA */
> DATA emiss;
> INFILE 'data.tab' LRECL=8000 FIRSTOBS=2 DLM='09'X MISSOVER DSD;
> INPUT study $ vehicle $ thc rv t5 t9 ar ol ox su bz;
>
> /* CREATE NEW VARIABLES */
> ln_thc = log (thc);
> new = study||vehicle;
>
> /* PERFORM ANALYSIS */
> PROC MIXED DATA=emiss MAXITER=1000 CONVH=1E-8 METHOD=REML NOCLPRINT
> NOITPRINT;
> CLASS new;
>
> MODEL ln_thc = rv t5 t9 ar ol ox su bz
&...
2011 Dec 12
5
[LLVMdev] nsw is still logically inconsistent
...ending on that would be an implicit pass dependency,
which is against the rules.
Ok, consider this LLVM IR code fragment:
br i1 %overflow_check, label %no_overflow, label %end
no_overflow:
%t0 = add nsw i32 %a, %b
%t1 = sext i32 %t0 to i64
%t2 = ashr i64 %t1, 31
%t3 = add i64 %t2, 1
%t5 = icmp ult %t3, 2
%t6 = udiv i1 1, %t5
Assume label %no_overflow has no other predecessors. And assume
adding %a and %b can sometimes produce overflow, but only when
%overflow_check is false.
This code has no undefined behavior. It's a bit subtle, but in
particular, note that it's not p...
2015 Jun 21
3
dovecot auth using 100% CPU
...SEEK_CUR) = -1 ESPIPE (Illegal seek)
0.000057 getsockname(19, {sa_family=AF_LOCAL, NULL}, [2]) = 0
0.000043 epoll_ctl(15, EPOLL_CTL_ADD, 19, {EPOLLIN|EPOLLPRI|EPOLLERR|EPOLLHUP, {u32=850618928, u64=140128453618224}}) = 0
0.000040 write(19, "VERSION\tauth-worker\t1\t0\nDBHASH\t5"..., 97) = -1 EPIPE (Broken pipe)
0.000035 --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=17956, si_uid=108} ---
0.000020 epoll_wait(15, {{EPOLLIN|EPOLLHUP, {u32=850618928, u64=140128453618224}}}, 14, 12614) = 1
0.000031 read(19, "", 8192) = 0
0.000...
2006 Jan 21
0
Means from balanced incomplete block design
The code below is intended to analyse a textbook example of a balanced
incomplete block design:
#
# Data taken from pp. 219-230 in
# Cox, D.R. (1958) Planning of Experiments. John Wiley and Son, Inc. New
York. 308 pp.
#
day <- factor(rep(1:10, each = 3))
T <- factor(c("T4","T5","T1","T4","T2","T5","T2","T4","T1","T5",
"T3","T1","T3","T4","T5","T2","T3","T1","T3","T1",
"T4",...
2011 Dec 08
1
optimize()
...ogaritmo da distribui??o condicional de alpha[i]
lp_alphai <- function(alphai, i, beta, tau, N){
t1 <- (N[i+1] - N[i])*log(alphai)
t2 <- - (N[i+1] - N[i])*alphai*log(beta[i])
t3 <- (alphai - 1)*sum(log(times[(N[i] + 1):N[i+1]]))
t4 <- - exp(alphai*(log(tau[i+1]) - log(beta[i])))
t5 <- 0
if(i > 1)
t5 <- exp(alphai*(log(tau[i]) - log(beta[i])))
v <- t1 + t2 + t3 + t4 + t5
return(v)
}
Then, I've done:
optimize(lp_alphai, lower = 0, upper = 10, maximum = TRUE, tol =
0.00000000001, i = 1, beta = 125, tau...