Appealing

45 views
Skip to first unread message

王鹏

unread,
Sep 17, 2007, 9:43:23 PM9/17/07
to testing-for-superio...@googlegroups.com
Hello, everyone, I'm a doctor coming from SouthWest University of
China. Recently I meet some difficulty in perfecting the SPA.OX
procedure. Because in SPA.OX only two lossfunction, i.e. MAE and MSE,
were defined, so I want to define my own lossfunction such as HMSE,
HMAE...However, after I defined four lossfunction and run the
procedure, I find the "p-values" and "t-stat" are the same for all
models and for all my own lossfunction. There must be something wrong
with the procedure. So, I hope someone could help me to check the
procedure and inform me where the wrong is. Thanks a lot.

My e-mail: wangp...@gmail.com

The following is the SPA.OX procedure after my "perfecting":

#include <oxstd.h>
#include <oxfloat.h>
#import "spa_src"

decl sFileName="data.xls",

dB=1000,
dq=0.50,

//lossfunction="mae";
//lossfunction="mse";
//lossfunction="hmse";
lossfunction="hmae";
//lossfunction="qlike";
//lossfunction="r2log";

//hmse(Y,Yhat)
//{return meanc((1-(Yhat./Y)).^2);}

hmae(Y,Yhat)
{return meanc(fabs(1-(Yhat./Y)));}

//qlike(Y,Yhat)
//{return meanc(log(Yhat)+Y./Yhat);}

//r2log(Y,Yhat)
//{return meanc(log(Y./Yhat).^2);}


main(){
decl mX=loadmat(sFileName),mY,mYhat;
mY=mX[][0]; mYhat=mX[][1:5];
SPA(mY, mYhat, lossfunction, TestStatScaledMax, dB, dq);
}

Peter Reinhard Hansen

unread,
Sep 18, 2007, 12:49:44 AM9/18/07
to Testing for Superior Predictive Ability
Hi. You need to define the loss so that it produces the time series of
losses.

That is:

hmae(Y,Yhat)
{return fabs(1-(Yhat./Y));}

(to not take meanc() )

-PRH

On Sep 17, 6:43 pm, "王鹏" <wangpeng...@gmail.com> wrote:
> Hello, everyone, I'm a doctor coming from SouthWest University of
> China. Recently I meet some difficulty in perfecting the SPA.OX
> procedure. Because in SPA.OX only two lossfunction, i.e. MAE and MSE,
> were defined, so I want to define my own lossfunction such as HMSE,
> HMAE...However, after I defined four lossfunction and run the
> procedure, I find the "p-values" and "t-stat" are the same for all
> models and for all my own lossfunction. There must be something wrong
> with the procedure. So, I hope someone could help me to check the
> procedure and inform me where the wrong is. Thanks a lot.
>

> My e-mail: wangpeng...@gmail.com

> }- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages