m******t 发帖数: 273 | 1 【 以下文字转载自 Statistics 讨论区 】
发信人: myregmit (myregmit), 信区: Statistics
标 题: data prediction by regression or better ways
发信站: BBS 未名空间站 (Fri Mar 7 17:24:34 2014, 美东)
I am working on data prediction.
Given data of a random variable X and Y, find out how to predict Y by X.
I know how to do it by linear regression, y = k x + b .
But, here, x is always non-negative and y is required to be non-negative.
Sometimes, b is not non-negative so that y < 0.
How to assure that b > 0 and also minimize the prediction error ?
Are there other better ways (not regression) to do the prediction ?
Any help would be appreciated. |
f******y 发帖数: 2971 | 2 做个transform可以不?
比如说ln(y)= k ln(x) + b
【在 m******t 的大作中提到】 : 【 以下文字转载自 Statistics 讨论区 】 : 发信人: myregmit (myregmit), 信区: Statistics : 标 题: data prediction by regression or better ways : 发信站: BBS 未名空间站 (Fri Mar 7 17:24:34 2014, 美东) : I am working on data prediction. : Given data of a random variable X and Y, find out how to predict Y by X. : I know how to do it by linear regression, y = k x + b . : But, here, x is always non-negative and y is required to be non-negative. : Sometimes, b is not non-negative so that y < 0. : How to assure that b > 0 and also minimize the prediction error ?
|
m******t 发帖数: 273 | 3 【 以下文字转载自 Statistics 讨论区 】
发信人: myregmit (myregmit), 信区: Statistics
标 题: data prediction by regression or better ways
发信站: BBS 未名空间站 (Fri Mar 7 17:24:34 2014, 美东)
I am working on data prediction.
Given data of a random variable X and Y, find out how to predict Y by X.
I know how to do it by linear regression, y = k x + b .
But, here, x is always non-negative and y is required to be non-negative.
Sometimes, b is not non-negative so that y < 0.
How to assure that b > 0 and also minimize the prediction error ?
Are there other better ways (not regression) to do the prediction ?
Any help would be appreciated. |
f******y 发帖数: 2971 | 4 做个transform可以不?
比如说ln(y)= k ln(x) + b
【在 m******t 的大作中提到】 : 【 以下文字转载自 Statistics 讨论区 】 : 发信人: myregmit (myregmit), 信区: Statistics : 标 题: data prediction by regression or better ways : 发信站: BBS 未名空间站 (Fri Mar 7 17:24:34 2014, 美东) : I am working on data prediction. : Given data of a random variable X and Y, find out how to predict Y by X. : I know how to do it by linear regression, y = k x + b . : But, here, x is always non-negative and y is required to be non-negative. : Sometimes, b is not non-negative so that y < 0. : How to assure that b > 0 and also minimize the prediction error ?
|
m******t 发帖数: 273 | 5 what if x = 0 ? also, in some cases, y is also 0.
thanks!
【在 f******y 的大作中提到】 : 做个transform可以不? : 比如说ln(y)= k ln(x) + b
|
m******t 发帖数: 273 | 6 x and y are discrete and between 0 and 100,000.
Any help would be appreciated.
【在 f******y 的大作中提到】 : 做个transform可以不? : 比如说ln(y)= k ln(x) + b
|
m******t 发帖数: 273 | 7 This y and x scatter plot.
Any help would be appreciated.
【在 m******t 的大作中提到】 : x and y are discrete and between 0 and 100,000. : Any help would be appreciated.
|
m******t 发帖数: 273 | 8 The data are not counts and not number of success either.
They are numerical values calculated by black box functions.
Any help would be appreciated.
【在 m******t 的大作中提到】 : This y and x scatter plot. : Any help would be appreciated.
|
m******t 发帖数: 273 | 9 This is the log-norm scatter plot.
log with base as 10.
For the x =0 and y =0, we change it to be 1.
Any help would be appreciated.
【在 m******t 的大作中提到】 : The data are not counts and not number of success either. : They are numerical values calculated by black box functions. : Any help would be appreciated.
|
k***g 发帖数: 7244 | 10 如果有现成的 non-linear least-square 的library,let m = ln(k), 把你的formula
变成 y = exp(m)x+b 来做回归,estimate m 之后,用 k = exp(m)来得到 k, k 肯定
是大于零的;
如果没有现成的 nls library,直接用optimizer来 minimize sum of squared
residuals subject to b>0 就行了,也很简单。
【在 m******t 的大作中提到】 : This is the log-norm scatter plot. : log with base as 10. : For the x =0 and y =0, we change it to be 1. : Any help would be appreciated.
|
m******t 发帖数: 273 | 11 for y = exp(m)x + b , what if k > 0 but b < 0 ?
In this way, y is still possible to be < 0.
Thanks
formula
【在 k***g 的大作中提到】 : 如果有现成的 non-linear least-square 的library,let m = ln(k), 把你的formula : 变成 y = exp(m)x+b 来做回归,estimate m 之后,用 k = exp(m)来得到 k, k 肯定 : 是大于零的; : 如果没有现成的 nls library,直接用optimizer来 minimize sum of squared : residuals subject to b>0 就行了,也很简单。
|
k***g 发帖数: 7244 | 12 哦,我把你的k 和 b 看串了,一样的,你可以把 b 作同样的形变,这是一个
constrained linear regression 里常用的trick
【在 m******t 的大作中提到】 : for y = exp(m)x + b , what if k > 0 but b < 0 ? : In this way, y is still possible to be < 0. : Thanks : : formula
|