search for: corarma

Displaying 20 results from an estimated 53 matches for "corarma".

2003 Jul 08
1
Questions about corARMA
...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 the complete equation? 2. Is is that any regression error will be stationary? (Forgive me for my poor math background. This may be a simple question to most people.) Since corARIMA is not available. 3. Why not make a function to automatically select the best corARMA...
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 `coef<-.corARMA`(`*tmp*`, value = value[parMap[, i]]) : # NA/NaN/Inf in foreign function call (arg 1) Gls(y ~ x, data=d, correlation = corARMA(p=1)) #This works I would rather use Gls than gls so that...
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 proc mixed data=raw method=reml maxiter=...
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 the parameters (individually) are greater than or equal to 1. Please co...
2007 Oct 10
2
corMatrix crashes with corARMA structure (PR#9952)
...3) I have seen this in other versions/platforms as well. Brian Ripley informs me the segfault is in corStruct.c Code to reproduce: n <- 100 # example from Box and Jenkins p. 83 arcoefs <- c(0.8) macoefs <- c(-0.6) p <- length(arcoefs) q <- length(macoefs) require(nlme) tmp <- corARMA(value=c(arcoefs,macoefs), form=~1, p=p, q=q) Sigma <- corMatrix(tmp, covariate = 1:n) # segfault
2004 Jul 30
1
lme: problems with corARMA
Trying following example from Pinheiro and Bates in order to fit an ARMA(1,1) model: library(nlme) fm1Ovary.lme<-lme(follicles~sin(2*pi*Time)+cos(*pi*Time),data=Ovary,random=p dDiag(~sin(2*pi*Time))) fm5Ovary.lme<-update(fm1Ovary.lme,corr=corARMA(p=1,q=1)) I get follwing error message: Error in "coef<-.corARMA"(`*tmp*`, value = c(62.3428455941166, 62.3428517930051 : Coefficient matrix not invertible Does somebody know why it doesn't work ? Stephan Moratti ----------------------------- Dipl. Psych. Stephan Mo...
2003 Jul 09
0
model selection in lme when corARMA is assumed
...alues. To pool the 5 subjects together, I use lme in R as try1 <- lme(y~x1+x2+x3,random=~1|sub,na.action= na.exclude). Is it proper to do so? (only intercept will be treated as random) If the initial model contain 8 variables with 3 of them insignificant. My first step would be to try various corARMA possibilities. There are several possible results: > 1. Maybe there is one corARMA model (with the lowest AIC of course) that makes all the eight variables significant. I'll happily stop at that! (but this is not the case for my data) > 2. There is one corARMA model with a much lower...
2008 Feb 12
0
nlme & special case of corARMA?
...z structure to the ``Orthodont'' example dataset provided in R-Help, we estimate RHO1 also (since the example matrix below contains INITIAL values). ---------------------Start R-code & output ------------------------------- #This intilizes a 2-banded Toeplitz structure cs1ARMA <- corARMA(value = c(0,-.3), form = ~ 1 | Subject, p = 2, q = 0) cs1ARMA <- Initialize(cs1ARMA, data = Orthodont) corMatrix(cs1ARMA)$M01 [,1] [,2] [,3] [,4] [1,] 1.0 0.0 -0.3 0.0 [2,] 0.0 1.0 0.0 -0.3 [3,] -0.3 0.0 1.0 0.0 [4,] 0.0 -0.3 0.0 1.0 > TOEP2 <- gls(distance ~ Sex * I(ag...
2005 Jun 10
1
Problems with corARMA
Dear all I am tryiing to fit the following lme with an ARMA correlation structure: test <- lme(fixed=fev1f~year, random=~1|id2, data=pheno2, correlation=corARMA(value=0.2, form=~year|id2), na.action=na.omit) But I get the following error message: Error in getGroupsFormula.default(correlation, asList = TRUE) : "Form" argument must be a formula I have used this same form argument with differerent correlation structures and it has worked...
2007 Oct 01
1
corMatrix crashes R 2.5.1 (windows XP) with corARMA structure
R-helpers, n <- 100 arcoefs <- c(0.8) macoefs <- c(-0.6) p <- length(arcoefs) q <- length(macoefs) require(nlme) tmp <- corARMA(value=c(arcoefs,macoefs), form=~1, p=p, q=q) Sigma <- corMatrix(tmp, covariate = 1:n) # results in segfault Have I used these commands in an improper way? Thanks Ben
2004 Mar 09
2
corARMA and ACF in nlme
...out there as to what I may be doing wrong? Is there an error in my code? Here's my R code for the simultaneous model fit (taking a phi estimate=0.6 from a previous step <ACF(glsfit)>): glsAR1fit<-gls(y~x1+x2+x3+x4, na.action = na.omit, subset=12:54, correlation = corARMA(0.6, p=1, q=0, fixed = FALSE)) Thanks much, Jeff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jeff Jorgensen Center for Limnology University of Wisconsin Madison ph (608) 263-2304 680 North Park Street fx (608) 265-2340 Madison, Wisconsin 53706...
2006 Jan 05
1
Problem with nlme version 3.1-68
...t 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" not in DLL for package "nlme" ] The nlme object was fitted with corr = corARMA(q=2) option. I refitted the model, and the same error message appeared. I then refitted the model with option corr = corARMA(p=1), then no problem; but for p = 2, or q = 1 or 2, then the error occurred. When I listed the same fitted nlme objects under R 2.1.1 with nlme 3.1-65, then no problem. I f...
2012 Feb 17
2
Error message in gamm. Problem with temporal correlation structure
HELLO ALL, I AM GETTING AN ERROR MESSAGE WHEN TRYING TO RUN A GAMM MODEL LIKE THE ONE BELOW. I AM USING R VERSION 2.14.1 (2011-12-22) AND MGCV 1.7-12. M1 <-gamm(DepVar ~ Treatment + s(Year, by =Treatment), random=list(Block=~1), na.action=na.omit, data = mydata, correlation = corARMA(form =~ Year|Treatment, p = 1, q = 0)) THIS IS THE ERROR MESSAGE Error in `*tmp*`[[k]] : attempt to select less than one element I have 312 observations. I get the error when I introduce the correlation structure in the model. I have the same problem even if I use /corAR1() /or I set bs=”cr”....
2007 Jul 31
5
Plotting a smooth curve from predict
...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)) > w <- gls(y ~ I(x)+I(x^2),correlation=corARMA(p=1),method="ML",data=b) > plot(predict(w),type="l") Many thanks, Andrew Wilson
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, q=1)) It gave this error message: Error in "coef<-.corARMA"(*tmp*, value = c(188.077895742055, 180.123242661068, : Coefficient matrix not invertible I...
2008 May 02
1
Errors using nlme's gls with autocorrelation
...ave 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... > library(nlme) > MyModel <- gls(Close ~ Monday + Tuesday + Wednesday + Thursday, correlation=corARMA(p=2), data=MyData, method="ML") ...I get the following error... Error in corFactor.corARMA(object) : Calloc could not allocate (62457409 of 8) memory ...Does anybody know what I'm doing wrong? I appreciate any help. Thanks. -- View this message in context: http://www.nabble.c...
2006 Dec 06
1
Questions about regression with time-series
...lent 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 : gls_mens<-gls(mening_s_des~dataATB, correlation = corARMA(p=52)) Error in "coef<-.corARMA"(`*tmp*`, value = c(11.2591629857661, 9.1821585359071, : Coefficient matrix not invertible This should be because most of the coefficients <52 are near to 0. I am looking for a way to be able : - To evaluate automatically my ARMA structure (if it...
2004 Apr 22
1
lme correlation structure error
...the book. fm2<-update(fm1,correlation=corAR1()) #### The parameters of fm2 are different to that in the book and plot(ACF(fm2)) ##### signifies that serial correlation still exists in the residuals. ###### When I try and run this (which runs fine in the book) fm5<-update(fm1,corr=corARMA(p=1,q=1)) #### I get the following error message #Error in "coef<-.corARMA"(*tmp*, value = c(62.3428455941166, 62.3428517930051 : # Coefficient matrix not invertible I have tried running the example on R for windows versions 1.7.1 and 1.8.1 with the same results. Can anyo...
2005 Jul 13
1
crossed random fx nlme lme4
I need to specify a model similar to this lme.formula(fixed = sqrt(lbPerAc) ~ y + season + y:season, data = cy, random = ~y | observer/set, correlation = corARMA(q = 6)) except that observer and set are actually crossed instead of nested. observer and set are factors y and lbPerAc are numeric If you know how to do it or have suggestions for reading I will be grateful. eal ps I have already read Pinheiro & Bates, the jan 05 newsletter, and seve...
2008 Feb 08
0
User-specified correlation structure (e.g., 2-banded Toeplitz)
...z structure to the ``Orthodont'' example dataset provided in R-Help, we estimate RHO1 also (since the example matrix below contains INITIAL values). ---------------------Start R-code & output ------------------------------- #This intilizes a 2-banded Toeplitz structure cs1ARMA <- corARMA(value = c(0,-.3), form = ~ 1 | Subject, p = 2, q = 0) cs1ARMA <- Initialize(cs1ARMA, data = Orthodont) corMatrix(cs1ARMA)$M01 [,1] [,2] [,3] [,4] [1,] 1.0 0.0 -0.3 0.0 [2,] 0.0 1.0 0.0 -0.3 [3,] -0.3 0.0 1.0 0.0 [4,] 0.0 -0.3 0.0 1.0 > TOEP2 <- gls(distance ~ Sex * I(a...