estimating the parameter of an equation

4 vues (au cours des 30 derniers jours)
ektor
ektor le 24 Mai 2019
Commenté : John D'Errico le 25 Mai 2019
Dear all,
I have this equation:
kk=randn(1000,1);
u=randn(999,1);
kk(2:end)=kk(1:end-1)+u*d;
and I want to estimate the scalar 'd' in the last equation. So, I try to do some minimization but I am not sure if this is the correct way to move on.
So I have something like this
f = @(x) sum( ( kk(2:end)-kk(1:end-1)-u*sqrt(x) ).^2 );
fun = @(x)f(x);
x=fminsearch(fun, 0.2);
I am looking not only for efficiency but also for speed in this calculation.
Thanks

Réponse acceptée

John D'Errico
John D'Errico le 24 Mai 2019
Modifié(e) : John D'Errico le 24 Mai 2019
Um, don't use fminsearch? In fact, I'm not sure why you would want to do it that way.
d = 17;
n = 10000;
kk=randn(n,1);
u=randn(n-1,1);
kk(2:end)=kk(1:end-1)+u*d;
Now, estimate d. For this simple problem, diff and std are about all you really need.
dhat = std(diff(kk))/sqrt(2)
dhat =
17.1535533234171
  3 commentaires
ektor
ektor le 24 Mai 2019
any other approaches?
John D'Errico
John D'Errico le 25 Mai 2019
u is included, in the sense that I used information ABOUT u.
u is a vector of samples from a Gaussian (Normally distributed) random variable. Such a random variable has population mean of zero, variance = 1.
When diff is applied to the vector, kk disappears. The result is n-1 samples of the difference of the random variables. The variance of those differences will be 2*d^2, although the samples will no longer be independent, but the lack of independence is irrelevant, since the variance is all that counts. Likewise, the standard deviation will be sqrt(2)*d.
So if you want to compute d, take the standard deviation of the difference, then divide by sqrt(2).
If you need a reference, then you probably need to take a basic course in statistics.
If you want a different approach than one that takes milliseconds to compute with no iterative estimation needed, then you need to explain why you are trying to compute this, and why that solution is not adequate for you.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by