# コーシー分布
f(y) = 1/(π*(1+y^2))
# 正規分布
g(σ,x,μ) = 1/(√(2π*σ^2))*exp((x-μ)^2/2σ^2)
g (generic function with 1 method)
using Plots
lables = Array{String}(1,3)
# コーシー分布
X = Float64[]
for i in -5:.1:5
push!(X,f(i))
end
#plot(X)
x = linspace(-5, 5, 100)
d = Normal(0, 1)
y = pdf(d, x)
labels[1] = string("コーシー分布")
labels[2] = string("正規分布")
plot(x, [X,y], linewidth=2, alpha=0.6, label=labels)
log(g(y)/f(y))g(y)
MethodError: no method matching g(::Array{Float64,1}) Closest candidates are: g(::Any, ::Any, ::Any) at In[75]:5 Stacktrace: [1] include_string(::String, ::String) at ./loading.jl:522