Skip to content

Instantly share code, notes, and snippets.

View vutunganh's full-sized avatar

Vu Tung Anh vutunganh

  • Prague, Czech Republic
View GitHub Profile
using MovingWeightedLeastSquares
f(x) = sin(2x)/2 + 10
function t()
xs = collect(-6:0.2:6)
fs = [f(x) for x in xs]
ε = 0.4
w = (d, eps) -> (exp(-d^2))
obj = mwls_naive(xs, fs, ε, w, maxDegree = 5)
%%BeginIpePreamble
%% Math
% These two are needed because something.
% https://tex.stackexchange.com/a/133783
\usepackage{sansmathaccent}
\pdfmapfile{+sansmathaccent.map}
\usepackage{amsmath,amssymb}
\usepackage{mathtools}
\usepackage{subcaption}