You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix additional averaging of likelihood
* weighting bug for many-data
* clearer error message
* format
* new tests and all pass
* rm accidental feature push
* added mv input testing at different input size
* remove unnec. prints
Copy file name to clipboardExpand all lines: src/MarkovChainMonteCarlo.jl
+14-12Lines changed: 14 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,14 @@ autodiff_hessian(model::AdvancedMH.DensityModel, params, sampler::MH) where {MH
233
233
"""
234
234
$(DocStringExtensions.TYPEDSIGNATURES)
235
235
236
-
Defines the internal log-density function over a vector of observation samples using an assumed conditionally indepedent likelihood, that is with a log-likelihood of `ℓ(y,θ) = sum^n_i log( p(y_i|θ) )`.
236
+
Defines the internal log-density function over a vector of observation samples using an assumed conditionally indepedent likelihood, that is with a log-likelihood of `ℓ(y,θ) = sum^n_i log( p(y_i|θ) )`.
237
+
238
+
Inputs:
239
+
=======
240
+
- θ: Parameters in physical (constrained) coordinates.
241
+
- prior: Prior distribution as a ParameterDistribution
242
+
- em: Emulator object with predict(.) method, evaluations returned in encoded space
243
+
- obs_vec: encoded data vector sample(s)
237
244
"""
238
245
functionemulator_log_density_model(
239
246
θ,
@@ -242,21 +249,17 @@ function emulator_log_density_model(
242
249
obs_vec::AV,
243
250
) where {FT <:AbstractFloat, AV <:AbstractVector}
244
251
245
-
#θ: model params we evaluate at; in original coords.
246
-
# transform_to_real = false means g, g_cov, obs_sample are in decorrelated coords.
252
+
#
253
+
# transform_to_real = false means g, g_cov, obs_sample are in encoded coords.
247
254
248
-
# Recall predict() written to return multiple N_samples: expects input to be a
249
-
# Matrix with N_samples columns. Returned g is likewise a Matrix, and g_cov is a
250
-
# Vector of N_samples covariance matrices. For MH, N_samples is always 1, so we
251
-
# have to reshape()/re-cast input/output; simpler to do here than add a
252
-
# predict() method.
255
+
# predict is written to apply to columns.
256
+
# Returned g is a length-1, Vector{Real} or Vector{Vector}, and g_cov is length-1 Vector{Vector} or Vector{Matrix} respectively
Copy file name to clipboardExpand all lines: src/VectorRandomFeature.jl
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,6 @@ Constructs a `VectorRandomFeatureInterface <: MachineLearningTool` interface for
160
160
- "cov_correction" => "nice": type of conditioning to improve estimated covariance. "shrinkage", "shrinkage_corr" (Ledoit Wolfe 03), "nice" for (Vishny, Morzfeld et al. 2024)
161
161
- "overfit" => 1.0: if > 1.0 forcibly overfit/under-regularize the optimizer cost, (vice versa for < 1.0).
162
162
- "n_cross_val_sets" => 2, train fraction creates (default 5) train-test data subsets, then use 'n_cross_val_sets' of these stacked in the loss function. If set to 0, train=test on the full data provided ignoring "train_fraction".
163
-
164
163
"""
165
164
functionVectorRandomFeatureInterface(
166
165
n_features::Int,
@@ -203,7 +202,7 @@ function VectorRandomFeatureInterface(
203
202
"accelerator"=> EKP.NesterovAccelerator(), # acceleration with momentum
204
203
"cov_correction"=>"nice", # type of conditioning to improve estimated covariance
205
204
"n_cross_val_sets"=>2, # if set to 0, removes data split. i.e takes train & test to be the same data set
206
-
"overfit"=>1.0, # if >1 this forcibly overfits to the data
205
+
"overfit"=>1.0, # if >1 this forcibly overfits to the data
0 commit comments