Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install hiyenwong-ai-collection-collection-skills-cognitive-flexibility-bayesian-estimationgit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-cognitive-flexibility-bayesian-estimation/SKILL.md---
name: cognitive-flexibility-bayesian-estimation
description: Cognitive Flexibility as a Latent Structural Operator for Bayesian State Estimation. Novel framework for deep stochastic state-space models that enables online structure selection via innovation-based predictive score. Addresses structural mismatch in nonlinear partially observed systems. Use for: (1) Bayesian filtering with structural adaptation, (2) online latent structure selection, (3) belief-structure recursion, (4) nonlinear state estimation with model mismatch.
---
# Cognitive Flexibility for Bayesian State Estimation
## Overview
Traditional deep stochastic state-space models assume a fixed latent structure for Bayesian filtering. When this assumption is violated (structural mismatch), parameter adaptation alone leads to persistent belief inconsistency.
**Cognitive Flexibility (CF)** is introduced as a representation-level operator that selects latent structures online via an innovation-based predictive score, while preserving the Bayesian filtering recursion.
## Key Concepts
### Structural Mismatch
- **Problem**: Fixed latent structure assumption violated → parameter adaptation insufficient
- **Manifestation**: Irreducible predictive inconsistency under fixed structure
- **Solution**: Online structure selection via CF operator
### Cognitive Flexibility Operator
**Definition**: CF selects among candidate latent structures based on:
- Innovation-based predictive score
- Bayesian filtering recursion preservation
- Structural descent property
**Properties**:
1. **Well-posed**: Belief-structure recursion properly defined
2. **Structural descent**: CF improves predictive consistency
3. **Finite switching**: Eventual convergence to best structure
4. **Reduction**: Standard Bayesian filtering when model correctly specified
### Mathematical Framework
**Belief-Structure Recursion**:
```
Belief_t = CF(Belief_{t-1}, Observation_t, Structure_candidates)
```
**Innovation-Based Predictive Score**:
```
Score(S) = E[||observation - prediction||^2 | structure S]
```
**Structure Selection**:
```
S_t = argmin_S Score(S) subject to structural descent property
```
## Applications
### 1. Latent Dynamics Mismatch
When the true latent dynamics differ from assumed structure:
- CF identifies structural mismatch via predictive inconsistency
- Switches to better-fitting structure online
- Maintains belief consistency
### 2. Observation Structure Shifts
When observation model changes over time:
- CF detects shift via innovation score increase
- Adapts observation structure accordingly
- Preserves filtering performance
### 3. Well-Specified Regime
When model is correctly specified:
- CF remains non-intrusive
- Reduces to standard Bayesian filtering
- No unnecessary structure switching
## Implementation Guidelines
### Structure Candidates
Define multiple latent structure hypotheses:
- Different latent dimensions
- Various observation mappings
- Alternative dynamics models
### Score Computation
1. Compute innovations for each structure
2. Calculate predictive score (MSE, likelihood, etc.)
3. Rank structures by score
### Structure Switching
Switch structure when:
- Current structure score exceeds threshold
- New structure offers significant improvement
- Structural descent property satisfied
## Advantages
1. **Adaptive**: Online structure selection without offline training
2. **Consistent**: Preserves Bayesian filtering properties
3. **Robust**: Handles structural mismatch gracefully
4. **Efficient**: Finite switching, eventual convergence
## References
- Paper: "Cognitive Flexibility as a Latent Structural Operator for Bayesian State Estimation" (arxiv:2604.08130)
- Authors: Thanana Nuchkrua, Sudchai Boonto, Xiaoqi Liu
- PDF: ~/.openclaw/workspace/papers/cognitive-flexibility-bayesian-estimation.pdf
## Related Skills
- `data-driven-mhe-sample-complexity`: Data-driven estimation with sample analysis
- `safe-rl-forward-invariant`: Forward invariance for safe learning
- `resilience-dynamics-cpsos`: Dynamical resilience analysis
## Description
This skill provides specialized capabilities for its domain.
## Activation Keywords
- keyword1
- keyword2
- keyword3
## Tools Used
- read: Read files
- write: Write files
- exec: Execute commands
## Instructions for Agents
When this skill is activated:
1. Identify the user's specific need
2. Apply the specialized knowledge
3. Provide clear guidance
## Examples
```
User: How do I use this skill?
Agent: I'll help you with this skill...
```