Skip to content

Commit

Permalink
Array of Function needs type before square bracket
Browse files Browse the repository at this point in the history
  • Loading branch information
panlanfeng committed Apr 20, 2017
1 parent a93f407 commit 0a1ab78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bandwidth.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function lscvlocalconstant(xdata::RealMatrix, ydata::RealVector, kernel::Array{F
tmp/n
end

function bwlocalconstant(xdata::RealMatrix, ydata::RealVector, kernel::Array{Function, 1} = [gaussiankernel for i in 1:size(xdata)[2]])
function bwlocalconstant(xdata::RealMatrix, ydata::RealVector, kernel::Array{Function, 1} = Function[gaussiankernel for i in 1:size(xdata)[2]])
n, p = size(xdata)
w = ones(n)
h0 = zeros(p)
Expand Down
6 changes: 3 additions & 3 deletions src/regression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ end


# #multi-variate nadaraya-watson regression or local linear
function localconstant(xdata::RealMatrix, ydata::RealVector; kernel::Array{Function, 1}=[gaussiankernel for i in 1:size(xdata)[2]], xeval::RealMatrix=xdata, h::RealVector=bwlocalconstant(xdata, ydata, kernel))
function localconstant(xdata::RealMatrix, ydata::RealVector; kernel::Array{Function, 1}=Function[gaussiankernel for i in 1:size(xdata)[2]], xeval::RealMatrix=xdata, h::RealVector=bwlocalconstant(xdata, ydata, kernel))

m, p = size(xeval)
n, p1 = size(xdata)
if p1 != p || length(h) !=p
Expand All @@ -104,7 +104,7 @@ function localconstant(xdata::RealMatrix, ydata::RealVector; kernel::Array{Funct
error("Bandwidth should be positive")
end
pre=zeros(m)

for i=1:m
w = ones(n)
wtmp = ones(n)
Expand Down

0 comments on commit 0a1ab78

Please sign in to comment.