trigonemetric function fitting using matrice in matlab
이전 댓글 표시
hi
please explain me these line of codes from the matlab documentation:
Simulating Electricity Prices with Mean-Reversion and Jump-Diffusion
why do we have to put t in matrice function when we have f(t)= s1*sin(2.pi.t)+s2*cos(2.pi.t)+s3*sin(4.pi.t)+s4*cos(4.pi.t)+s5 ?
% Calibrate parameters for the seasonality model
seasonMatrix = @(t) [sin(2.*pi.*t) cos(2.*pi.*t) sin(4.*pi.*t) ...
cos(4.*pi.*t) t ones(size(t, 1), 1)];
C = seasonMatrix(PriceTimes);
seasonParam = C\logPrices;
댓글 수: 3
darova
2020년 4월 28일
Your equation is
f(t)= s1*sin(2.pi.t)+s2*cos(2.pi.t)+s3*sin(4.pi.t)+s4*cos(4.pi.t)+s5 ?
You have 5 uknowns s1 - s5
To calculate them you need 5 equations:

Where a1,b1,c1,d1,e1 == [cos(2.*pi.*t) sin(4.*pi.*t) cos(4.*pi.*t) 1];
karim bio gassi
2020년 4월 28일
darova
2020년 4월 28일
I think it's a mistake

답변 (1개)
karim bio gassi
2020년 4월 28일
0 개 추천
댓글 수: 4
darova
2020년 4월 28일
Please explain what is X Y

karim bio gassi
2020년 4월 29일
darova
2020년 4월 29일
A is just
. No transposing needed
darova
2020년 4월 29일
where X and Y for this case:
X = [1 x1
1 x2];
Y = [y1; y2]
카테고리
도움말 센터 및 File Exchange에서 Energy Production에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!