Home > code > util > parameter_transformation > mappings > encode_pcsv_param_partial.m

encode_pcsv_param_partial

PURPOSE ^

ENCODE_PCSV_PARAM_PARTIAL Encodes all parameters of a PCSV partial model

SYNOPSIS ^

function [theta, decode] = encode_pcsv_param_partial(mu, A, lambda_0, kappa, theta, sigma, rho)

DESCRIPTION ^

ENCODE_PCSV_PARAM_PARTIAL Encodes all parameters of a PCSV partial model

  [theta, decode] = ENCODE_PCSV_PARAM_PARTIAL(mu, A, lambda_0, kappa, theta, sigma, 
    rho) encodes the parameters mu, A, lambda_0, kappa, theta, sigma, rho of
    a PCSV partial model into a single parameter vector theta. The returned function
    decode can be used together with decode_pcsv_param to recover the
    parameters from theta.

 See also DECODE_PCSV_PARAM, ENCODE_PARAMETERS, ENCODE_WASC_PARAM.

 created by Benedikt Rudolph
 DATE: 30-Jan-2013

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [theta, decode] = encode_pcsv_param_partial(mu, A, lambda_0, kappa ...
0002                                               , theta, sigma, rho)
0003 %ENCODE_PCSV_PARAM_PARTIAL Encodes all parameters of a PCSV partial model
0004 %
0005 %  [theta, decode] = ENCODE_PCSV_PARAM_PARTIAL(mu, A, lambda_0, kappa, theta, sigma,
0006 %    rho) encodes the parameters mu, A, lambda_0, kappa, theta, sigma, rho of
0007 %    a PCSV partial model into a single parameter vector theta. The returned function
0008 %    decode can be used together with decode_pcsv_param to recover the
0009 %    parameters from theta.
0010 %
0011 % See also DECODE_PCSV_PARAM, ENCODE_PARAMETERS, ENCODE_WASC_PARAM.
0012 %
0013 % created by Benedikt Rudolph
0014 % DATE: 30-Jan-2013
0015 
0016   [n, p] = size(A);
0017   
0018   param(1).name = 'mu';
0019   %param(end).constraint = 'None';
0020   param(end).constraint = 'equal';
0021   param(end).value = reshape(mu, n, 1);
0022 
0023   param(end+1).name = 'A';
0024   %param(end).constraint = 'orthogonal_non_quadratic';
0025   %% use more flexible constraint trafo for quadratic orthogonal matrices
0026   %if n==p && det(A)>0
0027     %param(end).constraint = 'orthogonal_quadratic';
0028   %end
0029   param(end).constraint = 'equal';
0030   param(end).value = A;
0031 
0032   param(end+1).name = 'lambda_0';
0033   param(end).constraint = 'equal';
0034   param(end).value = reshape(lambda_0, 1, p);
0035 
0036   param(end+1).name = 'kappa';
0037   param(end).constraint = 'none';
0038   param(end).value = kappa;
0039 
0040   param(end+1).name = 'theta';
0041   param(end).constraint = 'none';
0042   param(end).value = theta;
0043 
0044   param(end+1).name = 'sigma';
0045   param(end).constraint = 'none';
0046   %param(end).constraint = 'equal';
0047   param(end).value = sigma;
0048 
0049   param(end+1).name = 'rho';
0050   param(end).constraint = 'none';
0051   param(end).value = rho;
0052   
0053   [theta, decode] = encode_parameters(param);
0054 end

Generated on Mon 29-Apr-2013 19:29:13 by m2html © 2005