Assigning value from a matrix to a dictionary with key as pairs(i,j)

As @Dan indicated, the problem is likely in the dur variable. It appears to be of type Dict{Pair{Int16, Int16}, Float16} but your structure expects type Matrix{Float16}. Therefore, when you call the constructor Ld(Pg_Dict, Pd_Dict, dur), Julia implicitly invokes convert(Matrix{Float16}, dur), which fails.

Also, please, read the following instructions and try to adapt your posts accordingly: