Skip to content

How do I use gaussian_pdf in Owl.Arr? #627

@LongPham7

Description

@LongPham7

I'm struggling to figure out how to use the function gaussian_pdf : mu:arr -> sigma:arr -> arr -> arr in the Owl.Arr module. When I tried the following code in the top level (i.e. OCaml's REPL), it crashes due to a segmentation fault:

#require "owl";;
open Owl;;
let mu_arr = Arr.init [|2|] (fun _ -> 1.);;
Arr.set mu_arr [|1|] 4.;; (* Set the second element of mu_arr to 4. *)
let sigma_arr = Arr.init [|2|] (fun _ -> 0.1);;
let current_point = Arr.init [|2|] (fun _ -> 1.5);;
let result_arr = Arr.gaussian_pdf ~mu:mu_arr ~sigma:sigma_arr current_point;;

I managed to figure out how to use gaussian_rvs, but gaussian_pdf still eludes me. Thanks a lot in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions