1. Home
  2. PTK3D procedure

PTK3D procedure

Performs kernel smoothing of space-time data (D.A. Murray, P.J. Diggle & B.S. Rowlingson).

Option

PRINT = string token Controls printed output (grid, monitoring); default grid

Parameters

Y = variates Vertical coordinates of the spatial point pattern
X = variates Horizontal coordinates of the spatial point pattern
TIMES = variates Times for each event
XGRID = variates The values of x to compute kernel function
YGRID = variates The values of y to compute kernel function
ZGRID = variates The values of z, or time dimension, to compute kernel function
HXY = scalars What quartic kernel width to use in the XY direction
HZ = scalars What quartic kernel width to use in the Z or time direction
GRID = pointers Pointer to matrices containing the kernel smoothed values

Description

This procedure performs kernel smoothing of 3 dimensional, or space-time data. The method implemented uses a quartic kernel function as in the PTKERNEL2D procedure.

The data required by the procedure are the coordinates of the events in the spatial pattern (specified using the parameters X and Y) and the times of the events (specified by TIMES). The XGRID, YGRID and ZGRID parameters specify the 3 dimensions or space-time domain over which to evaluate the kernel smoothing. The kernel width must be specified for the X and Y direction using the HXY parameter, and in the Z (time) direction using the parameter HZ. The procedure calculates kernel density estimates at a grid of points spanning the specified polygon.

The GRID parameter can be used to save the kernel density estimates as a pointer to matrices where each matrix has rows corresponding to values of the horizontal coordinate (x) arranged in ascending order, and the columns corresponding to values of the vertical coordinate (y) in ascending order. Each matrix in the pointer represents a different time-slice and are arranged in ascending order.

Printed output is controlled using the PRINT option. The settings available are monitoring (which prints details about the parameter settings for the kernel smoothing process) and grid (which prints the grids of kernel density estimates).

Option: PRINT.

Parameters: Y1, X1, TIMES, XGRID, YGRID, ZGRID, HXY, HZ, GRID.

Method

A procedure PTCHECKXY is called to check that X, Y and TIMES have identical restrictions. The procedure then calls PTPASS to call a Fortran program to calculate the kernel density estimates for the grid of points spanning the 3 dimensional array.

See also

Procedures: KERNELDENSITY, MSEKERNEL2D, PTKERNEL2D.

Commands for: Spatial statistics.

Example

CAPTION  'PTK3D example'; STYLE=meta
VARIATE [NVALUES=188] X
READ X
300 291 326 299 267 266 267 262 268 335 302 301 302 324 260 306 284 293 274
263 307 274 297 288 283 290 284 286 282 292 305 298 299 287 276 261 273 284
266 285 278 305 293 297 332 256 275 267 267 286 322 278 280 276 261 323 260
283 282 308 293 331 266 280 301 279 321 292 315 323 282 269 330 281 330 328
264 303 264 259 329 328 284 309 329 273 295 262 281 325 288 302 315 295 284
272 305 279 290 311 288 324 287 283 267 280 275 281 313 273 283 304 308 330
260 289 268 329 264 274 286 263 265 269 260 279 284 270 267 320 282 303 303
264 303 289 270 262 274 262 262 267 255 267 273 270 270 265 276 276 283 305
264 286 278 257 302 275 290 279 300 270 290 291 283 270 266 267 300 268 276
293 273 267 278 310 298 266 279 266 267 272 327 265 310 279 277 258 :
VARIATE [NVALUES=188] Y
READ Y
302 270 263 376 327 356 345 338 335 275 272 304 272 337 338 385 362 332 353
333 386 357 282 365 366 352 341 341 350 278 381 378 381 342 380 345 347 357
361 360 350 321 332 375 273 345 357 350 301 379 332 349 356 354 343 298 346
352 361 390 275 272 308 354 271 361 280 391 307 333 302 348 349 302 396 341
323 382 285 337 350 351 351 370 270 347 267 353 352 335 341 248 273 377 358
376 369 318 339 376 256 284 353 364 337 298 326 299 365 332 363 366 387 275
339 335 314 268 298 342 373 346 335 340 359 355 399 337 363 282 315 377 247
297 337 380 330 335 342 333 333 369 290 336 309 328 339 334 360 360 363 374
326 361 333 344 395 378 361 362 255 357 356 368 361 325 332 367 364 390 337
396 345 338 367 387 268 332 340 361 344 370 383 335 387 339 379 350 :
VARIATE [NVALUES=188] Times
READ Times
413  472  511  689  730  847  871  899  921 1134 1190 1214 1224 1322 1399
1480 1503 1549 1567 1607 1615 1657 1688 1695 1714 1811 1813 1910 1986 1996
2049 2053 2075 2081 2103 2204 2209 2215 2239 2272 2281 2349 2351 2373 2377
2388 2411 2412 2419 2424 2488 2510 2512 2533 2545 2588 2616 2617 2629 2658
2695 2715 2766 2772 2800 2888 2996 3027 3118 3153 3149 3149 3173 3237 3245
3266 3275 3286 3302 3308 3323 3342 3346 3422 3453 3453 3500 3530 3570 3576
3614 3636 3661 3693 3716 3773 3790 3806 3843 3848 3848 3851 3973 3976 3878
3963 3985 4079 4080 4107 4118 4133 4156 4194 4195 4207 4212 4213 4213 4216
4235 4258 4273 4277 4290 4336 4339 4352 4383 4385 4441 4492 4518 4554 4565
4610 4628 4637 4638 4700 4700 4701 4708 4750 4751 4764 4780 4806 4822 4848
4858 4861 4862 4888 4891 4914 4918 4932 4944 4948 4964 4975 5001 5002 5072
5135 5199 5353 5358 5361 5489 5495 5505 5530 5578 5583 5588 5599 5641 5643
5650 5661 5702 5728 5752 5753 5755 5775 :
VARIATE Xgrid;!(250,260...350)
VARIATE Ygrid;!(250,260...400)
VARIATE Zgrid;!(365,730...5800)
PTK3D   Y=Y; X=X; TIMES=Times; XGRID=Xgrid; YGRID=Ygrid; ZGRID=Zgrid;\
        HXY=30; HZ=200; GRID=Rgrid
DSHADE  [WINDOW=5; KEY=0; TITLE='1961'] Rgrid[1]; PEN=2
DSHADE  [WINDOW=6; SCREEN=keep; KEY=0; TITLE='1962'] Rgrid[2]; PEN=2
DSHADE  [WINDOW=7; SCREEN=keep; KEY=0; TITLE='1963'] Rgrid[3]; PEN=2
DSHADE  [WINDOW=8; SCREEN=keep; KEY=0; TITLE='1964'] Rgrid[4]; PEN=2
Updated on March 6, 2019

Was this article helpful?