Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Error when running loo with moment_match = TRUE on rstan model from previous session

オープン
#183 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
r
領域
data

調査の方向性

レポートに記載されている loo(fit, moment_match = TRUE) エントリポイントと rstan/R/loo.R の実装から始めます。loo を呼び出す前に stanfit を保存して再読み込みし、失敗を再現してから、同一セッションでの呼び出しと比較します。再読み込みしたモデルが invalid-model error なしで moment matching を完了し、保存して再読み込みするケースを対象とした回帰テストがあれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hi,

I'm trying to run loo with moment matching on an rstan model fit in a previous session. The stanfit object was saved using:

fit <- stan(...)
saveRDS(fit,...)

And then loaded and loo (from https://github.com/stan-dev/rstan/blob/develop/rstan/rstan/R/loo.R) was run with:

fit <- loadRDS(...)
loo(fit, moment_match = TRUE)

which throws the following error:

Error in .local(object, ...) : 
  the model object is not created or not valid
Calls: loo ... apply -> FUN -> <Anonymous> -> <Anonymous> -> .local
Execution halted

Fitting and loading are both happening on the same system (university HPC cluster). I have no problems loading the stanfit object and then running other functions on this system (running extract(fit) for example) or loading the stanfit object on my local system (Mac OS 11.2.1). This also works fine if the model is fit and then loo is run within the same session (i.e. not from a .rds file).

HPC Cluster specs:

cat /etc/*-release

Cluster Manager v9.1
slave
NAME="Red Hat Enterprise Linux"
VERSION="8.2 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.2"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.2"
Red Hat Enterprise Linux release 8.2 (Ootpa)
Red Hat Enterprise Linux release 8.2 (Ootpa)

R environment specs:

R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
rstan (version 2.21.2)

Thanks for your help and developing such an awesome package! If this is an rstan and not a loo problem I'm happy to move the issue there.

主要言語
R
スター
157
フォーク
38
平均マージ
4日 16時間
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stan-dev/loo のほかの issue

stan-dev/loo の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。