similar to: correlation structure in gls or lme/lmer with several observations per day

Displaying 20 results from an estimated 1000 matches similar to: "correlation structure in gls or lme/lmer with several observations per day"

2017 May 16
0
Wish for arima function: add a data argument and a formula-type for regressors
Hi, Using arima on data that are in a data frame, especially when adding xreg, would be much easier if the arima function contained 1) a "data=" argument 2) the possibility to include the covariate(s) in a formula style. Ideally the call could be something like > arima(symptome, order=c(1,0,0), xreg=~trait01*mesure0, data=anxiete) ( or arima(symptome~trait01*mesure0,
2006 May 15
1
what's wrong with my "gls"? it does not allocate memory... even for the simplest AR1 model...
> myfit1 <- gls(col1 ~ col2+col3+col4+col5+col6-1, data=data2, corr=corAR1( 0.3202), method='ML') Error: cannot allocate vector of size 199712 Kb if I get rid of the "corr=corAR1(0.3202)" option, it works okay... can anybody help me? thanks a lot! [[alternative HTML version deleted]]
2005 Apr 15
1
AR1 in gls function
Dear R-project users I would like to calculate a linear trend versus time taking into account a first order autoregressive process of a single time series (e.g. data$S80 in the following example) using th gls function. gls(S80 ~ tt,data=data,corAR1(value, form, fixed)) My question is what number to set in the position of value within corAR1? Should it be the acf at lag 1? I look forward for
2007 Jan 06
1
help with gls
Hello R-users, I am using gls function in R to fit a model with certain correlation structure. The medol as: fit.a<-gls(y~1,data=test.data,correlation=corAR1(form=~1|aa),method="ML") mu<-summary(fit.a)$coefficient With the toy data I made to test, the estimate of mu is exactly equal to the overall mean of y which can not be true. But, if I make a toy data with y more than two
2003 Oct 31
0
strange logLik results in gls (nlme)
I am trying to analyse a data with gls/lm using the following set of models prcn.0.lm <- lm( log10(Y)~(cond-1)+(cond-1):t ,prcn) prcn.1.gls <- gls( log10(Y)~(cond-1)+(cond-1):t ,prcn,cor=corAR1()) prcn.0.gls <- gls( log10(Y)~(cond-1)+(cond-1):t ,prcn) prcn.1m.gls <- gls( log10(Y)~(cond-1)+(cond-1):t ,prcn,cor=corAR1(),method="ML") I get the following AICs for these models:
2004 Sep 03
0
ML vs. REML with gls()
Hello listmembers, I've been thinking of using gls in the nlme package to test for serial correlation in my data set. I've simulated a sample data set and have found a large discrepancy in the results I get when using the default method REML vs. ML. The data set involves a response that is measured twice a day (once for each level of a treatment factor). In my simulated data set, I
2011 Dec 12
0
Confidence intervals of gls function?
Dear gls-experts, while reading and testing some examples of the book "introductionary time series analysis with R", I encountered the following fact which puzzles me. Confidence intervals for global temperature time series (P99) computed from general least squares (GLS) to fit the time series. I repeat the example from the book and get the same results: temp.gls=gls(temp ~
2003 Nov 21
0
gls with serial correlation
Hello there fellow R users, Im trying to fit a gls model to data which has serial correlation in the errors e(t)=p*e(t-1). However I dont seem to be having much luck in erradicating the autocorrelation in the residuals. I have created the following example. library(nlme) x<-rnorm(100) y<-3+2*x y<-y+arima.sim(100,model=list(ar=(0.6)))+rnorm(100,0,0.2) #Create a data set with first
2006 Jul 13
1
Extracting Phi from gls/lme
I am trying to extract into a scalar the value of Phi from the printed output of gls or lme using corAR1 correlation. ie I want the estimate of the autocorrelation. I can't see how to do this and haven't seen it anywhere in str(model.lme). I can get all the other information - fixed and random effects etc. Is there an obvious way so that I can save the brick wall some damage? TIA
2005 Nov 17
1
anova.gls from nlme on multiple arguments within a function fails
Dear All -- I am trying to use within a little table producing code an anova comparison of two gls fitted objects, contained in a list of such object, obtained using nlme function gls. The anova procedure fails to locate the second of the objects. The following code, borrowed from the help page of anova.gls, exemplifies: --------------- start example code --------------- library(nlme) ##
2002 Apr 14
0
gls
Dear all, I am confused. I have encountered some strange behaviour of gls > data(co2) > co2.y <- aggregate(co2,1,mean) > co2.y.data <- data.frame(co2=as.numeric(co2.y),year=seq(1959-1980,along=co2.y)) > co2.1.gls <- gls(co2~year+I(year^2), co2.y.data) > co2.2.gls <- update(CO2.1.gls, corr=corAR1()) > summary(CO2.2.gls) > plot(CO2.2.gls) plot shows standardized
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,
2005 Feb 02
0
Not reproducing GLS estimates
Dear List: I am having some trouble reproducing some GLS estimates using matrix operations that I am not having with other R procedures. Here are some sample data to see what I am doing along with all code: mu<-c(100,150,200,250) Sigma<-matrix(c(400,80,16,3.2,80,400,80,16,16,80,400,80,3.2,16,80,400),n c=4) sample.size<-100 temp <-
2010 Dec 26
0
GLS with corAR(1) correlation structure residual/standard error calculation
I am using the gls function to fit a two-stage least squares model with first order autoregressive error terms. Since there is no automated adjustment for the use of two-stage least squares in this package, I am trying to manually replicate standard errors of the coefficient estimates in order to adjust for a first stage OLS estimate of endogenous variables. However, thus far I have been unable to
2009 Feb 02
0
repeated measures with gls
I am using the gls function of the nlme package to analyze data sets of soil respiration which have the following design: 3 complete blocks x 5 sampling dates (time from fertilization) x 3 fertilization levels. The fertilization dates are equal for all subjects (blocks) but not periodical (-46, 10, 24, 53, 123 days from the event). The code that I've been using is: fit.csnC<- gls(dno.C
2005 May 31
0
prediction using gls with correlated residuals
Dear all, I am a beginner user of R and I tried to fit a gls model with explanatory variables and an AR(1) correlation component using the function "gls" with: correlation = corAR1 (form = ~ 1) It should mean that the residual follows an AR(1) process, isn't it? The problem is that, if I use the funcion "predict" I noticed that the predicted values are the same as if I
2007 Nov 29
0
fatal error from R function "gls"
I would appreciate some help with the followiing error ... what did I do wrong and what is the woraroud. > library(nlme) > glmod <- gls(A ~ T +cosP +cos2P +cos4P +cos5P +sin3P +sin5P +cosP2 +sinP3 +P2, correlation=corAR1(),method="ML") Error: cannot allocate vector of size 491.3 Mb I have a bunch of humans' breathing signals. The recording frequency was 30 samples per
2010 Jan 18
1
problem of data manipulation
Hello, See my problem below. a<-data.frame(c("s","c","c","n","n","n"),c(rep(1,3),rep(2,3)),c(rep(2,3),rep(1,3)),c("01/01/1999","10/02/2000","13/02/2000","11/02/2000","15/02/2000","23/02/2000"))
2004 Dec 29
3
gls model and matrix operations
Dear List: I am estimating a gls model and am having to make some rather unconventional modifications to handle a particular problem I have identified. My aim is to fit a GLS with an AR1 structure, obtain the variance-covariance matrix (V), modify it as needed given my research problem, and then reestimate the GLS by brute force using matrix operations. All seems to be working almost perfectly,
2017 Mar 21
0
Re: CPU Pinning Help