K
K
Kovats2022-03-31 08:06:33
data mining
Kovats, 2022-03-31 08:06:33

How to find unknown parameters of a function, knowing its values?

Given: A specific function of the form f(x) = 54.8-k(x-7)^n, where n≥2, x is a natural number.
Required: find unknown parameters k,n such that the function values ​​will be as close as possible to the data:
f(x) X
0.4 1
0.9 2
4.4 3
22.5 4
39.4 5
51.6 6
54, 8 7
54.1 8
50.3 9
42.6 10
35.2 11
26.4 12
14.4 13
--
That is, in fact, given a function that is a time series, you need to restore the dependence on the available values ​​so that the error is minimum. The above is a specific example that does not need to be solved, I would like to understand what method can be used to complete the task?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2022-03-31
@hint000

f(x)=54.8-k(x-7)^n

Well, firstly, let's take x=8 and immediately get the value of k.
54.1=54.8-k(1)^n
k=0.7
Not very difficult, right?
f (x) = 54.8-0.7 (x-7) ^ n
now you can stupidly fill it in Excel (in x rows, different n in columns, given f (x) values ​​\u200b\u200bside by side) and see what happens, you can even build graphs.

W
Wataru, 2022-03-31
@wataru

Since you already have a hard-coded function type, this is the task of minimizing the error function (from n and k). It is common to minimize the sum of squared errors over all examples.
Analytically, as in the least squares method, equating the derivatives with respect to n and k to 0 does not seem to work very well. You will have to use some numerical method to minimize the function. For example, gradient descent or Newton's method. If the function looks like it has many local minima, then something trickier, like the annealing method, will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question