Skip to content

Commit

Permalink
add tests for multivariate regression
Browse files Browse the repository at this point in the history
  • Loading branch information
panlanfeng committed Apr 20, 2017
1 parent 0a1ab78 commit f776585
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/testreg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f776585

Please sign in to comment.