关于构造广义线性回归模型的glmfit函数

MATLAB中有glmfit()函数用于构建一个广义的线性回归模型,glmfit()函数属于统计工具箱。

如何去使用glmfit()?参考help hlmfit中的discription

b = glmfit(X,y,distr)
b = glmfit(X,y,distr,param1,val1,param2,val2,...)
[b,dev] = glmfit(...)
[b,dev,stats] = glmfit(...)

Description

b = glmfit(X,y,distr) returns a (p + 1)-by-1 vector b of coefficient estimates for a generalized linear regression of the responses in y on the predictors in X, using the distribution distrX is an n-by-p matrix of p predictors at each of nobservations. distr can be any of the following: 'binomial''gamma''inverse gaussian''normal' (the default), and'poisson'.

In most cases, y is an n-by-1 vector of observed responses. For the binomial distribution, y can be a binary vector indicating success or failure at each observation, or a two column matrix with the first column indicating the number of successes for each observation and the second column indicating the number of trials for each observation.

This syntax uses the canonical link (see below) to relate the distribution to the predictors.

翻译得:

b = glmfit(X,y,distr)使用分布distr,返回系数估计的(p + 1)-1矢量b,用于y中对X的预测变量的响应的广义线性回归。 
X是n个观测值中的每一个的p个预测值的n×p矩阵。 
distr可以是以下任何一种:'二项式','gamma','逆高斯','正常'(默认值)和'泊松'。


在大多数情况下,y是观察到的响应的n乘1矢量。
对于二项分布,y可以是指示每次观察成功或失败的二元矢量,或者是两列矩阵,其中第一列指示每个观察的成功次数,第二列指示每次观察的试验次数。
 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值