Apply a Metric Graph Low-Pass Filter Path
Source:R/metric_graph_lowpass.R
apply.metric.graph.lowpass.path.RdApplies every requested low-pass parameter to one response or a matrix of responses using a reusable spectral basis.
Arguments
- basis
A
"metric.graph.lowpass.basis"object.- y
Numeric response vector or matrix with one row per graph vertex.
- eta.grid
Numeric filter-parameter grid.
- filter.type
Spectral low-pass filter family.
- block.size
Optional number of response columns processed together.
- truncation.tol
Positive tolerance smaller than one used to classify truncated-basis candidates as spectrally resolved.
- unresolved.action
Action when a truncated-basis candidate exceeds
truncation.tol:"warn","error", or"allow".- exact.zero
Logical. For heat filtering, return the input exactly at
eta = 0. This avoids treating a truncated spectral projection as the identity.
Value
A list of class "metric.graph.lowpass.path". For one response,
fitted.values is an \(N\) by \(J\) matrix. For multiple
responses it is an \(N\) by \(J\) by \(S\) array.
Examples
adj <- list(2L, c(1L, 3L), c(2L, 4L), 3L)
lengths <- list(1, c(1, 1), c(1, 1), 1)
basis <- metric.graph.lowpass.basis(adj, lengths, n.eigenpairs = 4L,
eigen.solver = "dense")
apply.metric.graph.lowpass.path(basis, 1:4, eta.grid = c(0, 0.1, 1))
#> $fitted.values
#> 0.0 0.1 1.0
#> [1,] 1 1.095310 1.687464
#> [2,] 2 2.004388 2.167428
#> [3,] 3 2.995612 2.832572
#> [4,] 4 3.904690 3.312536
#>
#> $eta.grid
#> [1] 0.0 0.1 1.0
#>
#> $filter.type
#> [1] "heat_kernel"
#>
#> $effective.df
#> [1] 4.000000 3.472594 1.724905
#>
#> $resolution
#> eta retained.cutoff.weight spectrally.resolved exact.identity
#> 1 0.0 1.00000000 TRUE TRUE
#> 2 0.1 0.71075936 TRUE FALSE
#> 3 1.0 0.03290227 TRUE FALSE
#>
#> $n.responses
#> [1] 1
#>
#> $response.names
#> NULL
#>
#> $basis
#> $graph
#> $graph$n.vertices
#> [1] 4
#>
#> $graph$n.edges
#> [1] 3
#>
#> $graph$adj.list
#> $graph$adj.list[[1]]
#> [1] 2
#>
#> $graph$adj.list[[2]]
#> [1] 1 3
#>
#> $graph$adj.list[[3]]
#> [1] 2 4
#>
#> $graph$adj.list[[4]]
#> [1] 3
#>
#>
#> $graph$weight.list
#> $graph$weight.list[[1]]
#> [1] 1
#>
#> $graph$weight.list[[2]]
#> [1] 1 1
#>
#> $graph$weight.list[[3]]
#> [1] 1 1
#>
#> $graph$weight.list[[4]]
#> [1] 1
#>
#>
#>
#> $operator
#> $graph
#> $graph$n.vertices
#> [1] 4
#>
#> $graph$n.edges
#> [1] 3
#>
#> $graph$adj.list
#> $graph$adj.list[[1]]
#> [1] 2
#>
#> $graph$adj.list[[2]]
#> [1] 1 3
#>
#> $graph$adj.list[[3]]
#> [1] 2 4
#>
#> $graph$adj.list[[4]]
#> [1] 3
#>
#>
#> $graph$weight.list
#> $graph$weight.list[[1]]
#> [1] 1
#>
#> $graph$weight.list[[2]]
#> [1] 1 1
#>
#> $graph$weight.list[[3]]
#> [1] 1 1
#>
#> $graph$weight.list[[4]]
#> [1] 1
#>
#>
#>
#> $edge.table
#> u v length conductance
#> 1 1 2 1 1
#> 2 2 3 1 1
#> 3 3 4 1 1
#>
#> $conductance
#> $conductance$rule
#> [1] "inverse.length.power"
#>
#> $conductance$values
#> [1] 1 1 1
#>
#> $conductance$local.scales
#> [1] NA NA NA NA
#>
#> $conductance$summary
#> $conductance$summary$min
#> [1] 1
#>
#> $conductance$summary$q10
#> [1] 1
#>
#> $conductance$summary$median
#> [1] 1
#>
#> $conductance$summary$q90
#> [1] 1
#>
#> $conductance$summary$max
#> [1] 1
#>
#> $conductance$summary$mean
#> [1] 1
#>
#> $conductance$summary$n.nonfinite
#> [1] 0
#>
#> $conductance$summary$n.clipped
#> [1] 0
#>
#>
#>
#> $degree
#> [1] 1 2 2 1
#>
#> $laplacian
#> $laplacian$dim
#> [1] 4 4
#>
#> $laplacian$i
#> [1] 0 1 0 1 2 1 2 3 2 3
#>
#> $laplacian$j
#> [1] 0 0 1 1 1 2 2 2 3 3
#>
#> $laplacian$x
#> [1] 1 -1 -1 2 -1 -1 2 -1 -1 1
#>
#> $laplacian$matrix
#> 4 x 4 sparse Matrix of class "dgCMatrix"
#>
#> [1,] 1 -1 . .
#> [2,] -1 2 -1 .
#> [3,] . -1 2 -1
#> [4,] . . -1 1
#>
#>
#> $laplacian.type
#> [1] "unnormalized"
#>
#> $parameters
#> $parameters$conductance.epsilon
#> [1] 1e-08
#>
#> $parameters$conductance.alpha
#> [1] 1
#>
#> $parameters$conductance.sigma
#> [1] NA
#>
#> $parameters$conductance.sigma.rule
#> [1] "edge.quantile"
#>
#> $parameters$conductance.sigma.quantile
#> [1] 0.75
#>
#> $parameters$conductance.local.k
#> [1] 5
#>
#> $parameters$laplacian.type
#> [1] "unnormalized"
#>
#>
#> $diagnostics
#> $diagnostics$degree.summary
#> $diagnostics$degree.summary$min
#> [1] 1
#>
#> $diagnostics$degree.summary$q10
#> [1] 1
#>
#> $diagnostics$degree.summary$median
#> [1] 1.5
#>
#> $diagnostics$degree.summary$q90
#> [1] 2
#>
#> $diagnostics$degree.summary$max
#> [1] 2
#>
#> $diagnostics$degree.summary$mean
#> [1] 1.5
#>
#> $diagnostics$degree.summary$n.nonfinite
#> [1] 0
#>
#> $diagnostics$degree.summary$n.clipped
#> [1] 0
#>
#>
#> $diagnostics$length.summary
#> $diagnostics$length.summary$min
#> [1] 1
#>
#> $diagnostics$length.summary$q10
#> [1] 1
#>
#> $diagnostics$length.summary$median
#> [1] 1
#>
#> $diagnostics$length.summary$q90
#> [1] 1
#>
#> $diagnostics$length.summary$max
#> [1] 1
#>
#> $diagnostics$length.summary$mean
#> [1] 1
#>
#> $diagnostics$length.summary$n.nonfinite
#> [1] 0
#>
#> $diagnostics$length.summary$n.clipped
#> [1] 0
#>
#>
#>
#> attr(,"class")
#> [1] "metric.graph.lowpass.operator" "list"
#>
#> $conductance
#> $conductance$rule
#> [1] "inverse.length.power"
#>
#> $conductance$values
#> [1] 1 1 1
#>
#> $conductance$local.scales
#> [1] NA NA NA NA
#>
#> $conductance$summary
#> $conductance$summary$min
#> [1] 1
#>
#> $conductance$summary$q10
#> [1] 1
#>
#> $conductance$summary$median
#> [1] 1
#>
#> $conductance$summary$q90
#> [1] 1
#>
#> $conductance$summary$max
#> [1] 1
#>
#> $conductance$summary$mean
#> [1] 1
#>
#> $conductance$summary$n.nonfinite
#> [1] 0
#>
#> $conductance$summary$n.clipped
#> [1] 0
#>
#>
#>
#> $laplacian
#> $laplacian$dim
#> [1] 4 4
#>
#> $laplacian$i
#> [1] 0 1 0 1 2 1 2 3 2 3
#>
#> $laplacian$j
#> [1] 0 0 1 1 1 2 2 2 3 3
#>
#> $laplacian$x
#> [1] 1 -1 -1 2 -1 -1 2 -1 -1 1
#>
#> $laplacian$matrix
#> 4 x 4 sparse Matrix of class "dgCMatrix"
#>
#> [1,] 1 -1 . .
#> [2,] -1 2 -1 .
#> [3,] . -1 2 -1
#> [4,] . . -1 1
#>
#>
#> $laplacian.type
#> [1] "unnormalized"
#>
#> $spectral
#> $spectral$eigenvalues
#> [1] -7.244401e-17 5.857864e-01 2.000000e+00 3.414214e+00
#>
#> $spectral$eigenvectors
#> [,1] [,2] [,3] [,4]
#> [1,] -0.5 -0.6532815 -0.5 0.2705981
#> [2,] -0.5 -0.2705981 0.5 -0.6532815
#> [3,] -0.5 0.2705981 0.5 0.6532815
#> [4,] -0.5 0.6532815 -0.5 -0.2705981
#>
#> $spectral$backend
#> [1] "dense"
#>
#> $spectral$n.vertices
#> [1] 4
#>
#> $spectral$n.eigenpairs
#> [1] 4
#>
#> $spectral$is.complete
#> [1] TRUE
#>
#> $spectral$largest.retained.eigenvalue
#> [1] 3.414214
#>
#> $spectral$smallest.positive.eigenvalue
#> [1] 0.5857864
#>
#> $spectral$omitted.attenuation.bound.type
#> [1] "complete_spectrum"
#>
#>
#> $parameters
#> $parameters$conductance.rule
#> [1] "inverse.length.power"
#>
#> $parameters$conductance.epsilon
#> [1] 1e-08
#>
#> $parameters$conductance.alpha
#> [1] 1
#>
#> $parameters$conductance.sigma
#> [1] NaN
#>
#> $parameters$conductance.sigma.rule
#> [1] "edge.quantile"
#>
#> $parameters$conductance.sigma.quantile
#> [1] 0.75
#>
#> $parameters$conductance.local.k
#> [1] 5
#>
#> $parameters$laplacian.type
#> [1] "unnormalized"
#>
#> $parameters$verbose
#> [1] FALSE
#>
#> $parameters$n.eigenpairs
#> [1] 4
#>
#> $parameters$eigen.solver
#> [1] "dense"
#>
#> $parameters$dense.eigen.threshold
#> [1] 200
#>
#> $parameters$dense.fallback.threshold
#> [1] 5000
#>
#> $parameters$dense.fallback
#> [1] "auto"
#>
#>
#> attr(,"class")
#> [1] "metric.graph.lowpass.basis" "list"
#>
#> $parameters
#> $parameters$block.size
#> [1] NA
#>
#> $parameters$truncation.tol
#> [1] 1e-04
#>
#> $parameters$unresolved.action
#> [1] "warn"
#>
#> $parameters$exact.zero
#> [1] TRUE
#>
#>
#> attr(,"class")
#> [1] "metric.graph.lowpass.path" "list"