Radial Basis Surrogate

I am trying to execute the following program but facing the issue. Please help me to resolve this

Can you share code that reproduces the issue, not a screenshot?

1 Like

Hallo
Here is the code i have written
using Surrogates
using Plots
using LinearAlgebra
f(x)=log(x)+x^2
n=30
u=100
l=10
x=sample(n,u,l,SobolSample())
y=f.(x)
scatter(x,y,label=“scattered_points”,)
plot!(f,label=“True Functions”)
radial_surrogates=RadialBasis(x,y,l,u)
Error
MethodError: no method matching RadialBasis(::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Int64)
Closest candidates are:
RadialBasis(::Any, ::Any, ::Number, ::Number, ::Function, ::Int64) at C:\Users\Manisha Gowda.julia\packages\Surrogates\dfpEW\src\Radials.jl:25
RadialBasis(::F, ::Int64, ::X, ::Y, ::B, ::C) where {F, X, Y, B, C} at C:\Users\Manisha Gowda.julia\packages\Surrogates\dfpEW\src\Radials.jl:7
RadialBasis(::Any, ::Any, ::Any, ::Function, ::Int64) at C:\Users\Manisha Gowda.julia\packages\Surrogates\dfpEW\src\Radials.jl:40

Stacktrace:
[1] top-level scope at In[16]:1

Is this not the same issue as in Radial_surrogates Installations Error - #6 by nilshg? Please avoid duplicating discussions - you say you can’t run the example in the Surrogates documentation, and this is likely due to you using Julia 1.0.5 and possibly an outdated version of the Surrogates package.

No !!Here I am not duplicating the discussions. I am at the initial stage of learning Julia. I need expertise help in running my model.
Thanks for your reply

Can you please post the output of versioninfo() and using Pkg; Pkg.status("Surrogates")?

But you are getting essentially the exact same MethodError that you’re getting in the other thread, and the reason is likely the same - you are using Julia 1.0.5 according to your screenshot in the other thread, and the latest version of Surrogates (which the documentation from which you copied the code relates to), requires at least Julia version 1.5 to run.