Displaying 20 results from an estimated 2000 matches similar to: "Errors using nlme's gls with autocorrelation"
2012 May 25
1
Problem with Autocorrelation and GLS Regression
Hi,
I have a problem with a regression I try to run. I did an estimation of the
market model with daily data. You can see to output below:
/> summary(regression_resn)
Time series regression with "ts" data:
Start = -150, End = -26
Call:
dynlm(formula = ror_resn ~ ror_spi_resn)
Residuals:
Min 1Q Median 3Q Max
-0.0255690 -0.0030378 0.0002787
2012 Apr 19
2
Gls function in rms package
Dear R-help,
I don't understand why Gls gives me an error when trying to fit a
model with AR(2) errors, while gls (from nlme) does not. For example:
library(nlme)
library(rms)
set.seed(1)
d <- data.frame(x = rnorm(50), y = rnorm(50))
gls(y ~ x, data=d, correlation = corARMA(p=2)) #This works
Gls(y ~ x, data=d, correlation = corARMA(p=2)) # Gives error
# Error in
2005 Dec 09
1
R-help: gls with correlation=corARMA
Dear Madams/Sirs,
Hello. I am using the gls function to specify an arma correlation during
estimation in my model. The parameter values which I am sending the
corARMA function are from a previous fit using arima. I have had some
success with the method, however in other cases I get the following error
from gls: "All parameters must be less than 1 in absolute value". None
of
2011 Feb 22
1
Adjusting for autocorrelation in a panel model
I am working with panel data. I am using the plm package to do this.
I would like to do be able to adjust for autocorrelation, as one does with
glm models and correlation structures (eg corr=corARMA(q=4)) . In
particular, I want to employ MA(4) error structure.
Is there a way of doing this with the plm package?
(Note: I do not really want to use the pggls function for various
2006 Nov 06
1
question about function "gls" in library "nlme"
Hi:
The gls function I used in my code is the following
fm<-gls(y~x,correlation=corARMA(p=2) )
My question is how to extact the AR(2) parameters from "fm".
The object "fm" is the following. How can I extract the correlation parameters
Phi1 and Phi2 from "fm"? These two parametrs is not in the "coef" componenet of "fm".
Thanks a
2009 Jan 28
1
gls prediction using the correlation structure in nlme
How does one coerce predict.gls to incorporate the fitted correlation
structure from the gls object into predictions? In the example below
the AR(1) process with phi=0.545 is not used with predict.gls. Is
there another function that does this? I'm going to want to fit a few
dozen models varying in order from AR(1) to AR(3) and would like to
look at the fits with the correlation structure
2004 Mar 09
2
corARMA and ACF in nlme
Hi R-sters,
Just wondering what I might be doing wrong. I'm trying to fit a multiple
linear regression model, and being ever mindful about the possibilities of
autocorrelation in the errors (it's a time series), the errors appear to
follow an AR1 process (ar(ts(glsfit$residuals)) selected order 1). So,
when I go back and try to do the simultaneous regression and error fit with
gls,
2006 Dec 06
1
Questions about regression with time-series
Hi,
I am using 2 times series and I want to carry out a regression of Seri1
by Serie2 using structured (autocorrelated) errors.
(Equivalent to the autoreg function in SAS)
I found the function gls (package nlme) and I made:
gls_mens<-gls(mening_s_des~dataATB, correlation = corAR1())
My problem is that I don’t want a AR(1) structure but ARMA(n,p) but the
execution fails :
2006 Aug 09
1
Joint confidence intervals for GLS models?
Dear All,
I would like to be able to estimate confidence intervals for a linear
combination of coefficients for a GLS model. I am familiar with John
Foxton's helpful paper on Time Series Regression and Generalised Least
Squares (GLS) and have learnt a bit about the gls function.
I have downloaded the gmodels package so I can use the estimable
function. The estimable function is very
2003 Jul 21
0
correlated residuals in gls: Coefficient matrix not invertible
Dear Rers,
I have threes series, x, y, z and I want to fit a model z ~ x + y. First of
all, I fit a lm. I found the residuals are correlated, by looking at the
acf() and pacf(). Then I tried to fit a gls model allowing residuals to be
correlated (correlation = corARMA(p=5, q=1)):
y.na <- as.data.frame(y[complete.cases(y),])
y.gls <- gls(z ~ x + y, data = y.na, correlation=corARMA(p=5,
2003 Jul 08
1
Questions about corARMA
Hi,
I'm a new member here in the list. I am a graduate from University of Georgia. Recently in doing analysis using lme on a dataset, I found several questions:
1. How to express the equation when the correlation structure is very complicated. For exmaple, if the fixed is y(t)=0.03x1(t)+1.5x2(t)(I omitted "hat" and others). And the model with corARMA(p=2,q=3) is proper. What will be
2008 Oct 16
0
R package: autocorrelation in gamm
Dear users
I am fitting a Generalized Additive Mixed Models (gamm) model to
establish possible relationship between explanatory variables (water
temperature, dissolved oxygen and chlorophyll) and zooplankton data
collected in the inner and outer estuarine waters. I am using monthly
time-series which are auto-correlated.
In the case of the inner waters, I have applied satisfactoryly (by
2011 May 30
0
gls and phi1 >1 (phi larger than one)
Dear all,
I am stuck with a problem that might be trivial for most of you (and
therefore is a bit embarrassing for me...):
I want to calculate a generalized least squares regression using two
time series (Y depending on X) with an autoregressive correlation
structure of order two (the data along time are given below). I use
'gls' from package 'nlme':
Calib.gls <- gls(Y~X,
2009 Aug 24
1
lme, lmer, gls, and spatial autocorrelation
Hello folks,
I have some data where spatial autocorrelation seems to be a serious
problem, and I'm unclear on how to deal with it in R. I've tried to do my
homework - read through 'The R Book,' use the online help in R, search the
internet, etc. - and I still have some unanswered questions. I'd greatly
appreciate any help you could offer. The super-super short explanation is
2005 Aug 29
1
Different sings for correlations in OLS and TSA
Dear list,
I am trying to re-analyse something. I do have two time series, one
of which (ts.mar) might help explaining the other (ts.anr). In the
original analysis, no-one seems to have cared about the data being
time-series and they just did OLS. This yielded a strong positive
correlation.
I want to know if this correlation is still as strong when the
autocorrelations are taken into account.
2007 Jul 31
5
Plotting a smooth curve from predict
Probably a very simple query:
When I try to plot a curve from a fitted polynomial, it comes out rather
jagged, not smooth like fitted curves in other stats software. Is there
a way of getting a smooth curve in R?
What I'm doing at the moment (for the sake of example) is:
> x <- c(1,2,3,4,5,6,7,8,9,10)
> y <- c(10,9,8,7,6,6.5,7,8,9,10)
> b <- data.frame(cbind(x,y))
>
2011 Nov 22
0
Error in gls function in loop structure
Hi, r-users
I got a problem when I try to call a *gls* function in loop structure.
The gls function seems not able to recognize the parameters that I pass
into the loop function!
(But, if I use lm function, it works.)
The code looks like this:
=================================================
gls.lm <- function(Data, iv1, dv1)
{
gls.model <- gls(Data[ , dv1] ~ Data[ , iv1], correlation =
2009 Apr 23
0
How to construct confidence bands from a gls fit?
Dear R-list,
I would like to show the implications of estimating a linear trend to
time series,
which contain significant serial correlation.
I want to demonstrate this, comparing lm() and an gls() fits, using
the LakeHuron
data set, available in R.
Now in my particular case I would like to draw confidence bands on the plot and
show that there are differences. Unfortunately, I do not know how to
2005 Apr 14
1
lme, corARMA and large data sets
I am currently trying to get a "lme" analyses running to correct for the
non-independence of residuals (using e.g. corAR1, corARMA) for a larger data
set (>10000 obs) for an independent (lgeodisE) and dependent variable
(gendis). Previous attempts using SAS failed. In addition we were told by
SAS that our data set was too large to be handled by this procedure anyway
(!!).
SAS script
2006 Jan 05
1
Problem with nlme version 3.1-68
Dear All:
I updated my R program as well as associated packages yesterday. Currently
my R version is 2.2.1 running under WINXP SP-2.
When I tried to list (summary) an nlme object that I developed before, I got
the following error message:
[ Error in .C("ARMA_constCoef", as.integer(attr(object, "p")),
as.integer(attr(object, :
C entry point "ARMA_constCoef"