Hello,
The last line of my code returns the following error, but both appear to be matrixes. I cannot seem to figure out what is wrong?
MethodError: no method matching +(::Float64, ::Matrix{Float64})
For element-wise addition, use broadcasting with dot syntax: scalar .+ array
Closest candidates are:
+(::Any, ::Any, ::Any, ::Any...) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/operators.jl:655
+(::Union{Float16, Float32, Float64}, ::BigFloat) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/mpfr.jl:413
+(::AbstractFloat, ::Bool) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/bool.jl:172
...
zstar=mew/(1-ρ); #expected value of z
#stddev of z
σz=σ/sqrt(1-ρ^2);
#fill in along real line:
lnzg = zstar.*ones(nz,1) + range(start = -q.*σz,stop=q.*σz,length=nz);
The RHS of + sign looks like:
2-element LinRange{Matrix{Float64}, Int64}:
[-0.00367698 -302.609; -0.00370377 -302.609; … ; -360.943 -750.157; -387.051 -780.339],…,[0.00367698 302.609; 0.00370377 302.609; … ; 360.943 750.157; 387.051 780.339]
And the LHS of + sign looks like:
2×1 Matrix{Float64}:
0.0
0.0