Logistička funkcija

f[t_]:=A/(1+b Exp[-c t])

A=10;b=10;c=.6;
slf=Plot[f[t],{t,-3,20},PlotLabel->"Logisticka funkcija"];
sld=Plot[f'[t],{t,-3,20},PlotLabel->"Derivacija"];
sls=Plot[f'[t]/f[t],{t,0,10},PlotRange->{0,c},PlotLabel->"Stopa rasta"];
GraphicsGrid[{{slf,sld,sls}},ImageSize->500]
Print["I= ",{tI=Log[b/c],f[tI]} ]

Generalizirana logisticka funkcija

f[t_]:=A/(1+b Exp[-c  gam t])^(1/gam)

A=5;b=9;c=1.2;gam=.2;
slf=Plot[f[t],{t,-3,25},PlotLabel->"Gen. log. funkcija"];
sld=Plot[f'[t],{t,-3,25},PlotLabel->"Derivacija"];
sls=Plot[f'[t]/f[t],{t,0,25},PlotRange->{0,c},PlotLabel->"Stopa rasta"];
GraphicsGrid[{{slf,sld,sls}},ImageSize->500]
Print["I= ",{tI=Log[b/gam]/(c gam),f[tI]} ]

Gompertzova funkcija

f[t_]:=Exp[A-b Exp[-c t]]

A=2;b=7;c=.2;
slf=Plot[f[t],{t,-3,25},PlotLabel->"Gompertzova funkcija"];
sld=Plot[f'[t],{t,-3,25},PlotLabel->"Derivacija"];
sls=Plot[f'[t]/f[t],{t,0,25},PlotRange->{0,c},PlotLabel->"Stopa rasta"];
GraphicsGrid[{{slf,sld,sls}},ImageSize->500]
Print["I= ",{tI=Log[b]/c,f[tI]} ]

Određivanje točke infleksije

Clear[A,b,c,gam]
Solve[D[f[t],{t,2}]==0,t]//FullSimplify
f[Log[b]/c]

Određivanje tocaka : B, C

Clear[A,b,c,gam]
Solve[D[f[t],{t,3}]==0,t]

Logistička model funkcija

f[t_,A_,b_,c_]:=A/(1+b*Exp[-c*t])

A=50;b=.5;c=1;
slf=Plot[f[t,A,b,c],{t,-10,10},PlotRange->{0,A}];

SeedRandom[1]
pod=Table[{i,f[i,A,b,c]+RandomReal[NormalDistribution[0,1]]},{i,-5,5}];
slpod=ListPlot[pod];

LS regresija

FLS[A_,b_,c_]:=Sum[(f[pod[[i,1]],A,b,c]-pod[[i,2]])^2,{i,1,Length[pod]}]
{bLS,cLS}={bb,cc}/.NMinimize[FLS[A,bb,cc],{bb,cc}][[2]]

slfLS=Plot[f[t,A,bLS,cLS],{t,-10,10},PlotRange->{0,A}];

Show[{slpod,slf,slfLS}, ImageSize->200]

L1 regresija

F1[A_,b_,c_]:=Sum[Abs[f[pod[[i,1]],A,b,c]-pod[[i,2]]],{i,1,Length[pod]}]
{b1,c1}={bb,cc}/.NMinimize[F1[A,bb,cc],{bb,cc}][[2]]

slf1=Plot[f[t,A,b1,c1],{t,-10,10},PlotRange->{0,A}];

Show[{slpod,slf,slf1}, ImageSize->200]

L∞ regresija

Fb[A_,b_,c_]:=Max[Table[Abs[f[pod[[i,1]],A,b,c]-pod[[i,2]]],{i,1,Length[pod]}]]
{bbes,cbes}={bb,cc}/.NMinimize[Fb[A,bb,cc],{bb,cc}][[2]]

slfb=Plot[f[t,A,bbes,cbes],{t,-10,10},PlotRange->{0,A}];

Show[{slpod,slf,slfb}, ImageSize->300]

Karakteristične točke

tI={Log[b]/c,A/2};
tB=1/c*Log[b/(2+Sqrt[3])];
tC=1/c*Log[b/(2-Sqrt[3])];
TB={tB,f[tB,A,b,c]};
TC={tC,f[tC,A,b,c]};

sltoc=Graphics[{{Green,Point[tI]},{Red,Point[{TB,TC}]}}];

Show[{slf,sltoc}, ImageSize->200]

Generalizirana logistička model funkcija

f[t_,A_,b_,c_,gam_]:=A/(1+b*Exp[-c*gam*t])^(1/gam)

A=50;b=1;c=5;gam=.1;
slf=Plot[f[t,A,b,c,gam],{t,-10,10}];

Karakteristične točke

tI={Log[b/gam]/(c*gam),A/(1+gam)^(1/gam)};
tB=1/(c*gam)*Log[2b/(gam(gam+3)+gam*Sqrt[(gam+1)(gam+5)])];
tC=1/(c*gam)*Log[2b/(gam(gam+3)-gam*Sqrt[(gam+1)(gam+5)])];;
TB={tB,f[tB,A,b,c,gam]};
TC={tC,f[tC,A,b,c,gam]};

sltoc=Graphics[{{Green,Point[tI]},{Red,Point[{TB,TC}]}}];

Show[{slf,sltoc}, ImageSize->200]

Gompertzova model funkcija

f[t_,A_,b_,c_]:=Exp[A-b*Exp[-c*t]]

A=4;b=2;c=1;
slf=Plot [f[t,A,b,c],{t,-10,10}];

Karakteristične točke

tI={Log[b]/c,Exp[A-1]};
tB=1/c*Log[b*(3-Sqrt[5])/2];
tC=1/c*Log[b*(3+Sqrt[5])/2];
TB={tB,f[tB,A,b,c]};
TC={tC,f[tC,A,b,c]};
Print["Amplituda: ",Exp[A]//N]

sltoc=Graphics[{{Green,Point[tI]},{Red,Point[{TB,TC}]}}];

Show[{slf,sltoc}, ImageSize->200]