how to write this equation for modelfun?

being "bid-ask spread %" , "participation %", "T", "ADV" and "Size" the data I have, and the rest the parameters to fit.
I am trying to use the fitnlm function, but can't write my equation corrently :/
Thanks!

답변 (1개)

Elizabeth Reese
Elizabeth Reese 2017년 9월 1일

0 개 추천

The way you can do this with so many predictor variables and coefficients is to vectorize the equation. Then you just have to be consistent about how you vectorized. For your case, we could do the following:
This means that X would be a big matrix where each column is one of your predictor variables. For there, you have to be careful with multiplication, division, and exponentiation to ensure they are element-wise operations.
For example, to compute this
you need to execute the following in modelfun(b,x):
(x(:,4)./x(:,5)).^b(7)

카테고리

도움말 센터File Exchange에서 Chemistry에 대해 자세히 알아보기

질문:

2017년 8월 29일

답변:

2017년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by