About
김용기
Yonggi Kim
Education
M.A. in Psychology
- August 2026, Department of Psychology, Chungbuk National University
- Dissertation: Local Dependence in Psychological Scales
- Advisor: Wooyeol Lee, Ph. D.
B.A. in Psychology & Brain and Cognitive Engineering
- August 2025, Department of Psychology, Chungbuk National University
Research Interests
My research focuses on generalized latent variable modeling for estimating and explaining individual differences across diverse measurement contexts. A current concern is how the metric and continuum of continuous latent variables are defined in item response theory and what practical consequences follow when functional-form assumptions are violated.
More broadly, I am interested in psychometric issues surrounding the measurement of psychological constructs. These include how validity and reliability are conceptualized in classical test theory and factor analysis. Within the item response theory framework, my interests extend to optimal test design, scoring, linking and equating, and differential item functioning.
I am also interested in the philosophy of measurement, particularly the philosophical issues and axiomatic systems concerned with establishing the equal-interval property of measurement scales.
Publications
2025
Kim, Y., & Lee, W. (2025). Shape of the null distribution in the likelihood ratio test for selecting random effects structures in experimental data analysis. Korean Journal of Psychology: General, 44(1), 1-23. https://doi.org/10.22257/kjp.2025.3.44.1.1
Manuscripts
Kim, Y., & Lee, W. (under review). Consequences of model misspecification when the shape of the item information function is bimodal.
Conference Presentations
2026
Kim, Y., & Lee, W. (2026, August). Measurement invariance in cross-cultural comparisons of the Big Five: A comparison of scoring and linking methods [Poster session]. Korean Psychological Association 80th Anniversary Annual Conference 2026, Seoul, Republic of Korea.
Kim, Y., & Han, Y. (2026, July). Comparing permutation methods for evaluating multidimensional scaling configuration similarity [Poster session]. International Meeting of the Psychometric Society (IMPS) 2026, Seoul, Republic of Korea.
Kim, Y., & Lee, W. (2026, April). Effects of model misspecification on abilities in the presence of item complexity [Graduate student e-board session]. National Council on Measurement in Education (NCME) Annual Meeting 2026, Los Angeles, CA, USA.
Teaching Experience
Teaching Assistant
- August 2025 to August 2026, Department of Psychology, Chungbuk National University
Awards
2026
Paper Presentation Award (Representative Awardee)
- August 2026, Korean Psychological Association 80th Anniversary Annual Conference
Outstanding Academic Research Award (Research Presentation Category)
- June 2026, Department of Psychology, Chungbuk National University
Selected Participant (Graduate Student Works-In-Progress eBoard Competition)
- February 2026, 2025-2026 NCME Graduate Student Issues Committee
2025
Outstanding Academic Research Award (Thesis Presentation Category)
- December 2025, Department of Psychology, Chungbuk National University
Junior BK Fellowship (Outstanding Paper Scholarship)
- April 2025, Chungbuk National University
Technical Skills
I primarily use R for data analysis and Monte Carlo simulation. Key packages include mirt (custom item response functions via createItem), lavaan (measurement and structural models, mediation analysis), lme4 (generalized linear mixed-effects models for multilevel and longitudinal data), brms (Bayesian estimation for generalized linear mixed-effects models), and galamm (generalized latent variable modeling). I am also familiar with Stan and JAGS for Bayesian parameter estimation. For Monte Carlo simulations, I usually use expand.grid, apply/map, and the tidyverse to generate simulation conditions, iterate across them, and summarize results.
Relevant Coursework
Graduate Courses (Advisor: Wooyeol Lee, Ph. D.)
- Categorical Data Analysis
- Item Response Theory
- Bayesian Statistics
- Issues in Regression Analysis
- Multilevel Modeling
Workshops (Korean Society of Psychological Measurement and Assessment)
- Designing Regression Analysis and Understanding the Results
- Multilevel Modeling
- Experimental Design and Analysis of Variance
- Mixture Model
- Survival Analysis
- Structural Equation Modeling
- Longitudinal Study
- Item Response Theory and Computer Adaptive Testing
Certifications
Advanced Data Analytics Semi-Professional
- August 2026, Korea Data Agency
About This Blog
On this blog, I write and post about the things I’ve thought about and learned. Currently, I’m mainly posting about the following topics.
Data Processing with R and Python
Preface
During my master’s program, I noticed that fellow graduate students shied away from R, preprocessing raw data in Excel and analyzing it with SPSS or AMOS. As AI advances, however, I expect three changes: more complex statistical methods will be used to test hypotheses, most of them will be implemented as R packages, and researchers will entrust preprocessing and analysis to AI, which will work mainly in R. Researchers will thus have no choice but to engage with R, and research ethics will require them to take full responsibility for AI-generated code. This book aims to help readers make sense of AI’s preprocessing results and to foster understanding of, and interest in, how researchers handle data according to their own ideas.
Why must we handle data with a programming language? Strictly speaking, there is no need to; Excel is ideal for handling data visually and intuitively. Yet whatever we do in Excel, we do with a specific intention, which is not so different from handling data in code. When you click a column header, for instance, it is to select all the values in that column. Translate that intention into a language the computer understands, and it will perform the same task. Simple as the example is, the point is that with R we can perform any operation we imagine on data, as far as the language allows. Moreover, Excel records only the final result of data processing: if you move a column to the end, only the result remains, not the process. R, by contrast, records the process in code, like a diary that stays intact anytime and anywhere, letting others see exactly what you did.
This book explains how researchers handle data, focusing on using R and Python to communicate smoothly with the computer that preprocesses data for you, specifically the tidyverse (especially dplyr) and Polars. The tidyverse is a collection of R packages (add-ons) for data science, and dplyr, one of them, provides a syntax for handling tables; Polars is a Python library (the equivalent of an R package) that likewise provides one. Though in different languages, both rely on method chaining: passing the output of one function or method directly to the next call. Put simply, preprocessing steps are applied to a dataset one after another. Whereas the traditional approach thinks “create A, then use A to create B, then use B to create C,” method chaining thinks “filter this data, transform the variables, then sort them.” I believe this pattern better matches human thinking, so this book focuses primarily on these two.
Prerequisite
None. However, since psychology experiments are used as examples, it would be helpful to be familiar with topics in psychological research. You should also at least understand why R and Python are necessary for data analysis.
Recommendation
Once you have finished reading this book, I recommend that you work directly with the data you have collected in your own research. Alternatively, I suggest you practice using the data posted on TidyTuesday. (This book does not include practice problems.)
Acknowledgment
I used generative AI tools such as ChatGPT 6 Astra and Claude Opus 5.5 to generate artificial data and proofread the manuscript. As this book is a work in progress, the title, content, and examples are subject to change without notice.
Table of Contents
Part I: Programs, values, and functions
Understand execution, values, collections, and functions. R vectors and Python objects receive their own treatments before table operations.
- Running code and locating data
- 1.1 Working with data through code
- 1.2 Expressions, results, and function calls
- 1.3 Scripts, execution order, and session state
- 1.4 Reading errors and inspecting objects
- 1.5 Paths, files, folders, and installed code
- Values, vectors, and lists in R
- 2.1 Values, names, and assignment
- 2.2 Types, coercion, and attributes
- 2.3 Vector arithmetic and length
- 2.4 Comparisons, logical vectors, and missing values
- 2.5 Selecting and replacing vector elements
- 2.6 Lists and components of different types
- Objects, names, and collections in Python
- 3.1 Values, types, and elementary operations
- 3.2 Lists, positions, and slices
- 3.3 References, mutation, and copying a list
- 3.4 Tuples, dictionaries, and records
- 3.5 Attributes, methods, and namespaces
- Functions, conditions, and repeated calculations
- 4.1 Defining inputs, outputs, and defaults
- 4.2 Local names, scope, and argument evaluation
- 4.3 Choosing a branch with one condition
- 4.4 Iteration and building a collection of results
- 4.5 Functions as objects and arguments
Part II: Tables and transformations
Translate a data task into changes to rows, columns, values, groups, shapes, and relationships. Small examples establish the mechanisms used with the supplied data.
- Data frames, columns, and expressions
- 5.1 Observations, variables, and identifiers
- 5.2 Columns, types, and schemas
- 5.3 Object names and column names in R
- 5.4 Series, expressions, and contexts in Polars
- 5.5 Output lengths and the shape of a calculation
- Reading a rectangular file
- 6.1 Records, headers, delimiters, and quoting
- 6.2 Specifying types and preserving identifiers
- 6.3 Missing fields, whitespace, and encoding
- 6.4 Checking an imported table against its source
- Selecting rows and creating columns
- 7.1 Selecting and renaming columns
- 7.2 Selecting rows with explicit predicates
- 7.3 Creating columns from existing values
- 7.4 Ordering rows and resolving ties
- Groups, counts, and summaries
- 8.1 Counting rows, values, and distinct units
- 8.2 Summarizing each group in one row
- 8.3 Grouping by more than one variable
- 8.4 Returning group calculations to the original rows
- Text as characters, patterns, and categories
- 9.1 Characters, encoding, and Unicode representation
- 9.2 Normalizing labels with an explicit mapping
- 9.3 Detecting, extracting, and splitting patterns
- 9.4 Category labels, levels, and order
- From recorded numbers to usable measurements
- 10.1 Parsing numbers and checking their domain
- 10.2 Missing values and reasons for missingness
- 10.3 Missing values in sums, means, and denominators
- 10.4 Transforming measurements while retaining their meaning
- Dates, times, and temporal order
- 11.1 Parsing dates and date times
- 11.2 Durations, intervals, and calendar components
- 11.3 Local clock readings, time zones, and instants
- 11.4 Ordering observations and defining a previous value
- Changing the shape of a table
- 12.1 When a column name contains data
- 12.2 Moving repeated measurements into rows
- 12.3 Moving values into columns without hiding duplicates
- 12.4 Missing combinations and the meaning of a blank
- Combining tables with keys
- 13.1 Adding rows with compatible columns
- 13.2 Matching keys and predicting row multiplication
- 13.3 Unmatched records and matched missing values
- 13.4 Composite keys and category correspondence
- 13.5 Matching an event to a preceding time
- Nested records and multiple selections
- 14.1 Reading the structure of a nested record
- 14.2 Flattening records while preserving their identity
- 14.3 Expanding multiple selections and defining a denominator
- 14.4 Working with collections inside a column
Part III: Reusable analyses and dependable results
Connect transformations to reusable calculations, heterogeneous imports, descriptive summaries, figures, and saved results that can be checked against their inputs.
- Reusing calculations across columns and files
- 15.1 Turning a repeated transformation into a function
- 15.2 Supplying a column name or a calculation
- 15.3 Applying a calculation to several columns
- 15.4 Applying a calculation to a collection of files
- Reading heterogeneous source files
- 16.1 Spreadsheet sheets, headers, and cell types
- 16.2 Labeled data and user-defined missing codes
- 16.3 Encodings and tables formatted for readers
- 16.4 Export versions, empty files, and file inventories
- 16.5 Comparing representations without inventing precision
- Describing a dataset
- 17.1 Defining the observations being described
- 17.2 Describing a numerical distribution
- 17.3 Frequencies, proportions, and cross-classifications
- 17.4 Comparing groups and comparing the same people
- Figures that answer data questions
- 18.1 From a table to graphical marks
- 18.2 Showing numerical distributions
- 18.3 Comparing categories and groups visually
- 18.4 Showing repeated measurements and gaps
- Saving results and verifying transformations
- 19.1 Recorded values, working values, and derived results
- 19.2 Saving tables and reading them back
- 19.3 Checks that express the analytical definition
- 19.4 Reproducing an analysis from its recorded inputs
Part IV: Complete analytical workflows
Combine the concepts in five cases: survey responses, experimental trials, a longitudinal panel, momentary assessments, and a formatted public-statistics table.
- Preparing survey responses
- 20.1 Reconciling two exports of the same responses
- 20.2 Interpreting labels, invalid values, and missing answers
- 20.3 Repeated responses and response-quality flags
- 20.4 Constructing scale scores from valid items
- 20.5 Assembling and describing the participant table
- Assembling an experimental dataset
- 21.1 Inventorying and harmonizing session exports
- 21.2 Identifying and selecting completed runs
- 21.3 Resolving stimulus metadata and checking correctness
- 21.4 Defining accuracy and reaction-time summaries
- 21.5 Combining trial summaries and questionnaire responses
- Building a longitudinal panel
- 22.1 Harmonizing waves and participant attributes
- 22.2 Distinguishing enrollment, attendance, and missing measurements
- 22.3 Auditing provided totals against their items
- 22.4 Describing change with an explicit comparison set
- Matching scheduled prompts and responses
- 23.1 Establishing scheduled and submitted observation units
- 23.2 Interpreting nested answers and clock readings
- 23.3 Finding a candidate prompt and validating its window
- 23.4 Resolving repeated submissions without losing events
- 23.5 Reconstructing response coverage and observed measurements
- 23.6 Defining previous occasions and within-person changes
- Reconstructing a published table
- 24.1 Separating table structure from observations
- 24.2 Recovering district records and repeated years
- 24.3 Matching regional identifiers with composite keys
- 24.4 Reconciling totals and describing geographical change
Structured Query Language and Databases for Assessment and Learning Data
Preface
As I was nearing the end of my master’s program, I had many practical concerns about finding a job. At the time, there was a boom in Korea for non-majors learning SQL, and I, too, jumped on that bandwagon (though, of course, there has always been demand for database skills). Therefore, this is less a book and more a record of my studies. Although I did study it, unfortunately, for various reasons, I have now become a day laborer (I currently do demolition work, haul materials, and, quite often, paint rooftops). However, I hope that my study notes will be helpful to others.
What is SQL? SQL stands for Structured Query Language, which refers to a structured data query language used to process data in relational database systems. What does a relational database mean? It refers to a collection of data organized into tables that are managed collectively for the purpose of being shared and used by multiple people. What is a query language? It refers to a computer language used to make queries and obtain answers from a given information system.
In other words, one could say that learning SQL involves work that social science researchers would not typically engage in. However, there is a tremendous demand for databases because companies provide necessary information to specific groups of users or systematically accumulate information needed within an organization to provide it to users within that organization. I’ve heard that databases are useful for most computer-based tasks because they focus on sorting and searching, but since I haven’t secured a job yet, I cannot verify this.
Prerequisite
None. However, since this note deals with the context of psychological and educational measurement and assessment, it would be helpful to know what they do.
Recommendation
Once you’ve finished reading this note, well, I’d recommend putting together a portfolio that might help you find a job. Or try taking a certification exam.
Acknowledgment
I used generative AI tools such as ChatGPT 6 Astra and Claude Opus 5.5 to proofread the manuscript and the artificial database. I also sought advice from AI tools and current professionals to ensure that the scenarios I intended to use as examples closely resembled real-world business situations. I would like to thank Jiyeon Kim for her support with my studies, manuscript writing, and advice, as well as for her concern for my health. As this note is a work in progress, the title, content, and examples are subject to change without notice.
Table of Contents
Part I: Relational database foundations
Install PostgreSQL, load the two example databases, and read where a company’s data live and how they are structured.
- From files to a database
- 1.1 What goes wrong when several people share one file
- 1.2 Servers, clients, and connections
- 1.3 Databases, schemas, and tables
- 1.4 Service databases and analytical databases
- Tables, keys, and constraints
- 2.1 What a row represents
- 2.2 Primary keys and identifiers
- 2.3 Foreign keys and relationships between tables
- 2.4 Reading a schema diagram: examinees, tests, items, and responses
- 2.5 Many-to-many relationships: learners, courses, and enrollments
- Data types and NULL
- 3.1 Integers, exact numerics, and floating point
- 3.2 Text and the representation of identifiers
- 3.3 Dates, timestamps, and time zones
- 3.4 Booleans and three-valued logic
- 3.5 What a NULL stands for: skipped, not applicable, not collected
- Working in psql and exploring a schema
- 4.1 Running saved SQL files
- 4.2 Reading error messages
- 4.3 Finding tables, columns, and constraints in the catalog
- 4.4 A routine for getting to know an unfamiliar database
Part II: Queries
Translate a question about data into a SELECT statement, and state the unit and the denominator of its result.
- Selecting and ordering rows
- 5.1 SELECT and FROM: choosing columns and naming them
- 5.2 WHERE: comparisons, ranges, and lists
- 5.3 AND, OR, NOT, and conditions that meet NULL
- 5.4 ORDER BY and deterministic order
- 5.5 LIMIT and DISTINCT
- Expressions and CASE
- 6.1 Arithmetic and type conversion
- 6.2 Classifying values with CASE
- 6.3 Reverse-keyed items
- 6.4 COALESCE and NULLIF
- Aggregation and GROUP BY
- 7.1 Three kinds of COUNT: rows, values, and distinct values
- 7.2 SUM, AVG, and NULL: choosing a denominator
- 7.3 GROUP BY and the unit of a result row
- 7.4 Conditional aggregation with FILTER
- 7.5 HAVING and WHERE
- Joins
- 8.1 Inner joins and matching keys
- 8.2 Predicting row multiplication
- 8.3 Outer joins and unmatched rows
- 8.4 Skipped items, items never presented, and examinees never tested
- 8.5 Anti-joins and semi-joins with EXISTS
- 8.6 Joining several tables and composite keys
- Subqueries, CTEs, and set operations
- 9.1 Scalar subqueries and IN
- 9.2 Subqueries in FROM
- 9.3 Building a query in steps with CTEs
- 9.4 UNION, INTERSECT, and EXCEPT
- 9.5 The logical order of query evaluation
- Window functions
- 10.1 Calculations that keep every row
- 10.2 PARTITION BY and ORDER BY
- 10.3 Ranking: retakes and double submissions
- 10.4 LAG and LEAD: change since the previous sitting
- 10.5 Running totals and moving frames
- 10.6 Percentiles and quantiles
- Dates and times
- 11.1 Stored instants and time zone conversion
- 11.2 Truncating to days, weeks, and months
- 11.3 Intervals and elapsed time
- 11.4 School years and other custom periods
- 11.5 Overlapping periods and range types
- 11.6 Device clocks and server clocks
- Text, JSON, and arrays
- 12.1 String functions and normalizing text
- 12.2 Pattern matching and regular expressions
- 12.3 Extracting values from JSON event payloads
- 12.4 Payload keys that changed between app versions
- 12.5 Arrays and multiple-selection answers
- Reshaping and advanced patterns
- 13.1 From long to wide: a person-by-item table
- 13.2 From wide to long
- 13.3 Finding consecutive runs: study streaks
- 13.4 Dividing events into sessions
- 13.5 Recursive CTEs: the content tree
- 13.6 Range joins: looking up norm tables
Part III: Changing data and designing tables
Change data safely, design tables that store test and learning data together with their history, and make queries on them efficient.
- Modifying data and transactions
- 14.1 INSERT, UPDATE, and DELETE
- 14.2 Transactions: COMMIT and ROLLBACK
- 14.3 Concurrent sessions and isolation levels
- 14.4 Upserts with ON CONFLICT
- 14.5 A procedure for changing production data safely
- Normalization and schema design
- 15.1 Anomalies caused by redundancy
- 15.2 Functional dependencies and normal forms
- 15.3 Natural keys and surrogate keys
- 15.4 Designing an item bank and test forms
- 15.5 Designing administrations and responses: wide and long tables
- 15.6 Designing learning content and enrollments
- Recording what changes
- 16.1 What an overwrite erases
- 16.2 Versions of items, scoring keys, and norms
- 16.3 History tables with validity periods
- 16.4 Events and snapshots
- 16.5 Reconstructing a past state from a change log
- 16.6 Soft deletion and records of correction
- Constraints, views, and functions
- 17.1 NOT NULL, UNIQUE, and CHECK
- 17.2 Foreign key actions on delete and update
- 17.3 Views
- 17.4 Materialized views and refreshing them
- 17.5 User-defined functions: keeping a scoring rule in one place
- Indexes and query plans
- 18.1 What an index does
- 18.2 Reading EXPLAIN
- 18.3 Conditions that cannot use an index
- 18.4 Partitioning an event table
- 18.5 Diagnosing a slow query
Part IV: Analytical platforms and pipelines
Build and check the path from source data to tables made for analysis. Chapter 23 shows its examples in both R and Python.
- Loading data
- 19.1 Loading files with COPY
- 19.2 Staging tables and validation before insertion
- 19.3 Loading a typed-in batch of paper test responses
- 19.4 Loading event log files: duplicates and events of earlier days
- 19.5 Idempotent loads
- Modeling for analysis
- 20.1 Choosing the grain of a table
- 20.2 Fact tables and dimension tables
- 20.3 Dimensions that change: class moves and transfers
- 20.4 Keeping metric definitions in one place
- Transformation pipelines
- 21.1 Source, intermediate, and final layers
- 21.2 Models and their dependencies
- 21.3 Incremental processing
- 21.4 Tests for models
- Data quality checks
- 22.1 Uniqueness, reference, and range checks
- 22.2 Reconciling with the source: row counts and totals
- 22.3 Distribution shifts and anomalies
- 22.4 Responding to a problem and recording it
- Using the database from R and Python
- 23.1 Connections and credentials
- 23.2 Parameterized queries
- 23.3 Type mapping: NULL, numerics, timestamps, and identifiers
- 23.4 What to compute in the database and what to compute after fetching
- 23.5 Large extracts and extraction records
Part V: Security, personal data, and collaboration
Protect test materials and personal data, and work on a shared database with other people.
- Privileges and access control
- 24.1 Roles and privileges
- 24.2 Restricting columns and rows with views
- 24.3 Row-level security
- 24.4 Isolating the data of client organizations
- Protecting personal data and test materials
- 25.1 Separating identifying details from responses
- 25.2 Pseudonymization and the risk of re-identification
- 25.3 Implementing retention periods and deletion rules
- 25.4 Restricting access to children’s data and sensitive test results
- 25.5 Audit logs
- 25.6 Protecting item content and scoring keys
- Working with others
- 26.1 SQL style and naming
- 26.2 Version control and code review
- 26.3 Schema migrations
- 26.4 A data dictionary
- 26.5 Metric specifications and handling requests
Part VI: Complete workflows
Combine the concepts in six tasks: three on the assessment database (Chapters 27, 28, and 29) and three on the learning database (Chapters 30, 31, and 32).
- Scoring psychological tests
- 27.1 Selecting the administrations to score
- 27.2 Item scores and raw scores
- 27.3 Unanswered items and prorated scores
- 27.4 Scoring ability items with the key in force
- 27.5 Norm scores: T scores and percentiles
- 27.6 Assembling the report table
- 27.7 Comparing stored scores with recomputed scores
- Extracting data for item analysis
- 28.1 Defining the administrations to analyze
- 28.2 The person-by-item matrix
- 28.3 Item exposure and response times
- 28.4 Versions of item parameters
- 28.5 Adaptive test logs
- Correcting a scoring error
- 29.1 Finding a wrong scoring key and its reach
- 29.2 Rescoring
- 29.3 Keeping the correction history and the earlier results
- 29.4 Checks that prevent a recurrence
- Metrics from learning logs
- 30.1 Defining activity from events
- 30.2 Learning-active learners
- 30.3 Cohorts and retention
- 30.4 Funnels
- 30.5 Study time and completion rates
- Tables for experiment analysis
- 31.1 Assignment tables and the unit of analysis
- 31.2 Joining exposures to assignments
- 31.3 Checking assignment ratios and double assignment
- 31.4 Metric tables
- Reports for organizations
- 32.1 The organization and class hierarchy and the unit of aggregation
- 32.2 Limiting a report to what its reader may see
- 32.3 Tables for a recurring report
- 32.4 Masking small groups
Estimating Generalized Latent Variable Models in R
Preface
This book is a compilation of everything I learned from my professor, studied on my own through books, and encountered in papers during my master’s program. In fact, it’s less a book and more a collection of notes and code that have been appropriately reorganized. A book for graduate students and researchers who want to derive and implement the estimation methods of the latent variable models used in quantitative methods in the social sciences. It develops two connected abilities (At least, as far as I dare to think): deriving an estimator from a latent variable model, and implementing the calculations that turn the derivation into an estimate.
Prerequisite
Undergraduate-level calculus (single variable and multivariable), linear algebra, mathematical statistics, probability theory, and R programming.
Recommendation
R is essentially a programming language, and while it is used in data analysis, it is fundamentally a tool for statistical computation. Since this book utilizes R in this way, I believe it will help you develop your own algorithms and models in the future.
Acknowledgment
I used generative AI tools such as ChatGPT 6 Astra and Claude Opus 5.5 to proofread the manuscript. As this book is a work in progress, the title, content, and examples are subject to change without notice. Please note that since this is a translation of a Korean text into English, there may be some parts that sound unnatural. I appreciate your understanding.
Table of Contents
Part I: Models, likelihood, optimization, and integration
Express latent variable models in a common framework, then build the optimization and integration functions used to estimate them. Generalized linear models, missing normal data, a two-component normal mixture, and a logistic random-intercept model establish the calculations before they are combined in larger models.
- A framework for generalized latent variable models
- 1.1 Exponential families, means, variances, and link functions
- 1.2 Response models and structural models
- 1.3 Continuous, discrete, and nonparametric latent distributions
- 1.4 Conditional independence and the marginal likelihood
- 1.5 Factor models, item response models, mixed models, and latent states
- 1.6 Identification of location, scale, rotation, and labels
- 1.7 Representing response families and checking simulated data
- Likelihood and Newton methods
- 2.1 Generalized linear models, score functions, and information matrices
- 2.2 Newton-Raphson updates from a quadratic approximation
- 2.3 Fisher scoring and iteratively reweighted least squares
- 2.4 Solving weighted least squares with QR decomposition
- 2.5 Step halving, backtracking line search, and the maximum step length
- 2.6 Convergence criteria, indefinite curvature, and logistic separation
- 2.7 Checking coefficients and standard errors against existing GLM fits
- General numerical optimization
- 3.1 Numerical gradients, Hessians, and derivative checks
- 3.2 Steepest descent and line searches with Armijo and Wolfe conditions
- 3.3 The secant condition, BFGS updates, and limited-memory BFGS with bounds
- 3.4 Nelder-Mead simplex steps and derivative-free quadratic models (BOBYQA)
- 3.5 Trust regions, double dogleg steps, and the PORT bound-constrained quasi-Newton method
- 3.6 Transforming variances, probabilities, covariance matrices, and ordered cutpoints
- 3.7 Jacobians and standard errors on the original parameter scale
- 3.8 Multiple starting values and diagnosing unsuccessful optimization
- 3.9 Profile likelihood intervals and root finding
- 3.10 Comparing solutions, tolerances, and evaluation counts in nonlinear regression
- The EM algorithm and its extensions
- 4.1 Observed-data likelihoods, complete-data likelihoods, and the Q function
- 4.2 Jensen’s inequality, monotonicity, and the connection to MM algorithms
- 4.3 Implementing E and M steps for missing normal data and a normal mixture
- 4.4 Missing information and the rate of convergence
- 4.5 Conditional maximization with ECM and EC-MM
- 4.6 SQUAREM, quasi-Newton acceleration, and parabolic EM
- 4.7 Observed information of mixture estimates from a quasi-Newton refit
- 4.8 Checking likelihood sequences and accelerated solutions
- Integrating over latent variables
- 5.1 A random-intercept logistic regression model and its marginal likelihood
- 5.2 Orthogonal polynomials, Gaussian quadrature, and construction of nodes and weights
- 5.3 Gauss-Hermite quadrature and normal change of variables
- 5.4 Adaptive quadrature using the conditional mode and curvature
- 5.5 Laplace approximation and one-point adaptive quadrature
- 5.6 Product rules and the growth of multidimensional grids
- 5.7 Monte Carlo integration, importance sampling, and Halton sequences
- 5.8 Checking integration error and reusing inner optimization solutions
Part II: Continuous responses and normal marginal distributions
Derive the marginal normal distributions of factor models, structural equation models, and linear mixed models. Use matrix derivatives, likelihood concentration (i.e., profiling), and EM to estimate their mean and covariance structures.
- Linear factor analysis
- 6.1 The common factor model, covariance structure, and identification
- 6.2 The maximum likelihood discrepancy function and its derivatives
- 6.3 Joint optimization of loadings and unique variances
- 6.4 Concentrating the likelihood with an eigendecomposition
- 6.5 EM estimation using conditional factor moments
- 6.6 Heywood cases and variance estimates at the boundary
- 6.7 Implementing varimax and promax rotation
- 6.8 Regression and Bartlett factor scores
- 6.9 Comparing estimation routes and existing factor analysis results
- Structural equation models
- 7.1 RAM notation for paths, covariances, and observed variables
- 7.2 Model-implied means and covariances
- 7.3 Maximum likelihood, generalized least squares, and unweighted least squares
- 7.4 Parameter location matrices and analytic gradients
- 7.5 Expected information, identification, and standard errors
- 7.6 BFGS, Fisher scoring, starting values, and improper solutions
- 7.7 Full information maximum likelihood with missing-data patterns
- 7.8 Computing chi-square, RMSEA, CFI, and SRMR
- 7.9 Checking factor, path, and latent growth models against existing SEM fits
- Linear mixed models
- 8.1 Random intercepts, random slopes, and the marginal distribution
- 8.2 Maximum likelihood and restricted maximum likelihood
- 8.3 Profiling fixed effects and the residual variance
- 8.4 Cluster calculations with the Woodbury identity and determinant lemma
- 8.5 Covariance parameterization and variance components at the boundary
- 8.6 Profile optimization, EM, and Fisher scoring
- 8.7 Henderson’s equations, BLUP, and empirical Bayes prediction
- 8.8 Checking ML and REML fits and their equivalence to latent growth models
Part III: Nonnormal responses and marginal likelihood approximation
Combine the optimization and integration functions to estimate models for binary, ordinal, count, and mixed responses. Examine how integration accuracy and inner optimization affect parameter estimates and comparisons between fitting methods.
- Generalized linear mixed models
- 9.1 Logistic and Poisson models with random intercepts and slopes
- 9.2 Observation-level random effects and overdispersion
- 9.3 Evaluating the marginal likelihood with Gauss-Hermite and adaptive quadrature
- 9.4 Laplace approximation to the marginal likelihood
- 9.5 Nested optimization, starting at previous conditional modes, and derivatives of the outer objective function
- 9.6 Penalized quasi-likelihood as repeated linear mixed model fitting
- 9.7 Choosing quadrature accuracy and examining approximation bias
- 9.8 Comparing estimates and likelihoods with existing GLMM fits
- Item response theory
- 10.1 Rasch, two-parameter, and three-parameter logistic models
- 10.2 Graded response, generalized partial credit, and nominal response models
- 10.3 Marginal likelihood and Bock-Aitkin expected counts
- 10.4 Itemwise M steps and the use of weighted logistic regression
- 10.5 Direct marginal maximum likelihood, EM, and Ramsay acceleration
- 10.6 Guessing parameters, ordered thresholds, and Bayesian modal estimation
- 10.7 Estimating the latent distribution with an empirical histogram
- 10.8 Rasch conditional likelihood, elementary symmetric functions, and the limitations of joint maximum likelihood
- 10.9 ML, MAP, and EAP ability estimates and test information
- 10.10 Checking parameter recovery and comparing marginal and conditional estimates
- Generalized latent variable models for mixed responses
- 11.1 A factor model for continuous, binary, ordinal, and count responses
- 11.2 Poisson and negative binomial models for multivariate abundance data
- 11.3 Multidimensional conditional modes and Laplace approximation
- 11.4 Deriving the evidence lower bound for a normal variational distribution
- 11.5 Expected response terms in closed form and variational bounds
- 11.6 Joint optimization of model and variational parameters and the variational covariance structure
- 11.7 Starting values, covariance constraints, and loading identification
- 11.8 Comparing adaptive quadrature, Laplace, and variational estimates
Part IV: Discrete latent variables
Express latent classes, mixture components, and hidden states through finite sums. Build EM and direct likelihood estimators while accounting for local maxima, degenerate solutions, and equivalent labelings.
- Latent classes, finite mixtures, and nonparametric latent distributions
- 12.1 Latent class models for binary and categorical indicators
- 12.2 Posterior class probabilities and EM updates
- 12.3 Gaussian mixtures and latent profiles
- 12.4 Mixture regression and covariates for class membership
- 12.5 Starting partitions, k-means implementation, and multiple local solutions
- 12.6 Identification, boundary probabilities, degenerate covariances, and label switching
- 12.7 Comparing numbers of classes with AIC and BIC
- 12.8 Nonparametric maximum likelihood with mass point updates and directional derivatives
- 12.9 Checking mixture estimates and sensitivity to the latent distribution
- Hidden Markov models
- 13.1 Latent Markov chains, emission distributions, and latent transitions
- 13.2 Forward likelihood recursion with scaling and log calculations
- 13.3 Backward recursion and posterior state and transition probabilities
- 13.4 Baum-Welch estimation as EM
- 13.5 Direct likelihood optimization with transformed transition probabilities
- 13.6 Viterbi decoding and stationary distributions
- 13.7 State counts, local solutions, and checks with simulated and observed series
Part V: Stochastic estimation, inference, and diagnosis
Estimate models whose latent dimensions make product quadrature impractical. Then assemble the information, resampling, testing, and diagnostic procedures needed to assess the estimators developed throughout the book.
- Stochastic estimation with high-dimensional latent variables
- 14.1 Multidimensional item response models, multilevel factors, and crossed random effects
- 14.2 Metropolis-Hastings updates for conditional latent distributions
- 14.3 Simulating a Markov chain and choosing the proposal scale
- 14.4 Monte Carlo EM and increasing the simulation size
- 14.5 Stochastic EM with burn-in and averaging stages
- 14.6 Metropolis-Hastings Robbins-Monro updates for scores and information
- 14.7 Iterate averaging, stochastic convergence, and sparse design matrices
- 14.8 Checking reproducibility and agreement with quadrature and existing estimators
- Inference, diagnosis, and model comparison
- 15.1 Standard errors from observed, expected, and missing information, Louis’s formula, and supplemented EM
- 15.2 Sandwich covariance estimates and cluster contributions
- 15.3 Wald, likelihood ratio, and score tests
- 15.4 Variance components at the boundary and mixture chi-square reference distributions
- 15.5 Parametric bootstrap with refitting and reproducible parallel random streams
- 15.6 Conditional and marginal randomized quantile residuals
- 15.7 Local independence checks and item fit
- 15.8 Identification, Hessian eigenvalues, and variation across starting values
- 15.9 AIC, BIC, and the choice of sample size
- 15.10 Checking standard errors, tests, residuals, and interval coverage
Part VI: Bayesian estimation
Reuse the likelihoods, derivatives, integration rules, and Markov chain functions to compute posterior distributions in R. The final chapter covers approximate inference, sampling, convergence diagnostics, predictive assessment, and verification of the samplers themselves.
- Bayesian estimation
- 16.1 Joint posterior distributions, priors, identification, and empirical Bayes estimates
- 16.2 MAP estimation, Laplace approximation, and mean-field variational Bayes
- 16.3 Gibbs sampling for linear factor models and linear mixed models
- 16.4 Probit, ordinal, and Pólya-Gamma data augmentation
- 16.5 Random-walk, within-Gibbs, and adaptive Metropolis-Hastings
- 16.6 Hamiltonian Monte Carlo, NUTS, and noncentered parameterizations
- 16.7 Discrete latent variables, label switching, and marginalization
- 16.8 Rank-normalized split R-hat, effective sample size, and Monte Carlo standard error
- 16.9 Posterior predictive checks, WAIC, and PSIS-LOO with marginal likelihood contributions
- 16.10 Verifying samplers with analytic posteriors and simulation-based calibration
Appendices
Collect the mathematical identities, numerical tools, verification procedures, and function references used throughout the book.
- A.1 Differentials of log determinants and matrix inverses
- A.2 Trace identities and derivatives of quadratic forms
- A.3 Vectorization and Kronecker products
B. Exponential families and link functions
- B.1 Log densities, cumulant functions, means, and variances
- B.2 Canonical link functions and response family functions
- B.3 Cumulative and adjacent-category logits
- C.1 Log-sum-exp and normalized log weights
- C.2 Log probabilities, tail probabilities, and stable elementary functions
- C.3 Cholesky log determinants and triangular solves
- D.1 Comparing analytic and numerical derivatives
- D.2 Checking monotonicity of EM iterations
- D.3 Measuring simulation bias and interval coverage
- D.4 Comparing estimates with existing implementations
- D.5 Reproducing results with fixed random seeds
- E.1 Functions implemented or called by the reader and their teaching locations
- E.2 Mathematical functions used directly
- E.3 Existing implementations used for verification