Introduction

  1. Loading packages
library( CFINI )
t <- seq( 0, 1, 0.0001 )
d <- 40
W <- cf_wiener( d, t )
cols <- sample( colors()[ grepl( 'blue', colors() ) ], d, replace = TRUE )

plot( t, W[,1], type = 'l', col = cols[1], ylim = c( -3.5, 3.5 ), xlab = 't', ylab = 'W' )
for ( i in 2:d ) {
  points( t, W[,i], type = 'l', col = cols[i] )
}
t <- seq( 0, 2, 0.0001 )
d <- 2
X0 <- matrix( c( 0, 0 ), 2, 1 )
b <- function( t, X ) { 
  return( matrix( c( exp( -0.04 * t ), exp( -0.03 * t ) ), 2, 1 ) )
}
s <- function( t, X ) { 
  return( matrix( c( exp( 0.2 * t ), exp( 2 * t ), exp( 2 * t ), exp( 0.5 * t ) ), 2, 2 ) )
}
# X <- cf_stoch_solv( d, d, X0, b, s, t )
# plot( X[,1], X[,2], col = 'midnightblue', type = 'l', lwd = 1.5 )
# plot( t, X[,1], col = 'midnightblue', type = 'l', lwd = 1.5 )
# plot( t, X[,2], col = 'midnightblue', type = 'l', lwd = 1.5 )


pedroguarderas/CFINI documentation built on Feb. 16, 2024, 2:17 p.m.