fitting a gamma model to a data set

7 ビュー (過去 30 日間)
Rowan Humphreys
Rowan Humphreys 2022 年 11 月 22 日
回答済み: Rohit Kulkarni 2023 年 8 月 28 日
Hello,
I have a horrible equation that I need to fit some data to. How may I go about doing this?
This is the function:
where the gamma presumably is this thing:
I have 32 data points evenly spaced from 1 to 32.
Any ideas on how to start would be really appreciated!
  1 件のコメント
Torsten
Torsten 2022 年 11 月 22 日
編集済み: Torsten 2022 年 11 月 22 日
Which parameters do you want to fit ? For which variable(s) in the equation do you have these 32 data ?

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

回答 (1 件)

Rohit Kulkarni
Rohit Kulkarni 2023 年 8 月 28 日
Hi,
In my understanding you want to model the above functions and then fit the a vector of values from 1 to 32 in these. You can use symbolic equation to model such expressions:
syms f(mu) N(D,mu)
f(mu) = ((6/3.67^4)) * ((3.67 + mu)^(mu + 4))/gamma(mu+4);
N(D,mu) = Nw * f(mu) * ((D/D_0)^mu) * exp(-(3.67 + mu) * (D/D_0));
MATLAB offers a built-in function called gamma that allows you to calculate the values of the gamma function.
From the equation provided, it can assumed that 'D' and 'mu' are variables and all others are constants.
Then create a vector v and substitute it for mu, also provide the values for 'D' variable.
v = 1:32;
ans = N(D,v);
Hope it helps!

カテゴリ

Help Center および File ExchangeFrequently-used Algorithms についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by