Reduce Interpolating data size for initial guess

Hello,

I hope someone can help me with this.
I have a 1x721 data vector with initial guesses, but i need to adjust it to just 200 nodes, is it possible to adjust the vector size by interpolating and reducing its size? I’m trying by using JuMP and Interpolations.jl, but other options are welcome.

I don’t really have an example code for this issue, sorry about that.

Thanks,
Patrick

Could you be more specific? For example are input data have equal distances between them? Does the 200 point set need to be on a regular (equidistant) grid ? Are the data points noisy ?

1 Like

Hello, the input data is not completely equidistant, it looks like this:

[0.        , 0.0649982 , 0.12999116, 0.19497346, 0.25993975,
       0.32488474, 0.38980326, 0.45469024, 0.51954077, 0.5843501 ,
       0.64911368, 0.71382716, 0.77848642, 0.84308759, 0.90762705,
       0.97210148, 1.03650782, 1.10084332, 1.16510554, 1.22929237,
       1.29340201, 1.35743299, 1.42138416, 1.48525474, 1.54904425,
       1.61275255, 1.67637415, 1.7399153 , 1.80337685, 1.86675999,
       1.93006621, 1.99329728, 2.05645528, 2.11954256, 2.18256174,.....,5.78805045, 5.85291268, 5.91780987, 5.98273707,
       6.04768917, 6.11266096, 6.17764711, 6.24264226, 0.02445568,
       0.08945255, 0.15444214,..]

and the 200 points set doesn’t need to be regular, in short terms i want to reduce the size of the vector by keeping the same numerical behavior (tendency).
The data is not noisy, in other arrays it’s almost constant. The data will be used to set up and Initial guess for an optimization problem.

If there’s a solution only for equidistant data points i think it’ll work
Hope its clearer now, sorry and thanks.

Still not sure what your array is, but why not just subsample it ?

myarray[sort(rand(1:size(myarray)[1],200))]