[R] negative correlation with corSymm in nlme or another way?
Seth
sjmyers at syr.edu
Sun May 5 20:12:38 CEST 2013
Hi,
I have a nonlinear model with residuals that are negatively autocorrelated
at short distances.
I can find no spatial correlation structures in nlme that can easily handle
negative autocorrelation as most have bounds on parameter values so that
correlation is from 0 to 1.
First, is there something I am missing?
I tried to roll my own by calculating a correlation matrix with some
negative values off the diagonal and then setting the correlation structure
as follows within the function gnls:
correlation=corSymm(corr9x[lower.tri(corr9x)])
where corr9x is the n x n matrix of correlations that I set up based upon
distances between points in the data set. Some of these correlations are
positive and some are negative. They are based on a Moran's I correlogram
that I calculated from the residuals returned from a gnls model fit with NO
spatial correlation employed.
I get the following error:
Initial values for corSymm do not define a positive-definite correlation
structure
I am unsure if the matrix is rejected out of hand because it contains
negative values or if there is something I can do to coerce it. I have
checked the lower triangle matrix returned and it matches what I intended.
Any input is appreciated.
Seth Myers
--
View this message in context: http://r.789695.n4.nabble.com/negative-correlation-with-corSymm-in-nlme-or-another-way-tp4666357.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list