Hi Edzer,
Thank you very much for your mail. I found two records have identical location, but it is not my fault because I checked the original source data and it is erroneous.
Now I have another problem; R gives another error message:
Error: cannot allocate vector of size 95.4 Mb
My computer includes 32-bit Windows and 3,5 GB RAM. I am not sure if I install 64-bit Windows, then the problem is solved? Or maybe I should minimize the data. Do you have any idea about it?
Best wishes,
Pinar
-----Original Message-----
From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Edzer Pebesma
Sent: Wednesday, September 21, 2011 3:46 PM
To: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] about ST kriging
Hi Pinar,
it is not clear which variogram model you pass, or how your data are
laid out in space and time.
Possible causes for a non-positive definite covariance matrix include:
- a variogram model with (nearly) perfect correlation
- duplicate observations (observations having identical location AND time)
- an invalid variogram model
A small, reproducible example (data + script) would help identify the
problem.
Best regards,
--
Edzer
On 09/20/2011 11:15 AM, P?nar Aslantas Bostan wrote:
Dear all,
I am working about space-time kriging. Before I asked again about ST kriging
but now the problem is
different and I could not overcome it!
During kriging operation I got this error:
pred = krigeST(prec~1, w, STS(grid,time,index), v)
Error in chol.default(A$Sm, LINPACK = TRUE) :
non-positive definite matrix in 'chol'
I explained the data set below:
# prec is annual precipitation measured from 257 meteorological stations
# w is STSDF object
Object of class STSDF
[[Spatial:]]
Object of class SpatialPoints
Coordinates:
min max
Xnew 140556 1730472
Ynew 4309064 4971309
Is projected: NA
proj4string : [NA]
Number of points: 257
[[Temporal:]]
Index object at time
Min. :1970-01-01 12:00:00 Min. : 1.0
1st Qu.:1979-07-03 00:00:00 1st Qu.:10.5
Median :1989-01-01 12:00:00 Median :20.0
Mean :1989-01-01 02:46:09 Mean :20.0
3rd Qu.:1998-07-03 00:00:00 3rd Qu.:29.5
Max. :2008-01-01 12:00:00 Max. :39.0
[[Data attributes:]]
Min. 1st Qu. Median Mean 3rd Qu. Max.
114.5 413.7 533.6 633.0 735.6 3332.0
# I used grid to obtain predictions over it. It has 25 km spatial resolution
# time is temporal entity of study. It contains 39 annual observation.
# index is required for STSDF, and I used this code to create index.
index <- cbind(as.integer(as.factor(data$Station)),
as.integer(as.factor(data$Year)))
# v is space-time variogram
How can I solve the problem?
Thank you in advance!
Pinar Aslantas Bostan
Research Assistant
Department of Geodetic and
Geographic Information Technologies (GGIT) Middle East Technical University
06531 Ankara/TURKEY
aslantas at metu.edu.tr