Welcome to ClientVPS Mirrors

README

rareflow

Normalizing Flows for Rare-Event Inference

License: GPL-3

Overview

rareflow provides a unified framework for rare-event inference by combining:

The package includes:


Installation

From GitHub

# install.packages("devtools")
devtools::install_github("PietroPiu-labstats/rareflow")

Quick Example

A minimal workflow for fitting a variational posterior using a planar flow:

library(rareflow)

Qobs <- c(0.05, 0.90, 0.05)
px <- function(z) c(0.3, 0.4, 0.3)

flow <- makeflow("planar")
fit <- fitflowvariational(Qobs, pxgivenz = px, nmc = 500)

fit$elbo

Girsanov Tilting

b <- function(x) -x
dt <- 0.01
T <- 1000
Winc <- rnorm(T, sd = sqrt(dt))

fit_gir <- fitflow_girsanov(
  observed = Qobs,
  drift = b,
  Winc = Winc,
  dt = dt,
  pxgivenz = px
)

Freidlin–Wentzell Quasi-Potential

b <- function(x) x - x^3
qp <- FW_quasipotential(-1, 1, drift = b, T = 200, dt = 0.01)
qp$action

Documentation

Full documentation and examples are available in the package vignette:

vignette("rareflow")

Features

Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.

This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.