[R] A stat related question
Rolf Turner
r.turner at auckland.ac.nz
Mon Sep 21 01:47:20 CEST 2009
On 18/09/2009, at 9:23 PM, RON70 wrote:
>
> Can I ask a small stat. related question here?
>
> Suppose I have two predictors for a time series processes and
> accuracy of
> predictor is measured from MSEs. My question is, if two predictors
> give same
> MSE then, necessarily they have to be identical? Can anyone provide
> me any
> counter example?
Counter example:
xmpl.df <- structure(list(y = c(-0.367234642740975,
0.185230564865609, 0.581823727365507,
1.39973682729268, -0.727292059474465, 1.30254263204414,
0.335848119752074,
1.03850609869762, 0.920728568290646, 0.720878162866862,
-1.04311893856785,
-0.0901863866107067, 0.623518161999544, -0.953523357772344,
-0.542828814573857,
0.580996497681682, 0.768178737834591, 0.463767588540167,
-0.88577629740968,
-1.09978089864786), x1 = c(0.206067430466075, -0.132238579133420,
0.0299230903476012, 0.0770661103560109, 0.0371133529511250,
-0.0520909837658339,
0.230634542906874, -0.0500870952845974, 0.319228715708252,
-0.0445038917047473,
0.194516706231773, 0.366107384673495, -0.276282276770058,
-0.0822685230586955,
-0.0568443308533714, 0.0776057819874248, -0.0832235252633287,
-0.497827207484688, -0.460077637514818, 0.197180935204927), x2 = c
(0.0933724365258708,
0.290885869560421, -0.0537456615562362, -0.245617952924438,
-0.375140161451431,
-0.0161691421541291, 0.156173578334144, 0.216101027538157,
0.0175689640482125,
0.0199243858378162, -0.0866770708194298, 0.00756428018151888,
-0.514631477389958, -0.00411244710635592, -0.203127938586995,
0.337864750427246, 0.0317949224635923, -0.115158146496248,
0.434123920996512,
0.00900586257173104)), .Names = c("y", "x1", "x2"), row.names = c(NA,
-20L), class = "data.frame")
The predictors x1 and x2 are *orthogonal* to each other, yet yield
exactly
the same model when y is regressed on each of them.
To construct such an example think in terms of geometry and linear
algebra.
Let ``o'' be the constant n-vector all of whose entries are 1.
Take an n-vector y and a unit n-vector x1 which is orthogonal to
``o'' (i.e. which has mean 0). Construct a unit vector x2 which is
in the othocomplement of V_1 = <o,x1> = the span of o and x1, and
which has
the same inner product with y as has x1.
To do the latter --- choose any two unit vectors, u1 and u2 in the
orthocomplement
of V_1, let x2 = a*u1 + b*u2 and choose a and b so that a^2 + b^2 = 1
and
(y,x2) = (y,x1). Note that ``(v1,v2)'' means the inner (dot) product
of v1 and v2.
``Choosing'' a and b involves solving a quadratic equation.
To get things in orthocomplements of things, use the Gramm-Schmidt
orthonormalization
algorithm.
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
More information about the R-help
mailing list