similar to: Error in gls function in loop structure

Displaying 20 results from an estimated 3000 matches similar to: "Error in gls function in loop structure"

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
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,
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
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,
2008 May 02
1
Errors using nlme's gls with autocorrelation
Hi, I am trying out a generalized least squares method of forecasting that corrects for autocorrelation. I downloaded daily stock data from Yahoo Finance, and am trying to predict Close (n=7903). I have learned to use date functions to extract indicator variables for Monday - Friday (and Friday is missing in the model to prevent it from becoming full rank). When I run the following code...
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
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 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
2020 Oct 05
1
Simultaneous Equation Model with Dichotomous Dependent Variables
Hello everyone! I am currently working with a time series panel data set measuring six dependent variables: 4 of which are binary and 2 of which are count data. I am interested in constructing a model to measure if the dependent variables influence one another. For example: DV1~ DV2 + IV1+IV2+ Controls and DV2~ DV1 + IV1+ IV2+ Controls (where IV stands for independent variable, not
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
2008 Jun 22
1
two newbie questions
# I've tried to make this easy to paste into R, though it's probably so simple you won't need to. # I have some data (there are many more variables, but this is a reasonable approximation of it) # here's a fabricated data frame that is similar in form to mine: my.df <- data.frame(replicate(10, round(rnorm(100, mean=3.5, sd=1)))) var.list <- c("dv1",
2005 Jul 07
1
multivariate regression using R
Does anyone know if there is a way to run multivariate linear regression in R? I tried using the lm function (e.g., lm(dv1, dv2~iv1+iv2+iv3), but got error messages. Is my syntax wrong, or do I need a particular package? Thanks, Jeff-- ________________________________________________________ Jeffrey J. Lusk, Ph.D. Postdoctoral Research Associate Department of Forestry &
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 :
2010 Oct 08
1
MANCOVA
Hi, I have been using R to do multiple analyses of variance with two covariates, but recently found that the results in SPSS were very different. I have check several books and web resources and I think that both methods are correct, but I am less familiar with R, so I was hoping someone could offer some suggestions. Oddly simple ANOVA is the same in SPSS and R. Including covariates improves the
2008 Feb 08
0
User specified correlation structure (e.g., 2-banded Toeplitz)
Dear All: I am trying to fit a special case of a 2-banded Toeplitz correlation structure. A 2-banded Toeplitz has ones on the diagonal, a correlation, RHO1, on the first off-diagonal, and a correlation, RHO2, on the second off-diagonal, with zeros on all subsequent off-diagonals. After reading relevant sections in Mixed-Effects Models in S and S-PLUS (Pinheiro & Bates, 2000) and searching
2008 Feb 08
0
User-specified correlation structure (e.g., 2-banded Toeplitz)
Dear All: I am trying to fit a special case of a 2-banded Toeplitz correlation structure. A 2-banded Toeplitz has ones on the diagonal, a correlation, RHO1, on the first off-diagonal, and a correlation, RHO2, on the second off-diagonal, with zeros on all subsequent off-diagonals. After reading relevant sections in Mixed-Effects Models in S and S-PLUS (Pinheiro & Bates, 2000) and searching
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,
2008 Feb 12
0
nlme & special case of corARMA?
Dear All: I am trying to fit a special case of a 2-banded Toeplitz correlation structure. A 2-banded Toeplitz has ones on the diagonal, a correlation, RHO1, on the first off-diagonal, and a correlation, RHO2, on the second off-diagonal, with zeros on all subsequent off-diagonals. After reading relevant sections in Mixed-Effects Models in S and S-PLUS (Pinheiro & Bates, 2000) and searching
2007 May 07
0
Analyzing "Stacked" Time Series
I have a question about pooling or "stacking" several time series ?samples? (sorry in advance for the long, possibly confusing, message). I'm sure I'm revealing far more ignorance than I'm aware of, but that's why I'm sending this... [Example at bottom] I have regional migration flows (?samples?) from, say, regions A to B, A to C, B to A, ?., C to B (Noted as