How to evaluate a function?

5 Ansichten (letzte 30 Tage)
Max
Max am 9 Feb. 2016
Bearbeitet: Stephen23 am 9 Feb. 2016
Hello,
I would like to find values for three parameters that satisfy the following equation: R>=value (e.g.2)
R is the likelihood-ratio: L/L_LK
This is my source-code:
1a = [3850,4340,4760];
2a = [3300,3720,4080];
3a = [2750,3100,3400];
beta_hat =13.502152;
B_hat = 1861.328876;
C_hat=39.624407;
syms B C beta positive
L=1;
for j=1:length(1a)
L=L*((beta/(C*exp(B/393)))*((data_test_1a(j)/(C*exp(B/393)))^(beta-1))*exp(-((data_test_1a(j)/(C*exp(B/393)))^beta))*(beta/(C*exp(B/408)))*((data_test_2a(j)/(C*exp(B/408)))^(beta-1))*exp(-((data_test_2a(j)/(C*exp(B/408)))^beta))*(beta/(C*exp(B/423)))*((data_test_3a(j)/(C*exp(B/423)))^(beta-1))*exp(-((data_test_3a(j)/(C*exp(B/423)))^beta)));
end
L_LK= double(subs(L,[B,C,beta],[1861.328876,39.624407,13.502152]));
R=L/L_LK;
One possibility to do that is to hold two parameters constant and vary the 3rd one and so on.
But I don´t really know how to realize it in matlab.
Does somebody have an idea? Thanks in advance for all solutions.

Antworten (1)

Explorer
Explorer am 9 Feb. 2016
1a = [3850,4340,4760]
It's a row vector and you can't name a row with "1a". Yes, you use a1.
So replace 1a with a1, 2a with a2 and 3a with a3.
  3 Kommentare
Explorer
Explorer am 9 Feb. 2016
Bearbeitet: Explorer am 9 Feb. 2016
You welcome. If I have answered your question, please accept my answer.
Max
Max am 9 Feb. 2016
Unfortunately, that´s not the answer.Sorry.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by