Honey, R. C., Dwyer, D. M., & Iliescu, A. F. (2020).
diff --git a/articles/using_time_models.html b/articles/using_time_models.html
index 3d6efa4..85e5931 100644
--- a/articles/using_time_models.html
+++ b/articles/using_time_models.html
@@ -33,7 +33,7 @@
calmr
-
0.6.2
+
0.6.3
@@ -238,14 +238,14 @@ Specifying a design for time-
#> 6 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 T 6.5 1
#> 7 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 US 7.5 1
#> 8 ANCCR FP phase1 2 T FALSE 2 4 T 9.0 1
-#> 9 ANCCR FP phase1 2 T FALSE 2 5 T 10.5 1
-#> 10 ANCCR FP phase1 1 F>T>(US) FALSE 2 6 F 12.0 1
-#> 11 ANCCR FP phase1 1 F>T>(US) FALSE 2 6 T 13.0 1
-#> 12 ANCCR FP phase1 1 F>T>(US) FALSE 2 6 US 14.0 1
-#> 13 ANCCR FP phase1 1 F>T>(US) FALSE 2 7 F 15.5 1
-#> 14 ANCCR FP phase1 1 F>T>(US) FALSE 2 7 T 16.5 1
-#> 15 ANCCR FP phase1 1 F>T>(US) FALSE 2 7 US 17.5 1
-#> 16 ANCCR FP phase1 2 T FALSE 2 8 T 19.0 1
+#> 9 ANCCR FP phase1 1 F>T>(US) FALSE 2 5 F 10.5 1
+#> 10 ANCCR FP phase1 1 F>T>(US) FALSE 2 5 T 11.5 1
+#> 11 ANCCR FP phase1 1 F>T>(US) FALSE 2 5 US 12.5 1
+#> 12 ANCCR FP phase1 2 T FALSE 2 6 T 14.0 1
+#> 13 ANCCR FP phase1 2 T FALSE 2 7 T 15.5 1
+#> 14 ANCCR FP phase1 1 F>T>(US) FALSE 2 8 F 17.0 1
+#> 15 ANCCR FP phase1 1 F>T>(US) FALSE 2 8 T 18.0 1
+#> 16 ANCCR FP phase1 1 F>T>(US) FALSE 2 8 US 19.0 1
#> 17 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 F 20.5 1
#> 18 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 T 21.5 1
#> 19 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 US 22.5 1
diff --git a/articles/using_time_models_files/figure-html/unnamed-chunk-6-1.png b/articles/using_time_models_files/figure-html/unnamed-chunk-6-1.png
index b4122f9..623847f 100644
Binary files a/articles/using_time_models_files/figure-html/unnamed-chunk-6-1.png and b/articles/using_time_models_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/using_time_models_files/figure-html/unnamed-chunk-6-2.png b/articles/using_time_models_files/figure-html/unnamed-chunk-6-2.png
index 8ac650c..a7240c6 100644
Binary files a/articles/using_time_models_files/figure-html/unnamed-chunk-6-2.png and b/articles/using_time_models_files/figure-html/unnamed-chunk-6-2.png differ
diff --git a/articles/using_time_models_files/figure-html/unnamed-chunk-6-3.png b/articles/using_time_models_files/figure-html/unnamed-chunk-6-3.png
index 9697425..2487acb 100644
Binary files a/articles/using_time_models_files/figure-html/unnamed-chunk-6-3.png and b/articles/using_time_models_files/figure-html/unnamed-chunk-6-3.png differ
diff --git a/authors.html b/authors.html
index b4abd14..1b150c4 100644
--- a/authors.html
+++ b/authors.html
@@ -10,7 +10,7 @@
calmr
- 0.6.2
+ 0.6.3
@@ -79,14 +79,14 @@ Citation
Navarro V (2024).
calmr: Canonical Associative Learning Models and their Representations .
-R package version 0.6.2,
+R package version 0.6.3,
https://victornavarro.org/calmr/, https://github.com/victor-navarro/calmr .
@Manual{,
title = {calmr: Canonical Associative Learning Models and their Representations},
author = {Victor Navarro},
year = {2024},
- note = {R package version 0.6.2,
+ note = {R package version 0.6.3,
https://victornavarro.org/calmr/},
url = {https://github.com/victor-navarro/calmr},
}
diff --git a/index.html b/index.html
index 7addefe..c070be5 100644
--- a/index.html
+++ b/index.html
@@ -39,7 +39,7 @@
calmr
- 0.6.2
+ 0.6.3
diff --git a/news/index.html b/news/index.html
index 324ef4e..e20ce1d 100644
--- a/news/index.html
+++ b/news/index.html
@@ -10,7 +10,7 @@
calmr
- 0.6.2
+ 0.6.3
@@ -65,6 +65,10 @@
Source: NEWS.md
diff --git a/reference/run_experiment.html b/reference/run_experiment.html
index 61ef643..ee26f1b 100644
--- a/reference/run_experiment.html
+++ b/reference/run_experiment.html
@@ -10,7 +10,7 @@
calmr
-
0.6.2
+
0.6.3
diff --git a/reference/set_calmr_palette.html b/reference/set_calmr_palette.html
new file mode 100644
index 0000000..fbe559a
--- /dev/null
+++ b/reference/set_calmr_palette.html
@@ -0,0 +1,116 @@
+
+Get/set the colour/fill palette for plots — set_calmr_palette • calmr
+ Skip to contents
+
+
+
+
+
calmr
+
+
0.6.3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Get/set the colour/fill palette for plots
+
+
+
+
Usage
+
set_calmr_palette ( palette = NULL )
+
+
+
+
Arguments
+
palette
+A string specifying the available palettes.
+If NULL, returns available palettes.
+
+
+
+
Value
+
+
+
The old palette (invisibly) if palette is not NULL.
+Otherwise, a character vector of available palettes.
+
+
+
Note
+
Changes here do not affect the palette used in graphs.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/set_reward_parameters.html b/reference/set_reward_parameters.html
index a5295a4..0988a4b 100644
--- a/reference/set_reward_parameters.html
+++ b/reference/set_reward_parameters.html
@@ -10,7 +10,7 @@
calmr
- 0.6.2
+ 0.6.3
diff --git a/search.json b/search.json
index 5409ec7..2cb2485 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://victornavarro.org/calmr/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc. Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use “box”. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. information , apply follow GNU GPL, see . GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read .","code":" Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"the-mathematics-behind-anccr","dir":"Articles","previous_headings":"","what":"The mathematics behind ANCCR","title":"ANCCR","text":"ANCCR (Jeong et al., 2022) model, stands adjusted net contingency causal relations, proposes mesolimbic dopaminergic conveys adjusted net contingency causal relationships (biologically meaningful targets). mathematics (logic) behind model go well beyond can cover , now, suffice say model: Uses “Hebbian” mechanism learn retrospective associations experiencing meaningful causal target. Derives prospective associations using Bayes’s rule. Combines associations contingency terms represent dopaminergic activity. Uses sign dopaminergic activity strengthen weaken causal weights. Responds function prospective associations causal links.","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"maintaining-stimulus-representations","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"1 - Maintaining stimulus representations","title":"ANCCR","text":"degree stimulus \\(\\) time \\(t\\) “active” memory denoted : \\[ \\tag{Eq.1} E_i(t) = \\Sigma_{t_i \\leq t}e^{-(\\frac{t-t_i}{t\\_constant})} \\] \\(t_i\\) time steps time \\(t\\), \\(t\\_constant\\) time constant (usually meant inter-reward rate)1","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"learning-stimulus-associations","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"2 - Learning stimulus associations:","title":"ANCCR","text":"model learns retrospective associations meaningful causal targets occur. Whether event \\(j\\) meaningful causal target given : \\[ \\tag{Eq.2} \\Phi_j = \\begin{cases} 1,& \\text{} \\Phi_j(t) = 1\\\\ 1,& \\text{}DA_j + \\beta_j > \\theta\\\\ 0,& \\text{otherwise} \\end{cases} \\] \\(\\Phi\\) plays role indicator function, \\(DA_j\\) total dopamine activity time event \\(j\\), \\(\\beta_j\\) unconditioned value event \\(j\\) \\(\\theta\\) global threshold parameter.2 Note indicator function self-preserving: stimulus becomes meaningful causal target, stop . stimulus \\(j\\) observed, predecessor representation contingency, PRC, stimulus \\(\\) updated via: \\[ \\tag{Eq.3} PRC_{\\leftarrow j} = M_{\\leftarrow j} - M_{} \\] \\(M_{\\leftarrow j}\\) predecessor representation \\(\\) given \\(j\\) occurred, \\(M_{}\\) base rate \\(\\) occurs. quantities given : \\[ \\tag{Eq.4a} M_{\\leftarrow j} = M_{\\leftarrow j}' + \\Phi_j\\alpha(E_{\\leftarrow j} - M_{\\leftarrow j}') \\] \\[ \\tag{Eq.4b} M_{} = M_{}' + k\\alpha(E_{} - M_{}') \\] \\(M_{\\leftarrow j}'\\) \\(M_{}'\\) quantities \\(j\\) observed, \\(k\\) \\(\\alpha\\) learning rate parameters, \\(E_{\\leftarrow j}\\) elegibility trace stimulus \\(\\) time \\(j\\) occurs (see Eq. 1). , PRC can used derive prospective association, aptly named successor representation contingency, SRC via Bayes rule: \\[ \\tag{Eq.5} SRC_{\\rightarrow j} = PRC_{\\leftarrow j} \\frac{M_j}{M_i} \\] base rate \\(j\\), \\(M_j\\) calculated via Eq.4b.","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"releasing-dopamine","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"3 - Releasing Dopamine","title":"ANCCR","text":"model postulates dopaminergic signaling encodes adjusted net contingencies causal relations stimuli, ANCCRs. total dopaminergic activity time event \\(\\) equal : \\[ \\tag{Eq.6} DA_i = \\Sigma_j (ANCCR_{\\rightarrow j}\\Phi_j) \\] ANCCR stimulus \\(\\) stimulus \\(j\\) given : \\[ \\tag{Eq.7} ANCCR_{\\rightarrow j} = NC_{\\leftrightarrow j} CW_{\\rightarrow j} - \\sum_{k \\neq }(ANCCR_{k \\leftrightarrow j}\\Delta_{k \\leftarrow }\\Phi_{k \\leftrightarrow }) \\] \\(NC_{\\leftrightarrow j}\\) net contingency stimuli \\(\\) \\(j\\), \\(CW_{\\rightarrow j}\\) causal weight \\(\\) \\(j\\), \\(\\Delta_{k \\leftarrow }\\) recency stimulus \\(k\\) respect stimulus \\(\\), \\(\\Phi_{k \\leftrightarrow }\\) indicator function denoting whether \\(k\\) \\(\\) putative causal relationship . net contingency stimuli \\(\\) \\(j\\), \\(NC_{\\leftrightarrow j}\\), given : \\[ \\tag{Eq.8} NC_{\\leftrightarrow j} = wSRC_{\\rightarrow j} + (1-w)PRC_{\\leftarrow j} \\] weighted sum successor predecessor representation contingencies. net contingency used calculate indicator function , : \\[ \\tag{Eq.9} \\Phi_{k \\leftrightarrow } = \\begin{cases} 1,& \\text{} NC_{\\leftrightarrow j} > \\theta\\\\ 0,& \\text{otherwise} \\end{cases} \\] \\(\\theta\\) threshold parameter used Eq.23, indicator function stimulus , \\(\\Phi_{\\leftrightarrow }\\), 0. recency term, \\(\\Delta_{k \\leftarrow }\\), given : \\[ \\tag{Eq.10} \\Delta_{k \\leftarrow } = e^{-(\\frac{t_j-t_i}{t\\_constant})} \\] \\(t\\_constant\\) parameter used Eq.1. Note however Eq.9 include sum term Eq. 1. Finally, causal weight stimulus \\(\\) stimulus \\(j\\) given : \\[ \\tag{Eq.11} CW_{\\rightarrow j} = CW_{\\rightarrow j}' + \\alpha_{reward}\\delta_{\\rightarrow j} \\] \\(CW_{\\rightarrow j}'\\) previous causal weight, \\(\\alpha_{reward}\\) learning rate parameter exclusive causal weights, \\(\\delta_{\\rightarrow j}\\) delta term depending sign total dopaminergic activity, given : \\[ \\tag{Eq.12} \\delta_{\\rightarrow j} = \\begin{cases} CW_{j \\rightarrow j} - CW_{\\rightarrow j}, & \\text{} DA_j \\ge 0\\\\ (0-CW_{\\rightarrow j})\\frac{n_i^{-1}\\Delta{\\leftarrow j} \\Phi_{\\leftrightarrow j}}{\\Sigma_{k \\neq j}(n_k^{-1}\\Delta_{k \\leftarrow j} \\Phi_{k \\leftrightarrow j})},& \\text{otherwise} \\end{cases} \\] \\(CW_{j \\rightarrow j}\\) reward magnitude stimulus \\(j\\). plain words, dopaminergic activity positive, causal weights (present absent stimuli) strengthen. Conversely, dopaminergic activity negative, causal weights (present absent stimuli) weaken, proportional normalized frequency recency (long putative causal relations \\(j\\)).","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"4 - Generating responses","title":"ANCCR","text":"Responding ANCCR lightly specified. value responding upon presentation stimulus \\(\\) given : \\[ \\tag{Eq.13} Q_i = \\Sigma_k(SRC_{\\rightarrow k} CW_{\\rightarrow k}) \\] can mapped onto probabilities via softmax function4.","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"a-diagram","dir":"Articles","previous_headings":"The mathematics behind ANCCR > 4 - Generating responses","what":"A diagram","title":"ANCCR","text":"diagram shows dependencies model. excluding indicator functions parameters simplicity.5","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"note","dir":"Articles","previous_headings":"The mathematics behind ANCCR > 4 - Generating responses","what":"Note","title":"ANCCR","text":"implementation model port MATLAB code Jeong et al. shared GitHub repository associated paper. output R model checked outputs MATLAB model, using training routines (“eventlogs” parlance) generated using MATLAB code. training routines generated calmr differ somewhat, accommodate generality. example, version 0.6.1, possible specify probabilistic relations cues rewards. Instead, left user specify exact probability via trial numbers (e.g., 80% reward probability can specified “80A>(US)/20A”). naming parameters also differs codebases.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"the-mathematics-behind-heidi","dir":"Articles","previous_headings":"","what":"The mathematics behind HeiDI","title":"HD2022","text":"HeiDI model four major components: 1) acquisition reciprocal associations stimuli, 2) pooling associations stimulus activations, 3) distribution activations stimulus-specific response units, 4) generation responses.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"acquiring-reciprocal-associations","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"1 - Acquiring reciprocal associations","title":"HD2022","text":"Whenever trial given, HeiDI learns associations among stimuli. association two stimuli, \\(\\) \\(j\\) denoted via \\(v_{,j}\\). association \\(v_{,j}\\) represents directional expectation: expectation \\(j\\) presented \\(\\). Furthermore, value represents nature effect \\(\\) representation \\(j\\). positive, presentation \\(\\) “excites” representation \\(j\\). negative, presentation \\(\\) “inhibits” representation \\(j\\). HeiDI learns “forward” associations stimuli, also reciprocal, “backward” associations. Thus, organisms presented \\(\\rightarrow j\\), organisms learn \\(v_{,j}\\), also \\(v_{j, }\\), expectation receiving \\(\\) presented \\(j\\). Note , sake brevity, learning equations specified forward associations.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"the-stimulus-expectation-rule","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 1 - Acquiring reciprocal associations","what":"1.1 - The stimulus expectation rule","title":"HD2022","text":"HeiDI generates expectations stimuli. expectation stimulus \\(j\\) (\\(e_j\\)) expressed \\[ \\tag{Eq. 1} e_j = \\sum_{k}^{K}x_kv_{k,j} \\] \\(K\\) set containing stimuli experiment, \\(x_k\\) quantity denoting presence absence stimulus \\(k\\) (1 0, respectively)1.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"learning-rule","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 1 - Acquiring reciprocal associations","what":"1.2 - Learning rule","title":"HD2022","text":"HeiDI learns appropriate expectations via error-correction mechanisms. trial \\(t\\), association stimuli \\(\\) \\(j\\) expressed \\[ \\tag{Eq. 2} v_{,j, t} = v_{,j, t-1} + \\Delta v_{,j, t} \\] \\(v_{j,, t-1}\\) forward association \\(\\) \\(j\\) trial \\(t-1\\), \\(\\Delta v_{,j, t}\\) change association result trial \\(t\\). delta term uses pooled error term expressed \\[ \\tag{Eq. 3} \\Delta v_{,j} = x_i\\alpha_i(x_jc\\alpha_j - e_j) \\] \\(\\alpha_i\\) \\(\\alpha_j\\) parameters representing salience stimuli \\(\\) \\(j\\), respectively (\\(0 \\le \\alpha \\le 1\\)), \\(c\\) scaling constant (\\(c = 1\\)). Note term denoting trial, \\(t\\) omitted simplicity.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"pooling-the-strength-of-associations","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"2 - Pooling the strength of associations","title":"HD2022","text":"HeiDI pools stimulus associations activate stimulus-specific representations. activation representation stimulus \\(j\\), \\(a_j\\), defined : \\[ \\tag{Eq. 4} a_{j,M} = o_{j,M} + h_{j,M} \\] \\(o_{j,M}\\) denotes combined associative strength towards stimulus \\(j\\) presence stimuli \\(M\\), \\(h_{j,M}\\) denotes chained associative strength towards stimulus \\(j\\) presence stimuli \\(M\\).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"combined-associative-strength","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 2 - Pooling the strength of associations","what":"2.1 - Combined associative strength","title":"HD2022","text":"quantity \\(o_{j,M}\\) result combining associative strength forward backward associations stimulus \\(j\\) \\[ \\tag{Eq. 5} o_{j,M} = \\sum_{m \\neq j}^{M}v_{m,j} + \\left(\\frac{\\sum_{m \\neq j}^{M}v_{m,j} \\sum_{m \\neq j}^{M}v_{j,m}}{c}\\right) \\] sums run stimuli \\(M\\) presented trial, different stimulus \\(j\\).2 left-hand term describes forward associations stimuli \\(M\\) \\(j\\) affect representation \\(j\\), whereas right-hand term describes backward associations \\(j\\) stimuli \\(M\\) affect representation (although modulated forward associations ).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"chained-associative-strength","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 2 - Pooling the strength of associations","what":"2.2 - Chained associative strength","title":"HD2022","text":"quantity \\(h_{j,M}\\) captures indirect associative strength stimuli \\(M\\) \\(j\\), via absent stimuli. , \\(h_{j,M}\\) defined \\[ \\tag{Eq. 6a} h_{j,M} = \\sum_{m \\neq j}^{M} \\sum_{n}^{N}\\frac{v_{m,n}o_{j,n}}{c} \\] N stimuli presented trial (.e., K-M). Note re-use \\(o\\), quantity defined Eq. 5. equation allows absent stimuli \\(N\\) influence representation stimulus \\(j\\), long association present stimuli \\(M\\). Honey Dwyer (2022), authors specify similarity-based mechanism modulates effect associative chains according similarity salience nominal retrieved stimuli3. , Eq. 6a expanded : \\[ \\tag{Eq. 6b} h_{j,M} = \\sum_{m \\neq j}^{M} \\sum_{n}^{N}S(\\alpha_{n}, \\alpha'_n)\\frac{v_{m,n}o_{j,n}}{c} \\] \\(S\\) similarity function takes nominal salience stimulus n, \\(\\alpha_n\\) (perceived \\(n\\) presented trial) retrieved salience, \\(\\alpha'_n\\) (perceived \\(n\\) retrieved via stimuli M, see ahead). function defined : \\[ \\tag{Eq. 7} S(\\alpha_n, \\alpha'_n) = \\frac{\\alpha_n}{\\alpha_n + |\\alpha_n-\\alpha'_n|} \\times \\frac{\\alpha'_n}{\\alpha'_n+ |\\alpha_n-\\alpha'_n|} \\] Notably, whenever one nominal salience given stimulus, \\(\\alpha_n\\) arithmetic mean among nominal values (see “heidi_similarity” vignette).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"distributing-strength-into-stimulus-specific-response-units","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"3 - Distributing strength into stimulus-specific response units","title":"HD2022","text":"HeiDI distributes pooled stimulus-specific strength among \\(K\\) stimuli, according relative salience. activation response unit \\(j\\), \\(R_j\\) expressed \\[ \\tag{Eq. 8} R_{j,k} = \\frac{\\theta(j)}{\\sum_{k}^{K}\\theta(k)}a_{k,M} \\] \\(j \\K\\). \\(K\\) can include present absent stimuli, \\(\\theta\\) function depends whether stimulus \\(k\\) absent (.e., \\(k \\N\\)) (.e., \\(k \\M\\)), : \\[ \\tag{Eq. 9} \\theta(k) = \\begin{cases} \\left |\\sum_{m}^{M}\\left( v_{m,k}+\\sum_{n \\neq k}^{N}\\frac{v_{m,n}v_{n,k}}{c}\\right) \\right|,& \\text{} k \\N\\\\ \\alpha_k, & \\text{otherwise} \\end{cases} \\] Note quantity absent stimuli absolute, prevent negative \\(\\theta\\) values due inhibitory associations4. Also, note summation term used left-hand side expression absent stimulus. implies present stimuli \\(M\\) contribute salience stimulus \\(k\\). Finally, note right-hand side expression present stimuli contribute via direct association \\(k\\), \\(v_{m,k}\\) also associative chains absent stimuli (c.f., Eq. 6a).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"4 - Generating responses","title":"HD2022","text":"Finally, HeiDI responds. response-generating mechanisms HeiDI currently underspecified. current version, HeiDI’s responses product activation stimulus-specific response units connection units specific motor units. , activation motor unit \\(q\\), \\(r_q\\), given \\[ \\tag{Eq. 10} r_q = R_jw_{j,q} \\] \\(w_{j,q}\\) weight representing association stimulus-specific unit \\(j\\) motor unit \\(q\\).","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"the-mathematics-behind-mac1975","dir":"Articles","previous_headings":"","what":"The mathematics behind MAC1975","title":"MAC1975","text":"grand departure global error term models RW1972 (Rescorla & Wagner, 1972), MAC1975 model (Mackintosh, 1975) uses local error terms changes stimulus associability (\\(\\alpha\\)) via error comparison mechanism promotes learning uncertain stimuli:","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"generating-expectations","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"1 - Generating expectations","title":"MAC1975","text":"Let \\(v_{k,j}\\) denote associative strength stimulus \\(k\\) stimulus \\(j\\). given trial, expectation stimulus \\(j\\), \\(e_j\\), given : \\[ \\tag{Eq.1} e_j = \\sum_{k}^{K}x_k v_{k,j} \\] \\(x_k\\) denotes presence (1) absence (0) stimulus \\(k\\), set \\(K\\) represents stimuli design.","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"2 - Learning associations","title":"MAC1975","text":"Changes association stimulus \\(\\) \\(j\\), \\(v_{,j}\\), given : \\[ \\tag{Eq.2} \\Delta v_{,j} = x_i \\alpha_i \\beta_j (\\lambda_j - v_{,j}) \\] \\(\\alpha_i\\) associability (attention devoted ) stimulus \\(\\), \\(\\beta_j\\) learning rate parameter determined properties \\(j\\), \\(\\lambda_j\\) maximum association strength supported \\(j\\) (asymptote).","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"learning-to-attend","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"3 - Learning to attend","title":"MAC1975","text":"parameter \\(\\alpha_i\\) changes function learning, proportionally difference absolute errors conveyed \\(\\) predictors1, via: \\[ \\tag{Eq.3} \\Delta \\alpha_{} = x_i\\theta_i \\sum_{j}^{K}\\gamma_j(|\\lambda_j - \\sum_{k \\ne }^{K}v_{k,j}|-|\\lambda_j - v_{,j}|) \\] \\(\\theta_i\\) attentional learning rate parameter stimulus \\(\\) (usually fixed across stimuli). Although Mackintosh (1975) extend model account predictive power within-compound associations, implementation model package . can sometimes result unexpected behavior, , Eq. 3 includes extra parameter \\(\\gamma_j\\) (defaulting 1/K) denotes whether expectation stimulus \\(j\\) contributes attentional learning. , user can set parameters manually reflect contribution different experimental stimuli. example, simple “AB>(US)” design, setting \\(\\gamma_{US}\\) = 1 \\(\\gamma_{} = \\gamma_{B} = 0\\) leads behavior original model.","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"4 - Generating responses","title":"MAC1975","text":"specification response-generating mechanisms MAC1975. However, simplest response function can adopted identity function stimulus expectations. , responses reflecting nature \\(j\\), \\(r_j\\), given : \\[ \\tag{Eq.4} r_j = e_j \\]","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"the-mathematics-behind-pkh1982","dir":"Articles","previous_headings":"","what":"The mathematics behind PKH1982","title":"PKH1982","text":"Another departure global error term models RW1972 (Rescorla & Wagner, 1972), PKH1982 model (Pearce et al., 1982) use error term learning excitatory associations (inhibitory associations), ties stimulus associability (\\(\\alpha\\)) absolute global prediction error. note: implementation model closely follows technical note CAL-R group possible. Divergences noted.","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"generating-expectations","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"1 - Generating expectations","title":"PKH1982","text":"Let \\(v_{k,j}\\) denote excitatory strength stimulus \\(k\\) stimulus \\(j\\), \\(v_{k,\\overline j}\\) inhibitory strength stimulus \\(k\\) stimulus \\(j\\) (effectively, “j” representation). given trial, net expectation stimulus \\(j\\), \\(e_j\\), given : \\[ \\tag{Eq.1} e_j = \\sum_{k}^{K}x_k v_{k,j} - \\sum_{k}^{K}x_k v_{k,\\overline j} \\] \\(x_k\\) denotes presence (1) absence (0) stimulus \\(k\\), set \\(K\\) represents stimuli design.","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"2 - Learning associations","title":"PKH1982","text":"Changes excitatory inhibitory associations stimuli given : \\[ \\tag{Eq.2a} \\Delta v_{,j} = \\delta_jx_i \\beta_{ex,j} \\alpha_i \\lambda_j \\] \\[ \\tag{Eq.2b} \\Delta v_{,\\overline j} = x_i \\beta_{,j} \\alpha_i |\\overline{\\lambda_j}| \\] \\(\\beta_{ex,j}\\) \\(\\beta_{,j}\\) represent learning rates excitatory inhibitory associations, respectively, determined stimulus \\(j\\), \\(\\alpha_i\\) associability stimulus \\(\\), respectively, \\(\\lambda_j\\) \\(\\overline {\\lambda_j}\\) excitatory asymptote overexpectation stimulus \\(j\\), respectively. Importantly, \\(\\delta_j\\) Eq.2a parameter equal 1 expectation stimulus \\(j\\), lower excitatory asymptote (.e., \\(e_j < \\lambda_j\\)), 0 . implies model stops strengthening \\(v_{,j}\\) expectation \\(j\\) higher excitatory asymptote. mentioned introductory note, PKH1982 model learn excitatory associations via correction error. However, model learn inhibitory associations via correction error, overexpectation term , \\(\\overline {\\lambda_j}\\) equal \\(min(\\lambda_j - e_j, 0)\\), \\(min\\) minimum function. implies \\(\\overline {\\lambda_j}\\) takes non-zero values expectation \\(j\\) higher intensity trial (\\(\\lambda_j\\)).","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"learning-to-attend","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"3 - Learning to attend","title":"PKH1982","text":"associability parameter \\(\\alpha_i\\) changes completely trial trial function learning (note lack \\(\\Delta\\) ), change equal difference absolute global error, via: \\[ \\tag{Eq.3} \\Delta \\alpha_{} = x_i \\sum_{j}^{K}\\gamma_j(|\\lambda_j - e_j|) \\] \\(\\gamma_j\\) denotes contribution prediction error based jth stimulus. regard, important note Pearce et al. (1982) extend model account predictive power within-compound associations, yet implementation model package . can sometimes result unexpected behaviour, , Eq. 3 includes extra parameter \\(\\gamma_j\\) (defaulting 1/K) denotes whether expectation stimulus \\(j\\) contributes attentional learning. , user can set parameters manually reflect contribution different experimental stimuli. example, simple “AB>(US)” design, setting \\(\\gamma_{US}\\) = 1 \\(\\gamma_{} = \\gamma_{B} = 0\\) leads behavior original model. PKH1982 model improves upon Pearce & Hall (1980) model adding extra parameter controls rate associability changes. qualify changes associability determined Eq.3 via \\(\\Delta\\alpha_{}^{n}\\) (meaning happened trial \\(n\\)), can quantify total associability stimulus \\(\\) trial \\(n\\) via: \\[ \\tag{Eq.4} \\alpha_{}^{n} = \\begin{cases} (1-\\theta_i) \\alpha_{}^{n-1} + \\theta_i\\Delta\\alpha_{j}^n &\\text{, } x_i = 1\\\\ \\alpha_{}^{n} & \\text{, otherwise} \\end{cases} \\] \\(\\theta_i\\) parameter determining rate associability decays (via \\(1-\\theta_i\\)), rate increments attention occur. Note changes associability apply stimuli presented trial (.e., \\(x_i = 1\\)); attention absent stimuli remains unchanged.","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"4 - Generating responses","title":"PKH1982","text":"specification response-generating mechanisms PKH1982. However, simplest response function can adopted identity function stimulus expectations. , responses reflecting nature \\(j\\), \\(r_j\\), given : \\[ \\tag{Eq.5} r_j = e_j \\]","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/RAND.html","id":"the-mathematics-behind-rand","dir":"Articles","previous_headings":"","what":"The mathematics behind RAND","title":"RAND","text":"RAND model RW-based model associations randomized every trial. Therefore, model responds randomly. model meant comparisons .","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"the-mathematics-behind-rw1972","dir":"Articles","previous_headings":"","what":"The mathematics behind RW1972","title":"RW1972","text":"influential associative learning model, RW1972 (Rescorla & Wagner, 1972), learns global error posits changes stimulus associability.","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"generating-expectations","dir":"Articles","previous_headings":"The mathematics behind RW1972","what":"1 - Generating expectations","title":"RW1972","text":"Let \\(v_{k,j}\\) denote associative strength stimulus \\(k\\) stimulus \\(j\\). given trial, expectation stimulus \\(j\\), \\(e_j\\), given : \\[ \\tag{Eq.1} e_j = \\sum_{k}^{K}x_k v_{k,j} \\] \\(x_k\\) denotes presence (1) absence (0) stimulus \\(k\\), set \\(K\\) represents stimuli design.","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind RW1972","what":"2 - Learning associations","title":"RW1972","text":"Changes association stimulus \\(\\) \\(j\\), \\(v_{,j}\\), given : \\[ \\tag{Eq.2} \\Delta v_{,j} = \\alpha_i \\beta_j (\\lambda_j - e_j) \\] \\(\\alpha_i\\) associability stimulus \\(\\), \\(\\beta_j\\) learning rate parameter determined properties \\(j\\)1, \\(\\lambda_j\\) maximum association strength supported \\(j\\) (asymptote).","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind RW1972","what":"3 - Generating responses","title":"RW1972","text":"specification response-generating mechanisms RW1972. However, simplest response function can adopted identity function stimulus expectations. , responses reflecting nature \\(j\\), \\(r_j\\), given : \\[ \\tag{Eq.3} r_j = e_j \\]","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"the-mathematics-behind-socr","dir":"Articles","previous_headings":"","what":"The mathematics behind SOCR","title":"SM2007","text":"first formalization comparator hypothesis (Miller & Matzel, 1988), sometimes competing retrieval model (SOCR; Stout & Miller, 2007) learns local error responds function relative associative strength present retrieved stimuli.","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"1 - Learning associations","title":"SM2007","text":"SOCR model uses two different learning equations strengthening weakening associations. Whenever two stimuli contiguous, strengthening occurs. case, strengthening association stimulus \\(\\) \\(j\\) trial \\(t\\), \\(v_{,j}^t\\) given : \\[ \\tag{Eq.1a} \\Delta v_{,j}^t = x^t_i \\alpha_i \\alpha_j (\\lambda_j - v_{,j}^{t-1}) \\] \\(x^t_i\\) denotes presence (1) absence (0) stimulus \\(\\) trial \\(t\\). , SOCR model learns stimuli presented. parameters \\(\\alpha_i\\) \\(\\alpha_j\\) saliencies stimuli j, respectively, \\(\\lambda_j\\) maximum association strength supported \\(j\\) (asymptote). Whenever stimulus \\(\\) presented alone (.e., stimulus \\(j\\) absent), weakening association given : \\[ \\tag{Eq.1b} \\Delta v_{,j}^t = x_i \\alpha_i \\times -\\omega_j v_{,j}^{t-1} \\] \\(\\omega_j\\) determines weakening rate stimulus \\(j\\).1","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"activating-stimuli","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"2 - Activating stimuli","title":"SM2007","text":"SOCR posits competition stimuli presented /associatively retrieved. Dropping trial notation sake simplicity, degree stimulus \\(\\) activates stimulus \\(j\\), \\(act_{,j}\\), given : \\[ \\tag{Eq.2} act_{, j} = x_i v_{,j} + x_j\\rho_j\\alpha_j \\] \\(\\rho_j\\) (bound 0 +\\(\\infty\\)) determines much salience stimulus \\(j\\) contributes unconditioned activation. first-order activation values key quantities involved comparison processes.","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"generating-responses-and-comparison-processes","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"3 - Generating responses and comparison processes","title":"SM2007","text":"Stimulus \\(\\) generates j-oriented responding time retrieval function relative ability activate stimulus \\(j\\). relative ability expressed comparison process, given : \\[ \\tag{Eq.3} r^j_i = act_{,j} - \\Sigma_{k \\neq ,j} ^K \\gamma_k \\times o_{,k,j} \\times r^k_i \\times r^j_k \\] \\(r^j_i\\) relative activation stimulus \\(j\\) stimulus \\(\\), \\(K\\) set experimental stimuli including \\(\\) \\(j\\), \\(\\gamma_k\\) parameter determining degree stimulus \\(k\\), comparison stimulus, contributes comparison process (bound 0 1), \\(o_{,k,j}\\) operator switch determines whether \\(\\) \\(k\\) associations \\(j\\) engage facilitation competition. Finally, \\(r^k_i\\) relative activation stimulus \\(k\\) stimulus \\(\\), representing ability stimulus \\(\\) activate comparison, \\(r^j_k\\) relative activation stimulus \\(j\\) stimulus \\(k\\), representing ability comparison stimulus \\(k\\) activate stimulus \\(j\\).2 notably, last two quantities (\\(r^k_i\\) \\(r^j_k\\)) also determined corresponding instantiations Eq. 3. , involve comparison processes . number potential comparison processes technically infinite (comparison process can nest two extra comparison processes ), user must determine order model using extra global parameter (order). n-th order models (\\(n > 0\\)), model behave like extended comparator hypothesis (Denniston et al., 2001), implementing \\(n\\) comparison processes time relative activations calculated. order = 0, SM2007 behave like originally written consider one comparison process. Indeed, n-th order models accomplished via recursion using 0-th order model stopping condition. condition reached, \\(r^k_i\\) \\(r^j_k\\) terms Eq. 3 become \\(act_{,k}\\) \\(act_{k,j}\\), respectively.","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"switching-between-facilitation-and-competition","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"4 - Switching between facilitation and competition","title":"SM2007","text":"operator switch Eq. 3, \\(o_{,k,j}\\), changes subjects learn discriminate directly (via \\(\\)) indirectly activated (via \\(k\\)) representations stimulus \\(j\\). change quantity depends value \\(v_{,j}\\), follows: \\[ \\tag{Eq.4} \\Delta o_{,k,j} = \\begin{cases} \\tau_j\\alpha_iv_{,k}v_{k,j}(1-o_{,k,j}) &\\text{, } v_{,j} = 0\\\\ 1-o_{,k,j} & \\text{, otherwise} \\end{cases} \\] negative values \\(o\\) indicate facilitation positive values \\(o\\) indicate competition. default value operator switches outset training set -1 default. parameter \\(\\tau_j\\) specifies learning rate operator switches related stimulus \\(j\\).","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"using-the-calmr-app","dir":"Articles","previous_headings":"","what":"Using the calmr app","title":"calmr_app","text":"want deal programming side calmr simply want simulate experimental design see model , might interested using calmr application. calmr application offers GUI allows simulate experiments without writing code. want use online app, can find https://victor-navarro.shinyapps.io/calmr_app/. Alternatively, can install calmr.app companion package launch app via calmr.app::launch_app(). rest tutorial assumes app open ready run. Let’s break GUI.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"design-table","dir":"Articles","previous_headings":"The GUI","what":"Design Table","title":"calmr_app","text":"design table specify experimental design run. Using Group- Group+, can remove add groups design. Using Phase- Phase+, can remove add phases design. Parse Design button used parse design, required step run simulation. later. P1 P2 columns specify phases experiment simulated left right. entry columns specifies trials given corresponding groups (G1 G2, case). entries must obey special syntax (see calmr_basics additional information). now, suffice say : number trials specified via digits left trial. example, 10A(US) specifies ten “(US)” trials. Stimuli (elements) specified letters. example, 10AB(US) specifies elements B US. Named stimuli specified within parentheses. example, (US) implies element named “US” instead compound containing elements “U” “S”. Multiple trials per phase separated via forward slash (/). Additionally, one can choose randomize trials within phase ticking boxes R1 R2 columns. important note whatever set interact “Create trial blocks” option Options tab sidebar (see ahead). ’s full breakdown combinations behavior: Table checked preferences checked: Trials shuffled within blocks possible (based greater common factor). example, 2A/2B gets shuffled 2 blocks containing one one B trial, 2A/1B gets shuffled 1 block containing two trials one B trial. Table unchecked preferences checked: Trials deterministically intermixed within blocks possible. example, 2A/2B gets shuffled 2 blocks, resulting sequence ABAB. Table checked preferences unchecked: Trials shuffled completely random. Table unchecked preferences unchecked: Trials given order appearance. example, 2A/2B results AABB sequence. Go ahead parse design. new things appear GUI.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"parameters","dir":"Articles","previous_headings":"The GUI","what":"Parameters","title":"calmr_app","text":"parsing valid design, can set parameters experiment. number parameters change function model. case, Rescorla-Wagner model 4 parameters per stimulus. default values fairly sensible, can modify parameter hand favorite spreadsheet software. parameterization model calmr can sometimes differ appears literature. following table contains links documentation pages model (warning: equations).","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"results","dir":"Articles","previous_headings":"The GUI","what":"Results","title":"calmr_app","text":"new button appear parsing experiment. final click button run model populate “Results” “Association Graphs” portions app. Go ahead run experiment. new button allow download results spreadsheet. calmr app, results shown visually. Clicking bar graph (one containing “Blocking - Response Strength …” ) show plots available. first portion plot’s name denotes group’s name. , plot shows strength associations among stimuli experiment across trials (blocks), faceted phases columns, origin stimuli rows. example, yellow lines denote strength B US. top column corresponds (look label right) middle column corresponds B. Go ahead explore available plots. usually self-explanatory, consult documentation package case something unclear (especially using obscure models).","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"association-graphs","dir":"Articles","previous_headings":"The GUI","what":"Association Graphs","title":"calmr_app","text":"bottom portion app shows network graphs depicting strength associations model given trial, groups. Yellow denotes excitatory strength (.e., positive values), gray denotes neutral strength (.e., values close zero), purple (shown ) shows inhibitory strength (.e., negative values). Move “Trial” slider explore associations model change across experiment.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"other-bits","dir":"Articles","previous_headings":"The GUI","what":"Other bits","title":"calmr_app","text":"sections implement bulk functionalities calmr app. following sections describe additional options found useful.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"options","dir":"Articles","previous_headings":"The GUI > Other bits","what":"Options","title":"calmr_app","text":"set number iterations run experiment (important model behavior sensitive trial order effects), whether want create trial blocks. also set can choose plot common scale y-axis (active default).","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"a-final-message","dir":"Articles","previous_headings":"The GUI","what":"A final message","title":"calmr_app","text":"Hope enjoy app! find bugs, comments, like something implemented, feel free post message package’s Github repository drop line navarrov [] cardiff.ac.uk.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"your-first-simulation","dir":"Articles","previous_headings":"","what":"Your first simulation","title":"calmr_basics","text":"perform first simulation need: data.frame specifying experiment design, list parameters model using.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"the-design-data-frame","dir":"Articles","previous_headings":"","what":"The design data.frame","title":"calmr_basics","text":"Let’s specify blocking design. rules design data.frame: row represents group. first column contains group labels. remaining columns organized pairs (trials phase, whether randomize ) trials phase column specified using rigid notation. observations : Trials preceded number. number represents number times trial given phase. “10A(US)” means “(US)” trial given 10 times. presence absence unconditioned stimulus denoted traditional “+” “-” symbols. Instead, use parenthesis denote “complex” stimuli. can thought element complex name (.e., one character). , “(US)” specifies single element represent US. vein, multiple characters parentheses denote individual elements. example, “AB” implies presence two stimuli, B. “/” character used trial separator (imply randomization ). Thus, “1A/1B” specifies single “” trial single “B” trial given phase. Recall randomization trials within phase specified column (, R1, R2, R3). “#” character used denote probe trials. contrast real life, probe trials entail update model’s associations. , probe trials can used track development key associations, repercussion model learns normal training trials. want check whether phase string work package, can use phase_parser(). function returns list lot information, let’s print fields.","code":"library(calmr) my_blocking <- data.frame( Group = c(\"Exp\", \"Control\"), Phase1 = c(\"10A(US)\", \"10C(US)\"), R1 = c(FALSE, FALSE), Phase2 = c(\"10AB(US)\", \"10AB(US)\"), R2 = c(FALSE, FALSE), Test = c(\"1#A/1#B\", \"1#A/1#B\"), R3 = c(FALSE, FALSE) ) # parsing the design and showing the original and what was detected parsed <- parse_design(my_blocking) parsed # not specifying the number of AB trials. Error! phase_parser(\"AB/10AC\") #> Error in if (is.na(treps)) 1 else treps: argument is of length zero # putting the probe symbol out of order. Error! phase_parser(\"#10A\") #> Error in if (is.na(treps)) 1 else treps: argument is of length zero # considering a configural cue for elements AB trial <- phase_parser(\"10AB(AB)(US)\") # different USs trial <- phase_parser(\"10A(US1)/10B(US2)\") # tons of information! Phase parser is meant for internal use only. # you are better of using `parse_design()` on a design `data.frame` str(trial) #> List of 2 #> $ trial_info :List of 2 #> ..$ 10A(US1):List of 8 #> .. ..$ name : chr \"A(US1)\" #> .. ..$ repetitions : num 10 #> .. ..$ is_test : logi FALSE #> .. ..$ periods : chr \"A(US1)\" #> .. ..$ nominals :List of 1 #> .. .. ..$ A(US1): chr [1:2] \"A\" \"US1\" #> .. ..$ functionals :List of 1 #> .. .. ..$ A(US1): chr [1:2] \"A\" \"US1\" #> .. ..$ all_nominals : chr [1:2] \"A\" \"US1\" #> .. ..$ all_functionals: chr [1:2] \"A\" \"US1\" #> ..$ 10B(US2):List of 8 #> .. ..$ name : chr \"B(US2)\" #> .. ..$ repetitions : num 10 #> .. ..$ is_test : logi FALSE #> .. ..$ periods : chr \"B(US2)\" #> .. ..$ nominals :List of 1 #> .. .. ..$ B(US2): chr [1:2] \"B\" \"US2\" #> .. ..$ functionals :List of 1 #> .. .. ..$ B(US2): chr [1:2] \"B\" \"US2\" #> .. ..$ all_nominals : chr [1:2] \"B\" \"US2\" #> .. ..$ all_functionals: chr [1:2] \"B\" \"US2\" #> $ general_info:List of 5 #> ..$ trial_names : chr [1:2] \"A(US1)\" \"B(US2)\" #> ..$ trial_repeats: num [1:2] 10 10 #> ..$ is_test : logi [1:2] FALSE FALSE #> ..$ nomi2func : Named chr [1:4] \"A\" \"US1\" \"B\" \"US2\" #> .. ..- attr(*, \"names\")= chr [1:4] \"A\" \"US1\" \"B\" \"US2\" #> ..$ func2nomi : Named chr [1:4] \"A\" \"US1\" \"B\" \"US2\" #> .. ..- attr(*, \"names\")= chr [1:4] \"A\" \"US1\" \"B\" \"US2\""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"the-parameters-list","dir":"Articles","previous_headings":"","what":"The parameters list","title":"calmr_basics","text":"Now need pick model parameters. get models currently supported calmr, can call supported_models(). choosing model, can get default parameters design get_parameters().","code":"supported_models() #> [1] \"HDI2020\" \"HD2022\" \"RW1972\" \"MAC1975\" \"PKH1982\" \"SM2007\" \"RAND\" #> [8] \"ANCCR\" \"TD\" my_pars <- get_parameters(my_blocking, model = \"RW1972\") # Increasing the beta parameter for US presentations my_pars$betas_on[\"US\"] <- .6 my_pars #> $alphas #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $betas_on #> A B C US #> 0.4 0.4 0.4 0.6 #> #> $betas_off #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $lambdas #> A B C US #> 1 1 1 1"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"simulating","dir":"Articles","previous_headings":"The parameters list","what":"Simulating","title":"calmr_basics","text":", can run simulation using run_experiment() function. function also takes extra arguments manipulate number iterations run experiment , whether organize trials miniblocks (see help page make_experiment() additional details). , run experiment 5 iterations. advanced R user able dig data straight away. However, package also includes methods get quick look results.","code":"my_experiment <- run_experiment( my_blocking, # note we do not need to pass the parsed design model = \"RW1972\", parameters = my_pars, iterations = 5 ) # returns a `CalmrExperiment` object class(my_experiment) #> [1] \"CalmrExperiment\" #> attr(,\"package\") #> [1] \"calmr\" # CalmrExperiment is an S4 class, so it has slots slotNames(my_experiment) #> [1] \"design\" \"model\" \"groups\" \"parameters\" \"timings\" #> [6] \"experiences\" \"results\" \".model\" \".group\" \".iter\" # the experience given to group Exp on the first iteration my_experiment@experiences[[1]] #> model group phase tp tn is_test block_size trial #> 1 RW1972 Exp Phase1 1 A(US) FALSE 1 1 #> 2 RW1972 Exp Phase1 1 A(US) FALSE 1 2 #> 3 RW1972 Exp Phase1 1 A(US) FALSE 1 3 #> 4 RW1972 Exp Phase1 1 A(US) FALSE 1 4 #> 5 RW1972 Exp Phase1 1 A(US) FALSE 1 5 #> 6 RW1972 Exp Phase1 1 A(US) FALSE 1 6 #> 7 RW1972 Exp Phase1 1 A(US) FALSE 1 7 #> 8 RW1972 Exp Phase1 1 A(US) FALSE 1 8 #> 9 RW1972 Exp Phase1 1 A(US) FALSE 1 9 #> 10 RW1972 Exp Phase1 1 A(US) FALSE 1 10 #> 11 RW1972 Exp Phase2 2 AB(US) FALSE 1 11 #> 12 RW1972 Exp Phase2 2 AB(US) FALSE 1 12 #> 13 RW1972 Exp Phase2 2 AB(US) FALSE 1 13 #> 14 RW1972 Exp Phase2 2 AB(US) FALSE 1 14 #> 15 RW1972 Exp Phase2 2 AB(US) FALSE 1 15 #> 16 RW1972 Exp Phase2 2 AB(US) FALSE 1 16 #> 17 RW1972 Exp Phase2 2 AB(US) FALSE 1 17 #> 18 RW1972 Exp Phase2 2 AB(US) FALSE 1 18 #> 19 RW1972 Exp Phase2 2 AB(US) FALSE 1 19 #> 20 RW1972 Exp Phase2 2 AB(US) FALSE 1 20 #> 21 RW1972 Exp Test 3 #A TRUE 2 21 #> 22 RW1972 Exp Test 4 #B TRUE 2 22 # the number of times we ran the model (groups x iterations) length(experiences(my_experiment)) #> [1] 10 # an experiment has results with different levels of aggregation class(my_experiment@results) #> [1] \"CalmrExperimentResult\" #> attr(,\"package\") #> [1] \"calmr\" slotNames(my_experiment@results) #> [1] \"aggregated_results\" \"parsed_results\" \"raw_results\" # shorthand method to access aggregated_results results(my_experiment) #> $associations #> group phase trial_type trial block_size s1 s2 value model #> #> 1: Exp Phase1 A(US) 1 1 A A 0.0000000 RW1972 #> 2: Exp Phase1 A(US) 1 1 A B 0.0000000 RW1972 #> 3: Exp Phase1 A(US) 1 1 A C 0.0000000 RW1972 #> 4: Exp Phase1 A(US) 1 1 A US 0.0000000 RW1972 #> 5: Exp Phase1 A(US) 1 1 B A 0.0000000 RW1972 #> --- #> 700: Control Test #B 22 2 C US 0.9939534 RW1972 #> 701: Control Test #B 22 2 US A 0.4999999 RW1972 #> 702: Control Test #B 22 2 US B 0.4999999 RW1972 #> 703: Control Test #B 22 2 US C 0.6626356 RW1972 #> 704: Control Test #B 22 2 US US 0.0000000 RW1972 #> #> $responses #> group phase trial_type trial block_size s1 s2 value model #> #> 1: Exp Phase1 A(US) 1 1 A A 0 RW1972 #> 2: Exp Phase1 A(US) 1 1 A B 0 RW1972 #> 3: Exp Phase1 A(US) 1 1 A C 0 RW1972 #> 4: Exp Phase1 A(US) 1 1 A US 0 RW1972 #> 5: Exp Phase1 A(US) 1 1 B A 0 RW1972 #> --- #> 700: Control Test #B 22 2 C US 0 RW1972 #> 701: Control Test #B 22 2 US A 0 RW1972 #> 702: Control Test #B 22 2 US B 0 RW1972 #> 703: Control Test #B 22 2 US C 0 RW1972 #> 704: Control Test #B 22 2 US US 0 RW1972"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"plotting","dir":"Articles","previous_headings":"","what":"Plotting","title":"calmr_basics","text":"Let’s use plot method create plots. model supports different types plots according results can produce (e.g., associations, responses, saliences, etc.) case, RW model supports associations (associations) responses (responses).","code":"# get all the plots for the experiment plots <- plot(my_experiment) names(plots) #> [1] \"Exp - Association Strength (RW1972)\" #> [2] \"Control - Association Strength (RW1972)\" #> [3] \"Exp - Response Strength (RW1972)\" #> [4] \"Control - Response Strength (RW1972)\" # or get a specific type of plot specific_plot <- plot(my_experiment, type = \"associations\") names(specific_plot) #> [1] \"Exp - Association Strength (RW1972)\" #> [2] \"Control - Association Strength (RW1972)\" # show which plots are supported by the model we are using supported_plots(\"RW1972\") #> [1] \"associations\" \"responses\""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"stimulus-associations","dir":"Articles","previous_headings":"Plotting","what":"Stimulus associations","title":"calmr_basics","text":"columns plots phases design rows denote source association. colors within panel determine target association.","code":"plot(my_experiment, type = \"associations\") #> $`Exp - Association Strength (RW1972)` #> #> $`Control - Association Strength (RW1972)`"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"responding","dir":"Articles","previous_headings":"Plotting","what":"Responding","title":"calmr_basics","text":"Fairly similar , responding function stimuli presented trial.","code":"plot(my_experiment, type = \"responses\") #> $`Exp - Response Strength (RW1972)` #> #> $`Control - Response Strength (RW1972)`"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"graphing","dir":"Articles","previous_headings":"","what":"Graphing","title":"calmr_basics","text":"can also take look state model’s associations point training, using graph method experiment.","code":"my_graph_opts <- get_graph_opts(\"small\") # passing the argument t to specify the trial we're interested in. # end of acquisition patch_graphs(graph(my_experiment, t = 10, options = my_graph_opts)) # end of blocking patch_graphs(graph(my_experiment, t = 20, options = my_graph_opts))"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"final-thoughts","dir":"Articles","previous_headings":"","what":"Final thoughts","title":"calmr_basics","text":"calmr package designed simulate quickly: specify design, parameters, get glance model predictions. However, package also additional features advanced R users. ’re one , make sure check vignettes ready.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"fitting-heidi-to-empirical-data","dir":"Articles","previous_headings":"","what":"Fitting HeiDI to empirical data","title":"calmr_fits","text":"demo, fit HeiDI empirical data (Patitucci et al., 2016, Experiment 1). involve writing function produces model responses organized empirical data, can use function maximum likelihood estimation (MLE). begin short overview data, move model function, finally fit.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"the-data","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data","what":"The data","title":"calmr_fits","text":"data (pati) contains responses (lever presses lp, nose pokes np) 32 rats, across 6 blocks training (2 sessions per block). animals trained associate two levers two different food rewards (pellets sucrose). Let’s glance. thicker lines group averages; rest individual subjects. ignore specific mapping levers USs counterbalanced across subjects. However, ignore counterbalancing writing model function (see ahead).","code":"summary(pati) #> subject block lever us response #> 1 : 24 Min. :1.0 B: 0 Length:768 lp:384 #> 2 : 24 1st Qu.:2.0 L:384 Class :character np:384 #> 3 : 24 Median :3.5 R:384 Mode :character #> 4 : 24 Mean :3.5 #> 5 : 24 3rd Qu.:5.0 #> 6 : 24 Max. :6.0 #> (Other):624 #> rpert #> Min. :0.0000 #> 1st Qu.:0.9437 #> Median :2.2500 #> Mean :2.4806 #> 3rd Qu.:3.8000 #> Max. :8.4500 #> pati |> ggplot(aes(x = block, y = rpert, colour = us)) + geom_line(aes(group = interaction(us, subject)), alpha = .3) + stat_summary(geom = \"line\", fun = \"mean\", linewidth = 1) + labs(x = \"Block\", y = \"Responses per trial\", colour = \"US\") + facet_grid(~response)"},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"writing-the-model-function","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data","what":"Writing the model function","title":"calmr_fits","text":"biggest hurdle fitting model empirical data write function , given vector parameters experiment, generates responses organized empirical data. Let’s begin summarizing data first, know aim . design? experiment presented Patitucci et al. (2016) fairly simple, can reduced presentations two levers, followed different appetitive outcome. , assume two outcomes independent . also take liberties number trials specify reduce computing time. beware: HeiDI, like many learning models, sensitive order effects. want model misfit data happened run simulations unlucky run trials. arguments prepare must reflect behavior model “general” experimental procedure, , address issue running several iterations experiment (random order trials) averaging experiments evaluating likelihood parameters. mind, now prepare experiment pass run_experiment(). Note specified two counterbalancings groups. must reproduce counterbalancings data trying fit close possible. Otherwise, optimization process might latch onto experimentally-irrelevant variables. example, can seen pati lever pressing whenever lever paired pellets. didn’t counterbalance identities levers food rewards, optimization might result one levers less salient ! can now begin write model function. First, good see results run_experiment() returns. Although results() returns many model outputs, said earlier, care one : responses (model responses). , can write model function. Let’s dissect function three parts. get parameters experiment, via parameters() method store new_parameters.1 put pars (parameters provided optimizer) alphas new_parameters. run experiment store exp_res. select model responses (responses) model results store responses. Lastly. summarise model responses return .2 ’s lot digest, let’s see function action. Just numbers! order empirical data model responses must match. emphasize point enough: nothing within fit function checks reorders data . sole responsible making sure pieces data order. simple way print model results return compare data. ’s reason full parameter function definition. made sure everything looking good, can fit model.","code":"pati_summ <- setDT(pati)[, list(\"rpert\" = mean(rpert)), by = \"block,us,response\" ] # set order (relevant for the future) setorder(pati_summ, block, response, us) head(pati_summ) #> block us response rpert #> #> 1: 1 P lp 0.8195313 #> 2: 1 S lp 0.5609375 #> 3: 1 P np 3.4109375 #> 4: 1 S np 3.2796875 #> 5: 2 P lp 1.5738281 #> 6: 2 S lp 0.6406250 # The design data.frame des_df <- data.frame( group = c(\"CB1\", \"CB2\"), training = c( \"12L>(Pellet)/12R>(Sucrose)/12#L/12#R\", \"12L>(Sucrose)/12R>(Pellet)/12#L/12#R\" ), rand_train = FALSE ) # The parameters # the actual parameter values don't matter, # as our function will re-write them inside the optimizer call parameters <- get_parameters(des_df, model = \"HD2022\" ) # The arguments experiment <- make_experiment(des_df, parameters = parameters, model = \"HD2022\", iterations = 4 ) experiment exp_res <- run_experiment(experiment) results(exp_res) #> $activations #> group phase trial_type trial block_size s1 value model #> #> 1: CB1 training L>(Pellet) 1 4 L 0.4000000 HD2022 #> 2: CB1 training R>(Sucrose) 2 4 L 0.0000000 HD2022 #> 3: CB1 training #L 3 4 L 0.4000000 HD2022 #> 4: CB1 training #R 4 4 L 0.0000000 HD2022 #> 5: CB1 training L>(Pellet) 5 4 L 0.4000000 HD2022 #> --- #> 380: CB2 training #R 44 4 Sucrose 0.0000000 HD2022 #> 381: CB2 training L>(Sucrose) 45 4 Sucrose 0.4000000 HD2022 #> 382: CB2 training R>(Pellet) 46 4 Sucrose 0.0000000 HD2022 #> 383: CB2 training #L 47 4 Sucrose 0.3991293 HD2022 #> 384: CB2 training #R 48 4 Sucrose 0.0000000 HD2022 #> #> $associations #> group phase trial_type trial block_size s1 s2 value #> #> 1: CB1 training L>(Pellet) 1 4 L L 0.0000000 #> 2: CB1 training L>(Pellet) 1 4 L Pellet 0.0000000 #> 3: CB1 training L>(Pellet) 1 4 L R 0.0000000 #> 4: CB1 training L>(Pellet) 1 4 L Sucrose 0.0000000 #> 5: CB1 training L>(Pellet) 1 4 Pellet L 0.0000000 #> --- #> 1532: CB2 training #R 48 4 R Sucrose 0.0000000 #> 1533: CB2 training #R 48 4 Sucrose L 0.3991293 #> 1534: CB2 training #R 48 4 Sucrose Pellet 0.0000000 #> 1535: CB2 training #R 48 4 Sucrose R 0.0000000 #> 1536: CB2 training #R 48 4 Sucrose Sucrose 0.0000000 #> model #> #> 1: HD2022 #> 2: HD2022 #> 3: HD2022 #> 4: HD2022 #> 5: HD2022 #> --- #> 1532: HD2022 #> 1533: HD2022 #> 1534: HD2022 #> 1535: HD2022 #> 1536: HD2022 #> #> $pools #> group phase trial_type trial block_size s1 s2 type #> #> 1: CB1 training L>(Pellet) 1 4 L,Pellet L combvs #> 2: CB1 training L>(Pellet) 1 4 L,Pellet Pellet combvs #> 3: CB1 training L>(Pellet) 1 4 L,Pellet R combvs #> 4: CB1 training L>(Pellet) 1 4 L,Pellet Sucrose combvs #> 5: CB1 training R>(Sucrose) 2 4 R,Sucrose L combvs #> --- #> 764: CB2 training #L 47 4 L Sucrose chainvs #> 765: CB2 training #R 48 4 R L chainvs #> 766: CB2 training #R 48 4 R Pellet chainvs #> 767: CB2 training #R 48 4 R R chainvs #> 768: CB2 training #R 48 4 R Sucrose chainvs #> value model #> #> 1: 0 HD2022 #> 2: 0 HD2022 #> 3: 0 HD2022 #> 4: 0 HD2022 #> 5: 0 HD2022 #> --- #> 764: 0 HD2022 #> 765: 0 HD2022 #> 766: 0 HD2022 #> 767: 0 HD2022 #> 768: 0 HD2022 #> #> $responses #> group phase trial_type trial block_size s1 s2 value model #> #> 1: CB1 training L>(Pellet) 1 4 L L 0 HD2022 #> 2: CB1 training L>(Pellet) 1 4 L Pellet 0 HD2022 #> 3: CB1 training L>(Pellet) 1 4 L R 0 HD2022 #> 4: CB1 training L>(Pellet) 1 4 L Sucrose 0 HD2022 #> 5: CB1 training L>(Pellet) 1 4 Pellet L 0 HD2022 #> --- #> 1532: CB2 training #R 48 4 R Sucrose 0 HD2022 #> 1533: CB2 training #R 48 4 Sucrose L 0 HD2022 #> 1534: CB2 training #R 48 4 Sucrose Pellet 0 HD2022 #> 1535: CB2 training #R 48 4 Sucrose R 0 HD2022 #> 1536: CB2 training #R 48 4 Sucrose Sucrose 0 HD2022 my_model_function <- function(pars, exper, full = FALSE) { # extract the parameters from the model new_parameters <- parameters(exper)[[1]] # assign alphas new_parameters$alphas[] <- pars # reassign parameters to the experiment parameters(exper) <- new_parameters # note parameters method # running the model and selecting responses exp_res <- run_experiment(exper) # summarizing the model responses <- results(exp_res)$responses # calculate extra variables responses$response <- ifelse(responses$s1 %in% c(\"Pellet\", \"Sucrose\"), \"np\", \"lp\" ) responses$block <- ceiling(responses$trial / 8) # filtering # only probe trials responses <- responses[grepl(\"#\", trial_type)] # only available responses responses <- responses[s2 %in% c(\"Pellet\", \"Sucrose\") & (response == \"np\" | (response == \"lp\" & mapply(grepl, s1, trial_type)))] # aggregate responses <- responses[, list(value = mean(value)), by = \"block,s2,response\"] if (full) { return(responses) } responses$value } my_model_function(c(.1, .2, .4, .3), experiment) #> [1] 0.028557609 0.040188221 0.004008696 0.008429327 0.045573899 0.061933782 #> [7] 0.010480790 0.021230102 0.053426837 0.070862133 0.015100913 0.029677071 #> [13] 0.057584182 0.074995358 0.018328387 0.035165746 0.059994400 0.077081202 #> [19] 0.020711121 0.039013071 0.061492438 0.078227391 0.022547790 0.041891069 head(my_model_function(c(.1, .2, .4, .3), experiment, full = TRUE)) #> block s2 response value #> #> 1: 1 Pellet lp 0.028557609 #> 2: 1 Sucrose lp 0.040188221 #> 3: 1 Pellet np 0.004008696 #> 4: 1 Sucrose np 0.008429327 #> 5: 2 Pellet lp 0.045573899 #> 6: 2 Sucrose lp 0.061933782 head(pati_summ) #> block us response rpert #> #> 1: 1 P lp 0.8195313 #> 2: 1 S lp 0.5609375 #> 3: 1 P np 3.4109375 #> 4: 1 S np 3.2796875 #> 5: 2 P lp 1.5738281 #> 6: 2 S lp 0.6406250"},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"fitting-the-model","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data","what":"Fitting the model","title":"calmr_fits","text":"fit models using fit_model() function. function requires 4 arguments: (empirical) data. model function. arguments run model function. optimizer options. done great job taking care first three, let’s tackle last. get_optimizer_opts() function returns many things: model_pars: name model parameters (name alpha stimulus). ll ul: lower upper limits parameter search. optimizer: numerical optimization technique wish use MLE estimation. family: family distribution assume model. practice, request used determine link function transform model responses, likelihood function used objective function. normal family nothing fancy model responses estimate extra parameter, scale, scales model responses scale empirical data. comes likelihood functions, family use normal density data model differences. family_pars: family-specific parameter estimated alongside salience parameters. verbose: Whether print parameters objective function values optimize. free modify ; just make sure structure list returned get_optimizer_opts() remains . can also pass extra parameters optimizer call using (e.g., par argument optim, parallel ga). , fit model parallel ga, 10 iterations. , can fit model! (patient following along) fit_model function returns lot information track put got . However, typing model console show MLE parameters obtained time negative log-likelihood, given data: ’s good , well model run parameters “visually” fit data? can obtain predictions model via predict function. looks pretty good! Save blatant misfits, course. Now know everything need fit calmr empirical data. Go forth!","code":"my_optimizer_opts <- get_optimizer_opts( model_pars = names(parameters$alphas), optimizer = \"ga\", ll = c(0, 0, 0, 0), ul = c(1, 1, 1, 1), family = \"normal\" ) my_optimizer_opts #> $model_pars #> [1] \"L\" \"Pellet\" \"R\" \"Sucrose\" #> #> $optimizer #> [1] \"ga\" #> #> $family #> [1] \"normal\" #> #> $family_pars #> [1] \"normal_scale\" #> #> $all_pars #> [1] \"L\" \"Pellet\" \"R\" \"Sucrose\" \"normal_scale\" #> #> $initial_pars #> [1] NA NA NA NA 1 #> #> $ll #> L Pellet R Sucrose normal_scale #> 0 0 0 0 0 #> #> $ul #> L Pellet R Sucrose normal_scale #> 1 1 1 1 100 #> #> $verbose #> [1] FALSE the_fit <- fit_model(pati_summ$rpert, model_function = my_model_function, exper = experiment, optimizer_options = my_optimizer_opts, maxiter = 10, parallel = TRUE ) the_fit # the BIC and AIC BIC(the_fit) #> [1] 102.484 AIC(the_fit) #> [1] 96.5937 pati_summ$prediction <- predict(the_fit, exper = experiment) pati_summ[, data := rpert][, rpert := NULL] pati_summ <- melt(pati_summ, measure.vars = c(\"prediction\", \"data\")) pati_summ |> ggplot(ggplot2::aes( x = block, y = value, colour = us, linetype = variable )) + geom_line() + theme_bw() + facet_grid(us ~ response)"},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"a-final-note","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data > Fitting the model","what":"A final note","title":"calmr_fits","text":"vignette pre-generated, don’t want user fit model time installation. try keep package develops, spot inconsistencies, please drop line.","code":""},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"simulating-similarity-effects","dir":"Articles","previous_headings":"","what":"Simulating similarity effects","title":"heidi_similarity","text":"Honey Dwyer (2022), authors propose similarity retrieved nominal saliencies stimulus representations modulates quantities combination rule. Retrieved saliencies exclusively absent stimuli, result existing associations stimuli (see Eq. 8 model’s vignette). contrast, nominal saliencies denote intensity stimulus representations stimuli presented trial (\\(\\alpha\\)). intuitive example effect saliency similarity responding refers effect weakly retrieved representations behavior. low similarity weakly retrieved representation nominal representation result reduced effect former behavior. example, typical Pavlovian inhibition paradigm \\[(US)/AX\\], inhibitor (e.g., X) strong effect behavior presented weak effect behavior weakly retrieved stimulus strong association (e.g., ). Yet, inspiration proposing general rule fairly specific. attempt explain introduction delay CS US stimuli higher-order conditioning experiments sometimes enhance responding stimulus never paired US (e.g., AX/X(US) X(US)/AX).","code":""},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"reproducing-the-simulation-presented-in-the-paper","dir":"Articles","previous_headings":"Simulating similarity effects","what":"Reproducing the simulation presented in the paper","title":"heidi_similarity","text":"paper, authors plot similarity retrieved saliencies nominal saliencies stimulus X sensory preconditioning experiment short delay X US used (group Reduced) (group ). effect introducing delay simulated X saliency .36; otherwise, saliency .40. saliencies US fixed .30 .50, respectively, conditions.","code":"df <- data.frame( Group = c(\"Same\", \"Reduced\"), P1 = c(\"10A(X_a)\", \"10A(X_a)\"), R1 = c(FALSE, FALSE), P2 = c(\"10(X_a)(US)\", \"10(X_b)(US)\"), R2 = c(FALSE, FALSE) ) params <- get_parameters(df, model = \"HD2022\") params$alphas[] <- c(.30, .40, .50, .36) model <- run_experiment(df, model = \"HD2022\", parameters = params )"},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"plotting-the-similarity-between-saliencies","dir":"Articles","previous_headings":"Simulating similarity effects > Reproducing the simulation presented in the paper","what":"Plotting the similarity between saliencies","title":"heidi_similarity","text":"plot currently supported package, can easily generated passing \\(\\rightarrow X\\) association one alphas internal function used calculate similarity calmr:::.alphaSim.","code":"associations <- results(model)$associations[ s1 == \"A\" & s2 == \"X\" & phase == \"P1\" ] associations[ , nominal_alpha := ifelse(group == \"Reduced\", mean(.36, .40), .40) ][ , similarity := calmr:::.alphaSim(value, nominal_alpha) ] associations |> ggplot(aes(x = trial, y = similarity, linetype = group)) + geom_line() + theme_bw() + labs(x = \"Trial\", y = \"Similarity\", linetype = \"Group\")"},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"plotting-the-distribution-of-responding","dir":"Articles","previous_headings":"Simulating similarity effects > Reproducing the simulation presented in the paper","what":"Plotting the distribution of responding","title":"heidi_similarity","text":"one little bit trickier figure manuscript effectively contains many experiments varying number XA trials starting first-order conditioning phase. address , run multiple simulations different experimental designs. Run model. now can manually plot distribution responding among stimuli model$responses.","code":"ntrials <- 1:10 df <- data.frame( Group = c(paste0(\"S\", ntrials), paste0(\"R\", ntrials)), P1 = rep(paste0(ntrials, \"A(X_a)\"), 2), R1 = FALSE, P2 = rep(c(\"10(X_a)>(US)\", \"10(X_b)>(US)\"), each = 10), R2 = FALSE, P3 = \"1A#\", R3 = FALSE ) head(df) #> Group P1 R1 P2 R2 P3 R3 #> 1 S1 1A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 2 S2 2A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 3 S3 3A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 4 S4 4A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 5 S5 5A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 6 S6 6A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE model <- run_experiment(df, model = \"HD2022\", parameters = params ) responses <- results(model)$responses[phase == \"P3\" & s2 == \"US\"] responses[, `:=`( trial = trial - 11, group_lab = ifelse(substr(group, 1, 1) == \"R\", \"Reduced\", \"Same\") )] responses |> ggplot(aes(x = trial, y = value, colour = s1, linetype = group_lab)) + geom_line() + theme_bw() + labs(x = \"Trial\", y = \"R-value\", colour = \"stimulus\", linetype = \"Group\") + facet_wrap(~s2)"},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"some-final-notes","dir":"Articles","previous_headings":"Simulating similarity effects > Reproducing the simulation presented in the paper","what":"Some final notes","title":"heidi_similarity","text":"paper, Honey Dwyer completely specify rules choosing reference value similarity calculation whenever one nominal stimulus experienced. example, simulation, use two nominal versions X stimulus (X_a X_b), , whenever model compute similarity retrieved (.e., \\(\\rightarrow X\\)) conditioned saliency values, encounter problem choose among least two conditioned values (X_a X_b). Although authors paper chose saliency nominal X conditioned US (.e., X_b), specify choice made , less intuitive situations. way avoid solving issue, current implementation similarity rule uses average nominal stimuli reference value similarity calculation. specific simulation case, implementation reduces effect similarity distribution responding.","code":""},{"path":"https://victornavarro.org/calmr/articles/parallelism_in_calmr.html","id":"running-experiments-in-parallel","dir":"Articles","previous_headings":"","what":"Running experiments in parallel","title":"parallelism_in_calmr","text":"advent time-based models, version 0.51 calmr uses future package parallelize operations. Thanks design philosophy future, running things parallel takes single line code.","code":""},{"path":"https://victornavarro.org/calmr/articles/parallelism_in_calmr.html","id":"why-run-things-in-parallel","dir":"Articles","previous_headings":"Running experiments in parallel","what":"Why run things in parallel?","title":"parallelism_in_calmr","text":"many situations find run model many iterations, either design contains enough kinds trials order effects worry, want run model different parameters. Let’s run HeiDI model (Honey et al., 2020) long, random design. Let’s also enable verbosity via calmr_verbosity(), uses progressr package. Let’s try parallelizing now.","code":"library(calmr) # enables progress bars (try it on your computer) # calmr_verbosity(TRUE) pav_inhib <- data.frame( group = \"group\", phase1 = \"50(US)/50AB/50#A\", rand1 = TRUE ) # set options to introduce more randomness pars <- get_parameters(pav_inhib, model = \"HDI2020\") exp <- make_experiment(pav_inhib, parameters = pars, model = \"HDI2020\", iterations = 100, miniblocks = FALSE ) # time it start <- proc.time() pav_res <- run_experiment(exp) end <- proc.time() - start end #> user system elapsed #> 5.834 0.074 3.869"},{"path":"https://victornavarro.org/calmr/articles/parallelism_in_calmr.html","id":"running-an-experiment-in-parallel","dir":"Articles","previous_headings":"Running experiments in parallel","what":"Running an experiment in parallel","title":"parallelism_in_calmr","text":"run experiment, parallel, need enable future plan. “plan” one many ways future package can parallelize things (consult documentation). Regardless, running calmr single computer, ’ll using plan(multisession) case, parallel faster (see user time ). future package trades ease use bulkier overheads. overheads tend constant, parallelization better payoff run iterations.","code":"library(future) plan(multisession) start <- proc.time() pav_res <- run_experiment(exp) end <- proc.time() - start end #> user system elapsed #> 0.918 0.106 6.351 # go back to non-parallel evaluations plan(sequential)"},{"path":"https://victornavarro.org/calmr/articles/using_time_models.html","id":"time-models-in-calmr","dir":"Articles","previous_headings":"","what":"Time models in calmr","title":"using_time_models","text":"Version 0.5 calmr introduced first time-based model, ANCCR (Jeong et al., 2022), , wrote several additional tools future models.","code":""},{"path":"https://victornavarro.org/calmr/articles/using_time_models.html","id":"changes-to-trial-based-models","dir":"Articles","previous_headings":"Time models in calmr","what":"Changes to trial-based models","title":"using_time_models","text":"biggest change calmr version 0.5 use “>” character effect trial-based models. , “>” character used specify single split within trial. example, “>(US)” encode typical situation stimulus followed US. used mimic traditional situation expect organism start (conditionally) responding US delivered. , trial-based models two steps within trial: expectation step first half trial retrieved absent stimuli, learning step, stimuli trial associated . first pass (start throwing extinction trials, better yet, probe trials test associations).","code":""},{"path":"https://victornavarro.org/calmr/articles/using_time_models.html","id":"specifying-a-design-for-time-based-models","dir":"Articles","previous_headings":"Time models in calmr","what":"Specifying a design for time-based models","title":"using_time_models","text":"designs time-based models nearly identical trial-based models. However, clever use “>” character enrich parameter list. Let’s specify serial feature discrimination experiment: now let’s get parameters ANCCR model. ANCCR model plenty parameters, yet nearly half parameters list correspond parameters use create experience model receive. leave explanation model-based parameters future. now, suffice note can control timing trials (events) using things like post_trial_delay, mean_ITI, transition_delay, etc. Let’s make model’s experience look first 20 entries. can see , several rows per trial, specifying different stimulus. Time-based models like ANCCR run time log make ample use time difference events. Let’s run model see plots. ’s ! Easy, right?","code":"library(calmr) fpfn <- data.frame( group = c(\"FP\", \"FN\"), phase1 = c(\"100F>T>(US)/100T\", \"100F>T/100T>(US)\"), r1 = c(TRUE, TRUE) ) fpfn #> group phase1 r1 #> 1 FP 100F>T>(US)/100T TRUE #> 2 FN 100F>T/100T>(US) TRUE pars <- get_parameters(fpfn, model = \"ANCCR\") # increase learning rates pars$alpha_reward <- 0.8 pars$alpha <- 0.08 # increase sampling interval to speed up the model pars$sampling_interval <- 5 pars #> $reward_magnitude #> F T US #> 1 1 1 #> #> $betas #> F T US #> 1 1 1 #> #> $cost #> [1] 0 #> #> $temperature #> [1] 1 #> #> $threshold #> [1] 0.6 #> #> $k #> [1] 1 #> #> $w #> [1] 0.5 #> #> $minimum_rate #> [1] 0.001 #> #> $sampling_interval #> [1] 5 #> #> $use_exact_mean #> [1] 0 #> #> $t_ratio #> [1] 1.2 #> #> $t_constant #> [1] NA #> #> $alpha #> [1] 0.08 #> #> $alpha_reward #> [1] 0.8 #> #> $use_timed_alpha #> [1] 0 #> #> $alpha_exponent #> [1] 1 #> #> $alpha_init #> [1] 1 #> #> $alpha_min #> [1] 0 #> #> $add_beta #> [1] 0 #> #> $jitter #> [1] 1 experiment <- make_experiment(fpfn, parameters = pars, model = \"ANCCR\" ) head(experiences(experiment)[[1]], 20) #> model group phase tp tn is_test block_size trial stimulus time reward_mag #> 1 ANCCR FP phase1 2 T FALSE 2 1 T 0.5 1 #> 2 ANCCR FP phase1 1 F>T>(US) FALSE 2 2 F 2.0 1 #> 3 ANCCR FP phase1 1 F>T>(US) FALSE 2 2 T 3.0 1 #> 4 ANCCR FP phase1 1 F>T>(US) FALSE 2 2 US 4.0 1 #> 5 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 F 5.5 1 #> 6 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 T 6.5 1 #> 7 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 US 7.5 1 #> 8 ANCCR FP phase1 2 T FALSE 2 4 T 9.0 1 #> 9 ANCCR FP phase1 2 T FALSE 2 5 T 10.5 1 #> 10 ANCCR FP phase1 1 F>T>(US) FALSE 2 6 F 12.0 1 #> 11 ANCCR FP phase1 1 F>T>(US) FALSE 2 6 T 13.0 1 #> 12 ANCCR FP phase1 1 F>T>(US) FALSE 2 6 US 14.0 1 #> 13 ANCCR FP phase1 1 F>T>(US) FALSE 2 7 F 15.5 1 #> 14 ANCCR FP phase1 1 F>T>(US) FALSE 2 7 T 16.5 1 #> 15 ANCCR FP phase1 1 F>T>(US) FALSE 2 7 US 17.5 1 #> 16 ANCCR FP phase1 2 T FALSE 2 8 T 19.0 1 #> 17 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 F 20.5 1 #> 18 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 T 21.5 1 #> 19 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 US 22.5 1 #> 20 ANCCR FP phase1 2 T FALSE 2 10 T 24.0 1 experiment <- run_experiment(experiment) # Action values patch_plots(plot(experiment, type = \"action_values\")) # ANCCR patch_plots(plot(experiment, type = \"anccrs\")) # Dopamine transients patch_plots(plot(experiment, type = \"dopamines\"))"},{"path":[]},{"path":"https://victornavarro.org/calmr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Victor Navarro. Author, maintainer, copyright holder.","code":""},{"path":"https://victornavarro.org/calmr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Navarro V (2024). calmr: Canonical Associative Learning Models Representations. R package version 0.6.2, https://victornavarro.org/calmr/, https://github.com/victor-navarro/calmr.","code":"@Manual{, title = {calmr: Canonical Associative Learning Models and their Representations}, author = {Victor Navarro}, year = {2024}, note = {R package version 0.6.2, https://victornavarro.org/calmr/}, url = {https://github.com/victor-navarro/calmr}, }"},{"path":"https://victornavarro.org/calmr/index.html","id":"calmr","dir":"","previous_headings":"","what":"Canonical Associative Learning Models and their Representations","title":"Canonical Associative Learning Models and their Representations","text":"Canonical Associative Learning Models Representations","code":""},{"path":"https://victornavarro.org/calmr/index.html","id":"installing-the-latest-stable-version","dir":"","previous_headings":"","what":"Installing the latest stable version","title":"Canonical Associative Learning Models and their Representations","text":"may install latest stable version CRAN:","code":"install.packages(\"calmr\")"},{"path":"https://victornavarro.org/calmr/index.html","id":"installing-the-latest-version","dir":"","previous_headings":"","what":"Installing the latest version","title":"Canonical Associative Learning Models and their Representations","text":"feeling daring, can install latest version package. need devtools install package GitHub. managed build vignettes, ’s vignette showing basics package. (Worry , package’s website also ). want simulations using companion app, must install calmr.app package launch app.","code":"install.packages(\"devtools\") devtools::install_github(\"victor-navarro/calmr\") vignette(\"calmr_basics\", package = \"calmr\") devtools::install_github(\"victor-navarro/calmr.app\") calmr.app::launch_app()"},{"path":"https://victornavarro.org/calmr/index.html","id":"try-the-online-shiny-app","dir":"","previous_headings":"","what":"Try the online Shiny app","title":"Canonical Associative Learning Models and their Representations","text":"want check app without committing install, can check (wary: server might run free monthly quota). https://victor-navarro.shinyapps.io/calmr_app/","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr designs — CalmrDesign-class","title":"S4 class for calmr designs — CalmrDesign-class","text":"S4 class calmr designs","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr designs — CalmrDesign-class","text":"design: list containing design information. mapping: list containing object mapping. raw_design: original data.frame.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrDesign methods — CalmrDesign-methods","title":"CalmrDesign methods — CalmrDesign-methods","text":"S4 methods CalmrDesign class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrDesign methods — CalmrDesign-methods","text":"","code":"# S4 method for CalmrDesign show(object) # S4 method for CalmrDesign mapping(object) # S4 method for CalmrDesign trials(object)"},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrDesign methods — CalmrDesign-methods","text":"object CalmrDesign object","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrDesign methods — CalmrDesign-methods","text":"show() returns NULL (invisibly). mapping() returns list trial mappings. trials() returns NULL (invisibly).","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrExperiment methods — CalmrExperiment-methods","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"S4 methods CalmrExperiment class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"","code":"# S4 method for CalmrExperiment show(object) # S4 method for CalmrExperiment design(x) # S4 method for CalmrExperiment trials(object) # S4 method for CalmrExperiment parameters(x) # S4 method for CalmrExperiment parameters(x) <- value # S4 method for CalmrExperiment experiences(x) # S4 method for CalmrExperiment experiences(x) <- value # S4 method for CalmrExperiment results(object) # S4 method for CalmrExperiment raw_results(object) # S4 method for CalmrExperiment parsed_results(object) # S4 method for CalmrExperiment length(x) # S4 method for CalmrExperiment parse(object, outputs = NULL) # S4 method for CalmrExperiment aggregate(x, outputs = NULL) # S4 method for CalmrExperiment plot(x, type = NULL, ...) # S4 method for CalmrExperiment graph(x, ...) # S4 method for CalmrExperiment timings(x) # S4 method for CalmrExperiment timings(x) <- value"},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"object, x CalmrExperiment object. value list parameters (list parameter lists). outputs character vector specifying model outputs parse. type character vector specifying type(s) plots create. Defaults NULL. See supported_plots. ... Extra arguments passed calmr_model_graph() calmr_model_plot().","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"show() returns NULL (invisibly). design() returns CalmrDesign contained object. trials() returns NULL (invisibly). parameters() returns list parameters contained object. parameters()<- returns object updating parameters. experiences() returns list data.frame objects containing model training routines. experiences()<- returns object updating experiences. results() returns data.table objects aggregated results. raw_results() returns list raw model results. parsed_results() returns list data.table objects parsed results. length() returns integer specifying total length experiment (groups iterations). parse() returns object parsing raw results. aggregate() returns object aggregating parsed results. plot() returns list 'ggplot' plot objects. graph() returns list 'ggplot' plot objects. timings() returns list timings contained object. timings()<- returns object updating timings.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr experiments. — CalmrExperiment-class","title":"S4 class for calmr experiments. — CalmrExperiment-class","text":"S4 class calmr experiments.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr experiments. — CalmrExperiment-class","text":"design: CalmrDesign object. model: string specifying model used. groups: string specifying groups design. parameters: list parameters used, per group. timings: list timings used design. experiences: list experiences model. results: CalmrExperimentResult object. .model: Internal. model associated iteration. .group: Internal. group associated iteration. .iter: Internal. iteration number.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/CalmrExperimentResult.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr experiment results — CalmrExperimentResult-class","title":"S4 class for calmr experiment results — CalmrExperimentResult-class","text":"S4 class calmr experiment results","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperimentResult.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr experiment results — CalmrExperimentResult-class","text":"aggregated_results list data.table objects aggregated results. parsed_results list containing data.table objects parsed results. raw_results list raw model outputs.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr Fit — CalmrFit-class","title":"S4 class for calmr Fit — CalmrFit-class","text":"S4 class calmr Fit","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr Fit — CalmrFit-class","text":"nloglik: Numeric. Negative log likelihood fit best_pars: Numeric. Best fitting parameters model_pars: Numeric. Parameters used model function link_pars: Numeric. Parameters used link function data: Numeric. Data used fit model_function: Function. Model function link_function: Function. Link function ll_function: Function. Objective function (usually nloglikelihood) optimizer_options: List. Options used optimizer extra_pars: List. Extra parameters passed fit call (...)","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrFit methods — CalmrFit-methods","title":"CalmrFit methods — CalmrFit-methods","text":"S4 methods CalmrFit class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrFit methods — CalmrFit-methods","text":"","code":"# S4 method for CalmrFit show(object) # S4 method for CalmrFit predict(object, type = \"response\", ...) # S4 method for CalmrFit NLL(object) # S4 method for CalmrFit AIC(object, k = 2) # S4 method for CalmrFit BIC(object)"},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrFit methods — CalmrFit-methods","text":"object CalmrFit object. type string specifying type prediction generate. ... Extra named arguments. k Penalty term AIC method.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrFit methods — CalmrFit-methods","text":"show() returns NULL (invisibly). predict() returns numeric vector. NLL() returns negative log likelihood model. AIC() returns Akaike Information Criterion (AIC) model. BIC() returns Bayesian Information Criterion (BIC) model.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CalmrFit methods — CalmrFit-methods","text":"type = \"response\", predict() function passed model responses link function used fit model. AIC defined 2*k - 2*-NLL, k penalty term NLL negative log likelihood model. BIC defined p*log(n) - 2*-NLL, p number parameters model n number observations","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr representational similarity analysis — CalmrRSA-class","title":"S4 class for calmr representational similarity analysis — CalmrRSA-class","text":"S4 class calmr representational similarity analysis","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr representational similarity analysis — CalmrRSA-class","text":"corr_mat: array containing correlation matrix distances: list pairwise distance matrices args: list arguments used create object. test_data: list permutation data, populated testing object.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrRSA methods — CalmrRSA-methods","title":"CalmrRSA methods — CalmrRSA-methods","text":"S4 methods CalmrRSA class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrRSA methods — CalmrRSA-methods","text":"","code":"# S4 method for CalmrRSA show(object) # S4 method for CalmrRSA test(object, n_samples = 1000, p = 0.95) # S4 method for CalmrRSA plot(x)"},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrRSA methods — CalmrRSA-methods","text":"object, x CalmrRSA object. n_samples number samples permutation test (default = 1e3) p critical threshold level permutation test (default = 0.95)","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrRSA methods — CalmrRSA-methods","text":"show() returns NULL (invisibly). test() returns CalmrRSA object permutation test data. plot() returns list 'ggplot' plot objects.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrResult methods — CalmrResult-methods","title":"CalmrResult methods — CalmrResult-methods","text":"S4 methods CalmrResults class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrResult methods — CalmrResult-methods","text":"","code":"# S4 method for CalmrResult show(object)"},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrResult methods — CalmrResult-methods","text":"object CalmrResults object.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrResult methods — CalmrResult-methods","text":"show() returns NULL (invisibly).","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr results — CalmrResult-class","title":"S4 class for calmr results — CalmrResult-class","text":"S4 class calmr results","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr results — CalmrResult-class","text":"aggregated_results list data.table objects aggregated results. parsed_results list containing data.table objects parsed results. raw_results list raw model outputs.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform representational similarity analysis — rsa","title":"Perform representational similarity analysis — rsa","text":"Perform representational similarity analysis","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform representational similarity analysis — rsa","text":"","code":"rsa(x, comparisons, test = FALSE, ...)"},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform representational similarity analysis — rsa","text":"x list CalmrExperiment objects comparisons model-named list containing model outputs compare. test Whether test RSA via permutation test. Default = FALSE. ... Additional parameters passed stats::dist() stats::cor()","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform representational similarity analysis — rsa","text":"CalmrRSA object","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Perform representational similarity analysis — rsa","text":"object returned function can later tested via test() method.","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform representational similarity analysis — rsa","text":"","code":"# Comparing the associations in three models exp <- data.frame( Group = c(\"A\", \"B\"), P1 = c(\"2(A)>(US)/1B>(US)\", \"1(A)>(US)/2B>(US)\"), R1 = TRUE ) models <- c(\"HD2022\", \"RW1972\", \"PKH1982\") parameters <- sapply(models, get_parameters, design = exp) exp_res <- compare_models(exp, models = models ) comparisons <- list( \"HD2022\" = c(\"associations\"), \"RW1972\" = c(\"associations\"), \"PKH1982\" = c(\"associations\") ) res <- rsa(exp_res, comparisons = comparisons) test(res, n_samples = 20) #> CalmrRSA object #> --------------- #> Correlation matrix: #> HD2022.associations RW1972.associations #> HD2022.associations 1.0000000 0.3022383 #> RW1972.associations 0.3022383 1.0000000 #> PKH1982.associations -0.9178532 0.1009465 #> PKH1982.associations #> HD2022.associations -0.9178532 #> RW1972.associations 0.1009465 #> PKH1982.associations 1.0000000 #> --------------- #> Significance matrix: #> HD2022.associations RW1972.associations #> HD2022.associations FALSE FALSE #> RW1972.associations FALSE FALSE #> PKH1982.associations FALSE FALSE #> PKH1982.associations #> HD2022.associations FALSE #> RW1972.associations FALSE #> PKH1982.associations FALSE #> From 20 permutation samples, two-tailed test with alpha = 0.05."},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a graph with calmr data — calmr_model_graph","title":"Create a graph with calmr data — calmr_model_graph","text":"patch_graphs() patches graphs 'patchwork'","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a graph with calmr data — calmr_model_graph","text":"","code":"calmr_model_graph( x, loops = TRUE, limits = max(abs(x$value)) * c(-1, 1), colour_key = FALSE, t = max(x$trial), options = get_graph_opts() ) patch_graphs(graphs, selection = names(graphs)) get_graph_opts(graph_size = \"small\")"},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a graph with calmr data — calmr_model_graph","text":"x data.frame-like data use plot. Contains column named value. loops Logical. Whether draw arrows back forth limits Numerical. Limits color scale. Defaults max(abs(x$value))*c(-1,1). colour_key Logical. Whether show color key t trial weights obtained (defaults maximum trial data). options list graph options, returned get_graph_opts(). graphs list (named) graphs, returned graph() calmr_model_graph() selection character numeric vector determining plots patch. graph_size string (either \"small\" \"large\"). return default values small large graphs trial Numerical. trial graph.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a graph with calmr data — calmr_model_graph","text":"'ggplot' object patch_graphs() returns 'patchwork' object list graph options, passed ggnetwork::geom_nodes().","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a graph with calmr data — calmr_model_graph","text":"probably getting graphs via graph method CalmrExperiment.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a plot with calmr data — calmr_model_plot","title":"Create a plot with calmr data — calmr_model_plot","text":"plot_common_scale() rescales list plots common scale. get_plot_opts() returns generic plotting options. patch_plots() patches plots using patchwork package.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a plot with calmr data — calmr_model_plot","text":"","code":"calmr_model_plot(data, type, model, ...) plot_common_scale(plots) get_plot_opts(common_scale = TRUE) patch_plots(plots, selection = names(plots), plot_options = get_plot_opts())"},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a plot with calmr data — calmr_model_plot","text":"data data.table containing aggregated data CalmrExperiment type character specifying type plot. model character specifying model. ... parameters passed plotting functions. plots list (named) plots, returned plot() calmr_model_plot() common_scale Logical specifying whether plots common scale. selection character numeric vector determining plots patch plot_options list plot options returned get_plot_opts()","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a plot with calmr data — calmr_model_plot","text":"'ggplot' object. plot_common_scale() returns list plots. get_plot_opts() returns list. patch_plots() returns patchwork object.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a plot with calmr data — calmr_model_plot","text":"probably getting plots via plot() method CalmrExperiment.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":null,"dir":"Reference","previous_headings":"","what":"Set verbosity options for calmr — calmr_verbosity","title":"Set verbosity options for calmr — calmr_verbosity","text":"Whether show verbosity messages progress bars","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set verbosity options for calmr — calmr_verbosity","text":"","code":"calmr_verbosity(verbose)"},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set verbosity options for calmr — calmr_verbosity","text":"verbose logical","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set verbosity options for calmr — calmr_verbosity","text":"list progressr handlers (invisibly).","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Set verbosity options for calmr — calmr_verbosity","text":"Progress bars handled progressr package. just convenience function. See package 'progressr' details.","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":null,"dir":"Reference","previous_headings":"","what":"Run models given a set of parameters — compare_models","title":"Run models given a set of parameters — compare_models","text":"Run models given set parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run models given a set of parameters — compare_models","text":"","code":"compare_models(x, models = NULL, ...)"},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run models given a set of parameters — compare_models","text":"x list CalmrExperiment objects design data.frame. models character vector length m, specifying models run. Ignored x list CalmrExperiment objects. ... Arguments passed make_experiment.","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run models given a set of parameters — compare_models","text":"list CalmrExperiment objects","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run models given a set of parameters — compare_models","text":"","code":"# By making experiment beforehand (recommended) df <- get_design(\"blocking\") models <- c(\"HD2022\", \"RW1972\", \"PKH1982\") exps <- lapply(models, function(m) { make_experiment(df, parameters = get_parameters(df, model = m), model = m ) }) comp <- compare_models(exps) # By passing minimal arguments (not recommended; default parameters) comp <- compare_models(df, models = models)"},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit model to data — fit_model","title":"Fit model to data — fit_model","text":"Obtain MLE estimates model, given data.","code":""},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit model to data — fit_model","text":"","code":"fit_model(data, model_function, optimizer_options, file = NULL, ...)"},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit model to data — fit_model","text":"data numeric vector containing data fit model . model_function function runs model returns data.frame value, organized data. optimizer_options list options optimizer, returned get_optimizer_opts. file path save model fit. arguments fit call found identical file, model just gets loaded. ... Extra parameters passed optimizer call.","code":""},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit model to data — fit_model","text":"CalmrFit object","code":""},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Fit model to data — fit_model","text":"See calmr_fits vignette examples","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit model to data — fit_model","text":"","code":"# Make some fake data df <- data.frame(g = \"g\", p1 = \"3A>(US)\", r1 = TRUE) pars <- get_parameters(df, model = \"RW1972\") pars$alphas[\"US\"] <- 0.9 exper <- make_experiment(df, parameters = pars, model = \"RW1972\") res <- run_experiment(exper, outputs = \"responses\") responses <- results(res)$responses$value # define model function model_fun <- function(p, ex) { np <- parameters(ex) np[[1]]$alphas[] <- p parameters(ex) <- np results(run_experiment(ex))$responses$value } # Get optimizer options optim_opts <- get_optimizer_opts( model_pars = names(pars$alphas), ll = rep(.05, 2), ul = rep(.95, 2), optimizer = \"optim\", family = \"identity\" ) optim_opts$initial_pars[] <- rep(.6, 2) fit_model(responses, model_fun, optim_opts, ex = exper, method = \"L-BFGS-B\", control = list(maxit = 1) ) #> Calmr model fit #> -------------- #> Parameters: #> A US #> 0.4386228 0.8962406 #> -------------- #> #> nLogLik: 11.029"},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":null,"dir":"Reference","previous_headings":"","what":"Get basic designs — get_design","title":"Get basic designs — get_design","text":"Get basic designs","code":""},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get basic designs — get_design","text":"","code":"get_design(design_name = NULL)"},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get basic designs — get_design","text":"design_name string specifying design name (default = NULL)","code":""},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get basic designs — get_design","text":"design_name NULL, data.frame containing design. Otherwise, list containing available designs.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get basic designs — get_design","text":"","code":"names(get_design()) #> [1] \"blocking\" \"relative_validity\" \"controlled_blocking\" get_design(\"blocking\") #> Group P1 R1 P2 R2 #> 1 Blocking 10N>(US) FALSE 10NL>(US)/10#L FALSE #> 2 Control FALSE 10NL>(US)/10#L FALSE"},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":null,"dir":"Reference","previous_headings":"","what":"Get optimizer options — get_optimizer_opts","title":"Get optimizer options — get_optimizer_opts","text":"Get optimizer options","code":""},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get optimizer options — get_optimizer_opts","text":"","code":"get_optimizer_opts( model_pars, initial_pars = rep(NA, length(model_pars)), ll = rep(NA, length(model_pars)), ul = rep(NA, length(model_pars)), optimizer = NULL, family = NULL )"},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get optimizer options — get_optimizer_opts","text":"model_pars character vector specifying name parameters fit. initial_pars numeric vector specifying initial parameter values #' evaluate model (required optim). Defaults 0 parameter. ll, ul numeric vector specifying lower upper limits parameters fit, respectively optimizer string specifying optimizer use. One c(\"optim\", \"ga\") family string specifying family function generate responses (calculate likelihood function ). One c(\"identity\", \"normal\", \"poisson\").","code":""},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get optimizer options — get_optimizer_opts","text":"list optimizer options.","code":""},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Get optimizer options — get_optimizer_opts","text":"Whenever family function identity used, family-specific parameters always appended end relevant lists.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Get model parameters — get_parameters","title":"Get model parameters — get_parameters","text":"Get model parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get model parameters — get_parameters","text":"","code":"get_parameters(design, model = NULL)"},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get model parameters — get_parameters","text":"design data.frame containing experimental design. model string specifying model. One supported_models().","code":""},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get model parameters — get_parameters","text":"list model parameters depending model","code":""},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get model parameters — get_parameters","text":"","code":"block <- get_design(\"blocking\") get_parameters(block, model = \"SM2007\") #> $alphas #> L N US #> 0.4 0.4 0.4 #> #> $lambdas #> L N US #> 1 1 1 #> #> $omegas #> L N US #> 0.2 0.2 0.2 #> #> $rhos #> L N US #> 1 1 1 #> #> $gammas #> L N US #> 1 1 1 #> #> $taus #> L N US #> 0.2 0.2 0.2 #> #> $order #> [1] 1 #>"},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":null,"dir":"Reference","previous_headings":"","what":"Get timing design parameters — get_timings","title":"Get timing design parameters — get_timings","text":"Get timing design parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get timing design parameters — get_timings","text":"","code":"get_timings(design)"},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get timing design parameters — get_timings","text":"design data.frame containing experimental design.","code":""},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get timing design parameters — get_timings","text":"list timing design parameters.","code":""},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get timing design parameters — get_timings","text":"","code":"block <- get_design(\"blocking\") get_timings(block) #> $use_exponential #> [1] TRUE #> #> $time_resolution #> [1] 0.5 #> #> $trial_ts #> trial post_trial_delay mean_ITI max_ITI #> 1 N>(US) 1 30 90 #> 2 NL>(US) 1 30 90 #> 3 #L 1 30 90 #> #> $period_ts #> trial period stimulus stimulus_duration #> 1 N>(US) N N 1 #> 2 N>(US) (US) US 1 #> 3 NL>(US) NL N 1 #> 4 NL>(US) NL L 1 #> 5 NL>(US) (US) US 1 #> 6 #L L L 1 #> #> $transition_ts #> trial transition transition_delay #> 1 N>(US) N>(US) 1 #> 2 NL>(US) NL>(US) 1 #>"},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":null,"dir":"Reference","previous_headings":"","what":"Make CalmrExperiment — make_experiment","title":"Make CalmrExperiment — make_experiment","text":"Makes CalmrExperiment object containing arguments necessary run experiment.","code":""},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make CalmrExperiment — make_experiment","text":"","code":"make_experiment( design, model, parameters = NULL, timings = NULL, iterations = 1, miniblocks = TRUE, .callback_fn = NULL, ... )"},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make CalmrExperiment — make_experiment","text":"design design data.frame. model string specifying model name. One supported_models(). parameters Optional. Parameters model returned get_parameters(). timings Optional. Timings time-based design returned get_timings() iterations integer specifying number iterations per group. Default = 1. miniblocks Whether organize trials miniblocks. Default = TRUE. .callback_fn function keeping track progress. Internal use. ... Extra parameters passed functions.","code":""},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make CalmrExperiment — make_experiment","text":"CalmrExperiment object.","code":""},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Make CalmrExperiment — make_experiment","text":"miniblocks option direct sampling function create equally-sized miniblocks random trials within phase. example, phase string \"2A/2B\" create two miniblocks one trial. phase string \"2A/4B\" create two miniblocks one trial, 2 B trials. However, phase string \"2A/1B\" result miniblocks, even miniblocks set TRUE.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make CalmrExperiment — make_experiment","text":"","code":"des <- data.frame(Group = \"G1\", P1 = \"10A>(US)\", R1 = TRUE) ps <- get_parameters(des, model = \"HD2022\") make_experiment( design = des, parameters = ps, model = \"HD2022\", iterations = 2 ) #> ----------------------------- #> CalmrExperiment with model: #> HD2022 #> ----------------------------- #> Design: #> Group P1 R1 #> 1 G1 10A>(US) TRUE #> ----------------------------- #> Parameters: #> $G1 #> $G1$alphas #> A US #> 0.4 0.4 #>"},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":null,"dir":"Reference","previous_headings":"","what":"Model information functions — model_information","title":"Model information functions — model_information","text":"assortment functions return model information.","code":""},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Model information functions — model_information","text":"","code":"supported_models() supported_timed_models() supported_optimizers() supported_families() supported_plots(model = NULL) get_model(model) model_parameters(model = NULL) model_outputs(model = NULL)"},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Model information functions — model_information","text":"model string specifying model. One supported_models().","code":""},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Model information functions — model_information","text":"supported_models() returns character vector. supported_timed_models() returns character vector. supported_optimizers() returns character vector. supported_families() returns character vector. supported_plots() returns character vector list (model NULL). get_model() returns model function. model_parameters() returns list list lists (model NULL). model_outputs() returns character vector list (model NULL).","code":""},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Model information functions — model_information","text":"","code":"# Outputs and plots supported by the RW1972 model model_outputs(\"RW1972\") #> [1] \"associations\" \"responses\" # Getting the model function implementing the PKH1982 model pkh_func <- get_model(\"PKH1982\") head(pkh_func, 10) #> #> 1 function (ev = NULL, iv = NULL, parameters, experience, mapping, #> 2 ...) #> 3 { #> 4 .assert_no_functional(mapping) #> 5 ntrials <- length(experience$tp) #> 6 fsnames <- mapping$unique_functional_stimuli #> 7 if (is.null(ev)) { #> 8 ev <- gen_ss_weights(fsnames) #> 9 } #> 10 if (is.null(iv)) { # Getting the parameters required by SM2007 model_parameters(\"SM2007\") #> $name #> [1] \"alphas\" \"lambdas\" \"omegas\" \"rhos\" \"gammas\" \"taus\" \"order\" #> #> $default_value #> [1] 0.4 1.0 0.2 1.0 1.0 0.2 1.0 #>"},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse design data.frame — parse_design","title":"Parse design data.frame — parse_design","text":"Parse design data.frame","code":""},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse design data.frame — parse_design","text":"","code":"parse_design(df)"},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse design data.frame — parse_design","text":"df data.frame dimensions (groups) (2*phases+1).","code":""},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse design data.frame — parse_design","text":"CalmrDesign object.","code":""},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Parse design data.frame — parse_design","text":"entry even-numbered columns df string formatted per phase_parser().","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parse design data.frame — parse_design","text":"","code":"df <- data.frame( Group = c(\"Group 1\", \"Group 2\"), P1 = c(\"10AB(US)\", \"10A(US)\"), R1 = c(TRUE, TRUE) ) parse_design(df) #> CalmrDesign built from data.frame: #> Group P1 R1 #> 1 Group 1 10AB(US) TRUE #> 2 Group 2 10A(US) TRUE #> ---------------- #> Trials detected: #> group phase trial_names trial_repeats is_test stimuli #> 1 Group 1 P1 AB(US) 10 FALSE A;B;US #> 2 Group 2 P1 A(US) 10 FALSE A;US"},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":null,"dir":"Reference","previous_headings":"","what":"Rat responses from Patittucci et al. 2016 — pati","title":"Rat responses from Patittucci et al. 2016 — pati","text":"dataset containing rat nose pokes lever presses levers associated different appetitive stimuli.","code":""},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rat responses from Patittucci et al. 2016 — pati","text":"","code":"pati"},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Rat responses from Patittucci et al. 2016 — pati","text":"data.frame following variables: subject subject identifier block 2-session block training (1 8) lever lever presented trial: L = left; R = right us stimulus followed lever: P = pellet; S = sucrose response response: lp = lever press; np = nose poke rpert responses per trial","code":""},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Rat responses from Patittucci et al. 2016 — pati","text":"Patittucci et al. (2016). JEP:ALC","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":null,"dir":"Reference","previous_headings":"","what":"Parses a phase string — phase_parser","title":"Parses a phase string — phase_parser","text":"Parses phase string","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parses a phase string — phase_parser","text":"","code":"phase_parser(phase_string)"},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parses a phase string — phase_parser","text":"phase_string string specifying trials within phase.","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parses a phase string — phase_parser","text":"named list : trial_info: trial-named list lists. general_info: General phase information.","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Parses a phase string — phase_parser","text":"function meant internal use , expose can test strings.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parses a phase string — phase_parser","text":"","code":"# A silly (but valid) string phase_parser(\"10#Rescorla>Wagner\") #> $trial_info #> $trial_info$`10#Rescorla>Wagner` #> $trial_info$`10#Rescorla>Wagner`$name #> [1] \"#Rescorla>Wagner\" #> #> $trial_info$`10#Rescorla>Wagner`$repetitions #> [1] 10 #> #> $trial_info$`10#Rescorla>Wagner`$is_test #> [1] TRUE #> #> $trial_info$`10#Rescorla>Wagner`$periods #> [1] \"Rescorla\" \"Wagner\" #> #> $trial_info$`10#Rescorla>Wagner`$nominals #> $trial_info$`10#Rescorla>Wagner`$nominals$Rescorla #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" #> #> $trial_info$`10#Rescorla>Wagner`$nominals$Wagner #> [1] \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> #> $trial_info$`10#Rescorla>Wagner`$functionals #> $trial_info$`10#Rescorla>Wagner`$functionals$Rescorla #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" #> #> $trial_info$`10#Rescorla>Wagner`$functionals$Wagner #> [1] \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> #> $trial_info$`10#Rescorla>Wagner`$all_nominals #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> $trial_info$`10#Rescorla>Wagner`$all_functionals #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> #> #> $general_info #> $general_info$trial_names #> [1] \"#Rescorla>Wagner\" #> #> $general_info$trial_repeats #> [1] 10 #> #> $general_info$is_test #> [1] TRUE #> #> $general_info$nomi2func #> R e s c o r l a W g n #> \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"g\" \"n\" #> #> $general_info$func2nomi #> R e s c o r l a W g n #> \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"g\" \"n\" #> #> # An invalid string that needs trial repetitions for one of trials. try(phase_parser(\"10#Rescorla/Wagner\")) #> Error in if (is.na(treps)) 1 else treps : argument is of length zero"},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":null,"dir":"Reference","previous_headings":"","what":"General plotting functions — plotting_functions","title":"General plotting functions — plotting_functions","text":"plot_targetted_tbins() plots targetted time data trial. plot_tbins() plots non-targetted time data trial. plot_targetted_trials() plots targetted trial data. plot_trials() plots non-targetted trial data. plot_targetted_typed_trials() plots targetted trial data type. plot_targetted_complex_trials() plots targetted data third variable","code":""},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"General plotting functions — plotting_functions","text":"","code":"plot_targetted_tbins(data, t = max(data$trial)) plot_tbins(data, t = max(data$trial)) plot_targetted_trials(data) plot_trials(data) plot_targetted_typed_trials(data) plot_targetted_complex_trials(data, col)"},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"General plotting functions — plotting_functions","text":"data data.frame-like data plot. t numeric vector specifying trial(s) plot. Defaults last trial data. col string specifying column third variable.","code":""},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"General plotting functions — plotting_functions","text":"plot_targetted_tbins() returns 'ggplot' object. plot_tbins() returns 'ggplot' object. plot_targetted_trials() returns 'ggplot' object. plot_trials() returns 'ggplot' object. plot_targetted_typed_trials() returns 'ggplot' object. plot_targetted_complex_trials() returns 'ggplot' object.","code":""},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"General plotting functions — plotting_functions","text":"data must organised returned results() parsed_results().","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":null,"dir":"Reference","previous_headings":"","what":"Run experiment — run_experiment","title":"Run experiment — run_experiment","text":"Runs experiment minimal parameters.","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run experiment — run_experiment","text":"","code":"run_experiment(x, outputs = NULL, parse = TRUE, aggregate = TRUE, ...)"},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run experiment — run_experiment","text":"x CalmrExperiment design data.frame outputs character vector specifying outputs parse aggregate. Defaults NULL, case model outputs parsed/aggregated. parse logical specifying whether raw results parsed. Default = TRUE. aggregate logical specifying whether parsed results aggregated. Default = TRUE. ... Arguments passed functions","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run experiment — run_experiment","text":"CalmrExperiment results.","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run experiment — run_experiment","text":"","code":"# Using a data.frame only (throws warning) df <- get_design(\"relative_validity\") run_experiment(df, model = \"RW1972\") #> Warning: Using default model parameters. #> ----------------------------- #> CalmrExperiment with model: #> RW1972 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 True 10AB(US)/10AC TRUE 1#A TRUE #> 2 Pseudo 5AB(US)/5AB/5AC(US)/5AC TRUE 1#A TRUE #> ----------------------------- #> Parameters: #> $True #> $True$alphas #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $True$betas_on #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $True$betas_off #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $True$lambdas #> A B C US #> 1 1 1 1 #> #> #> $Pseudo #> $Pseudo$alphas #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $Pseudo$betas_on #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $Pseudo$betas_off #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $Pseudo$lambdas #> A B C US #> 1 1 1 1 #> # Using custom parameters df <- get_design(\"relative_validity\") pars <- get_parameters(df, model = \"HD2022\") pars$alphas[\"US\"] <- 0.6 run_experiment(df, parameters = pars, model = \"HD2022\") #> ----------------------------- #> CalmrExperiment with model: #> HD2022 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 True 10AB(US)/10AC TRUE 1#A TRUE #> 2 Pseudo 5AB(US)/5AB/5AC(US)/5AC TRUE 1#A TRUE #> ----------------------------- #> Parameters: #> $True #> $True$alphas #> A B C US #> 0.4 0.4 0.4 0.6 #> #> #> $Pseudo #> $Pseudo$alphas #> A B C US #> 0.4 0.4 0.4 0.6 #> # Using make_experiment, for more iterations df <- get_design(\"blocking\") pars <- get_parameters(df, model = \"SM2007\") exper <- make_experiment(df, parameters = pars, model = \"SM2007\", iterations = 4 ) run_experiment(exper) #> ----------------------------- #> CalmrExperiment with model: #> SM2007 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 Blocking 10N>(US) FALSE 10NL>(US)/10#L FALSE #> 2 Control FALSE 10NL>(US)/10#L FALSE #> ----------------------------- #> Parameters: #> $Blocking #> $Blocking$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Blocking$lambdas #> L N US #> 1 1 1 #> #> $Blocking$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$rhos #> L N US #> 1 1 1 #> #> $Blocking$gammas #> L N US #> 1 1 1 #> #> $Blocking$taus #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$order #> [1] 1 #> #> #> $Control #> $Control$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Control$lambdas #> L N US #> 1 1 1 #> #> $Control$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Control$rhos #> L N US #> 1 1 1 #> #> $Control$gammas #> L N US #> 1 1 1 #> #> $Control$taus #> L N US #> 0.2 0.2 0.2 #> #> $Control$order #> [1] 1 #> # Only parsing the associations in the model, without aggregation run_experiment(exper, outputs = \"associations\", aggregate = FALSE) #> ----------------------------- #> CalmrExperiment with model: #> SM2007 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 Blocking 10N>(US) FALSE 10NL>(US)/10#L FALSE #> 2 Control FALSE 10NL>(US)/10#L FALSE #> ----------------------------- #> Parameters: #> $Blocking #> $Blocking$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Blocking$lambdas #> L N US #> 1 1 1 #> #> $Blocking$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$rhos #> L N US #> 1 1 1 #> #> $Blocking$gammas #> L N US #> 1 1 1 #> #> $Blocking$taus #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$order #> [1] 1 #> #> #> $Control #> $Control$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Control$lambdas #> L N US #> 1 1 1 #> #> $Control$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Control$rhos #> L N US #> 1 1 1 #> #> $Control$gammas #> L N US #> 1 1 1 #> #> $Control$taus #> L N US #> 0.2 0.2 0.2 #> #> $Control$order #> [1] 1 #>"},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Set reward parameters for ANCCR model — set_reward_parameters","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"Set reward parameters ANCCR model","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"","code":"set_reward_parameters(parameters, rewards = c(\"US\"))"},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"parameters list parameters, returned get_parameters() rewards character vector specifying reward stimuli. Default = c(\"US\")","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"list parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"default behaviour get_parameters ANCCR model set every reward-related parameter non-zero default value. function set parameters zero non-reward stimuli","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-062","dir":"Changelog","previous_headings":"","what":"calmr 0.6.2","title":"calmr 0.6.2","text":"Aggregation ANCCR data now ignores time; time entries averaged. Added Temporal Difference model name “TD”. model experimental state. Experiments time-based models now require separate list construct time-based experiences. See get_timings(). Added experiences<-, timings, timings<- methods CalmrExperiment class. Revamped plotting functions parsing functions. Revamped output names models make intelligible. Fixed bug related aggregation pools HDI2020 HD2022. Consolidated man pages.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-061","dir":"Changelog","previous_headings":"","what":"calmr 0.6.1","title":"calmr 0.6.1","text":"CRAN release: 2024-03-14 Added outputs argument run_experiment(), parse(), aggregate(), allowing user parse/aggregate model outputs. Documentation corrections CRAN resubmission.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-060","dir":"Changelog","previous_headings":"","what":"calmr 0.6.0","title":"calmr 0.6.0","text":"Added dependency data.table resulting great speedups large experiments. Replaced dependency cowplot dependency patchwork. Removed dependencies tibble, dplyr, tidyr, packages tidyverse. Removed shiny app package. previous app now distributed separately via calmr.app package available GitHub. Test coverage reached 100%. package now ready CRAN submission.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-051","dir":"Changelog","previous_headings":"","what":"calmr 0.5.1","title":"calmr 0.5.1","text":"Added parallelization progress bars via future, future.apply, progressr. Function calmr_verbosity can set verbosity package.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-050","dir":"Changelog","previous_headings":"","what":"calmr 0.5.0","title":"calmr 0.5.0","text":"Implementation ANCCR (Jeong et al., 2022), first time-based model included calmr. Added parameter distinction trial-wise period-wise parameters. Added internal augmentation arguments depending model. trial-based models use pre/post distinctions anymore. Using “>” special character affect models anymore. “>” special character used specify periods within trial. example, “>B>C” implies followed B followed C. See using_time_models vignette additional information. Named stimuli now support numbers trailing characters (e.g., “(US1)” valid now.)","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-040","dir":"Changelog","previous_headings":"","what":"calmr 0.4.0","title":"calmr 0.4.0","text":"Major refactoring classes models. help development moving forward. Added several methods access CalmrExperiment contents, including c (bind experiments) results, plot, graph, design, parameters. Created CalmrDesign CalmrResult classes. Rewrote parsers less verbose rely less tidyverse suite piping. Substantially reduced complexity make_experiment function (previous make_experiment). Introduced distinction stimulus-specific global parameters. Parameters now lists instead data.frames. Modified UI calmr app include sidebar. Simplified app removing options. Nearly duplicated number tests.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-030","dir":"Changelog","previous_headings":"","what":"calmr 0.3.0","title":"calmr 0.3.0","text":"Added first version SOCR model (SM2007) well two vignettes explaining math behind implementation quick simulations. Documentation progress.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-020","dir":"Changelog","previous_headings":"","what":"calmr 0.2.0","title":"calmr 0.2.0","text":"Added multiple models package app (RW1972, PKH1982, MAC1975). Implementation basic S4 classes model, experiment, fit, RSA comparison objects, well methods. Added genetic algorithms (via GA) parameter estimation. Added basic tools perform representational similarity analysis. Documentation progress.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-010","dir":"Changelog","previous_headings":"","what":"calmr 0.1.0","title":"calmr 0.1.0","text":"heidi now calmr. package now aims maintain several associative learning models implement tools use. Major overhaul training function (train_pav_model). relevant calculations now done function functional stimuli instead just US. Support specification expectation/correction steps within trial via “>”. example, trial “>(US)” use generate expectation, learn stimuli correction step. previous plotting function R-values revamped allow simple complex versions. complex version facets r-values predictor basis, uses colour lines target. Bugfix related stimulus saliencies.","code":""}]
+[{"path":"https://victornavarro.org/calmr/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc. Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://victornavarro.org/calmr/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use “box”. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. information , apply follow GNU GPL, see . GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read .","code":" Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"the-mathematics-behind-anccr","dir":"Articles","previous_headings":"","what":"The mathematics behind ANCCR","title":"ANCCR","text":"ANCCR (Jeong et al., 2022) model, stands adjusted net contingency causal relations, proposes mesolimbic dopaminergic conveys adjusted net contingency causal relationships (biologically meaningful targets). mathematics (logic) behind model go well beyond can cover , now, suffice say model: Uses “Hebbian” mechanism learn retrospective associations experiencing meaningful causal target. Derives prospective associations using Bayes’s rule. Combines associations contingency terms represent dopaminergic activity. Uses sign dopaminergic activity strengthen weaken causal weights. Responds function prospective associations causal links.","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"maintaining-stimulus-representations","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"1 - Maintaining stimulus representations","title":"ANCCR","text":"degree stimulus \\(\\) time \\(t\\) “active” memory denoted : \\[ \\tag{Eq.1} E_i(t) = \\Sigma_{t_i \\leq t}e^{-(\\frac{t-t_i}{t\\_constant})} \\] \\(t_i\\) time steps time \\(t\\), \\(t\\_constant\\) time constant (usually meant inter-reward rate)1","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"learning-stimulus-associations","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"2 - Learning stimulus associations:","title":"ANCCR","text":"model learns retrospective associations meaningful causal targets occur. Whether event \\(j\\) meaningful causal target given : \\[ \\tag{Eq.2} \\Phi_j = \\begin{cases} 1,& \\text{} \\Phi_j(t) = 1\\\\ 1,& \\text{}DA_j + \\beta_j > \\theta\\\\ 0,& \\text{otherwise} \\end{cases} \\] \\(\\Phi\\) plays role indicator function, \\(DA_j\\) total dopamine activity time event \\(j\\), \\(\\beta_j\\) unconditioned value event \\(j\\) \\(\\theta\\) global threshold parameter.2 Note indicator function self-preserving: stimulus becomes meaningful causal target, stop . stimulus \\(j\\) observed, predecessor representation contingency, PRC, stimulus \\(\\) updated via: \\[ \\tag{Eq.3} PRC_{\\leftarrow j} = M_{\\leftarrow j} - M_{} \\] \\(M_{\\leftarrow j}\\) predecessor representation \\(\\) given \\(j\\) occurred, \\(M_{}\\) base rate \\(\\) occurs. quantities given : \\[ \\tag{Eq.4a} M_{\\leftarrow j} = M_{\\leftarrow j}' + \\Phi_j\\alpha(E_{\\leftarrow j} - M_{\\leftarrow j}') \\] \\[ \\tag{Eq.4b} M_{} = M_{}' + k\\alpha(E_{} - M_{}') \\] \\(M_{\\leftarrow j}'\\) \\(M_{}'\\) quantities \\(j\\) observed, \\(k\\) \\(\\alpha\\) learning rate parameters, \\(E_{\\leftarrow j}\\) elegibility trace stimulus \\(\\) time \\(j\\) occurs (see Eq. 1). , PRC can used derive prospective association, aptly named successor representation contingency, SRC via Bayes rule: \\[ \\tag{Eq.5} SRC_{\\rightarrow j} = PRC_{\\leftarrow j} \\frac{M_j}{M_i} \\] base rate \\(j\\), \\(M_j\\) calculated via Eq.4b.","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"releasing-dopamine","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"3 - Releasing Dopamine","title":"ANCCR","text":"model postulates dopaminergic signaling encodes adjusted net contingencies causal relations stimuli, ANCCRs. total dopaminergic activity time event \\(\\) equal : \\[ \\tag{Eq.6} DA_i = \\Sigma_j (ANCCR_{\\rightarrow j}\\Phi_j) \\] ANCCR stimulus \\(\\) stimulus \\(j\\) given : \\[ \\tag{Eq.7} ANCCR_{\\rightarrow j} = NC_{\\leftrightarrow j} CW_{\\rightarrow j} - \\sum_{k \\neq }(ANCCR_{k \\leftrightarrow j}\\Delta_{k \\leftarrow }\\Phi_{k \\leftrightarrow }) \\] \\(NC_{\\leftrightarrow j}\\) net contingency stimuli \\(\\) \\(j\\), \\(CW_{\\rightarrow j}\\) causal weight \\(\\) \\(j\\), \\(\\Delta_{k \\leftarrow }\\) recency stimulus \\(k\\) respect stimulus \\(\\), \\(\\Phi_{k \\leftrightarrow }\\) indicator function denoting whether \\(k\\) \\(\\) putative causal relationship . net contingency stimuli \\(\\) \\(j\\), \\(NC_{\\leftrightarrow j}\\), given : \\[ \\tag{Eq.8} NC_{\\leftrightarrow j} = wSRC_{\\rightarrow j} + (1-w)PRC_{\\leftarrow j} \\] weighted sum successor predecessor representation contingencies. net contingency used calculate indicator function , : \\[ \\tag{Eq.9} \\Phi_{k \\leftrightarrow } = \\begin{cases} 1,& \\text{} NC_{\\leftrightarrow j} > \\theta\\\\ 0,& \\text{otherwise} \\end{cases} \\] \\(\\theta\\) threshold parameter used Eq.23, indicator function stimulus , \\(\\Phi_{\\leftrightarrow }\\), 0. recency term, \\(\\Delta_{k \\leftarrow }\\), given : \\[ \\tag{Eq.10} \\Delta_{k \\leftarrow } = e^{-(\\frac{t_j-t_i}{t\\_constant})} \\] \\(t\\_constant\\) parameter used Eq.1. Note however Eq.9 include sum term Eq. 1. Finally, causal weight stimulus \\(\\) stimulus \\(j\\) given : \\[ \\tag{Eq.11} CW_{\\rightarrow j} = CW_{\\rightarrow j}' + \\alpha_{reward}\\delta_{\\rightarrow j} \\] \\(CW_{\\rightarrow j}'\\) previous causal weight, \\(\\alpha_{reward}\\) learning rate parameter exclusive causal weights, \\(\\delta_{\\rightarrow j}\\) delta term depending sign total dopaminergic activity, given : \\[ \\tag{Eq.12} \\delta_{\\rightarrow j} = \\begin{cases} CW_{j \\rightarrow j} - CW_{\\rightarrow j}, & \\text{} DA_j \\ge 0\\\\ (0-CW_{\\rightarrow j})\\frac{n_i^{-1}\\Delta{\\leftarrow j} \\Phi_{\\leftrightarrow j}}{\\Sigma_{k \\neq j}(n_k^{-1}\\Delta_{k \\leftarrow j} \\Phi_{k \\leftrightarrow j})},& \\text{otherwise} \\end{cases} \\] \\(CW_{j \\rightarrow j}\\) reward magnitude stimulus \\(j\\). plain words, dopaminergic activity positive, causal weights (present absent stimuli) strengthen. Conversely, dopaminergic activity negative, causal weights (present absent stimuli) weaken, proportional normalized frequency recency (long putative causal relations \\(j\\)).","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind ANCCR","what":"4 - Generating responses","title":"ANCCR","text":"Responding ANCCR lightly specified. value responding upon presentation stimulus \\(\\) given : \\[ \\tag{Eq.13} Q_i = \\Sigma_k(SRC_{\\rightarrow k} CW_{\\rightarrow k}) \\] can mapped onto probabilities via softmax function4.","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"a-diagram","dir":"Articles","previous_headings":"The mathematics behind ANCCR > 4 - Generating responses","what":"A diagram","title":"ANCCR","text":"diagram shows dependencies model. excluding indicator functions parameters simplicity.5","code":""},{"path":"https://victornavarro.org/calmr/articles/ANCCR.html","id":"note","dir":"Articles","previous_headings":"The mathematics behind ANCCR > 4 - Generating responses","what":"Note","title":"ANCCR","text":"implementation model port MATLAB code Jeong et al. shared GitHub repository associated paper. output R model checked outputs MATLAB model, using training routines (“eventlogs” parlance) generated using MATLAB code. training routines generated calmr differ somewhat, accommodate generality. example, version 0.6.1, possible specify probabilistic relations cues rewards. Instead, left user specify exact probability via trial numbers (e.g., 80% reward probability can specified “80A>(US)/20A”). naming parameters also differs codebases.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"the-mathematics-behind-heidi","dir":"Articles","previous_headings":"","what":"The mathematics behind HeiDI","title":"HD2022","text":"HeiDI model four major components: 1) acquisition reciprocal associations stimuli, 2) pooling associations stimulus activations, 3) distribution activations stimulus-specific response units, 4) generation responses.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"acquiring-reciprocal-associations","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"1 - Acquiring reciprocal associations","title":"HD2022","text":"Whenever trial given, HeiDI learns associations among stimuli. association two stimuli, \\(\\) \\(j\\) denoted via \\(v_{,j}\\). association \\(v_{,j}\\) represents directional expectation: expectation \\(j\\) presented \\(\\). Furthermore, value represents nature effect \\(\\) representation \\(j\\). positive, presentation \\(\\) “excites” representation \\(j\\). negative, presentation \\(\\) “inhibits” representation \\(j\\). HeiDI learns “forward” associations stimuli, also reciprocal, “backward” associations. Thus, organisms presented \\(\\rightarrow j\\), organisms learn \\(v_{,j}\\), also \\(v_{j, }\\), expectation receiving \\(\\) presented \\(j\\). Note , sake brevity, learning equations specified forward associations.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"the-stimulus-expectation-rule","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 1 - Acquiring reciprocal associations","what":"1.1 - The stimulus expectation rule","title":"HD2022","text":"HeiDI generates expectations stimuli. expectation stimulus \\(j\\) (\\(e_j\\)) expressed \\[ \\tag{Eq. 1} e_j = \\sum_{k}^{K}x_kv_{k,j} \\] \\(K\\) set containing stimuli experiment, \\(x_k\\) quantity denoting presence absence stimulus \\(k\\) (1 0, respectively)1.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"learning-rule","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 1 - Acquiring reciprocal associations","what":"1.2 - Learning rule","title":"HD2022","text":"HeiDI learns appropriate expectations via error-correction mechanisms. trial \\(t\\), association stimuli \\(\\) \\(j\\) expressed \\[ \\tag{Eq. 2} v_{,j, t} = v_{,j, t-1} + \\Delta v_{,j, t} \\] \\(v_{j,, t-1}\\) forward association \\(\\) \\(j\\) trial \\(t-1\\), \\(\\Delta v_{,j, t}\\) change association result trial \\(t\\). delta term uses pooled error term expressed \\[ \\tag{Eq. 3} \\Delta v_{,j} = x_i\\alpha_i(x_jc\\alpha_j - e_j) \\] \\(\\alpha_i\\) \\(\\alpha_j\\) parameters representing salience stimuli \\(\\) \\(j\\), respectively (\\(0 \\le \\alpha \\le 1\\)), \\(c\\) scaling constant (\\(c = 1\\)). Note term denoting trial, \\(t\\) omitted simplicity.","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"pooling-the-strength-of-associations","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"2 - Pooling the strength of associations","title":"HD2022","text":"HeiDI pools stimulus associations activate stimulus-specific representations. activation representation stimulus \\(j\\), \\(a_j\\), defined : \\[ \\tag{Eq. 4} a_{j,M} = o_{j,M} + h_{j,M} \\] \\(o_{j,M}\\) denotes combined associative strength towards stimulus \\(j\\) presence stimuli \\(M\\), \\(h_{j,M}\\) denotes chained associative strength towards stimulus \\(j\\) presence stimuli \\(M\\).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"combined-associative-strength","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 2 - Pooling the strength of associations","what":"2.1 - Combined associative strength","title":"HD2022","text":"quantity \\(o_{j,M}\\) result combining associative strength forward backward associations stimulus \\(j\\) \\[ \\tag{Eq. 5} o_{j,M} = \\sum_{m \\neq j}^{M}v_{m,j} + \\left(\\frac{\\sum_{m \\neq j}^{M}v_{m,j} \\sum_{m \\neq j}^{M}v_{j,m}}{c}\\right) \\] sums run stimuli \\(M\\) presented trial, different stimulus \\(j\\).2 left-hand term describes forward associations stimuli \\(M\\) \\(j\\) affect representation \\(j\\), whereas right-hand term describes backward associations \\(j\\) stimuli \\(M\\) affect representation (although modulated forward associations ).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"chained-associative-strength","dir":"Articles","previous_headings":"The mathematics behind HeiDI > 2 - Pooling the strength of associations","what":"2.2 - Chained associative strength","title":"HD2022","text":"quantity \\(h_{j,M}\\) captures indirect associative strength stimuli \\(M\\) \\(j\\), via absent stimuli. , \\(h_{j,M}\\) defined \\[ \\tag{Eq. 6a} h_{j,M} = \\sum_{m \\neq j}^{M} \\sum_{n}^{N}\\frac{v_{m,n}o_{j,n}}{c} \\] N stimuli presented trial (.e., K-M). Note re-use \\(o\\), quantity defined Eq. 5. equation allows absent stimuli \\(N\\) influence representation stimulus \\(j\\), long association present stimuli \\(M\\). Honey Dwyer (2022), authors specify similarity-based mechanism modulates effect associative chains according similarity salience nominal retrieved stimuli3. , Eq. 6a expanded : \\[ \\tag{Eq. 6b} h_{j,M} = \\sum_{m \\neq j}^{M} \\sum_{n}^{N}S(\\alpha_{n}, \\alpha'_n)\\frac{v_{m,n}o_{j,n}}{c} \\] \\(S\\) similarity function takes nominal salience stimulus n, \\(\\alpha_n\\) (perceived \\(n\\) presented trial) retrieved salience, \\(\\alpha'_n\\) (perceived \\(n\\) retrieved via stimuli M, see ahead). function defined : \\[ \\tag{Eq. 7} S(\\alpha_n, \\alpha'_n) = \\frac{\\alpha_n}{\\alpha_n + |\\alpha_n-\\alpha'_n|} \\times \\frac{\\alpha'_n}{\\alpha'_n+ |\\alpha_n-\\alpha'_n|} \\] Notably, whenever one nominal salience given stimulus, \\(\\alpha_n\\) arithmetic mean among nominal values (see “heidi_similarity” vignette).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"distributing-strength-into-stimulus-specific-response-units","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"3 - Distributing strength into stimulus-specific response units","title":"HD2022","text":"HeiDI distributes pooled stimulus-specific strength among \\(K\\) stimuli, according relative salience. activation response unit \\(j\\), \\(R_j\\) expressed \\[ \\tag{Eq. 8} R_{j,k} = \\frac{\\theta(j)}{\\sum_{k}^{K}\\theta(k)}a_{k,M} \\] \\(j \\K\\). \\(K\\) can include present absent stimuli, \\(\\theta\\) function depends whether stimulus \\(k\\) absent (.e., \\(k \\N\\)) (.e., \\(k \\M\\)), : \\[ \\tag{Eq. 9} \\theta(k) = \\begin{cases} \\left |\\sum_{m}^{M}\\left( v_{m,k}+\\sum_{n \\neq k}^{N}\\frac{v_{m,n}v_{n,k}}{c}\\right) \\right|,& \\text{} k \\N\\\\ \\alpha_k, & \\text{otherwise} \\end{cases} \\] Note quantity absent stimuli absolute, prevent negative \\(\\theta\\) values due inhibitory associations4. Also, note summation term used left-hand side expression absent stimulus. implies present stimuli \\(M\\) contribute salience stimulus \\(k\\). Finally, note right-hand side expression present stimuli contribute via direct association \\(k\\), \\(v_{m,k}\\) also associative chains absent stimuli (c.f., Eq. 6a).","code":""},{"path":"https://victornavarro.org/calmr/articles/HD2022.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind HeiDI","what":"4 - Generating responses","title":"HD2022","text":"Finally, HeiDI responds. response-generating mechanisms HeiDI currently underspecified. current version, HeiDI’s responses product activation stimulus-specific response units connection units specific motor units. , activation motor unit \\(q\\), \\(r_q\\), given \\[ \\tag{Eq. 10} r_q = R_jw_{j,q} \\] \\(w_{j,q}\\) weight representing association stimulus-specific unit \\(j\\) motor unit \\(q\\).","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"the-mathematics-behind-mac1975","dir":"Articles","previous_headings":"","what":"The mathematics behind MAC1975","title":"MAC1975","text":"grand departure global error term models RW1972 (Rescorla & Wagner, 1972), MAC1975 model (Mackintosh, 1975) uses local error terms changes stimulus associability (\\(\\alpha\\)) via error comparison mechanism promotes learning uncertain stimuli:","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"generating-expectations","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"1 - Generating expectations","title":"MAC1975","text":"Let \\(v_{k,j}\\) denote associative strength stimulus \\(k\\) stimulus \\(j\\). given trial, expectation stimulus \\(j\\), \\(e_j\\), given : \\[ \\tag{Eq.1} e_j = \\sum_{k}^{K}x_k v_{k,j} \\] \\(x_k\\) denotes presence (1) absence (0) stimulus \\(k\\), set \\(K\\) represents stimuli design.","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"2 - Learning associations","title":"MAC1975","text":"Changes association stimulus \\(\\) \\(j\\), \\(v_{,j}\\), given : \\[ \\tag{Eq.2} \\Delta v_{,j} = x_i \\alpha_i \\beta_j (\\lambda_j - v_{,j}) \\] \\(\\alpha_i\\) associability (attention devoted ) stimulus \\(\\), \\(\\beta_j\\) learning rate parameter determined properties \\(j\\), \\(\\lambda_j\\) maximum association strength supported \\(j\\) (asymptote).","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"learning-to-attend","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"3 - Learning to attend","title":"MAC1975","text":"parameter \\(\\alpha_i\\) changes function learning, proportionally difference absolute errors conveyed \\(\\) predictors1, via: \\[ \\tag{Eq.3} \\Delta \\alpha_{} = x_i\\theta_i \\sum_{j}^{K}\\gamma_j(|\\lambda_j - \\sum_{k \\ne }^{K}v_{k,j}|-|\\lambda_j - v_{,j}|) \\] \\(\\theta_i\\) attentional learning rate parameter stimulus \\(\\) (usually fixed across stimuli). Although Mackintosh (1975) extend model account predictive power within-compound associations, implementation model package . can sometimes result unexpected behavior, , Eq. 3 includes extra parameter \\(\\gamma_j\\) (defaulting 1/K) denotes whether expectation stimulus \\(j\\) contributes attentional learning. , user can set parameters manually reflect contribution different experimental stimuli. example, simple “AB>(US)” design, setting \\(\\gamma_{US}\\) = 1 \\(\\gamma_{} = \\gamma_{B} = 0\\) leads behavior original model.","code":""},{"path":"https://victornavarro.org/calmr/articles/MAC1975.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind MAC1975","what":"4 - Generating responses","title":"MAC1975","text":"specification response-generating mechanisms MAC1975. However, simplest response function can adopted identity function stimulus expectations. , responses reflecting nature \\(j\\), \\(r_j\\), given : \\[ \\tag{Eq.4} r_j = e_j \\]","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"the-mathematics-behind-pkh1982","dir":"Articles","previous_headings":"","what":"The mathematics behind PKH1982","title":"PKH1982","text":"Another departure global error term models RW1972 (Rescorla & Wagner, 1972), PKH1982 model (Pearce et al., 1982) use error term learning excitatory associations (inhibitory associations), ties stimulus associability (\\(\\alpha\\)) absolute global prediction error. note: implementation model closely follows technical note CAL-R group possible. Divergences noted.","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"generating-expectations","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"1 - Generating expectations","title":"PKH1982","text":"Let \\(v_{k,j}\\) denote excitatory strength stimulus \\(k\\) stimulus \\(j\\), \\(v_{k,\\overline j}\\) inhibitory strength stimulus \\(k\\) stimulus \\(j\\) (effectively, “j” representation). given trial, net expectation stimulus \\(j\\), \\(e_j\\), given : \\[ \\tag{Eq.1} e_j = \\sum_{k}^{K}x_k v_{k,j} - \\sum_{k}^{K}x_k v_{k,\\overline j} \\] \\(x_k\\) denotes presence (1) absence (0) stimulus \\(k\\), set \\(K\\) represents stimuli design.","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"2 - Learning associations","title":"PKH1982","text":"Changes excitatory inhibitory associations stimuli given : \\[ \\tag{Eq.2a} \\Delta v_{,j} = \\delta_jx_i \\beta_{ex,j} \\alpha_i \\lambda_j \\] \\[ \\tag{Eq.2b} \\Delta v_{,\\overline j} = x_i \\beta_{,j} \\alpha_i |\\overline{\\lambda_j}| \\] \\(\\beta_{ex,j}\\) \\(\\beta_{,j}\\) represent learning rates excitatory inhibitory associations, respectively, determined stimulus \\(j\\), \\(\\alpha_i\\) associability stimulus \\(\\), respectively, \\(\\lambda_j\\) \\(\\overline {\\lambda_j}\\) excitatory asymptote overexpectation stimulus \\(j\\), respectively. Importantly, \\(\\delta_j\\) Eq.2a parameter equal 1 expectation stimulus \\(j\\), lower excitatory asymptote (.e., \\(e_j < \\lambda_j\\)), 0 . implies model stops strengthening \\(v_{,j}\\) expectation \\(j\\) higher excitatory asymptote. mentioned introductory note, PKH1982 model learn excitatory associations via correction error. However, model learn inhibitory associations via correction error, overexpectation term , \\(\\overline {\\lambda_j}\\) equal \\(min(\\lambda_j - e_j, 0)\\), \\(min\\) minimum function. implies \\(\\overline {\\lambda_j}\\) takes non-zero values expectation \\(j\\) higher intensity trial (\\(\\lambda_j\\)).","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"learning-to-attend","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"3 - Learning to attend","title":"PKH1982","text":"associability parameter \\(\\alpha_i\\) changes completely trial trial function learning (note lack \\(\\Delta\\) ), change equal difference absolute global error, via: \\[ \\tag{Eq.3} \\Delta \\alpha_{} = x_i \\sum_{j}^{K}\\gamma_j(|\\lambda_j - e_j|) \\] \\(\\gamma_j\\) denotes contribution prediction error based jth stimulus. regard, important note Pearce et al. (1982) extend model account predictive power within-compound associations, yet implementation model package . can sometimes result unexpected behaviour, , Eq. 3 includes extra parameter \\(\\gamma_j\\) (defaulting 1/K) denotes whether expectation stimulus \\(j\\) contributes attentional learning. , user can set parameters manually reflect contribution different experimental stimuli. example, simple “AB>(US)” design, setting \\(\\gamma_{US}\\) = 1 \\(\\gamma_{} = \\gamma_{B} = 0\\) leads behavior original model. PKH1982 model improves upon Pearce & Hall (1980) model adding extra parameter controls rate associability changes. qualify changes associability determined Eq.3 via \\(\\Delta\\alpha_{}^{n}\\) (meaning happened trial \\(n\\)), can quantify total associability stimulus \\(\\) trial \\(n\\) via: \\[ \\tag{Eq.4} \\alpha_{}^{n} = \\begin{cases} (1-\\theta_i) \\alpha_{}^{n-1} + \\theta_i\\Delta\\alpha_{j}^n &\\text{, } x_i = 1\\\\ \\alpha_{}^{n} & \\text{, otherwise} \\end{cases} \\] \\(\\theta_i\\) parameter determining rate associability decays (via \\(1-\\theta_i\\)), rate increments attention occur. Note changes associability apply stimuli presented trial (.e., \\(x_i = 1\\)); attention absent stimuli remains unchanged.","code":""},{"path":"https://victornavarro.org/calmr/articles/PKH1982.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind PKH1982","what":"4 - Generating responses","title":"PKH1982","text":"specification response-generating mechanisms PKH1982. However, simplest response function can adopted identity function stimulus expectations. , responses reflecting nature \\(j\\), \\(r_j\\), given : \\[ \\tag{Eq.5} r_j = e_j \\]","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/RAND.html","id":"the-mathematics-behind-rand","dir":"Articles","previous_headings":"","what":"The mathematics behind RAND","title":"RAND","text":"RAND RW-based model associations randomized every trial. Therefore, model responds randomly. model meant comparisons .","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"the-mathematics-behind-rw1972","dir":"Articles","previous_headings":"","what":"The mathematics behind RW1972","title":"RW1972","text":"influential associative learning model, RW1972 (Rescorla & Wagner, 1972), learns global error posits changes stimulus associability.","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"generating-expectations","dir":"Articles","previous_headings":"The mathematics behind RW1972","what":"1 - Generating expectations","title":"RW1972","text":"Let \\(v_{k,j}\\) denote associative strength stimulus \\(k\\) stimulus \\(j\\). given trial, expectation stimulus \\(j\\), \\(e_j\\), given : \\[ \\tag{Eq.1} e_j = \\sum_{k}^{K}x_k v_{k,j} \\] \\(x_k\\) denotes presence (1) absence (0) stimulus \\(k\\), set \\(K\\) represents stimuli design.","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind RW1972","what":"2 - Learning associations","title":"RW1972","text":"Changes association stimulus \\(\\) \\(j\\), \\(v_{,j}\\), given : \\[ \\tag{Eq.2} \\Delta v_{,j} = \\alpha_i \\beta_j (\\lambda_j - e_j) \\] \\(\\alpha_i\\) associability stimulus \\(\\), \\(\\beta_j\\) learning rate parameter determined properties \\(j\\)1, \\(\\lambda_j\\) maximum association strength supported \\(j\\) (asymptote).","code":""},{"path":"https://victornavarro.org/calmr/articles/RW1972.html","id":"generating-responses","dir":"Articles","previous_headings":"The mathematics behind RW1972","what":"3 - Generating responses","title":"RW1972","text":"specification response-generating mechanisms RW1972. However, simplest response function can adopted identity function stimulus expectations. , responses reflecting nature \\(j\\), \\(r_j\\), given : \\[ \\tag{Eq.3} r_j = e_j \\]","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"the-mathematics-behind-socr","dir":"Articles","previous_headings":"","what":"The mathematics behind SOCR","title":"SM2007","text":"first formalization comparator hypothesis (Miller & Matzel, 1988), sometimes competing retrieval model (SOCR; Stout & Miller, 2007) learns local error responds function relative associative strength present retrieved stimuli.","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"learning-associations","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"1 - Learning associations","title":"SM2007","text":"SOCR model uses two different learning equations strengthening weakening associations. Whenever two stimuli contiguous, strengthening occurs. case, strengthening association stimulus \\(\\) \\(j\\) trial \\(t\\), \\(v_{,j}^t\\) given : \\[ \\tag{Eq.1a} \\Delta v_{,j}^t = x^t_i \\alpha_i \\alpha_j (\\lambda_j - v_{,j}^{t-1}) \\] \\(x^t_i\\) denotes presence (1) absence (0) stimulus \\(\\) trial \\(t\\). , SOCR model learns stimuli presented. parameters \\(\\alpha_i\\) \\(\\alpha_j\\) saliencies stimuli j, respectively, \\(\\lambda_j\\) maximum association strength supported \\(j\\) (asymptote). Whenever stimulus \\(\\) presented alone (.e., stimulus \\(j\\) absent), weakening association given : \\[ \\tag{Eq.1b} \\Delta v_{,j}^t = x_i \\alpha_i \\times -\\omega_j v_{,j}^{t-1} \\] \\(\\omega_j\\) determines weakening rate stimulus \\(j\\).1","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"activating-stimuli","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"2 - Activating stimuli","title":"SM2007","text":"SOCR posits competition stimuli presented /associatively retrieved. Dropping trial notation sake simplicity, degree stimulus \\(\\) activates stimulus \\(j\\), \\(act_{,j}\\), given : \\[ \\tag{Eq.2} act_{, j} = x_i v_{,j} + x_j\\rho_j\\alpha_j \\] \\(\\rho_j\\) (bound 0 +\\(\\infty\\)) determines much salience stimulus \\(j\\) contributes unconditioned activation. first-order activation values key quantities involved comparison processes.","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"generating-responses-and-comparison-processes","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"3 - Generating responses and comparison processes","title":"SM2007","text":"Stimulus \\(\\) generates j-oriented responding time retrieval function relative ability activate stimulus \\(j\\). relative ability expressed comparison process, given : \\[ \\tag{Eq.3} r^j_i = act_{,j} - \\Sigma_{k \\neq ,j} ^K \\gamma_k \\times o_{,k,j} \\times r^k_i \\times r^j_k \\] \\(r^j_i\\) relative activation stimulus \\(j\\) stimulus \\(\\), \\(K\\) set experimental stimuli including \\(\\) \\(j\\), \\(\\gamma_k\\) parameter determining degree stimulus \\(k\\), comparison stimulus, contributes comparison process (bound 0 1), \\(o_{,k,j}\\) operator switch determines whether \\(\\) \\(k\\) associations \\(j\\) engage facilitation competition. Finally, \\(r^k_i\\) relative activation stimulus \\(k\\) stimulus \\(\\), representing ability stimulus \\(\\) activate comparison, \\(r^j_k\\) relative activation stimulus \\(j\\) stimulus \\(k\\), representing ability comparison stimulus \\(k\\) activate stimulus \\(j\\).2 notably, last two quantities (\\(r^k_i\\) \\(r^j_k\\)) also determined corresponding instantiations Eq. 3. , involve comparison processes . number potential comparison processes technically infinite (comparison process can nest two extra comparison processes ), user must determine order model using extra global parameter (order). n-th order models (\\(n > 0\\)), model behave like extended comparator hypothesis (Denniston et al., 2001), implementing \\(n\\) comparison processes time relative activations calculated. order = 0, SM2007 behave like originally written consider one comparison process. Indeed, n-th order models accomplished via recursion using 0-th order model stopping condition. condition reached, \\(r^k_i\\) \\(r^j_k\\) terms Eq. 3 become \\(act_{,k}\\) \\(act_{k,j}\\), respectively.","code":""},{"path":"https://victornavarro.org/calmr/articles/SM2007.html","id":"switching-between-facilitation-and-competition","dir":"Articles","previous_headings":"The mathematics behind SOCR","what":"4 - Switching between facilitation and competition","title":"SM2007","text":"operator switch Eq. 3, \\(o_{,k,j}\\), changes subjects learn discriminate directly (via \\(\\)) indirectly activated (via \\(k\\)) representations stimulus \\(j\\). change quantity depends value \\(v_{,j}\\), follows: \\[ \\tag{Eq.4} \\Delta o_{,k,j} = \\begin{cases} \\tau_j\\alpha_iv_{,k}v_{k,j}(1-o_{,k,j}) &\\text{, } v_{,j} = 0\\\\ 1-o_{,k,j} & \\text{, otherwise} \\end{cases} \\] negative values \\(o\\) indicate facilitation positive values \\(o\\) indicate competition. default value operator switches outset training set -1 default. parameter \\(\\tau_j\\) specifies learning rate operator switches related stimulus \\(j\\).","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"using-the-calmr-app","dir":"Articles","previous_headings":"","what":"Using the calmr app","title":"calmr_app","text":"want deal programming side calmr simply want simulate experimental design see model , might interested using calmr application. calmr application offers GUI allows simulate experiments without writing code. want use online app, can find https://victor-navarro.shinyapps.io/calmr_app/. Alternatively, can install calmr.app companion package launch app via calmr.app::launch_app(). rest tutorial assumes app open ready run. Let’s break GUI.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"design-table","dir":"Articles","previous_headings":"The GUI","what":"Design Table","title":"calmr_app","text":"design table specify experimental design run. Using Group- Group+, can remove add groups design. Using Phase- Phase+, can remove add phases design. Parse Design button used parse design, required step run simulation. later. P1 P2 columns specify phases experiment simulated left right. entry columns specifies trials given corresponding groups (G1 G2, case). entries must obey special syntax (see calmr_basics additional information). now, suffice say : number trials specified via digits left trial. example, 10A(US) specifies ten “(US)” trials. Stimuli (elements) specified letters. example, 10AB(US) specifies elements B US. Named stimuli specified within parentheses. example, (US) implies element named “US” instead compound containing elements “U” “S”. Multiple trials per phase separated via forward slash (/). Additionally, one can choose randomize trials within phase ticking boxes R1 R2 columns. important note whatever set interact “Create trial blocks” option Options tab sidebar (see ahead). ’s full breakdown combinations behavior: Table checked preferences checked: Trials shuffled within blocks possible (based greater common factor). example, 2A/2B gets shuffled 2 blocks containing one one B trial, 2A/1B gets shuffled 1 block containing two trials one B trial. Table unchecked preferences checked: Trials deterministically intermixed within blocks possible. example, 2A/2B gets shuffled 2 blocks, resulting sequence ABAB. Table checked preferences unchecked: Trials shuffled completely random. Table unchecked preferences unchecked: Trials given order appearance. example, 2A/2B results AABB sequence. Go ahead parse design. new things appear GUI.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"parameters","dir":"Articles","previous_headings":"The GUI","what":"Parameters","title":"calmr_app","text":"parsing valid design, can set parameters experiment. number parameters change function model. case, Rescorla-Wagner model 4 parameters per stimulus. default values fairly sensible, can modify parameter hand favorite spreadsheet software. parameterization model calmr can sometimes differ appears literature. following table contains links documentation pages model (warning: equations).","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"results","dir":"Articles","previous_headings":"The GUI","what":"Results","title":"calmr_app","text":"new button appear parsing experiment. final click button run model populate “Results” “Association Graphs” portions app. Go ahead run experiment. new button allow download results spreadsheet. calmr app, results shown visually. Clicking bar graph (one containing “Blocking - Response Strength …” ) show plots available. first portion plot’s name denotes group’s name. , plot shows strength associations among stimuli experiment across trials (blocks), faceted phases columns, origin stimuli rows. example, yellow lines denote strength B US. top column corresponds (look label right) middle column corresponds B. Go ahead explore available plots. usually self-explanatory, consult documentation package case something unclear (especially using obscure models).","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"association-graphs","dir":"Articles","previous_headings":"The GUI","what":"Association Graphs","title":"calmr_app","text":"bottom portion app shows network graphs depicting strength associations model given trial, groups. Yellow denotes excitatory strength (.e., positive values), gray denotes neutral strength (.e., values close zero), purple (shown ) shows inhibitory strength (.e., negative values). Move “Trial” slider explore associations model change across experiment.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"other-bits","dir":"Articles","previous_headings":"The GUI","what":"Other bits","title":"calmr_app","text":"sections implement bulk functionalities calmr app. following sections describe additional options found useful.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"options","dir":"Articles","previous_headings":"The GUI > Other bits","what":"Options","title":"calmr_app","text":"set number iterations run experiment (important model behavior sensitive trial order effects), whether want create trial blocks. also set can choose plot common scale y-axis (active default).","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_app.html","id":"a-final-message","dir":"Articles","previous_headings":"The GUI","what":"A final message","title":"calmr_app","text":"Hope enjoy app! find bugs, comments, like something implemented, feel free post message package’s Github repository drop line navarrov [] cardiff.ac.uk.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"your-first-simulation","dir":"Articles","previous_headings":"","what":"Your first simulation","title":"calmr_basics","text":"perform first simulation need: data.frame specifying experiment design, list parameters model using.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"the-design-data-frame","dir":"Articles","previous_headings":"","what":"The design data.frame","title":"calmr_basics","text":"Let’s specify blocking design. rules design data.frame: row represents group. first column contains group labels. remaining columns organized pairs (trials phase, whether randomize ) trials phase column specified using rigid notation. observations : Trials preceded number. number represents number times trial given phase. “10A(US)” means “(US)” trial given 10 times. presence absence unconditioned stimulus denoted traditional “+” “-” symbols. Instead, use parenthesis denote “complex” stimuli. can thought element complex name (.e., one character). , “(US)” specifies single element represent US. vein, multiple characters parentheses denote individual elements. example, “AB” implies presence two stimuli, B. “/” character used trial separator (imply randomization ). Thus, “1A/1B” specifies single “” trial single “B” trial given phase. Recall randomization trials within phase specified column (, R1, R2, R3). “#” character used denote probe trials. contrast real life, probe trials entail update model’s associations. , probe trials can used track development key associations, repercussion model learns normal training trials. want check whether phase string work package, can use phase_parser(). function returns list lot information, let’s print fields.","code":"library(calmr) my_blocking <- data.frame( Group = c(\"Exp\", \"Control\"), Phase1 = c(\"10A(US)\", \"10C(US)\"), R1 = c(FALSE, FALSE), Phase2 = c(\"10AB(US)\", \"10AB(US)\"), R2 = c(FALSE, FALSE), Test = c(\"1#A/1#B\", \"1#A/1#B\"), R3 = c(FALSE, FALSE) ) # parsing the design and showing the original and what was detected parsed <- parse_design(my_blocking) parsed # not specifying the number of AB trials. Error! phase_parser(\"AB/10AC\") #> Error in if (is.na(treps)) 1 else treps: argument is of length zero # putting the probe symbol out of order. Error! phase_parser(\"#10A\") #> Error in if (is.na(treps)) 1 else treps: argument is of length zero # considering a configural cue for elements AB trial <- phase_parser(\"10AB(AB)(US)\") # different USs trial <- phase_parser(\"10A(US1)/10B(US2)\") # tons of information! Phase parser is meant for internal use only. # you are better of using `parse_design()` on a design `data.frame` str(trial) #> List of 2 #> $ trial_info :List of 2 #> ..$ 10A(US1):List of 8 #> .. ..$ name : chr \"A(US1)\" #> .. ..$ repetitions : num 10 #> .. ..$ is_test : logi FALSE #> .. ..$ periods : chr \"A(US1)\" #> .. ..$ nominals :List of 1 #> .. .. ..$ A(US1): chr [1:2] \"A\" \"US1\" #> .. ..$ functionals :List of 1 #> .. .. ..$ A(US1): chr [1:2] \"A\" \"US1\" #> .. ..$ all_nominals : chr [1:2] \"A\" \"US1\" #> .. ..$ all_functionals: chr [1:2] \"A\" \"US1\" #> ..$ 10B(US2):List of 8 #> .. ..$ name : chr \"B(US2)\" #> .. ..$ repetitions : num 10 #> .. ..$ is_test : logi FALSE #> .. ..$ periods : chr \"B(US2)\" #> .. ..$ nominals :List of 1 #> .. .. ..$ B(US2): chr [1:2] \"B\" \"US2\" #> .. ..$ functionals :List of 1 #> .. .. ..$ B(US2): chr [1:2] \"B\" \"US2\" #> .. ..$ all_nominals : chr [1:2] \"B\" \"US2\" #> .. ..$ all_functionals: chr [1:2] \"B\" \"US2\" #> $ general_info:List of 5 #> ..$ trial_names : chr [1:2] \"A(US1)\" \"B(US2)\" #> ..$ trial_repeats: num [1:2] 10 10 #> ..$ is_test : logi [1:2] FALSE FALSE #> ..$ nomi2func : Named chr [1:4] \"A\" \"US1\" \"B\" \"US2\" #> .. ..- attr(*, \"names\")= chr [1:4] \"A\" \"US1\" \"B\" \"US2\" #> ..$ func2nomi : Named chr [1:4] \"A\" \"US1\" \"B\" \"US2\" #> .. ..- attr(*, \"names\")= chr [1:4] \"A\" \"US1\" \"B\" \"US2\""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"the-parameters-list","dir":"Articles","previous_headings":"","what":"The parameters list","title":"calmr_basics","text":"Now need pick model parameters. get models currently supported calmr, can call supported_models(). choosing model, can get default parameters design get_parameters().","code":"supported_models() #> [1] \"HDI2020\" \"HD2022\" \"RW1972\" \"MAC1975\" \"PKH1982\" \"SM2007\" \"RAND\" #> [8] \"ANCCR\" \"TD\" my_pars <- get_parameters(my_blocking, model = \"RW1972\") # Increasing the beta parameter for US presentations my_pars$betas_on[\"US\"] <- .6 my_pars #> $alphas #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $betas_on #> A B C US #> 0.4 0.4 0.4 0.6 #> #> $betas_off #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $lambdas #> A B C US #> 1 1 1 1"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"simulating","dir":"Articles","previous_headings":"The parameters list","what":"Simulating","title":"calmr_basics","text":", can run simulation using run_experiment() function. function also takes extra arguments manipulate number iterations run experiment , whether organize trials miniblocks (see help page make_experiment() additional details). , run experiment 5 iterations. advanced R user able dig data straight away. However, package also includes methods get quick look results.","code":"my_experiment <- run_experiment( my_blocking, # note we do not need to pass the parsed design model = \"RW1972\", parameters = my_pars, iterations = 5 ) # returns a `CalmrExperiment` object class(my_experiment) #> [1] \"CalmrExperiment\" #> attr(,\"package\") #> [1] \"calmr\" # CalmrExperiment is an S4 class, so it has slots slotNames(my_experiment) #> [1] \"design\" \"model\" \"groups\" \"parameters\" \"timings\" #> [6] \"experiences\" \"results\" \".model\" \".group\" \".iter\" # the experience given to group Exp on the first iteration my_experiment@experiences[[1]] #> model group phase tp tn is_test block_size trial #> 1 RW1972 Exp Phase1 1 A(US) FALSE 1 1 #> 2 RW1972 Exp Phase1 1 A(US) FALSE 1 2 #> 3 RW1972 Exp Phase1 1 A(US) FALSE 1 3 #> 4 RW1972 Exp Phase1 1 A(US) FALSE 1 4 #> 5 RW1972 Exp Phase1 1 A(US) FALSE 1 5 #> 6 RW1972 Exp Phase1 1 A(US) FALSE 1 6 #> 7 RW1972 Exp Phase1 1 A(US) FALSE 1 7 #> 8 RW1972 Exp Phase1 1 A(US) FALSE 1 8 #> 9 RW1972 Exp Phase1 1 A(US) FALSE 1 9 #> 10 RW1972 Exp Phase1 1 A(US) FALSE 1 10 #> 11 RW1972 Exp Phase2 2 AB(US) FALSE 1 11 #> 12 RW1972 Exp Phase2 2 AB(US) FALSE 1 12 #> 13 RW1972 Exp Phase2 2 AB(US) FALSE 1 13 #> 14 RW1972 Exp Phase2 2 AB(US) FALSE 1 14 #> 15 RW1972 Exp Phase2 2 AB(US) FALSE 1 15 #> 16 RW1972 Exp Phase2 2 AB(US) FALSE 1 16 #> 17 RW1972 Exp Phase2 2 AB(US) FALSE 1 17 #> 18 RW1972 Exp Phase2 2 AB(US) FALSE 1 18 #> 19 RW1972 Exp Phase2 2 AB(US) FALSE 1 19 #> 20 RW1972 Exp Phase2 2 AB(US) FALSE 1 20 #> 21 RW1972 Exp Test 3 #A TRUE 2 21 #> 22 RW1972 Exp Test 4 #B TRUE 2 22 # the number of times we ran the model (groups x iterations) length(experiences(my_experiment)) #> [1] 10 # an experiment has results with different levels of aggregation class(my_experiment@results) #> [1] \"CalmrExperimentResult\" #> attr(,\"package\") #> [1] \"calmr\" slotNames(my_experiment@results) #> [1] \"aggregated_results\" \"parsed_results\" \"raw_results\" # shorthand method to access aggregated_results results(my_experiment) #> $associations #> group phase trial_type trial block_size s1 s2 value model #> #> 1: Exp Phase1 A(US) 1 1 A A 0.0000000 RW1972 #> 2: Exp Phase1 A(US) 1 1 A B 0.0000000 RW1972 #> 3: Exp Phase1 A(US) 1 1 A C 0.0000000 RW1972 #> 4: Exp Phase1 A(US) 1 1 A US 0.0000000 RW1972 #> 5: Exp Phase1 A(US) 1 1 B A 0.0000000 RW1972 #> --- #> 700: Control Test #B 22 2 C US 0.9939534 RW1972 #> 701: Control Test #B 22 2 US A 0.4999999 RW1972 #> 702: Control Test #B 22 2 US B 0.4999999 RW1972 #> 703: Control Test #B 22 2 US C 0.6626356 RW1972 #> 704: Control Test #B 22 2 US US 0.0000000 RW1972 #> #> $responses #> group phase trial_type trial block_size s1 s2 value model #> #> 1: Exp Phase1 A(US) 1 1 A A 0 RW1972 #> 2: Exp Phase1 A(US) 1 1 A B 0 RW1972 #> 3: Exp Phase1 A(US) 1 1 A C 0 RW1972 #> 4: Exp Phase1 A(US) 1 1 A US 0 RW1972 #> 5: Exp Phase1 A(US) 1 1 B A 0 RW1972 #> --- #> 700: Control Test #B 22 2 C US 0 RW1972 #> 701: Control Test #B 22 2 US A 0 RW1972 #> 702: Control Test #B 22 2 US B 0 RW1972 #> 703: Control Test #B 22 2 US C 0 RW1972 #> 704: Control Test #B 22 2 US US 0 RW1972"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"plotting","dir":"Articles","previous_headings":"","what":"Plotting","title":"calmr_basics","text":"Let’s use plot method create plots. model supports different types plots according results can produce (e.g., associations, responses, saliences, etc.) case, RW model supports associations (associations) responses (responses).","code":"# get all the plots for the experiment plots <- plot(my_experiment) names(plots) #> [1] \"Exp - Association Strength (RW1972)\" #> [2] \"Control - Association Strength (RW1972)\" #> [3] \"Exp - Response Strength (RW1972)\" #> [4] \"Control - Response Strength (RW1972)\" # or get a specific type of plot specific_plot <- plot(my_experiment, type = \"associations\") names(specific_plot) #> [1] \"Exp - Association Strength (RW1972)\" #> [2] \"Control - Association Strength (RW1972)\" # show which plots are supported by the model we are using supported_plots(\"RW1972\") #> [1] \"associations\" \"responses\""},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"stimulus-associations","dir":"Articles","previous_headings":"Plotting","what":"Stimulus associations","title":"calmr_basics","text":"columns plots phases design rows denote source association. colors within panel determine target association.","code":"plot(my_experiment, type = \"associations\") #> $`Exp - Association Strength (RW1972)` #> #> $`Control - Association Strength (RW1972)`"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"responding","dir":"Articles","previous_headings":"Plotting","what":"Responding","title":"calmr_basics","text":"Fairly similar , responding function stimuli presented trial.","code":"plot(my_experiment, type = \"responses\") #> $`Exp - Response Strength (RW1972)` #> #> $`Control - Response Strength (RW1972)`"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"graphing","dir":"Articles","previous_headings":"","what":"Graphing","title":"calmr_basics","text":"can also take look state model’s associations point training, using graph method experiment.","code":"my_graph_opts <- get_graph_opts(\"small\") # passing the argument t to specify the trial we're interested in. # end of acquisition patch_graphs(graph(my_experiment, t = 10, options = my_graph_opts)) # end of blocking patch_graphs(graph(my_experiment, t = 20, options = my_graph_opts))"},{"path":"https://victornavarro.org/calmr/articles/calmr_basics.html","id":"final-thoughts","dir":"Articles","previous_headings":"","what":"Final thoughts","title":"calmr_basics","text":"calmr package designed simulate quickly: specify design, parameters, get glance model predictions. However, package also additional features advanced R users. ’re one , make sure check vignettes ready.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"fitting-heidi-to-empirical-data","dir":"Articles","previous_headings":"","what":"Fitting HeiDI to empirical data","title":"calmr_fits","text":"demo, fit HeiDI empirical data (Patitucci et al., 2016, Experiment 1). involve writing function produces model responses organized empirical data, can use function maximum likelihood estimation (MLE). begin short overview data, move model function, finally fit.","code":""},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"the-data","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data","what":"The data","title":"calmr_fits","text":"data (pati) contains responses (lever presses lp, nose pokes np) 32 rats, across 6 blocks training (2 sessions per block). animals trained associate two levers two different food rewards (pellets sucrose). Let’s glance. thicker lines group averages; rest individual subjects. ignore specific mapping levers USs counterbalanced across subjects. However, ignore counterbalancing writing model function (see ahead).","code":"summary(pati) #> subject block lever us response #> 1 : 24 Min. :1.0 B: 0 Length:768 lp:384 #> 2 : 24 1st Qu.:2.0 L:384 Class :character np:384 #> 3 : 24 Median :3.5 R:384 Mode :character #> 4 : 24 Mean :3.5 #> 5 : 24 3rd Qu.:5.0 #> 6 : 24 Max. :6.0 #> (Other):624 #> rpert #> Min. :0.0000 #> 1st Qu.:0.9437 #> Median :2.2500 #> Mean :2.4806 #> 3rd Qu.:3.8000 #> Max. :8.4500 #> pati |> ggplot(aes(x = block, y = rpert, colour = us)) + geom_line(aes(group = interaction(us, subject)), alpha = .3) + stat_summary(geom = \"line\", fun = \"mean\", linewidth = 1) + labs(x = \"Block\", y = \"Responses per trial\", colour = \"US\") + facet_grid(~response)"},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"writing-the-model-function","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data","what":"Writing the model function","title":"calmr_fits","text":"biggest hurdle fitting model empirical data write function , given vector parameters experiment, generates responses organized empirical data. Let’s begin summarizing data first, know aim . design? experiment presented Patitucci et al. (2016) fairly simple, can reduced presentations two levers, followed different appetitive outcome. , assume two outcomes independent . also take liberties number trials specify reduce computing time. beware: HeiDI, like many learning models, sensitive order effects. want model misfit data happened run simulations unlucky run trials. arguments prepare must reflect behavior model “general” experimental procedure, , address issue running several iterations experiment (random order trials) averaging experiments evaluating likelihood parameters. mind, now prepare experiment pass run_experiment(). Note specified two counterbalancings groups. must reproduce counterbalancings data trying fit close possible. Otherwise, optimization process might latch onto experimentally-irrelevant variables. example, can seen pati lever pressing whenever lever paired pellets. didn’t counterbalance identities levers food rewards, optimization might result one levers less salient ! can now begin write model function. First, good see results run_experiment() returns. Although results() returns many model outputs, said earlier, care one : responses (model responses). , can write model function. Let’s dissect function three parts. get parameters experiment, via parameters() method store new_parameters.1 put pars (parameters provided optimizer) alphas new_parameters. run experiment store exp_res. select model responses (responses) model results store responses. Lastly. summarise model responses return .2 ’s lot digest, let’s see function action. Just numbers! order empirical data model responses must match. emphasize point enough: nothing within fit function checks reorders data . sole responsible making sure pieces data order. simple way print model results return compare data. ’s reason full parameter function definition. made sure everything looking good, can fit model.","code":"pati_summ <- setDT(pati)[, list(\"rpert\" = mean(rpert)), by = \"block,us,response\" ] # set order (relevant for the future) setorder(pati_summ, block, response, us) head(pati_summ) #> block us response rpert #> #> 1: 1 P lp 0.8195313 #> 2: 1 S lp 0.5609375 #> 3: 1 P np 3.4109375 #> 4: 1 S np 3.2796875 #> 5: 2 P lp 1.5738281 #> 6: 2 S lp 0.6406250 # The design data.frame des_df <- data.frame( group = c(\"CB1\", \"CB2\"), training = c( \"12L>(Pellet)/12R>(Sucrose)/12#L/12#R\", \"12L>(Sucrose)/12R>(Pellet)/12#L/12#R\" ), rand_train = FALSE ) # The parameters # the actual parameter values don't matter, # as our function will re-write them inside the optimizer call parameters <- get_parameters(des_df, model = \"HD2022\" ) # The arguments experiment <- make_experiment(des_df, parameters = parameters, model = \"HD2022\", iterations = 4 ) experiment exp_res <- run_experiment(experiment) results(exp_res) #> $activations #> group phase trial_type trial block_size s1 value model #> #> 1: CB1 training L>(Pellet) 1 4 L 0.4000000 HD2022 #> 2: CB1 training R>(Sucrose) 2 4 L 0.0000000 HD2022 #> 3: CB1 training #L 3 4 L 0.4000000 HD2022 #> 4: CB1 training #R 4 4 L 0.0000000 HD2022 #> 5: CB1 training L>(Pellet) 5 4 L 0.4000000 HD2022 #> --- #> 380: CB2 training #R 44 4 Sucrose 0.0000000 HD2022 #> 381: CB2 training L>(Sucrose) 45 4 Sucrose 0.4000000 HD2022 #> 382: CB2 training R>(Pellet) 46 4 Sucrose 0.0000000 HD2022 #> 383: CB2 training #L 47 4 Sucrose 0.3991293 HD2022 #> 384: CB2 training #R 48 4 Sucrose 0.0000000 HD2022 #> #> $associations #> group phase trial_type trial block_size s1 s2 value #> #> 1: CB1 training L>(Pellet) 1 4 L L 0.0000000 #> 2: CB1 training L>(Pellet) 1 4 L Pellet 0.0000000 #> 3: CB1 training L>(Pellet) 1 4 L R 0.0000000 #> 4: CB1 training L>(Pellet) 1 4 L Sucrose 0.0000000 #> 5: CB1 training L>(Pellet) 1 4 Pellet L 0.0000000 #> --- #> 1532: CB2 training #R 48 4 R Sucrose 0.0000000 #> 1533: CB2 training #R 48 4 Sucrose L 0.3991293 #> 1534: CB2 training #R 48 4 Sucrose Pellet 0.0000000 #> 1535: CB2 training #R 48 4 Sucrose R 0.0000000 #> 1536: CB2 training #R 48 4 Sucrose Sucrose 0.0000000 #> model #> #> 1: HD2022 #> 2: HD2022 #> 3: HD2022 #> 4: HD2022 #> 5: HD2022 #> --- #> 1532: HD2022 #> 1533: HD2022 #> 1534: HD2022 #> 1535: HD2022 #> 1536: HD2022 #> #> $pools #> group phase trial_type trial block_size s1 s2 type #> #> 1: CB1 training L>(Pellet) 1 4 L,Pellet L combvs #> 2: CB1 training L>(Pellet) 1 4 L,Pellet Pellet combvs #> 3: CB1 training L>(Pellet) 1 4 L,Pellet R combvs #> 4: CB1 training L>(Pellet) 1 4 L,Pellet Sucrose combvs #> 5: CB1 training R>(Sucrose) 2 4 R,Sucrose L combvs #> --- #> 764: CB2 training #L 47 4 L Sucrose chainvs #> 765: CB2 training #R 48 4 R L chainvs #> 766: CB2 training #R 48 4 R Pellet chainvs #> 767: CB2 training #R 48 4 R R chainvs #> 768: CB2 training #R 48 4 R Sucrose chainvs #> value model #> #> 1: 0 HD2022 #> 2: 0 HD2022 #> 3: 0 HD2022 #> 4: 0 HD2022 #> 5: 0 HD2022 #> --- #> 764: 0 HD2022 #> 765: 0 HD2022 #> 766: 0 HD2022 #> 767: 0 HD2022 #> 768: 0 HD2022 #> #> $responses #> group phase trial_type trial block_size s1 s2 value model #> #> 1: CB1 training L>(Pellet) 1 4 L L 0 HD2022 #> 2: CB1 training L>(Pellet) 1 4 L Pellet 0 HD2022 #> 3: CB1 training L>(Pellet) 1 4 L R 0 HD2022 #> 4: CB1 training L>(Pellet) 1 4 L Sucrose 0 HD2022 #> 5: CB1 training L>(Pellet) 1 4 Pellet L 0 HD2022 #> --- #> 1532: CB2 training #R 48 4 R Sucrose 0 HD2022 #> 1533: CB2 training #R 48 4 Sucrose L 0 HD2022 #> 1534: CB2 training #R 48 4 Sucrose Pellet 0 HD2022 #> 1535: CB2 training #R 48 4 Sucrose R 0 HD2022 #> 1536: CB2 training #R 48 4 Sucrose Sucrose 0 HD2022 my_model_function <- function(pars, exper, full = FALSE) { # extract the parameters from the model new_parameters <- parameters(exper)[[1]] # assign alphas new_parameters$alphas[] <- pars # reassign parameters to the experiment parameters(exper) <- new_parameters # note parameters method # running the model and selecting responses exp_res <- run_experiment(exper) # summarizing the model responses <- results(exp_res)$responses # calculate extra variables responses$response <- ifelse(responses$s1 %in% c(\"Pellet\", \"Sucrose\"), \"np\", \"lp\" ) responses$block <- ceiling(responses$trial / 8) # filtering # only probe trials responses <- responses[grepl(\"#\", trial_type)] # only available responses responses <- responses[s2 %in% c(\"Pellet\", \"Sucrose\") & (response == \"np\" | (response == \"lp\" & mapply(grepl, s1, trial_type)))] # aggregate responses <- responses[, list(value = mean(value)), by = \"block,s2,response\"] if (full) { return(responses) } responses$value } my_model_function(c(.1, .2, .4, .3), experiment) #> [1] 0.028557609 0.040188221 0.004008696 0.008429327 0.045573899 0.061933782 #> [7] 0.010480790 0.021230102 0.053426837 0.070862133 0.015100913 0.029677071 #> [13] 0.057584182 0.074995358 0.018328387 0.035165746 0.059994400 0.077081202 #> [19] 0.020711121 0.039013071 0.061492438 0.078227391 0.022547790 0.041891069 head(my_model_function(c(.1, .2, .4, .3), experiment, full = TRUE)) #> block s2 response value #> #> 1: 1 Pellet lp 0.028557609 #> 2: 1 Sucrose lp 0.040188221 #> 3: 1 Pellet np 0.004008696 #> 4: 1 Sucrose np 0.008429327 #> 5: 2 Pellet lp 0.045573899 #> 6: 2 Sucrose lp 0.061933782 head(pati_summ) #> block us response rpert #> #> 1: 1 P lp 0.8195313 #> 2: 1 S lp 0.5609375 #> 3: 1 P np 3.4109375 #> 4: 1 S np 3.2796875 #> 5: 2 P lp 1.5738281 #> 6: 2 S lp 0.6406250"},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"fitting-the-model","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data","what":"Fitting the model","title":"calmr_fits","text":"fit models using fit_model() function. function requires 4 arguments: (empirical) data. model function. arguments run model function. optimizer options. done great job taking care first three, let’s tackle last. get_optimizer_opts() function returns many things: model_pars: name model parameters (name alpha stimulus). ll ul: lower upper limits parameter search. optimizer: numerical optimization technique wish use MLE estimation. family: family distribution assume model. practice, request used determine link function transform model responses, likelihood function used objective function. normal family nothing fancy model responses estimate extra parameter, scale, scales model responses scale empirical data. comes likelihood functions, family use normal density data model differences. family_pars: family-specific parameter estimated alongside salience parameters. verbose: Whether print parameters objective function values optimize. free modify ; just make sure structure list returned get_optimizer_opts() remains . can also pass extra parameters optimizer call using (e.g., par argument optim, parallel ga). , fit model parallel ga, 10 iterations. , can fit model! (patient following along) fit_model function returns lot information track put got . However, typing model console show MLE parameters obtained time negative log-likelihood, given data: ’s good , well model run parameters “visually” fit data? can obtain predictions model via predict function. looks pretty good! Save blatant misfits, course. Now know everything need fit calmr empirical data. Go forth!","code":"my_optimizer_opts <- get_optimizer_opts( model_pars = names(parameters$alphas), optimizer = \"ga\", ll = c(0, 0, 0, 0), ul = c(1, 1, 1, 1), family = \"normal\" ) my_optimizer_opts #> $model_pars #> [1] \"L\" \"Pellet\" \"R\" \"Sucrose\" #> #> $optimizer #> [1] \"ga\" #> #> $family #> [1] \"normal\" #> #> $family_pars #> [1] \"normal_scale\" #> #> $all_pars #> [1] \"L\" \"Pellet\" \"R\" \"Sucrose\" \"normal_scale\" #> #> $initial_pars #> [1] NA NA NA NA 1 #> #> $ll #> L Pellet R Sucrose normal_scale #> 0 0 0 0 0 #> #> $ul #> L Pellet R Sucrose normal_scale #> 1 1 1 1 100 #> #> $verbose #> [1] FALSE the_fit <- fit_model(pati_summ$rpert, model_function = my_model_function, exper = experiment, optimizer_options = my_optimizer_opts, maxiter = 10, parallel = TRUE ) the_fit # the BIC and AIC BIC(the_fit) #> [1] 102.484 AIC(the_fit) #> [1] 96.5937 pati_summ$prediction <- predict(the_fit, exper = experiment) pati_summ[, data := rpert][, rpert := NULL] pati_summ <- melt(pati_summ, measure.vars = c(\"prediction\", \"data\")) pati_summ |> ggplot(ggplot2::aes( x = block, y = value, colour = us, linetype = variable )) + geom_line() + theme_bw() + facet_grid(us ~ response)"},{"path":"https://victornavarro.org/calmr/articles/calmr_fits.html","id":"a-final-note","dir":"Articles","previous_headings":"Fitting HeiDI to empirical data > Fitting the model","what":"A final note","title":"calmr_fits","text":"vignette pre-generated, don’t want user fit model time installation. try keep package develops, spot inconsistencies, please drop line.","code":""},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"simulating-similarity-effects","dir":"Articles","previous_headings":"","what":"Simulating similarity effects","title":"heidi_similarity","text":"Honey Dwyer (2022), authors propose similarity retrieved nominal saliencies stimulus representations modulates quantities combination rule. Retrieved saliencies exclusively absent stimuli, result existing associations stimuli (see Eq. 8 model’s vignette). contrast, nominal saliencies denote intensity stimulus representations stimuli presented trial (\\(\\alpha\\)). intuitive example effect saliency similarity responding refers effect weakly retrieved representations behavior. low similarity weakly retrieved representation nominal representation result reduced effect former behavior. example, typical Pavlovian inhibition paradigm \\[(US)/AX\\], inhibitor (e.g., X) strong effect behavior presented weak effect behavior weakly retrieved stimulus strong association (e.g., ). Yet, inspiration proposing general rule fairly specific. attempt explain introduction delay CS US stimuli higher-order conditioning experiments sometimes enhance responding stimulus never paired US (e.g., AX/X(US) X(US)/AX).","code":""},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"reproducing-the-simulation-presented-in-the-paper","dir":"Articles","previous_headings":"Simulating similarity effects","what":"Reproducing the simulation presented in the paper","title":"heidi_similarity","text":"paper, authors plot similarity retrieved saliencies nominal saliencies stimulus X sensory preconditioning experiment short delay X US used (group Reduced) (group ). effect introducing delay simulated X saliency .36; otherwise, saliency .40. saliencies US fixed .30 .50, respectively, conditions.","code":"df <- data.frame( Group = c(\"Same\", \"Reduced\"), P1 = c(\"10A(X_a)\", \"10A(X_a)\"), R1 = c(FALSE, FALSE), P2 = c(\"10(X_a)(US)\", \"10(X_b)(US)\"), R2 = c(FALSE, FALSE) ) params <- get_parameters(df, model = \"HD2022\") params$alphas[] <- c(.30, .40, .50, .36) model <- run_experiment(df, model = \"HD2022\", parameters = params )"},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"plotting-the-similarity-between-saliencies","dir":"Articles","previous_headings":"Simulating similarity effects > Reproducing the simulation presented in the paper","what":"Plotting the similarity between saliencies","title":"heidi_similarity","text":"plot currently supported package, can easily generated passing \\(\\rightarrow X\\) association one alphas internal function used calculate similarity calmr:::.alphaSim.","code":"associations <- results(model)$associations[ s1 == \"A\" & s2 == \"X\" & phase == \"P1\" ] associations[ , nominal_alpha := ifelse(group == \"Reduced\", mean(.36, .40), .40) ][ , similarity := calmr:::.alphaSim(value, nominal_alpha) ] associations |> ggplot(aes(x = trial, y = similarity, linetype = group)) + geom_line() + theme_bw() + labs(x = \"Trial\", y = \"Similarity\", linetype = \"Group\")"},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"plotting-the-distribution-of-responding","dir":"Articles","previous_headings":"Simulating similarity effects > Reproducing the simulation presented in the paper","what":"Plotting the distribution of responding","title":"heidi_similarity","text":"one little bit trickier figure manuscript effectively contains many experiments varying number XA trials starting first-order conditioning phase. address , run multiple simulations different experimental designs. Run model. now can manually plot distribution responding among stimuli model$responses.","code":"ntrials <- 1:10 df <- data.frame( Group = c(paste0(\"S\", ntrials), paste0(\"R\", ntrials)), P1 = rep(paste0(ntrials, \"A(X_a)\"), 2), R1 = FALSE, P2 = rep(c(\"10(X_a)>(US)\", \"10(X_b)>(US)\"), each = 10), R2 = FALSE, P3 = \"1A#\", R3 = FALSE ) head(df) #> Group P1 R1 P2 R2 P3 R3 #> 1 S1 1A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 2 S2 2A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 3 S3 3A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 4 S4 4A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 5 S5 5A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE #> 6 S6 6A(X_a) FALSE 10(X_a)>(US) FALSE 1A# FALSE model <- run_experiment(df, model = \"HD2022\", parameters = params ) responses <- results(model)$responses[phase == \"P3\" & s2 == \"US\"] responses[, `:=`( trial = trial - 11, group_lab = ifelse(substr(group, 1, 1) == \"R\", \"Reduced\", \"Same\") )] responses |> ggplot(aes(x = trial, y = value, colour = s1, linetype = group_lab)) + geom_line() + theme_bw() + labs(x = \"Trial\", y = \"R-value\", colour = \"stimulus\", linetype = \"Group\") + facet_wrap(~s2)"},{"path":"https://victornavarro.org/calmr/articles/heidi_similarity.html","id":"some-final-notes","dir":"Articles","previous_headings":"Simulating similarity effects > Reproducing the simulation presented in the paper","what":"Some final notes","title":"heidi_similarity","text":"paper, Honey Dwyer completely specify rules choosing reference value similarity calculation whenever one nominal stimulus experienced. example, simulation, use two nominal versions X stimulus (X_a X_b), , whenever model compute similarity retrieved (.e., \\(\\rightarrow X\\)) conditioned saliency values, encounter problem choose among least two conditioned values (X_a X_b). Although authors paper chose saliency nominal X conditioned US (.e., X_b), specify choice made , less intuitive situations. way avoid solving issue, current implementation similarity rule uses average nominal stimuli reference value similarity calculation. specific simulation case, implementation reduces effect similarity distribution responding.","code":""},{"path":"https://victornavarro.org/calmr/articles/parallelism_in_calmr.html","id":"running-experiments-in-parallel","dir":"Articles","previous_headings":"","what":"Running experiments in parallel","title":"parallelism_in_calmr","text":"advent time-based models, version 0.51 calmr uses future package parallelize operations. Thanks design philosophy future, running things parallel take single line code.","code":""},{"path":"https://victornavarro.org/calmr/articles/parallelism_in_calmr.html","id":"why-run-things-in-parallel","dir":"Articles","previous_headings":"Running experiments in parallel","what":"Why run things in parallel?","title":"parallelism_in_calmr","text":"many situations find run model many iterations, either design contains enough kinds trials order effects worry, want run model different parameters. Let’s run HeiDI model (Honey et al., 2020) long, random design. Let’s also enable verbosity via calmr_verbosity(), uses progressr package. Let’s try parallelizing now.","code":"library(calmr) # enables progress bars (try it on your computer) # calmr_verbosity(TRUE) pav_inhib <- data.frame( group = \"group\", phase1 = \"50(US)/50AB/50#A\", rand1 = TRUE ) # set options to introduce more randomness pars <- get_parameters(pav_inhib, model = \"HDI2020\") exp <- make_experiment(pav_inhib, parameters = pars, model = \"HDI2020\", iterations = 100, miniblocks = FALSE ) # time it start <- proc.time() pav_res <- run_experiment(exp) end <- proc.time() - start end #> user system elapsed #> 5.328 0.096 3.482"},{"path":"https://victornavarro.org/calmr/articles/parallelism_in_calmr.html","id":"running-an-experiment-in-parallel","dir":"Articles","previous_headings":"Running experiments in parallel","what":"Running an experiment in parallel","title":"parallelism_in_calmr","text":"run experiment, parallel, need enable future plan. “plan” one many ways future package can parallelize things (really consult documentation). Regardless, running calmr single computer, ’ll using plan(multisession) case, parallel evaluation faster (see user time ). future package trades ease use bulkier overheads, overheads tend constant, parallelization better payoff run iterations.","code":"library(future) plan(multisession) start <- proc.time() pav_res <- run_experiment(exp) end <- proc.time() - start end #> user system elapsed #> 0.734 0.145 3.854 # go back to non-parallel evaluations plan(sequential)"},{"path":"https://victornavarro.org/calmr/articles/using_time_models.html","id":"time-models-in-calmr","dir":"Articles","previous_headings":"","what":"Time models in calmr","title":"using_time_models","text":"Version 0.5 calmr introduced first time-based model, ANCCR (Jeong et al., 2022), , wrote several additional tools future models.","code":""},{"path":"https://victornavarro.org/calmr/articles/using_time_models.html","id":"changes-to-trial-based-models","dir":"Articles","previous_headings":"Time models in calmr","what":"Changes to trial-based models","title":"using_time_models","text":"biggest change calmr version 0.5 use “>” character effect trial-based models. , “>” character used specify single split within trial. example, “>(US)” encode typical situation stimulus followed US. used mimic traditional situation expect organism start (conditionally) responding US delivered. , trial-based models two steps within trial: expectation step first half trial retrieved absent stimuli, learning step, stimuli trial associated . first pass (start throwing extinction trials, better yet, probe trials test associations).","code":""},{"path":"https://victornavarro.org/calmr/articles/using_time_models.html","id":"specifying-a-design-for-time-based-models","dir":"Articles","previous_headings":"Time models in calmr","what":"Specifying a design for time-based models","title":"using_time_models","text":"designs time-based models nearly identical trial-based models. However, clever use “>” character enrich parameter list. Let’s specify serial feature discrimination experiment: now let’s get parameters ANCCR model. ANCCR model plenty parameters, yet nearly half parameters list correspond parameters use create experience model receive. leave explanation model-based parameters future. now, suffice note can control timing trials (events) using things like post_trial_delay, mean_ITI, transition_delay, etc. Let’s make model’s experience look first 20 entries. can see , several rows per trial, specifying different stimulus. Time-based models like ANCCR run time log make ample use time difference events. Let’s run model see plots. ’s ! Easy, right?","code":"library(calmr) fpfn <- data.frame( group = c(\"FP\", \"FN\"), phase1 = c(\"100F>T>(US)/100T\", \"100F>T/100T>(US)\"), r1 = c(TRUE, TRUE) ) fpfn #> group phase1 r1 #> 1 FP 100F>T>(US)/100T TRUE #> 2 FN 100F>T/100T>(US) TRUE pars <- get_parameters(fpfn, model = \"ANCCR\") # increase learning rates pars$alpha_reward <- 0.8 pars$alpha <- 0.08 # increase sampling interval to speed up the model pars$sampling_interval <- 5 pars #> $reward_magnitude #> F T US #> 1 1 1 #> #> $betas #> F T US #> 1 1 1 #> #> $cost #> [1] 0 #> #> $temperature #> [1] 1 #> #> $threshold #> [1] 0.6 #> #> $k #> [1] 1 #> #> $w #> [1] 0.5 #> #> $minimum_rate #> [1] 0.001 #> #> $sampling_interval #> [1] 5 #> #> $use_exact_mean #> [1] 0 #> #> $t_ratio #> [1] 1.2 #> #> $t_constant #> [1] NA #> #> $alpha #> [1] 0.08 #> #> $alpha_reward #> [1] 0.8 #> #> $use_timed_alpha #> [1] 0 #> #> $alpha_exponent #> [1] 1 #> #> $alpha_init #> [1] 1 #> #> $alpha_min #> [1] 0 #> #> $add_beta #> [1] 0 #> #> $jitter #> [1] 1 experiment <- make_experiment(fpfn, parameters = pars, model = \"ANCCR\" ) head(experiences(experiment)[[1]], 20) #> model group phase tp tn is_test block_size trial stimulus time reward_mag #> 1 ANCCR FP phase1 2 T FALSE 2 1 T 0.5 1 #> 2 ANCCR FP phase1 1 F>T>(US) FALSE 2 2 F 2.0 1 #> 3 ANCCR FP phase1 1 F>T>(US) FALSE 2 2 T 3.0 1 #> 4 ANCCR FP phase1 1 F>T>(US) FALSE 2 2 US 4.0 1 #> 5 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 F 5.5 1 #> 6 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 T 6.5 1 #> 7 ANCCR FP phase1 1 F>T>(US) FALSE 2 3 US 7.5 1 #> 8 ANCCR FP phase1 2 T FALSE 2 4 T 9.0 1 #> 9 ANCCR FP phase1 1 F>T>(US) FALSE 2 5 F 10.5 1 #> 10 ANCCR FP phase1 1 F>T>(US) FALSE 2 5 T 11.5 1 #> 11 ANCCR FP phase1 1 F>T>(US) FALSE 2 5 US 12.5 1 #> 12 ANCCR FP phase1 2 T FALSE 2 6 T 14.0 1 #> 13 ANCCR FP phase1 2 T FALSE 2 7 T 15.5 1 #> 14 ANCCR FP phase1 1 F>T>(US) FALSE 2 8 F 17.0 1 #> 15 ANCCR FP phase1 1 F>T>(US) FALSE 2 8 T 18.0 1 #> 16 ANCCR FP phase1 1 F>T>(US) FALSE 2 8 US 19.0 1 #> 17 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 F 20.5 1 #> 18 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 T 21.5 1 #> 19 ANCCR FP phase1 1 F>T>(US) FALSE 2 9 US 22.5 1 #> 20 ANCCR FP phase1 2 T FALSE 2 10 T 24.0 1 experiment <- run_experiment(experiment) # Action values patch_plots(plot(experiment, type = \"action_values\")) # ANCCR patch_plots(plot(experiment, type = \"anccrs\")) # Dopamine transients patch_plots(plot(experiment, type = \"dopamines\"))"},{"path":[]},{"path":"https://victornavarro.org/calmr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Victor Navarro. Author, maintainer, copyright holder.","code":""},{"path":"https://victornavarro.org/calmr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Navarro V (2024). calmr: Canonical Associative Learning Models Representations. R package version 0.6.3, https://victornavarro.org/calmr/, https://github.com/victor-navarro/calmr.","code":"@Manual{, title = {calmr: Canonical Associative Learning Models and their Representations}, author = {Victor Navarro}, year = {2024}, note = {R package version 0.6.3, https://victornavarro.org/calmr/}, url = {https://github.com/victor-navarro/calmr}, }"},{"path":"https://victornavarro.org/calmr/index.html","id":"calmr","dir":"","previous_headings":"","what":"Canonical Associative Learning Models and their Representations","title":"Canonical Associative Learning Models and their Representations","text":"Canonical Associative Learning Models Representations","code":""},{"path":"https://victornavarro.org/calmr/index.html","id":"installing-the-latest-stable-version","dir":"","previous_headings":"","what":"Installing the latest stable version","title":"Canonical Associative Learning Models and their Representations","text":"may install latest stable version CRAN:","code":"install.packages(\"calmr\")"},{"path":"https://victornavarro.org/calmr/index.html","id":"installing-the-latest-version","dir":"","previous_headings":"","what":"Installing the latest version","title":"Canonical Associative Learning Models and their Representations","text":"feeling daring, can install latest version package. need devtools install package GitHub. managed build vignettes, ’s vignette showing basics package. (Worry , package’s website also ). want simulations using companion app, must install calmr.app package launch app.","code":"install.packages(\"devtools\") devtools::install_github(\"victor-navarro/calmr\") vignette(\"calmr_basics\", package = \"calmr\") devtools::install_github(\"victor-navarro/calmr.app\") calmr.app::launch_app()"},{"path":"https://victornavarro.org/calmr/index.html","id":"try-the-online-shiny-app","dir":"","previous_headings":"","what":"Try the online Shiny app","title":"Canonical Associative Learning Models and their Representations","text":"want check app without committing install, can check (wary: server might run free monthly quota). https://victor-navarro.shinyapps.io/calmr_app/","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr designs — CalmrDesign-class","title":"S4 class for calmr designs — CalmrDesign-class","text":"S4 class calmr designs","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr designs — CalmrDesign-class","text":"design: list containing design information. mapping: list containing object mapping. raw_design: original data.frame.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrDesign methods — CalmrDesign-methods","title":"CalmrDesign methods — CalmrDesign-methods","text":"S4 methods CalmrDesign class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrDesign methods — CalmrDesign-methods","text":"","code":"# S4 method for CalmrDesign show(object) # S4 method for CalmrDesign mapping(object) # S4 method for CalmrDesign trials(object)"},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrDesign methods — CalmrDesign-methods","text":"object CalmrDesign object","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrDesign-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrDesign methods — CalmrDesign-methods","text":"show() returns NULL (invisibly). mapping() returns list trial mappings. trials() returns NULL (invisibly).","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrExperiment methods — CalmrExperiment-methods","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"S4 methods CalmrExperiment class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"","code":"# S4 method for CalmrExperiment show(object) # S4 method for CalmrExperiment design(x) # S4 method for CalmrExperiment trials(object) # S4 method for CalmrExperiment parameters(x) # S4 method for CalmrExperiment parameters(x) <- value # S4 method for CalmrExperiment experiences(x) # S4 method for CalmrExperiment experiences(x) <- value # S4 method for CalmrExperiment results(object) # S4 method for CalmrExperiment raw_results(object) # S4 method for CalmrExperiment parsed_results(object) # S4 method for CalmrExperiment length(x) # S4 method for CalmrExperiment parse(object, outputs = NULL) # S4 method for CalmrExperiment aggregate(x, outputs = NULL) # S4 method for CalmrExperiment plot(x, type = NULL, ...) # S4 method for CalmrExperiment graph(x, ...) # S4 method for CalmrExperiment timings(x) # S4 method for CalmrExperiment timings(x) <- value"},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"object, x CalmrExperiment object. value list parameters (list parameter lists). outputs character vector specifying model outputs parse. type character vector specifying type(s) plots create. Defaults NULL. See supported_plots. ... Extra arguments passed calmr_model_graph() calmr_model_plot().","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrExperiment methods — CalmrExperiment-methods","text":"show() returns NULL (invisibly). design() returns CalmrDesign contained object. trials() returns NULL (invisibly). parameters() returns list parameters contained object. parameters()<- returns object updating parameters. experiences() returns list data.frame objects containing model training routines. experiences()<- returns object updating experiences. results() returns data.table objects aggregated results. raw_results() returns list raw model results. parsed_results() returns list data.table objects parsed results. length() returns integer specifying total length experiment (groups iterations). parse() returns object parsing raw results. aggregate() returns object aggregating parsed results. plot() returns list 'ggplot' plot objects. graph() returns list 'ggplot' plot objects. timings() returns list timings contained object. timings()<- returns object updating timings.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr experiments. — CalmrExperiment-class","title":"S4 class for calmr experiments. — CalmrExperiment-class","text":"S4 class calmr experiments.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperiment.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr experiments. — CalmrExperiment-class","text":"design: CalmrDesign object. model: string specifying model used. groups: string specifying groups design. parameters: list parameters used, per group. timings: list timings used design. experiences: list experiences model. results: CalmrExperimentResult object. .model: Internal. model associated iteration. .group: Internal. group associated iteration. .iter: Internal. iteration number.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/CalmrExperimentResult.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr experiment results — CalmrExperimentResult-class","title":"S4 class for calmr experiment results — CalmrExperimentResult-class","text":"S4 class calmr experiment results","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrExperimentResult.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr experiment results — CalmrExperimentResult-class","text":"aggregated_results list data.table objects aggregated results. parsed_results list containing data.table objects parsed results. raw_results list raw model outputs.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr Fit — CalmrFit-class","title":"S4 class for calmr Fit — CalmrFit-class","text":"S4 class calmr Fit","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr Fit — CalmrFit-class","text":"nloglik: Numeric. Negative log likelihood fit best_pars: Numeric. Best fitting parameters model_pars: Numeric. Parameters used model function link_pars: Numeric. Parameters used link function data: Numeric. Data used fit model_function: Function. Model function link_function: Function. Link function ll_function: Function. Objective function (usually nloglikelihood) optimizer_options: List. Options used optimizer extra_pars: List. Extra parameters passed fit call (...)","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrFit methods — CalmrFit-methods","title":"CalmrFit methods — CalmrFit-methods","text":"S4 methods CalmrFit class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrFit methods — CalmrFit-methods","text":"","code":"# S4 method for CalmrFit show(object) # S4 method for CalmrFit predict(object, type = \"response\", ...) # S4 method for CalmrFit NLL(object) # S4 method for CalmrFit AIC(object, k = 2) # S4 method for CalmrFit BIC(object)"},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrFit methods — CalmrFit-methods","text":"object CalmrFit object. type string specifying type prediction generate. ... Extra named arguments. k Penalty term AIC method.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrFit methods — CalmrFit-methods","text":"show() returns NULL (invisibly). predict() returns numeric vector. NLL() returns negative log likelihood model. AIC() returns Akaike Information Criterion (AIC) model. BIC() returns Bayesian Information Criterion (BIC) model.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrFit-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CalmrFit methods — CalmrFit-methods","text":"type = \"response\", predict() function passed model responses link function used fit model. AIC defined 2*k - 2*-NLL, k penalty term NLL negative log likelihood model. BIC defined p*log(n) - 2*-NLL, p number parameters model n number observations","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr representational similarity analysis — CalmrRSA-class","title":"S4 class for calmr representational similarity analysis — CalmrRSA-class","text":"S4 class calmr representational similarity analysis","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr representational similarity analysis — CalmrRSA-class","text":"corr_mat: array containing correlation matrix distances: list pairwise distance matrices args: list arguments used create object. test_data: list permutation data, populated testing object.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrRSA methods — CalmrRSA-methods","title":"CalmrRSA methods — CalmrRSA-methods","text":"S4 methods CalmrRSA class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrRSA methods — CalmrRSA-methods","text":"","code":"# S4 method for CalmrRSA show(object) # S4 method for CalmrRSA test(object, n_samples = 1000, p = 0.95) # S4 method for CalmrRSA plot(x)"},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrRSA methods — CalmrRSA-methods","text":"object, x CalmrRSA object. n_samples number samples permutation test (default = 1e3) p critical threshold level permutation test (default = 0.95)","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrRSA-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrRSA methods — CalmrRSA-methods","text":"show() returns NULL (invisibly). test() returns CalmrRSA object permutation test data. plot() returns list 'ggplot' plot objects.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"CalmrResult methods — CalmrResult-methods","title":"CalmrResult methods — CalmrResult-methods","text":"S4 methods CalmrResults class.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CalmrResult methods — CalmrResult-methods","text":"","code":"# S4 method for CalmrResult show(object)"},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CalmrResult methods — CalmrResult-methods","text":"object CalmrResults object.","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CalmrResult methods — CalmrResult-methods","text":"show() returns NULL (invisibly).","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for calmr results — CalmrResult-class","title":"S4 class for calmr results — CalmrResult-class","text":"S4 class calmr results","code":""},{"path":"https://victornavarro.org/calmr/reference/CalmrResult.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for calmr results — CalmrResult-class","text":"aggregated_results list data.table objects aggregated results. parsed_results list containing data.table objects parsed results. raw_results list raw model outputs.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform representational similarity analysis — rsa","title":"Perform representational similarity analysis — rsa","text":"Perform representational similarity analysis","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform representational similarity analysis — rsa","text":"","code":"rsa(x, comparisons, test = FALSE, ...)"},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform representational similarity analysis — rsa","text":"x list CalmrExperiment objects comparisons model-named list containing model outputs compare. test Whether test RSA via permutation test. Default = FALSE. ... Additional parameters passed stats::dist() stats::cor()","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform representational similarity analysis — rsa","text":"CalmrRSA object","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Perform representational similarity analysis — rsa","text":"object returned function can later tested via test() method.","code":""},{"path":"https://victornavarro.org/calmr/reference/RSA.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform representational similarity analysis — rsa","text":"","code":"# Comparing the associations in three models exp <- data.frame( Group = c(\"A\", \"B\"), P1 = c(\"2(A)>(US)/1B>(US)\", \"1(A)>(US)/2B>(US)\"), R1 = TRUE ) models <- c(\"HD2022\", \"RW1972\", \"PKH1982\") parameters <- sapply(models, get_parameters, design = exp) exp_res <- compare_models(exp, models = models ) comparisons <- list( \"HD2022\" = c(\"associations\"), \"RW1972\" = c(\"associations\"), \"PKH1982\" = c(\"associations\") ) res <- rsa(exp_res, comparisons = comparisons) test(res, n_samples = 20) #> CalmrRSA object #> --------------- #> Correlation matrix: #> HD2022.associations RW1972.associations #> HD2022.associations 1.0000000 0.3022383 #> RW1972.associations 0.3022383 1.0000000 #> PKH1982.associations -0.9178532 0.1009465 #> PKH1982.associations #> HD2022.associations -0.9178532 #> RW1972.associations 0.1009465 #> PKH1982.associations 1.0000000 #> --------------- #> Significance matrix: #> HD2022.associations RW1972.associations #> HD2022.associations FALSE FALSE #> RW1972.associations FALSE FALSE #> PKH1982.associations FALSE FALSE #> PKH1982.associations #> HD2022.associations FALSE #> RW1972.associations FALSE #> PKH1982.associations FALSE #> From 20 permutation samples, two-tailed test with alpha = 0.05."},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a graph with calmr data — calmr_model_graph","title":"Create a graph with calmr data — calmr_model_graph","text":"patch_graphs() patches graphs 'patchwork'","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a graph with calmr data — calmr_model_graph","text":"","code":"calmr_model_graph( x, loops = TRUE, limits = max(abs(x$value)) * c(-1, 1), colour_key = FALSE, t = max(x$trial), options = get_graph_opts() ) patch_graphs(graphs, selection = names(graphs)) get_graph_opts(graph_size = \"small\")"},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a graph with calmr data — calmr_model_graph","text":"x data.frame-like data use plot. Contains column named value. loops Logical. Whether draw arrows back forth limits Numerical. Limits color scale. Defaults max(abs(x$value))*c(-1,1). colour_key Logical. Whether show color key t trial weights obtained (defaults maximum trial data). options list graph options, returned get_graph_opts(). graphs list (named) graphs, returned graph() calmr_model_graph() selection character numeric vector determining plots patch. graph_size string (either \"small\" \"large\"). return default values small large graphs trial Numerical. trial graph.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a graph with calmr data — calmr_model_graph","text":"'ggplot' object patch_graphs() returns 'patchwork' object list graph options, passed ggnetwork::geom_nodes().","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_graph.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a graph with calmr data — calmr_model_graph","text":"probably getting graphs via graph method CalmrExperiment.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a plot with calmr data — calmr_model_plot","title":"Create a plot with calmr data — calmr_model_plot","text":"plot_common_scale() rescales list plots common scale. get_plot_opts() returns generic plotting options. patch_plots() patches plots using patchwork package.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a plot with calmr data — calmr_model_plot","text":"","code":"calmr_model_plot(data, type, model, ...) plot_common_scale(plots) get_plot_opts(common_scale = TRUE) patch_plots(plots, selection = names(plots), plot_options = get_plot_opts())"},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a plot with calmr data — calmr_model_plot","text":"data data.table containing aggregated data CalmrExperiment type character specifying type plot. model character specifying model. ... parameters passed plotting functions. plots list (named) plots, returned plot() calmr_model_plot() common_scale Logical specifying whether plots common scale. selection character numeric vector determining plots patch plot_options list plot options returned get_plot_opts()","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a plot with calmr data — calmr_model_plot","text":"'ggplot' object. plot_common_scale() returns list plots. get_plot_opts() returns list. patch_plots() returns patchwork object.","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_model_plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a plot with calmr data — calmr_model_plot","text":"probably getting plots via plot() method CalmrExperiment.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":null,"dir":"Reference","previous_headings":"","what":"Set verbosity options for calmr — calmr_verbosity","title":"Set verbosity options for calmr — calmr_verbosity","text":"Whether show verbosity messages progress bars","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set verbosity options for calmr — calmr_verbosity","text":"","code":"calmr_verbosity(verbose)"},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set verbosity options for calmr — calmr_verbosity","text":"verbose logical","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set verbosity options for calmr — calmr_verbosity","text":"list progressr handlers (invisibly).","code":""},{"path":"https://victornavarro.org/calmr/reference/calmr_verbosity.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Set verbosity options for calmr — calmr_verbosity","text":"Progress bars handled progressr package. just convenience function. See package 'progressr' details.","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":null,"dir":"Reference","previous_headings":"","what":"Run models given a set of parameters — compare_models","title":"Run models given a set of parameters — compare_models","text":"Run models given set parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run models given a set of parameters — compare_models","text":"","code":"compare_models(x, models = NULL, ...)"},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run models given a set of parameters — compare_models","text":"x list CalmrExperiment objects design data.frame. models character vector length m, specifying models run. Ignored x list CalmrExperiment objects. ... Arguments passed make_experiment.","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run models given a set of parameters — compare_models","text":"list CalmrExperiment objects","code":""},{"path":"https://victornavarro.org/calmr/reference/compare_models.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run models given a set of parameters — compare_models","text":"","code":"# By making experiment beforehand (recommended) df <- get_design(\"blocking\") models <- c(\"HD2022\", \"RW1972\", \"PKH1982\") exps <- lapply(models, function(m) { make_experiment(df, parameters = get_parameters(df, model = m), model = m ) }) comp <- compare_models(exps) # By passing minimal arguments (not recommended; default parameters) comp <- compare_models(df, models = models)"},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit model to data — fit_model","title":"Fit model to data — fit_model","text":"Obtain MLE estimates model, given data.","code":""},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit model to data — fit_model","text":"","code":"fit_model(data, model_function, optimizer_options, file = NULL, ...)"},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit model to data — fit_model","text":"data numeric vector containing data fit model . model_function function runs model returns data.frame value, organized data. optimizer_options list options optimizer, returned get_optimizer_opts. file path save model fit. arguments fit call found identical file, model just gets loaded. ... Extra parameters passed optimizer call.","code":""},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit model to data — fit_model","text":"CalmrFit object","code":""},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Fit model to data — fit_model","text":"See calmr_fits vignette examples","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/fit_model.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit model to data — fit_model","text":"","code":"# Make some fake data df <- data.frame(g = \"g\", p1 = \"3A>(US)\", r1 = TRUE) pars <- get_parameters(df, model = \"RW1972\") pars$alphas[\"US\"] <- 0.9 exper <- make_experiment(df, parameters = pars, model = \"RW1972\") res <- run_experiment(exper, outputs = \"responses\") responses <- results(res)$responses$value # define model function model_fun <- function(p, ex) { np <- parameters(ex) np[[1]]$alphas[] <- p parameters(ex) <- np results(run_experiment(ex))$responses$value } # Get optimizer options optim_opts <- get_optimizer_opts( model_pars = names(pars$alphas), ll = rep(.05, 2), ul = rep(.95, 2), optimizer = \"optim\", family = \"identity\" ) optim_opts$initial_pars[] <- rep(.6, 2) fit_model(responses, model_fun, optim_opts, ex = exper, method = \"L-BFGS-B\", control = list(maxit = 1) ) #> Calmr model fit #> -------------- #> Parameters: #> A US #> 0.4386228 0.8962406 #> -------------- #> #> nLogLik: 11.029"},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":null,"dir":"Reference","previous_headings":"","what":"Get basic designs — get_design","title":"Get basic designs — get_design","text":"Get basic designs","code":""},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get basic designs — get_design","text":"","code":"get_design(design_name = NULL)"},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get basic designs — get_design","text":"design_name string specifying design name (default = NULL)","code":""},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get basic designs — get_design","text":"design_name NULL, data.frame containing design. Otherwise, list containing available designs.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/get_design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get basic designs — get_design","text":"","code":"names(get_design()) #> [1] \"blocking\" \"relative_validity\" \"controlled_blocking\" get_design(\"blocking\") #> Group P1 R1 P2 R2 #> 1 Blocking 10N>(US) FALSE 10NL>(US)/10#L FALSE #> 2 Control FALSE 10NL>(US)/10#L FALSE"},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":null,"dir":"Reference","previous_headings":"","what":"Get optimizer options — get_optimizer_opts","title":"Get optimizer options — get_optimizer_opts","text":"Get optimizer options","code":""},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get optimizer options — get_optimizer_opts","text":"","code":"get_optimizer_opts( model_pars, initial_pars = rep(NA, length(model_pars)), ll = rep(NA, length(model_pars)), ul = rep(NA, length(model_pars)), optimizer = NULL, family = NULL )"},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get optimizer options — get_optimizer_opts","text":"model_pars character vector specifying name parameters fit. initial_pars numeric vector specifying initial parameter values #' evaluate model (required optim). Defaults 0 parameter. ll, ul numeric vector specifying lower upper limits parameters fit, respectively optimizer string specifying optimizer use. One c(\"optim\", \"ga\") family string specifying family function generate responses (calculate likelihood function ). One c(\"identity\", \"normal\", \"poisson\").","code":""},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get optimizer options — get_optimizer_opts","text":"list optimizer options.","code":""},{"path":"https://victornavarro.org/calmr/reference/get_optimizer_opts.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Get optimizer options — get_optimizer_opts","text":"Whenever family function identity used, family-specific parameters always appended end relevant lists.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Get model parameters — get_parameters","title":"Get model parameters — get_parameters","text":"Get model parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get model parameters — get_parameters","text":"","code":"get_parameters(design, model = NULL)"},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get model parameters — get_parameters","text":"design data.frame containing experimental design. model string specifying model. One supported_models().","code":""},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get model parameters — get_parameters","text":"list model parameters depending model","code":""},{"path":"https://victornavarro.org/calmr/reference/get_parameters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get model parameters — get_parameters","text":"","code":"block <- get_design(\"blocking\") get_parameters(block, model = \"SM2007\") #> $alphas #> L N US #> 0.4 0.4 0.4 #> #> $lambdas #> L N US #> 1 1 1 #> #> $omegas #> L N US #> 0.2 0.2 0.2 #> #> $rhos #> L N US #> 1 1 1 #> #> $gammas #> L N US #> 1 1 1 #> #> $taus #> L N US #> 0.2 0.2 0.2 #> #> $order #> [1] 1 #>"},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":null,"dir":"Reference","previous_headings":"","what":"Get timing design parameters — get_timings","title":"Get timing design parameters — get_timings","text":"Get timing design parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get timing design parameters — get_timings","text":"","code":"get_timings(design)"},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get timing design parameters — get_timings","text":"design data.frame containing experimental design.","code":""},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get timing design parameters — get_timings","text":"list timing design parameters.","code":""},{"path":"https://victornavarro.org/calmr/reference/get_timings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get timing design parameters — get_timings","text":"","code":"block <- get_design(\"blocking\") get_timings(block) #> $use_exponential #> [1] TRUE #> #> $time_resolution #> [1] 0.5 #> #> $trial_ts #> trial post_trial_delay mean_ITI max_ITI #> 1 N>(US) 1 30 90 #> 2 NL>(US) 1 30 90 #> 3 #L 1 30 90 #> #> $period_ts #> trial period stimulus stimulus_duration #> 1 N>(US) N N 1 #> 2 N>(US) (US) US 1 #> 3 NL>(US) NL N 1 #> 4 NL>(US) NL L 1 #> 5 NL>(US) (US) US 1 #> 6 #L L L 1 #> #> $transition_ts #> trial transition transition_delay #> 1 N>(US) N>(US) 1 #> 2 NL>(US) NL>(US) 1 #>"},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":null,"dir":"Reference","previous_headings":"","what":"Make CalmrExperiment — make_experiment","title":"Make CalmrExperiment — make_experiment","text":"Makes CalmrExperiment object containing arguments necessary run experiment.","code":""},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make CalmrExperiment — make_experiment","text":"","code":"make_experiment( design, model, parameters = NULL, timings = NULL, iterations = 1, miniblocks = TRUE, .callback_fn = NULL, ... )"},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make CalmrExperiment — make_experiment","text":"design design data.frame. model string specifying model name. One supported_models(). parameters Optional. Parameters model returned get_parameters(). timings Optional. Timings time-based design returned get_timings() iterations integer specifying number iterations per group. Default = 1. miniblocks Whether organize trials miniblocks. Default = TRUE. .callback_fn function keeping track progress. Internal use. ... Extra parameters passed functions.","code":""},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make CalmrExperiment — make_experiment","text":"CalmrExperiment object.","code":""},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Make CalmrExperiment — make_experiment","text":"miniblocks option direct sampling function create equally-sized miniblocks random trials within phase. example, phase string \"2A/2B\" create two miniblocks one trial. phase string \"2A/4B\" create two miniblocks one trial, 2 B trials. However, phase string \"2A/1B\" result miniblocks, even miniblocks set TRUE.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/make_experiment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make CalmrExperiment — make_experiment","text":"","code":"des <- data.frame(Group = \"G1\", P1 = \"10A>(US)\", R1 = TRUE) ps <- get_parameters(des, model = \"HD2022\") make_experiment( design = des, parameters = ps, model = \"HD2022\", iterations = 2 ) #> ----------------------------- #> CalmrExperiment with model: #> HD2022 #> ----------------------------- #> Design: #> Group P1 R1 #> 1 G1 10A>(US) TRUE #> ----------------------------- #> Parameters: #> $G1 #> $G1$alphas #> A US #> 0.4 0.4 #>"},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":null,"dir":"Reference","previous_headings":"","what":"Model information functions — model_information","title":"Model information functions — model_information","text":"assortment functions return model information.","code":""},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Model information functions — model_information","text":"","code":"supported_models() supported_timed_models() supported_optimizers() supported_families() supported_plots(model = NULL) get_model(model) model_parameters(model = NULL) model_outputs(model = NULL)"},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Model information functions — model_information","text":"model string specifying model. One supported_models().","code":""},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Model information functions — model_information","text":"supported_models() returns character vector. supported_timed_models() returns character vector. supported_optimizers() returns character vector. supported_families() returns character vector. supported_plots() returns character vector list (model NULL). get_model() returns model function. model_parameters() returns list list lists (model NULL). model_outputs() returns character vector list (model NULL).","code":""},{"path":"https://victornavarro.org/calmr/reference/model_information.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Model information functions — model_information","text":"","code":"# Outputs and plots supported by the RW1972 model model_outputs(\"RW1972\") #> [1] \"associations\" \"responses\" # Getting the model function implementing the PKH1982 model pkh_func <- get_model(\"PKH1982\") head(pkh_func, 10) #> #> 1 function (ev = NULL, iv = NULL, parameters, experience, mapping, #> 2 ...) #> 3 { #> 4 .assert_no_functional(mapping) #> 5 ntrials <- length(experience$tp) #> 6 fsnames <- mapping$unique_functional_stimuli #> 7 if (is.null(ev)) { #> 8 ev <- gen_ss_weights(fsnames) #> 9 } #> 10 if (is.null(iv)) { # Getting the parameters required by SM2007 model_parameters(\"SM2007\") #> $name #> [1] \"alphas\" \"lambdas\" \"omegas\" \"rhos\" \"gammas\" \"taus\" \"order\" #> #> $default_value #> [1] 0.4 1.0 0.2 1.0 1.0 0.2 1.0 #>"},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse design data.frame — parse_design","title":"Parse design data.frame — parse_design","text":"Parse design data.frame","code":""},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse design data.frame — parse_design","text":"","code":"parse_design(df)"},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse design data.frame — parse_design","text":"df data.frame dimensions (groups) (2*phases+1).","code":""},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse design data.frame — parse_design","text":"CalmrDesign object.","code":""},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Parse design data.frame — parse_design","text":"entry even-numbered columns df string formatted per phase_parser().","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/parse_design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parse design data.frame — parse_design","text":"","code":"df <- data.frame( Group = c(\"Group 1\", \"Group 2\"), P1 = c(\"10AB(US)\", \"10A(US)\"), R1 = c(TRUE, TRUE) ) parse_design(df) #> CalmrDesign built from data.frame: #> Group P1 R1 #> 1 Group 1 10AB(US) TRUE #> 2 Group 2 10A(US) TRUE #> ---------------- #> Trials detected: #> group phase trial_names trial_repeats is_test stimuli #> 1 Group 1 P1 AB(US) 10 FALSE A;B;US #> 2 Group 2 P1 A(US) 10 FALSE A;US"},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":null,"dir":"Reference","previous_headings":"","what":"Rat responses from Patittucci et al. 2016 — pati","title":"Rat responses from Patittucci et al. 2016 — pati","text":"dataset containing rat nose pokes lever presses levers associated different appetitive stimuli.","code":""},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rat responses from Patittucci et al. 2016 — pati","text":"","code":"pati"},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Rat responses from Patittucci et al. 2016 — pati","text":"data.frame following variables: subject subject identifier block 2-session block training (1 8) lever lever presented trial: L = left; R = right us stimulus followed lever: P = pellet; S = sucrose response response: lp = lever press; np = nose poke rpert responses per trial","code":""},{"path":"https://victornavarro.org/calmr/reference/pati.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Rat responses from Patittucci et al. 2016 — pati","text":"Patittucci et al. (2016). JEP:ALC","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":null,"dir":"Reference","previous_headings":"","what":"Parses a phase string — phase_parser","title":"Parses a phase string — phase_parser","text":"Parses phase string","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parses a phase string — phase_parser","text":"","code":"phase_parser(phase_string)"},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parses a phase string — phase_parser","text":"phase_string string specifying trials within phase.","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parses a phase string — phase_parser","text":"named list : trial_info: trial-named list lists. general_info: General phase information.","code":""},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Parses a phase string — phase_parser","text":"function meant internal use , expose can test strings.","code":""},{"path":[]},{"path":"https://victornavarro.org/calmr/reference/phase_parser.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parses a phase string — phase_parser","text":"","code":"# A silly (but valid) string phase_parser(\"10#Rescorla>Wagner\") #> $trial_info #> $trial_info$`10#Rescorla>Wagner` #> $trial_info$`10#Rescorla>Wagner`$name #> [1] \"#Rescorla>Wagner\" #> #> $trial_info$`10#Rescorla>Wagner`$repetitions #> [1] 10 #> #> $trial_info$`10#Rescorla>Wagner`$is_test #> [1] TRUE #> #> $trial_info$`10#Rescorla>Wagner`$periods #> [1] \"Rescorla\" \"Wagner\" #> #> $trial_info$`10#Rescorla>Wagner`$nominals #> $trial_info$`10#Rescorla>Wagner`$nominals$Rescorla #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" #> #> $trial_info$`10#Rescorla>Wagner`$nominals$Wagner #> [1] \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> #> $trial_info$`10#Rescorla>Wagner`$functionals #> $trial_info$`10#Rescorla>Wagner`$functionals$Rescorla #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" #> #> $trial_info$`10#Rescorla>Wagner`$functionals$Wagner #> [1] \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> #> $trial_info$`10#Rescorla>Wagner`$all_nominals #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> $trial_info$`10#Rescorla>Wagner`$all_functionals #> [1] \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"a\" \"g\" \"n\" \"e\" \"r\" #> #> #> #> $general_info #> $general_info$trial_names #> [1] \"#Rescorla>Wagner\" #> #> $general_info$trial_repeats #> [1] 10 #> #> $general_info$is_test #> [1] TRUE #> #> $general_info$nomi2func #> R e s c o r l a W g n #> \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"g\" \"n\" #> #> $general_info$func2nomi #> R e s c o r l a W g n #> \"R\" \"e\" \"s\" \"c\" \"o\" \"r\" \"l\" \"a\" \"W\" \"g\" \"n\" #> #> # An invalid string that needs trial repetitions for one of trials. try(phase_parser(\"10#Rescorla/Wagner\")) #> Error in if (is.na(treps)) 1 else treps : argument is of length zero"},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":null,"dir":"Reference","previous_headings":"","what":"General plotting functions — plotting_functions","title":"General plotting functions — plotting_functions","text":"plot_targetted_tbins() plots targetted time data trial. plot_tbins() plots non-targetted time data trial. plot_targetted_trials() plots targetted trial data. plot_trials() plots non-targetted trial data. plot_targetted_typed_trials() plots targetted trial data type. plot_targetted_complex_trials() plots targetted data third variable.","code":""},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"General plotting functions — plotting_functions","text":"","code":"plot_targetted_tbins(data, t = max(data$trial)) plot_tbins(data, t = max(data$trial)) plot_targetted_trials(data) plot_trials(data) plot_targetted_typed_trials(data) plot_targetted_complex_trials(data, col)"},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"General plotting functions — plotting_functions","text":"data data.frame-like data plot. t numeric vector specifying trial(s) plot. Defaults last trial data. col string specifying column third variable.","code":""},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"General plotting functions — plotting_functions","text":"plot_targetted_tbins() returns 'ggplot' object. plot_tbins() returns 'ggplot' object. plot_targetted_trials() returns 'ggplot' object. plot_trials() returns 'ggplot' object. plot_targetted_typed_trials() returns 'ggplot' object. plot_targetted_complex_trials() returns 'ggplot' object.","code":""},{"path":"https://victornavarro.org/calmr/reference/plotting_functions.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"General plotting functions — plotting_functions","text":"data must organised returned results() parsed_results().","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":null,"dir":"Reference","previous_headings":"","what":"Run experiment — run_experiment","title":"Run experiment — run_experiment","text":"Runs experiment minimal parameters.","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run experiment — run_experiment","text":"","code":"run_experiment(x, outputs = NULL, parse = TRUE, aggregate = TRUE, ...)"},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run experiment — run_experiment","text":"x CalmrExperiment design data.frame outputs character vector specifying outputs parse aggregate. Defaults NULL, case model outputs parsed/aggregated. parse logical specifying whether raw results parsed. Default = TRUE. aggregate logical specifying whether parsed results aggregated. Default = TRUE. ... Arguments passed functions","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run experiment — run_experiment","text":"CalmrExperiment results.","code":""},{"path":"https://victornavarro.org/calmr/reference/run_experiment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run experiment — run_experiment","text":"","code":"# Using a data.frame only (throws warning) df <- get_design(\"relative_validity\") run_experiment(df, model = \"RW1972\") #> Warning: Using default model parameters. #> ----------------------------- #> CalmrExperiment with model: #> RW1972 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 True 10AB(US)/10AC TRUE 1#A TRUE #> 2 Pseudo 5AB(US)/5AB/5AC(US)/5AC TRUE 1#A TRUE #> ----------------------------- #> Parameters: #> $True #> $True$alphas #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $True$betas_on #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $True$betas_off #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $True$lambdas #> A B C US #> 1 1 1 1 #> #> #> $Pseudo #> $Pseudo$alphas #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $Pseudo$betas_on #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $Pseudo$betas_off #> A B C US #> 0.4 0.4 0.4 0.4 #> #> $Pseudo$lambdas #> A B C US #> 1 1 1 1 #> # Using custom parameters df <- get_design(\"relative_validity\") pars <- get_parameters(df, model = \"HD2022\") pars$alphas[\"US\"] <- 0.6 run_experiment(df, parameters = pars, model = \"HD2022\") #> ----------------------------- #> CalmrExperiment with model: #> HD2022 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 True 10AB(US)/10AC TRUE 1#A TRUE #> 2 Pseudo 5AB(US)/5AB/5AC(US)/5AC TRUE 1#A TRUE #> ----------------------------- #> Parameters: #> $True #> $True$alphas #> A B C US #> 0.4 0.4 0.4 0.6 #> #> #> $Pseudo #> $Pseudo$alphas #> A B C US #> 0.4 0.4 0.4 0.6 #> # Using make_experiment, for more iterations df <- get_design(\"blocking\") pars <- get_parameters(df, model = \"SM2007\") exper <- make_experiment(df, parameters = pars, model = \"SM2007\", iterations = 4 ) run_experiment(exper) #> ----------------------------- #> CalmrExperiment with model: #> SM2007 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 Blocking 10N>(US) FALSE 10NL>(US)/10#L FALSE #> 2 Control FALSE 10NL>(US)/10#L FALSE #> ----------------------------- #> Parameters: #> $Blocking #> $Blocking$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Blocking$lambdas #> L N US #> 1 1 1 #> #> $Blocking$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$rhos #> L N US #> 1 1 1 #> #> $Blocking$gammas #> L N US #> 1 1 1 #> #> $Blocking$taus #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$order #> [1] 1 #> #> #> $Control #> $Control$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Control$lambdas #> L N US #> 1 1 1 #> #> $Control$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Control$rhos #> L N US #> 1 1 1 #> #> $Control$gammas #> L N US #> 1 1 1 #> #> $Control$taus #> L N US #> 0.2 0.2 0.2 #> #> $Control$order #> [1] 1 #> # Only parsing the associations in the model, without aggregation run_experiment(exper, outputs = \"associations\", aggregate = FALSE) #> ----------------------------- #> CalmrExperiment with model: #> SM2007 #> ----------------------------- #> Design: #> Group P1 R1 P2 R2 #> 1 Blocking 10N>(US) FALSE 10NL>(US)/10#L FALSE #> 2 Control FALSE 10NL>(US)/10#L FALSE #> ----------------------------- #> Parameters: #> $Blocking #> $Blocking$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Blocking$lambdas #> L N US #> 1 1 1 #> #> $Blocking$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$rhos #> L N US #> 1 1 1 #> #> $Blocking$gammas #> L N US #> 1 1 1 #> #> $Blocking$taus #> L N US #> 0.2 0.2 0.2 #> #> $Blocking$order #> [1] 1 #> #> #> $Control #> $Control$alphas #> L N US #> 0.4 0.4 0.4 #> #> $Control$lambdas #> L N US #> 1 1 1 #> #> $Control$omegas #> L N US #> 0.2 0.2 0.2 #> #> $Control$rhos #> L N US #> 1 1 1 #> #> $Control$gammas #> L N US #> 1 1 1 #> #> $Control$taus #> L N US #> 0.2 0.2 0.2 #> #> $Control$order #> [1] 1 #>"},{"path":"https://victornavarro.org/calmr/reference/set_calmr_palette.html","id":null,"dir":"Reference","previous_headings":"","what":"Get/set the colour/fill palette for plots — set_calmr_palette","title":"Get/set the colour/fill palette for plots — set_calmr_palette","text":"Get/set colour/fill palette plots","code":""},{"path":"https://victornavarro.org/calmr/reference/set_calmr_palette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get/set the colour/fill palette for plots — set_calmr_palette","text":"","code":"set_calmr_palette(palette = NULL)"},{"path":"https://victornavarro.org/calmr/reference/set_calmr_palette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get/set the colour/fill palette for plots — set_calmr_palette","text":"palette string specifying available palettes. NULL, returns available palettes.","code":""},{"path":"https://victornavarro.org/calmr/reference/set_calmr_palette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get/set the colour/fill palette for plots — set_calmr_palette","text":"old palette (invisibly) palette NULL. Otherwise, character vector available palettes.","code":""},{"path":"https://victornavarro.org/calmr/reference/set_calmr_palette.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Get/set the colour/fill palette for plots — set_calmr_palette","text":"Changes affect palette used graphs.","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Set reward parameters for ANCCR model — set_reward_parameters","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"Set reward parameters ANCCR model","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"","code":"set_reward_parameters(parameters, rewards = c(\"US\"))"},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"parameters list parameters, returned get_parameters() rewards character vector specifying reward stimuli. Default = c(\"US\")","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"list parameters","code":""},{"path":"https://victornavarro.org/calmr/reference/set_reward_parameters.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Set reward parameters for ANCCR model — set_reward_parameters","text":"default behaviour get_parameters ANCCR model set every reward-related parameter non-zero default value. function set parameters zero non-reward stimuli","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-063","dir":"Changelog","previous_headings":"","what":"calmr 0.6.3","title":"calmr 0.6.3","text":"Added set_calmr_palette() function control colour/fill scales used plot results (#1).","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-062","dir":"Changelog","previous_headings":"","what":"calmr 0.6.2","title":"calmr 0.6.2","text":"Aggregation ANCCR data now ignores time; time entries averaged. Added Temporal Difference model name “TD”. model experimental state. Experiments time-based models now require separate list construct time-based experiences. See get_timings(). Added experiences<-, timings, timings<- methods CalmrExperiment class. Revamped plotting functions parsing functions. Revamped output names models make intelligible. Fixed bug related aggregation pools HDI2020 HD2022. Consolidated man pages.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-061","dir":"Changelog","previous_headings":"","what":"calmr 0.6.1","title":"calmr 0.6.1","text":"CRAN release: 2024-03-14 Added outputs argument run_experiment(), parse(), aggregate(), allowing user parse/aggregate model outputs. Documentation corrections CRAN resubmission.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-060","dir":"Changelog","previous_headings":"","what":"calmr 0.6.0","title":"calmr 0.6.0","text":"Added dependency data.table resulting great speedups large experiments. Replaced dependency cowplot dependency patchwork. Removed dependencies tibble, dplyr, tidyr, packages tidyverse. Removed shiny app package. previous app now distributed separately via calmr.app package available GitHub. Test coverage reached 100%. package now ready CRAN submission.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-051","dir":"Changelog","previous_headings":"","what":"calmr 0.5.1","title":"calmr 0.5.1","text":"Added parallelization progress bars via future, future.apply, progressr. Function calmr_verbosity can set verbosity package.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-050","dir":"Changelog","previous_headings":"","what":"calmr 0.5.0","title":"calmr 0.5.0","text":"Implementation ANCCR (Jeong et al., 2022), first time-based model included calmr. Added parameter distinction trial-wise period-wise parameters. Added internal augmentation arguments depending model. trial-based models use pre/post distinctions anymore. Using “>” special character affect models anymore. “>” special character used specify periods within trial. example, “>B>C” implies followed B followed C. See using_time_models vignette additional information. Named stimuli now support numbers trailing characters (e.g., “(US1)” valid now.)","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-040","dir":"Changelog","previous_headings":"","what":"calmr 0.4.0","title":"calmr 0.4.0","text":"Major refactoring classes models. help development moving forward. Added several methods access CalmrExperiment contents, including c (bind experiments) results, plot, graph, design, parameters. Created CalmrDesign CalmrResult classes. Rewrote parsers less verbose rely less tidyverse suite piping. Substantially reduced complexity make_experiment function (previous make_experiment). Introduced distinction stimulus-specific global parameters. Parameters now lists instead data.frames. Modified UI calmr app include sidebar. Simplified app removing options. Nearly duplicated number tests.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-030","dir":"Changelog","previous_headings":"","what":"calmr 0.3.0","title":"calmr 0.3.0","text":"Added first version SOCR model (SM2007) well two vignettes explaining math behind implementation quick simulations. Documentation progress.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-020","dir":"Changelog","previous_headings":"","what":"calmr 0.2.0","title":"calmr 0.2.0","text":"Added multiple models package app (RW1972, PKH1982, MAC1975). Implementation basic S4 classes model, experiment, fit, RSA comparison objects, well methods. Added genetic algorithms (via GA) parameter estimation. Added basic tools perform representational similarity analysis. Documentation progress.","code":""},{"path":"https://victornavarro.org/calmr/news/index.html","id":"calmr-010","dir":"Changelog","previous_headings":"","what":"calmr 0.1.0","title":"calmr 0.1.0","text":"heidi now calmr. package now aims maintain several associative learning models implement tools use. Major overhaul training function (train_pav_model). relevant calculations now done function functional stimuli instead just US. Support specification expectation/correction steps within trial via “>”. example, trial “>(US)” use generate expectation, learn stimuli correction step. previous plotting function R-values revamped allow simple complex versions. complex version facets r-values predictor basis, uses colour lines target. Bugfix related stimulus saliencies.","code":""}]
diff --git a/sitemap.xml b/sitemap.xml
index 3a817d9..5d7cf1b 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -144,6 +144,9 @@
https://victornavarro.org/calmr/reference/run_experiment.html
+
+ https://victornavarro.org/calmr/reference/set_calmr_palette.html
+
https://victornavarro.org/calmr/reference/set_reward_parameters.html