Well, in a numerical technique test we were given the following problem:

A physical phenomenon is modeled such that,

$F(f,d) = A(f)/d^2 + L$;

Where, $F$ is a function of frequency $f$ and distance $d$, and $L$ is random error. Function $A(f)$ is unknown.

A function is given, to produce data set $(F,f,d)$. The function is:

function F = get_data(d,f)
    for i= 1:length(f)
        for j = 1:length(d)
            F(i,j) = 2*f(i)^2 / d(j)^2 + 0.3*rand()*(1-rand());

here d, f are arrays. F is a 2D array. rand is a function that gives some random numbers less than 1. It is assumed that, we cannot poke into this function for an answer. We can't just look at the function and say A(f) = 2*f^2. We have to find this or a very close approximation to this by some numerical method....

Now, for d = 1:1:10; f = 30:30:300;

we have to produce a data set for $F$. From, this data set, we have to calculate, (1) mean of $L$. (2) an expression for $A(f)$.

Now, what I understand is that, 2nd if we have $A(f)$ then we can produce the values of $L$, and can easily evaluate mean of $L$. And, for $A(f)$ we could assume $L$ to be too low that we can ignore......

But, how could I actually do it?

I'll be very happy if someone helped me.

  • 1
    $\begingroup$ If this is a homework or exam question for an active class, you should be very careful posting it here. You should be sure that you have your instructor's permission to ask for help like this. $\endgroup$
    – Bill Barth
    Jun 4, 2013 at 16:44
  • $\begingroup$ not hw. test question, and test is over. He said, he will not repeat questions in future courses, or we will not get any questions from previous years' question.... So, I think it's okay... And, we do not have any forums like the modern Universities do... So, these are the only place for me to ask questions.... $\endgroup$
    – ponir
    Jun 4, 2013 at 16:47
  • $\begingroup$ Will he not review the answer to the question now that the exam is over? Either way, it's an interesting question. Thanks for the followup. $\endgroup$
    – Bill Barth
    Jun 4, 2013 at 17:02
  • $\begingroup$ I don't know. Usually they don't... But, I think I'll ask him next time we meet. :\ $\endgroup$
    – ponir
    Jun 4, 2013 at 17:05
  • $\begingroup$ I think, he wants to find an answer that approximates the expression $A(f)$ very closely and does not want an exact/correct answer.... Well, that's only my hunch... $\endgroup$
    – ponir
    Jun 4, 2013 at 17:13

1 Answer 1


I am not giving the full answer here but as an idea you could think about your data as follows.

You have homoscedastic data, which is good. But a non-normal noise term. Now there a several techniques for defining a statistical model on these data. One could do a B-spline regression on the model or one could choose an appropriate basis on the domain of $f$ for an approximation on $A(f)\approx \hat{A}(f) = \sum_i c_i b_i(f)$, with basis functions $b_i(f)$.

Either way, your fit model needs to find some coefficients and reads: $F(f,d) = \hat{A}(f)/d^2 +L$ and $\hat{A}(f)$ is the respective approximation to $A(f)$. Once you have obtained the fit, the residuals represent $L$. A hypothesis test should reveal if $E(L)=0$ in your model, so you catch the features of $A(f)$.

Likely, the fit matrix will be ill-conditioned, so when performing the fit you need to apply some regularization technique, e.g. truncated svd.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.