estimating the parameter of an equation

4 ビュー (過去 30 日間)
ektor
ektor 2019 年 5 月 24 日
コメント済み: John D'Errico 2019 年 5 月 25 日
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

採用された回答

John D'Errico
John D'Errico 2019 年 5 月 24 日
編集済み: John D'Errico 2019 年 5 月 24 日
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 件のコメント
ektor
ektor 2019 年 5 月 24 日
any other approaches?
John D'Errico
John D'Errico 2019 年 5 月 25 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSmoothing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by