model

package
Version: v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

The eight schools example as appears in PyStan documentation (and taken from "Bayesian Data Analysis", Section 5.5 by Gelman et al.i):

data {

int<lower=0> J; // number of schools
vector[J] y; // estimated treatment effects
vector<lower=0>[J] sigma; // s.e. of effect estimates

} parameters {

real mu;
real<lower=0> tau;
vector[J] eta;

} transformed parameters {

vector[J] theta;
theta = mu + tau * eta;

} model {

eta ~ normal(0, 1);
y ~ normal(theta, sigma);

}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	J          int       // number of schools
	Y          []float64 // estimated treatment effects
	Sigma      []float64 // s.e. of effect estimates
	Stau, Seta float64   // log variances of tau and eta priors
}

func (*Model) Observe

func (m *Model) Observe(x []float64) float64

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL