Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Laplace Approximation #2594

Draft
wants to merge 59 commits into
base: develop
Choose a base branch
from
Draft

[WIP] Laplace Approximation #2594

wants to merge 59 commits into from

Conversation

SteveBronder
Copy link
Collaborator

Summary

This is a very WIP PR, mostly for @charlesm93 and I to debug some things

Tests

Side Effects

Release notes

Checklist

  • Math issue #(issue number)

  • Copyright holder: Charles Margossian and Steve Bronder

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@@ -0,0 +1,441 @@
#ifndef STAN_MATH_LAPLACE_LAPLACE_LIKELIHOOD_HPP
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file just be deleted?

const Eigen::Matrix<T_theta, Eigen::Dynamic, 1>& theta,
const Eigen::Matrix<T_eta, Eigen::Dynamic, 1>& eta,
Eigen::Matrix<return_type_t<T_theta, T_eta>, Eigen::Dynamic, 1>& gradient,
Eigen::Matrix<return_type_t<T_theta, T_eta>, Eigen::Dynamic, 1>& hessian,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other diff methods expect a sparse matrix as the hessian, should this as well? laplace_marginal_density currently passes a sparse matrix as the hessian

Comment on lines 186 to 188
var target
= laplace_marginal_density(diff_functor, K, phi_v, eta_v, x, delta,
delta_int, theta_0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing because neg_binom does not have a defined compute_s2 method which is needed in the vari constructor. What is compute_s2 doing? Is neg_binom deprecated so we should just remove these tests?

@SteveBronder
Copy link
Collaborator Author

Also should we be using the BlockSparseMatrix type from Eigen?

https://eigen.tuxfamily.org/dox/unsupported/classEigen_1_1BlockSparseMatrix.html

@syclik syclik marked this pull request as draft May 19, 2023 14:20
@syclik
Copy link
Member

syclik commented May 19, 2023

Changed status to draft; looks like a bunch of work left to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants