convert CmdStan CSV output to R dump format input

Offen
#511 12 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cpp
Bereich
cli, documentation

Rechercherichtung

Beginne mit der Untersuchung des vorhandenen Befehls bin/print und des CmdStan-Handbuchs. Verfolge, wie die CmdStan-CSV-Ausgabe dargestellt wird, einschließlich generierter Größen vom Typ Integer, und ermittle die Befehlsschnittstelle zum Erzeugen von R-dump-Eingaben. Als abgeschlossen gilt die Aufgabe, wenn die Konvertierung für das Bernoulli-Beispiel funktioniert und das Handbuch ihre Verwendung für die Simulation von Fake-Daten und posterior-predictive Checks dokumentiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

Moved from https://github.com/stan-dev/stan/issues/544

In order to perform fake data simulation or posterior predictive checking, it would be nice to be able to convert the output of a Stan model from CSV format to the input for a Stan model in R dump format.

This should be structured as a command parallel to bin/print that does the conversion of an output CSV file. An alternative would be to have a model call argument that would produce R dump output.

The manual for CmdStan needs to be updated to show how to use this function. This will enable us to write a chapter in the manual on fake data and posterior predictive checks.

Be careful about type of the columns --- if there are integer generated quantities, the output can be integers.

For example, for the Bernoulli model in the introduction, a fake-data generator should look like:

data {
  int<lower=0> N;
  real<lower=0, upper=1> theta;
}
generated quantities {
  int<lower=0,upper=1> y[N];

  for (n in 1:N)
    y[n] <- bernoulli_rng(theta);
}

Related issues:

  • To run this, we need both the output of running the Bernoulli model and a value for N in order to provide input for this model
  • Doing proper posterior model generation will require empty parameters and model blocks, so update the parser so that this works (or link to a different issue); @betanalpha is working on a feature for this with a dummy sampler that can handle empty parameter vectors
Vorherrschende Sprache
C++
Sterne
240
Forks
105
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus stan-dev/cmdstan

Alle Issues in stan-dev/cmdstan

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.