- using R version 4.5.2 Patched (2026-01-31 r89382)
- using platform: aarch64-apple-darwin20
- R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
- running under: macOS Ventura 13.7.8
- using session charset: UTF-8
- checking for file ‘creditratingsystem/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘creditratingsystem’ version ‘0.1.0’
- package encoding: UTF-8
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘creditratingsystem’ can be installed ... [14s/15s] OK
See the install log for details.
- checking installed package size ... INFO
installed size is 9.9Mb
sub-directories of 1Mb or more:
R 4.0Mb
extdata 4.1Mb
- checking package directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [0s/0s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the package can be unloaded cleanly ... [0s/0s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the namespace can be unloaded cleanly ... [0s/0s] OK
- checking loading without being on the library search path ... [0s/0s] OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [22s/22s] OK
- checking Rd files ... [0s/0s] OK
- checking Rd metadata ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking examples ... [1s/1s] OK
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [21s/22s] ERROR
Running ‘test-affordability.R’ [0s/0s]
Running ‘test-application.R’ [0s/0s]
Running ‘test-behavioral-development.R’ [1s/1s]
Running ‘test-behavioral.R’ [1s/1s]
Running ‘test-calibration-models.R’ [1s/1s]
Running ‘test-calibration.R’ [0s/0s]
Running ‘test-canonical-id-ordering.R’ [0s/0s]
Running ‘test-champion-challenger-example.R’ [0s/0s]
Running ‘test-classification-bayesian.R’ [0s/0s]
Running ‘test-classification-dispatch.R’ [0s/0s]
Running ‘test-classification-flexible.R’ [1s/1s]
Running ‘test-classification-models.R’ [1s/1s]
Running ‘test-classification-neural.R’ [0s/0s]
Running ‘test-classification.R’ [0s/0s]
Running ‘test-collections-prediction.R’ [0s/0s]
Running ‘test-collections.R’ [0s/0s]
Running ‘test-content-fingerprint.R’ [0s/0s]
Running ‘test-core.R’ [0s/0s]
Running ‘test-counterparty-credit-products-example.R’ [0s/0s]
Running ‘test-counterparty-public-review.R’ [1s/1s]
Running ‘test-covered-bond-products-example.R’ [0s/1s]
Running ‘test-data.R’ [0s/0s]
Running ‘test-decisioning-approval-contract.R’ [0s/0s]
Running ‘test-decisioning-economics.R’ [0s/0s]
Running ‘test-decisioning-evaluation.R’ [1s/1s]
Running ‘test-decisioning.R’ [0s/0s]
Running ‘test-dependence.R’ [1s/1s]
Running ‘test-ead-authorizations.R’ [0s/0s]
Running ‘test-ead-counterparty.R’ [0s/0s]
Running ‘test-ead-models.R’ [0s/0s]
Running ‘test-ead.R’ [0s/0s]
Running ‘test-expert-network.R’ [0s/0s]
Running ‘test-expert-probability.R’ [0s/0s]
Running ‘test-expert-qualitative.R’ [0s/0s]
Running ‘test-explainability-ale.R’ [0s/0s]
Running ‘test-explainability-attribution.R’ [0s/0s]
Running ‘test-explainability-counterfactual.R’ [0s/0s]
Running ‘test-explainability-local.R’ [0s/0s]
Running ‘test-explainability-permutation.R’ [0s/0s]
Running ‘test-explainability-reasons.R’ [0s/0s]
Running ‘test-explainability-robustness.R’ [0s/0s]
Running ‘test-features.R’ [0s/0s]
Running ‘test-hybrid-graph.R’ [0s/0s]
Running ‘test-hybrid-models.R’ [1s/1s]
Running ‘test-input-lineage-example.R’ [0s/0s]
Running ‘test-lgd-downturn.R’ [0s/0s]
Running ‘test-lgd-models.R’ [0s/0s]
Running ‘test-lgd-workout.R’ [1s/1s]
Running ‘test-lgd.R’ [0s/0s]
Running ‘test-lifetime-risk-review.R’ [0s/0s]
Running ‘test-lineage-canonical-ids.R’ [0s/0s]
Running ‘test-links.R’ [0s/0s]
Running the tests in ‘tests/test-links.R’ failed.
Complete output:
> if(!exists('build_entity_graph'))library(creditratingsystem)
> lk_error<-function(code,expr){e<-tryCatch({force(expr);NULL},error=identity);stopifnot(inherits(e,'creditratingsystem_error'),identical(e$code,code))}
> lk_near<-function(a,b)stopifnot(isTRUE(all.equal(as.numeric(unlist(a)),b,tolerance=1e-9)))
> lk_policy<-list(policy_id='relations',version='1',edge_types=list('OWNERSHIP','CONTROL','CROSS_DEFAULT'))
> lk_control<-list(policy_id='control',version='1',control_edge_types=list('CONTROL'),ownership_threshold=.5,ownership_inclusive=FALSE)
> lk_target<-list(event='default',horizon=1,time_unit='years',probability_measure='PHYSICAL',conditioning='performing')
> lk_edge<-function(i,a,b,kind='OWNERSHIP'){x<-list(edge_id=i,source_id=a,target_id=b,edge_type=kind,valid_from='2024-01-01',valid_until=NULL,known_at='2024-01-01',evidence_reference='test-contract');if(kind=='OWNERSHIP')x$ownership_fraction<-.6;x}
> lk_graph<-function(edges,as_of='2024-04-01',known_at='2024-04-01')build_entity_graph(lapply(c('A','B','C','D'),function(x)list(entity_id=x)),edges,lk_policy,as_of,known_at)
> e1<-lk_edge('ab','A','B');e1$valid_until<-'2024-07-01';e2<-lk_edge('db','D','B');e2$valid_from<-'2024-07-01';e2$known_at<-'2024-06-01'
> g<-lk_graph(list(e1,e2,lk_edge('bc','B','C')));stopifnot(resolve_parent_links(g,lk_control)$value$parents[[3]]$ultimate_parent=='A')
> later<-lk_graph(list(e1,e2,lk_edge('bc','B','C')),'2024-07-01','2024-07-01');stopifnot(resolve_parent_links(later,lk_control)$value$parents[[3]]$ultimate_parent=='D')
> cycle<-lk_graph(list(lk_edge('ab','A','B'),lk_edge('ba','B','A')));stopifnot(resolve_parent_links(cycle,lk_control)$value$parents[[1]]$status=='CONTROL_CYCLE')
> bad<-g$value;bad$edges[[1]]$source_id<-'D';lk_error('LINK_INTEGRITY',resolve_parent_links(bad,lk_control))
> g<-lk_graph(list(lk_edge('ab','A','B','CROSS_DEFAULT'),lk_edge('ba','B','A','CROSS_DEFAULT'),lk_edge('bc','B','C','CROSS_DEFAULT'),lk_edge('cb','C','B','CROSS_DEFAULT')))
> dp<-list(policy_id='defaults',version='1',edge_types=list('CROSS_DEFAULT'),direction_policy='mutual_only',transitive=TRUE)
> r<-assign_default_groups(g,dp,list(list(facility_id='f',entity_id='A')))$value;stopifnot(identical(sort(vapply(r$groups,function(x)length(x$members),integer(1))),c(1L,3L)))
> dp$transitive<-FALSE;r<-assign_default_groups(g,dp,list())$value;stopifnot(r$conflicts[[1]]$status=='NONTRANSITIVE_OVERLAP')
> child<-list(entity_id='B',pd=.1,stage='STANDALONE',target=lk_target,applied_effects=list());parent<-child;parent$entity_id<-'A';parent$pd<-.2
> state<-list(available_capacity=100,willingness_given_state=.5,success_given_willing_and_funded=1,support_permitted=TRUE,evidence_reference='conditional-support');joint<-state;joint$available_capacity<-0;joint$support_permitted<-FALSE
> support<-list(effect_id='support-A-B',assumption_reference='conditional-tree',currency='EUR',total_capacity=200,reserved_elsewhere=50,allocated_capacity=100,support_required=80,states=list(parent_alive=state,joint_default=joint))
> lk_near(apply_parent_support(child,parent,support,.02)$value$pd,.06);support$states$parent_alive$available_capacity<-70;lk_near(apply_parent_support(child,parent,support,.02)$value$pd,.1)
> claims<-lapply(c('A','B'),function(x)list(claim_id=x,entity_id=x,amount=80,currency='EUR',due_at='2024-12-01',known_at='2024-01-01'))
> guar<-list(guarantee_id='g',guarantor_id='P',currency='EUR',cap=100,cap_used=0,coverage_fraction=1,covered_claim_ids=list('A','B'),valid_from='2024-01-01',valid_until='2025-01-01',known_at='2024-01-01',legally_effective=TRUE,evidence_reference='contract')
> ap<-list(policy_id='allocation',version='1',guarantee_priority=list('g'),claim_priority=list('A','B'),cap_convention='non_reinstating_total')
> a<-allocate_guarantee_coverage(list(guar),claims,ap,'2024-01-01','2024-01-01','EUR');lk_near(lapply(a$value$allocations,function(r)r$covered_amount),c(80,20))
> stopifnot(identical(a$value,allocate_guarantee_coverage(list(guar),rev(claims),ap,'2024-01-01','2024-01-01','EUR')$value))
> claims<-list(list(claim_id='c',entity_id='B',amount=100,currency='EUR',due_at='2024-12-01',known_at='2024-01-01'));guar$cap<-60;guar$covered_claim_ids<-list('c');ap$claim_priority<-list('c')
> a<-allocate_guarantee_coverage(list(guar),claims,ap,'2024-01-01','2024-01-01','EUR');guarantor<-parent;guarantor$entity_id<-'P'
> lc<-list(effect_id='guarantee',currency='EUR',assumption_reference='four-state-table',stage='PRE_GUARANTEE',valuation_date='2024-12-01',states=list(borrower_only=list(loss_before_guarantee=80,payout_fraction=1,evidence_reference='payout'),joint_default=list(loss_before_guarantee=100,payout_fraction=0,evidence_reference='zero-payout')))
> r<-apply_guarantee_risk(child,guarantor,a,'c',lc,.02);lk_near(r$value$expected_loss_before,8.4);lk_near(r$value$expected_loss_after,3.6);stopifnot(r$value$pd==.1);lk_error('LINK_DOUBLE_COUNT',apply_guarantee_risk(r,guarantor,a,'c',lc,.02));lc$effect_id<-'renamed-effect';lk_error('LINK_DOUBLE_COUNT',apply_guarantee_risk(r,guarantor,a,'c',lc,.02))
> # Exact Frechet boundary: a certain borrower event intersects the guarantor event.
> for(qb in c(.1,.2,.7)){
+ cb<-child;cb$pd<-1;gb<-guarantor;gb$pd<-qb
+ rb<-apply_guarantee_risk(cb,gb,a,'c',lc,qb)$value
+ stopifnot(rb$pd==1);lk_near(rb$expected_loss_after,20*(1-qb)+100*qb)
+ lk_error('INVALID_JOINT_PROBABILITY',apply_guarantee_risk(cb,gb,a,'c',lc,qb-1e-7))
+ lk_error('INVALID_JOINT_PROBABILITY',apply_guarantee_risk(cb,gb,a,'c',lc,qb+1e-7))
+ }
Error: Borrower/guarantor intersection outside Frechet bounds
Execution halted
- checking PDF version of manual ... [6s/6s] OK
- DONE
Status: 1 ERROR