Skip to content

custom knots for thin plate spline fails #5

@brycefrank

Description

@brycefrank

Hello!

Thank you for the hard work on this package, it is incredibly exhaustive and useful.

One thing I am struggling with is fitting a thin plate spline with knots that are not at the sample locations. Here is an example that slightly modifies an example given in the manual:

library(fields)
data(ozone2)
y16<- ozone2$y[16,]
# there are some missing values -- remove them
good<- !is.na( y16)
y<- y16[good]
x<- ozone2$lon.lat[ good,]
#
# the knots can be arbitrary but just for fun find them with a space
# filling design. Here we select 50 from the full set of 147 points
#
xknots<- cover.design( x, 50, num.nn= 75)$design # select 50 knot points
Tps(x,y, knots=xknots)

I receive the error

Error in eigen(A + B, symmetric = TRUE) : 
  infinite or missing values in 'x'

I am able to fit a thin plate spline using knots not at the sample locations using some code I have written, but I would like to take advantage of this package to fit the lambda parameter. I have been using this publication for my own code so far:

Cicchitelli, Giuseppe, and Giorgio E. Montanari. "Model‐assisted estimation of a spatial population mean." International Statistical Review 80, no. 1 (2012): 111-126.

Any insight on why this error is showing up would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions