Displaying 20 results from an estimated 300 matches similar to: "Reshaping grouped data"
2008 Apr 14
3
Merging daily and weekly data
Dear R-help group,
I have a dataset with daily closing prices from a stock exchange (consecutive 5 trading days) from a firm trading a specific commodity. The date variable looks like:
quote_date
20080411
With the format; yyyymmdd.
Moreover, I have another data set with a (average) weekly price of the underlying commodity. The date variables in this dataset are only year and a week number.
I
2004 Jul 08
1
parallel mle/optim and instability
I have a MLE task that for a small number of parameters finishes in a
reasonable amount of time, but for my "real" case (with 17 parameters
to be estimated) either takes far too long (over a day), or fails with
"computationally singular" errors. So a) are there any parallel
implementations of optim() (in R or otherwise) and b) how can I make my
function more robust?
2012 May 21
1
Changing selected elements of an array
Hi!
I have a matrix defined on geographical positions (through) row and column
names. I need to change a number of elements in this matrix using the
information of a data.frame containing geographical positions and a number of
variables.
Changing the value of one specific element is easy, but changing on a number
of selected positions seems more difficult. When I use the geographical
2013 Mar 28
2
ggplot2: less than equal sign
Hi
I am trying to add a less than equal sign to a plot. I have previously done
this using unicode but is not working in this instance. Any suggestions
would be great
thanks
example code:
library(ggplot2)
df<-data.frame(vis=c(0,0,1,1) , count=c(10,15,20,10) , grp=c(0,1,0,1))
df$grp <-factor(df$grp ,levels=c(0,1) , labels =c("x \u2265 10" , "x > 10"))
ggplot(df,
2010 Jun 09
4
creating a new variable, conditional on the value of an existing variable, selected conditionally
Dear all,
I have a data frame f, with four variables:
f <- data.frame(A=c(0,0,1,1), B=c(0,1,0,1), C=c(1,1,0,1), D=c(3,1,2,3))
f
A B C D
1 0 0 1 3
2 0 1 1 1
3 1 0 0 2
4 1 1 1 3
I want to create a new variable (f$E), such that each of its elements is drawn from either f$A, f$B, or f$C, according to the value (for each row) of f$D (values of which range from 1 to 3).
In the first row, D is
2010 Aug 02
10
Number of hard links limit
Hi,
There''s been discussion before on this list on the very small number
of hard links supported by btrfs.[1][2] In those threads, an often
asked question has been if there''s a real world use case the limit
breaks. Also it has been pointed out that a fix for this would need a
disk format change.
As discussed in bug #15762 [3], there are certainly real-world use
cases this
2009 Feb 06
1
Linear model: contrasts
Hey,
I am modelling a linear regression Y=X*B+E. To compute the effect of ?group? the B-values of the regressors/columns that code the interaction effects (col. 5-8 and col. 11-14, see below) have to be weighted with non-zero elements within the contrast "Group 1" minus "Group 2" (see below). My first understanding was that the interaction effects add up to zero in each group.
2010 Jan 31
2
Reshaping matrix of vectors as dataframe
Dear R people,
I have to deal with the output of a function which comes as a matrix of
vectors.
You can reproduce the structure as given below:
x <- list(c(1,2,4),c(1,3,5),c(0,1,0),
c(1,3,6,5),c(3,4,4,4),c(0,1,0,1),
c(3,7),c(1,2),c(0,1))
data <- matrix(x,byrow=TRUE,nrow=3)
colnames(data) <- c("First", "Length", "Value")
rownames(data)
2003 Aug 21
2
levelplot behaviour for panel with constants
In the example:
x = rep(c(0,0,1,1),4)
y = rep(c(0,1,0,1),4)
z = c(1,0,1,0,0,0,1,1,0,1,0,0,1,1,1,1)
f = as.factor(c(rep("a",4),rep("b",4),rep("c",4),rep("d",4)))
levelplot(z~x+y|f,data.frame(x=x,y=y,z=z,f=f))
I noted that the last ("d") plot remains empty. I guess the
reason for this is that the values are constant (1), but I consider
it more
2017 Apr 26
2
2 patches related to silk_biquad_alt() optimization
On Tue, Apr 25, 2017 at 10:31 PM, Jean-Marc Valin <jmvalin at jmvalin.ca>
wrote:
>
> > A_Q28 is split to 2 14-bit (or 16-bit, whatever) integers, to make the
> > multiplication operation within 32-bits. NEON can do 32-bit x 32-bit =
> > 64-bit using 'int64x2_t vmull_s32(int32x2_t a, int32x2_t b)', and it
> > could possibly be faster and less
2006 Jan 24
1
Basic graphics question
I have a toy example given here:
par(fig=c(0,1,0,0.05))
par(mar=c(0,0,0,0))
par(plt=c(0,1,0,1))
par(oma=c(0,0,0,0))
par(ann=F)
plot(c(0,1),c(0,1),type='n',xlab='',ylab='',main='')
rect(0,0,1,1,col='gray75')
What parameter am I missing to make the gray rectangle use the entire figure
region? I am trying to build a plot from
2017 May 15
2
2 patches related to silk_biquad_alt() optimization
Hi Linfeng,
Sorry for the delay -- I was actually trying to think of the best option
here. For now, my preference would be to keep things bit-exact, but
should there be more similar optimizations relying on 64-bit
multiplication results, then we could consider having a special option
to enable those (even in C).
Cheers,
Jean-Marc
On 08/05/17 12:12 PM, Linfeng Zhang wrote:
> Ping for
2008 Feb 11
5
local root exploit
I saw that there is a local root exploit in the wild.
http://blog.kagesenshi.org/2008/02/local-root-exploit-on-wild.html
And I see my centos box still has: 2.6.18-53.1.4.el5
yum says there are no updates... am I safe?
Valent.
2017 May 08
0
2 patches related to silk_biquad_alt() optimization
Ping for comments.
Thanks,
Linfeng
On Wed, Apr 26, 2017 at 2:15 PM, Linfeng Zhang <linfengz at google.com> wrote:
> On Tue, Apr 25, 2017 at 10:31 PM, Jean-Marc Valin <jmvalin at jmvalin.ca>
> wrote:
>
>>
>> > A_Q28 is split to 2 14-bit (or 16-bit, whatever) integers, to make the
>> > multiplication operation within 32-bits. NEON can do 32-bit x
2011 Mar 14
3
Standardized Pearson residuals
Is there any reason that rstandard.glm doesn't have a "pearson" option?
And if not, can it be added?
Background: I'm currently teaching an undergrad/grad-service course from
Agresti's "Introduction to Categorical Data Analysis (2nd edn)" and
deviance residuals are not used in the text. For now I'll just provide
the students with a simple function to use, but I
2017 May 17
0
2 patches related to silk_biquad_alt() optimization
Hi Jean-Marc,
Thanks!
Please find the 2 updated patches which only optimize stride 2 case and
keep the bit exactness. They have passed our internal tests as usual.
Thanks,
Linfeng
On Mon, May 15, 2017 at 9:36 AM, Jean-Marc Valin <jmvalin at jmvalin.ca> wrote:
> Hi Linfeng,
>
> Sorry for the delay -- I was actually trying to think of the best option
> here. For now, my
2017 Apr 25
2
2 patches related to silk_biquad_alt() optimization
On Mon, Apr 24, 2017 at 5:52 PM, Jean-Marc Valin <jmvalin at jmvalin.ca> wrote:
> On 24/04/17 08:03 PM, Linfeng Zhang wrote:
> > Tested on my chromebook, when stride (channel) == 1, the optimization
> > has no gain compared with C function.
>
> You mean that the Neon code is the same speed as the C code for
> stride==1? This is not terribly surprising for an IIRC
2008 Jun 18
2
ifelse and "&&" vs "&"
Hi,
I noticed whether some one could explain why "&" and "&&" behave differently in data frame transformations.
Consider the following :
a<-data.frame(r=c(0,0,2,3),g=c(0,2,0,2.1))
Then:
> transform(a,R=ifelse(r>0 && g> 0,log(r/g),NA))
r g R
1 0 0.0 NA
2 0 2.0 NA
3 2 0.0 NA
4 3 2.1 NA
but
> transform(a,R=ifelse(r>0 & g>
2008 Feb 14
1
write output in a custom format
Hi,
I need to create a text file in the following format,
> 1 100.0 0
> 0 0
> 1 1
> 0 0
> 1 1
> #
> 1 100.0 0
> 0 0
> 0 1
> 1 0
> 1 1
...
where # is part of the format and not a R comment.
Each block (delimited by #) consists of a first line with three
values, call it dose, and a list of (x,y) coordinates which are a
matrix or data.frame,
>
2006 Sep 18
1
Cochrans Q Test
Hi!
I would like to conduct a Cochran`s Q Test in R, but have not found any
suitable function.
My first idea was: J <- as.table(matrix(c(6,16,2,4),ncol=2, dimnames =
list("C" = c("Favorable","Unfavorable"),"Drug A Favorable"=c("B
Favorable","B Unfavorable"))))
L <- as.table(matrix(c(2,4,6,6),ncol=2, dimnames =