Displaying 20 results from an estimated 110 matches similar to: "Error in Rolling window of function - rollapply"
2016 Feb 08
2
Memory Store/Load Optimization Issue (Emulating stack)
Hello,
I am trying to emulate the "stack" as like on x86 when using push/pop so
afterwards I can use LLVM's optimizer passes to simplify (reduce junk) the
code.
The LLVM IR code:
define { i32, i32, i32 } @test(i32 %foo, i32 %bar, i32 %sp) {
; push foo (On "stack")
%sp_1 = sub i32 %sp, 4
%sp_1_ptr = inttoptr i32 %sp_1 to i32*
store i32 %foo, i32* %sp_1_ptr, align
2016 Feb 10
4
Memory Store/Load Optimization Issue (Emulating stack)
Thank you for the hint.
I adjusted the code and it works:
The code after replacing inttoptr with getelementptr:
define { i32, i32, i8* } @test(i32 %foo, i32 %bar, i8* %sp) {
entry:
; push foo (On "stack")
%sp_1 = getelementptr i8, i8* %sp, i32 -4
%sp_1_ptr = bitcast i8* %sp_1 to i32*
store i32 %foo, i32* %sp_1_ptr, align 4
; push bar
%sp_2 = getelementptr i8, i8* %sp_1,
2016 Feb 10
2
Memory Store/Load Optimization Issue (Emulating stack)
Thanks for the answers. Although I am not sure if I've understood the docs
about how inttoptr/ptrtointr are different when compared to gep.
It says: "It’s invalid to take a GEP from one object, address into a
different separately allocated object, and dereference it.".
To go back to my intention why I am doing this, I would like to "emulate"
some x86 instructions with
2016 Feb 12
2
Memory Store/Load Optimization Issue (Emulating stack)
Hi again,
So I finally gave up on trying to get through the converting (x86' push pop
mov add) because it deals a lot with crazy pointer arithmetics and sonce
inttoptr and ptrtoint doesn't provide any alias analysis information.
Daniel, you said it doesn't make much sense to provide it but in my cases
it is actually very much needed, you didn't say it wasn't possible to
2016 Feb 07
5
Assigning constant value without alloca/load/store
Hello,
I am currently trying to translate some custom IR to LLVM-IR and came
across and issue.
The custom IR has several registers and I am basically try to SSAfy it so
it can be easily translated/converted to LLVM-IR.
The problem:
Since in my custom IR I can reassign every register I have to reassign
every new expression with a new llvm Value. But my IR has something like
this:
REG A = VAR C
2016 Feb 08
2
Assigning constant value without alloca/load/store
I want to keep the translation short and simple (My IR doesn't have control
flow so it's basically on basic block) that's why I don't want to rely on
alloca/load/store.
2016-02-08 6:08 GMT+01:00 George Burgess IV <george.burgess.iv at gmail.com>:
> Hi!
>
> I don't know what "the right way" to do this is, but is there any reason
> you're against
2009 Jun 19
1
function rollapply
Hi,
I faced with problem when start using function - rollapply(returns, 3 ,
mean)
Error in UseMethod("rollapply") :
No suitable Method for "rollaply"
How can I fix the problem? Thank you for help.
--
Best regards,
Andy Fetsun
[[alternative HTML version deleted]]
2008 Jul 31
1
rollapply() to portions of a matrix
Hi everyone,
I have a rollapply statement that applies a function, in steps, over a data
matrix as follows:
#Code start
testm<-rollapply(mat, 100, by=100, min, na.rm=F)
#Code end
This moves down matrix 'mat' and calculates the minimum value over a 100 row
range, every 100 rows (i.e. no overlaps). NAs are not removed.
I want to modify this statement somehow so that the rollapply()
2012 Oct 26
1
rollapply() by time, not entries (width)
Hi all-
Thank you for reading my post. Please bear in mind that I'm very much a
newbie with R! My question is this:
I'm trying to use rollapply() on an irregular time series so I can't simply
use the width parameter (I don't think). Rather than last 5 entries, I'd
like to rollapply on last 6 months (for example). What would be the proper
course of action for this?
Thanks!
2010 Apr 09
3
"fill in" values between rollapply
Hi,
Sorry ahead of time for not including data with this question.
Using rollapply to calculate mean values for 5 day blocks, I'd use this:
Roll5mean <- rollapply(data, 5, mean, by=5, align = c("left"))
My question is, can someone tell me how to fill in the days between each of
these means with the previously calculated mean? If this doesn't make
sense, I will clarify and
2011 Aug 12
2
rollapply.zoo() with na.rm=TRUE
Hi.
I'm comparing output from rollapply.zoo, as produced by two versions
of R and package zoo. I'm illustrating with an example from a R-help
posting 'Zoo - bug ???' dated 2010-07-13.
My question is not about the first version, or the questions raised in
that posting, because the behaviour is as documented. I'm puzzled as
to why na.rm no longer is passed to mean, i.e. why
2009 Mar 23
1
performance: zoo's rollapply() vs inline
zoo's rollapply() function appears to be extremely useful for plugging in a
function on-the-fly to run over a window. With inline, there is a lot more
coding and room for error, and the code is less portable because the user
has to have R compiling set up or it won't work.
However, rollapply() seems to be really slow. Several orders of magnitude
slower than inline, in fact. I don't
2010 Jan 13
1
Rollapply
Hi
I would like to understand how to extend the function (FUN) I am using in
rollapply below.
######################################
With the following simplified data, test1 yields parameters for a rolling
regression
data = data.frame(Xvar=c(70.67,70.54,69.87,69.51,70.69,72.66,72.65,73.36),
Yvar =c(78.01,77.07,77.35,76.72,77.49,78.70,77.78,79.58))
data.z = zoo(d)
test1 =
2012 Jul 10
1
Help with vectors and rollapply
Hello
I have a vector a =(-2,0,0,0,1,0,0,3,0,0,-4)
I want to replace all zeros into previous non-zero state. So for instance the above vector should be converted into:
a= (-2,-2,-2,-2,1,1,1,3,3,3,-4)
I tried many things and finally concluded that probably(?) rollapply may be the best way?
I tried
f= function(x){
ifelse(x==0,Lag(x),x)
}
And then, rollappy(a,1,f) and that
2007 Nov 30
1
rollapply on zoo object
Dear R users.
I have zoo object "size_june" containing market-capital values:
> dim(size_june) # market-cap data of 625 firms for 20 years
[1] 20 625
> class(size_june)
[1] "zoo"
> size_june # colnames = "size.firmcode"
size.34020 size.4710 size.11050 size.10660 size.9540 size.8060
size.16160 size.8080 size.9280
1988-06-30 NA
2012 Jan 24
1
problems with rollapply {zoo}
Here is a relatively simple script (with comments as to the logic
interspersed):
# Some of these libraries are probably not needed here, but leaving them in
place harms nothing:
library(tseries)
library(xts)
library(quantmod)
library(fGarch)
library(fTrading)
library(ggplot2)
# Set the working directory, where the data file is located, and read the
raw data
2012 Oct 16
2
sliding window analysis with rollapply
Dear List members
I want to do the sliding window analysis of some specific values. Here is my code:
require(zoo)
dat <- read.table("chr1.txt", header = TRUE, sep="\t")
dat2 <- cbind(dat[1,3]) #The first column is also important. It represents the position of the site on the chromosome.
TS <- zoo(c(dat2))
a <- rollapply(TS, width=1000000, by=200000, FUN=mean,
2011 Apr 03
1
zoo:rollapply by multiple grouping factors
# Hi there,
# I am trying to apply a function over a moving-window for a large
number of multivariate time-series that are grouped in a nested set of
factors. I have spent a few days searching for solutions with no luck,
so any suggestions are much appreciated.
# The data I have are for the abundance dynamics of multiple species
observed in multiple fixed plots at multiple sites. (I total I
2011 Jun 25
1
Moving average in a data table
Hi,
I'm trying to figure out common approach on calculating MA on a dataset
that contains column "time".
After digging around, I believe functions rollmean and rollaply should
be used.
However I don't quite understand the requirements for the underlying data.
Should it be zoo object type? Formatted in a special way?
As an example, I'm looking to get calculated
2013 Jun 27
3
using "rollapply" to calculate a moving sum or running sum?
#using "rollapply" to calculate a moving sum or running sum?
#I am tryign to use rollapply to calcualte a moving sum? #I tried
rollapply and get the error message
#"Error in seq.default(start.at, NROW(data), by = by) :
# wrong sign in 'by' argument"
#example:
mymatrix <- ( matrix(data=1:100, nrow=5, ncol=20) )
mymatrix_cumsum <- ( matrix(data=NA, nrow=5,