similar to: "Improvement with the R code"

Displaying 20 results from an estimated 100 matches similar to: ""Improvement with the R code""

2017 Aug 28
0
"Improvement with the R code"
Hi, I think you overthought this one a little bit, I don't know if this is the kind of code you are expecting but I came up with something like that: generate_transition_matrix <- function(data, n_states) { #To be sure I imagine you should check n_states is right at this point transitions <- matrix(0, n_states, n_states) #we could improve a little bit here because at
2017 Aug 28
0
"Improvement with the R code"
Chuck (Is it fine to call you Chuck?) has far more R jutsu than I do obviously. I don't know much about pmin and factor but it might worth looking into if you want to manipulate states by names (I assume this is why one might want to use it?) generate_transition_matrix <- function(data, states) prop.table(table(head(data, -1), tail(data, -1)), 1)[states,]
2017 Aug 28
0
"Improvement with the R code"
Ok, I assumed you wanted to compute a matrix M for all states such that M[i][j]= transition from state i to state j / number of transition from state i but from what you just answered it looks like you want to compute a matrix M for a set of states S such that: M[S_i][S_j]= transition from state S_i to state S_j / number of transition from state S_i where S_i is in the set S ? 2017-08-28
2017 Sep 20
1
How to use depmix for HMM with intial parameters
Hello, I have initial parameters for HMM model and I want to use depmixS4 package. The parameters are in the form intial_prob_matrix=matrix(c(0.07614213, 0.45177665, 0.47208122), nrow=1, ncol=3, byrow = TRUE) transition_matrix=matrix(c(0.46666667,0.46666667,0.06666667, 0.06741573,0.5617978,0.37078652, 0.02173913,0.3478261,0.63043478), nrow = 3, ncol =
2009 Sep 19
2
Counting observations of a combined factor
#I have a dataset with two factor. I want to combine those factors into a single factor and count the number of data values for each new factor. The following gives a comparable dataframe: a <- rep(c("a", "b"), c(6,6)) b <- rep(c("c", "d"), c(6,6)) df <- data.frame(f1=a, f2=b, d=rnorm(12)) df # I use the 'interaction' function to combine
2007 Oct 19
0
calculating power of log rank test
hie Im trying to calculate the power of the logrank test for different values of rho .I was just wandering whether the following programme would do it. any suggestions are welcome s=50 number=1 count1=0;count2=0;count3=0;count4=0;count5=0;count6=0;count7=0;count7=0; count8=0;count9=0 while(s!=0){ n=20 n1=n/2
2008 Feb 14
0
help in simplyfiying programme
my program given below can some one make it presentable. I trying to simulate survival data and calculate the power. I think i could have done better. s=10 number=0 count1=0;count2=0;count3=0;count4=0;count5=0;count6=0;count7=0;count8=0; count9=0; count11=0;count22=0;count33=0;count44=0;count55=0;count66=0;count77=0; count88=0;count99=0; while(s!=0){ n=100 n1=n/2 n2=n/4
2009 Jul 09
3
Looking for recommendations for blocking hacking attempts
Hello: I have been looking into projects that will automatically restrict hacking attempts on my servers running CentOS 5. I think the two top contenders are: DenyHosts - http://denyhosts.sourceforge.net Fail2ban - http://www.fail2ban.org >From what I see, DenyHosts only blocks based on failed SSH attempts whereas Fail2ban blocks failed attempts for other access as well. The main benefit
2012 Aug 14
2
igraph: Turn multiple edges into weights
Dear all, I have some network data - about 300 vertices and several thousand edges. I am looking for a way to turn multiple edges into weights of the edges. I looked around and - surprisingly? - haven't found anything. Is there an easy way to do this? Best, Jonas [[alternative HTML version deleted]]
2010 Jun 28
2
Stacked Histogram, multiple lines for dates of news stories?
Dear colleagues, I have extracted the dates of several news stories from a newspaper data base to chart coverage trends of an issue over time. They are in a data frame that looks just like one generated by the reproducible code below. I can already generate a histogram of the dates with various intervals (months, quarters, weeks years) using hist.Date. However, there are two other
2007 Feb 20
1
Reshape (pivot) question
Hi R-users, I have a data set like this (first ten rows): id patient_id date code class eala ID1564262 1562 6.4.2006 12:00 5555 1 NA ID1564262 1562 6.4.2006 12:00 5555 1 NA ID1564264 1365 14.2.2006 14:35 5555 1 50 ID1564265 1342 7.4.2006 14:30 2222 2 50 ID1564266 1648 7.4.200614:30 2222 2 50 ID1564267 1263 10.2.2006 15:45 2222 2 10 ID1564267 1263 10.2.200615:45 3333 3 10 ID1564269 5646
2012 Sep 04
1
Producing a SMA signal when closing price is above the moving average for 3 days
I have loaded price data for GE and then calculated a 50 day simple moving average. Then I have a created a ifelse statement that produce a 1 when GE's closing price is above the simple moving average and a 0 when GE Closing price is below the 50 day simple moving average. However, what I really want to do is to produce a 1 for when the price is above the simple moving average for 3 days
2005 Oct 16
1
GROUP and GROUP_COUNT
I have a macro and when I call it I have something like this: exten => s,1,NoOp(Group Count: ${GROUP_COUNT(MYGROUP)}) exten => s,n,Set(GROUP()=MYGROUP) ;Set Group exten => s,n,NoOp(Group List: ${GROUP_LIST()}) exten => s,n,NoOp(Group Count: ${GROUP_COUNT(MYGROUP)}) The GROUP_COUNT returns zero before the call to GROUP but also returns 0 after the call to GROUP. If I
2018 Jan 24
2
[PATCH] D41675: Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Hello, Is there a script to update those test cases? I see mention of a sed script in the commit message but when I try it (see attached) on sed I get the following error: sed: file script line 2: invalid reference \3 on `s' command's RHS Did I lose something in a copy-paste? Is it not really a sed script? How do I run it? On Fri, Jan 19, 2018 at 9:15 AM, Daniel Neilson via
2018 Jan 24
0
[PATCH] D41675: Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Hi Alexandre, The script uses extended-sed syntax, so you need to run sed with the -E option. For example, when preparing the patch I created a file ( script.sed ) containing all of the lines that I copied into the commit message. Then, I ran this bash one-liner from the test directory: for f in $(find . -name '*.ll'); do sed -E -i ‘.sedbak' -f script.sed $f; done When I was happy
2018 Jan 25
2
[PATCH] D41675: Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Thanks, that worked like a charm except for the following: llvm generate: call void @llvm.memcpy.p3i8.p1i8.i64(i8 addrspace(3)* align 1 bitcast ([512 x float] addrspace(3)* @a_scratchpad to i8 addrspace(3)*), i8 addrspace(1)* align 1 %0, i64 2048, i1 false) And we expected: call void @llvm.memcpy.p3i8.p1i8.i64(i8 addrspace(3)* bitcast ([512 x float] addrspace(3)* [[SPM0]] to i8
2018 Jan 25
3
[PATCH] D41675: Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Yes, all that is correct. My question is more a long term question: why do the .ll printer specify the alignment if it is equivalent to the default one? That is, it seems the sed script expect the printer to not specify it (this would match the load/store behavior), but the ll-printer does specify it, which either means the printer is not ideal on this case and I should fix it, or in this case
2018 Jan 25
0
[PATCH] D41675: Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Hi Alexandre, Before the change you would have been expecting one of the following, correct? a) call void @llvm.memcpy.p3i8.p1i8.i64(i8 addrspace(3)* bitcast ([512 x float] addrspace(3)* [[SPM0]] to i8 addrspace(3)*), i8 addrspace(1)* [[APTR]], i64 2048, i32 0, i1 false) b) call void @llvm.memcpy.p3i8.p1i8.i64(i8 addrspace(3)* bitcast ([512 x float] addrspace(3)* [[SPM0]] to i8 addrspace(3)*), i8
2018 Jan 25
0
[PATCH] D41675: Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Good question. AFAIK, the IR-printer doesn’t understand the semantics of parameter attributes. In this case, it only knows that there is an attribute on the parameter that is integer valued (with value 1) and that has the name “align”, so it prints it out. If we don’t want it printing out ‘align 1’ then it’s up to us to not set the alignment parameter attribute to a value if that value would be 1.
2010 Feb 26
5
[PATCH 0/5] renouveau: nv30/nv40 unification
This patchset applies some minor fixes to renouveau.xml and then unifies the nv30 and nv40 register definitions. nv30 and nv40 are very similar and have the same offsets for the registers they share. The major differences are: 1. Texture setup is different due to full NPOT support on nv40 2. More advanced blending/render targets on nv40 3. NV30 has fixed function registers, which NV40 lacks The