Learn R Programming

subrank (version 0.9.9.3)

predictdep: Probability forecasting

Description

From a set of incomplete observations, and a description of the dependence, provides simulated values of the unknown coordinates. It is also possible to simulate unconditionally, with empty observations.

Usage

predictdep(knownvalues,dependence,smoothing=c("Uniform","Beta"),nthreads=2)

Value

the matrix of the completed observations

Arguments

knownvalues

in case of conditional simulation, a matrix containing incomplete observations, the known coordinates being the same for all observations. If no variable name in knwonvalues appears in dependence$varnames, then the simulation is unconditional.

dependence

the description of the dependence we want to use to forecast, as built by function estimdep

smoothing

the smoothing method for input and output ranks.

nthreads

number of number of threads, assumed to be strictly positive. For "full throttle" computations, consider using parallel::detectCores()

Author

Jerome Collet

Examples

Run this code
lon=100
plon=100
subsampsize=10

shift=0
noise=0
knowndims=1

x=rnorm(lon)
y=2*x+noise*rnorm(lon)
donori=as.data.frame(cbind(x,y))
depori=estimdep(donori,c("x","y"),subsampsize)
##
knownvalues=data.frame(x=rnorm(plon)+shift)
prev <- predictdep(knownvalues,depori)
##
plot(prev$x,prev$y,xlim=c(-2,2),ylim=c(-2,5),pch=20,cex=0.5)
points(donori[,1:2],col='red',pch=20,cex=.5)
##
knownvalues=data.frame(x=rnorm(plon)+shift)
prev <- predictdep(knownvalues,depori,smoothing="Beta")
##
plot(prev$x,prev$y,xlim=c(-2,2),ylim=c(-2,5),pch=20,cex=0.5)
points(donori[,1:2],col='red',pch=20,cex=.5)

# souci normal si |shift|>>1

knownvalues=data.frame(z=rnorm(plon)+shift)
prev <- predictdep(knownvalues,depori)
##
plot(prev$x,prev$y,xlim=c(-2,2),ylim=c(-2,5),pch=20,cex=0.5)
points(donori[,1:2],col='red',pch=20,cex=.5)

Run the code above in your browser using DataLab