The document provides an overview of Monte Carlo simulation techniques. It discusses random number generation, methods for computing integrals using Monte Carlo integration, and techniques for reducing variance in Monte Carlo estimates. The lecture covers generating uniform and non-uniform random variables, numerical integration methods, the curse of dimensionality, and compares quasi-Monte Carlo and standard Monte Carlo integration.
The document discusses camera geometric parameters. There are intrinsic parameters that define the camera's optical characteristics and relate pixel coordinates to camera coordinates. There are also extrinsic parameters that define the camera's position and orientation relative to a world coordinate system. Together, intrinsic and extrinsic parameters are used to map 3D world points to their 2D pixel coordinates in an image. Common camera models include the perspective, weak perspective, and affine models.
The document summarizes camera calibration techniques. It discusses:
1) Projecting 3D world points to 2D image points using a projection matrix with intrinsic and extrinsic parameters.
2) Computing camera parameters by estimating the projection matrix from known 3D points and corresponding 2D image points using linear and non-linear optimization methods.
3) Modeling lens distortion and different distortion types that must be accounted for during calibration.
This document provides an overview and summary of Numerical Python (NumPy), an extension to the Python programming language that adds support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays. It describes how to install NumPy, test the installation, and introduces some of the key features like array objects, universal functions (ufuncs), and convenience functions for array creation and manipulation.
Stability of adaptive random-walk Metropolis algorithmsBigMC
The document discusses adaptive MCMC algorithms and their stability. It introduces the stochastic approximation framework that is commonly used to construct adaptive MCMC algorithms. It then discusses issues with stability as the adaptive parameters are updated, and how enforced stability or adaptive reprojections can help address this. Finally, it provides examples of the adaptive Metropolis algorithm and adaptive scaling Metropolis algorithm, which aim to automatically tune the proposal distribution scale parameter.
The document discusses the definite integral, including computing it using Riemann sums, estimating it using approximations like the midpoint rule, and reasoning about its properties. It outlines the topics to be covered, such as recalling previous concepts and comparing properties of integrals. Formulas are provided for calculating Riemann sums using different representative points within the intervals.
This document summarizes Ja-Keoung Koo's presentation on structure from motion. It discusses image formation, the structure from motion pipeline with calibrated cameras, and the 8-point algorithm. The key points are:
1. Image formation maps 3D world points to 2D image points using a camera's intrinsic and extrinsic parameters.
2. Structure from motion with calibrated cameras recovers 3D structure and camera motion from 2D correspondences using the essential matrix and 8-point algorithm.
3. The 8-point algorithm finds the essential matrix from point correspondences, decomposes it to recover the rotation and translation between views.
MATHEON Center Days: Index determination and structural analysis using Algori...Dagmar Monett
This document discusses the work of research project D7 on numerical simulation of integrated circuits. The project uses algorithmic differentiation techniques to determine the tractability index of differential algebraic equations (DAEs) and compute consistent initial values. It provides examples of index determination for circuit simulation problems and discusses achievements, collaborations, and plans for future work extending the structural analysis methods to computational graphs.
Steffen Rendle, Research Scientist, Google at MLconf SFMLconf
Abstract:
Developing accurate recommender systems for a specific problem setting seems to be a complicated and time-consuming task: models have to be defined, learning algorithms derived and implementations written. In this talk, I present the factorization machine (FM) model which is a generic factorization approach that allows to be adapted to problems by feature engineering. Efficient FM learning algorithms are discussed among them SGD, ALS/CD and MCMC inference including automatic hyperparameter selection. I will show on several tasks, including the Netflix prize and KDDCup 2012, that FMs are flexible and generate highly competitive accuracy. With FMs these results can be achieved by simple data preprocessing and without any tuning of regularization parameters or learning rates.
The document discusses camera geometric parameters. There are intrinsic parameters that define the camera's optical characteristics and relate pixel coordinates to camera coordinates. There are also extrinsic parameters that define the camera's position and orientation relative to a world coordinate system. Together, intrinsic and extrinsic parameters are used to map 3D world points to their 2D pixel coordinates in an image. Common camera models include the perspective, weak perspective, and affine models.
The document summarizes camera calibration techniques. It discusses:
1) Projecting 3D world points to 2D image points using a projection matrix with intrinsic and extrinsic parameters.
2) Computing camera parameters by estimating the projection matrix from known 3D points and corresponding 2D image points using linear and non-linear optimization methods.
3) Modeling lens distortion and different distortion types that must be accounted for during calibration.
This document provides an overview and summary of Numerical Python (NumPy), an extension to the Python programming language that adds support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays. It describes how to install NumPy, test the installation, and introduces some of the key features like array objects, universal functions (ufuncs), and convenience functions for array creation and manipulation.
Stability of adaptive random-walk Metropolis algorithmsBigMC
The document discusses adaptive MCMC algorithms and their stability. It introduces the stochastic approximation framework that is commonly used to construct adaptive MCMC algorithms. It then discusses issues with stability as the adaptive parameters are updated, and how enforced stability or adaptive reprojections can help address this. Finally, it provides examples of the adaptive Metropolis algorithm and adaptive scaling Metropolis algorithm, which aim to automatically tune the proposal distribution scale parameter.
The document discusses the definite integral, including computing it using Riemann sums, estimating it using approximations like the midpoint rule, and reasoning about its properties. It outlines the topics to be covered, such as recalling previous concepts and comparing properties of integrals. Formulas are provided for calculating Riemann sums using different representative points within the intervals.
This document summarizes Ja-Keoung Koo's presentation on structure from motion. It discusses image formation, the structure from motion pipeline with calibrated cameras, and the 8-point algorithm. The key points are:
1. Image formation maps 3D world points to 2D image points using a camera's intrinsic and extrinsic parameters.
2. Structure from motion with calibrated cameras recovers 3D structure and camera motion from 2D correspondences using the essential matrix and 8-point algorithm.
3. The 8-point algorithm finds the essential matrix from point correspondences, decomposes it to recover the rotation and translation between views.
MATHEON Center Days: Index determination and structural analysis using Algori...Dagmar Monett
This document discusses the work of research project D7 on numerical simulation of integrated circuits. The project uses algorithmic differentiation techniques to determine the tractability index of differential algebraic equations (DAEs) and compute consistent initial values. It provides examples of index determination for circuit simulation problems and discusses achievements, collaborations, and plans for future work extending the structural analysis methods to computational graphs.
Steffen Rendle, Research Scientist, Google at MLconf SFMLconf
Abstract:
Developing accurate recommender systems for a specific problem setting seems to be a complicated and time-consuming task: models have to be defined, learning algorithms derived and implementations written. In this talk, I present the factorization machine (FM) model which is a generic factorization approach that allows to be adapted to problems by feature engineering. Efficient FM learning algorithms are discussed among them SGD, ALS/CD and MCMC inference including automatic hyperparameter selection. I will show on several tasks, including the Netflix prize and KDDCup 2012, that FMs are flexible and generate highly competitive accuracy. With FMs these results can be achieved by simple data preprocessing and without any tuning of regularization parameters or learning rates.
Digital Signal Processing Lab Manual ECE studentsUR11EC098
This document describes a MATLAB program to perform operations on discrete-time signals. It discusses amplitude manipulation operations like amplification, attenuation, and amplitude reversal. Time manipulation operations covered include time shifting and time reversal. It also describes adding and multiplying two discrete signals. The program takes user input, performs the selected operations, and plots the output waveforms to verify results.
Johan Suykens: "Models from Data: a Unifying Picture" ieee_cis_cyprus
The document discusses models that are constructed from data using machine learning techniques. It provides examples of different model types, including neural networks, support vector machines, kernel methods, and spectral clustering. These models can be expressed in both primal and dual formulations, and the dual representations allow for out-of-sample extensions, model selection, and solving large-scale problems. The document outlines core models that underlie many machine learning algorithms and how adding regularization terms and constraints can yield different optimal model representations.
This document provides an overview of streaming data and event processing concepts. It discusses different types of windows (tumbling, sliding, periodic, monotonic) that can be used to analyze data over time. It also introduces the concepts of streams and pipes for composing processing logic from simple reusable parts, and discusses how this relates to approaches used in Node.js and other systems. The document is presented at a technical event to explain these streaming data concepts.
The document is an introduction to graphical models. It discusses that graphical models define probability distributions over random variables using graphs to encode conditional independence assumptions. It then describes popular classes of graphical models including directed Bayesian networks and undirected Markov random fields. Bayesian networks define a factorization of the joint distribution over parent variables, while Markov random fields factorize over potentials at cliques in the graph. An example Markov random field is also shown.
This document discusses OpenGL transformations. It describes how geometric objects are represented and transformed using matrices. Transformation matrices for modeling, viewing and projection are manipulated separately in OpenGL. The viewing transformation places the camera in the 3D world. Projection can be parallel (orthographic) or perspective, with perspective being more realistic. OpenGL provides functions for common viewing and projection setups. The full transformation pipeline involves clipping, perspective division, viewport mapping and rasterization to render the 3D scene to a 2D framebuffer.
Prévision de consommation électrique avec adaptive GAMCdiscount
The document discusses generalized additive models (GAM) for short-term electricity load forecasting. GAMs are smooth additive models that decompose a response variable into additive components like trends, cyclic patterns, and nonlinear effects. They summarize how GAMs can model various drivers of electricity consumption, including temperature effects, day-of-week patterns, and lagged load values. Big additive models (BAM) allow applying GAMs to large electricity load datasets. BAMs use QR decomposition and online updating to efficiently estimate high-dimensional additive models.
Introduction to Factorization Machines model with an example. Motivations - why you should have it in your toolbox, model and it expressiveness, use case for context-aware recommendations and Field-Aware Factorization Machines.
This document provides an overview of engineering risk analysis and event logic. It discusses how to define events, represent them using Venn diagrams and indicator variables, and perform logic operations like unions and intersections on events. Simple reliability models are presented, including series, parallel and 2-out-of-3 systems. Methods for analyzing events are covered, such as event trees, fault trees, cut sets, and minimal cut sets. Examples of initiating events in risk analysis are also listed.
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...Jan Wedekind
This document discusses reconstructing micro-objects from focus-sets using blind deconvolution. It describes the experimental setup including a motorized microscope and camera. It provides an overview of the objectives which are to reconstruct surfaces, luminosities and colors from focus-sets and identify model parameters and assembly quality. It also gives basics on the discrete Fourier transform and sparse matrices and vectors in images and convolution.
A Game Theoretical Approach to Multi-Agent SynchronizationSofie Haesaert
This document discusses a game theoretical approach to multi-agent synchronization using a linear-quadratic discrete-time graphical game. It describes how each agent aims to minimize its own tracking error relative to a leader agent within the constraints of a communication graph. The agents jointly determine their control policies to achieve a global Nash equilibrium where no agent can improve by unilaterally changing its policy. Coupled Riccati equations characterize the optimal control policies.
This document provides an overview of a 2004 CVPR tutorial on nonlinear manifolds in computer vision. The tutorial is divided into four parts that cover: (1) motivation for studying nonlinear manifolds and how differential geometry can be useful in vision, (2) tools from differential geometry like manifolds, tangent spaces, and geodesics, (3) statistics on manifolds like distributions and estimation, and (4) algorithms and applications in computer vision like pose estimation, tracking, and optimal linear projections. Nonlinear manifolds are important in computer vision as the underlying spaces in problems involving constraints like objects on circles or matrices with orthogonality constraints are nonlinear. Differential geometry provides a framework for generalizing tools from vector spaces to nonlinear
PVS-Studio for Linux Went on a Tour Around DisneyPVS-Studio
Recently we released a Linux version of PVS-Studio analyzer, which we had used before to check a number of open-source projects such as Chromium, GCC, LLVM (Clang), and others. Now this list includes several projects developed by Walt Disney Animation Studios for the community of virtual-reality developers. Let's see what bugs and defects the analyzer found in these projects.
Why should you care about Markov Chain Monte Carlo methods?
→ They are in the list of "Top 10 Algorithms of 20th Century"
→ They allow you to make inference with Bayesian Networks
→ They are used everywhere in Machine Learning and Statistics
Markov Chain Monte Carlo methods are a class of algorithms used to sample from complicated distributions. Typically, this is the case of posterior distributions in Bayesian Networks (Belief Networks).
These slides cover the following topics.
→ Motivation and Practical Examples (Bayesian Networks)
→ Basic Principles of MCMC
→ Gibbs Sampling
→ Metropolis–Hastings
→ Hamiltonian Monte Carlo
→ Reversible-Jump Markov Chain Monte Carlo
This document describes a Matlab project assignment on signal processing and the discrete Fourier transform (DFT). The project has two parts:
1) Developing functions for circular convolution properties like flipping, shifting, and convolution. Testing these functions with example signals.
2) Implementing block convolution using overlap-add and overlap-save strategies. Writing Matlab functions to perform overlap-add and overlap-save block convolution, and testing them with example data. Guidelines are provided for writing the project report.
Spatial Point Processes and Their Applications in EpidemiologyLilac Liu Xu
Spatial statistics can be used in epidemiology to analyze spatial point patterns of disease cases and controls. Common models include homogeneous and inhomogeneous Poisson processes, which describe patterns of complete spatial randomness and non-random clustering or dispersion. Descriptive statistics like the first-order intensity function λ(s) and second-order K-function can quantify clustering in a point pattern. A case-control study compares these statistics between case and control patterns to test for non-random spatial variations in disease risk. Monte Carlo simulations are used to calculate p-values when testing hypotheses about relative risk and clustering.
F. Arrichiello and G. Antonelli and A.P. Aguiar and A. Pascoal, Observability metrics for the relative localization of AUVs based on range and depth measurements: theory and experiments, 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems, San Franscisco, CA, pp. 3166--3171, 2011.
Those are the slides for my Master course on Monte Carlo Statistical Methods given in conjunction with the Monte Carlo Statistical Methods book with George Casella.
Digital Signal Processing Lab Manual ECE studentsUR11EC098
This document describes a MATLAB program to perform operations on discrete-time signals. It discusses amplitude manipulation operations like amplification, attenuation, and amplitude reversal. Time manipulation operations covered include time shifting and time reversal. It also describes adding and multiplying two discrete signals. The program takes user input, performs the selected operations, and plots the output waveforms to verify results.
Johan Suykens: "Models from Data: a Unifying Picture" ieee_cis_cyprus
The document discusses models that are constructed from data using machine learning techniques. It provides examples of different model types, including neural networks, support vector machines, kernel methods, and spectral clustering. These models can be expressed in both primal and dual formulations, and the dual representations allow for out-of-sample extensions, model selection, and solving large-scale problems. The document outlines core models that underlie many machine learning algorithms and how adding regularization terms and constraints can yield different optimal model representations.
This document provides an overview of streaming data and event processing concepts. It discusses different types of windows (tumbling, sliding, periodic, monotonic) that can be used to analyze data over time. It also introduces the concepts of streams and pipes for composing processing logic from simple reusable parts, and discusses how this relates to approaches used in Node.js and other systems. The document is presented at a technical event to explain these streaming data concepts.
The document is an introduction to graphical models. It discusses that graphical models define probability distributions over random variables using graphs to encode conditional independence assumptions. It then describes popular classes of graphical models including directed Bayesian networks and undirected Markov random fields. Bayesian networks define a factorization of the joint distribution over parent variables, while Markov random fields factorize over potentials at cliques in the graph. An example Markov random field is also shown.
This document discusses OpenGL transformations. It describes how geometric objects are represented and transformed using matrices. Transformation matrices for modeling, viewing and projection are manipulated separately in OpenGL. The viewing transformation places the camera in the 3D world. Projection can be parallel (orthographic) or perspective, with perspective being more realistic. OpenGL provides functions for common viewing and projection setups. The full transformation pipeline involves clipping, perspective division, viewport mapping and rasterization to render the 3D scene to a 2D framebuffer.
Prévision de consommation électrique avec adaptive GAMCdiscount
The document discusses generalized additive models (GAM) for short-term electricity load forecasting. GAMs are smooth additive models that decompose a response variable into additive components like trends, cyclic patterns, and nonlinear effects. They summarize how GAMs can model various drivers of electricity consumption, including temperature effects, day-of-week patterns, and lagged load values. Big additive models (BAM) allow applying GAMs to large electricity load datasets. BAMs use QR decomposition and online updating to efficiently estimate high-dimensional additive models.
Introduction to Factorization Machines model with an example. Motivations - why you should have it in your toolbox, model and it expressiveness, use case for context-aware recommendations and Field-Aware Factorization Machines.
This document provides an overview of engineering risk analysis and event logic. It discusses how to define events, represent them using Venn diagrams and indicator variables, and perform logic operations like unions and intersections on events. Simple reliability models are presented, including series, parallel and 2-out-of-3 systems. Methods for analyzing events are covered, such as event trees, fault trees, cut sets, and minimal cut sets. Examples of initiating events in risk analysis are also listed.
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...Jan Wedekind
This document discusses reconstructing micro-objects from focus-sets using blind deconvolution. It describes the experimental setup including a motorized microscope and camera. It provides an overview of the objectives which are to reconstruct surfaces, luminosities and colors from focus-sets and identify model parameters and assembly quality. It also gives basics on the discrete Fourier transform and sparse matrices and vectors in images and convolution.
A Game Theoretical Approach to Multi-Agent SynchronizationSofie Haesaert
This document discusses a game theoretical approach to multi-agent synchronization using a linear-quadratic discrete-time graphical game. It describes how each agent aims to minimize its own tracking error relative to a leader agent within the constraints of a communication graph. The agents jointly determine their control policies to achieve a global Nash equilibrium where no agent can improve by unilaterally changing its policy. Coupled Riccati equations characterize the optimal control policies.
This document provides an overview of a 2004 CVPR tutorial on nonlinear manifolds in computer vision. The tutorial is divided into four parts that cover: (1) motivation for studying nonlinear manifolds and how differential geometry can be useful in vision, (2) tools from differential geometry like manifolds, tangent spaces, and geodesics, (3) statistics on manifolds like distributions and estimation, and (4) algorithms and applications in computer vision like pose estimation, tracking, and optimal linear projections. Nonlinear manifolds are important in computer vision as the underlying spaces in problems involving constraints like objects on circles or matrices with orthogonality constraints are nonlinear. Differential geometry provides a framework for generalizing tools from vector spaces to nonlinear
PVS-Studio for Linux Went on a Tour Around DisneyPVS-Studio
Recently we released a Linux version of PVS-Studio analyzer, which we had used before to check a number of open-source projects such as Chromium, GCC, LLVM (Clang), and others. Now this list includes several projects developed by Walt Disney Animation Studios for the community of virtual-reality developers. Let's see what bugs and defects the analyzer found in these projects.
Why should you care about Markov Chain Monte Carlo methods?
→ They are in the list of "Top 10 Algorithms of 20th Century"
→ They allow you to make inference with Bayesian Networks
→ They are used everywhere in Machine Learning and Statistics
Markov Chain Monte Carlo methods are a class of algorithms used to sample from complicated distributions. Typically, this is the case of posterior distributions in Bayesian Networks (Belief Networks).
These slides cover the following topics.
→ Motivation and Practical Examples (Bayesian Networks)
→ Basic Principles of MCMC
→ Gibbs Sampling
→ Metropolis–Hastings
→ Hamiltonian Monte Carlo
→ Reversible-Jump Markov Chain Monte Carlo
This document describes a Matlab project assignment on signal processing and the discrete Fourier transform (DFT). The project has two parts:
1) Developing functions for circular convolution properties like flipping, shifting, and convolution. Testing these functions with example signals.
2) Implementing block convolution using overlap-add and overlap-save strategies. Writing Matlab functions to perform overlap-add and overlap-save block convolution, and testing them with example data. Guidelines are provided for writing the project report.
Spatial Point Processes and Their Applications in EpidemiologyLilac Liu Xu
Spatial statistics can be used in epidemiology to analyze spatial point patterns of disease cases and controls. Common models include homogeneous and inhomogeneous Poisson processes, which describe patterns of complete spatial randomness and non-random clustering or dispersion. Descriptive statistics like the first-order intensity function λ(s) and second-order K-function can quantify clustering in a point pattern. A case-control study compares these statistics between case and control patterns to test for non-random spatial variations in disease risk. Monte Carlo simulations are used to calculate p-values when testing hypotheses about relative risk and clustering.
F. Arrichiello and G. Antonelli and A.P. Aguiar and A. Pascoal, Observability metrics for the relative localization of AUVs based on range and depth measurements: theory and experiments, 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems, San Franscisco, CA, pp. 3166--3171, 2011.
Those are the slides for my Master course on Monte Carlo Statistical Methods given in conjunction with the Monte Carlo Statistical Methods book with George Casella.
This document provides an overview of databases and the Microsoft Access program. It defines what a database is, explains the main components of a database including fields, entries, and records. It also describes the different views in Access like datasheet, design, and form view. Finally, it outlines the major functions of databases like sorting, searching, and reports and provides steps for creating an Access database.
This lesson covers importing and exporting data between Access and other programs like Excel and Word. It also discusses creating form letters by merging data from an Access database into a Word document using merge fields. Key points include that imported data must match the field structure of the existing table, CSV files use commas to separate fields, and form letters generate a unique letter for each record by inserting data from the specified fields.
Cybernetics and space exploration are closely intertwined fields. The document discusses how cybernetics, the science of communication and control in animals and machines, has played a key role in enabling space exploration through technologies like automated systems, robotics, and remote control. Cybernetics continues to be important for advancing space technologies and enabling deeper exploration of space.
This document discusses creating and designing an Access database and tables. It describes creating a blank database, adding and designing tables in Datasheet and Design views, and setting field properties. Key points include: creating a database using a template that can include pre-built tables, queries, forms and reports; setting a field's data type; adding fields in Design view; and using properties like Description, Field Size, Format, Default Value and Required to further define fields.
Monte Carlo simulation is one of the most important numerical methods in financial derivative pricing and risk management. Due to the increasing sophistication of exotic derivative models, Monte Carlo becomes the method of choice for numerical implementations because of its flexibility in high-dimensional problems. However, the method of discretization of the underlying stochastic differential equation (SDE) has a significant effect on convergence. In addition the choice of computing platform and the exploitation of parallelism offers further efficiency gains. We consider here the effect of higher order discretization methods together with the possibilities opened up by the advent of programmable graphics processing units (GPUs) on the overall performance of Monte Carlo and quasi-Monte Carlo methods.
This document provides an overview of Monte Carlo simulation and examples of how to apply it. Monte Carlo simulation uses random numbers to estimate outcomes of complex problems that are difficult to solve analytically. Example problems include simulating daily demand at a grocery store, coin flips, dice rolls, and traffic light colors. The document also provides a newsboy problem simulation and car accident penalty simulation to demonstrate how to set up and run Monte Carlo simulations.
This document provides an overview of computer forensics, including its history, definitions, types of cyber crimes, and the role of computer forensics in investigations. It discusses how computer forensics has evolved from early uses in law enforcement to become a more standardized field. The document also outlines the stages of a forensic investigation and rules that investigators follow to preserve evidence.
Computer forensics is used to discover evidence of computer crimes by collecting, preserving, and analyzing digital evidence from computers and storage media. It helps criminal and civil legal cases involving issues like espionage, intellectual property theft, employee misuse of computers, and medical billing fraud. The computer forensics process includes securing evidence, making copies or images of storage devices, examining files and locations where deleted or hidden data may be stored, and documenting the investigation. Maintaining control of intellectual property and trade secrets is challenging as organizations increasingly process data overseas where there is greater risk of information leakage.
Computer Forensics & Windows Registryaradhanalaw
This document discusses how the Windows registry can be used in computer forensics investigations to retrieve information about software installed on a system, programs and files recently used by the user, devices connected to the system, and websites visited. Specific registry keys are identified that can provide details on installed software, autorun locations, most recently used lists, wireless networks connected to, mounted storage devices, and browser history. The registry acts as a log of system activity and can offer clues about the owner's actions even after files have been deleted.
The document provides instructions for using Microsoft Access 2010 to create and manage databases. It discusses identifying good database design principles, creating tables and defining fields, adding and deleting records, creating relationships between tables, sorting data, and using queries, forms, and reports to organize and display information. Specific topics covered include creating queries with criteria, sorting query results, using calculations in queries, and building queries that pull from multiple tables.
Kumpulan 4 mempresentasikan model inkuiri sebagai strategi pengajaran yang berpusat pada pelajar. Mereka menjelaskan fasa-fasa dan prinsip model inkuiri serta perbandingan antara inkuiri terbimbing dan terbuka. Presentasi ini membandingkan beberapa model pengajaran dan menyimpulkan pentingnya bagi guru memahami teknik-teknik pengajaran.
Monte Carlo Simulation methods are widely used to solve complex engineering and scientific problems.
The principle of Monte Carlo Simulation is averaging over a large number of random samples to approximate desired quantities. However, the convergence rate is 1/N, where N is the number of samples. In this slides, we introduce the concept of Superefficient Monte Carlo simulations, which can achieve 1/N^2 convergence rate. We discuss both the theoretical and practical aspects of the Superefficient Monte Carlo simulation methodology.
This document discusses how to create and modify reports in Microsoft Access 2010. It covers using the Report tool, Label Wizard, and Report Wizard to create basic reports from tables or queries. It also describes modifying reports in Layout view by adjusting control layouts and sizes, and in Design view by changing report sections, adding controls, lines, labels, and pictures. The goal is to help users understand how to generate and customize reports to display and organize database data.
Access lesson 04 Creating and Modifying FormsAram SE
This document discusses creating and modifying forms in Microsoft Access. It covers creating forms using tools and wizards, navigating records in a form, finding and replacing data, and updating, adding, and deleting records using a form. It also discusses creating blank forms and modifying forms by adding fields and controls in Layout and Design views.
Unit 5 general principles, simulation softwareraksharao
This document discusses concepts and algorithms in discrete-event simulation. It describes key concepts like events, activities, and the event scheduling algorithm. The event scheduling algorithm involves removing the imminent event from the future event list, advancing the clock, executing the event to update the system state, and generating future events. It also discusses world views like event scheduling and activity scanning. The document provides an example of simulating a single-channel queue and how simulation can be implemented in Java and GPSS.
Agape explains the importance Of Computer Forensics.Agape Inc
A computer forensic expert was able to prove a man's innocence when he was falsely accused of a crime based on files found on his work laptop. The expert determined the laptop had been infected with viruses that resulted in the unwanted activity without the owner's knowledge. As a result of the expert's findings, all charges were dropped and the man's life was restored. This story illustrates the importance of computer forensics in determining the truth in such cases and fighting cybercrime.
This document discusses hemolytic anemia, including its causes, signs and symptoms, pathophysiology, diagnosis, and investigation. The key points are:
- Hemolytic anemia occurs when red blood cell destruction exceeds bone marrow production, shortening red blood cell lifespan from the normal 120 days to 20-30 days.
- Causes include red blood cell defects like enzyme deficiencies or structural issues, as well as toxins, trauma, or conditions like thrombotic thrombocytopenic purpura.
- Signs and symptoms include jaundice, pallor, splenomegaly, and dark urine. Diagnosis involves tests to detect hemolysis and determine the type and precise cause through
This document discusses scenario generation techniques for Monte Carlo simulation in financial modeling. It covers:
1) Exact solution advancement - generating scenarios by calculating the analytical solution to stochastic differential equations at discrete time points.
2) Numerical integration of stochastic differential equations - approximating scenarios by numerically solving SDEs using methods like the Euler scheme.
3) The difference between strong and weak convergence in the accuracy of numerical schemes - schemes may converge at different rates when approximating trajectories versus expectations.
The document provides examples of generating lognormal scenarios through both exact and numerical methods, and discusses sources of error in numerical integration schemes.
Monte Carlo methods rely on repeated random sampling to compute results. They generate random samples from a population according to a probability distribution and use them to obtain numerical results. The founders of the Monte Carlo method were J. von Neumann and S. Ulam during the Manhattan Project in the 1940s. Monte Carlo methods can be used to solve multidimensional integrals and have better convergence than classical numerical integration methods for dimensions greater than 4. The variance of Monte Carlo estimates decreases as 1/N, where N is the number of samples, resulting in slow convergence. Variance reduction techniques can improve the convergence rate.
This document discusses automatic Bayesian cubature for numerical integration. It begins with an introduction to multivariate integration and the challenges it poses. It then describes an automatic cubature algorithm that generates sample points and computes error bounds iteratively until a tolerance threshold is met. Next, it covers Bayesian cubature, which treats integrands as random functions to obtain probabilistic error bounds. It defines a Bayesian trio identity relating the integration error to discrepancies, variations, and alignments. The document concludes with discussions of future work.
Uniform and non-uniform pseudo random numbers generators for high dimensional...LEBRUN Régis
This document outlines various topics related to pseudo-random number generators (PRNGs). It begins by discussing uniform PRNGs and the goal of approximating independent and uniformly distributed random variables. It then discusses linear congruential generators and multiplicative congruential generators as examples of uniform PRNGs. It notes some weaknesses of these generators, such as short periods and poor distribution in high dimensions. Finally, it briefly discusses statistical tests that can be used to validate PRNGs, such as the gap test and spectral test.
The document discusses data structures and algorithms. It defines key concepts like algorithms, programs, data structures, and asymptotic analysis. It explains how to analyze algorithms to determine their efficiency, including analyzing best, worst, and average cases. Common notations for describing asymptotic running time like Big-O, Big-Omega, and Big-Theta are introduced. The document provides examples of analyzing sorting algorithms like insertion sort and calculating running times. It also discusses techniques for proving an algorithm's correctness like assertions and loop invariants.
My talk at the International Conference on Monte Carlo Methods and Applications (MCM2032) related to advances in mathematical aspects of stochastic simulation and Monte Carlo methods at Sorbonne Université June 28, 2023, about my recent works (i) "Numerical Smoothing with Hierarchical Adaptive Sparse Grids and Quasi-Monte Carlo Methods for Efficient Option Pricing" (link: https://doi.org/10.1080/14697688.2022.2135455), and (ii) "Multilevel Monte Carlo with Numerical Smoothing for Robust and Efficient Computation of Probabilities and Densities" (link: https://arxiv.org/abs/2003.05708).
The document summarizes key concepts in image formation, including how light interacts with objects and lenses to form images, and how different imaging systems like the human eye and digital cameras work. It discusses factors that affect image quality such as point spread functions and noise. Methods for analyzing the effects of noise propagation and algorithms on image quality are presented, such as error propagation techniques and Monte Carlo simulations.
ITS World Congress :: Vienna, Oct 2012László Nádai
Control of the emission rate of exhaust fumes as well as vehicle density in various road segments of freeway traffic practically is desirable. For this purpose hydrodynamic macroscopic models are used that approximate the traffic as the motion of some compressible fluid. They normally have analytical ambiguities due to using various finite element approximations of spatial partial differential operators and applying various analytical compressibility models. Further uncertainties stem from the estimation of the model parameters. The suggested approach is able to iteratively and adaptively refine the traffic control based on any version of the possible analytical forms. The controller has to measure vehicle densities and traffic velocities and applies variable traffic signs for prescribing velocities and allowed ingress rate from a ramp as control signals. Since the stationary solutions of the control problem are stable in the region investigated, instead of fast, really dynamic control it applies simple quasi-stationary process model and control that is a common practice in Classical Thermodynamics. The operation of the proposed method is illustrated via simulations.
The document discusses Gaussian process emulators for approximating complex computer models or simulators. It describes how Gaussian process emulators work by modeling the simulator output as a Gaussian stochastic process. The emulator can then predict the simulator output at new input values and provide a measure of prediction accuracy. Key steps in building a Gaussian process emulator include designing runs of the simulator, fitting the emulator parameters using Bayesian methods rather than maximum likelihood to avoid issues, and obtaining closed-form expressions for the predictive distribution at new points. Gaussian process emulators have advantages like interpolation and calibrated predictive accuracy but also challenges like computational scaling with data size.
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesVissarion Fisikopoulos
The document discusses efficient algorithms for computing volume and edge skeletons of polytopes defined implicitly by optimization oracles. It presents an algorithm to compute the edge skeleton of a polytope in oracle calls and arithmetic operations. It also describes using geometric random walks and optimization oracles to approximate polytope volume, which is more efficient than exact computation for high dimensions. Experimental results show the approach computes volume within minutes for polytopes up to dimension 12 with less than 2% error.
The document discusses encrypted control systems using homomorphic encryption. It introduces Learning With Errors (LWE)-based homomorphic encryption, which allows computations like addition and multiplication to be performed on encrypted data. A procedure is described to implement an encrypted linear dynamic system by first converting it to operate over integers modulo q, then encrypting the system using LWE encryption. The encryption scheme, called GSW-LWE encryption, allows matrix-vector multiplications to be performed in an encrypted form while keeping the error growth bounded.
This document discusses output analysis for terminating simulations. It begins by explaining that simulation results contain variance, so we must be cautious in how we interpret them. It then describes two main types of simulations: terminating and non-terminating. For terminating simulations, there is a natural start and end point defined in the model, and output depends on both the initial and stopping conditions. Statistical methods like confidence intervals are used to analyze the results from multiple replications. The document provides examples and discusses measures to determine the needed precision and number of replications.
The document provides guidelines for a presentation by two professors. It includes their names, the presenter's name, date and location of the presentation. It then discusses topics related to algorithms and computation such as deterministic and nondeterministic computation modes, complexity classes like TIME and SPACE, and the time complexity hierarchy theorem. It also mentions random number generators, pseudo-random number generators, and Monte Carlo methods for testing random numbers.
Opening of our Deep Learning Lunch & Learn series. First session: introduction to Neural Networks, Gradient descent and backpropagation, by Pablo J. Villacorta, with a prologue by Fernando Velasco
This document provides an overview of the CS303 Computer Algorithms course taught by Dr. Yanxia Jia. It discusses the importance of algorithms, provides examples of classic algorithm problems like sorting and searching, and summarizes common algorithm design techniques and data structures used, including arrays, linked lists, stacks, queues, heaps, graphs and trees.
Workshop: Numerical Analysis of Stochastic Partial Differential Equations (NASPDE), in Network Eurandom at Eindhoven University of Technology, May 16, 2023, about my recent works (i) "Numerical Smoothing with Hierarchical Adaptive Sparse Grids and Quasi-Monte Carlo Methods for Efficient Option Pricing" (link: https://doi.org/10.1080/14697688.2022.2135455), and (ii) "Multilevel Monte Carlo with Numerical Smoothing for Robust and Efficient Computation of Probabilities and Densities" (link: https://arxiv.org/abs/2003.05708).
This document provides an overview of support vector machines (SVMs). It discusses how SVMs can be used to perform classification tasks by finding optimal separating hyperplanes that maximize the margin between different classes. The document outlines how SVMs solve an optimization problem to find these optimal hyperplanes using techniques like Lagrange duality, kernels, and soft margins. It also covers model selection methods like cross-validation and discusses extensions of SVMs to multi-class classification problems.
https://telecombcn-dl.github.io/2018-dlai/
Deep learning technologies are at the core of the current revolution in artificial intelligence for multimedia data analysis. The convergence of large-scale annotated datasets and affordable GPU hardware has allowed the training of neural networks for data analysis tasks which were previously addressed with hand-crafted features. Architectures such as convolutional neural networks, recurrent neural networks or Q-nets for reinforcement learning have shaped a brand new scenario in signal processing. This course will cover the basic principles of deep learning from both an algorithmic and computational perspectives.
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Alexander Litvinenko
1) The document describes a method called Multilevel Monte Carlo (MLMC) to efficiently compute electromagnetic fields scattered from dielectric objects of uncertain shapes. MLMC balances statistical errors from random sampling and numerical errors from geometry discretization to reduce computational time.
2) A surface integral equation solver is used to model scattering from dielectric objects. Random geometries are generated by perturbing surfaces with random fields defined by spherical harmonics.
3) MLMC is shown to estimate scattering cross sections accurately while requiring fewer overall computations compared to traditional Monte Carlo methods. This is achieved by optimally allocating samples across discretization levels.
This document summarizes key concepts in cryptography and number theory relevant to public key cryptography algorithms like RSA. It discusses number theoretic concepts like prime numbers, modular arithmetic, discrete logarithms, and one-way functions. It then provides an overview of the RSA algorithm, explaining how it uses the difficulty of factoring large numbers to enable secure public key encryption and digital signatures.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Lecture1
1. Advanced Computational Methods in Statistics:
Lecture 1
Monte Carlo Simulation
&
Introduction to Parallel Computing
Axel Gandy
Department of Mathematics
Imperial College London
http://www2.imperial.ac.uk/~agandy
London Taught Course Centre
for PhD Students in the Mathematical Sciences
Spring 2011
2. Today’s Lecture
Part I Monte Carlo Simulation
Part II Introduction to Parallel Computing
Axel Gandy 2
3. Random Number Generation Computation of Integrals Variance Reduction Techniques
Part I
Monte Carlo Simulation
Random Number Generation
Computation of Integrals
Variance Reduction Techniques
Axel Gandy Monte Carlo Simulation 3
4. Random Number Generation Computation of Integrals Variance Reduction Techniques
Uniform Random Number Generation
Basic building block of simulation:
stream of independent rv U1 , U2 , . . . ∼ U(0, 1)
“True” random number generators:
based on physical phenomena
Example http://www.random.org/; R-package random: “The
randomness comes from atmospheric noise”
Disadvantages of physical systems:
cumbersome to install and run
costly
slow
cannot reproduce the exact same sequence twice [verification,
debugging, comparing algorithms with the same stream]
Pseudo Random Number Generators: Deterministic algorithms
Example: linear congruential generators:
sn
un = , sn+1 = (asn + c)modM
M
Axel Gandy Monte Carlo Simulation 5
5. Random Number Generation Computation of Integrals Variance Reduction Techniques
General framework for Uniform RNG
(L’Ecuyer, 1994)
T s1 T s2 T s3 T ...
s
G G G
u1 u2 u3
s initial state (’seed’)
S finite set of states
T : S → S is the transition function
U finite set of output symbols
(often {0, . . . , m − 1} or a finite subset of [0, 1])
G : S → U output function
si := T (Si−1 ) and ui := G (si ).
output: u1 , u2 , . . .
Axel Gandy Monte Carlo Simulation 6
6. Random Number Generation Computation of Integrals Variance Reduction Techniques
Some Notes for Uniform RNG
S finite =⇒ ui is periodic
In practice: seed s often chosen by clock time as default.
Good practice to be able to reproduce simulations:
Save the seed!
Axel Gandy Monte Carlo Simulation 7
7. Random Number Generation Computation of Integrals Variance Reduction Techniques
Quality of Random Number Generators
“Random numbers should not be generated with a method
chosen at random” (Knuth, 1981, p.5)
Some old implementations were unreliable!
Desirable properties of random number generators:
Statistical uniformity and unpredictability
Period Length
Efficiency
Theoretical Support
Repeatability, portability, jumping ahead, ease of implementation
(more on this see e.g. Gentle (2003), L’Ecuyer (2004), L’Ecuyer
(2006), Knuth (1998))
Usually you will do well with generators in modern software (e.g.
the default generators in R).
Don’t try to implement your own generator!
(unless you have very good reasons)
Axel Gandy Monte Carlo Simulation 8
8. Random Number Generation Computation of Integrals Variance Reduction Techniques
Nonuniform Random Number Generation
How to generate nonuniform random variables?
Basic idea:
Apply transformations to a stream of iid U[0,1] random variables
Axel Gandy Monte Carlo Simulation 9
9. Random Number Generation Computation of Integrals Variance Reduction Techniques
Inversion Method
Let F be a cdf.
Quantile function (essentially the inverse of the cdf):
F −1 (x) = inf{x : F (x) ≥ u}
If U is uniform then F −1 (U) ∼ F . Indeed,
P(X ≤ x) = P(F −1 (U) ≤ x) = P(U ≤ F (x)) = F (x)
Only works if F −1 (or a good approximation of it) is available.
Axel Gandy Monte Carlo Simulation 10
10. Random Number Generation Computation of Integrals Variance Reduction Techniques
Acceptance-Rejection Method
f(x)
Cg(x)
0.30
0.20
0.10
0.00
0 5 10 15 20
x
target density f
Proposal density g (easy to generate from) such that for some
C < ∞:
f (x) ≤ Cg (x)∀x
Algorithm:
1. Generate X from g .
2. With probability Cg(X )) return X - otherwise goto 1.
f
(X
1
C= probability of acceptance - want it to be as close to 1 as
possible.
Axel Gandy Monte Carlo Simulation 11
11. Random Number Generation Computation of Integrals Variance Reduction Techniques
Further Algorithms
Ratio-of-Uniforms
Use of the characteristic function
MCMC
For many of those techniques and techniques to simulate specific
distributions see e.g. Gentle (2003).
Axel Gandy Monte Carlo Simulation 12
12. Random Number Generation Computation of Integrals Variance Reduction Techniques
Evaluation of an Integral
Want to evaluate
I := g (x)dx
[0,1]d
Importance for statistics: computation of expected values
(posterior means), probabilities (p-values), variances, normalising
constants, ....
Often, d is large. In a random sample, often d =sample size.
How to solve it?
Symbolical
Numerical Integration
Quasi Monte Carlo
Monte Carlo Integration
Axel Gandy Monte Carlo Simulation 14
13. Random Number Generation Computation of Integrals Variance Reduction Techniques
Numerical Integration/Quadrature
Main idea: approximate the function locally with simple
function/polynomials
Advantage: good convergence rate
Not useful for high dimensions - curse of dimensionality
Axel Gandy Monte Carlo Simulation 15
14. Random Number Generation Computation of Integrals Variance Reduction Techniques
Midpoint Formula
Basic:
1
1
f (x)dx ≈ f
0 2
Composite: apply the rule in n subintervals
1.0
0.5
0.0
−0.5
−1.0
0.0 0.5 1.0 1.5 2.0
1
Error: O( n ).
Axel Gandy Monte Carlo Simulation 16
15. Random Number Generation Computation of Integrals Variance Reduction Techniques
Trapezoidal Formula
Basic:
1
1
f (x)dx ≈ (f (0) + f (1))
0 2
Composite:
1.0
0.5
0.0
−0.5
−1.0
0.0 0.5 1.0 1.5 2.0
1
Error: O( n2 ).
Axel Gandy Monte Carlo Simulation 17
16. Random Number Generation Computation of Integrals Variance Reduction Techniques
Simpson’s rule
Approximate the integrand by a quadratic function
1
1 1
f (x)dx ≈ [f (0) + 4f ( ) + f (1)]
0 6 2
Composite Simpson:
1.0
0.5
0.0
−0.5
−1.0
0.0 0.5 1.0 1.5 2.0
1
Error: O( n4 ). Axel Gandy Monte Carlo Simulation 18
17. Random Number Generation Computation of Integrals Variance Reduction Techniques
Advanced Numerical Integration Methods
Newton Cotes formulas
Adaptive methods
Unbounded integration interval: transformations
Axel Gandy Monte Carlo Simulation 19
18. Random Number Generation Computation of Integrals Variance Reduction Techniques
Curse of dimensionality - Numerical Integration in Higher
Dimensions
I := g (x)dx
[0,1]d
Naive approach:
write as iterated integral
1 1
I := ... g (x)dxn . . . dx1
0 0
use 1D scheme for each integral with, say g points .
n = g d function evaluations needed
for d = 100 (a moderate sample size) and g = 10 (which is not a
lot):
n > estimated number of atoms in the universe!
1
Suppose we use the trapezoidal rule, then the error = O( n2/d )
More advanced schemes are not doing much better!
Axel Gandy Monte Carlo Simulation 20
19. Random Number Generation Computation of Integrals Variance Reduction Techniques
Monte Carlo Integration
n
1
g (x)dx ≈ g (Xi ),
[0,1]d n
i=1
where X1 , X2 , · · · ∼ U([0, 1]d ) iid.
SLLN:
n
1
g (Xi ) → g (x)dx (n → ∞)
n [0,1]d
i=1
1
CLT: error is bounded by OP ( √n ).
independent of d
Can easily compute asymptotic confidence intervals.
Axel Gandy Monte Carlo Simulation 21
20. Random Number Generation Computation of Integrals Variance Reduction Techniques
Quasi-Monte-Carlo
Similar to MC, but instead of random Xi : Use deterministic xi
that fill [0, 1]d evenly.
so-called “low-discrepancy sequences”.
R-package randtoolbox
Axel Gandy Monte Carlo Simulation 22
22. Random Number Generation Computation of Integrals Variance Reduction Techniques
Comparison between Quasi-Monte-Carlo and Monte Carlo
(x1 + x2 )(x2 + x3 )2 (x3 + x4 )3 dx
[0,1]4
Using Monte-Carlo and Quasi-MC
2.75
quasi−MC
MC
2.70
2.65
2.60
2.55
0e+00 2e+05 4e+05 6e+05 8e+05 1e+06
n
Axel Gandy Monte Carlo Simulation 24
23. Random Number Generation Computation of Integrals Variance Reduction Techniques
Bounds on the Quasi-MC error
Koksma-Hlawka inequality (Niederreiter, 1992, Theorem 2.11)
1 ∗
g (xi ) − g (x)dx ≤ Vd (g )Dn ,
n [0,1]d
where
Vd (g ) is the so-called Hardy and Krause variation of g
and
Dn is the discrepancy of the points x1 , . . . , xn in [0, 1]d
given by
∗
Dn = sup |#{xi ∈ A : i = 1, . . . , n} − λ(A)|
A∈A
where
λ is Lebesgue measure
A is the set of all subrectangles of [0, 1]d of the
d
form i=1 [0, ai ]d
Many sequences have been suggested, e.g. the Halton sequence
(other sequences: Gandy
Axel
Faure, Sobol, ...) with:Carlo Simulation
Monte 25
24. Random Number Generation Computation of Integrals Variance Reduction Techniques
Comparison
The consensus in the literature seems to be:
use numerical integration for small d
Quasi-MC useful for medium d
use Monte Carlo integration for large d
Axel Gandy Monte Carlo Simulation 26
25. Random Number Generation Computation of Integrals Variance Reduction Techniques
Importance Sampling
Main idea: Change the density we are sampling from.
Interested in E(φ(X )) = φ(x)f (x)dx
For any density g ,
f (x)
E(φ(X )) = φ(x) g (x)dx
g (x)
Thus an unbiased estimator of E(φ(X )) is
n
ˆ= 1
I φ(Xi )
f (Xi )
,
n g (Xi )
i=1
where X1 , . . . , Xn ∼ g iid.
How to choose g ?
Suppose g ∝ φf then Var(ˆ) = 0.
I
However, the corresponding normalizing constant is E(φ(X )), the
quantity we want to estimate!
A lot of theoretical work is based on large deviation theory.
Axel Gandy Monte Carlo Simulation 28
26. Random Number Generation Computation of Integrals Variance Reduction Techniques
Importance Sampling and Rare Events
Importance sampling can greatly reduce the variance for
estimating the probability of rare events, i.e. φ(x) = I(x ∈ A)
and E(φ(X )) = P(X ∈ A) small.
Axel Gandy Monte Carlo Simulation 29
27. Random Number Generation Computation of Integrals Variance Reduction Techniques
Control Variates
Interested in I = E X
Suppose we can also observe Y and know E Y .
Consider T = X + a(Y − E(Y ))
Then E T = I and
Var T = Var X + 2a Cov(X , Y ) − a2 Var Y
Minimized for a = − Cov(XY ) .
Var
,Y
usually, a not known → estimate
For Monte Carlo sampling:
generate iid sample (X1 , Y1 ), . . . , (Xn , Yn )
estimate Cov(X , Y ), Var Y based on this sample → ˆ
a
ˆ = 1 n [Xi + ˆ(Yi − E(Y ))]
I a
n i=1
ˆ can be computed via standard regression analysis.
I
Hence the term “regression-adjusted control variates” .
Can be easily generalised to several control variates.
Axel Gandy Monte Carlo Simulation 30
28. Random Number Generation Computation of Integrals Variance Reduction Techniques
Further Techniques
Antithetic Sampling
Use X and −X
Conditional Monte Carlo
Evaluate parts explicitly
Common Random Numbers
For comparing two procedures - use the same sequence of
random numbers.
Stratification
Divide sample space Ω into strata Ω1 , . . . , Ωs
In each strata, generate Ri replicates conditional on Ωi and
obtain an estimates ˆi
I
Combine using the law of total probability:
ˆ = p1ˆ1 + · · · + ps ˆs
I I I
Need to know pi = P(Ωi ) for all i
Axel Gandy Monte Carlo Simulation 31
29. Introduction Parallel RNG Practical use of parallel computing (R)
Part II
Parallel Computing
Introduction
Parallel RNG
Practical use of parallel computing (R)
Axel Gandy Parallel Computing 32
30. Introduction Parallel RNG Practical use of parallel computing (R)
Moore’s Law
(Source: Wikipedia, Creative Commons Attribution ShareAlike 3.0 License)
Axel Gandy Parallel Computing 34
31. Introduction Parallel RNG Practical use of parallel computing (R)
Growth of Data Storage
Growth PC Harddrive Capacity
q
q
q q
q q q
1e+02
q q
q q
q q q
q q q q q
q q q
q
q q q q
q q
q q
capacity [GB]
q
q q
q
q q
q
q q q
q q
q q q
q q
q q
q q
q
q q q
1e+00
q
q q q
q
q
q
q
q
q q
q
q q q
q q q
1e−02
q q q
q q q q
q q q
q q q q q
q
q q q
q
1980 1985 1990 1995 2000 2005 2010
year
Not only the computer speed but also the data size is increasing
exponentially!
The increase in the available storage is at least as fast as the
increase in computing power.
Axel Gandy Parallel Computing 35
32. Introduction Parallel RNG Practical use of parallel computing (R)
Introduction
Recently: Less increase in CPU clock speed
→ multi core CPUs are appearing (quad core available - 80 cores
in labs)
→ software needs to be adapted to exploit this
Traditional computing:
Problem is broken into small steps that are executed sequentially
Parallel computing:
Steps are being executed in parallel
Axel Gandy Parallel Computing 36
33. Introduction Parallel RNG Practical use of parallel computing (R)
von Neumann Architecture
CPU executes a stored program that specifies a sequence of read
and write operations on the memory.
Memory is used to store both program and data instructions
Program instructions are coded data which tell the computer to
do something
Data is simply information to be used by the program
A central processing unit (CPU) gets instructions and/or data
from memory, decodes the instructions and then sequentially
performs them.
Axel Gandy Parallel Computing 37
34. Introduction Parallel RNG Practical use of parallel computing (R)
Different Architectures
Multicore computing
Symmetric multiprocessing
Distributed Computing
Cluster computing
Massive Parallel processor
Grid Computing
List of top 500 supercomputers at http://www.top500.org/
Axel Gandy Parallel Computing 38
35. Introduction Parallel RNG Practical use of parallel computing (R)
Flynn’s taxonomy
Single Instruction Multiple Instruction
Single Data SISD MISD
Multiple Data SIMD MIMD
Examples:
SIMD: GPUs
Axel Gandy Parallel Computing 39
36. Introduction Parallel RNG Practical use of parallel computing (R)
Memory Architectures of Parallel Computers
Traditional System Memory
CPU
Shared Memory System Memory
CPU CPU CPU
Distributed Memory System
Memory Memory Memory
CPU CPU CPU
Distributed Shared Memory System
Memory Memory Memory
CPU CPU CPU CPU CPU CPU CPU CPU CPU
Axel Gandy Parallel Computing 40
37. Introduction Parallel RNG Practical use of parallel computing (R)
Embarrassingly Parallel Computations
Examples:
Monte Carlo Integration
Bootstrap
Cross-Validation
Axel Gandy Parallel Computing 41
38. Introduction Parallel RNG Practical use of parallel computing (R)
Speedup
Ideally: computational time reduced linearly in the number of
CPUs
Suppose only a fraction p of the total tasks can be parallelized.
Supposing we have n parallel CPUs, the speedup is
1
(Amdahl’s Law)
(1 − p) + p/n
→ no infinite speedup possible.
Example: p = 90%, maximum speed up by a factor of 10.
Axel Gandy Parallel Computing 42
39. Introduction Parallel RNG Practical use of parallel computing (R)
Communication between processes
Forking
Threading
OpenMP
shared memory multiprocessing
PVM (Parallel Virtual Machine)
MPI (Message Passing Interface)
How to divide tasks? e.g. Master/Slave concept
Axel Gandy Parallel Computing 43
40. Introduction Parallel RNG Practical use of parallel computing (R)
Parallel Random Number Generation
Problems with RNG on parallel computers
Cannot use identical streams
Sharing a single stream: a lot of overhead.
Starting from different seeds: danger of overlapping streams
(in particular if seeding is not sophisticated or simulation is large)
Need independent streams on each processor...
Axel Gandy Parallel Computing 45
41. Introduction Parallel RNG Practical use of parallel computing (R)
Parallel Random Number Generation - sketch of general
approach
1 T 1 T 1 T ...
s1 s2 s3
G G G
f1 1 1 1
u1 u2 u3
f2 T T T
s 2
s1 2
s2 2
s3 ...
G G G
f3
2
u1 2
u2 2
u3
3 T 3 T 3 T ...
s1 s2 s3
G G G
3
u1 3
u2 3
u3
Axel Gandy Parallel Computing 46
42. Introduction Parallel RNG Practical use of parallel computing (R)
Packages in R for Parallen random Number Generation
rsprng Interface to the scalable parallel random number
generators library (SPRNG)
http://sprng.cs.fsu.edu/
rlecuyer Essentially starts with one random stream and
partitions it into long substreams by jumping ahead.
L’Ecuyer et al. (2002)
Axel Gandy Parallel Computing 47
43. Introduction Parallel RNG Practical use of parallel computing (R)
Profile
Determine what part of the programme uses most time with a
profiler
Improve the important parts (usually the innermost loop)
R has a built-in profiler (see Rprof, Rprof.summary, package
profr)
Axel Gandy Parallel Computing 49
44. Introduction Parallel RNG Practical use of parallel computing (R)
Use Vectorization instead of Loops
> a <- rnorm(1e+07)
> system.time({
+ x <- 0
+ for (i in 1:length(a)) x <- x + a[i]
+ })[3]
elapsed
21.17
> system.time(sum(a))[3]
elapsed
0.07
Axel Gandy Parallel Computing 50
45. Introduction Parallel RNG Practical use of parallel computing (R)
Just-In-Time Compilation - RA
From the developer’s websie
(http://www.milbo.users.sonic.net/ra/): “Ra is
functionally identical to R but provides just-in-time compilation
of loops and arithmetic expressions in loops. This usually makes
arithmetic in Ra much faster. Ra will also typically run a little
faster than standard R even when just-in-time compilation is not
enabled.”
Not just a package - central parts are reimplemented.
Bill Venables (on R help archive):
“if you really want to write R code as you might C code, then jit
can help make it practical in terms of time. On the other hand, if
you want to write R code using as much of the inbuilt operators
as you have, then you can possibly still do things better.”
Axel Gandy Parallel Computing 51
46. Introduction Parallel RNG Practical use of parallel computing (R)
Use Compiled Code
R is an interpreted language.
Can include C, C++ and Fortran code.
Can dramaticallly speed up computationally intensive parts
(a factor of 100 is possible)
No speedup if the computationally part is a vector/matrix
operation.
Downside: decreased portability
Axel Gandy Parallel Computing 52
47. Introduction Parallel RNG Practical use of parallel computing (R)
R-Package: snow
Mostly for “embarassingly parallel” computations
Extends the “apply”-style function to a cluster of machines:
params <- 1:10000
cl <- makeCluster(8, "SOCK")
res <- parSapply(cl, params, function(x) foo(x))
applies the function to each of the parameters using the cluster.
will run 8 copies at once.
Axel Gandy Parallel Computing 53
48. Introduction Parallel RNG Practical use of parallel computing (R)
snow - Hello World
> library(snow)
> cl <- makeCluster(2, type = "SOCK")
> str(clusterCall(cl, function() Sys.info()[c("nodename", "machine
List of 2
$ : Named chr [1:2] "AG" "x86"
..- attr(*, "names")= chr [1:2] "nodename" "machine"
$ : Named chr [1:2] "AG" "x86"
..- attr(*, "names")= chr [1:2] "nodename" "machine"
> str(clusterApply(cl, 1:2, function(x) x + 3))
List of 2
$ : num 4
$ : num 5
> stopCluster(cl)
Axel Gandy Parallel Computing 54
49. Introduction Parallel RNG Practical use of parallel computing (R)
snow - set up random number generator
without setting upt the RNG
> cl <- makeCluster(2, type = "SOCK")
> clusterApply(cl, 1:2, function(i) rnorm(5))
[[1]]
[1] 0.1540537 -0.4584974 1.1320638 -1.4979826 1.1992120
[[2]]
[1] 0.1540537 -0.4584974 1.1320638 -1.4979826 1.1992120
> stopCluster(cl)
Now with proper setup of the RNG
> cl <- makeCluster(2, type = "SOCK")
> clusterSetupRNG(cl)
[1] "RNGstream"
> clusterApply(cl, 1:2, function(i) rnorm(5))
[[1]]
[1] -1.14063404 -0.49815892 -0.76670013 -0.04821059 -1.09852152
[[2]]
[1] 0.7049582 0.4821092 -1.2848088 0.7198440 0.7386390
> stopCluster(cl)
Axel Gandy Parallel Computing 55
50. Introduction Parallel RNG Practical use of parallel computing (R)
snow - Another Simple Example
5x4 processors - several servers
> cl <- makeCluster(rep(c("localhost","euler","dirichlet","leibniz","riemann"),
each=4),type="SOCK")
may need to give password if not set up public/private key for ssh
> system.time(sapply(1:1000,function(i) mean(rnorm(1e3))))[3]
0.156
> system.time(clusterApply(cl,1:1000,function(i) mean(rnorm(1e3))))[3]
0.161
> system.time(clusterApplyLB(cl,1:1000,function(i) mean(rnorm(1e3))))[3]
0.401
→ too much overhead - parallelisation does not lead to gains
> system.time(sapply(1:1000,function(i) mean(rnorm(1e5))))[3]
12.096
> system.time(clusterApply(cl,1:1000,function(i) mean(rnorm(1e5))))[3]
0.815
> system.time(clusterApplyLB(cl,1:1000,function(i) mean(rnorm(1e5))))[3]
0.648
> stopCluster(cl)
→ parallelisation leads to substantial gain in speed.
Axel Gandy Parallel Computing 56
51. Introduction Parallel RNG Practical use of parallel computing (R)
Extensions of snow
snowfall offers additional support for implicit sequential execution (e.g.
for distributing packages using optional parallel support),
additional calculation functions, extended error handling, and
many functions for more comfortable programming.
snowFT Extension of the snow package supporting fault tolerant and
reproducible applications. It is written for the PVM
communication layer.
Axel Gandy Parallel Computing 57
52. Introduction Parallel RNG Practical use of parallel computing (R)
Rmpi
For more complicated parallel algorithms that are not embarassingly
parallel.
Tutorial under http://math.acadiau.ca/ACMMaC/Rmpi/
Hello world from this tutorial
# Load the R MPI package if it is not already loaded.
if (!is.loaded("mpi_initialize")) {
library("Rmpi") }
# Spawn as many slaves as possible
mpi.spawn.Rslaves()
# In case R exits unexpectedly, have it automatically clean up
# resources taken up by Rmpi (slaves, memory, etc...)
.Last <- function(){
if (is.loaded("mpi_initialize")){
if (mpi.comm.size(1) > 0){
print("Please use mpi.close.Rslaves() to close slaves.")
mpi.close.Rslaves()
}
print("Please use mpi.quit() to quit R")
.Call("mpi_finalize") } }
# Tell all slaves to return a message identifying themselves
mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size()))
# Tell all slaves to close down, and exit the program
mpi.close.Rslaves()
mpi.quit()
(not able to install under win from CRAN - install from
http://www.stats.uwo.ca/faculty/yu/Rmpi/)
Axel Gandy Parallel Computing 58
53. Introduction Parallel RNG Practical use of parallel computing (R)
Some other Packages
nws Network of Workstations
http://nws-r.sourceforge.net/
multicore Use of parallel computing on a single machine via fork
(Unix, MacOS) - very fast and easy to use.
GridR http:
//cran.r-project.org/web/packages/GridR/
Wegener et al. (2009, Future Generation Computer
Systems)
papply on CRAN “ Similar to apply and lapply, applies a
function to all items of a list, and returns a list with the
results. Uses Rmpi to distribute the processing evenly
across a cluster.”‘
multiR http://e-science.lancs.ac.uk/multiR/
rparallel http://www.rparallel.org/
Axel Gandy Parallel Computing 59
54. Introduction Parallel RNG Practical use of parallel computing (R)
GPUs
graphical processing units - in graphics cards
very good at parallel processing
need to taylor to specific GPU.
Packages in R:
gputools several basic routines.
cudaBayesreg Bayesian multilevel modeling for fMRI.
Axel Gandy Parallel Computing 60
55. Introduction Parallel RNG Practical use of parallel computing (R)
Further Reading
A tutorial on Parallel Computing:
https://computing.llnl.gov/tutorials/parallel_comp/
High Performance Computing task view on CRAN
http://cran.r-project.org/web/views/
HighPerformanceComputing.html
An up-to-date talk on high performance comuting with R:
http://dirk.eddelbuettel.com/papers/
useR2010hpcTutorial.pdf
Axel Gandy Parallel Computing 61
56. References
Part III
Appendix
Axel Gandy Appendix 62
57. References
Topics in the coming lectures:
Optimisation
MCMC methods
Bootstrap
Particle Filtering
Axel Gandy Appendix 63
58. References
References I
Gentle, J. (2003). Random Number Generation and Monte Carlo Methods.
Springer.
Knuth, D. (1981). The art of computer programming. Vol. 2: Seminumerical
algorithms. Addison-Wesley.
Knuth, G. (1998). The Art of Computer Programming, Seminumerical Algorithms,
Vol.2 .
L’Ecuyer, P. (1994). Uniform random number generation. Annals of Operations
Research 53, 77–120.
L’Ecuyer, P. (2004). Random number generation. In Handbook of Computational
Statistics: Concepts and Methods, Springer.
L’Ecuyer, P. (2006). Uniform random number generation. In Handbooks in
Operations Research and Management Science, Elsevier.
L’Ecuyer, P., Simard, R., Chen, E. J. & Kelton, W. D. (2002). An
objected-oriented random-number package with many long streams and
substreams. Operations Research 50, 1073–1075. The code in C, C++, Java,
and FORTRAN is available.
Axel Gandy Appendix 64
59. References
References II
Niederreiter, H. (1992). Random number generation and quasi-Monte Carlo
methods. SIAM.
Axel Gandy Appendix 65