This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
functions { | |
real matrix_f_lpdf(matrix cov, real nu, real delta){ | |
int k = cols(cov); | |
return(lmgamma(k, (nu + delta + k - 1)/2) - (lmgamma(k, nu/2) + lmgamma(k, (delta + k - 1)/2) + log(1)) + log_determinant(cov)*((nu -k - 1)/2) - (nu + delta + k - 1)/2 * log_determinant(cov + diag_matrix(rep_vector(1, k)))); | |
} | |
real matrix_f_fast_lpdf(matrix cov, real nu, real delta){ | |
int k = cols(cov); | |
real log_det_cov = 2*sum(log(diagonal(cholesky_decompose(cov)))); | |
real I_Sig_log_det = 2*sum(log(diagonal(cholesky_decompose(diag_matrix(rep_vector(1,k)) + cov)))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data { | |
int N; | |
vector[N] read; // Data vectors | |
vector[N] parents; | |
vector[N] ses; | |
vector[N] iq; | |
vector[N] treat; | |
int read_nMiss; // N missing from variables; excluded have no missings | |
int ses_nMiss; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Bayesian SEM example" | |
output: html_notebook | |
--- | |
The example below will use the "Political Democracy" dataset from the lavaan package. | |
```{r} | |
library(lavaan) | |
library(rstan) | |
options(mc.cores=4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Stephen Martin <stephenSRMMartin at gmail dot com> | |
pkgname=jasp-desktop-git | |
_pkgname=jasp-desktop | |
_buildname=jasp-build | |
pkgver=r1752.1a28614 | |
pkgrel=1 | |
pkgdesc="JASP, a low fat alternative to SPSS, a delicious alternative to R." | |
arch=('any') | |
url="http://jasp-stats.org" | |
license=('AGPL3') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(ggvis) | |
colors <- c('black','red','green','grey') | |
shinyServer(function(input, output,session) { | |
population0 <- reactive({ | |
data.frame(Value = rnorm(n = 100000,mean = input$mu0,sd = input$sigma0)) | |
}) | |
population1 <- reactive({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(ggvis) | |
colors <- c('black','red','blue','green') | |
shinyServer(function(input, output, session) { | |
dsR <- reactive({ | |
invalidateLater(input$refresh, session); | |
data.frame(Value = rnorm(n = input$nObs, mean = input$mean, sd = input$sd)) | |
}) | |
gv <- reactive({ |