Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RBF interpolation with multiquadric method #19

Closed
mdsa3d opened this issue Jun 3, 2021 · 0 comments
Closed

RBF interpolation with multiquadric method #19

mdsa3d opened this issue Jun 3, 2021 · 0 comments

Comments

@mdsa3d
Copy link

mdsa3d commented Jun 3, 2021

I am trying to perform radial basis interpolation with multiquadric method. I have developed the below mentioned example to demonstrate my application of the project.

using ScatteredInterpolation

a = [1.0 1.0 13.41; 2.0 1.0 8.60; 3.0 1.0 5.76; 4.0 1.0 3.58; 5.0 1.0 4.69; 6.0 1.0 3.72; 7.0 1.0 6.32; 8.0 1.0 5.68]
x_train = a[:, 1]
y_train = a[:, 2]
z_train = a[:, 3]
samples = z_train
points = [x_train y_train]'
itp = ScatteredInterpolation.interpolate(Multiquadratic(), points, samples; returnRBFmatrix=true);

#testig the interpolated object
x_test = [1.0; 2.28; 2.28; 2.285; 3.57; 4.85; 6.14; 7.42; 8.71; 10.0]
y_test = [1.0; 1.0; 1.0; 1.0; 1.0; 1.0; 1.0; 1.0; 1.0; 1.0]

points_test = [x_test y_test]'
#predicting or evaluating values
interpolated = ScatteredInterpolation.evaluate(itp, points_test)
println(interpolated)

However, when I execute the script with returnRBFmatrix=true for interpolation application, it returns the following error:

LoadError: MethodError: no method matching evaluate(::Tuple{ScatteredInterpolation.RBFInterpolant{Vector{Float64}, LinearAlgebra.Adjoint{Float64, Matrix{Float64}}, Multiquadratic{Int64}, Euclidean}, Matrix{Float64}}, ::LinearAlgebra.Adjoint{Float64, Matrix{Float64}})
Closest candidates are:
  evaluate(::ScatteredInterpolation.RadialBasisInterpolant, ::AbstractMatrix{var"#s36"} where var"#s36"<:Real) at C:\Users\user\.julia\packages\ScatteredInterpolation\05YPn\src\rbf.jl:270
  evaluate(::ScatteredInterpolation.ShepardInterpolant, ::AbstractMatrix{var"#s36"} where var"#s36"<:Real) at C:\Users\user\.julia\packages\ScatteredInterpolation\05YPn\src\idw.jl:32
  evaluate(::ScatteredInterpolation.NearestNeighborInterpolant, ::AbstractMatrix{var"#s36"} where var"#s36"<:Real) at C:\Users\user\.julia\packages\ScatteredInterpolation\05YPn\src\nearestNeighbor.jl:35

To resolve this, I tried passing the rbfMatrix as a stand alone value but that too returned a not defined constructor error:

ERROR: LoadError: MethodError: no constructors have been defined for ScatteredInterpolation.RadialBasisInterpolant

May I know how can this be resolved? Thanks!!

@mdsa3d mdsa3d closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant