From f776585cb8751147048ef14c80976551992502d3 Mon Sep 17 00:00:00 2001 From: Lanfeng Pan Date: Thu, 20 Apr 2017 13:55:28 -0500 Subject: [PATCH] add tests for multivariate regression --- test/testreg.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testreg.jl b/test/testreg.jl index 38ab381..8ff3d13 100644 --- a/test/testreg.jl +++ b/test/testreg.jl @@ -28,7 +28,12 @@ yfit1=npr(x, y, xeval=xeval, reg=locallinear) cb=bootstrapCB(x, y, xeval=xeval) @test mean(vec(cb[1,:]) .<= yfit1 .<= vec(cb[2,:])) > .8 - +#multivariate regression +x = rand(Normal(10), 500, 3) +y = x * ones(3) .+ x.^2 *ones(3) +yfit1 = localconstant(x, y, xeval=x) +regfit = x*inv(x'*x)*x'*y +@test sum(abs2, regfit .- y) > sum(abs2, yfit1.-y) ###Bounded gamma kernel density and regression