Displaying 20 results from an estimated 8000 matches similar to: "Rolling window linear regression"
2009 Jul 07
1
Error in Rolling window of function - rollapply
Dear Colleagues,
I have faced with the problem that function rollaply with rolling window for
calculation of volatility doesn't give the all results of calculations.
I have run the rolling window for calculation in Excel and obtained that the
number of outputs for Excel is 36 and for R is 18. The total number of
observations is 37. In the attachment you can find pdf of the Excel and
Excel
2010 Feb 07
2
predicting with stl() decomposition
Hi mailinglist members,
I’m actually working on a time series prediction and my current approach is
to decompose the series first into a trend, a seasonal component and a
remainder. Therefore I’m using the stl() function. But I’m wondering how to
get the single components in order to predict the particular fitted series’.
This code snippet illustrates my problem:
series <-
2017 Aug 10
2
Zoo rolling window with increasing window size
Hi again,
I am wondering there is any function for 'zoo' time series, where I
can apply a user defined function rolling window basis, wherein window
size is ever increasing i.e. not fixed. For example, let say I have
below user defined function and a zoo time series :
> library(zoo)
> UDF = function(x) sum(x)
> TS = zoo(rnorm(10), seq(as.Date('2017-01-01'),
2011 Mar 04
2
apply.rolling() to a multi column timeSeries
Hello there,
I am trying to compute the 3 months return momentum with the timeSeries x.ts,
which is just a subset of simple returns from a much bigger series,
> class(x.ts)
[1] "timeSeries"
attr(,"package")
[1] "timeSeries"
> dim(x.ts)
[1] 20 3
> x.ts[1:8,]
GMT
MS.US AAPL.US CA.FP
1996-01-31 0.15159065 -0.133391894
2009 Nov 27
2
How to compute Rolling analysis of Standard Deviation using ZOO package?
Hello:
I want to get a rolling estimation of the stdev of my data.
Searching the document, I found the function "rollapply" in the zoo package.
For example, my series is "c", and i want get a period of 10 days,
so i write the command below:
roll.sd = rollapply( c, 10, sd, na.pad = TRUE, align = 'right' )
but there is an error in it ,and the computing cannot be
2017 Aug 10
3
Zoo rolling window with increasing window size
Hi Joshua, thanks for your prompt reply. However as I said, sum()
function I used here just for demonstrating the problem, I have other
custom function to implement, not necessarily sum()
I am looking for a generic solution for above problem.
Any better idea? Thanks,
On Fri, Aug 11, 2017 at 12:04 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
> Use a `width` of integer index
2010 Jan 17
1
Confusion in 'quantile' and getting rolling estimation of sample quantiles
Guys:
1).When I using the 'quantile' function, I get really confused. Here is what
I met:
> x<-zoo(rnorm(500,0,1))
> quantile(x,0.8)
400
1.060258
> c=rnorm(500,0,1)
> quantile(c,0.8)
80%
0.9986075
why do the results display different? Is that because of the different type
of the class?
2).And I want to use the 'rollapply' function to compute a
2017 Aug 10
0
Zoo rolling window with increasing window size
Use a `width` of integer index locations. And you likely want =
"right" (or rollapplyr(), as I used).
R> set.seed(21)
R> x <- rnorm(10)
R> rs <- rollapplyr(x, seq_along(x), sum)
R> cs <- cumsum(x)
R> identical(rs, cs)
[1] TRUE
On Thu, Aug 10, 2017 at 1:28 PM, Christofer Bogaso
<bogaso.christofer at gmail.com> wrote:
> Hi again,
>
> I am
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling
sums". (I have seen the Rmetrics package and the rollMean function and I
would like to do the same thing except Sum instead of Mean.) I imagine
someone has done this, I just can't find it anywhere.
Example:
x <- somevector #where x is 'n' entries long
#what I would like to do is:
x1
2017 Aug 10
0
Zoo rolling window with increasing window size
Replace "sum" with your custom function's name. I don't see any
reason why that wouldn't work, and the problem with my solution is not
clear in your response.
r <- rollapplyr(x, seq_along(x), yourCustomFunctionGoesHere)
On Thu, Aug 10, 2017 at 1:39 PM, Christofer Bogaso
<bogaso.christofer at gmail.com> wrote:
> Hi Joshua, thanks for your prompt reply. However
2011 Oct 10
1
how to calculate the statistics of a yearly window with a rolling step as 1 day?
Hope someone can help me here.
I have a daily time series, say
2003-02-01 2003-02-03 2003-02-07 2003-02-09 2003-02-14 .......... 2004-02-01
2004-02-04
0.4914798 -1.1857653 -1.6982844 -0.3559572 -0.2333087 ...........
0.44553 -0.45222
I need to calculate the statistics for the overlapping rolling yearly window
with rolling step as 1 day
so for each of the intervals: (2003-02-01 ~
2012 May 25
1
Rolling Sample VAR
hi guys,
I am using trivariate VAR model to get 10 step ahead orthogonalized impulse
response functions. I want to use rolling sample analysis on the
coefficients of the irf but I have no idea how to do that. I looked through
the forums but I can't seem to find any solutions.
Any suggestions would be helpful.
B
--
View this message in context:
2010 Aug 21
1
lattice::xyplot() with one factor for points and another for lines
Hi:
In lattice, how does one handle separate graphical behavior for two
different factors? In the xyplot below, the objective is to use the levels
of one factor to distinguish corresponding shapes and colors, and the levels
of the other factor to perform level-wise loess smooths.
# Illustrative data:
d <- data.frame(time = rep(1:8, each = 6), val = rnorm(48),
gp1 =
2007 Nov 30
1
Rolling Correlations
Hi R,
I want to do some rolling correlations. But before, I searched for
"?rollingCorrelation" and tried the example in it. But I was not
successful. What could be the problem? Here is the code I tried:
> library(zoo)
> library(PerformanceAnalytics)
> rollingCorrelation(manager.ts@Data[,1],edhec.ts@Data,n=12)
Error in inherits(object, "zoo") : object
2011 Oct 03
2
rolling regression
Dear all,
I have spent the last few days on a seemingly simple and previously documented rolling regression.
I have a 60 year data set organized in a ts matrix.
The matrix has 5 columns; cash_ret, epy1, ism1, spread1, unemp1
I have been able to come up with the following based on previous help threads. It seems to work fine.
The trouble is I get regression coefficients but need the immediate
2008 Jul 29
1
rolling regression between adjacent columns
Hi everyone,
I am trying to apply linear regression to adjacent columns in a matrix (i.e.
col1~col2; col3~col4; etc.). The columns in my matrix come with identifiers
at the top of each column, but when I try to use these identifiers to
reference the columns in the regression function using rollapply(), the
columns are not recognised and the regression breaks down. Is there a more
robust way to
2012 Mar 13
1
Rolling regressions with sample extended one period at a time
Hi,
I would like suggestions as to how to perform rolling regressions with the
window extended one period at a time. That is, an initial sample period is
passed to estimation and that very sample is then extended one period at a
time through the remaining sample. Is there a specific package?
Thnks.
P.
--
View this message in context:
2010 May 06
1
question about rolling regressions
Hi All,
I am using R 2.11.0 on a Ubuntu machine. I have a time series data set and
want to run rolling regressions with it. Any suggestions would be useful.
Here are the details:
(1) I convert relevant variables into time series objects and compute first
differences:
vad <- ts(data$ALLGVA/data$GDPDEF, start=1948, frequency=1)
emp <- ts(data$ALLEMP, start=1948, frequency=1)
vad.dif1 <-
2010 Apr 16
2
efficient rolling rank
Could someone give me an idea on how to do rolling ranking, i.e. rank in the
moving window of last 100 numbers in a long vector? I tried naive solution
like
roll.rank<-function(v, len){
r<-numeric(length(v)-len+1)
for(i in len:length(v))
r[i-len+1]<-rank(v[(i-len+1):i])[len]
r
}
However, it turns out pretty slow even on my rather able Linux box. For
2009 Feb 26
3
Moving Average
I am looking for some help at removing low-frequency components from a signal, through Moving Average on a sliding window.
I understand thiis is a smoothing procedure that I never done in my life before .. sigh.
I searched R archives and found "rollmean", "MovingAverages {TTR}", "SymmetricMA".
None of the above mantioned functions seems to accept the smoothing