フィルターのクリア

how to find the sum of a function with 2 variables

1 回表示 (過去 30 日間)
Trond Oesten
Trond Oesten 2015 年 4 月 25 日
編集済み: Sainath Varikuti 2015 年 4 月 28 日
Hi,
I'm trying to find the sum of the function likelihhod, after the values from smaller is inserted. Then I want to integrate the new function for the variables d1 and d2 with the limits given bellow. But when I try this approche it only crashes. Can anyone tell me how I can do this?? Thanks!
smaller = [1650,1660,1656,1649];
m = numel(smaller);
q = 1657;
likelihood = @(d1,d2) sum(log((d2./d1).*(smaller./d1).^(d2-1).*...
exp(-(smaller./d1).^d2)))+ log(exp(-(q/d1)^d2);
integration = integral2(@d1,d2)likelihood(d1,d2),1000,2000,30,230)

採用された回答

Sainath Varikuti
Sainath Varikuti 2015 年 4 月 28 日
編集済み: Sainath Varikuti 2015 年 4 月 28 日
I would break down the likelihood expression into smaller expressions in order to narrow down on the error. For example
a = @(d1,d2) (d2/d1)*(smaller./d1)
b = @(d1,d2) (d2-1)*exp(-(smaller./d1).^d2);
x = @(d1,d2) log(a(d1,d2).^b(d1,d2));
y = @(d1,d2) (exp(-(q/d1)^d2));
likelihood = @(d1,d2) sum(x(d1,d2))+y(d1,d2);
integration = integral2(likelihood,1000,2000,30,230);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by