4. Utility Functions for Specific Preference 特殊偏好之效用函数 特殊 ...

合集下载

Budget constraint, preference and utility (3)

Budget constraint, preference and utility (3)
U (பைடு நூலகம்x1, x2 ,, xn ) 1x1 2 x2 3 x3
U (TW , TT , C ) 0.147TW 0.0411 2.24C TT
TW=total walking time to and from bus or car TT=total time of trip in minutes
18
Cobb-Douglas Preferences
x2
Utility function:
u( x1, x2 ) x x
x2
x1
c d 1 2
Indifference curves:
u x1
1 d c d
19
Cobb-Douglas Preferences
u( x1, x2 ) x x
15
Perfect Substitutes
x2
Utility function:
u( x1 , x2 ) ax1 bx2
Indifference curves:
u a x2 x1 b b
x1
16
Perfect Complements
Utility function:
x2
U3=3
Bundle (1,1)
u( x1, x 2) 2u( x1, x 2) u( x1, x 2) 4
3 6 -1
(1,0.5)
(0.4,1) (0.8,0.8)
2
1 1
4
2 2
-2
-3 -3
11
In General
If :
u( x1, x 2) represents f (u ) is a positive monotonic transformation [u1 u 2 f (u1) f (u 2)] Then, also f (u( x1, x 2)) represents

中级微观经济学讲义 ch03-E

中级微观经济学讲义 ch03-E
Quantity of y
MU x = ∂U ∂x
• The magnitude of marginal utility depends on the magnitude of utility
• E.g.,if we multiply utility by 2, then the marginal utility would also be multiplied by 2
7
Utility
• Assume that an individual must choose among consumption goods x1, x2,…, xn • The individual’s rankings can be shown by a utility function of the form: utility = U(x1, x2,…, xn; other things)
• used to analyze individuals’ responses to relatively small changes in income and prices
4
Utility
• Given these assumptions, it is possible to show that people are able to rank in order all possible situations from least desirable to most • Economists call this ranking utility
dy MRS = − dx U =U1
y1 y2
U1
x1
x2
Quantity of x
12
Marginal Rate of Substitution

sgmodel软件包用户手册说明书

sgmodel软件包用户手册说明书

Package‘sgmodel’October14,2022Type PackageTitle Solves a Generic Stochastic Growth Model with a RepresentativeAgentVersion0.1.1Author Thomas Vigie<*********************>Maintainer Thomas Vigie<*********************>Description It computes the solutions to a generic stochastic growth model for a given set of user sup-plied parameters.It includesthe solutions to the model,plots of the solution,a summary of the features of the model,a function that covers different types of consump-tion preferences,and a function that computes the moments of a Markov process.Merton,Robert C(1971)<doi:10.1016/0022-0531(71)90038-X>,Tauchen,George(1986)<doi:10.1016/0165-1765(86)90168-0>,Wickham,Hadley(2009,ISBN:978-0-387-98140-6).License GPL-3Encoding UTF-8LazyData trueSuggests knitr,rmarkdown,testthatImports ggplot2,ramify,RtauchenVignetteBuilder knitrRoxygenNote6.0.1NeedsCompilation noRepository CRANDate/Publication2020-02-2712:20:02UTCR topics documented:Markovmoments (2)package_sgmodel (3)plot_sgmod (3)12Markovmoments print.summary_sgmod (4)print_sgmod (5)sgmodel (6)summary_sgmod (8)util (9)Index11 Markovmoments MarkovmomentsDescriptionThe function Markovmoments computes the expectation,variance,autocovariance and autocorrela-tion of a Markov process.UsageMarkovmoments(states,ptm,...)Argumentsstates A numerical vector with the states of the Markov process.ptm The probability transition matrix,a square matrix of dimension length(states) whose columns sum to one....Additional arguments.ValueIt returns a list containing:Expectation The mean of the process.Variance The variance of the process.AutocovarianceThe autocovariance of the process.AutocorrelationThe autocorrelation of the process.Stationary distributionThe stationary distribution of the process,used for the computation of the mo-ments.Examplesa<-c(-1,1)A<-matrix(c(0.5,0.6,0.5,0.4),2,2)Markovmoments(a,A)package_sgmodel3package_sgmodel sgmodel:A package for computating the solutions to a genericstochastic growth model.DescriptionThe sgmodel package provides three important functions:sgmod,util and Markovmoments.The sgmodel functionThe sgmodel function solves a standard stochastic growth model using value function iteration.The stochastic component follows an autoregressive process of order one,and is discretized by afinite state Markov process.The util functionIt computes values for various uility functions encountered in economic theory.The Markovmoments functionIt computes the four moments of afinite state Markov chain:expectation,variance,autocovariance and autocorrelation.plot_sgmod plot_sgmodDescriptionThe function plot_sgmod returns a plot of the Savings value of a sgmodel object on the Capital grid value.Usageplot_sgmod(x,...)Argumentsx A sgmod object....Additional arguments.ValueIt returns a plot using ggplot that graphs the Savings decisions from the sgmodel object on the Capital grid.The plot shows as many facets as length(Z)where Z is the vector of states of the TFP process.4print.summary_sgmodReferencesWickham H(2009),ggplot2:Elegant Graphics for Data Analysis.Examplesmodel<-sgmodel(grid=100,rho=0.2,sigma=0.02)plot_sgmod(model)grid<-200utiltype<-"CRRA"utilparam<-4A<-1depre<-0.03discount<-0.95prod<-0.3states<-5m<-2rho<-0.2sigma<-0.02model<-sgmodel(grid,utiltype,utilparam,A,depre,discount,prod,states,m,rho,sigma) plot_sgmod(model)print.summary_sgmod print.summary_sgmodDescriptionThe function print.summary_sgmod prints a summary for a sgmodel object.Usage##S3method for class summary_sgmodprint(x,...)Argumentsx An object of class sgmod....Additional arguments.ValueIt returns a list with the model parameters.It includes:Utility functionThe type of utility function.See the details of util for the available types Capital share The exponent on capital in the Cobb-Douglas production function.Discount factorThe discount factor used in the model.Depreciation The depreciation rate of capital used in the model.print_sgmod5Rho Autocorrelation of the TFP AR(1)process.Sigma Standard deviation of the white noise in the TFP process.Number of TFP statesNumber of states of the TFP process.Examplesgrid<-200utiltype<-"CRRA"utilparam<-4A<-1depre<-0.03discount<-0.95prod<-0.3states<-3m<-4rho<-0.2sigma<-0.02model<-sgmodel(grid,utiltype,utilparam,A,depre,discount,prod,states,m,rho,sigma) summary_sgmod(model)print_sgmod print_sgmodDescriptionThe function print_sgmod prints results of the sgmodel function.Usageprint_sgmod(x,...)Argumentsx A sgmodel object....Additional arguments.ValueThe function prints the call of the function,the Savings,Consumption and Capital grid vectors from sgmodel.Examplesgrid<-200utiltype<-"CRRA"utilparam<-4A<-1depre<-0.03discount<-0.95prod<-0.3states<-3m<-5rho<-0.2sigma<-0.02model<-sgmodel(grid,utiltype,utilparam,A,depre,discount,prod,states,m,rho,sigma) print_sgmod(model)sgmodel SgmodelDescriptionThe function sgmodel computes the solutions to a generic stochastic growth model after discretizing the distribution of the stochastic element.Usagesgmodel(grid,utiltype,utilparam,A,depre,discount,prod,states,m,rho,sigma,...)Argumentsgrid A numerical value,the number of capital grid points to consider for k(t).Default value set to1000.utiltype The type of preference for the util function.Can be"log","CRRA","CARA", "Cobb-Douglas","CES".See description of util for details.Default type setto"log".utilparam Numerical value,preference parameter for the util function.See description of util for details.Default set to1.A Numerical value,preference parameter for the util function.See descriptionof util for details.Default set to1.depre Numerical value for the depreciation parameter.Must be between0and1.De-fault value set to1.discount Numerical value for the discount factor.Must be(strictly)between0and1.Default value set to0.95.prod Numerical value for the Cobb-Douglas production function.Must be(strictly) between0and1.Default value set to0.3.states umerical value for the number of states of the Markov process approximating the TFP process.Default value set to2.m Numerical value for the Rtauchen function.See description of Rtauchen for details.Default value set to3.rho Autocorrelation of the TFP AR(1)process,used to approximate the process witha Markov process.sigma Standard deviation of the white noise in the TFP process,used to approximate the process with a Markov process....Additional arguments.ValueThe function returns a list containing:Capital grid Vector of values for capital.Savings Vector of size(grid x States)indicating which coordinates of the capital grid are the optimal savings decision.Consumption Vector of size(grid x States)indicating the optimal consumption decisions us-ing the optimal savings decision,and given the capital level of the correspondingcoordinate of Capital grid.Z States of the TFP process.PTM The probability transition matrix of the process.Production parameterThe exponent on capital in the Cobb-Douglas production function.Utility type The type of utility function.See the details of"util"for the available types Discount factorThe discount factor used in the model.Depreciation The depreciation rate of capital used in the model.Rho Autocorrelation of the TFP AR(1)process.Sigma Standard deviation of the white noise in the TFP process.ReferencesTauchen G(1986),Finite state markov-chain approximations to univariate and vector autoregres-sions.Economics letters,20(2),177–181.Merton R.C(1971),Optimum consumption and portfolio rules in a continuous-time model.Journal of Economic Theory,3(4),373–413.URL /science/article/ pii/002205317190038XExamplesmodel<-sgmodel(grid=100,rho=0.2,sigma=0.02)grid<-200utiltype<-"CRRA"8summary_sgmod utilparam<-4A<-1depre<-0.03discount<-0.95prod<-0.3states<-5m<-10rho<-0.2sigma<-0.02model<-sgmodel(grid,utiltype,utilparam,A,depre,discount,prod,states,m,rho,sigma) summary_sgmod summary_sgmodDescriptionThe function summary_sgmod prints a summary for results of the sgmodel function.Usagesummary_sgmod(object,...)Argumentsobject A sgmodel object....Additional arguments.ValueIt returns a list with the model parameters.It includes:Utility functionThe type of utility function.See the details of util for the available types Capital share The exponent on capital in the Cobb-Douglas production function.Discount factorThe discount factor used in the model.Depreciation The depreciation rate of capital used in the model.Rho Autocorrelation of the TFP AR(1)process.Sigma Standard deviation of the white noise in the TFP process.Number of TFP statesNumber of states of the TFP process.util9Examplesgrid<-200utiltype<-"CRRA"utilparam<-4A<-1depre<-0.03discount<-0.95prod<-0.3states<-3m<-3rho<-0.2sigma<-0.02model<-sgmodel(grid,utiltype,utilparam,A,depre,discount,prod,states,m,rho,sigma) summary_sgmod(model)util UtilDescriptionThe function util computes values for different types of utility functions and different parameters.See sgmodel_vignette for detailed functional forms.Usageutil(x,A,prefparam,type=c("log","CRRA","CARA","Cobb-Douglas","CES"), ngoods,...)Argumentsx A numeric vector of length ngoods with values to compute utility for.A A numerical value that will premultiply the utility function.Default value set to1.prefparam A numerical value,the preference parameter applied to the utility function de-pending on type.type A character for the Type of utility function.Can be"log","CRRA","CARA", "Cobb-Douglas","CES".Default type set to"log".ngoods Numerical value for the number of goods to consider.Default value set to1....Additional arguments.ValueA numerical value,the utility function evaluated at the arguments.10utilReferencesMerton R.C(1971),Optimum consumption and portfolio rules in a continuous-time model.Journal of Economic Theory,3(4),373–413.URL /science/article/ pii/002205317190038X.Examplesx<-c(exp(1),exp(1))A<-2type<-"log"ngoods<-2util(x=x,A=A,type=type,ngoods=ngoods)IndexMarkovmoments,2package_sgmodel,3package_sgmodel-package(package_sgmodel),3plot_sgmod,3print.summary_sgmod,4print_sgmod,5sgmodel,6summary_sgmod,8util,911。

Lesson 4 Electronic feul injection system 电控燃油喷射系统

Lesson 4 Electronic feul injection system 电控燃油喷射系统
AUTOMOBILE ENGLISH 汽车专业英语
Unit 2 Engines Lesson 4 Electronic fuel injection system
电控燃油喷射系统
electronic injection sensor detect be divided into subsystem induction consist of air cleaner assembly throttle
New words & expressions
Tasks before class
Reading & speaking
Tasks in class
电控燃油喷射系统使用多个传感器来检测发动机状况和汽车的运行状 况。电控燃油喷射系统可分为三个子系统:
(1)空气供给系统。空气供给系统由空气滤清器总成、节气门体和 进气歧管组成。节气门体包含节流阀,通过驾驶员的操作,节流阀会打开 和关闭,从而控制进入进气歧管的空气量。
system 3__t_h_r_o_tt_l_e_b_o_d_y__ contains the throttle valve.
Fuel delivery system
The fuel delivery system provides the fuel mixing with the 4_____a_ir_. The fuel is taken from the fuel 5________tabnykthe fuel 6_______p_u. mThpen it is 7____s_p_r_a_y_ed_ under pressure by an injector. Any fuel which is not used is returned to the tank through the 8___f_u_e_l_r_e_t_u_r_n_l_in_e_.

Utility for Caching Metafile Renditions For Matrix

Utility for Caching Metafile Renditions For Matrix

Utility for Caching Metafile Renditions For MatrixTable of Contents Introduction (3)How does it work? (3)What is a metafile? (3)Supported Document Formats for Metafile Renditions (3)Steps for Creating Metafiles (4)i.For Files with XREFs (3D Assemblies or 2D files with XREFs) (4)ii.For all other files (4)Architecture (5)Administrator Guide (6)System Requirements (6)Installation (6)Manual Setup (7)Starting the Utility (9)Configuration (10)Setting Trigger Mechanisms in Matrix (10)i.On-Demand Mechanism (10)ii.Event-Based Mechanism (11)Enabling Icon Mail for Matrix Users (15)Feedback (16)General Inquiries (16)Sales Inquiries (16)Customer Support (16)IntroductionMetafile Utility uses the AutoVue server as a rendition tool to generate and check metafiles into the Matrix Product Data Management system (Matrix PDM). Once a metafile rendition is added to the native document, the next time the file is viewed in the AutoVue client, the AutoVue server fetches the metafile rendition instead of the native file.How does it work?Here is a brief description of how the utility handles requests for creating metafile renditions:1. The client application sends the rendition request to the PDM server.The actual request dispatched by the client depends on the triggering mechanism, which can be configured on the PDM server side. Examples of triggering mechanisms include check-in, promotion, or on-demand actions.2. The Server stores the request in a special queue item.Each queue item represents a request made by a client to generate a metafile rendition of the native file.3. The utility polls the queue items from the PDM at predefined intervals, and retrieves any pending requests.4. The utility sends relevant information of each request to the AutoVue server to generate the metafile rendition.5. The utility asks AutoVue server to check-in the metafile rendition to the PDM.The AutoVue server in turn passes the request to VueLink to add the metafile as a rendition to the nativedocument object in the PDM.What is a metafile?A metafile is a true replica of the original file. It is a lightweight format developed by Cimmetry. Its main advantage is performance enhancement of document viewing on the client side.Supported Document Formats for Metafile RenditionsThe utility generates metafile renditions for all Engineering and Vector formats that are supported by AutoVue Client-Server Edition. Currently, AutoVue Client-Server Edition supports many file formats, including 2D engineering drawings and 3D assemblies.Steps for Creating MetafilesFor Files with XREFs (3D Assemblies or 2D files with XREFs)Special care is given when creating a metafile for files with XREFs. For the utility to properly generate a metafile for a particular file, follow these steps:1. Launch the Matrix client application and login.2. Check in all the XREFs and the assembly, then define the relationship between the master file and the XREFs.3. If the On-Demand trigger mechanism is setup, select the Assembly business object, right-click and selectExecute > csiCreateQueueItemOnDemand from the popup menu.4. If the Event-Based trigger mechanism is setup, check out the Assembly and check it back into Matrix.For All Other FilesIf the Event-Based trigger mechanism is setup, the metafile request is generated as soon as the file is checked into Matrix.ArchitectureWhenever a predefined event occurs, such as a file check-in for example, Matrix invokes a server-side custom program called csiCreateQueueItem, which creates a custom object inside a Matrix vault. This custom object represents a unique Rendition Request.Meanwhile, a polling application retrieves these queue items from Matrix, using API provided by VueLink, extracts information from the QueueItem to identify the checked-in document. This information is added to an internal Queue, which is polled by a QueueReader. Each entry retrieved by the QueueReader is then dispatched to the AutoVue Client-Server Edition server using Vuebean API. Thereafter, the metafile is created and checked into Matrix by the AutoVue Client-Server Edition server, which interacts with VueLink for Matrix for this purpose. The status of the rendition, whether it is “Errored” or “Successful” is then sent back to the user by the Polling Application using Matrix Icon Mail.The Polling Application and the QueueReader run asynchronously, leading to greater efficiency.Administrator GuideSystem RequirementsThe utility itself is a Java application program and therefore can be run on any platform equipped with Java Virtual Machine (JVM).The following software must already be installed on the machine hosting this utility:•Sun's Java Runtime Environment (JRE) 1.4.2 or higher•Matrix Thick Client Applications v10.7- At least the MQL Application.The following software must also be available for the utility to work but may be installed on a different machine than the one hosting the utility:•AutoVue Client-Server Edition v19.1 (or any SP of v19.1)•Matrix Collaboration Kernel 10.7•VueLink for Matrix v19.1•Matrix Application Exchange Framework AEF 10.7•Matrix Engineering Central or Designer Central 10.7InstallationMetafile utility requires the AutoVue Server and VueLink. Before installing Metafile Utility with Matrix, make sure that Matrix, AutoVue Client-Server Edition, and VueLink for Matrix are properly installed and configured on your system, according to the manufacturer’s instructions, and are operating correctly.To install the utility for caching metafiles for Matrix, complete the steps outlined in the following sections:•Manual Setup•Setting Trigger Mechanism in Matrix•Enabling Icon Mail for Matrix Users•Starting the UtilityManual SetupTake the following steps to install Metafile Caching Utility manually. If you installed Metafile Caching Utility during the automatic installation of VueLink, skip the following steps.1. Create a folder called /cimmetry/metafile_utility. For example: c:/program files/cimmetry/metafile_utility2. Copy the content of the ‘metafile_utility’ folder found on the distribution CD to the folder created in previousstep.3. In the /metafile_utility/bin folder, open ‘run.bat’ in a text editor and modify the following settings:JDK_DIR Full path to the root folder where Sun’s JRE is installed. Example: c:\jdk1.3.1JARDIR Full path to the folder that contains metafile.jar along with other JAR files.PASSWORD Password of a valid Matrix account with administrative privileges.MX_CLIENT_JAR There are two entries in run.bat. You need to uncomment one entry only based onversion of Matrix you have installed. If you are using Matrix v9.5.2.0+,eMatrixServletRMI.jar should be in the classpath. Otherwise,eMatrixAppletDownloadXML.jar should be in the classpath.If you are using RIP mode, use full path to eMatrixAppletXML.jar instead ofeMatrixServletRMI.jar.Note:By default, the csiqcmatrix.properties file is located under same folder as metafile.jar. If this file is moved to another location, then you need to set the full path to PROPFILE.PROPFILE Full path to csiqcmatrix.properties file.4. In the /metafile_utility/bin folder, open the ‘csiqcmatrix.properties’ file in a text editor and modify thefollowing settings:JVUE_HOST The host server Name or IP where AutoVue Client-Server Edition Server isrunning.JVUE_PORT The Port Number to which AutoVue Client-Server Edition Server is listening. Bydefault, this value is 5099.MAX_THREADS For each request for rendition, the utility creates a new thread (process) thatinteracts with the AutoVue Server to perform the rendition as well as the check-in ofthe metafile. The maximum number of such threads that the polling client can runsimultaneously can be configured here. Increasing this number leads to quickerrendition because more files can be rendered at the same time. But it also leads toa greater load on the machine hosting this utility as well as the machine hostingAutoVue Server. This number cannot exceed the number of seats procured forAutoVue Client-Server Edition Server. For example, if you are running AutoVueClient-Server Edition server with a 50-user license, then the value supplied in thistext field may never exceed 50.QUEUE_CLIENT_PROP Full Path to csimfmatrix.properties properties file.5. In the /metafile_utility/bin folder, open ‘csimfmatrix.properties’ file in a text editor and modify the followingsettings:MX_HOST The host server Name or IP where the Application Server (e.g. Weblogic) hostingMatrix Thin Client applications is running.MX_PORT Any Matrix Thin Client installation needs a Webserver to be the point of entry for allrequests. The Webserver then transfers requests to the underlying application server.For example, when the Weblogic server is installed, it comes with a default Webserverthat listens to port 7001 by default and transfers all requests to Weblogic.The value supplied in this text field should be the port number to which the Webserver islistening.MX_CONNECT Matrix Collaboration Kernel type. RIP,RMI or EJB. Default is RIP.If using RIP mode, input MX_CONNECT is APPSERVER.MX_RMIPORT Port number if Matrix RMI server is used. Default is 1099.MX_USER Name of valid Matrix user with Administrative Privileges to Application Centrals.Default is Test Everything. The utility needs to sign into Matrix to access RenditionRequests. This user ID should have permissions to read and modify Business Objectsof type csiQueueItem. It should also have permissions to send icon mail notifications tousers about the status of their rendition requests.MX_VAULT Matrix vault name, which contains all the csiQueueItems. Care should be taken toensure that this is the same Vault that contains VueLink for Matrix specific businessobjects.MX_CSI_CONFIG This object (Cimmetry Configuration Business Object) is created whenVueLink for Matrix is installed. It contains all the required meta-data for VueLinkfunctionality. Since this utility depends on VueLink to function (please refer to thearchitecture diagram), the object name specified here should be accurate. CODEBASE Web path to the client file specified above (MX_CLIENT_JAR), with web app contextname. Example: /ematrix/WebClient/java/classesMX_FILEURL Web path to MxAutoVue servlet. Example: /ematrix/servlet/MxAutoVueServletMX_SVLT Web path to VueLink servlet. Example: /ematrix/com.cimmetry.vuelink.matrix.DMS6. In a text editor, open ‘schemaCreateBC.txt’ file found under /metafile_utility/bin folder and modify thefollowing settings:context_user Replace "__USER__" with the name of valid Matrix user who has administrativeprivileges. Default is creator.context_password Replace "__ PASSWORD __" with the password of valid Matrix user who hasadministrative privileges. Default is empty.context_vault Replace "__VAULT__” with Matrix Vault name.store_name Replace "__STORE__" with Matrix Store name.7. Launch Matrix MQL Application (mql.exe) and run the script contained in ‘schemaCreateBC.txt’ file. Forexample, at MQL prompt, type run c:/temp/schemaCreateBC.txt.Starting the UtilityInvoke ‘run.bat’ from the command line. It asks you for a password. Enter a password that belongs to a valid Matrix user who has administrative privileges.Make sure that Application Server (Weblogic or WebSphere) is running before invoking ‘run.bat’.ConfigurationSetting Trigger Mechanisms in MatrixMetafile Utility for Matrix takes advantage of the event mechanism provided by Matrix. Two kinds of triggering mechanisms are employed with Metafile Utility:The On-Demand (explicit) mechanism, metafile request is implemented with Matrix Thick-client. The user can initiate a metafile request when needed. The metafile Utility takes care of that request and creates the metafile.Note:• The On-Demand mechanism is recommended for files with XREFs.The Event-based (implicit) mechanism, the triggering method is involved with registering with a particular event such as the check-in event. That means once a document is checked in, an event, which is defined by Matrix is fired which invokes ‘csiCreateQueueItem’ program.Note:• The Event-Based mechanism is recommended for files without XREFs.On-Demand MechanismThe script file creates a program called ‘csiCreateQueueItemOnDemand’ within Matrix. This program functions exactly like the program “csiCreateQueueItem”. The difference is that “csiCreateQueueItem” is meant to be associated with Business Objects as a trigger while this program is to be associated with Business Objects as a method. The administrator may also associate the program “csiCreateQueueItem” with Business Object types other than CAD Model.1. Run Matrix Business application (eg.: business.exe).2. Open the Matrix CAD Model type in edit mode.3. In the Edit window that appears, click the Methods tab.4. Click Add.5. Type “csiCreateQueueItemOnDemand” in the Name field.6. Click Ok.Event-Based Mechanismii-1 csiCreateQueueItemThe script file creates a program called csiCreateQueueItem in Matrix. When invoked, this program creates a Business Object, which represents a request for Metafile Rendition. You can set the ‘Check-in’ trigger on CAD Model Business Objects to invoke this program. You can choose to associate the program with any other trigger.In addition to this, you can also associate the csiCreateQueueItem program with Business Object types other than CAD Model.1. Run Matrix Business application (eg.: business.exe).2. Open the Matrix CAD Model type in edit mode.3. In the Edit window that appears, click the Triggers tab.4. If the trigger you want is not in the list, click Add, then double-click the desired trigger.5. In the Edit Trigger window that appears, type the program name, i.e. csiCreateQueueItem, in the Action textfield.ii-2 csiCreateQueueItemMeetingThe script file creates a program called “csiCreateQueueItemMeeting” in Matrix. When invoked, this program creates a Business Object, which represents a request for Metafile Rendition. You can set the Create trigger on MeetingAttachment Relationship Business Objects to invoke this program. You can choose to associate the program with any other trigger.In addition to this, you can also associate the “csiCreateQueueItemMeeting” program with Business Object types other than MeetingAttachment.6. Run Matrix Business application (eg.: business.exe).7. Open the Matrix MeetingAttachment type in edit mode.8. In the Edit window that appears, click the Triggers tab.9. If the trigger you want is not in the list, click Add, then double-click the desired trigger.10. In the Edit Trigger window that appears, type the program name, i.e. csiCreateQueueItemMeeting, in the Actiontext field.11- Make sure the Meeting Attachments relationship is from Type Meeting to Type DOCUMENTS as well. In this case, the trigger would act on any type of document that is derived from type DOCUMENTS successfully.Enabling Icon Mail for Matrix UsersOnce the utility is installed successfully, you need to enable icon Mail for all users who will be creating Rendition Requests. This is needed because the utility relies on icon mail to send notification to users about the status of their requests.1. Run the Matrix Business application (eg.: business.exe).2. Select Object > Find from main menu.3. Select Person from the Object list, then click Find.4. From the search result, select the user who needs icon mail enabling.5. Select Object > Open > Edit from main menu.6. In the Edit window that appears, make sure the Icon Mail box is checked.FeedbackCimmetry System products are designed according to your needs. We would appreciate your feedback, comments and suggestions. We can be contacted by fax, e-mail or telephone. There is a feedback button on our Web page that activates an easy-to-use feedback form. Let us know what you think!General InquiriesTelephone: +1 514-735-3219Fax: (514) 735-6440E-mail: *****************Website: Sales InquiriesTelephone: +1 514-735-3219 or 1-800-361-1904Fax: (514) 735-6440E-mail: ******************Customer SupportTelephone: +1 514-735-9941Website: http://support。

1 Demand and prices under Dixit-Stiglitz preferences 2 Scale

1 Demand and prices under Dixit-Stiglitz preferences 2 Scale

1. Write the consumer’s utility maximization and derive the first-order conditions.
2. Use the first order conditions associated with two distinct varieties to derive relative consumption. Interpretation.
2 Scale economies, Product differentiation and the Pattern of Trade (Krugman, 1980)
Motivation: Develop a model with economies of scale, product differentiation and imperfect competition explaining the pattern of international trade, notably the prevalence of intra-sectorial trade among the industrial countries.
than the potential range of products.
There are L individuals in the economy, each endowed with one unit of labor. In equilibrium, individual
expenditure is thus equal to the wage rate. Labor is the only factor of production. The agricultural
1. Discuss the properties of the technological function in the manufacturing sector.

Tsinghua Micro Ch4 Utility 效用 《微观经济学》

Tsinghua Micro Ch4 Utility 效用 《微观经济学》

Perfect Complementarity
Indifference Curves
x2 45o
W(x1,x2) = min{x1,x2}
8
min{x1,x2} = 8
5
min{x1,x2} = 5
3
min{x1,x2} = 3
35 8
x1
Perfect Complementarity
Indifference Curves
Utility Units of function water are bads
x’
Water
Around x’ units, a little extra water is a neutral.
Some Other Utility Functions and Their Indifference Curves
And xU2dx2xU1dx1
rearranged is
ddxx12U U//xx12.
This is the MRS.
Marg. Rates-of-Substitution for Quasi-linear Utility Functions
A quasi-linear utility function is of the
x2
Each curve is a vertically shifted
copy of the others.
x1
Some Other Utility Functions and Their Indifference Curves
Any utility function of the form
U(x1,x2) = x1a x2b
A preference relation that is complete, reflexive, transitive can be represented by a utility function.

RightNow 客户支持首页和意图指南可用性计算说明书

RightNow 客户支持首页和意图指南可用性计算说明书

DEFINITIONS, PROCESSES AND PROCEDURES1. DEFINITIONS“Availability” means the number of minutes in a calendar quarter that Customer‟s Support Home Page or Intent Guide is available fornormal business use by end users, expressed as a percentage of the total number of minutes in a quarter after subtracting the following from the total minutes: (i) minutes of outage during the quarter for maintenance performed by RightNow (up to a maximum of 20 hoursper year) for which Customer received at least twenty four (24) hours advance notice; (ii) minutes of outage during upgrades; (iii) minutesof outage during any interruption caused by a failure of the Internet, the telephone or the power supply; and (iv) minutes of outage caused by force majeure.If an outage of Customer‟s Support Home Page or Intent Guide is caused by the same event, the minutes of outage of that event will not be counted twice when calculating Availability.“Business Day” means the 24 hour period for each day of the week excluding Saturday and Sunday, with the Business Day for Monday commencing at 12:00AM Monday and the Business Day for Friday ending12:00AM Saturday. Customer may choose to start its Business Day in one of seven time zones that are supported by RightNow. Supported time zones are GMT, GMT (+1), GMT -5 (EST), GMT -6 (CST), GMT -7 (MST), GMT -8 (PST), GMT +9 (Tokyo), and GMT +11 (Sydney, Australia). All supported time zones will observe daylight savings time shifts as appropriate for the local area.“Premium Care Account Specialist” (PCAS)”is a technically oriented project manager working in RightNow‟s Customer Care organization. The PCAS will provide accountability, internal customer advocacy, and customer focused management across departments in order to provide a holistic management structure for top accounts. The PCAS will be designated to support multiple accounts as a shared resource.PCAS‟ responsibilities limited to:–Proactively assess Customer impact of all delivery functions.–Monitor Incident traffic to ensure commitments are met and appropriate resources are dedicated to issues based on severity.–Coordinate cross-functional teams for unscheduled work.–Ensure on-time delivery of RightNow commitments to Customer.PCAS‟ roles limited to:–Customer LiaisonPersonal relationship with CustomerHolds Customer accountableDrives RCA process to make both organizations strongerProactively communicate software upgrades/updates and benefits with an appreciation for Customer‟sbusiness environment.–Internal Voice of CustomerHolds RightNow accountableEnsures smooth transition of delivery activities inside RightNowInvolved in / aware of change managementQueue Monitoring / Management–Escalation / event managerCross functional issue resolutionSingle point of escalation internally and externally“Email Support” allows the support contact to submit Incidents initially via the support page at . Once submitted,further correspondence by the submitter on a given Incident may be conducted via email or via updates to the Incident via the supportpage at . Incidents may not be initially submitted via email.“Incident” means any request for technical assistance submitted to the RightNow Customer Care team. Technical assistance includesbut is not limited to diagnosis of error messages, assistance with application crash or installation issues and application troubleshooting. Incidents that RightNow determines to be a result of a defect in the RightNow product or a hosting outage will be excluded from Customer‟s number of Incidents. Technical assistance excludes training, customizations, business requirements analysis, and configuration assistance (other than answering …how to” questions related to configuration). RightNow Customer Care will rout e those requests to the appropriate RightNow resource.“Intent Guide” means the Software application to enable organizations to engage with consumers online, to understand their intent andguide them to high value interactions.“Service Level Credit” means an amount equal to 50% of the quarterly price paid by Customer for Preferred Customer Care (PREF-CCP) or Premier Customer Care (PREM-CCP).“Service Level Credit Threshold” means a percentage Availability below which Service Level Credits are payable.“Severity Level 1” means the production use of the solution has stopped, or application performance has been so severely impactedthat work cannot reasonably continue. Examples of Severity Level 1 include:The end-user pages are inaccessible from the InternetAll or the majority of agents are unable to access the administrative console for their job functionA service channel (e.g. e-mail, voice, chat) is not functioningAccess to core functionality within a console is so impaired that agents cannot work (e.g. Analytics does not work, Marketingcampaigns cannot be launched, critical views not populating, all rules not functioning)“Severity Level 2” means important product features are unavailable with no acceptable workaround. Production use of the solution is continuing; however, there is a serious impact on productivity or service levels. Examples of Severity Level 2 include: An integrated custom tab is failing, causing agents to access the integrated data from another application, thereby slowingdown response time substantiallyOne or a small percentage of agents are consistently unable to access the agent desktopAn issue is causing properly constructed rules to fail causing agents to manually route incidentsAn issue is causing deflection rates to decrease substantially“Severity Level 3” means important product features are unavailable but a workaround is available, or less significant product features are unavailable with no reasonable workaround. Work has a minor loss of operational functionality, or implementation resources. Examples of Severity Level 3 include:Agedatabase utility is behind causing some cached reports to display incomplete data setsODBC Replication is behindA small percentage of agent workstations are experiencing periodic errorsBold tags are not rendered properly in answers“Severity Level 4” means requests for information (how to), enhancements or documentation clarification regarding the product, but there is no impact on daily operation of the solution. The implementation or production use of the solution is continuing and there is no work being impeded at the time. Examples of Severity Level 4 include:An application message is misspelledA request for a new featureA single, non-reproducible application crashHow to configure or set up features in the product“Support Home Page” means the entry page on the end-user interface in RightNow Service that contains links leading to main functions.2. PROCESSES AND PROCEDURESIncident Handling: Incidents are assigned a severity level according to impact on Customer‟s business. The severity level definitions above are used to assess the situation and properly classify the issue for handling.If an Incident is submitted with a specific severity level and it does not meet the criteria for the severity level specified,RightNow will reclassify the Incident to the appropriate severity level and notify Customer.Once RightNow Technologies determines that the root cause of any outage or impact lies outside of RightNow‟s ability tocontrol, the Incident will be considered solved or the severity will be reduced to a more appropriate level. Examples of rootcauses outside of RightNow‟s control:✓Location where the affected agents reside is unable to get to the Internet in general✓Redirect from Customer site to the domain is failing on the Customer‟s site✓ A routing or Internet outage outside the infrastructure of RightNow‟s upstream providers✓Customer‟s network is not configured to allow proper execution of the solution -proxy servers, firewall, available bandwidth, packet shaping, etc (See Environmental Configuration Guide for requirements:/app/answers/detail/a_id/2364/kw/configuration%20guide/p/%20/r_id/218805)Hosting Availability Monitoring and Measurement:Availability is monitored on calendar quartersIf previous quarter‟s Availability was below the Service Level Credit Threshold specified in Customer‟s support package, andCustomer has purchased either the Preferred Customer Care Package (PREF-CCP) or Premier Customer Care Package(PREM-CCP), one Service Level Credit will be offered for that quarter.Payment of Service Level Credits:If Customer is entitled to Service Level Credit for the previous quarter, Customer will be notified via an incident by the 15th dayof the first month in the next quarterCustomer can elect to apply credit against monies owed to RightNow for Hosting Services or receive a cash paymentCredit will be issued to Customer within 30 days of receiving the incident notificationCustomer will be able to receive a maximum of one (1) Service Level Credit per quarterService Level Credits are payable only (a) if Customer has purchased either the Preferred Customer Care Package (PREF-CCP) or Premier Customer Care Package (PREM-CCP); and (b) when Hosting Availability falls below the Service Level Credit Threshold. No Service Level Credits are payable in any other circumstance, including failure to meet Customer Care Service Level Objectives.Upgrade and Test sites: It is a general principle that we do not accept Severity Level 1 for these types of non-production sites. Exceptions to this principle, which need to be explicitly stated during Incident submittal, include:If the issue found on the upgrade site is going to negatively impact or cause the cut over to fail or become a high severity issuein productionIf Customer has integrated test sites into their production environment to facilitate their business processes then the test sites need to be treated as production sites.The Technical Migration Manager (TMM)will direct the Customer to the SmartConversion guide, Release Notes,Workstation / System RequirementsConsultation, coaching or training aroundnew features and functionalityConfiguration of new features orfunctionalityThe customer can submit incidents toCustomer Care and they will be routed tothe TMM accordingly.Examples of incidents would be: timeline,UAT, cutover, next steps, etc.Incidents submitted as a result of theupgrade will count against the 12 allottedincidents per year for Customers with theBasic Customer Care Package.Phone Support is excluded for Basic andSelf-Service customers.Product related questions such as “howto configure a new feature”.The TMM will present a kick offPowerPoint presentation to discuss theupgrade process and next steps.Support package SLOs apply. Customerswith the Basic Customer Care Packagecannot exceed the 12 severity level 2, 3,and 4 incidents allowed per year.Post-cutover incidents are to be submittedwithin 30 days after upgrade.Management of non-upgrade relatedissues.Management of incidents submitted forup to 30 days post-cutover.RightNow may choose not to migrate acustomer to a managed framework.If RightNow chooses to migratecustomizations as part of the upgrade,RightNow will migrate customizationswritten only by RightNow ProfessionalServices to obtain a …like for like‟functionality in the new version.“Like for like” does not mean “e xact” lookand feel, but will have similar functionality.Look and feel migration may not have thesame look and feel if moving from oneend-user framework to another.RightNow will build test cases for allcustomizations written by RightNowProfessional Services and execute qualityassurance around those test cases.Exact duplication of look and feel whenmoving from one framework to another.Implementation or configuration of newfeatures or functionality.Core functionality testing.Formal requirements or test plandocuments.Updates to managed frameworkcustomizations.Customizations on unsupportedplatforms.Upgrade-related incidents will bemonitored by the TMM post cutover for 30days.Product related or customization relatedincidents qualify under this deliverable.All support before, during and after thecutover will be provided remotely.Training, coaching, configuration typequestions or issues.。

Software Specification

Software Specification

Table of Contents1.SCOPE OF THIS DOCUMENT (3)2.SOFTWARE SAFETY REQUIREMENTS (3)2.1.S AFETY-R ELATED F UNCTIONS TO BE I MPLEMENTED (4)2.1.1Functions Related to the Application (4)2.1.2Functions Related to Software or Hardware Faults (4)2.1.3Control Response(s) in Case of Detected Fault/Error (7)2.2.I NTERFACES B ETWEEN S OFTWARE AND H ARDWARE (7)2.3.I NTERFACES B ETWEEN S AFETY AND N ON-S AFETY R ELATED F UNCTIONS (8)3.SOFTWARE ARCHITECTURE (8)3.1.T ECHNIQUES AND M EASURES TO C ONTROL S OFTWARE F AULTS/E RRORS (8)3.2.I NTERACTIONS B ETWEEN H ARDWARE AND S OFTWARE (8)3.3.P ARTITIONING I NTO M ODULES AND A LLOCATION TO S PECIFIED S AFETY F UNCTIONS (8)3.4.H IERARCHY AND C ALL S TRUCTURE OF THE M ODULES (C ONTROL F LOW) (9)3.5.I NTERRUPT H ANDLING (9)3.6.D ATA F LOW AND R ESTRICTIONS ON D ATA A CCESS (9)3.7.A RCHITECTURE AND S TORAGE OF D ATA (9)3.8.T IME-BASED D EPENDENCIES OF S EQUENCES AND D ATA (9)4.MODULE DESIGN AND CODING (9)4.1.M ODULE:<MODULE NAME> (10)4.1.1Functions (10)4.1.2Interfaces to Other Modules (10)4.1.3Data (10)4.2.M ODULE:<MODULE NAME> (10)4.2.1Functions (10)4.2.2Interfaces to Other Modules (10)4.2.3Data (10)4.3.M ODULE:<MODULE NAME> (11)4.3.1Functions (11)4.3.2Interfaces to Other Modules (11)4.3.3Data (11)1. Scope of This DocumentThe scope of this document, per UL 60730-1 Clause H.11.12.3.2, is to specify the requirements, architecture, and module design and coding for the safety-related software in the subject product. The Software Specification serves as the left-hand side of the “V” in the V-Model as shown in UL 60730-1 Figure H.1 (reproduced below):UL 60730-1 Figure H.1***As specified in UL 60730-1, the V-Model is a recommended – not required – life cycle, and other methods can be used if they incorporate disciplined and structured processes including design and test phases.***2. Software Safety RequirementsThe requirements for the safety-related software in terms of the software safety functions are specified below. The requirements also include the Software Fault Analysis specified in H.7 Table 1, Requirement 68, including identification of safety-related data and segments of the software sequence and measures provided to address faults/errors in Table H.1.The Software Safety Requirements (H.11.12.3.2.1) have the following relationships as defined in UL 60730-1 Figure H.1:•Input: System Safety Requirements Specification (outside the scope of this Standard)•Output/Verified Against: Software Architecture (H.11.12.3.2.2)•Validated By: Software Validation Testing (H.11.12.3.3.3)2.1. Safety-Related Functions to be Implemented2.1.1 Functions Related to the Application2.1.1.1.*** Each safety-related function related to the application should be describedhere in this list. Included in this description should be the required Software Class,any critical threshold(s) for determining correct performance of the function, andthe required response time(s). Verbiage used should be deterministic and testablein nature by using such terms as “shall”. For example: “The software shall detectand respond to an overload condition of the motor based on current consumption.If the current exceeds 10 A for a duration of 10 seconds, the software shallimmediately cease motor operation. This function shall comply with SoftwareClass B requirements.” ***2.1.1.2.2.1.1.3.2.1.2 Functions Related to Software or Hardware Faults***Based on the required Software Class, the appropriate version of Table H.1 should be included and filled out below, with reference to the provided measure(s) (see Table H.1 for examples of acceptable measures) and the corresponding requirement number(s) in the Software Safety Requirements Specification. The unused table can be deleted.******The required software class(es) [A, B, and/or C] and implemented software structures [single-channel with functional test, single-channel with periodic self-test, dual-channel without comparison, single-channel with periodic self-test and monitoring, dual-channel (homogeneous) with comparison, dual-channel (diverse) with comparison, or other] shall be defined/declared here per Table 1 requirements 69 and 70.******Use the following table for Software Class B******Use the following table for Software Class C******If any of the referenced requirements to address software or hardware faults do not match the definition of one of the examples of acceptable measures listed in Table H.1, additional rationale should be provided here to show that the measure(s) implemented fully address the defined fault/errors described in Table H.1.***2.1.3 Control Response(s) in Case of Detected Fault/Error***The software fault/error detection time(s) and control response(s) in case of detectedfault/error shall be declared here per UL 60730-1 Table 1, requirements 71 and 72.***2.2. Interfaces Between Software and Hardware2.2.1.*** Description(s) of interfaces between software and hardware should beincluded here in this list. This potentially includes, but is not limited to, theprogrammable component itself (e.g. microcontroller, DSP, etc.) and its internaland external peripherals such as clocks, memories, external communications,digital I/O, analog I/O including A/D converters, D/A converters, and analogmultiplexers, monitoring devices and comparators such as watchdog timers,voltage regulating devices, etc., custom ICs such as FPGAs, ASICs, etc., userinterfaces, sensors such as temperature or current-sensing devices, and actuatorssuch as relays and transistors used to perform the safety-related functions.***2.2.2.2.2.3.2.3. Interfaces Between Safety and Non-Safety Related Functions2.3.1.*** Identification of and description(s) of interfaces between safety and non-safety related functions should be included here in this list. This potentiallyincludes, but is not limited to, a description of the partitioning concepts used inthe software, e.g. separation of functions into logical and/or physical segments,the information exchanged and shared between functions, and any measures thathave been put into place to ensure, per Table 1, footnote 12, that the non-safetyrelated segments do not influence the safety-related segments.***2.3.2.2.3.3.3. Software ArchitectureThe software architecture is specified below.The Software Architecture (H.11.12.3.2.2) has the following relationships as defined in UL 60730-1 Figure H.1:•Input: System Architecture Specification (outside the scope of this Standard)•Input/Verified Against: Software Safety Requirements (H.11.12.3.2.1)•Output/Verified Against: Module Design and Coding (H.11.12.3.2.3)•Tested By: Software Integration Testing (H.11.12.3.3.2)3.1. Techniques and Measures to Control Software Faults/Errors***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.2. Interactions Between Hardware and Software***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.3. Partitioning Into Modules and Allocation to Specified Safety Functions***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.4. Hierarchy and Call Structure of the Modules (Control Flow)***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.5. Interrupt Handling***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.6. Data Flow and Restrictions on Data Access***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.7. Architecture and Storage of Data***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***3.8. Time-based Dependencies of Sequences and Data***A description at a high level – for example, block diagram, flow chart, etc. should be provided here. Some of these sections can be combined as long as all sections have been addressed one way or another.***4. Module Design and CodingThe module design and coding of the software is specified below. It also includes the Software Sequence Documentation (Clause H.7, Table 1, requirement 66) and Programme Documentation (Clause H.7, Table 1, requirement 67).The Module Design and Coding (H.11.12.3.2.3) have the following relationships as defined in UL 60730-1 Figure H.1:•Input/Verified Against: Software Architecture (H.11.12.3.2.2)•Output/Verified Against: Source Code Implementation•Tested By: Module Design Testing (H.11.12.3.3.1)4.1. Module: <MODULE NAME>4.1.1 Functions***A detailed description of each function in this module, including its purpose, its inputs, and its outputs should be provided here in this section.***4.1.2 Interfaces to Other Modules***A detaile d description of the module’s public interface with other modules should be provided here in this section.***4.1.3 Data***A detailed description of the module’s publicly-available and private data should be provided here in this section.***4.2. Module: <MODULE NAME>4.2.1 Functions***A detailed description of each function in this module, including its purpose, its inputs, and its outputs should be provided here in this section.***4.2.2 Interfaces to Other Modules***A detailed description of th e module’s public interface with other modules should be provided here in this section.***4.2.3 DataPage 11 of 11 ***A detailed description of the module’s publicly-available and private data should be provided here in this section.***4.3. Module: <MODULE NAME>4.3.1 Functions***A detailed description of each function in this module, including its purpose, its inputs, and its outputs should be provided here in this section.***4.3.2 Interfaces to Other Modules***A detailed description of the module’s public i nterface with other modules should be provided here in this section.***4.3.3 Data***A detailed description of the module’s publicly-available and private data should be provided here in this section.******These sections should be repeated until all modules in the software have been described***<PRODUCT NAME>Software SpecificationDOC. NO. XXXXX, REV. XX。

CODEV10.2说明书3

CODEV10.2说明书3

Application Programming InterfaceReference GuideVersion 10.2December 2009Pasadena, California 91107Phone: (626) 795-9101Fax: (626) 795-0184E-mail: service@The information in this document is subject to change without notice and should not be construed as a commitment by Optical Research Associates (ORA®). ORA assumes no liability for any errors that may Arrayappear in this document.The software described in this document is furnished under license and may be used or copied only in accordance with the terms of such license. The CODE V output shown (plotted and printed) may vary in different versions.Copyright © 2009 by Optical Research Associates. All rights reserved.Proprietary Software NotificationCODE V® is the proprietary and confidential property of ORA and/or its suppliers. It is licensed for use on the designated equipment on which it was originally installed and cannot be modified, duplicated, or copied in any form without prior written consent of ORA. If supplied under a U.S. Government contract the following also applies:Restricted Rights LegendUse, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or insubparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FARS 52.227-19.ORA, CODE V, and LightTools are registered trademarks of Optical Research Associates. Other trademarksor marks are the property of their respective companies.CODE V API Reference Guide Contents • iiiContentsChapter 1OverviewWhat is the CODE V API? (1)Requirements (1)A Note about the DEFAULTS.SEQ File (2)Getting Started (2)DisplayAlerts Property (4)Speeding Up COM Client Execution...............................................................................................4Chapter 2CODE V Interface FunctionsGeneral Utility Functions (6)Start/StopCodeV (6)Get/SetCommandTimeout (7)Get/SetMaxTextBufferSize (8)Get/SetStartingDirectory (9)GetCodeVVersion (10)Asynchronous Usage Functions (11)AsyncCommand (11)IsExecutingCommand (12)Wait (13)GetCommandOutput (14)StopCommand (15)Synchronous Usage Functions (16)Command (16)EvaluateExpression (17)CODE V State Information (18)GetCurrentOption (18)GetCurrentSubOption (19)GetZoomCount (20)GetSurfaceCount (21)GetFieldCount (22)GetWavelengthCount (23)GetDimension (24)GetStopSurface (25)GetMaxAperture (26)Math and Optical MACRO Functions (27)BESTSPH (27)EVALZERN (28)FITERROR (29)GAUSSBEAM (30)GAUSSWTS (32)INDEX (33)MTF_1FLD (34)NORMRADIUS (35)POLGRID (36)RAYPOL (39)RAYRSI (42)RAYSIN..................................................................................................................................43iv • Contents CODE V API Reference GuideRAYTRA................................................................................................................................44RMSWE..................................................................................................................................45RMS_1FLD.............................................................................................................................48SAGF (50)SASF (51)SURFSAGD (52)SVD (53)TRA_1FLD (54)TRANSFORM (56)ZERNIKE (57)ZERNIKEGQ (59)Zernike Fitting Functions (61)ZFRCOEF (62)Buffer Functions (63)Sample Code: Outputting buffer data from CODE V (63)BufferToArray (64)ArrayToBuffer (65)Chapter 3CODE V API by ExampleWriting PSF Data to an Excel Spreadsheet (67)Results (69)Creating a Surface Listing (70)MATLAB Sample File...................................................................................................................72Appendix A CVCommand ErrorsE_INVALIDARG (73)DISP_E_BADINDEX (73)E_UNEXPECTED (73)FACILITY_ITF..............................................................................................................................73Chapter 1OverviewWhat is the CODE V API?The CODE V API is an application programming interface designed to allow access from otherprograms to CODE V commands. The CODE V API uses the Microsoft Windows standardComponent Object Model (COM) interface1. This enables you to execute CODE V commandsusing applications such as Microsoft Visual Basic (VB), Microsoft Office Applications, C++,MATLAB, or any other application that supports Windows COM architecture. The CODE V API is particularly useful for automating tasks or retrieving data used in calculations in other programs.Both Visual Basic and Excel provide an integrated development environment in which you candevelop CODE V command functions.2 This type of environment provides context-sensitiveediting and debugging, Windows standard forms, object oriented programming capabilities(Classes), standard functions in Visual Basic/Excel (or the client program), external object libraries known as dynamic link libraries (DLLs), as well as other conveniences that can enhance thefunction writing process.The CODE V API has no graphical user interface, and therefore no graphics support; any plotscreated with a CODE V API function must be output to a file or they are lost. Plot files can beviewed either in CODE V, or in the standalone CODE V Viewer program (CVPlotView). RequirementsIn order to use the CODE V API to write and run commands, you must have installed:•CODE V 9.30 or laterDuring installation, CODE V is configured to support API command execution. This processregisters CODE V as a COM server on your system (cvcommand).•Any Visual Basic compliant application (such as Microsoft Excel, Word, PowerPoint, Visual Basic, or MATLAB) or any other Windows program that supports Microsoft COMarchitecture1. The COM enables Windows Programs to communicate with each other using the Client/Serverconcept. For example, the program that initiates the communication process is referred to asthe client, and the program that responds to client’s requests is referred to as the server. Currently,CODE V can only act as a server, meaning that it can only respond to client programs.2. This document concentrates on Visual Basic as the client for writing functions. To use other pro-grams, please refer to their documentation (under “Automation” or “COM” support).CODE V API Reference Guide Overview • 12 • Overview CODE V API Reference GuideA Note about the DEFAULTS.SEQ FileWhen you use the CODE V API, note that your DEFAULTS.SEQ file is not automatically loaded when CODE V is run. You must include the following command in your function to load this file:mand("in defaults.seq")Getting StartedThis example describes how to write a very simple command function using the Visual Basic Editor provided with Microsoft Excel.1.Start Microsoft Excel.2.Select Tools > Macro > Visual Basic Editor .The Microsoft VisualBasic window is displayed.3.Add the CODE V Command Type Library as a reference by doing the following:a.Select Tools > References . . ..b.In the References - VBAProject window, select the Optical Research AssociatesCVCommand Type Library and click OK .If you are running Excel 97, the CVCommand Type Library may not be listed in theAvailable References. If it is not, select Browse and navigate to the CODE V installation directory. Click on cvcommand.tlb and click Open to add the CVCommand Type Library to the Available References.3.Back in the Microsoft Visual Basic window, select Tools > Macros .4.In the Macros window, key in a name and click Create .5.In the Book1 - Module1(Code) window, you can begin writing your macro.a.Declare the session variable:Dim Session As CVCommand b.Request an instance of the CVCommand interface using the Set statement:Set session = CreateObject("mand.930")This instance should be requested by object name, which in this case is version 9.30 ofCODE V . A specific version number should be requested because the interfaces maychange with later versions of CODE V.CODE V API Reference Guide Overview • 3c.Once an instance is created, the CODE V utility functions can be called on to set up theenvironment parameters, such as buffer size and starting directory. For example:session.SetStartingDirectory("c:\CVUSER")e the StartCodeV function to start up CODE V:session.StartCodeVplete the macro as desired and save your project.Following is a sample macro that starts CODE V , opens the sample lens file dbgauss.len, and optimizes the lens:Sub RunCodeV()Dim Session As CVCommand'Create an instance of CODE V and set the starting directory to c:\CVUSER Set session = CreateObject("mand.xxx")'where xxx is the CODE V version; for example, xxx=101 for version 10.1 session.SetStartingDirectory("c:\CVUSER")session.StartCodeVmand("in defaults.seq")'load a lens (dbgauss) and run AUTO to optimize itresult = mand("res cv_lens:dbgauss")result = mand("aut; go")MsgBox (result)'evaluate the Effective Focal Lengthresult = session.EvaluateExpression ("(efl)")'Shut down the instance of CODE Vsession.StopCodeVSet session = NothingEnd Sub6.From the Visual Basic window, click Run > Run Sub/User Form , or click the Run icon on thetoolbar.The macro will run CODE V and execute the specified CODE V command functions.For details about the available CODE V commands available for use with the CODE V API, go to Chapter 2, “CODE V Interface Functions” on page5.DisplayAlerts PropertyIf your macro starts a CODE V process that takes time, and waits for a response, then VB or VBA Array will try to issue a warning message indicating that the server is not responding and may not run the remaining portion of the macro. To suppress this message, you can use the following code:in VBA:Application.DisplayAlerts = Falsedisables the display of alert boxes; however, this setting should be used selectively and changedback to True when not needed.in VB, you can set:App.OleRequestPendingTimeout = NApp.OleRequestBusyTimeout = Nwhere N is the number of milliseconds. N should be greater than the time it takes to run the process. Speeding Up COM Client ExecutionThe REC command allows you to disable recording of data in the CODE V recovery file, whichcan help speed up execution of COM clients. See “Defining Configuration - I/O” on page24-19 ofthe CODE V Reference Manual for details about REC. Note that, by default, CODE V alwaysrecords data in the recovery file, which is recommended for general CODE V usage.4 • Overview CODE V API Reference GuideCODE V API Reference Guide CODE V Interface Functions • 5Chapter 2CODE V Interface FunctionsThis section contains details for each CODE V interface function. The CODE V interface functions are grouped in the following categories, based on what they do.•General Utility Functions.................................................................................... 6•Asynchronous Usage Functions......................................................................... 11•Synchronous Usage Functions........................................................................... 16•CODE V State Information ............................................................................... 18•Math and Optical MACRO Functions............................................................... 27•Buffer Functions................................................................................................63General Utility FunctionsStart/StopCodeVThese functions start or stop the CODE V session being run by CVCommand. Start must be called before any function other than Set/GetCommandTimeout, Set/GetMaxTextBufferSize,GetCodeVVersion, or Set/GetStartingDirectory is called. StopCodeV must be called when you are done running the session of CODE V.Visual Basic SyntaxStartCodeV()StopCodeV()6 • CODE V Interface Functions CODE V API Reference GuideGet/SetCommandTimeoutThese functions are used to get or set the timeout for synchronous commands. They have no effect on asynchronous commands.Visual Basic SyntaxSetCommandTimeout(nTimeout As Integer)GetCommandTimeout() As IntegerParameterReturn ValueFor GetCommandTimeout, the current timeout time in seconds.nTimeoutCurrent timeout time in secondsGet/SetMaxTextBufferSizeThese functions are used to get or set the maximum buffer size for text returned by the Command and GetCommandOutput functions.Visual Basic SyntaxSetMaxTextBufferSize(lSize As Long)GetMaxTextBufferSize() As LongParameterReturn ValueFor GetMaxTextBufferSize, a pointer to a long integer that contains the current maximum buffer size.lSize Long integer containing the desired maximum buffer size in characters.Default is 256000.Get/SetStartingDirectoryGet or set the working directory for CODE V . SetStartingDirectory must be called before StartCodeV to set the directory of execution.Visual Basic SyntaxGetStartingDirectory() As StringSetStartingDirectory(bstrStartingDirectory As String)ParameterReturn ValuePointer to a string defining the current starting directory.bstrStartingDirectoryString defining the desired starting directory.GetCodeVVersionVisual Basic SyntaxGetCodeVVersion() As StringParameterNone.Return ValueVersion of CODE V that is running.Asynchronous Usage FunctionsAsyncCommandStart an asynchronous command. Only one AsyncCommand call can be run at a time, but multiple AsyncCommand calls can be made during a CVCommand session. This function call fails if CODE V is already running a command. Calling this function clears the results of the previous asynchronous function call.Visual Basic SyntaxAsyncCommand(bstrCommandLine As String)ParameterbstrCommandLineCommand to be executed.IsExecutingCommandVisual Basic SyntaxIsExecutingCommand() As LongParameterNone.Return ValueBoolean that indicates whether or not an asynchronous command is currently executing.WaitWait for an asynchronous command to complete.Visual Basic SyntaxWait(nWaitTime As Integer) As CVWaitStatusParameterReturn ValueEnumeration for wait status, either Completed or TimeOut:Completed Command completed 1TimeOut Wait timed out with the command still runningnWaitTimeTime to wait in seconds.GetCommandOutputEvaluateExpression, or math and optical functions) between calls to AsyncCommand andGetCommandOutput. This will preserve the buffer between those two calls.Visual Basic SyntaxGetCommandOutput() As StringParameterNone.Return ValueString containing the output. Its maximum length is the maximum buffer size.StopCommandThis function aborts the currently running CODE V calculation.Visual Basic SyntaxStopCommand()Synchronous Usage FunctionsCommandThis function sends a command to the CODE V session being run by CVCommand and returns its output. Calling this function clears the results of the previous asynchronous function call.Visual Basic SyntaxCommand(bstrCommandLine As String) As StringParameterReturn ValueThe command output. Its size is limited by the maximum buffer size set withSetMaxTextBufferSize.bstrCommandLineCODE V command.EvaluateExpressionThis function evaluates an expression and returns its value. It is equivalent to the EV A command in CODE V .Visual Basic SyntaxEvaluateExpression(bstrExpression As String) As StringParameterReturn ValuePointer to a string into which CVCommand will put the results of the evaluation. Note that because this is a string, the value is only as precise as the output into the string; it is not a true floating point value.bstrExpressionString containing the expression to evaluate.CODE V State Informationasynchronous command.GetCurrentOptionReturns the name of the current option.Visual Basic SyntaxGetCurrentOption() As StringParameterNone.Return ValueThe option short name (e.g., AUT for Automatic Design). Returns "CHA" if CODE V is notcurrently in an option.GetCurrentSubOptionVisual Basic SyntaxGetCurrentSubOption() As StringParameterNone.Return ValueThe option name. Returns an empty string if CODE V is not currently in a sub-option.Visual Basic SyntaxGetZoomCount() As Integer ParameterNone.Return ValueThe current number of zoom positions in the lens.Visual Basic SyntaxGetSurfaceCount() As Integer ParameterNone.Return ValueThe current number of surfaces.GetFieldCountVisual Basic SyntaxGetFieldCount() As Integer ParameterNone.Return ValueThe current number of fields.GetWavelengthCountVisual Basic SyntaxGetWavelengthCount() As Integer ParameterNone.Return ValueThe current number of wavelengths.GetDimensionReturns a value representing the type of dimensions in the system.Visual Basic SyntaxGetDimension() As IntegerParameterNone.Return ValuesThe value representing the type of dimensions in the system:0Inches1Centimeters2MillimetersVisual Basic SyntaxGetStopSurface() As Integer ParameterNone.Return ValueThe surface number of the current stop surface.Returns the maximum aperture size for the specified surface and zoom.Visual Basic SyntaxGetMaxAperture(nSurface As Integer, nZoom As Integer) As DoubleParametersReturn ValueMaximum aperture size. This uses the “MAP” database item.nSurfaceNumber of the surface for which the maximum aperture will be oomZoom position at which the maximum aperture will be determined.Math and Optical MACRO FunctionsThe following functions are equivalent to calling various CODE V macro functions. For more details about the CODE V macro functions referenced, see “Language Reference” on page 25A-1 of the CODE V Reference Manual .BESTSPHThis is equivalent to calling the BESTSPH macro function in CODE V .Visual Basic SyntaxBESTSPH(nSurface As Integer, nZoomPos As Integer,dblMinHeight As Double, dblMaxHeight As Double) As DoubleParametersReturn ValueThe return value of the BESTSPH macro function. It is the curvature of the best fitting sphere.nSurface Desired surface.nZoomPos Desired zoom position.dblMinHeight Minimum Y coordinate.dblMaxHeightMaximum Y coordinate.EVALZERNThis is equivalent to calling the EV ALZERN macro function in CODE V . The EV ALZERN macron function evaluates a Zernike polynomial generated with the ZERNIKE, ZERNIKEGQ, orZFRCOEF macro function and computes the value of the polynomial at a point X,Y , where X and Y are normalized to the unit circle.Visual Basic SyntaxEVALZERN(nWavelengthNum As Integer, nFieldNum As Integer, nZoomPos As Integer, dblX As Double, dblY As Double, nPolType As Integer, eOutputType As CVZernOutputTypeEnum, eZernType As CVZernTypeEnum) As DoubleParametersReturn ValueThe value of the Zernike polynomial at the specified coordinate. If the polynomial has not been defined with the ZERNIKE, ZERNIKEGQ, or ZFRCOEF function, EV ALZERN returns a value of -1e10.nWavelengthNum Number of the wavelength defined in ZERNIKE, ZERNIKEGQ, or ZFRCOEF.nFieldNum Number of the field point defined in ZERNIKE, ZERNIKEGQ, or ZFRCOEF.nZoomPos Zoom position defined in ZERNIKE, ZERNIKEGQ, or ZFRCOEF.dblX X coordinate to be evaluated.dblY Y coordinate to be evaluated.nPolTypeNumber specifying whether polarization ray tracing is enabled for this computation; matches the number defined in ZERNIKE or ZERNIKEGQ. If you used ZFRCOEF, this must be 0.eOutputTypeEnumeration of the output type ('intensity' or 'phase'), specifying intensity or phase. Matches the type used in ZERNIKE or ZERNI-KEGQ. If you used ZFRCOEF, the output must be 'phase.'eZernTypeType of the Zernike polynomial. Matches the expression defined inZERNIKE or ZERNIKEGQ. If you used ZFRCOEF, it must be 'zfr.'FITERRORThis is equivalent to calling the FITERROR macro function in CODE V .Visual Basic SyntaxFITERROR(nWavelengthNum As Integer, nFieldNum As Integer, nZoomPos As Integer, nPolType As Integer, eOutputType As CVZernOutputTypeEnum, eZernType As CVZernTypeEnum) As DoubleParametersReturn ValueThe RMS fit error of the Zernike polynomial. If the polynomial has not been defined with the ZERNIKE or ZFRCOEF function, FITERROR returns a value of -1. If used with the ZERNIKEGQ macro function, returns a value of 0.nWavelengthNum Number of the wavelength defined in ZERNIKE or ZFRCOEF.nFieldNum Number of the field point defined in ZERNIKE or oomPos Zoom position defined in ZERNIKE or ZFRCOEF.nPolTypeNumber specifying whether polarization ray tracing is enabled for this computation; matches the number defined in ZERNIKE. If you used ZFRCOEF, this must be 0.eOutputTypeEnumeration of the output type ('intensity' or 'phase'), specifying intensity or phase. Matches the type used in ZERNIKE. If you used ZFRCOEF, the output must be 'phase.'eZernTypeType of the Zernike polynomial. Matches the expression defined inZERNIKE. If you used ZFRCOEF, it must be 'zfr.'GAUSSBEAMThis is equivalent to calling the GAUSSBEAM macro function in CODE V .Visual Basic SyntaxGAUSSBEAM(nSurface As Integer, nZoomPos As Integer, nFieldNum As Integer, nWavelengthNum As Integer, psaInput() As Double, eOutputType As CVGaussbeamOutputTypeEnum) As DoubleParametersnSurfaceThe surface number to use. For non-sequential systems, if you enter a negative value, that value refers to the hit number rather than the sur-face number. This gives you direct access to the information by hit number.nZoomPos Zoom position to use.nFieldNumNumber of field positions to use.nWavelengthNum Number of the wavelength to use (not the value of the wavelength).psaInputA five-element input array containing the following parameters (in this order): initial beam-width radius (at the object plane) at the 1/ e 2 inten-sity point in the X meridian (WRX), initial beam-width radius (at the object plane) at the 1/ e 2 intensity point in the Y meridian (WRY), radius of curvature of input wavefront (at object plane) in X meridian (RCX), radius of curvature of input wavefront (at object plane) in Y meridian (RCY), orientation (in degrees) of input beam definition about the optical (z) axis (AZI).eOutputTypeEnumeration specifying the output value of the function:0PROP Propagation distance to the next surface 1BSDX X semi-diameter of the beam 2BSDY Y semi-diameter of the beam 3BANG Beam angle (in degrees)4WCUX X Curvature of the Wavefront 5WCUY Y Curvature of the Wavefront 6WSDX X semi-diameter of the waist 7WSDY Y semi-diameter of the waist 8WDSX X waist distance from the surface 9WDSY Y waist distance from the surface 10SURX X Coordinate of the beam on the surface 11SURY Y Coordinate of the beam on the surface 12SURZZ Coordinate of the beam on the surfaceReturn ValueFor non-sequential systems, the macro function returns results for the last time the specified surface was hit. If that surface was not hit, the function returns 0.13RDCL L Direction cosine (geo) of center of beam prior to surface14RDCM M Direction cosine (geo) of center of beam prior to surface15RDCN N Direction cosine (geo) of center of beam prior to surface16AINC Angle of incidence (in degrees) of center of beam at surface17SURNFor NS systems. Return the surface number for the hit number specified with the surface numparameterGAUSSWTSThis function is equivalent to calling the GAUSSWTS macro function in CODE V .Visual Basic SyntaxGAUSSWTS(nNumInputPts As Integer, psaInputCoords() As Double, psalInputWeights() As Double, nNumQuadPts As Integer, psaCoords() As Double, psaWeights() As Double) As DoubleParametersReturn ValueThe return value of the GAUSSWTS macro function. It is 0 if there are no errors in the computation, and -1 if any errors are encountered.nNumInputPts Number of input points at which weights are supplied.psaInputCoordsInput array of coordinates at which weights are supplied. It must be nNumInputPts long. The input coordinates do not need to be equally spaced.psalInputWeights An input array, dimensioned at nNumInputPts, of the weighting function at the points specified in psaInputCoords.nNumQuadPts Number of Gaussian quadrature points and weights desired.psaCoords An output array, dimensioned at nNumQuadPts, of the coordinates to be used for the numerical integration.psaWeightsAn output array, dimensioned at nNumQuadPts. It will receive theweights to be used for the numerical integration.INDEXThis is equivalent to calling the INDEX macro function in CODE V .Visual Basic SyntaxINDEX(nSurface As Integer, nZoomPos As Integer,nWavelengthNum As Integer, nGlassNum As Integer, dblX As Double, dblY As Double, dblZ As Double) As DoubleParametersReturn ValueThe refractive index at the specified point. Note that it can be positive or negative, depending on the direction the light is traveling. If the first four parameters are outside their allowed range or if the index cannot be computed for any reason, the return value is set to 0.0.nSurface Surface number of the GRIN oomPosZoom position.nWavelengthNum Number of the wavelength to be used (not the wavelength value).nGlassNum Glass number (for NSS surfaces). Value must be either 1 or 2. For sequential surfaces, use 1.dblX, dblY , dblZCoordinates relative to the surface origin where the index is to becomputed.MTF_1FLDMTF_1FLD computes the MTF of the lens system including or excluding diffraction effects,assuming either a sine wave or a square wave object, similar to the MTF option. It is equivalent to calling the MTF_1FLD macro function in CODE V .Visual Basic SytaxMTF_1FLD(nZoomPos As Integer, nFieldNum As Integer, Frequency As Double, Azimuth As Double, NRD As Integer, MTFValues() As Double, MTFtype As CVMTFTypeEnum, MTFWave As CVMTFWaveEnum) As DoubleParametersReturn ValueThe return value of the function is the modulation. If there is an error in the computation or inputs, the return value is -1. Since a negative modulation is not valid, any negative return value indicates that the calculation failed.nZoomPos Zoom position to use. Range: 1 to (NUM Z).nFieldNum Number of field point to use. Range: 1 to (NUM F).FrequencySpatial frequency at the image surface. Units are cycles/mm for focal systems, and cycles per angular measure for afocal (AFC) systems, where the angular measure is defined by the angular units specification (ADM).Azimuth Orientation of the spatial frequency at the image, in degrees.NRD Number of grid rays across the diameter of the pupil. If nrd is set to zero, the calculation is performed using a default value of 60.MTFValuesThe output array name must be declared before the macro is called, and is a one-dimensional output array that will contain the following six elements:1.Modulation2.Phase (degrees)3.Analytic diffraction limit value4.Actual diffraction limit value5.Illumination for unit brightness6.Number of rays traced (in convolved pupil for diffraction MTF)These data values correspond to the equivalent values output by the MTF option.MTFtype String expression specifying diffraction MTF ('DIF') or geometrical MTF ('GEO').MTFWaveString expression specifying sine wave response ('SIW') or square waveresponse ('SQW').。

Chapter 4Indirect Utility and Expenditure(高级微观经济学-上海财经大学,沈凌)

Chapter 4Indirect Utility and Expenditure(高级微观经济学-上海财经大学,沈凌)

p11(ρ −1)w
ρ
ρ
,
p1 (ρ −1) + p2 (ρ −1)
x2 =
p21(ρ −1)w
ρ
ρ
.
p1 (ρ −1) + p2 (ρ −1)
Hence, IU function is:
( ) v
P, w
=
⎜⎛ ⎜ ⎜ ⎝
⎜⎛ ⎜⎜⎝
p11( ρ −1)w
ρ
ρ
p1 (ρ−1) + p2 (ρ−1)
Our additional differentiability assumption allows us to apply the Envelope theorem.
( ) ∂v(P, w) = ∂L x∗,λ∗ = λ∗ > 0
∂w
∂w
1
( ) ∂v(P, w) = ∂L x∗,λ∗
∂pi
∂pi
{ } on the budget sets. Define Bi = x | Pi x ≤ wi ∀i ∈{1,2,t}.
The idea is that if every choice the consumer can possibly make when she faces Bt is a choice that could have been made when she faces either B1 or B2 , then every utility level she can achieve facing Bt is a level she could have achieved either when facing B1 or when facing B2 . Hence, the maximal level of utility she can achieve over Bt (it

Microeconomic 0_Midterm_solution

Microeconomic 0_Midterm_solution
(a) Jack could increase his utility by buying more pens and fewer pencils. (b) Jack could increase his utility by buying more pencils and fewer pens. (c) Jack could increase his utility by buying more pencils and more pens. (d) Jack could increase his utility by buying fewer pencils and fewer pens. (e) Jack is at a corner solution and is maximizing his utility.
?l?x1?l?x2?l??1x20p1?x1?1p2?x01x2u?x1x20123fromequations1and2wehavex2p1p1optimal?x2x1x1p2p2plugequation4intoequation3toreplacex2wehaveu?x1thissolvesthedemandfunctionh?1puu11p2p1
2
10. We learnt from other reliable sources that Frank’s preference is strictly convex. Frank consumes two goods, 1 and 2. When the prices are (p1, p2) = (10, 10), Frank’s chooses x = (x1, x2) = (2, 3). What can we learn?
(a) A is preferred to C. (b) A is preferred to B. (c) Both A and B answer choices are correct. (d) None of the above.

《微观经济学microeconomics》英文版全套课件(101页)

《微观经济学microeconomics》英文版全套课件(101页)
Assumption: It is homogeneous of degree of zero ( Definition
2.E.1 ): individual’s choice depends only on the set of feasible points. It satisfies Walras’ law ( Definition 2.E.2 ): the consumer fully expends his wealth. Exercise 2.E.1
微观经济学
Microeconomics
Hale Waihona Puke ECON501 Lecture Note 1
Preference and Choice
Structure
Preference relation Choice rules The link between preference and choice
Preference Relations
X RL {x R : xl 0 for l 1,..., L}
The economic constraint:
px p1x1 ... pL xL w
The Walrasian budget set (Definition 2.D.1)
Bp,w {x RL : px w}
x y u(x) u( y)
A preference relation can be represented by a utility function only if it is rational
Choice Rules
A choice structure ( ,C())
Budget sets B
Intuition: Figure 2.F.1

expected utility function

expected utility function

expected utility functionThe expected utility function is a concept used in decision theory and economics to model an individual's preferences and choices under uncertainty. It assigns a numerical value, known as utility, to different outcomes based on their expected probabilities and perceived desirability.The expected utility function is typically represented as U(X), where X represents an outcome or set of outcomes. It is derived by multiplying the utility of each possible outcome by its respective probability and summing these values. Mathematically, the expected utility function can be expressed as:U(X) = Σ (P(Xi) * U(Xi))where P(Xi) represents the probability of outcome Xi occurring and U(Xi) represents the utility assigned to outcome Xi.The concept of expected utility can be used to explain decision-making behavior under risk and uncertainty. Rational individuals are assumed to maximize their expected utility when making choices by weighing the potential rewards against the associated risks. The specific form of the expected utility function may vary depending on the individual's risk preferences, such as risk aversion or risk-seeking behavior. Various theories and models, such as the Von Neumann-Morgenstern utility theorem and Prospect theory, have been developed to describe and analyze expected utility functions in different decision scenarios.。

UtilityFunction:效用函数

UtilityFunction:效用函数

Problem Set2:SolutionsECON301:Intermediate Microeconomics Prof.Marek WeretkaProblem1(Marginal Rate of Substitution)(a)For the third column,recall that by definition MRS(x1,x2)=−∂U∂x1∂U∂x2.Utility Function∂U∂x1∂U∂x2MRS(x1,x2)MRS(2,3)(i)U(x1,x2)=x1x2x2x1−x2x1−32(ii)U(x1,x2)=x31x523x21x525x31x42−3x25x1−910(iv)U(x1,x2)=3ln x1+5ln x23x15x2−3x25x1−910(b)MRS(2,3)=−9/10for utility function U(x1,x2)=x31x52has the following interpre-tation:At bundle(2,3),to remain indifferent about the change(i.e.,remain at the same utility level),a consumer is willing to give up9/10of x2for one additional unit of x1.(Or, after losing one unit of x1,he must receive9/10of a unit of x2to be as well offas he was at bundle(2,3).)So at the point(2,3),good two is more valuable since he needs to get less of it than he lost of the other good to remain as satisfied.If0.00001of good one is takenaway,he would have to receive approximately0.00001×(910)=0.000009units of good twoto remain indifferent to the change.(c)The two utility functions share the same MRS functions because U(x1,x2)=3ln x1+5ln x2is a monotonic transformation of U(x1,x2)=x31x52.To see this,let f(u)=ln(u)(f(u)is a monotonic function).Then letting u=x31x52,we have that f(u)=ln(x31x52)=3ln x1+5ln x2.If one function is a monotonic transformation of another,the two describe the same preferences since they will they rank bundles in the same way.(They assign dif-ferent values to the bundle,but we do not use these cardinal numbers in determining the utility-maximizing choices—we only care about ordinal comparisons.)Problem2(Well-Behaved Preferences)(a)Instead of using utility function U(x1,x2)=x31x12,we can use a monotonic trans-formation instead:U(x1,x2)=3ln x1+ln x2.(To get this,let f(u)=ln(u).Then f(u)=ln(x31x2)=3ln x1+ln x2.Again,even though these are not the same utility func-tions,they’ll give the same MRS and thus the same results.)Using U(x1,x2)=3ln x1+ln x2,we get than MU1=∂U∂x1=3x1and MU2=∂U∂x2=1x2.SinceMRS(x1,x2)=−MU1MU2=−∂U∂x1∂U∂x2,we have here that MRS(x1,x2)=−3x2x1.This is the MRSfor any bundle(x1,x2),which is also the slope of the indifference curve passing through that point.(b)Using our answer in(a),we get that MRS(1,1)=−3·11=−3.This tells us that theslope of the indifference curve passing through the point(1,1)is−3:At(1,1),good one is locally more valued since,to compensate for a loss of3units of good two(the CDs),Alicia only needs1unit of good one(the DVDs)to maintain the initial level of happiness.(c)The two secrets of happiness for well-behaved preferences are:•(1)p1x1+p2x2=m(Since more is preferred to less,spend all of your income.)•(2)MRS=−p1p2(Marginal utility per dollar spent is equalized.)–Note:An equivalent way of writing this is−MU1MU2=−p1p2(using the definition ofMRS)or MU1p1=MU2p2.All three ways are exactly the same.Graphically,we’refinding the bundle for which the budget line is tangent to an indifference curve:Given that p1=40,p2=20,and m=800,we can rewrite these two equations as •(1)40x1+20x2=800•(2)−3x2x1=−4020=⇒x2=23x1(d)Tofind Alicia’s optimal bundle,we just use the two equations above to solve for our two unknowns,which are x1and x2.(So there’s no economics here,only Algebra.)You canjust take x2=23x1from equation(2)and plug it into(1)to get40x1+20(23x1)=800=⇒x1=15.Plug x1=15into either equation tofind that x2=10.Alicia’s optimal bundle, given these prices and her income,is(15,10),which is interior(she’s consuming non-zero amounts of both).This is shown in thefigure above.Problem3(Perfect Complements)(a)The indifference curves passing through(5,1),(10,10),and(15,4)are shown below.The vertices all fall along the dotted line along which x2=5x1.(It shows the combinations for which Trevor consumesfive times as many strawberries(x2)as he does units of milk(x1)). The MRS at each of these points(without using any formulas and only looking at the graph) is zero:MRS(5,1)=MRS(10,10)=MRS(15,4)=0.(b)His preferences can be represented by the utility function U(x1,x2)=min{5x1,x2}.In general,if preferences are perfect complements where a of x1must be consumed for every bof x2,the utility function can be expressed as U(x1,x2)=min{1a x1,1bx2},and the line alongwhich all of the vertices of those L-shaped indifference curves lie is1a x1=1bx2.So using thisformula directly U(x1,x2)=min{x1,15x2}but,multiplying everything through by5(whichwould be a monotonic transformation!)we get U(x1,x2)=min{5x1,x2}.Tofind the level of utility associated with the indifference curves passing through(5,1), (10,10),and(15,4),we use this utility function tofind that:•U(5,1)=min{5·5,1}=min{25,1}=1•U(10,10)=min{5·10,10}=min{50,10}=10•U(15,4)=min{5·15,4}=min{75,4}=4Notice that if you would have used utility function U(x1,x2)=min{x1,15x2},you would get:•U(5,1)=min{5,15·1}=min{5,15}=15•U(10,10)=min{10,15·10}=min{10,2}=2•U(15,4)=min{15,15·4}=min{15,45}=45Either way,we see that(10,10)is the most preferred(i.e.,gives the highest utility among the three),followed by(15,4)and then(5,1).(c)Multiplying our utility function by ten and adding two is equivalent to taking a monotonic transformation f(u)=10u+2.If we take our utility U(x1,x2)=min{5x1,x2},we get U trans(x1,x2)=10·min{5x1,x2}+2.Then•U(5,1)=10·min{25,1}+2=10·1+2=12•U(10,10)=10·min{50,10}+2=10·10+2=102•U(15,4)=10·min{75,4}+2=10·4+2=42Again,the indifference curves do not move and the preference ranking among the bundles is preserved,we just have the above levels of utility attached to each of the indifference curves.(d)Letting p1=1,p2=1,and m=100,the two secrets of happiness for perfect comple-ments are•(1)p1x1+p2x2=m=⇒x1+x2=100(Trevor spends all of his income.)•(2)x2=5x1(He consumes only to optimal proportions along the dotted line along which x2=5x1.)–Note:These types of preferences are not“well behaved”like Cobb Douglas pref-erences are,so we use a different second secret of happiness for these preferences.We can no longer use MRS=−p1p2since the MRS of the indifference curve is notdefined at the kink.Tofind the demand for both milk(x1)and strawberries(x2)we solve the equations in(1) and(2):Plug x2=5x1into equation(1)for x2,so x1+(5x1)=100=⇒x1=100/6.Plug this into either equation to solve for x2and get x2=500/6.This is interior since Trevor is consuming non-zero amounts of both goods(i.e.,x1>0and x2>0).(e)With larger strawberries,the new optimal proportion of milk(x1)and strawberries(x2) is two strawberries for every unit of milk,or x2=2x1.Our indifference curves are the same shape as they were before,but now the vertices of these L-shaped indifference curves(which will be the optimal bundles)lie along x2=2x1,as seenbelow.These new preferences can be represented by utility function U(x1,x2)=min{2x1,x2}.Problem4(Perfect Substitutes)(a)When two goods are perfect substitutes,we know the indifference curves are linear and downward-sloping,in this case having a constant slope of−1.The indifference curves pass-ing through points(3,2)and(3,3)are shown below:(b)Some utility functions that could represent these functions:•(i)U(x1,x2)=x1+x2•(ii)U(x1,x2)=ln(x1+x2)•(iii)U(x1,x2)=(x1+x2)2•(iv)U(x1,x2)=18x1+18x2•(v)U(x1,x2)=6x1+6x2Each of thesefive utility functions represents a monotonic transformation of any of the oth-ers;they all represent the same underlying perfect-substitute preferences over Red Delicious (x1)and Jonagold(x2)apples and give indifference curves having the same MRS=−1(you can verify this).(c)MRS(x1,x2)=−1for any(x1,x2).This means that starting from any(x1,x2)bundle, Kate is always willing to give up one Red Delicious(x1)apple to get one additional Jonagold (x2)(or vice versa).This means,as noted above,that the indifferences curves will be linear everywhere.(d)Letting p1=2,p2=1,and m=100we canfirst turn to the commodity space to see how to go about funding the optimal bundle.We know that thefirst secret of happiness (spending all of one’s income)will always hold,so the optimal choice is along the budget line.But the budget line is not tangent to any indifference curve here:The budget linehas a slope of−p1p2=−21and we just determined that MRS(x1,x2)=−1everywhere,soMRS=−p1p2anywhere.We can see that at the indifference curve furthest out from the origin(the one with highest utility)but still touching the budget line,Kate is consuming only Jonagolds(x2)and no RedDelicious(x1):x1=0,x2=mp2=1001=100.This is not an interior solution(since x1=0)but rather is a corner solution.As a general rule,when|MRS|<p1p2(the indifference curves are moreflat than the budgetline),the consumer chooses to consume only x2.Here,|MRS|=1<p1p2=2.This makessense intuitively here:If the two types of apples are1:1perfect substitutes for Kate,she should just consume the one that is cheaper.(e)Now we have that|MRS|=1>p1p2=12and Kate consumes only the cheaper apple,theRed Delicious(x1),with x1=mp1=1001=100,x2=0.(f)With this price change,|MRS|=p1p2everywhere,so all of the combinations along thebudget line lie along the same indifference curve,and thus any bundle is equally as good asany other bundle on the budget line.Kate can choose any(x1,x2)combination such that p1x1+p2x2=m or x1+x2=100:。

2013 Utility Copula Functions Matching All Boundary Assessments

2013 Utility Copula Functions Matching All Boundary Assessments
n n
the complement to determine the functional form. With this approach, the trade-off assessments among the attributes are also determined completely by the univariate utility assessments and the choice of the normalizing constants. If utility independence conditions do not hold, one would, in general, need to assess conditional utility functions across the entire domain of the attributes to construct the utility surface. Several methods have therefore been proposed to facilitate the utility elicitation task when utility independence conditions do not exist. Bell (1979) introduced the notion of interpolation independence of Y on X , where the normalized conditional utility function, U y x , is an interpolation of its boundary values, i.e., U y x = x U y x∗ + 1 − x U y x0 where x0 x∗ are two boundary values of X , and x is a univariate interpolation function. In related work, Abbas and Bell (2011) introduced the idea of one-switch independence of X on Y , where preferences for lotteries over X can change, but only once, as we increase Y . This condition requires two conditional utility functions for each attribute at the boundary values of the complement, and a monotone interpolation function, y , such that U x y = U x0 y + U x∗ y − U x0 y × U x y∗ + U x y∗ − U x y0

行为金融学课后答案1至5章anawer

行为金融学课后答案1至5章anawer

第一章1. Differentiate the following terms/concepts:a.Prospect and probability distributionA prospect is a lottery or series of wealth outcomes, each of which is associated with a probability, whereas a probability distribution defines the likelihood of possible outcomes.b.Risk and uncertaintyRisk is measurable using probability, but uncertainty is not. Uncertainty is when probabilities can’t be assigned or the possible outcomes are unclear.c.Utility function and expected utilityA utility function, denoted as u( ), assigns numbers to possible outcomes so that preferred choices receive higher numbers. Utility can be thought of as the satisfaction received from a particular outcome.d.Risk aversion, risk seeking, and risk neutralityRisk aversion describes someone who prefers the expected value of a lottery to the lottery itself. Risk seeking describes someone who prefers a lottery to the expected value of a lottery. And risk neutrality describes someone whose utility of the expected value of a lottery is equal to the expected utility of the lottery.2. When eating out, Rory prefers spaghetti over a hamburger. Last night she had a choice of spaghetti and macaroni and cheese and decided on the spaghetti again. The night before, Rory had a choice between spaghetti, pizza, and a hamburger and this time she had pizza. Then, today she chose macaroni and cheese over a hamburger. Does her selection today indicate that Rory’s choices are consistent with economic rationality? Why or why not?Rory’s pref erences are consistent with rationality. They are complete and transitive. We see that her preference ordering is:Pizza spaghetti macaroni and cheese hamburger3. Consider a person with the following utility function over wealth: u(w) = e w, where e is the exponential function (approximately equal to 2.7183) and w = wealth in hundreds of thousands of dollars. Suppose that this person has a 40% chance of wealth of $50,000 and a 60% chance of wealth of $1,000,000 as summarized by P(0.40, $50,000, $1,000,000).a. What is the expected value of wealth?E(w) = .4 * .5 + .6 * 10 = 6.2U(P) = .4e0.50 + .6e10 = 13,216.54b. Construct a graph of this utility function.The function is convex.c. Is this person risk averse, risk neutral, or a risk seeker?Risk seeker because graph is convex.d. What is this person’s certainty equivalent for the prospect?e w = 13,216.54 gives w = 9.4892244 or $948,922.444. An individual has the following utility function: u(w) = w.5 where w = wealth.a. Using expected utility, order the following prospects in terms of preference, from the most to the least preferred:P1(.8, 1,000, 600)P2(.7, 1,200, 600)P3(.5, 2,000, 300)Ranking: P2, P3, P1 with expected utilities 31.5972, 31.0209, and 30.1972 for prospects 2, 3, and1, respectivelyb. What is the certainty equivalent for prospect P2?998.3830c. Without doing any calculations, would the certainty equivalent for prospect P1 be larger or smaller? Why?The certainty equivalent for P1 would be smaller because P2 is ranked higher than P1.5. Consider two prospects:Problem 1: Choose betweenProspect A: $2,500 with probability .33,$2,400 with probability .66,Zero with probability .01.And Prospect B: $2,400 with certainty.Problem 2: Choose betweenProspect C: $2,500 with probability .33,Zero with probability .67.And Prospect D: $2,400 with probability .34,Zero with probability .66.It has been shown by Daniel Ka hneman and Amos Tversky (1979, “Prospect theory: An analysis of decision under risk,” Econometrica 47(2), 263-291) that more people choose B when presented with problem 1 and when presented with problem 2, most people choose C. These choices violate expected utility theory. Why?This is an example of the Allais paradox. The first choice suggests thatu(2,400) > .33u(2,500) + .66u(2,400) or .34u(2,400) > .33 u(2,500)while the second choice suggests just the opposite inequality.第二章1. Differentiate the following terms/concepts:a. Systematic and nonsystematic riskNondiversifiable or systematic risk is risk that is common to all risky assets in the system and cannot be diversified. Diversifiable or unsystematic risk is specific to the asset in question and can be diversified.b. Beta and standard deviationBeta is the CAPM’s measure of risk. It takes into account an asset’s sensitivity to the market and only measures systematic, nondiversifiable risk. The standard deviation is a measure of dispersion that includes both diversifiable and nondiversifiable risks.c. Direct and indirect agency costsAgency costs arise when managers’ incentives are not consistent with maximizing the value of the firm. Direct costs include expenditures that benefit the manager but not the firm, such as purchasing a luxury jet for travel. Other direct costs result from the need to monitor managers, including the cost of hiring outside auditors. Indirect costs are more difficult to measure and result from lost opportunities.d. Weak, semi-strong, and strong form market efficiencyWith weak form market efficiency prices reflect all the information contained in historical returns. With semi-strong form market efficiency prices reflect all publicly available information. With strong form market efficiency prices reflect information that is not publicly available, such as insiders’ information.2. A stock has a beta of 1.2 and the standard deviation of its returns is 25%. The market risk premium is 5% and the risk-free rate is 4%.a. What is the expected return for the stock?E(R) = .04 + 1.2(.05) = .10b. What are the expected return and standard deviation for a portfolio that is equally invested in the stock and the risk-free asset?E(R p) = .5(.10) +.5(.04) = .07, σp =(.5)(.25) = .125c. A financial analyst forecasts a return of 12% for the stock. Would you buy it? Why or why not?If you believe the source is very credible, buy it as it is expected to generate a positive abnormal (or excess) return.3. What is the joint hypothesis problem? Why is it important?If when testing one hypothesis another must be assumed to hold, a joint-hypothesis problem arises. For us, this is of particular interest when we are testing market efficiency because of the need to utilize a particular risk-adjustment model to produce required returns, that is, to risk-adjust.This would not be a problem if we knew with certainty what the correct risk adjustment model is, but unfortunately we do not. If a test rejects the EMH, is it because the EMH does not hold, or because we did not properly measure abnormal returns? We simply do not know for certain the answer to this question.4. Warren Buffett has been a very successful investor. In 2008 Luisa Kroll reported that Buffett topped Forbes Magazine’s list of the world’s richest people with a fortune estimated to be worth $62 billion (March 5, 2008, "The world's billionaires," Forbes). Does this invalidate the EMH?Warren Buffett’s experience does not necessarily invalidate the EMH. There is the possibility that he is just lucky: given that there are numerous money managers, some are bound to perform well just by luck. Still many would question this here because Buffett’s track record has been consistently strong.5. You are considering whether to invest in two stocks, Stock A and Stock B. Stock A has a beta of 1.15 and the standard deviation of its returns has been estimated to be 0.28. For Stock B, the beta is 0.84 and standard deviation is 0.48.a.Which stock is riskier?Stock A is riskier, though stock B has greater total risk.b.If the risk-free rate is 4% and the market risk premium is 8%, what is the expectedreturn for a portfolio that is composed of 60% A and 40% B?R p = .6(.132) + .4 (.1072) = .12208c.If the correlation between the returns of A and B is 0.50, what is the standarddeviation for the portfolio that includes 60% A and 40% B?σp2 = (.6)2(.28)2 + (.4)2(.48)2+ 2*.5(.6)(.4)(.28)(.48) = 9.7%, σp = 31.2%第三章1. Differentiate the following terms/concepts:a. Lottery and insuranceA lottery is a prospect with a low probability of a high payoff. Many people buy lottery tickets, even with negative expected values. These same people buy insurance to protect themselves from risk. Normally, insurance is a hedge against a low-probability large loss. These choices are inconsistent with traditional expected utility framework but can be explained by prospect theory.b. Segregation and integrationIntegration occurs when positions are lumped together, while segregation occurs when situations are viewed one at a time.c. Risk aversion and loss aversionA person who is risk averse prefers the expected value of a prospect to the prospect itself, whereas for a person who is loss averse, losses loom larger than gains.d. Weighting function and event probabilityEvent probability is simply the subjective view on how likely an event is. The weighting function is associated with the probability of an outcome, but is not strictly the same as the probability as in expected utility theory.2. According to prospect theory, which is preferred?a. Prospect A or B?Decision (i). Choose between:A(0.80, $50, $0)and B(0.40, $100, $0)Prospect A is preferred due to risk aversion for gains. While both have the same expected change in wealth, A has less risk.b. Prospect C or D?Decision (ii). Choose between:C(0.00002, $500,000, $0) and D(0.00001, $1,000,000, $0)Prospect D, with more risk, is preferred due to the risk seeking that occurs when there are very low probabilities of positive payoffs.c. Are these choices consistent with expected utility theory? Why or why not?Violation of EU theory because preferences are inconsistent. The same sort of Allais paradox proof from chapter 1 can be used. It is also necessary to make the assumption of preference homogeneity, which means that if D is preferred to C, it will also be true that D* is preferred to C* where these are:C*:(0.00002, $50, $0) and D*: (0.00001, $100, $0)3. Consider a person with the following value function under prospect theory:v(w) = w.5when w > 0= -2(-w) .5when w < 0a. Is this individual loss-averse? Explain.This person is loss averse. Losses are felt twice as much as gains of equal magnitude.b. Assume that this individual weights values by probabilities, instead of using a prospect theory weighting function. Which of the following prospects would be preferred?P1(.8, 1000, -800)P2(.7, 1200, -600)P3(.5, 2000, -1000)We calculate the value of each prospect:V(P1) = .8(31.62)+.2(-2)(28.27)= 13.982V(P2) = .7(34.64)+.3(-2)(24.49)= 9.55V(P3) = .5(44.72)+.5(-2)(31.62)= 9.265Therefore prospect P1 is preferred.4. Now consider a person with the following value function under prospect theory:v(z) = z.8when z ≥ 0= -3(-z).8when z < 0This individual has the following weighting function:where we set =.65.a. Which of the following prospects would he choose?PA(.001, -5000)PB(-5)Compare the value of each prospect:V(P A) = .983(0) + (-3)(910.28)(.011) = -30.15 (note use of weights)V(PB) = 3 * 1 * -3.62 = -10.87Therefore you would prefer B.b. Repeat the calculation but using probabilities instead of weights. Whatdoes this illustrate?V(P A) = .999 * 0 + 3 * .001 * -910.28 = -2.73 (note use of probability)V(PB) = 3 * 1 * -3.62 = -10.87Therefore you would prefer A. The reason for the switch is that risk seeking is maintained in the domain of losses (implying rejection of losses) if probabilities are used instead of weights.5. Why might some prefer a prix fixe (fixed price) dinner costing about the same as an a la carte one (where you pay individually for each item)? (Assume the food is identical.)Payment decoupling is encouraged with prix fixe. You only face the loss of money once rather than multiple times (occurring if you have to face the cost of each item individually using an à la carte scheme).第五章1. Differentiate the following terms/concepts:a.Primacy and recency effectsA primacy effect is the tendency to rely on information that comes first when making an assessment, whereas a recency effect is the tendency to rely on the most recent information when making an assessment.b.Salience and availabilityThe salience of an event refers to how much it stands out relative to other events, whereas the availability refers to how easily the event is recalled from memory.c.Fast-and-frugal heuristics and bias-generating heuristicsFast and frugal heuristics require a minimum of time, knowledge and computation in order to make choices. Often they lead to very good choices. Sometimes however heuristics go astray and generate behavioral bias.d.Autonomic and cognitive heuristicsAutonomic heuristics are reflexive, autonomic, non-cognitive, and require low effort levels. Cognitive heuristics require more deliberation. Autonomic heuristics are appropriate when a very quick decision must be made or when the stakes are low, whereas cognitive heuristics are appropriate when the stakes are higher.2. Which description of Mary has higher probability?a. Mary loves to play tennis.b. Mary loves to play tennis and, during the summer, averages at least a game aweek.Explain your answer. Define the conjunction fallacy. How does it apply here?Assume for the purpose of illustration that the probability that someone loves to play tennis is .2; the probability that someone plays tennis once or more a week during the summer is .1; and the probability of one or the other of these things is .22.Pr(loves tennis) = .2Pr(loves tennis AND averages 1+)= Pr(loves tennis) + Pr(averages 1+) - Pr(loves tennis OR averages 1+)= .2 + .1 - .22 = .08The second probability has to be less because it has one more requirement (not only do you have to love tennis but you also have to play regularly, but some tennis lovers might just be too busy to do this). When people commit the conjunction fallacy (the belief that the joint probability is more likely than one of its components), they will think the second (joint) event is more likely because it sounds logical that someone who loves tennis will also play regularly.3. Rex is a smart fellow. He gets an A in a course 80% of the time. Still helikes his leisure, only studying for the final exam in half of the courses he takes.Nevertheless when he does study, he is almost sure (95% likely) to get an A.Assuming he got an A, how likely is it he studied? If someone estimates the above to be 75%, what error are they committing? Explain.P(studied|A) = P(A|studied) * [P(studied)/P(A)]= .95 * (.5 / .8) = .59375The “sample” is that he got an A. Without knowing this you would have said the probability that he studied was .5. You rightfully shifted the probability upwards based on the sample, but you moved it too much. You should have stayed closer to the base rate, so you have committed base weight underweighting.Another example of this is, when watching sports and noticing that someone is playing better than they normally do, believing that they have permanently improved.4. Why are two people who witnessed the same event last month likely to describeit differently today?Memory is very imprecise. The common view that past experiences have somehow been writtento the brain’s hard-drive and are then retrieved, even if at considerable effort, is not the way our brain works. In fact, memory is reconstructive. Therefore people in remembering some event will reconstruct it in different ways.5. How do gambling fallacy and clustering illusion relate to representativeness?Provide examples from sports. In what way are they different? Representativeness exists when one thinks that A should look like B. A can be the sample and B the distribution, or vice-versa. A belief in a hot hand is thinking the conditional distribution should look like the sample. But sometimes it seems that people think the reverse, namely that the sample, however small, should look like the distribution, in the sense that essential features should be shared. A hot hand often comes into play in sports when people don’t know for certain the skill level of an athlete, and the extent to which it may change. Gambler’s fallacy is likely to exist when the underlying distribution (e.g., cards or dice) is well-known.。

中级微观习题

中级微观习题

1. Jim consumes two commodities, namely garbage and punk rock video cassettes. He doesn't actually eat the former but keeps it in his backyard where it is eaten by goats and assorted vermin. The reason that he accepts the garbage is that people pay him $2 per sack for taking it. Edmund can accept as much garbage as he wishes at that price. He has no other source of income. Video cassettes cost him $6 each.(a) If Edmund accepts zero sacks of garbage, how many video cassettes can he buy? (b) If he accepts 15 sacks of garbage, how many video cassettes can he buy? (c) Write down an equation for his budget line.2. Alice likes apples and bananas, and she has strictly convex preferences.(a) Sketch an indifference curve for Alice. Will the slope of an indifference curve be positive or negative?(b) Do Randy's indifference curves get steeper or flatter as you move from left to right along one of them?3. Joan likes chocolate cake and ice cream, but after 10 slices of cake, she gets tired of cake, and eating more cake makes her less happy. Joan always prefers more ice cream to less. Joan's parents require her to eat everything put on her plate. In the axes below, use blue ink to draw a set of indifference curves that depict her preferences between plates with different amounts of cake and ice cream. Be sure to label the axes.4. Ambrose, whom you met in the last chapter, continues to thrive on nuts and berries. You saw two of his indifference curves. One indifference curve had the equation 12420x x -=, and another indifference curve had the equation12420x x -=x 1, where x 1 is his consumption of nuts and x 2 is his consumption of berries. Now it can be told that Ambrose has quasilinear utility. In fact, his preferences can be represented by the utility function 21214),(x x x x U +=(a) Ambrose originally consumed 9 units of nuts and 10 units of berries. Hisconsumption of nuts is reduced to 4 units, but he is given enough berries so that he is just as well-off as he was before. After the change, how many units of berries does Ambrose consume?(b) On the graph below, indicate Ambrose's original consumption and sketch anindifference curve passing through this point. As you can verify, Ambrose is indifferent between the bundle (9,10) and the bundle (25,2). If you doubled theamount of each good in each bundle, you would have bundles (18,20) and (50,4). Are these two bundles on the same indifference curve? (Hint: How do you check whether two bundles are indifferent when you know the utility function?)(c) What is Ambrose's marginal rate of substitution, MRS (x 1; x 2), when he is consuming the bundle (9; 10)? (Give a numerical answer.)What is Ambrose's marginal rate of substitution when he is consumingthe bundle (9; 20)?(d) We can write a general expression for Ambrose's marginal rate of substitution when he is consuming commodity bundle (x 1; x 2). what is MRS (x 1; x 2) ?5. Charlie has a utility function 2121x x ) x ;U(x , where x 1 is his consumption of apples and x 2 is his consumption of bananas. Suppose that the price of apples is $1, the price of bananas is $2, and Charlie's income is 40.(a) How many apples does he choose to buy? How many bananas?(b) If the price of bananas suddenly falls to $1, and Charlie want to consume his old consumption bundle, what does his new income have to be?(c) With this new income and the new prices, how many apples and bananas does he choose to buy?(d) What is the substitution effect and income effect?6. Mario has a small garden where he raises eggplant and tomatoes. He consumes some of these vegetables, and he sells some in the market. Eggplants and tomatoes are perfect complements for Mario, since the only recipes he knows use them together in a 1:1 ratio. One week his garden yielded 30 pounds of eggplant and 10 pounds of tomatoes. At that time the price of each vegetable was $5 per pound.(a) Please graph to show Mario ’s utility -maximizing choice. Is Mario a net buyer of eggplant.(b) Suppose that the price of tomatoes rises to $15 a pound, while the price ofeggplant stays at $5 a pound. What is Mario ’s utility -maximizing choice ? Will Mario be made better-off or worse-off by this price raise?7. A firm has two variable factors and a production function 212142),(x x x x f +=. If the price of the output good is 4, the price of factor 1 is 2, and the price of factor 2is 3, (a) Does this technology exhibit constant, increasing, or decreasing returns to scale? (b) How many units of factor 1 will the firm demand?(c) How many units of factor 2 will it demand?(d) How much output will it produce?。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

4. Utility Functions for Specific Preference 特殊偏好之效用函數
     
Part 2A. Preferences & Utility Function
Perfect Substitutes Perfect Complements CobbCobb -Douglas Utility CES Utility Homothetic Preferences QuasiQuasi -Linear Preference
2014.11.6
1


Perfect Substitutes
U(x,y) = x + y, ,  > 0
The indifference curves will be linear. The MRS will be constant along the IC. y
MU x    0
U1 U2
U3 x
MU y    0 MU x   MRS xy  MU y 
dMRS xy
dx dMU x 0 0 d dx
2
Perloff (2014, 3e, GE), Figure 3.5(a), p.95.


Perfect f Complements l
U(x,y) = min (x, y), ) ,  > 0
The ICs will be L-shaped. (Leontief Leontief) Only by choosing more of the two goods together can utility be increased. (Fixed Fixed proportions proportions) y
 , if    MRS xy  undefined, , if U3  U2  U1 , if 0  x
y   x  y   x  y   x 
3
Perloff (2014, 3e, GE), Figure 3.5(b), p.95.


CobbCobb -Douglas Utility
U(x,y) = xy, 0 < ,  < 1
The relative sizes of  and  indicate the relative importance of the goods.  1 
MU x   x
y 0
Quantity of y
MU y   x y  1  0 MU x  y MRS xy   MU y  x dMRS xy  y  0 U3 2 dx  x U2
dMU x  (  1) x  2 y   0 dx Quantity of x
U1
4


CES Utility (Constant elasticity of substitution)
U ( x, y )   x   y    , when   1,   0
1
U(x,y) = ln x + ln y, when  = 0  = 1  Perfect substitutes  = 0  Cobb-Douglas  =   Perfect complements
5


The Elasticity y of Substitution, , For the CES utility function,
 y  y d  d  x x y y 1 x x    d (dy / dx) dMRS xy 1   dy / dx MRS xy
Perfect substitutes (U = x + y),   1     Cobb-Douglas bb l (U = ln l x + ln l y), ) =0=1 Perfect complements (U = min[x, y]),       0
6


Homothetic Preferences

Definition: If the MRS depends only on the ratio of the amounts of the two g goods, , the utility y function is homothetic. i.e., The MRS can be expressed p as a function of x/y.

Perfect Substitutes U = x + y MRS = / is the same at every point.
7



Perfect Complements U(x,y) = min (x, y) MRS =  if y/x > / MRS is undefined if y/x = / MRS = 0 if y/x < /

CobbCobb -Douglas Preferences U = xy
U x  x 1 y   y MRS     1   U y  x y  x
8



Example: Nonhomothetic Preferences Some utility functions do not exhibit homothetic preferences. preferences e.g., the following quasi quasi-linear utility function. U(x,y) = ln x + y
U x 1 x 1  MRS xy    U y 1 x
Nicholson and Snyder (2012, 11e), Example 3.4 p. 101.
9


QuasiQuasi -Linear Preferences 準線性偏好

QuasiQuasi -Linear Utility Functions U(x,y) = V(x) + y
MU y  1  0
y can be viewed as a numéraire (計價單位).
MU x  MVx  0 MU x  MRS xy   MVx MU y The ICs are vertically parallel.
Perloff (2014, 3e, GE), Figure 3.6, p.97.
i i.e., E h IC h Each has th the same slope at a given x.
10

相关文档
最新文档