Skip to content

Commit

Permalink
fix typo in the code szcf-weiya#49
Browse files Browse the repository at this point in the history
  • Loading branch information
szcf-weiya committed Aug 12, 2020
1 parent 0f4f3b1 commit 980c9b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/PCA/principal_curves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function principal_curve(X0::Array{Float64,2}; tol=1e-4, kw...)
# note that v_1 is normalized, so λ is exactly the arc-length
β = v[:, 1] # slope
λf = u[:,1] * d[1]
spls = scatterplot_smoother(λ, X)
spls = scatterplot_smoother(λf, X)
#while true
y1, y2, y3 = gen_data(noise=false)
anim = @animate for iter = 1:1000
Expand All @@ -115,7 +115,7 @@ function principal_curve(X0::Array{Float64,2}; tol=1e-4, kw...)
scatter!(X0[:, 1], X0[:, 2], X0[:, 3], markersize=1)
plot!(y1, y2, y3, xlim = (-1, 1), ylim = (-1, 1), legend = false, color = "red")
end
return spls, λ, anim
return spls, λf, anim
end

X1, X2, X3 = gen_data()
Expand Down

0 comments on commit 980c9b9

Please sign in to comment.