Displaying 20 results from an estimated 33 matches for "corexp".
2006 Jul 18
2
Using corStruct in nlme
I am having trouble fitting correlation structures within nlme. I would like to
fit corCAR1, corGaus and corExp correlation structures to my data. I either
get the error "step halving reduced below minimum in pnls step" or
alternatively R crashes.
My dataset is similar to the CO2 example in the nlme package. The one major
difference is that in my case the 'conc' steps are not the same...
2006 Jul 01
1
nlme: correlation structure in gls and zero distance
...he
Doubs department. Measurements have been taken on 470 plots in March
each year and georeferenced. Average density is supposed to be different
each year.
In a first approach, I would like to use a general model of this type,
taking spatial correlation into account:
gls(IKAfox~an,correlation=corExp(2071,form=~x+y,nugget=1.22),data=renliev)
but I get
>
gls(IKAfox~an,correlation=corExp(2071,form=~x+y,nugget=1.22),data=renliev)
Error in getCovariate.corSpatial(object, data = data) :
Cannot have zero distances in "corSpatial"
I understand that the 470 geographical coordi...
2010 Apr 14
1
creating a new corClass for lme()
Hi,
I have been using the function lme() of the package nlme to model grouped
data that is auto-correlated in time and in space (the data was collected on
different days via a moving monitor). I am aware that I can use the
correlation classes corCAR1 and corExp (among other options) to model the
temporal and spatial components of the auto-correlation. However, as far as
I can tell, I can only model using one correlation class or the other. I
would like my model to account for both temporal and spatial autocorrelation
simultaneously.
The ?corClasses help...
2009 Jul 25
1
how to avoid a for looping break after an error message
...I wrote a piece of code that generates simulated variables. after variable
generation I use them in several analyzes.
However, when I use a for to repeat the procedure 1000 times I get an erro
message in one of the "for" steps, precisely at this time:
gls.temp<- gls(y2 ~ x2,correlation=corExp(form=~coord2[,1]+coord2[,2])) #
coord 2 are spatial coordinates
and the error message is:
Error in gls(y2 ~ x2, correlation = corExp(form = ~coord2[, 1] + coord2[,
: false convergence (8)
I don´t know what causes this error. My problem is that this error stops all
the calculations during the for...
2009 Oct 21
1
odd evaluation within correlation argument of glmmPQL
...s(100,2),
f = factor(rep(letters[1:20],each=5)))
library(MASS)
## without correlation structure: fine
glmmPQL(z~1,random=~1|f,data=d,family="poisson")
## with correlation structure,
## but x and y not defined outside of 'd'
glmmPQL(z~1,random=~1|f,data=d,
correlation=corExp(form=~x+y),
family="poisson")
## Error in eval(expr, envir, enclos) : object 'x' not found
x = y = runif(10)
glmmPQL(z~1,random=~1|f,data=d,
correlation=corExp(form=~x+y),
family="poisson")
## Error in ...
## variable lengths differ (found for...
2012 Aug 29
1
spatial correlation in lme and huge correlation matrix (memory limit)
...ith range=200 and nugget.effet of 0.3) in a lme model of
this form: lme(ARBUS~YEAR, random=~1|IDSOUS).
The structure of the data is "IDSOUS" "XMIN" "YMAX" "YEAR" "ARBUS"
with 2 years of data and 5600 points for each year.
I do:
corstr<-corExp(value=200, form=~XMIN+YMAX|YEAR, nugget=0.3)
with |year to calculate correlation of IDSOUS(plot) only within the
same year since their positions did not change between the 2 years.
Then I try to initialize the corExp vector:
> corstr<-Initialize(corstr, data=cover)
Erreur : impossible d...
2009 Sep 01
1
understanding the output from gls
...'m
having trouble interpreting the results of gls. If any of you could offer
me some advice, I'd greatly appreciate it.
Short explanation of models: These two models have the same fixed-effects
structure (two independent, linear effects), and differ only in that the
second model includes a corExp structure for spatial autocorrelation. (more
detailed explanation of the models at end).
Specific questions:
1. The second model estimates two additional parameters in the process of
fitting the corSpatial object - the range and nugget of the spatial
autocorrelation. Based on this, I would expect...
2008 Sep 27
1
seg.fault from nlme::gnls() {was "[R-sig-ME] GNLS Crash"}
...ange tree data set. However, R crashes frequently
VW> when using the gnls() function. With the following
VW> simple example, I was able to reproduce the problem.
VW> gnls.exp <- gnls(circumference ~ Asym/(1 + exp(-(age-xmid)/scal)) ,
VW> data = Orange, correlation = corExp(form = ~1 | Tree),
VW> start = c(Asym=150, xmid=750, scal=300))
Yes, I can reproduce it (on a Linux (RHEL 5) 64bit server), using
R 2.8.0 alpha : Use this
for(i in 1:20)# for MM: ca. 8 to 10 times --> seg.fault
try(
gnls.exp <- gnls(circumference ~ Asym/(1 + exp(-(age-xmid)/scal)) ,...
2012 May 02
3
Consulta gráfica
Hola,
Por favor, ¿podríais indicarme qué recursos (librerías o ideas) pueden resultar de utilidad para crear un gráfico del estilo del de la figura 3.8 del siguiente link?
http://www.tsc.uvigo.es/BIO/Bioing/ChrLDoc3.html#3.5
Actualmente estoy utilizando funciones muy básicas y la verdad es que no me encuentro muy satisfecha con el resultado.
Muchas gracias.
Eva
[[alternative HTML
2005 Mar 22
2
LME correlation structures: user defined
...ME package. Specifically I like to see the code for the functions coef, corMatrix, and intialize for any of the pre-defined correlation structures, and use this as a template to define a new correlation structure. So how do I see e.g. the code for the method initialize for the correlation structure corExp or corARMA?
thank you in advance!
Michael Jerosch-Herold
PS: Oh, and if somebody could still send me example code for a user defined correlation structure I would much appreciate it, as my previous requests for help have not yielded any response.
2004 Sep 22
1
impenetrable warning
Dear R-help,
Can anyone explain the meaning of the warning,
Singular precision matrix in level -1, block 1
? Or how to track down where it comes from?
More precisely, using the nlme package, I'm issued with the warning
itt2 <- lme(lrna~rx.nrti+lbrna, random=~1|patid,
cor=corExp(form=~days|patid,nugget=T), weights=varPower(
form=~lbrna),data=rna3)
Warning messages:
1: Singular precision matrix in level -1, block 1
2: Singular precision matrix in level -1, block 1
the output is:
Linear mixed-effects model fit by REML
Data: rna3
Log-restricted-likelihood: -4990.142
F...
2004 Sep 24
1
exponential correlation?
Hello,
I have been asked to perform a exponential correlation on a data set.
Unfortunately, i did not find any simple example on how to do that with R.
If the correlation is significant, one asked me to also find the thresold
of the acceleration slope.
Have any of you a little example or a good link to get me started?
Best regards
Blaise
--
Mutt, c'est de la balle, quand ??a marche :-)
2008 Jan 24
0
possible inconsistency in nlme logLik or me
Hello,
I am comparing 2 nonlinear models one with a correlation structure.
I used the gnls command in the nlme package to fit model 1 and then the update(mod1,corr=corExp(form=~lat+lon,nugget=T) to fit the same model but with a correlation structure. I am comparing models using AIC, but I am getting results that don't seem to match. I get matching results for the model with no correlation structure, but non corresponding results for the model with a correlatio...
2011 May 27
1
continuous time AR(1)
Dear R helpers,
I would like to model temporal trend of biological remains in sediment cores.
All samples are temporally auto-correlated and I would like to take this effect
into account.
Initially I thought that I could use AR(1) or ARIMA functions but these
functions only work with regular temporal intervals between samples.
Hence I would like to use a continuous time AR(1) that allow
2012 Aug 17
0
spatial auto-correlation structure in nlme
Dear R users,
I'm estimating a mixed effects model in which the spatial correlation is
controlled for by the "corGaus" structure. I'm wondering if there is a
document or paper that explains how the spatial correlation structure (such
as "corExp" or "corGaus") works.
Let me use the example and data posted on UCLA's R FAQ webpage to explain
my problems. The link for the webpage is:
http://www.ats.ucla.edu/stat/r/faq/spatial_regression.htm
install.packages("nlme")
library(nlme)
spdata <- read.table("ht...
2008 Mar 19
1
analyzing binomial data with spatially correlated errors
...ally correlated. Naively, I thought I could
found something similar to gls to analyze such data. After some reading, I
decided that lmer is probably to tool I need. The model I want to fit would
look like
lmer ( cbind(n.success,n.failure) ~ (x1 + x2 + ... + xn)^2 , family=binomial,
correlation=corExp(1,form=~longitude+latitude))
This doesn't work because lmer says it needs a random effect in the model.
And, apart from the spatial random effect that I want to capture by computing
the correlation matrix, I have no other random effect.
There must be something I do not understand here... I...
2011 Dec 16
1
Model design
...lots of these (13000) cells which are classfied into ~2000
AREA's and ~750 STATE'S
So my question is do AREA'S differ in the amount of grass they contain
i.e does AREA A contain significantly more grass than AREA B?
I have modelled this by
area_grass <- gls(grass~AREA, correlation=corExp(form=~x+y), data = grassland
I have set the contrasts to options(contrasts = c("contr.treatment",
"contr.poly")) as there are no control groups.
What i will get ( it is taking ages!)
is
AREA A: -0.12.... **
AREA B: 0.17....*
AREA C..
So can i then say AREA A has s...
2008 Oct 10
1
glmmPQL
...;
[13] "package:methods" "Autoloads" "package:base"
> m.1 <- glmmPQL(fixed=cbind(nb_pc_02,I(nb_expr_02-nb_pc_02))~(PSDC99
+I(log(RFUCQ202))+PCCHOM99+sd_RFUCQ202+PCFEMCHOM)^2+langue,
+ random= ~ 1 | bidon,
+ correlation = corExp(form = ~ Longitude
+Latitude),
+ family=quasibinomial,
+ na.action="na.exclude",
+ data=d.glmm)
iteration 1
Erreur dans model.frame.default(formula = ~Longitude + Latitude + bidon
les longueurs des variables diff?rent (trouv? pour ...
2009 Sep 22
1
odd (erroneous?) results from gls
...e you aware of this issue, in case it is an
error in gls (2) For my information, in case I have made an error, in the
hope that one of you folks might be able to correct me. Thanks in advance
for your time.
The issue is in 2 parts.
(A) I've used gls to fit a model with two fixed effects and a corExp
object. By my count, this fitting process estimates 5 parameters:
(Intercept), l10area, newx, range, and nugget. With 118 total df, there
should be 118 - 5 = 113 residual df. However, the output from summary.gls
reports 115 residual degrees of freedom. Is this an error in summary or
gls, or is ther...
2012 May 29
1
GLMMPQL spatial autocorrelation
...ted a join count test which suggests that there is some spatial
autocorrelation. Consequently I have used the following code:
library(MASS)
attach(Birds)
Birds$x <- Birds$LONGITUDE
Birds$y <- Birds$LATITUDE
M <- glmmPQL(PRESENCE~ HYDROVAR1 + HYDROVAR2, random= ~ 1|fAVGNTS,
correlation = corExp(form = ~ x + y), family = binomial(link = "logit"),
data = Birds)
The model seems to run fine. However, when I compare the results of this
model and the residual spread against the same model but without the
correlation function, there is absolutely no difference at all.
I am somewhat...