[R] exponential correlation?
TRAMIER Blaise
meles at free.fr
Mon Sep 27 20:06:52 CEST 2004
On Sat, Sep 25, 2004 at 01:21:34PM -0700, Spencer Graves wrote:
> The "nlme" package has "corExp" for estimating the nuggett effect
> n and the range d for an exponential spatial correlation structure = n +
> (1-n)*exp(-r/d), where r = distance between two observations. See
> library(nlme); ?corExp, plus Pinheiro and Bates (2000) Mixed-Effects
> Models for S and S-Plus (Springer).
> Is this what you want?
>
Thanks, for your answer.
I'm afraid I was'nt very clear on what I needed.
In fact, I have a set of paired quantitatve values. When I plot them,
it looks like if the values where following a 1/exp(x) equation.
I would like to make a regression on this dataset to find the equation and
eventually find the x-value where the slope becomes more tough (I'm not
sure it's the appropriate word, I hope you'll understand anyway). In
fact I need to find the cutoff value.
I'm not sure of what method to use to achieve that.
Here is a subset of the dataset (Y are RR):
X Y
82.0 1.00
72.0 2.45
53.0 3.88
45.0 8.76
71.0 1.00
60.0 2.00
40.0 4.76
20.0 12.05
8.0 11.62
87.0 1.00
78.0 1.03
65.0 1.21
41.0 2.78
75.0 1.00
67.5 1.53
45.0 1.81
30.0 3.76
75.0 1.00
62.0 1.90
42.0 4.10
17.0 5.40
86.0 1.00
so far I tried to do a non linear regression (nls):
> fm1<-nls(rrm ~ a/(exp(clr*c)),start=list(a=1,c=0.033),trace=T)
437.4397 : 1.000 0.033
120.0999 : 7.78174860 0.01381373
70.89977 : 13.15418549 0.03034625
67.18951 : 14.63044976 0.03070568
67.18892 : 14.62649511 0.03066069
67.18892 : 14.6270777 0.0306623
>summary(fm1)
Formula: rrm ~ a/(exp(clr * c))
Parameters:
Estimate Std. Error t value Pr(>|t|)
a 14.627078 2.217950 6.595 2.01e-06 ***
c 0.030662 0.004876 6.288 3.87e-06 ***
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Residual standard error: 1.833 on 20 degrees of freedom
Correlation of Parameter Estimates:
a
c 0.8091
But I'm not sure I'm going the right way. If somebody could give me an
advice on the way to proceed, it would be great.
To find the cutoff value for x, should try to use the equation
obtained by the regression or should I use the residuals between
original data and the fitted values?
Best Regards
Blaise
PS: I hope I've been more explicit this time and that my english is
readable.
More information about the R-help
mailing list