# Question:Deep fit with Maple

## Question:Deep fit with Maple

Maple

We have the data
X := Vector([seq(.1*j, j = 0 .. 16), 1.65], datatype = float):
Y := Vector([2.61, 2.62, 2.62, 2.62, 2.63, 2.63, 2.74, 2.98, 3.66,
5.04, 7.52, 10.74, 12.62, 10.17, 5, 2.64, 11.5, 35.4], datatype = float):
and the model function of x with 5 parameters
F := a*cosh(b*x^c*sin(d*x^e)):
How to fit F to the data  up to the sum of the squared residuals being about 0.001?
Is such good fit possible with Maple at all? It is interesting that Mathcad (not MATLAB) produces this.
Here are my attempts with the DirectSearch v.2:
>sol1 := DirectSearch:-DataFit(F, X, Y, x, fitmethod = minimax, tolerances = 10^(-10));

Warning, complex or non-numeric value encountered; trying to find a feasible point
Warning, limiting number of function evaluations (10000) is reached; set initial point
equal to extremum point obtained, increase evaluationlimit option and continue search
[HFloat(5.23048993932328266), [a = HFloat(7.38941529751814040),

b = HFloat(0.690330114701544040), c = HFloat(3.28806528986702996),

d = HFloat(-0.000225124039803239990), e = HFloat(15.8206481655129992)], 10000]
> sol2 := DirectSearch:-DataFit(F, X, Y, x, fitmethod = lad, optimizer = globalsearch,
tolerances = 10^(-10), evaluationlimit = 30000, solutions = 1);

Warning, limiting number of function evaluations (30000) is reached;
increase evaluationlimit option and repeat search

[2.92695529634436, [a = 3.28480371217865, b = -.686854841550572, c = 2.36912149895351,
d = 5.59890949384448, e = 62.8762878369468],587]

﻿