How to compute the regression coefficient in Matlab with exp and ln?
3 次查看(过去 30 天)
显示 更早的评论
I would like to compute the regression coefficients `a` and `b` for my data using this equation:
y=exp(a * ln(1 - t / h) + b * ln(1 - t / t1))
and this data(example):
t = [1,2,5,4,8,7,5,1,2,5,4,1,2,1,5]
t1 = [1,2,4,4,5,3,7,5,6,8,7,1,2,1,5]
h = [1,2,3,2,9,6,8,3,6,7,4,5,2,1,5]
y = [1,2,1,4,4,6,5,8,5,7,3,1,4,1,5]
but I do not know how to include `exp` and `ln`. PLease help
4 个评论
dpb
2013-12-26
a) Well, 'cuz it's a nonlinear equation, maybe? :)
b) The difficulty in estimating your a and b separately is that since they're an additive term in the exponential they combine as a single argument.
It would help if the data were collected for a design matrix that has those two terms evaluated independently altho I've not taken the time to try to work out a specific design for the case.
回答(1 个)
Keith Dalbey
2013-12-26
let t, h, t1, and y be column vectors then
if true
% code
G=[log(1-t./h) log(1-t./t1)]; ab=(G'*G)\(G'*log(y))
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!