Giter Site home page Giter Site logo

zoj613 / htnorm Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 4.0 143 KB

Fast and Exact Simulation of Hyperplane-Truncated Multivariate Normal Distributions, with C, Python and R interfaces.

License: BSD 3-Clause "New" or "Revised" License

C 67.40% Makefile 2.06% Python 7.49% R 10.43% Cython 12.63%
cholesky-decomposition conditional-distribution high-dimensional-regression multivariate-gaussian-distribution truncated-distribution

htnorm's People

Contributors

zoj613 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

htnorm's Issues

BUG: Exceptions are not explicitly raised in python when validating output.

cdef inline void validate_return_info(int info):
if info == HTNORM_ALLOC_ERROR:
raise MemoryError("Not enough memory to allocate resources.")
elif info < 0:
raise ValueError("Possible illegal value in one of the inputs.")
elif info > 0:
raise ValueError(
f"""Either the leading minor of the {info}'th order is not
positive definite (meaning the covariance matrix is also not
positive definite), or factorization of one of the inputs
returned a `U` with a zero in the {info}'th diagonal."""
)

Since this cython function has void return type, the raised exception is not propagated properly and thus gets treated as a warning.

To remedy this, the function should return an int. A value of zero when everything checks out and probably a -1 otherwise.

Error installing on linux via pip

Hi everyone,
i tried to install the package via pip. But i get the following error :

           error: Command "gcc -pthread -B /home/dingeldein/anaconda3/envs/cryo_sbi/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/dingeldein/anaconda3/envs/cryo_sbi/include -fPIC -O2 -isystem /home/dingeldein/anaconda3/envs/cryo_sbi/include -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DSCIPY_MKL_H -DHAVE_CBLAS -I/usr/local/include -I/usr/include -I/home/dingeldein/anaconda3/envs/cryo_sbi/include -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/dingeldein/anaconda3/envs/cryo_sbi/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.o.d" failed with exit status 1
           [end of output]
     
       note: This error originates from a subprocess, and is likely not a problem with pip.
       ERROR: Failed building wheel for numpy
     Failed to build numpy
     ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
     [end of output]
 
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

on Ubuntu 22.04.1 LTS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.