Description Usage Arguments Value Examples
This function performs a probabilistic principal component analysis with automatic relevance determination.
1 2 | ppcaard(xdf, k, chains = 2, iter = 500,
cores = max(parallel::detectCores() - 1, 1), ...)
|
xdf |
the data set to perform the analysis on |
k |
the number of latent factors to consider |
chains |
the number of chains to use which defaults to 2 |
iter |
the number of samples to pull which defaults to 1000 |
cores |
the number of cores to use which defaults to max(parallel::detectCores()-1, 1) |
... |
other arguments passed to the sampling method in rstan |
the stanfit from the sampled changepoint model
1 2 3 4 5 6 7 8 9 10 | library(ggplot2)
library(mvtnorm)
library(tibble)
library(dplyr)
tmpdf <- mvtnorm::rmvnorm(400, sigma = matrix(c(1,0.8,0.8,1),2,2))
ggplot2::qplot(tmpdf[,1], tmpdf[,2])
a<-ppcaard(as.data.frame(tmpdf), 2)
adf <- as.data.frame(a)
compdf <- tibble::tibble(z1=adf[,grep("z\\[1,", colnames(adf), value=TRUE)] %>% colMeans(),
z2=adf[,grep("z\\[2,", colnames(adf), value=TRUE)] %>% colMeans())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.